/* Interface e relatório: hierarquia, espaço e leitura */
:root{--blue:#1766a0;--ink:#123653;--line:#dde6ed;color:#243c4f;background:#f3f6f9;font-size:15px}body{line-height:1.5}header{padding-top:17px;padding-bottom:17px;background:#103854}main{max-width:1240px;padding-top:30px}.step{border:1px solid #e0e7ed;border-radius:16px;padding:32px;box-shadow:0 5px 22px #19364a05}.page-title{margin-bottom:22px}h1{font-size:2rem;letter-spacing:-.8px}h2{font-size:1.5rem}h3{font-size:1.08rem}nav{background:#e6edf3;margin-bottom:26px;border-radius:12px}nav button{border-radius:8px}.comparison-panel{border:0;padding:0;margin-bottom:0}.comparison-panel>p:first-of-type{max-width:84ch;margin-bottom:24px}.current-regime{max-width:470px;display:block;margin:22px 0}.current-regime select{margin-top:8px}.current-regime small{display:block;margin-top:6px}.activity-row{background:#f7f9fb;border:1px solid var(--line);border-radius:10px;padding:16px;gap:14px}#allocation-total{border:0;border-radius:8px;margin:14px 0;font-weight:600}.info{border-radius:0 9px 9px 0}.field-reference{background:#f7f9fb;border:1px solid #e6ecf1;padding:10px 12px}.field-reference small{font-size:.78rem}.field-reference button{background:white;font-weight:500}.check{padding:15px 18px;margin-bottom:16px}.view-switch{display:flex;gap:6px;background:#edf2f6;padding:5px;border-radius:10px;width:fit-content;margin-bottom:28px}.view-switch button{background:transparent;color:#4f6577;font-size:.9rem}.view-switch button[aria-pressed=true]{background:white;color:var(--ink);box-shadow:0 1px 5px #163e5415}.optional-panel{margin:26px 0;border:1px solid var(--line);border-radius:10px;padding:16px 20px}.optional-panel>summary{font-size:1rem}.optional-panel[open]>summary{margin-bottom:20px}.report-actions{display:flex;justify-content:space-between;gap:12px;margin-bottom:28px}.report-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:18px}.report-heading h2{font-size:1.9rem;letter-spacing:-.65px;margin-bottom:8px}.report-meta{display:flex;flex-wrap:wrap;gap:8px 24px;padding:16px 0;color:#536779;font-size:.82rem;border-bottom:1px solid var(--line)}.report-scope{font-size:.9rem;margin:18px 0}.report-hero{display:grid;grid-template-columns:1.1fr 1fr;gap:24px;background:#103854;color:white;border-radius:14px;padding:26px 30px;margin:24px 0 12px}.report-hero span{color:#c6d9e8;font-size:.85rem;display:block}.report-hero h3{font-size:1.6rem;margin:6px 0}.report-hero strong{font-size:2rem;letter-spacing:-.7px;display:block}.report-hero p{color:#e4eef5;font-size:.85rem;margin:8px 0 0}.report-hero>div:last-child{text-align:right}.report-limit{border-left:3px solid #cd9a41;background:#fffaef;padding:12px 16px;font-size:.85rem;color:#67522e;margin:14px 0 24px}.regime-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:24px 0 30px}.regime-card{border:1px solid var(--line);border-radius:12px;padding:20px;background:white;break-inside:avoid}.regime-card.best{border-color:#7eb6d5;background:#f2f8fc}.card-top{display:flex;flex-direction:column;align-items:flex-start;gap:8px;min-height:66px}.regime-card p{font-size:.8rem;min-height:42px}.regime-value{font-size:1.65rem;display:block;letter-spacing:-.6px;margin:14px 0 5px;color:var(--ink);overflow-wrap:anywhere}.regime-card>span{font-size:.85rem;color:#526b7e}.regime-card meter{display:block;width:100%;height:10px;margin-top:18px;appearance:none}.regime-card meter::-webkit-meter-bar{background:#e3ecf3;border:0;border-radius:8px}.regime-card meter::-webkit-meter-optimum-value{background:#829bad}.regime-card.best meter::-webkit-meter-optimum-value{background:#2476ac}.report-section{border:1px solid var(--line);border-radius:12px;padding:24px;margin:24px 0}.report-section>h3,.report-section>summary{margin-bottom:12px;color:var(--ink);font-size:1.1rem}.report-section p{font-size:.86rem;margin-bottom:16px}.report-section table{font-size:.83rem}.report-section td{font-variant-numeric:tabular-nums}.report-section td:not(:first-child),.report-section th:not(:first-child){text-align:right}.report-section td{white-space:normal!important}.report-section th{white-space:normal}.report-section th:first-child{width:30%}.report-warnings{padding-left:22px;columns:2;column-gap:34px}.report-warnings li{break-inside:avoid;font-size:.83rem;line-height:1.6;margin:0 0 12px;color:#536779}.report-footnote{font-size:.78rem;border-top:1px solid var(--line);padding-top:20px}.review-extras{grid-column:1/-1;margin:0}.review-extras>summary{color:#536779}.context-line{display:flex;flex-wrap:wrap;gap:8px 20px;color:#536779;font-size:.82rem;margin:-6px 0 18px}.context-line strong{color:var(--ink)}button{transition:background .15s,border-color .15s}button:hover{filter:brightness(.97)}input[aria-invalid=true]{border:2px solid #bc4949}input,select{border-radius:8px}#message{position:sticky;top:12px;z-index:5;box-shadow:0 4px 15px #604d1010}#review-summary .metric strong{font-size:1.4rem}.actions{gap:14px}.source-options button{flex:1}.brand small{font-size:.75rem}.local-badge{font-size:.75rem}
@media(max-width:960px){.regime-cards{grid-template-columns:1fr}.card-top{min-height:0;flex-direction:row;justify-content:space-between}.regime-card p{min-height:0}.regime-value{font-size:1.8rem}.report-warnings{columns:1}}
@media(max-width:760px){main{padding:20px 12px}.step{padding:22px 16px}.report-heading,.report-hero{display:block}.report-heading .tag{display:inline-block;margin-top:10px}.report-hero{padding:22px}.report-hero>div:last-child{text-align:left;margin-top:20px}.report-actions{flex-wrap:wrap}.report-section{padding:18px 12px}.report-heading h2{font-size:1.55rem}.view-switch{width:100%}.view-switch button{flex:1}.activity-row{padding:12px}nav{grid-template-columns:repeat(3,minmax(0,1fr))}nav button{font-size:.72rem;padding:10px 6px;text-align:center}nav b{display:block;margin:0 auto 5px}.page-title h1{font-size:1.7rem}.regime-cards{gap:12px}.table-scroll{max-width:100%}.report-section table{min-width:510px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
@media print{
 @page{size:A4;margin:14mm 12mm}body.printing-report{background:white;font-size:10pt;-webkit-print-color-adjust:exact;print-color-adjust:exact}body.printing-report header,body.printing-report nav,body.printing-report .page-title,body.printing-report footer,body.printing-report #message,body.printing-report .context-line,body.printing-report #scenario>.section-heading,body.printing-report .view-switch,body.printing-report #scenario-settings,body.printing-report .report-actions{display:none!important}body.printing-report main{max-width:none;padding:0}body.printing-report #scenario{padding:0;border:0;box-shadow:none}body.printing-report .report-heading h2{font-size:22pt}body.printing-report .report-section{padding:14px;margin:16px 0;overflow:visible}body.printing-report .regime-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}body.printing-report .regime-card{padding:12px}body.printing-report .regime-value{font-size:15pt}body.printing-report .card-top{min-height:46px;display:block}body.printing-report .card-top h3{font-size:10pt}body.printing-report .tag{font-size:8pt;white-space:normal}body.printing-report .report-section table{min-width:0;font-size:9pt}body.printing-report th,body.printing-report td{padding:8px 6px}body.printing-report .table-scroll{overflow:visible}body.printing-report thead{display:table-header-group}body.printing-report tr,body.printing-report .metric,body.printing-report .report-hero{break-inside:avoid}body.printing-report h3,body.printing-report summary{break-after:avoid}body.printing-report .report-warnings{columns:1}body.printing-report details>*{display:block}body.printing-report details>.table-scroll{display:block}body.printing-report .report-meta{font-size:8pt}body.printing-report .metrics{gap:8px}body.printing-report .metric{padding:12px}body.printing-report .metric strong{font-size:13pt}body.printing-report .report-limit{font-size:9pt}
}
#calculate-extra-only{margin:10px 0 10px 12px}@media(max-width:760px){#calculate,#calculate-extra-only{display:block;width:100%;margin:10px 0}}

/* Fluxo guiado: entrada, conferência e preparação do relatório */
@media screen {
 :root{--blue:#166b78;--ink:#173f50;--line:#dce6e9;background:#f3f6f6;color:#233f4b}
 header{background:#153e4c;padding-top:14px;padding-bottom:14px}.brand>span{padding:10px;border-radius:10px}.local-badge{border-color:#537780;color:#e1edf0}
 main{max-width:1200px;padding-top:32px}.page-title h1{font-size:1.85rem;letter-spacing:-.65px;max-width:700px}.page-title>div>p:last-child{font-size:.95rem}.eyebrow{color:#286f7b}
 nav{padding:6px;gap:6px;background:#e6eeee}nav button{position:relative;padding:16px 18px;color:#526971}nav button small{display:block;margin:5px 0 0 35px;font-size:.76rem;color:#5b737c;font-weight:400}nav button[aria-current]{box-shadow:0 2px 6px #163c5010}nav button[aria-current] b{background:#166b78}
 .context-line{font-size:.84rem;gap:10px 18px}.context-line strong{padding-right:18px;border-right:1px solid #bacdd1}
 .step{border-radius:16px;padding:32px 36px;box-shadow:0 5px 24px #163c5005}.section-heading{padding-bottom:22px;border-bottom:1px solid var(--line);margin-bottom:26px}.section-heading p{margin-bottom:0}
 h2{font-size:1.4rem}h3{font-size:1.05rem}label{font-size:.9rem;font-weight:600}input,select{border-color:#b8cbd0;min-height:46px;border-radius:8px;margin-top:5px}input::placeholder{color:#72858d;font-size:.85rem}.form-grid{gap:22px 26px;align-items:start}.form-grid label{gap:4px}small,.small{color:#586e78}
 .primary{background:#166b78;box-shadow:0 2px 3px #17475314}.primary:hover{background:#105562}.secondary{background:white;border-color:#c6d6da;color:#275968}.source-intro>p,.section-description{font-size:.88rem;margin:7px 0 22px;max-width:85ch}.source-options{gap:16px;margin-top:18px;margin-bottom:24px}.source-options button{display:flex;align-items:center;text-align:left;gap:14px;padding:20px;background:#fff;border-radius:12px}.source-options button.selected{padding:19px;background:#f0f8f7;border-color:#217582;color:#154f5a}.source-options small{display:block;font-weight:400;margin-top:4px}.source-icon{display:grid;place-items:center;flex-shrink:0;background:#e9f1f2;border-radius:10px;width:40px;height:40px;font-size:.85rem;color:#3a6d76}
 .upload{border-color:#90b6bc;background:#f6faf9;border-radius:12px;padding:30px 20px}.file-button{background:#166b78}.form-section{margin:28px 0;padding:24px;border:1px solid var(--line);border-radius:12px;background:white}.form-section>.form-grid{margin:0}.form-section>label:not(.check){display:block;max-width:580px}.form-section>.check{margin:20px 0 0}.form-section>.info{background:#f7fafb;border:0;border-top:1px solid var(--line);border-radius:0;padding:24px 0 0;margin-top:24px}.info{background:#f2f7f8;border-left-color:#418793}.check{background:#f5f8fa;border-color:#d8e4e8;font-size:.87rem;align-items:start}.check input{accent-color:#166b78;flex-shrink:0}.field-reference{background:#f7faf9;border-color:#e0e9e7;padding:12px}.field-reference button{border:1px solid #c9dcda;color:#265e65}
 #movement{margin-top:26px}#movement>.section-heading{border:0;padding-bottom:0}.current-regime{max-width:440px}.activity-row{background:#f6f9fa;border-color:#dce7e9}.comparison-panel>p{font-size:.9rem}.optional-panel{background:#fafcfc;padding:18px 22px}.optional-panel summary{color:#365b68}.optional-panel summary .optional{margin-left:10px}.simulation-actions{padding:22px 0;border-top:1px solid var(--line);margin-top:30px}.simulation-actions p{font-size:.88rem;max-width:380px;margin:0}.simulation-actions .primary{padding:14px 22px}.view-switch{background:#eaf1f2}
 #audit-filters .toolbar{gap:18px}.metric{background:#fafcfc;border-color:#dce6e9;padding:20px}.metric strong{font-variant-numeric:tabular-nums}.table-scroll{border:1px solid var(--line);border-radius:10px}th{background:#eef4f5}tbody tr:hover{background:#f6fafa}td{padding:16px 12px}#audited-results .metric{background:#f0f8f4;border-color:#a6cbb7}#review-controls{padding:22px}#review-controls>.form-grid{margin-top:0}
 .message-dismiss{display:block;margin:-10px 0 20px auto;background:transparent;color:#795b18;font-size:.8rem;padding:6px 10px}#message{position:static;margin-bottom:14px}.report-hero{background:#153e4c}.regime-card.best{background:#f0f8f6;border-color:#92beb3}.tag{background:#eaf3f3;color:#235967}
 @media(max-width:760px){main{padding:22px 12px}.step{padding:22px 16px}.page-title h1{font-size:1.65rem}nav{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}nav button{padding:12px 5px;font-size:.72rem}nav button small{display:none}nav b{display:block;margin:0 auto 6px}.form-section{padding:18px 14px;margin:22px 0}.form-grid{gap:20px}.source-options button,.source-options button.selected{padding:16px}.simulation-actions{flex-direction:column;align-items:stretch}.simulation-actions .primary{margin-left:0!important;width:100%}.section-heading{gap:14px}.optional-panel{padding:16px 14px}.optional-panel summary .optional{display:block;margin-left:0}.report-actions button{flex:1;min-width:140px}.context-line strong{border-right:0}.activity-row{grid-template-columns:1fr}.activity-row label:first-child{grid-column:auto}#review-controls{padding:16px}#selection-actions button{width:100%}.actions>button{min-height:44px}}
}
@media screen{.brand small{color:#d6e6e9;opacity:1}}
/* Pares relacionados compartilham a mesma linha; opções booleanas ficam fora da grade. */
.period-pair{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:26px;align-items:start}
.taxpayer-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px 18px;border-top:1px solid var(--line);padding-top:18px;margin-top:22px}
.taxpayer-check{display:inline-flex;align-items:center;gap:10px;cursor:pointer;flex-shrink:0}
.taxpayer-check input{width:20px;height:20px;min-height:20px;margin:0;accent-color:#166b78}
.taxpayer-row>small{flex:1;min-width:180px}.taxpayer-row button{font-size:.8rem;padding:8px 12px}
.field-wide{grid-column:1/-1}.form-grid>label,.period-pair>label{min-width:0}
@media(max-width:760px){.period-pair{gap:12px}.period-pair input{padding:10px 6px;font-size:.82rem}.taxpayer-row{align-items:flex-start}.taxpayer-row>small{flex-basis:100%}.taxpayer-row button{width:auto}}

/* Salvamento autenticado no Supabase */
.cloud-open{cursor:pointer;background:#ffffff0b}.cloud-open:hover{background:#ffffff18}.cloud-open:focus-visible{outline:3px solid #8ccbd2;outline-offset:3px}
.access-shell{min-height:calc(100vh - 76px);display:grid;grid-template-columns:minmax(0,1.05fr) minmax(360px,.7fr);align-items:center;gap:clamp(40px,8vw,110px);max-width:1120px;margin:auto;padding:60px 28px}.access-brand h1{font-size:clamp(2.3rem,5vw,4.2rem);line-height:1.04;max-width:760px;margin:12px 0 22px;color:var(--ink);letter-spacing:-2px}.access-brand>p{font-size:1.08rem;max-width:620px}.access-brand ul{display:grid;gap:12px;margin:30px 0 0;padding:0;list-style:none;color:#416173}.access-brand li::before{content:'✓';display:inline-grid;place-items:center;width:24px;height:24px;margin-right:10px;border-radius:50%;background:#dcefeb;color:#176b68;font-weight:800}.access-card{background:white;border:1px solid var(--line);border-radius:18px;padding:28px;box-shadow:0 18px 60px #173d5015}.access-tabs{display:grid;grid-template-columns:1fr 1fr;background:#edf2f5;padding:5px;border-radius:10px;margin-bottom:28px}.access-tabs button{background:transparent;color:#627680;font-size:.86rem}.access-tabs button.selected{background:white;color:var(--ink);box-shadow:0 2px 8px #173d5012}.access-card form{display:grid;gap:16px}.access-card form>p{margin:0 0 4px}.access-card label{display:grid;gap:7px;font-size:.87rem;font-weight:650;color:var(--ink)}.access-card form>.primary{margin-top:4px;min-height:48px}.request-result{background:#eaf6f3;border:1px solid #a9d5cb;border-radius:8px;padding:13px;color:#285e55!important;font-size:.85rem}
.auth-link-error{background:#fff4dc;border:1px solid #e5c472;border-radius:8px;padding:13px 14px!important;color:#6d5013!important;font-size:.85rem;margin:0 0 20px!important}
.request-result.error{background:#fff0ee;border-color:#e2aaa2;color:#7b3028!important}
#cloud-dialog{width:min(760px,calc(100vw - 28px));max-height:88vh;border:0;border-radius:16px;padding:26px;box-shadow:0 24px 80px #0b293a55;color:#233f4b}
#cloud-dialog::backdrop{background:#102f3db5}.cloud-head,.cloud-account-line,.cloud-list-head{display:flex;justify-content:space-between;align-items:center;gap:18px}.cloud-head{margin-bottom:22px}.cloud-head h2{margin-top:4px}.cloud-account-line{padding:12px 0 20px;border-bottom:1px solid var(--line)}.cloud-save{padding:24px 0;border-bottom:1px solid var(--line)}.cloud-save label{display:block;margin-top:14px}.cloud-list-head{margin:22px 0 12px}.cloud-list-head button{font-size:.8rem;padding:8px 12px}#cloud-list{display:grid;gap:9px}.cloud-item{display:flex;flex-direction:column;align-items:flex-start;text-align:left;background:#f5f9f9;border:1px solid var(--line);padding:14px 16px;color:#244753}.cloud-item:hover{border-color:#72a8ad;background:#eff7f6}.cloud-item span,.cloud-item small{display:block;font-weight:400;margin-top:4px}.cloud-item small{color:#677c84}
@media(max-width:760px){.access-shell{grid-template-columns:1fr;padding:34px 18px;gap:32px}.access-brand h1{font-size:2.35rem;letter-spacing:-1.2px}.access-brand ul{display:none}.access-card{padding:22px 18px}#cloud-dialog{padding:20px 16px}.cloud-head{align-items:flex-start}.cloud-account-line{align-items:flex-start;flex-direction:column}.cloud-open{display:block;font-size:.72rem}}
