:root{--chart1:#8bd5ff;--chart2:#e6bc69;--chart3:#a9e5b5;--chart4:#e5b3f7;--chart5:#ffa99b;--chart6:#b7c6ff;--ink:#f0eee8}
html[data-theme=light]{color-scheme:light;color:#202833;background:#f2f3f5;--ink:#202833;--gold:#74500c;--line:#c5cbd2;--muted:#505c69;--panel:#fff;--chart1:#00669c;--chart2:#825608;--chart3:#23713b;--chart4:#80419d;--chart5:#b33a28;--chart6:#3d4aa0}
html[data-theme=light] header{background:#fff;border-color:#b9a575}
html[data-theme=light] button,html[data-theme=light] .button{background:#f0eee8;color:#27303a;border-color:#a59c88}
html[data-theme=light] button:hover{background:#e2dfd5;border-color:#74500c}
html[data-theme=light] .primary,html[data-theme=light] nav button.active{background:#e2c17e;color:#211a0b;border-color:#927126}
html[data-theme=light] label{color:#303b49}
html[data-theme=light] input,html[data-theme=light] select{background-color:#fff;color:#202833;border-color:#798592;color-scheme:light}
html[data-theme=light] th{background:#eee8dc;color:#544016}
html[data-theme=light] td{border-color:#d2d7dd}
html[data-theme=light] .current{color:#63430a;background:#faf2de}
html[data-theme=light] .notice,html[data-theme=light] .metric{background:#faf3e3;color:#554319;border-color:#bca773}
html[data-theme=light] .metric strong{color:#63430a}
html[data-theme=light] .warn{background:#fff0d4;color:#674000}
html[data-theme=light] dialog{color:#202833;background:#fff}
html[data-theme=light] #toast{background:#fff7e5;color:#493508}
html[data-theme=light] footer{color:#505c69}
html[data-theme=light] .danger{color:#a02e24;border-color:#b56d63}
html[data-theme=light] button.link{color:#74500c;background:transparent}
html[data-theme=light] .marked button.link{color:#17477d}
html[data-theme=light] .marked select{background-color:#fff;color:#202833}
html[data-theme=light] .tag{border-color:#938570}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,summary:focus-visible,circle:focus-visible{outline:3px solid var(--chart1);outline-offset:3px}
.analysisgrid{display:grid;grid-template-columns:1fr 1fr;gap:20px}.analysisgrid>.card{min-width:0}.chartscroll{overflow:auto}.chartscroll svg{width:100%;min-width:620px;display:block;color:var(--ink)}.chartscroll text{fill:var(--ink);font:24px Arial,sans-serif}.chartgrid{stroke:var(--line);stroke-width:1}.chartlegend{display:flex;flex-wrap:wrap;gap:14px;font-size:.9rem;margin:18px 0}.chartlegend b{display:inline-grid;place-items:center;width:23px;height:23px;color:#101215;border-radius:4px}.seriesfield{flex:1;min-width:260px}.seriesfield select{min-height:160px;background-image:none}summary{cursor:pointer;padding:14px 0;color:var(--gold);font-weight:bold}#analysis .card h2{margin-top:10px}#analysis input[type=number]{width:180px}
html[data-theme=light] .chartlegend b{color:#fff}
@media(max-width:1100px){.analysisgrid{grid-template-columns:1fr;gap:0}}

.analysis-table{max-height:520px}#analysis #targetamount{width:190px}

.brand-signature{display:inline-block;font-size:.43em;font-weight:400;letter-spacing:.02em;margin-left:.5em;vertical-align:middle;color:var(--muted)}.history-matrix{max-height:70vh;margin:22px 0}.history-matrix th{position:sticky;top:0;z-index:2;white-space:normal;min-width:100px;line-height:1.5}.history-matrix .history-sticky{position:sticky;left:0;z-index:1;background:var(--panel);min-width:250px}.history-matrix th.history-sticky{z-index:3}.history-cell{background:transparent;color:inherit;border:1px solid transparent;padding:6px 9px;font-variant-numeric:tabular-nums}.history-cell:hover{border-color:var(--gold)}html[data-theme=light] .history-cell{background:transparent;color:inherit;border-color:transparent}html[data-theme=light] .history-cell:hover{border-color:var(--gold)}

.decimal-control{display:flex;flex-direction:column;gap:6px;color:var(--ink);font-size:.9rem}.decimal-buttons{display:flex;align-items:center;gap:6px}.decimal-buttons button{min-width:44px;font-weight:bold;font-size:1.15rem;padding:8px 12px}.decimal-buttons button:disabled{cursor:default}.decimal-select select{min-width:68px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.decimal-control small{font-size:.82rem}
.scroll{max-height:70vh;overflow:auto;isolation:isolate;scrollbar-gutter:stable}
.scroll th{position:sticky;top:0;z-index:2;box-shadow:0 1px 0 var(--line)}
/* Keep the workspace focused on tariff rows, with secondary tools on demand. */
#app>header{padding:12px max(24px,calc((100vw - 1530px)/2));gap:16px}
#app>header .eyebrow{display:none}
#app>header h1{font-size:1.55rem;margin:0 0 4px}
#app>header p{font-size:.875rem}
.account label{flex-direction:row;align-items:center}
main{padding-top:16px}
.context{gap:12px;padding-bottom:12px;align-items:end}
.context #savestatus{padding-bottom:10px}
nav{gap:6px;margin-bottom:12px}
nav button{padding:9px 12px}
main>.card,main>section>.card{padding:16px;margin-bottom:12px}
.sectionhead{gap:10px;margin-bottom:10px}
.sectionhead h2{margin-bottom:0}
.toolbar{gap:10px;margin:12px 0}
label{gap:5px}
button,.button{padding:8px 12px;min-height:38px}
input,select{padding-top:8px;padding-bottom:8px;min-height:38px}
input[type=checkbox]{min-height:0}
th{padding:10px 8px}
#simulation .simulation-params{margin:0;align-items:end}
#simulation .simulation-params label:last-child{flex:1;min-width:180px;max-width:360px}
#simulation .simulation-params input:not([type=number]),#simulation .simulation-params select{width:100%}
.simulation-notes{display:flex;align-items:baseline;gap:6px 20px;flex-wrap:wrap;margin-top:10px}
.rate-summary{margin:0;color:var(--ink);font-size:.9rem;line-height:1.5}
.compact-help{flex:1;min-width:140px}
.compact-help summary{padding:5px 0;font-size:.9rem;line-height:1.5}
.compact-help p{margin:6px 0 0;font-size:.9rem}
.simulation-lines #simavailability{margin:0;font-size:.875rem}
#simulation .simulation-selection{align-items:center;margin:0 0 10px;gap:8px 12px}
.simulation-selection .buttons{gap:6px}
.simulation-selection label{margin-right:auto}
.simulation-selection input[type=search]{width:260px}
.simulation-selection button{font-size:.9rem}
.current-draft{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px;border:1px solid var(--line);border-left:3px solid var(--gold);border-radius:6px;margin-top:12px}
.current-draft p{margin:5px 0 0;font-size:.875rem;max-width:760px}
#draftrows small{display:block;margin-top:5px}
#draftrows .tools{min-width:275px}
#simulation #draftstatus{font-size:.875rem}
@media(max-width:800px){
 #app>header{padding:12px 16px}
 .account{gap:8px;margin-top:10px}
 main{padding:12px}
 .context{gap:10px}
 .context #savestatus{padding-bottom:0}
 .context label{flex:1;min-width:135px}
 .context .decimal-select{min-width:0}
 button,.button,input,select{min-height:44px}
 input[type=checkbox]{min-height:0}
 #simulation .simulation-params label:last-child{max-width:none}
 #simulation .simulation-selection label{flex:1 1 100%}
 .simulation-selection input[type=search]{width:100%}
 .simulation-lines .sectionhead{align-items:start}
 .current-draft{flex-wrap:wrap}
}

.financial-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:18px 0}.financial-fields input{width:100%}#financialrows small{display:block;margin-top:6px}.access-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.access-options label{flex-direction:row;align-items:center;padding:10px;border:1px solid var(--line);border-radius:5px;min-height:44px}.access-options input{flex:none}.chart-scale{display:inline-flex;flex-direction:row;gap:10px;align-items:center;margin:12px 0}.chart-scale select{min-width:180px}.analysis-shortcuts{margin:8px 0 12px}#accountrows td:nth-child(4){max-width:380px;font-size:.875rem;line-height:1.5}
@media(max-width:700px){.financial-fields,.access-options{grid-template-columns:1fr}}

#local-login{display:grid;gap:14px;margin-top:18px}#local-login input{width:100%}
