:root{color-scheme:dark;--bg:#101919;--panel:#182424;--line:#2c3c39;--ink:#eef4e9;--muted:#a0b4aa;--accent:#c1ef8c;--orange:#f5c785}*{box-sizing:border-box}body{margin:0;font:15px/1.6 system-ui,sans-serif;background:var(--bg);color:var(--ink)}[hidden]{display:none!important}button,input,select{font:inherit}button{cursor:pointer;background:var(--accent);color:#152019;border:0;border-radius:8px;padding:10px 18px;font-weight:650}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #f5c785;outline-offset:3px}input,select{background:#111c1b;border:1px solid #475d51;border-radius:7px;color:var(--ink);padding:11px;width:100%}h1,h2,p{margin-top:0}h1{font-size:32px;letter-spacing:-1px;margin-bottom:5px}h2{font-size:19px;font-weight:600}a{color:var(--accent);text-decoration:none}.muted{color:var(--muted);font-size:13px}.eyebrow{font-size:11px;letter-spacing:2px;color:var(--muted);margin:22px 0 8px}.mark{display:inline-grid;place-items:center;background:var(--accent);color:#172019;font-size:22px;width:38px;height:38px;border-radius:11px;font-weight:800}aside{position:fixed;inset:0 auto 0 0;width:230px;padding:30px 22px;border-right:1px solid var(--line);background:#142020}.brand{font-size:19px;font-weight:650;display:flex;align-items:center;gap:12px;color:var(--ink)}nav{display:grid;gap:8px;margin-top:25px}nav button{background:transparent;color:var(--muted);text-align:left;padding:11px 12px;font-weight:500}nav button.selected{background:#2b3c2a;color:var(--accent)}.aside-bottom{position:absolute;bottom:30px;color:var(--muted);font-size:12px}.dot{display:inline-block;background:var(--accent);width:7px;height:7px;border-radius:50%}.text-button{background:none;color:var(--muted);padding:5px 0;display:block}main{margin-left:230px;padding:35px 40px;max-width:1600px}header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}header .eyebrow{margin-top:0}.mode{display:flex;align-items:center;gap:9px;font-size:12px}.mode button{width:40px;height:24px;border:1px solid #70836f;padding:3px;background:#324130}.mode button span{display:block;background:var(--accent);border-radius:50%;width:16px;height:16px}.notice{border:1px solid #425936;background:#213022;color:#d2e8b8;padding:12px 18px;border-radius:10px;margin-bottom:24px;font-size:13px}.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}.card,article{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:24px}.card .label{font-size:12px;color:var(--muted)}.card .value{font-size:31px;letter-spacing:-1px;margin:7px 0;color:var(--accent)}.card .value small{font-size:15px;color:var(--muted);letter-spacing:0}.card .detail{font-size:12px;color:var(--muted)}article{margin-bottom:20px}.two-col{display:grid;grid-template-columns:1.6fr 1fr;gap:20px}.article-title,.toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px}.toolbar{margin-bottom:16px}.toolbar input{max-width:320px}.tag{font-size:11px;border:1px solid #526148;border-radius:20px;padding:3px 9px;color:var(--accent)}.chart{min-height:160px}.chart svg{width:100%;height:200px;overflow:visible}.chart-empty{height:150px;display:grid;place-items:center;color:var(--muted);text-align:center}.legend{display:flex;gap:20px;font-size:12px;color:var(--muted)}.legend i{width:12px;height:3px;display:inline-block;vertical-align:middle;margin-right:5px}.money-row{display:flex;justify-content:space-between;padding:13px 0;border-bottom:1px solid var(--line)}.money-row.total{color:var(--accent);font-size:22px;border-bottom:0}.reasons{display:flex;flex-wrap:wrap;gap:7px}.reason{padding:5px 9px;background:#342e20;border:1px solid #625333;color:var(--orange);font-size:12px;border-radius:6px}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:12px}td,th{text-align:left;padding:11px 9px;border-bottom:1px solid var(--line)}th{color:var(--muted);font-weight:500}td.code{font-family:monospace;font-size:11px;word-break:break-word}.good{color:var(--accent)}.warn{color:var(--orange)}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px;margin:20px 0}label{font-size:13px;display:block}label input,label select{margin-top:7px}.setting-row{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);padding-bottom:10px}.setting-row p{margin:5px 0}.switch-label{display:flex;align-items:center;gap:10px}.switch-label input{appearance:none;width:44px;height:25px;border-radius:20px;background:#334037;position:relative;cursor:pointer;margin:0}.switch-label input:before{content:'';position:absolute;top:3px;left:3px;width:17px;height:17px;border-radius:50%;background:var(--muted)}.switch-label input:checked{background:#477331}.switch-label input:checked:before{left:22px;background:var(--accent)}footer{color:var(--muted);font-size:11px;margin-top:30px}#error,#login-error{color:var(--orange)}.login{min-height:100vh;display:grid;place-items:center;padding:20px}.login form{max-width:400px;width:100%;background:var(--panel);border:1px solid var(--line);padding:36px;border-radius:16px}.login button{width:100%;margin:20px 0 0}.login p{color:var(--muted)}@media(max-width:1050px){main{padding:25px}.cards{grid-template-columns:repeat(2,1fr)}.two-col{grid-template-columns:1fr}header{align-items:flex-start;gap:15px}.mode{flex-wrap:wrap;max-width:160px}}@media(max-width:700px){aside{position:static;width:auto;padding:16px;border-right:0;border-bottom:1px solid var(--line)}aside .eyebrow,.aside-bottom{display:none}nav{display:flex;overflow:auto;gap:4px;margin-top:15px}nav button{white-space:nowrap;font-size:12px;padding:8px}.brand{font-size:17px}.mark{width:30px;height:30px;font-size:18px}main{margin:0;padding:20px 15px}h1{font-size:27px}.card,article{padding:17px}.card .value{font-size:26px}.cards{gap:10px}.form-grid{grid-template-columns:1fr}.toolbar{align-items:flex-start;flex-direction:column}.mode{max-width:145px}#sources-table{max-height:600px}}
.legend svg{width:12px;height:4px;display:inline-block;vertical-align:middle;margin-right:5px;overflow:visible}.legend span{display:flex;align-items:center;gap:5px}.card .value.stale-value{color:var(--orange)}
#hourly-plan .table-wrap{max-height:650px;overflow:auto}#hourly-plan table{min-width:1850px}#hourly-plan td,#hourly-plan th{white-space:nowrap}#hourly-plan td:last-child{white-space:normal;min-width:260px;max-width:340px}#hourly-plan th{position:sticky;top:0;background:var(--panel);z-index:1}.legend{flex-wrap:wrap}

.weekday-options{display:flex;flex-wrap:wrap;gap:14px;margin-top:15px}.weekday-options label{display:flex;align-items:center;gap:6px}.weekday-options input,#ev-absence-enabled{width:auto}

.next-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 24px}.next-card{border:1px solid #3a5246;background:linear-gradient(140deg,#23372c,#182424);padding:18px;border-radius:12px;display:grid;gap:7px}.next-card span{color:var(--muted);font-size:12px}.next-card strong{font-size:18px;color:var(--accent)}.next-card small{font-size:12px;color:var(--muted)}.reference-details{border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:20px}.reference-details summary,.assumptions summary{cursor:pointer;color:var(--muted)}.reference-details article{margin-top:16px}.assumptions{margin-top:14px}.assumptions .reasons{margin-top:14px}#hour-view{width:auto;max-width:230px}#hourly-plan table{min-width:1050px}#hourly-plan th{font-weight:600}#hourly-plan td{padding:13px 10px}#hourly-plan td:last-child{min-width:230px}#slots .table-wrap{max-height:420px}.chart svg{height:230px}.money-row strong{font-variant-numeric:tabular-nums}@media(max-width:1050px){.next-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:700px){.next-actions{gap:10px}.next-card{padding:14px}.next-card strong{font-size:15px}.article-title{flex-wrap:wrap}#hour-view{max-width:100%}}

/* Keep scrolling stable while live content refreshes. */
html,.table-wrap{overflow-anchor:none;scroll-behavior:auto}.table-wrap{overscroll-behavior:contain}
#hourly-plan tr.price-published td,.price-key .price-published{background:rgba(193,239,140,.055)}
#hourly-plan tr.price-estimated td,.price-key .price-estimated{background:rgba(245,199,133,.09)}
#hourly-plan tr.price-missing td{background:rgba(160,180,170,.04)}
.price-key span{display:inline-block;padding:3px 8px;border-radius:5px;margin-right:6px}

.mode button span{transition:transform .2s ease}.mode button[aria-checked="true"] span{transform:translateX(16px)}
#hourly-plan tr.period-past td{background:rgba(155,163,170,.10);color:#b8c0bc}
#hourly-plan tr.period-current td{background:rgba(116,178,232,.14);border-top:1px solid #73abe0;border-bottom:1px solid #73abe0}
.hour-explanation{padding:12px;border-left:3px solid #73abe0;margin:12px 0;background:#152222}

/* Settings are grouped by asset; native checkboxes keep a compact hit target. */
.settings-intro{margin-bottom:24px}.settings-box{min-width:0;margin:0 0 24px;padding:22px 24px 24px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}.settings-box legend{padding:0 10px;color:var(--accent);font-size:21px;font-weight:650}.settings-box h3{margin:24px 0 8px;font-size:16px}.settings-box label:has(input[type=checkbox]){display:flex;align-items:center;gap:10px;align-self:center}.settings-box input[type=checkbox]{width:20px;height:20px;flex:0 0 auto;margin:0;accent-color:var(--accent)}.settings-box .switch-label input{width:44px;height:25px;flex-basis:44px}.settings-box small{display:block;color:var(--muted);margin-top:7px}.settings-box .weekday-options{margin:0 0 20px}.settings-advanced{border-top:1px solid var(--line);padding-top:16px;margin-top:18px}.settings-advanced summary{cursor:pointer;color:var(--muted);font-weight:600}.settings-save{padding:18px 0 24px;display:flex;flex-wrap:wrap;align-items:center;gap:14px}.settings-save p{width:100%;margin:0}@media(max-width:700px){.settings-box{padding:15px}.settings-box legend{font-size:19px}}

.box-save{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin-top:22px;padding-top:16px;border-top:1px solid var(--line)}.box-save-status{color:var(--accent);font-size:13px}.settings-dirty{border-color:var(--orange)}.settings-dirty .box-save-status{color:var(--orange)}button:disabled{opacity:.55;cursor:wait}

/* Compact hourly views fit the available width; detailed view keeps scrolling. */
#hourly-plan[data-view="energy"] table,#hourly-plan[data-view="money"] table{width:100%;min-width:0;table-layout:fixed}#hourly-plan[data-view="energy"] td,#hourly-plan[data-view="energy"] th,#hourly-plan[data-view="money"] td,#hourly-plan[data-view="money"] th{white-space:pre-line;overflow-wrap:anywhere;padding:12px 7px;min-width:0;max-width:none;vertical-align:top;line-height:1.65;font-variant-numeric:tabular-nums}#hourly-plan[data-view="energy"] th:nth-child(1){width:12%}#hourly-plan[data-view="energy"] th:nth-child(2),#hourly-plan[data-view="energy"] th:nth-child(3),#hourly-plan[data-view="energy"] th:nth-child(4){width:7%}#hourly-plan[data-view="energy"] th:nth-child(5){width:17%}#hourly-plan[data-view="energy"] th:nth-child(6){width:21%}#hourly-plan[data-view="energy"] th:nth-child(7){width:8%}#hourly-plan[data-view="energy"] th:nth-child(8){width:21%}#hourly-plan[data-view="money"] th:first-child{width:16%}@media(max-width:700px){#hourly-plan[data-view="energy"] table{min-width:760px}#hourly-plan[data-view="money"] table{min-width:620px}}

.deadline-group{display:grid;align-content:start;gap:20px;min-width:0}

.settings-box label:has(input[type=checkbox]){flex-wrap:wrap}.settings-box label:has(input[type=checkbox]) small{flex-basis:100%}

.plan-updated{padding:12px 16px;border:1px solid var(--line);border-radius:8px;color:var(--accent);background:var(--panel);font-size:14px}

/* Chart legends must not inherit the 230px height of the main chart SVG. */
.chart .legend svg{width:12px;height:4px;flex:0 0 12px}.chart>.legend{gap:8px 16px;margin:8px 0 12px}.chart>svg{display:block;cursor:zoom-in}.overview-charts,.overview-details{grid-template-columns:1fr 1fr;align-items:start}.chart{position:relative}.chart-expand{display:block;margin:0 0 4px auto;background:transparent;border:1px solid var(--line);color:var(--accent);font-size:12px;padding:5px 9px}.control-summary{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-bottom:12px}.control-details summary{cursor:pointer;color:var(--muted)}.control-details{margin-top:16px}.control-details .table-wrap{margin-top:12px}.control-alerts{border-left:3px solid var(--orange);padding-left:12px;font-size:13px}.control-alerts p{margin-bottom:6px}#chart-dialog{width:min(1200px,96vw);max-height:94vh;overflow:auto;padding:24px;border:1px solid #526b58;border-radius:14px;background:var(--panel);color:var(--ink)}#chart-dialog::backdrop{background:rgba(0,0,0,.75)}.chart-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:16px}.chart-dialog-header h2{margin:0}.chart-controls{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 12px}.chart-controls button{padding:7px 12px;font-size:13px}#chart-large>svg{height:min(55vh,480px);cursor:default}#chart-large .legend svg{height:4px}.overview-charts article,.overview-details article{margin-bottom:20px}@media(max-width:1050px){.overview-charts,.overview-details{grid-template-columns:1fr}}@media(max-width:700px){#chart-dialog{padding:15px}.chart-controls button{padding:6px 9px}}

#next-five-hours table{table-layout:fixed;width:100%;font-size:13px}#next-five-hours td,#next-five-hours th{white-space:normal;overflow-wrap:anywhere;vertical-align:top}#next-five-hours th:nth-child(1){width:13%}#next-five-hours th:nth-child(2){width:20%}#next-five-hours th:nth-child(3){width:15%}#next-five-hours th:nth-child(4){width:27%}#next-five-hours th:nth-child(5){width:11%}#next-five-hours th:nth-child(6){width:14%}@media(max-width:700px){#next-five-hours table{min-width:650px}}

.chart>svg{height:auto;aspect-ratio:800/210}#chart-large>svg{height:auto;aspect-ratio:800/210}

.flow-controls{display:flex;align-items:center;flex-wrap:wrap;gap:14px}.flow-controls select{width:auto;max-width:220px}#next-five-hours .table-wrap{max-height:720px;overflow:auto}#next-five-hours thead th{position:sticky;top:0;background:var(--panel);z-index:1}#next-five-hours .flow-day th{padding:16px 10px 8px;color:var(--accent);background:#1e2d29;font-weight:650;text-transform:capitalize}#next-five-hours .flow-current td{background:rgba(116,178,232,.12)}#next-five-hours .flow-estimated td:last-child{color:var(--orange)}@media(max-width:700px){.flow-controls{width:100%;justify-content:space-between}.flow-controls select{max-width:190px}}
.notification-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.notification-grid .settings-box{margin:0 0 12px;padding:18px}.notification-grid legend{font-size:18px}.notification-checks{display:grid;gap:11px;margin-top:18px}.notification-detail{margin-top:16px}.notification-presets{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin:20px 0}.notification-presets small{width:100%;color:var(--muted)}.notification-presets button,.secondary-button{background:#2b3c2a;color:var(--accent);border:1px solid #526148}.notification-help{display:block;margin:10px 0}#notification-form>.form-grid label:has(input[type=checkbox]){display:flex;align-items:center;gap:10px}#notification-form input[type=checkbox]{width:20px;height:20px;flex:0 0 auto;accent-color:var(--accent)}#notification-history td{white-space:pre-line;overflow-wrap:anywhere}@media(max-width:900px){.notification-grid{grid-template-columns:1fr}}

#notification-form .notification-toggle{display:flex;align-items:center;gap:10px}

/* Keep the experimental chart's price selector beside a readable title. */
#weekly-price-experiment .article-title select{width:auto;min-width:14rem;max-width:100%}
@media(max-width:700px){#weekly-price-experiment .article-title select{width:100%;min-width:0}}

.weekly-price-controls{display:flex;flex-wrap:wrap;gap:12px;margin:12px 0}.weekly-price-controls label{display:flex;align-items:center;gap:10px}.weekly-price-controls input[type=checkbox]{width:auto;margin:0;accent-color:var(--accent)}
