/* Mobile first. A tablet rail and a desktop sidebar share existing handlers. */
:root{--brand:#6B3BD1;--brand2:#7C3AED;--brand-lt:#F0E9FD;--bg:#F6F4FB;--gold:#D7A932}
#app-screen{padding-bottom:0}.topbar{padding:0}.tb-inner{margin:auto;max-width:none;padding:16px 24px}.panel,.panel:not(#p-resumo){width:100%;min-width:0;max-width:1600px;padding:24px 28px 40px}.panel:not(#p-resumo){max-width:1150px}.overview-grid>*{min-width:0}.overview-grid{gap:20px}.card{height:auto}.page-heading h2{font-size:clamp(24px,2.2vw,34px)}.overview-actions{display:flex;gap:12px;align-items:center;margin:0 0 22px}.overview-actions button{min-height:48px;font-size:16px}.overview-actions svg{width:22px;height:22px}.overview-actions .action-main{display:flex;gap:10px;align-items:center;padding:14px 22px;background:linear-gradient(110deg,#6B3BD1,#7C3AED);box-shadow:0 5px 16px #6B3BD122}.overview-actions .btn-sm{background:white;border:1px solid var(--border);padding:12px 20px}.hero{background:white;color:var(--text);border:1px solid var(--border);box-shadow:var(--shadow)}.hero-amount{color:var(--green)}.hero.negative{background:var(--red-lt)}.hero.negative .hero-amount{color:var(--red)}.hero-foot{color:var(--text2)}.hero-register{background:var(--brand-lt);color:var(--brand);min-height:44px}.category-visual{display:block;padding:0 0 16px}.category-donut{display:none}.legend-row{display:block;font-size:14px;padding:10px 0}.legend-heading{display:flex;gap:12px;align-items:center;justify-content:space-between}.legend-heading strong{margin-left:auto;white-space:nowrap}.legend-heading small{color:var(--text2);min-width:36px;text-align:right}.category-bar{height:9px;background:#F0ECF8;border-radius:20px;overflow:hidden;margin-top:10px}.category-bar span{display:block;height:100%;border-radius:20px}.sh-title{font-size:16px}.muted-note,.tx-desc,.lesson-card p{font-size:14px}.btn-sm,.goal-actions button,.marrow{min-height:44px}.tx{gap:12px}.tx-meta,.hero-label,.stat-label{font-size:14px}.thermo-main small,.hero-foot{font-size:12px}.thermo-main p{font-size:14px}.forma-tools{max-width:none;margin:0;padding:12px 24px;align-items:center}.forma-tools button{min-height:44px;font-size:14px}.forma-tools #forma-admin-button{display:flex;align-items:center;gap:12px;background:linear-gradient(120deg,#30205D,#6B3BD1);color:white;border:1px solid #8060BA;border-radius:15px;padding:12px 18px;text-align:left;box-shadow:0 5px 15px #30205D18}.forma-tools #forma-admin-button svg{width:24px;height:24px;flex-shrink:0}.forma-tools #forma-admin-button span{font-weight:700;font-size:14px}.forma-tools #forma-admin-button small{display:block;font-size:12px;font-weight:400;color:#E7DDFB;margin-top:3px}.forma-brand small{font-size:12px}.admin-dialog{width:min(1280px,calc(100% - 40px));padding:30px;background:#FCFBFF}.admin-heading{position:sticky;top:-30px;z-index:2;background:#FCFBFF;padding:16px 0}.admin-metrics article{background:white}.admin-thermo{background:#F4EEFE;border-color:#E5D7FA}.admin-meter{background:#E7DDF8}.admin-meter span{background:linear-gradient(90deg,#6B3BD1,#A88AE8)}.admin-dialog table{font-size:14px}.admin-dialog th{white-space:nowrap}.admin-dialog td{vertical-align:top}.evidence-bar{font-size:14px}.evidence-bar>span{width:125px}.evidence-bar strong{min-width:30px}.evidence-track{height:13px}.admin-tabs button,.admin-controls button{min-height:44px;font-size:14px}.forma-dialog label{font-size:14px}.journey span{font-size:13px}.guide-card h3{font-size:18px}.goal-track{height:9px}.learn-preview{background:#FFF9EA;border-color:#F0E4C7}.learn-preview .lesson-label{color:#8D6510}.learn-preview .btn-sm{color:#805A10}.page-heading,.sh{flex-wrap:wrap}.history-group-head{flex-wrap:wrap}.install-banner{max-width:540px;left:50%;transform:translateX(-50%);width:calc(100% - 24px)}
@media(min-width:1200px){
 #app-screen{padding-left:228px}#bnav{left:0;top:0;bottom:0;right:auto;transform:none;width:228px;border-radius:0;border:0;display:flex;flex-direction:column;justify-content:flex-start;gap:8px;padding:130px 18px 24px;background:linear-gradient(175deg,#432779,#6B3BD1);box-shadow:none}#bnav::before{content:'FORMÁ';position:absolute;top:48px;left:28px;font:800 30px Sora,sans-serif;color:white}#bnav .nb{flex:0 0 auto;flex-direction:row;justify-content:flex-start;gap:14px;padding:14px 16px;min-height:54px;color:#F0E9FF;border-radius:13px}#bnav .nb.active{background:#FFFFFF25;color:white}#bnav .ni{margin:0}#bnav .nl{font-size:15px;letter-spacing:0;text-transform:none}#bnav .nb:hover{background:#FFFFFF18}.overview-grid{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr)}.hero{grid-column:1;grid-row:1}.finance-stats{grid-column:2 / 4;grid-row:1}.finance-stats .stat{display:flex;flex-direction:column;justify-content:center}.stat-val{font-size:clamp(24px,2.4vw,36px)}.thermometer-card{grid-column:2;grid-row:2}.category-card{grid-column:1;grid-row:2 / 4}.savings-card{grid-column:3;grid-row:2}.learn-preview{grid-column:3;grid-row:3}.plan-card{grid-column:2;grid-row:3}.recent-card{grid-column:1 / 3}.overview-grid #chart-card{grid-column:3}.thermo-main{flex-direction:column;align-items:flex-start;gap:18px}.thermo-ring{align-self:center}.overview-actions{justify-content:flex-end}.guide-card{padding:18px 22px}.panel:not(#p-resumo){padding-top:32px}.modal{max-width:740px;border-radius:24px}.numpad-sheet,.tx-detail-sheet{border-radius:24px 24px 0 0}.tx-amt{font-size:16px}.forma-tools{padding-bottom:0}
}
@media(min-width:768px) and (max-width:1199px){
 #app-screen{padding-left:108px}#bnav{left:0;top:0;bottom:0;right:auto;transform:none;width:108px;border-radius:0;border:0;border-right:1px solid var(--border);display:flex;flex-direction:column;justify-content:flex-start;gap:10px;padding:104px 8px 20px;background:white;box-shadow:none}#bnav::before{content:'FORMÁ';position:absolute;top:38px;width:100%;left:0;text-align:center;font:800 17px Sora,sans-serif;color:var(--brand)}#bnav .nb{flex:0 0 auto;min-height:72px;gap:8px;padding:12px 4px}#bnav .nl{font-size:13px;letter-spacing:0;text-transform:none}.panel,.panel:not(#p-resumo){padding:22px 20px 32px}.overview-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.hero{grid-column:1;grid-row:1}.finance-stats{grid-column:1;grid-row:2}.thermometer-card{grid-column:2;grid-row:1 / 3}.category-card{grid-column:1;grid-row:3 / 5}.savings-card{grid-column:2;grid-row:3}.learn-preview{grid-column:2;grid-row:4}.thermo-main{flex-direction:column;align-items:flex-start}.thermo-ring{align-self:center}.card{padding:18px}.hero-amount{font-size:34px}.stat{padding:15px}.stat-val{font-size:22px}.page-heading{gap:12px}.guide-card{padding:18px}.modal{max-width:680px;border-radius:24px}.admin-dialog{width:calc(100% - 32px)}
}
@media(max-width:767px){
 #app-screen{padding-bottom:calc(80px + env(safe-area-inset-bottom,0px))}.tb-inner{padding:12px 14px}.forma-brand strong{font-size:14px}.forma-brand small{font-size:10px}.forma-brand img{width:38px;height:38px}.tb-info h1{max-width:95px;font-size:12px}.tb-info p{display:none}.tb-avatar{display:none}.tb-logout{width:44px;height:44px}.panel,.panel:not(#p-resumo){padding:20px 16px 30px}.page-heading{gap:14px;align-items:flex-start}.page-heading>div:first-child{width:100%}.page-heading h2{font-size:26px}.page-heading p{font-size:14px}.page-heading .mnav{width:100%}.mnav h2{font-size:15px}.overview-actions{display:grid;grid-template-columns:1fr auto;gap:8px}.overview-actions .action-main{padding:14px 12px;justify-content:center;font-size:15px}.overview-actions .btn-sm{padding:12px;font-size:14px}.overview-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:16px}.overview-grid>*{grid-column:auto;grid-row:auto}.hero{order:0}.finance-stats{order:1}.thermometer-card{order:2}.category-card{order:3}.savings-card{order:4}.learn-preview{order:5}.recent-card{order:6}.plan-card{order:7}.overview-grid #chart-card{order:8}.hero{padding:22px}.hero-amount{font-size:36px}.card{padding:20px}.stat{padding:16px}.stat-val{font-size:24px}.thermo-ring{height:108px;width:108px}.thermo-ring>div{height:88px;width:88px}.thermo-ring strong{font-size:26px}.thermo-main{gap:16px}.thermo-main h3{font-size:16px}.thermo-ring span{font-size:10px}.guide-card{padding:18px;gap:12px}.guide-card .action-main{width:100%;min-height:46px}.journey{flex-wrap:wrap}.journey span{flex:1 1 40%;font-size:12px}.forma-tools{padding:10px 16px;gap:8px;flex-wrap:wrap}.forma-tools #forma-admin-button{padding:10px 13px}#bnav{left:0;right:0;bottom:0;transform:none;width:100%;border-radius:18px 18px 0 0;padding:8px 4px calc(8px + env(safe-area-inset-bottom,0px));gap:0}#bnav .nb{min-height:54px;padding:7px 2px;gap:6px}#bnav .nl{font-size:10px;text-transform:none;letter-spacing:0}#bnav .ni svg{width:22px;height:22px}.admin-dialog{width:calc(100% - 16px);max-height:94dvh;padding:20px 16px}.admin-heading{top:-20px}.admin-heading h2{font-size:22px}.admin-metrics{grid-template-columns:1fr}.admin-metrics article{padding:16px}.evidence-charts{grid-template-columns:1fr}.evidence-charts section{padding:16px}.evidence-bar>span{width:100px}.admin-tabs{gap:7px}.admin-tabs button{flex:1 1 40%;font-size:13px}.evidence-note{font-size:14px}.voice-card{padding:22px 16px}.voice-main{min-height:60px}.reg-amount-display{font-size:clamp(38px,12vw,58px)}.sh-title{font-size:15px}.tx-amt{font-size:14px}.goal-item{overflow-wrap:anywhere}.modal{padding:24px 16px}.install-banner{bottom:calc(86px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:350px){.thermo-main{flex-direction:column;align-items:flex-start}.overview-actions{grid-template-columns:1fr}.tb-info{display:none}.stat-val{font-size:21px}.legend-heading{gap:6px}.legend-heading strong{font-size:13px}.legend-name{overflow-wrap:anywhere}.panel,.panel:not(#p-resumo){padding-left:12px;padding-right:12px}.card{padding:16px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
.page-heading .mnav h2{font:600 15px 'DM Sans',sans-serif;letter-spacing:0;margin:0;min-width:120px}
@media(min-width:768px){.guide-card .journey{padding-top:8px}.guide-card{gap:10px;padding:16px 20px}.guide-card h3{font-size:16px}.page-heading{margin-bottom:16px}.overview-actions{margin-bottom:16px}}
/* Full working pages: administration stays inside the application shell. */
.panel.admin-workspace{width:100%;max-width:none;margin:0;max-height:none;overflow:visible;border-radius:0;border:0;box-shadow:none;background:var(--bg);padding:24px 28px 48px;min-height:75dvh}
.admin-workspace .admin-heading{position:static;background:transparent;padding:0;margin-bottom:24px}.admin-workspace .admin-heading button{width:auto;height:auto;min-height:44px;border:1px solid var(--border);border-radius:12px;padding:12px 18px;font-size:14px;background:white}.admin-workspace .admin-tabs{position:sticky;top:0;background:var(--bg);z-index:3;padding:12px 0;margin:0 0 20px}.admin-workspace .admin-table-wrap{border:1px solid var(--border);border-radius:16px;background:white}.admin-workspace .admin-metrics{gap:20px}.admin-workspace .evidence-charts section{background:white}.admin-workspace #admin-status{font-size:14px;color:var(--text2)}.admin-workspace #admin-roster td:first-child{font-weight:700}.admin-workspace .admin-controls{justify-content:space-between;max-width:600px}.admin-workspace [data-close]:focus-visible,.editor-back:focus-visible{outline:3px solid #A88BE5;outline-offset:3px}
.editor-workspace{background:var(--bg);align-items:flex-start;overflow-y:auto;overscroll-behavior:contain;animation:none;padding:0}
.editor-workspace .editor-surface{width:100%;max-width:none;min-height:100%;max-height:none;overflow:visible;border-radius:0;box-shadow:none;background:var(--bg);margin:0;padding:24px 28px 48px}
.editor-heading{display:flex;align-items:center;gap:20px;margin:0 0 24px;padding:12px 0;flex-wrap:wrap}.editor-heading h2{font:700 24px Sora,sans-serif;margin:0}.editor-back{background:white;border:1px solid var(--border);border-radius:12px;padding:12px 18px;min-height:44px;color:var(--brand);font:600 14px 'DM Sans',sans-serif;cursor:pointer}
.editor-workspace .fld{min-width:0}.editor-workspace .modal-title{font-size:20px}.editor-workspace .modal-sub{font-size:15px}.editor-workspace .inp-simple{background:white;min-height:48px}.editor-workspace .tx-detail-handle{display:none}.editor-workspace .tx-detail-rows,.editor-workspace .tx-detail-actions{max-width:960px;margin-left:auto;margin-right:auto}.editor-workspace .btn-primary,.editor-workspace .btn-cancel,.editor-workspace .save-btn{min-height:48px;font-size:16px}.editor-workspace .btn-cancel{background:white;border:1px solid var(--border);color:var(--text2);margin-top:12px}.editor-workspace .orc-group{background:white;break-inside:avoid;margin:0;height:fit-content}.editor-workspace .orc-group summary{min-height:44px;font-size:16px}.editor-workspace #orc-cats{display:grid;gap:16px}.editor-workspace #orc-live,.editor-workspace #custom-budget-tools{grid-column:1/-1}.editor-workspace .orc-totals{top:0;background:#F0E9FD;z-index:2;padding:16px;border-color:#DCCCF5}.editor-workspace .orc-input{font-size:16px;min-height:44px}.editor-workspace #budget-save-status{font-size:14px!important;padding:16px;background:white;border-radius:12px}.editor-workspace .event-row{font-size:14px}.panel:not(#p-resumo):not(#p-registrar){max-width:none}.section-head{flex-wrap:wrap;gap:12px}.section-head .btn-sm{min-height:44px}.goal-item .goal-actions button,.lesson-card button{min-height:44px;font-size:14px}.lesson-card{margin:0;background:white;padding:22px}.lesson-card summary{font-size:16px;line-height:1.5;min-height:44px}.goal-item{margin:0;padding:22px;background:white}.goal-actions{gap:10px}.goal-item .event-row{flex-wrap:wrap}.annual-row{min-width:0}.editor-workspace .voice-main{max-width:960px;margin-left:auto;margin-right:auto}
@media(min-width:1200px){.editor-workspace{left:228px}.editor-workspace #orc-cats{grid-template-columns:repeat(3,minmax(0,1fr))}#goals-list,#learning-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;align-items:start}.editor-workspace:not(#orc-overlay) .editor-surface{padding:32px max(28px,calc((100% - 1100px)/2)) 48px}#p-registrar{max-width:1200px}.manual-register[open]{background:white;padding:24px}.editor-workspace .fld{margin-bottom:18px}.admin-workspace .evidence-charts{gap:24px}.admin-workspace .admin-metrics strong{font-size:38px}.admin-workspace .admin-table-wrap table{min-width:1100px}.editor-workspace .tx-detail-actions{gap:16px}}
@media(min-width:768px) and (max-width:1199px){.editor-workspace{left:108px}.editor-workspace #orc-cats{grid-template-columns:repeat(2,minmax(0,1fr))}#goals-list,#learning-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:start}.panel.admin-workspace{padding:24px 20px 40px}.admin-workspace .admin-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.admin-workspace .evidence-charts{grid-template-columns:1fr}.editor-workspace .editor-surface{padding:24px 20px 40px}}
@media(max-width:767px){.panel.admin-workspace{padding:20px 16px 32px}.admin-workspace .admin-heading{align-items:flex-start;gap:12px;flex-wrap:wrap}.admin-workspace .admin-heading h2{font-size:24px}.admin-workspace .admin-tabs{top:0}.editor-workspace .editor-surface{padding:16px 16px calc(32px + env(safe-area-inset-bottom,0px))}.editor-heading{gap:12px;margin-bottom:18px}.editor-heading h2{font-size:20px}.editor-workspace #orc-cats{grid-template-columns:1fr}#goals-list,#learning-list{display:grid;grid-template-columns:1fr;gap:16px}.editor-workspace .orc-totals{position:static}.editor-workspace .orc-row{gap:8px}.editor-workspace .orc-label{min-width:0;overflow-wrap:anywhere}.editor-workspace .orc-input{max-width:100px}.admin-workspace .admin-metrics{grid-template-columns:1fr}.admin-workspace .admin-heading button{width:100%;text-align:center}#nb-admin .nl{font-size:9px}#nb-admin .nl{overflow-wrap:anywhere}.editor-workspace .tx-detail-amt{font-size:36px}.admin-workspace .admin-controls{gap:12px}.goal-item,.lesson-card{padding:18px}}
/* Categories flow independently so collapsed groups leave no empty grid rows. */
.editor-workspace #orc-cats{display:block;columns:1;column-gap:16px}.editor-workspace #orc-cats .orc-group{display:inline-block;width:100%;margin:0 0 16px;vertical-align:top}.editor-workspace #orc-live,.editor-workspace #custom-budget-tools{column-span:all;margin-bottom:18px}.editor-workspace #orc-live{position:static}.editor-workspace .editor-heading{position:sticky;top:-24px;background:var(--bg);z-index:4}
@media(min-width:1200px){.editor-workspace #orc-cats{columns:3}}
@media(min-width:768px) and (max-width:1199px){.editor-workspace #orc-cats{columns:2}}
@media(max-width:767px){.editor-workspace .editor-heading{top:-16px}}
.editor-workspace #orc-cats{columns:auto}.budget-columns{display:grid;gap:16px;align-items:start}.budget-column{display:flex;flex-direction:column;gap:16px;min-width:0}.editor-workspace #orc-cats .budget-column .orc-group{display:block;margin:0;width:100%}.editor-workspace #custom-budget-tools{margin-top:20px}
