:root {
  color-scheme: light;
  --page: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --glass: rgba(252, 252, 251, 0.78);
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --b1: #104281; --b2: #1c5cab; --b3: #2a78d6; --b4: #5598e7; --b5: #86b6ef;
  --good: #0ca30c; --good-text: #006300; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --glow-1: rgba(42, 120, 214, 0.16); --glow-2: rgba(27, 175, 122, 0.12); --glow-3: rgba(235, 104, 52, 0.10);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --radius: 16px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --glass: rgba(26, 26, 25, 0.72);
    --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --b1: #cde2fb; --b2: #86b6ef; --b3: #5598e7; --b4: #2a78d6; --b5: #1c5cab;
    --good-text: #0ca30c;
    --glow-1: rgba(57, 135, 229, 0.20); --glow-2: rgba(25, 158, 112, 0.13); --glow-3: rgba(217, 89, 38, 0.10);
    --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --surface-2: #232321; --glass: rgba(26, 26, 25, 0.72);
  --ink: #ffffff; --ink-2: #c3c2b7; --muted: #898781; --grid: #2c2c2a; --axis: #383835; --border: rgba(255,255,255,0.10);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --b1: #cde2fb; --b2: #86b6ef; --b3: #5598e7; --b4: #2a78d6; --b5: #1c5cab;
  --good-text: #0ca30c;
  --glow-1: rgba(57, 135, 229, 0.20); --glow-2: rgba(25, 158, 112, 0.13); --glow-3: rgba(217, 89, 38, 0.10);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 22px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
small { font-size: 12px; }
b { font-weight: 650; }

/* animated background */
.bg-glow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-glow span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(80px); animation: drift 28s ease-in-out infinite alternate; }
.bg-glow span:nth-child(1) { background: var(--glow-1); top: -25vmax; left: -15vmax; }
.bg-glow span:nth-child(2) { background: var(--glow-2); bottom: -30vmax; right: -20vmax; animation-duration: 34s; }
.bg-glow span:nth-child(3) { background: var(--glow-3); top: 30%; left: 45%; width: 40vmax; height: 40vmax; animation-duration: 40s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }

/* loader */
.loader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--page); transition: opacity .6s ease, visibility .6s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-card { text-align: center; width: min(420px, 88vw); display: grid; gap: 10px; justify-items: center; }
.loader-card h2 { font-size: 26px; }
.bolt { width: 72px; height: 72px; border-radius: 22px; background: var(--s1); display: grid; place-items: center; animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 0 0 var(--glow-1); }
.bolt svg { width: 40px; fill: #fff; }
@keyframes pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 18px transparent, 0 0 40px var(--s1); } }
.progress { width: 100%; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.progress div { height: 100%; width: 3%; background: linear-gradient(90deg, var(--s1), var(--s3)); border-radius: 6px; transition: width .4s ease; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 12px clamp(16px, 3vw, 32px); background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--border); }
.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.brand h1 { font-size: 17px; }
.brand p { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32ch; }
.logo { width: 36px; height: 36px; border-radius: 11px; background: var(--s1); display: grid; place-items: center; flex: none; }
.logo svg { width: 20px; fill: #fff; }
.sections { display: flex; gap: 2px; margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.sections a { color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; white-space: nowrap; transition: background .2s, color .2s; }
.sections a:hover { background: var(--surface-2); }
.sections a.active { background: var(--ink); color: var(--page); }
.actions { display: flex; align-items: center; gap: 6px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); margin-right: 6px; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform .15s, background .2s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

main { max-width: 1440px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 48px; display: grid; gap: 40px; }
section { display: grid; gap: 16px; }
main > *, section > *, .calc-panel > * { min-width: 0; } /* grid items may shrink: wide tables scroll inside their card instead of widening the page */
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.section-title > :first-child { display: grid; gap: 2px; }
.section-title h2 + p { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 14px; box-shadow: var(--shadow); min-width: 0; transition: transform .25s ease, box-shadow .25s ease; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.card-head p { font-size: 12.5px; margin-top: 2px; }
.chart { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2.wide-left { grid-template-columns: 1.7fr 1fr; }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.kpi, .insight { opacity: 0; transform: translateY(14px) scale(.98); animation: pop .6s cubic-bezier(.2,.7,.2,1) forwards; }
@keyframes pop { to { opacity: 1; transform: none; } }

/* segmented */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 6px 11px; border-radius: 7px; font: inherit; font-size: 12.5px; cursor: pointer; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 600; }
.seg.small button { padding: 4px 9px; font-size: 12px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
.hero-main { position: relative; overflow: hidden; display: grid; gap: 16px; padding: 22px 24px; }
.hero-main::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, var(--glow-1), transparent 70%); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.hero-row { display: flex; align-items: end; gap: 24px; flex-wrap: wrap; }
.hero-num { font-size: clamp(48px, 7vw, 76px); font-weight: 700; letter-spacing: -0.035em; line-height: 1; }
.hero-num small { font-size: 20px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.hero-side { display: grid; gap: 4px; padding-bottom: 6px; }
.delta { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: 15px; }
.delta.up { color: var(--critical); } .delta.down { color: var(--good-text); }
.delta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.hero-proj { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-proj div { display: grid; gap: 2px; }
.hero-proj span { font-size: 12px; }
.hero-proj b { font-size: 20px; }
.month-bar { position: relative; height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.month-bar div { position: absolute; inset: 0 auto 0 0; border-radius: 8px; transition: width 1.4s cubic-bezier(.2,.7,.2,1); width: 0; }
#hero-bar { background: var(--s1); z-index: 1; }
#hero-bar-proj { background: repeating-linear-gradient(45deg, var(--s1) 0 3px, transparent 3px 7px); opacity: .45; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 10px; display: grid; gap: 4px; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .25s, border-color .25s; }
.kpi:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--s1) 50%, var(--border)); }
.kpi .lbl { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi .lbl svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; }
.kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--muted); min-height: 18px; }
.kpi .sub .up { color: var(--critical); font-weight: 600; } .kpi .sub .down { color: var(--good-text); font-weight: 600; }
.kpi .spark { height: 34px; margin: 2px -4px 0; }

/* insights */
.insights { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.insight { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; box-shadow: var(--shadow); }
.insight .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.insight .ic svg { width: 18px; height: 18px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke: var(--ink-2); }
.insight.good .ic svg { stroke: var(--good); } .insight.warn .ic svg { stroke: var(--warning); } .insight.bad .ic svg { stroke: var(--critical); } .insight.info .ic svg { stroke: var(--s1); }
.insight h4 { margin: 0 0 3px; font-size: 14px; font-weight: 650; }
.insight p { color: var(--ink-2); font-size: 13px; }
.insight .tag { display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* optimizer */
.optimizer { display: grid; gap: 12px; align-content: start; }
.opt-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.opt-table th, .opt-table td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--grid); font-size: 13px; }
.opt-table th:first-child, .opt-table td:first-child { text-align: left; }
.opt-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.pill i { width: 8px; height: 8px; border-radius: 50%; }
.callout { border-radius: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--s1) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--s1) 30%, transparent); font-size: 13px; color: var(--ink-2); }
.callout b { color: var(--ink); }

/* tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--axis); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.tbl tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--surface-2); cursor: pointer; }
.tbl .num { text-align: right; }
.bar-cell { position: relative; min-width: 120px; }
.bar-cell span { position: absolute; left: 10px; top: 50%; height: 6px; transform: translateY(-50%); border-radius: 0 4px 4px 0; background: var(--s1); }

/* simulator */
.sim-body { display: grid; gap: 16px; }
.sim label { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; color: var(--ink-2); }
.sim output { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.sim input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--s1); }
.sim-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 8px; border-top: 1px solid var(--grid); }
.sim-result div { display: grid; gap: 2px; }
.sim-result span { font-size: 12px; }
.sim-result b { font-size: 22px; letter-spacing: -0.02em; }

/* day explorer */
.day-pick { display: flex; gap: 6px; align-items: center; }
.day-pick input { height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 0 10px; font: inherit; }
.day-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.day-stats div { display: grid; gap: 2px; }
.day-stats span { font-size: 12px; color: var(--muted); }
.day-stats b { font-size: 20px; letter-spacing: -0.01em; }
.day-stats .full { grid-column: 1 / -1; }

/* meter info */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.info-card h4 { margin: 0 0 10px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.info-card dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.info-card dt { color: var(--muted); }
.info-card dd { margin: 0; text-align: right; font-weight: 550; overflow-wrap: anywhere; }
.dq { display: grid; gap: 10px; }
.dq-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; font-size: 13px; }
.dq-row .meter { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.dq-row .meter i { display: block; height: 100%; background: var(--s1); border-radius: 6px; }
.dq-big { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.dq-big div { display: grid; }
.dq-big b { font-size: 24px; }

.btn { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; transition: background .2s, transform .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--s1); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* settings dialog */
dialog { border: 1px solid var(--border); border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); width: min(720px, 94vw); max-height: 88vh; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
dialog::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }
dialog[open] { animation: dlg .3s cubic-bezier(.2,.7,.2,1); }
@keyframes dlg { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.settings { padding: 20px; display: grid; gap: 14px; }
.settings fieldset { border: 1px solid var(--grid); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin: 0 0 12px; }
.settings legend { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 6px; }
.settings label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.settings input { height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 10px; font: inherit; font-variant-numeric: tabular-nums; }
.settings .note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.settings-foot { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px; font-size: 13px; z-index: 60; box-shadow: var(--shadow); animation: pop .3s forwards; }
.foot { text-align: center; font-size: 12px; padding-top: 8px; }

/* invoices */
.dropzone { display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; min-height: 220px; border: 2px dashed color-mix(in srgb, var(--s1) 45%, var(--border)); background: color-mix(in srgb, var(--s1) 5%, var(--surface)); cursor: pointer; transition: background .25s, border-color .25s, transform .25s; }
.dropzone:hover, .dropzone.over { background: color-mix(in srgb, var(--s1) 14%, var(--surface)); border-color: var(--s1); transform: translateY(-2px); }
.dropzone.over .dz-icon { transform: translateY(-6px) scale(1.08); }
.dropzone.busy .dz-icon svg { animation: spin 1.2s linear infinite; }
.dz-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--s1); display: grid; place-items: center; margin-bottom: 6px; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.dz-icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dz-suppliers { font-size: 11.5px; color: var(--muted); max-width: 34ch; margin-top: 6px; }
.empty { color: var(--muted); font-size: 13px; padding: 18px 4px 6px; }
.tbl .acts { display: flex; gap: 4px; justify-content: flex-end; }
.tbl .acts button, .tbl .acts a { height: 28px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.tbl .acts button:hover, .tbl .acts a:hover { background: var(--surface-2); color: var(--ink); }
.diff-good { color: var(--good-text); font-weight: 600; } .diff-bad { color: var(--critical); font-weight: 600; }
dialog.wide { width: min(1120px, 96vw); }
.rv-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 16px; margin-bottom: 12px; }
.rv-meta div { display: grid; gap: 1px; } .rv-meta span { font-size: 12px; color: var(--muted); } .rv-meta b { font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.chip i { font-style: normal; font-weight: 700; }
.chip.ok i { color: var(--good); } .chip.bad i { color: var(--critical); } .chip.warn i { color: var(--warning); }
.warns { margin: 0 0 10px; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); }
.rv-table { max-height: 46vh; overflow: auto; border: 1px solid var(--grid); border-radius: 12px; }
.rv-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rv-table th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 500; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--axis); z-index: 1; }
.rv-table td { padding: 6px 8px; border-bottom: 1px solid var(--grid); }
.rv-table tr.off td { opacity: .45; }
.rv-table select { height: 28px; border-radius: 7px; border: 1px solid var(--border); background: var(--page); color: var(--ink); font: inherit; font-size: 12px; max-width: 210px; }
.rv-table .num { text-align: right; }
.rv-table .x { color: var(--critical); }
.rv-prices { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 16px; font-size: 12.5px; margin-top: 12px; }
.rv-prices div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--grid); padding: 3px 0; }
.rv-prices span { color: var(--muted); }
details.raw { margin-top: 10px; font-size: 12px; } details.raw pre { max-height: 220px; overflow: auto; background: var(--page); padding: 10px; border-radius: 8px; white-space: pre; font-size: 11px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.badge { display: inline-flex; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--s1) 16%, transparent); color: var(--s1); margin-left: 6px; vertical-align: middle; }
.settings label .badge { margin: 0; justify-self: start; }

@media (max-width: 1100px) {
  .sections { display: none; }
  .brand p { max-width: 22ch; }
}
@media (max-width: 900px) {
  .grid-2, .grid-2.wide-left, .hero { grid-template-columns: 1fr; }
  .hero-proj { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .live { display: none; }
  .brand p { display: none; }
  .hero-proj, .sim-result { grid-template-columns: 1fr 1fr; }
  .day-stats { grid-template-columns: 1fr; }
  .card { padding: 14px 12px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .kpi, .insight { opacity: 1; transform: none; }
}

/* review dialog: header and footer fixed, body scrolls */
dialog.wide { overflow: hidden; }
dialog.wide .settings { max-height: 88vh; display: flex; flex-direction: column; }
dialog.wide #rv-body { overflow: auto; min-height: 0; flex: 1; padding-right: 4px; }
dialog.wide .rv-table { max-height: none; overflow: visible; }
dialog.wide .settings-foot { align-items: center; padding-top: 12px; border-top: 1px solid var(--grid); }
.settings label.check { display: inline-flex; grid-template-columns: none; }
.settings .check input { height: 16px; width: 16px; padding: 0; accent-color: var(--s1); }

/* upload buttons */
.upload-btn { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; box-shadow: 0 4px 14px color-mix(in srgb, var(--s1) 35%, transparent); }
.upload-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.upload-btn:hover { background: color-mix(in srgb, var(--s1) 88%, #fff); }
.upload-btn.big { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.upload-btn.loading svg { animation: bob .8s ease-in-out infinite alternate; }
.upload-btn:disabled { opacity: .8; cursor: progress; }
@keyframes bob { to { transform: translateY(-3px); } }
.empty { display: grid; gap: 12px; justify-items: start; }
@media (max-width: 720px) {
  .topbar .upload-btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .topbar .upload-btn .lbl { display: none; }
  .upload-btn.big { width: 100%; justify-content: center; }
  .dropzone { min-height: 150px; }
}

/* ---------- pages ---------- */
main > section[hidden] { display: none !important; }
.link { color: var(--s1); text-decoration: none; font-size: 13px; font-weight: 550; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.small { font-size: 12.5px; }

/* home */
.home-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.home-title { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.025em; margin: 2px 0 6px; }
.home-lede { color: var(--ink-2); font-size: 15px; max-width: 70ch; }
.home-lede b { color: var(--ink); }
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.home-card { display: grid; gap: 8px; align-content: start; padding: 20px 22px 16px; position: relative; overflow: hidden; }
.home-card .hero-num { font-size: clamp(40px, 4.6vw, 56px); }
.home-card .hero-num small { font-size: 16px; }
.hc-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-top: 1px solid var(--grid); padding-top: 10px; margin-top: auto; font-size: 13px; }
.hc-foot a { color: var(--s1); text-decoration: none; font-weight: 550; }
.price-scale { position: relative; height: 34px; margin-top: 4px; }
.price-scale .track { position: absolute; left: 0; right: 0; top: 10px; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--good), var(--warning), var(--critical)); opacity: .55; }
.price-scale .mark { position: absolute; top: 4px; width: 3px; height: 20px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); transition: left 1.2s cubic-bezier(.2,.7,.2,1); }
.price-scale .mark.median { background: var(--muted); width: 2px; }
.price-scale .lbls { position: absolute; top: 24px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.todo { display: grid; gap: 8px; }
.todo a, .todo button { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; transition: transform .2s, border-color .2s; }
.todo a:hover, .todo button:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--s1) 50%, var(--border)); }
.todo .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); }
.todo .ic svg { width: 17px; height: 17px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke: var(--s1); }
.todo .bad svg { stroke: var(--critical); } .todo .warn svg { stroke: var(--warning); } .todo .good svg { stroke: var(--good); }
.todo b { display: block; font-size: 13.5px; } .todo span.t { font-size: 12.5px; color: var(--ink-2); }
.todo .go { color: var(--muted); font-size: 18px; }

/* price history */
.changes { display: grid; gap: 8px; max-height: 300px; overflow: auto; }
.chg { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.chg .when { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chg .up { color: var(--critical); font-weight: 650; } .chg .down { color: var(--good-text); font-weight: 650; }

/* community */
.share-card { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; align-items: center; }
.share-card h3 { margin-bottom: 4px; }
.share-card ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 12.5px; columns: 2; }
.share-card .state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.share-card .state i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.share-card .state.on i { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent); }
.share-actions { display: grid; gap: 8px; justify-items: end; }
.comm-me { display: grid; gap: 14px; }
.comm-me .big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.comm-me .rows { display: grid; gap: 6px; font-size: 13px; }
.comm-me .rows div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--grid); padding-bottom: 5px; }
.comm-me .rows span { color: var(--muted); }
.foot-note { font-size: 12px; max-width: 110ch; }

@media (max-width: 1100px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .sections { display: flex; order: 3; width: 100%; margin: 0; padding-bottom: 2px; }
}
@media (max-width: 900px) {
  .home-cards { grid-template-columns: 1fr; }
  .share-card { grid-template-columns: 1fr; }
  .share-actions { justify-items: start; }
  .share-card ul { columns: 1; }
}

/* setup */
.loader.setup-mode .loader-card { display: none; }
.setup { width: min(520px, 92vw); display: grid; gap: 14px; padding: 28px; text-align: left; animation: pop .5s cubic-bezier(.2,.7,.2,1) forwards; }
.setup h2 { font-size: 24px; letter-spacing: -0.02em; }
.setup label { display: grid; gap: 6px; font-size: 13.5px; }
.setup input { height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 14px; font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.setup input:focus { outline: none; border-color: var(--s1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--s1) 22%, transparent); }
.setup input.bad { border-color: var(--critical); }
.setup a { color: var(--s1); }
.setup .btn.big { height: 46px; font-size: 15px; }
.setup-err { color: var(--critical); font-size: 13px; font-weight: 550; margin: 0; }
.bolt.small { width: 48px; height: 48px; border-radius: 14px; animation: none; }
.bolt.small svg { width: 26px; }

/* sign-in */
.login-points { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; display: grid; gap: 4px; }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 48px; border-radius: 12px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; font-size: 15px; text-decoration: none; }
.google-btn:hover { background: #f8f9fa; }
.google-btn svg { width: 20px; height: 20px; }
.dev-login { display: grid; gap: 6px; padding: 10px; border: 1px dashed var(--border); border-radius: 12px; }
.dev-login input { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 12px; font: inherit; }

/* account menu */
.acct { position: relative; }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--s1), var(--s7)); color: #fff; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; }
.acct-menu { position: absolute; right: 0; top: 46px; width: 270px; padding: 8px; display: grid; gap: 2px; z-index: 40; animation: pop .2s forwards; }
.acct-menu[hidden] { display: none; }
.acct-who { display: grid; gap: 2px; padding: 8px 10px 10px; border-bottom: 1px solid var(--grid); margin-bottom: 4px; font-size: 13px; overflow-wrap: anywhere; }
.acct-menu button, .acct-menu a { text-align: left; background: none; border: 0; color: var(--ink); font: inherit; font-size: 13.5px; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.acct-menu button:hover, .acct-menu a:hover { background: var(--surface-2); }
.acct-menu .danger { color: var(--critical); }
.acct-menu [hidden] { display: none; }
.danger-btn { background: var(--critical); color: #fff; border-color: transparent; }
.consent-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
dialog p { margin: 0; font-size: 14px; line-height: 1.55; }
#consent-dialog, #del-dialog { width: min(560px, 94vw); }
#consent-dialog .settings, #del-dialog .settings { gap: 12px; }
#del-dialog label { display: grid; gap: 6px; font-size: 13px; }
#del-dialog input { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 12px; font: inherit; }
.foot a { color: inherit; }

/* setup steps & how-to */
.steps { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 600; }
.steps[hidden] { display: none; }
.step { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.step i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.step.done { color: var(--good-text); } .step.done i { background: var(--good); color: #fff; border-color: transparent; }
.step.now { color: var(--ink); } .step.now i { background: var(--s1); color: #fff; border-color: transparent; }
.step-line { flex: 1; height: 2px; background: linear-gradient(90deg, var(--good), var(--s1)); border-radius: 2px; max-width: 80px; }
.howto { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: color-mix(in srgb, var(--s1) 6%, var(--surface)); }
.howto summary { cursor: pointer; font-weight: 650; font-size: 14px; }
.howto ol { margin: 10px 0 12px; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.howto .btn { display: inline-flex; align-items: center; text-decoration: none; }
.setup-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.link-btn[hidden] { display: none; }
.setup { max-height: 94vh; overflow: auto; }

.setup[hidden], .dev-login[hidden], .google-btn[hidden], .email-login[hidden] { display: none !important; }
.email-login { display: grid; gap: 8px; }
.login-invite { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; color: var(--ink-2); background: color-mix(in srgb, var(--s1) 10%, transparent); border: 1px solid color-mix(in srgb, var(--s1) 30%, transparent); }
.login-invite[hidden] { display: none; }
.email-login input { height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 14px; font: inherit; }
.email-login .or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 4px 0; }
.email-login .or::before, .email-login .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* calculators */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.calc { display: grid; gap: 12px; align-content: start; }
.calc .inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 14px; }
.calc label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.calc input, .calc select { height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 10px; font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; width: 100%; }
.calc .check { display: flex; align-items: center; gap: 8px; }
.calc .check input { width: 16px; height: 16px; }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-top: 10px; border-top: 1px solid var(--grid); }
.results div { display: grid; gap: 2px; }
.results span { font-size: 12px; color: var(--muted); }
.results b { font-size: 20px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.results b.good { color: var(--good-text); } .results b.bad { color: var(--critical); }
.calc .note { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.calc .note b { color: var(--ink); }
.plan { display: grid; gap: 8px; }
.plan-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.plan-row .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--s1); color: #fff; font-weight: 700; font-size: 13px; }
.plan-row b { display: block; font-size: 14px; } .plan-row span { font-size: 12.5px; color: var(--ink-2); }
.plan-row .eur { font-size: 18px; font-weight: 700; color: var(--good-text); white-space: nowrap; text-align: right; }
.plan-row .eur small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.plan-total { display: flex; justify-content: space-between; padding: 6px 4px 0; font-size: 14px; }
.offers td input { height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 8px; font: inherit; font-size: 13px; width: 100%; min-width: 80px; font-variant-numeric: tabular-nums; }
.offers td.name input { min-width: 150px; }
.offers .cheapest td { background: color-mix(in srgb, var(--good) 10%, transparent); }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }

/* explanation tab */
.kwh-hero { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0 6px; }
.kwh-hero .big { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; }
.kwh-hero span { color: var(--ink-2); font-size: 14px; }
.legend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; font-size: 13px; margin-top: 6px; }
.legend-list div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--grid); padding: 4px 0; }
.legend-list i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend-list b { font-variant-numeric: tabular-nums; }
.fixed-big { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; }
.fixed-rows { display: grid; gap: 6px; margin: 10px 0; font-size: 13.5px; }
.fixed-rows div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--grid); padding-bottom: 5px; }
.prose { font-size: 14px; line-height: 1.6; color: var(--ink-2); display: grid; gap: 10px; }
.prose b { color: var(--ink); }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.now-box { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; }
.now-box .blk { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff; }
.now-box b { font-size: 16px; } .now-box p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 24px; margin: 0; }
.glossary div { border-bottom: 1px solid var(--grid); padding-bottom: 10px; }
.glossary dt { font-weight: 650; color: var(--ink); margin-bottom: 3px; }
.glossary dd { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.who { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.who.sup { color: var(--s1); border-color: color-mix(in srgb, var(--s1) 40%, transparent); }

/* community counter + invite */
.k-progress { display: grid; gap: 6px; margin-top: 10px; max-width: 420px; }
.k-progress .bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.k-progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--s1), var(--s3)); border-radius: 8px; transition: width 1s cubic-bezier(.2,.7,.2,1); }
.k-progress span { font-size: 12.5px; color: var(--ink-2); }
.live { cursor: help; }
.live.stale i { background: var(--warning); box-shadow: none; animation: none; }

/* calculator controls: sliders + chips */
.ctls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 20px; }
.ctl { display: grid; gap: 7px; font-size: 13px; color: var(--ink-2); }
.ctl > span { display: flex; justify-content: space-between; gap: 8px; }
.ctl output { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ctl input[type=range] { width: 100%; accent-color: var(--s1); height: 22px; margin: 0; }
.ctl input[type=text] { height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 10px; font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.chips button:hover { border-color: color-mix(in srgb, var(--s1) 50%, var(--border)); }
.chips button.on { background: var(--s1); border-color: var(--s1); color: #fff; font-weight: 600; }
details.adv { border-top: 1px solid var(--grid); padding-top: 10px; }
details.adv summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.calc .results b { font-size: 22px; }
.calc .results div:first-child b { font-size: 26px; }

/* BETA badge (invoice reading) */
.beta { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 6px; font-size: 10px; font-weight: 750; letter-spacing: .06em; line-height: 1; vertical-align: middle;
  color: #3b2a00; background: linear-gradient(135deg, #ffd56a, #f5a524); box-shadow: 0 0 0 1px rgba(245,165,36,.35), 0 2px 8px rgba(245,165,36,.25); }
h2 .beta { height: 20px; font-size: 10.5px; margin-left: 4px; position: relative; top: -2px; }
.upload-btn .beta { margin-left: 2px; height: 16px; font-size: 9px; padding: 0 5px; }
.beta-note { margin-top: 6px; font-size: 12.5px; color: var(--ink-2); padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, #f5a524 10%, transparent); border: 1px solid color-mix(in srgb, #f5a524 30%, transparent); max-width: 80ch; }
@media (max-width: 720px) { .topbar .upload-btn .beta { display: none; } }
.invite-stat { font-size: 12.5px; margin: 2px 0 0; }
.invite-stat b { color: var(--good-text); font-size: 14px; }
.logo-img { width: 36px; height: 36px; border-radius: 11px; flex: none; box-shadow: 0 4px 14px -4px color-mix(in srgb, var(--s1) 60%, transparent); }
.ios-steps { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.ios-ic { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }

/* first-run tour */
#tour { position: fixed; inset: 0; z-index: 60; }
#tour[hidden] { display: none; }
.tour-hole { position: fixed; border-radius: 18px; box-shadow: 0 0 0 9999px rgba(5, 8, 14, .66), 0 0 0 2px var(--s1), 0 0 40px 4px color-mix(in srgb, var(--s1) 50%, transparent); transition: all .45s cubic-bezier(.2,.7,.2,1); pointer-events: none; }
.tour-card { position: fixed; display: grid; gap: 8px; padding: 18px 18px 14px; transition: top .45s cubic-bezier(.2,.7,.2,1), left .45s cubic-bezier(.2,.7,.2,1); }
.tour-card.in { animation: pop .45s cubic-bezier(.2,.7,.2,1); }
.tour-step { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--s1); font-weight: 700; }
.tour-card h3 { font-size: 18px; }
.tour-card p { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.tour-dots { display: flex; gap: 6px; margin-top: 4px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--grid); transition: width .3s, background .3s; }
.tour-dots i.on { width: 22px; background: var(--s1); }
.tour-btns { display: flex; justify-content: space-between; margin-top: 6px; }

/* ---------- day analysis ---------- */
.day-strip { display: flex; gap: 4px; align-items: end; padding: 12px 12px 8px; overflow-x: auto; scrollbar-width: thin; }
.day-strip button { flex: 1 0 30px; display: grid; grid-template-rows: 64px auto; gap: 4px; justify-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 2px; border-radius: 10px; font: inherit; transition: background .2s, color .2s; }
.day-strip button:hover { background: var(--surface-2); color: var(--ink); }
.day-strip button i { align-self: end; width: 70%; height: var(--h); min-height: 3px; border-radius: 5px 5px 2px 2px; background: color-mix(in srgb, var(--s1) 55%, var(--surface-2)); transform-origin: bottom; animation: grow .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 18ms); }
.day-strip button.free i { background: color-mix(in srgb, var(--s3) 55%, var(--surface-2)); }
.day-strip button.odd i { background: var(--serious); }
.day-strip button.on { background: var(--surface-2); color: var(--ink); }
.day-strip button.on i { background: linear-gradient(180deg, #6fb1ff, var(--s1)); box-shadow: 0 0 18px -2px var(--s1); }
.day-strip span { font-size: 10.5px; line-height: 1.15; text-align: center; }
@keyframes grow { from { transform: scaleY(0); } }

.day-hero { position: relative; overflow: hidden; display: grid; gap: 14px; padding: 22px 24px; }
.day-hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, var(--glow-1), transparent 65%); pointer-events: none; animation: drift 18s ease-in-out infinite alternate; }
.dh-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; position: relative; }
.dh-nums div { display: grid; gap: 2px; }
.dh-nums span { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.dh-nums b { font-size: clamp(30px, 3.6vw, 46px); font-weight: 720; letter-spacing: -0.035em; line-height: 1.05; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.dh-nums em { font-style: normal; font-variant-numeric: tabular-nums; }
.dh-nums small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.dh-nums .bad, .dh-story .bad { color: var(--critical); } .dh-nums .good, .dh-story .good { color: var(--good-text); }
.dh-story { position: relative; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); max-width: 95ch; }
.dh-story b { color: var(--ink); }
.dh-tags { display: flex; gap: 8px; flex-wrap: wrap; position: relative; }
.dh-tags span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.dh-tags .warn { color: var(--serious); border-color: color-mix(in srgb, var(--serious) 40%, transparent); }
.swap { animation: swapIn .5s cubic-bezier(.2,.7,.2,1); }
@keyframes swapIn { from { opacity: .2; transform: translateY(8px); } }

.day-blocks { display: grid; gap: 10px; }
.db-row { display: grid; grid-template-columns: 74px 1fr 76px 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.db-row.off { opacity: .45; }
.db-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.db-name i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); box-shadow: 0 0 10px -1px var(--c); }
.db-bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.db-bar i { display: block; height: 100%; width: var(--w); border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, transparent), var(--c)); transform-origin: left; animation: growX .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
@keyframes growX { from { transform: scaleX(0); } }
.db-kwh { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.db-row b { text-align: right; font-variant-numeric: tabular-nums; }

.day-events { display: grid; gap: 8px; }
.ev { display: grid; grid-template-columns: 64px 44px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); opacity: 0; animation: pop .5s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 70ms); transition: transform .2s, border-color .2s; }
.ev:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--s1) 45%, var(--border)); }
.ev-time { font-weight: 700; font-size: 16px; display: grid; font-variant-numeric: tabular-nums; }
.ev-time small { font-weight: 500; font-size: 12px; color: var(--muted); }
.ev-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--surface); border: 1px solid var(--border); }
.ev-body { display: grid; gap: 2px; min-width: 0; }
.ev-body span { color: var(--ink-2); font-size: 13px; }
.ev-body em { font-style: normal; font-size: 12.5px; color: var(--good-text); }
@media (max-width: 900px) {
  .dh-nums { grid-template-columns: 1fr 1fr; }
  .db-row { grid-template-columns: 64px 1fr 64px 60px; font-size: 12.5px; }
}
.bolt-img { border-radius: 22px; animation: pulse 1.6s ease-in-out infinite; }
.bolt-img.small { border-radius: 15px; animation: none; box-shadow: 0 8px 28px -8px var(--s1); }

/* ---------- tips (Nasveti) ---------- */
.tips-sum { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 22px 24px; position: relative; overflow: hidden;
  background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--s3) 20%, transparent), transparent 55%), var(--surface); }
.ts-big { display: grid; gap: 2px; }
.ts-big span { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.ts-big b { font-size: clamp(36px, 4.6vw, 56px); font-weight: 750; letter-spacing: -0.04em; color: var(--good-text); line-height: 1.05; }
.ts-big em { font-style: normal; font-variant-numeric: tabular-nums; }
.ts-big small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.tips-sum p { color: var(--ink-2); line-height: 1.6; max-width: 80ch; }
.today-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 130px; }
.th { display: grid; grid-template-rows: 1fr auto auto; height: 100%; align-items: end; justify-items: center; gap: 2px; position: relative; }
.th i { width: 100%; border-radius: 5px 5px 2px 2px; background: var(--c); opacity: .9; transform-origin: bottom; animation: grow .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 22ms); }
.th b { font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.th span { font-size: 10px; color: var(--muted); }
.th.now i { outline: 2px solid var(--ink); outline-offset: 2px; }
.th.now::before { content: "zdaj"; position: absolute; top: -16px; font-size: 9.5px; font-weight: 700; color: var(--ink); }
.tips-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.tip { display: grid; gap: 10px; align-content: start; opacity: 0; animation: pop .55s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 60ms); transition: transform .25s, border-color .25s; }
.tip:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--s3) 45%, var(--border)); }
.tip-head { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; }
.tip .ic, .eli5 .ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: var(--surface-2); border: 1px solid var(--border); }
.tip h3 { font-size: 16px; }
.tip-effort { font-size: 12px; color: var(--muted); }
.tip-save { text-align: right; display: grid; }
.tip-save b { font-size: 22px; color: var(--good-text); letter-spacing: -0.02em; }
.tip-save span { font-size: 11px; color: var(--muted); }
.tip p { color: var(--ink-2); line-height: 1.55; font-size: 14px; }
.tip ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; color: var(--ink-2); font-size: 13.5px; }
.eli5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.eli5 article { padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); display: grid; gap: 8px; align-content: start; }
.eli5 h3 { font-size: 15.5px; }
.eli5 p { font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.eli5 b { color: var(--ink); }
@media (max-width: 1200px) { .eli5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .tips-grid, .eli5 { grid-template-columns: 1fr; } .tips-sum { grid-template-columns: 1fr; } .today-strip { height: 110px; } .th b { display: none; } }

/* ---------- motion & depth ---------- */
.chart-loading { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.home-card, .kpi, .tip, .dh-nums > div { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .25s; will-change: transform; }
.tilt { transition: transform .08s linear, box-shadow .35s; box-shadow: 0 18px 40px -18px rgba(0,0,0,.55), var(--shadow);
  background-image: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255,255,255,.07), transparent 45%); }
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.home-card:first-child::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--ang), transparent 0 55%, color-mix(in srgb, var(--s1) 90%, transparent) 72%, #2fd3a0 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spinang 7s linear infinite; }
@keyframes spinang { to { --ang: 360deg; } }
.home-cards .home-card { opacity: 0; animation: pop .7s cubic-bezier(.2,.7,.2,1) forwards; }
.home-cards .home-card:nth-child(2) { animation-delay: .08s; } .home-cards .home-card:nth-child(3) { animation-delay: .16s; }
.sections a { position: relative; }
.sections a.active { box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--ink) 60%, transparent); }
@media (prefers-reduced-motion: reduce) { .home-card:first-child::before { animation: none; } .home-card, .kpi, .tip { transform: none; } }
/* entrance animations use `translate`/`scale` so they don't lock `transform` (needed for the tilt) */
@keyframes fadeUp { from { opacity: 0; translate: 0 14px; scale: .98; } to { opacity: 1; translate: 0 0; scale: 1; } }
.kpi, .tip, .home-cards .home-card { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); animation-name: fadeUp; }

/* ---------- calculators v2 ---------- */
.calc-nav { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.calc-nav button { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2,.7,.2,1), border-color .2s, background .2s, box-shadow .2s; }
.calc-nav button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--s1) 40%, var(--border)); }
.calc-nav button i { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 20px; background: var(--surface-2); transition: transform .3s; }
.calc-nav button b { font-size: 14px; }
.calc-nav button span { font-size: 11.5px; color: var(--muted); }
.calc-nav button.on { border-color: var(--s1); background: linear-gradient(135deg, color-mix(in srgb, var(--s1) 22%, var(--surface)), var(--surface)); box-shadow: 0 10px 30px -12px var(--s1); }
.calc-nav button.on i { transform: scale(1.08) rotate(-4deg); background: color-mix(in srgb, var(--s1) 25%, var(--surface-2)); }
.calc-panel.in { animation: fadeUp .45s cubic-bezier(.2,.7,.2,1); }
.calc-title { display: flex; gap: 12px; align-items: center; }
.calc-title > i { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-style: normal; font-size: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--s1) 30%, transparent), color-mix(in srgb, var(--s3) 25%, transparent)); border: 1px solid var(--border); }
.calc-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; margin-top: 6px; }
.calc .calc-body .ctls { grid-template-columns: 1fr; gap: 18px; }
.calc-out { position: sticky; top: 84px; display: grid; gap: 14px; padding: 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.calc-hero { display: grid; gap: 2px; }
.calc-hero span { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.calc-hero b { font-size: clamp(38px, 4.8vw, 58px); font-weight: 760; letter-spacing: -0.045em; line-height: 1.02; }
.calc-hero b.good { color: var(--good-text); } .calc-hero b.bad { color: var(--critical); }
.calc-hero em { font-style: normal; font-variant-numeric: tabular-nums; }
.calc-hero.bump b { animation: bump .45s cubic-bezier(.2,.7,.2,1); }
@keyframes bump { 40% { transform: scale(1.035); } }
.calc-bars { display: grid; gap: 10px; }
.cb { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; }
.cb span { color: var(--ink-2); }
.cb b { font-variant-numeric: tabular-nums; }
.cb i { grid-column: 1 / -1; height: 12px; border-radius: 8px; background: var(--surface); overflow: hidden; }
.cb s { display: block; height: 100%; width: 0; border-radius: 8px; transition: width .8s cubic-bezier(.2,.7,.2,1); }
.calc .calc-out .results { border-top: 1px solid var(--border); grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.calc .calc-out .results b { font-size: 17px; }
.calc .calc-out .results div:first-child b { font-size: 17px; }
.calc .note { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
/* sliders with a filled track */
.calc input[type=range] { -webkit-appearance: none; appearance: none; height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--s1) 0 var(--p, 50%), var(--surface-2) var(--p, 50%) 100%); outline: none; cursor: pointer; border: 1px solid var(--border); }
.calc input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--s1); box-shadow: 0 2px 10px rgba(0,0,0,.35); transition: transform .15s; }
.calc input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.calc input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--s1); box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.ctl-search small { font-size: 12px; line-height: 1.5; }
.search-box { position: relative; display: block; }
.search-box input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 14px 0 38px; font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
.search-box input:focus { outline: none; border-color: var(--s1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--s1) 22%, transparent); }
.search-box i { position: absolute; left: 13px; top: 50%; translate: 0 -50%; font-style: normal; color: var(--muted); font-size: 17px; pointer-events: none; }
@media (max-width: 1100px) { .calc-nav { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .calc-body { grid-template-columns: 1fr; } .calc-out { position: static; } }
@media (max-width: 560px) { .calc-nav { grid-template-columns: repeat(2, 1fr); } .calc-nav button span { display: none; } }

/* ---------- agreed power optimizer v2 ---------- */
.opt-grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: 28px; align-items: start; }
.opt-explain p { color: var(--ink-2); line-height: 1.6; font-size: 14px; margin-bottom: 10px; }
.opt-explain b { color: var(--ink); }
.opt-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.opt-sum div { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 1px; }
.opt-sum span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.opt-sum b { font-size: 24px; letter-spacing: -0.02em; }
.opt-sum small { font-size: 11.5px; color: var(--muted); }
.opt-sum .good b { color: var(--good-text); } .opt-sum .bad b { color: var(--critical); }
.opt-blocks { display: grid; gap: 14px; }
.ob { display: grid; gap: 6px; opacity: 0; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 70ms); }
.ob-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.ob-track { position: relative; height: 16px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.ob-peak { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; opacity: .85; transform-origin: left; animation: growX 1s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms + .1s); }
.ob-agreed, .ob-rec { position: absolute; top: -5px; bottom: -5px; width: 0; }
.ob-agreed { border-left: 3px solid var(--ink); }
.ob-rec { border-left: 3px dashed var(--good); }
.ob.over .ob-track { box-shadow: 0 0 0 2px color-mix(in srgb, var(--critical) 50%, transparent); }
.ob-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.ob-legend b { color: var(--ink); } .ob-legend b.rec { color: var(--good-text); }
.ob-key i { display: inline-block; width: 14px; height: 10px; margin: 0 4px 0 10px; vertical-align: middle; border-radius: 3px; }
.ob-key .k-peak { background: var(--s1); } .ob-key .k-agreed { border-left: 3px solid var(--ink); width: 0; border-radius: 0; height: 14px; } .ob-key .k-rec { border-left: 3px dashed var(--good); width: 0; border-radius: 0; height: 14px; }
.opt-steps { margin: 8px 0 6px; padding-left: 20px; display: grid; gap: 3px; }
.opt-steps a { color: var(--s1); }
@media (max-width: 900px) { .opt-grid { grid-template-columns: 1fr; } .opt-sum b { font-size: 19px; } }

/* ---------- similar households ---------- */
.similar-card { display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center; }
.sim-main { display: grid; gap: 8px; }
.sim-main p { color: var(--ink-2); line-height: 1.55; }
.sim-big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sim-big b { font-size: clamp(36px, 4.4vw, 52px); font-weight: 760; letter-spacing: -0.04em; }
.sim-big span { color: var(--ink-2); font-size: 15px; }
.sim-big.bad b { color: var(--critical); } .sim-big.good b { color: var(--good-text); }
.sim-actions { display: grid; gap: 8px; justify-items: end; }
@media (max-width: 900px) { .similar-card { grid-template-columns: 1fr; } .sim-actions { justify-items: start; } }
.sim-tiles { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; padding-top: 14px; }
.sim-tiles span { color: var(--muted); }
.sim-tiles small { color: var(--ink-2); line-height: 1.4; }

/* ---------- household dialog ---------- */
.hh { display: grid; gap: 14px; }
.hh-q { display: grid; gap: 8px; }
.hh-q > span { font-weight: 600; font-size: 14px; }
.hh-q[hidden] { display: none; }
.hh .chips { margin: 0; }

/* ---------- EV page ---------- */
.ev-hero { display: grid; gap: 14px; padding: 22px 24px; position: relative; overflow: hidden; background: radial-gradient(100% 140% at 100% 0%, color-mix(in srgb, var(--s3) 18%, transparent), transparent 55%), var(--surface); }
.ev-list { display: grid; gap: 8px; }
.ev-row { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.similar-card .state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.similar-card .state i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.similar-card .state.on { color: var(--good-text); } .similar-card .state.on i { background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: ping 2s infinite; }

/* overpaid: excess power + unused capacity */
.overpaid { display: grid; gap: 12px; padding-top: 6px; border-top: 1px solid var(--border); }
.overpaid h4 { margin: 4px 0 0; font-size: 15px; }
.op-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.op-cards > div { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 3px; }
.op-cards span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.op-cards b { font-size: 28px; letter-spacing: -0.03em; }
.op-cards small { font-size: 12.5px; color: var(--ink-2); }
.op-cards .bad b { color: var(--critical); } .op-cards .warn b { color: var(--serious); } .op-cards .good b { color: var(--good-text); }
.op-detail summary { cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 4px 0; }
.op-detail .pill { margin: 1px 4px 1px 0; }
.st { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.st-billed { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.st-informative { color: var(--serious); } .st-estimate { color: var(--muted); }
@media (max-width: 700px) { .op-cards { grid-template-columns: 1fr; } }

/* ---------- costs & invoices v2 ---------- */
.cost-hero { display: grid; grid-template-columns: 1.1fr 1.6fr; gap: 28px; align-items: center; padding: 24px 26px; position: relative; overflow: hidden;
  background: radial-gradient(110% 150% at 0% 0%, color-mix(in srgb, var(--s1) 20%, transparent), transparent 55%), radial-gradient(90% 120% at 100% 100%, color-mix(in srgb, var(--s3) 14%, transparent), transparent 60%), var(--surface); }
.ch-main { display: grid; gap: 6px; }
.ch-big { font-size: clamp(44px, 5.6vw, 72px); font-weight: 760; letter-spacing: -0.045em; line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.ch-big em { font-style: normal; font-variant-numeric: tabular-nums; }
.ch-big small { font-size: 22px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.ch-main .month-bar { margin-top: 8px; }
.ch-main .month-bar div { position: absolute; inset: 0 auto 0 0; border-radius: 8px; transition: width 1.4s cubic-bezier(.2,.7,.2,1); }
.ch-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ch-stats > div { padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface-2) 80%, transparent); border: 1px solid var(--border); display: grid; gap: 2px; align-content: start; }
.ch-stats span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.ch-stats b { font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ch-stats small { font-size: 12.5px; color: var(--ink-2); }
.ch-stats .bad { color: var(--critical); } .ch-stats .ok { color: var(--good-text); }
.ch-cover { grid-column: 1 / -1; display: grid; gap: 8px; padding-top: 16px; border-top: 1px dashed var(--border); }
.ch-cover-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.ch-cover .cm { display: grid; justify-items: center; gap: 5px; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.ch-cover .cm.invoice { cursor: default; color: var(--ink-2); }
.ch-cover .cm i { display: block; width: 100%; height: 10px; border-radius: 5px; border: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.ch-cover .cm.invoice i { border: 0; background: linear-gradient(90deg, var(--s1), var(--s3)); }
.ch-cover .cm.partial i { border-style: solid; border-color: var(--s1); background: linear-gradient(90deg, var(--s1) 50%, transparent 50%); }
.ch-cover .cm:not(.invoice):hover i { border-color: var(--s1); background: color-mix(in srgb, var(--s1) 14%, transparent); }
@media (max-width: 560px) { .ch-cover-months { gap: 3px; } .ch-cover .cm { font-size: 10px; } }

.money-split { display: grid; gap: 12px; }
.ms-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; gap: 2px; margin-bottom: 4px; }
.ms-bar i { display: block; height: 100%; transform-origin: left; animation: growX .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 80ms); }
.ms-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center; opacity: 0; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 60ms + .2s); }
.ms-dot { width: 12px; height: 12px; border-radius: 4px; }
.ms-row > div { display: grid; gap: 1px; }
.ms-row small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.ms-num { text-align: right; }
.ms-num b { font-variant-numeric: tabular-nums; font-size: 15px; }

.inv-layout { display: grid; grid-template-columns: 1.7fr 1fr; gap: 16px; align-items: start; }
.inv-list { display: grid; gap: 10px; }
.inv-list .empty { padding: 22px; }
.inv-card { display: grid; grid-template-columns: 46px minmax(0, 1.6fr) 1fr .8fr auto auto; gap: 16px; align-items: center; padding: 14px 16px; opacity: 0; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 50ms); transition: border-color .2s, transform .2s; }
.inv-card:hover { border-color: color-mix(in srgb, hsl(var(--h) 70% 55%) 55%, var(--border)); transform: translateY(-2px); }
.inv-ava { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-weight: 750; font-size: 15px; color: #fff; background: linear-gradient(135deg, hsl(var(--h) 70% 52%), hsl(calc(var(--h) + 40) 70% 42%)); box-shadow: 0 6px 18px -8px hsl(var(--h) 70% 50%); }
.inv-main { display: grid; gap: 2px; min-width: 0; }
.inv-main b { font-size: 15px; }
.inv-main > span { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.tag.on { color: var(--s1); border-color: color-mix(in srgb, var(--s1) 40%, transparent); background: color-mix(in srgb, var(--s1) 12%, transparent); }
.tag.warn { color: var(--serious); }
.inv-stat { display: grid; gap: 1px; }
.inv-stat span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.inv-stat b { font-size: 15px; font-variant-numeric: tabular-nums; }
.inv-stat small { font-size: 12px; color: var(--muted); }
.inv-stat .ok { color: var(--good-text); } .inv-stat .bad { color: var(--critical); }
.inv-sum { text-align: right; display: grid; }
.inv-sum b { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inv-sum small { font-size: 11.5px; color: var(--muted); }
.inv-acts { display: flex; gap: 6px; }
.icon-btn.danger:hover { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, var(--border)); }
.inv-layout .dropzone { position: sticky; top: 84px; min-height: 260px; background: radial-gradient(100% 100% at 50% 0%, color-mix(in srgb, var(--s1) 14%, transparent), transparent 70%), var(--surface); }
.inv-layout .dz-icon { background: linear-gradient(135deg, var(--s1), var(--s3)); box-shadow: 0 10px 30px -10px var(--s1); animation: floaty 4s ease-in-out infinite; }

/* price changes as a timeline */
.changes { gap: 0; padding-left: 14px; border-left: 2px solid var(--grid); }
.chg { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0 10px 12px; background: none; border-radius: 0; }
.chg::before { content: ""; position: absolute; left: -21px; top: 15px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--s1); }
.chg .when { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.chg .up { color: var(--critical); font-weight: 650; } .chg .down { color: var(--good-text); font-weight: 650; }
@media (max-width: 1100px) { .cost-hero { grid-template-columns: 1fr; } .inv-layout { grid-template-columns: 1fr; } .inv-layout .dropzone { position: static; min-height: 180px; order: -1; } }
@media (max-width: 760px) {
  .ch-stats { grid-template-columns: 1fr; }
  .inv-card { grid-template-columns: 42px 1fr auto; }
  .inv-card .inv-stat { grid-column: 2 / -1; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
  .inv-card .inv-sum { grid-column: 3; grid-row: 1; }
  .inv-card .inv-acts { grid-column: 2 / -1; }
}
.inv-list .empty[hidden] { display: none; }
.dz-private { font-size: 12px; color: var(--good-text); margin-top: 4px; }

/* timeline stats */
.tl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 2px 0 12px; }
.tl-stats > div { padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; gap: 1px; }
.tl-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tl-stats b { font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; transition: color .3s; }
.tl-stats b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tl-stats b.up { color: var(--critical); } .tl-stats b.down { color: var(--good-text); }
.tl-stats em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.tl-legend { grid-column: 1 / -1; display: flex; gap: 16px; flex-wrap: wrap; margin: 0; font-size: 12px; color: var(--ink-2); }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
@media (max-width: 760px) { .tl-stats { grid-template-columns: 1fr 1fr; } .tl-stats b { font-size: 18px; } }
.tl-legend span { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; color: var(--ink-2); }
.day-strip button.pending { opacity: .85; }
.day-strip button.pending i { height: 64px; background: repeating-linear-gradient(-45deg, var(--surface-2) 0 5px, transparent 5px 10px); border: 1px dashed var(--border); animation: none; }
.day-strip button.pending.on i { border-color: var(--s1); background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--s1) 30%, transparent) 0 5px, transparent 5px 10px); }

/* temperature */
.day-strip button { grid-template-rows: 64px auto auto; }
.day-strip em.t { font-style: normal; font-size: 10px; color: #e5484d; opacity: .85; line-height: 1; }
.temp-insight { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 12px 22px; align-items: center; margin-bottom: 8px; }
.temp-insight > div { display: grid; gap: 1px; }
.temp-insight b { font-size: 22px; letter-spacing: -0.02em; }
.temp-insight span { font-size: 12px; color: var(--muted); }
.temp-insight p { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; margin: 0; }
@media (max-width: 900px) { .temp-insight { grid-template-columns: 1fr 1fr 1fr; gap: 12px 14px; } .temp-insight p { grid-column: 1 / -1; } .temp-insight b { font-size: 19px; } .temp-insight span { font-size: 11.5px; } }
.temp-insight p b { font-size: inherit; letter-spacing: 0; }

/* ---------- phone: bottom tab bar & sheet ---------- */
.tabbar { display: none; }
@media (max-width: 720px) {
  .topbar { display: none; }
  main { padding-top: 18px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
    padding: 6px; border-radius: 22px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
    border: 1px solid var(--border); box-shadow: 0 12px 34px -10px rgba(0,0,0,.35); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 7px 2px 6px; border-radius: 16px; color: var(--muted); text-decoration: none; background: none; border: 0; font: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer; transition: color .2s, background .2s; }
  .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar .on { color: var(--s1); background: color-mix(in srgb, var(--s1) 13%, transparent); }
  .tabbar #tab-more svg circle { fill: currentColor; stroke: none; }
  #tip { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
}
dialog.sheet { margin: auto auto 0; width: 100vw; max-width: 100vw; max-height: 86vh; border-radius: 24px 24px 0 0; border-bottom: 0; padding: 0; }
dialog.sheet[open] { animation: sheetUp .35s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
.sheet-body { padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--grid); margin: 0 auto 2px; }
.sheet-acct { display: flex; gap: 12px; align-items: center; }
.sheet-acct .avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--s1), var(--s7)); }
.sheet-acct div { display: grid; } .sheet-acct span.muted { font-size: 12.5px; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sheet-grid a { display: grid; justify-items: center; gap: 4px; padding: 12px 4px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 600; }
.sheet-grid a i { font-style: normal; font-size: 22px; }
.sheet-grid a.on { border-color: var(--s1); background: color-mix(in srgb, var(--s1) 12%, var(--surface-2)); }
.sheet-actions { display: grid; gap: 2px; border-top: 1px solid var(--border); padding-top: 8px; }
.sheet-actions button { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; text-align: left; border-radius: 12px; cursor: pointer; }
.sheet-actions button:active { background: var(--surface-2); }
.sheet-actions i { font-style: normal; width: 26px; text-align: center; font-size: 18px; }

/* ---------- settings v2 ---------- */
dialog.st-dialog { width: min(640px, 96vw); max-height: 90vh; overflow: hidden; }
.st-form { display: flex; flex-direction: column; max-height: 90vh; }
.st-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.st-top h3 { font-size: 18px; }
.st-body { overflow: auto; padding: 14px 18px; display: grid; gap: 12px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.st-foot { display: flex; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface); }
.st-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; background: var(--surface-2); display: grid; gap: 12px; }
.st-head, .st-adv summary { display: flex; gap: 12px; align-items: flex-start; }
.st-head > i, .st-adv summary > i { font-style: normal; font-size: 20px; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); flex: none; }
.st-head div, .st-adv summary div { display: grid; gap: 2px; flex: 1; }
.st-head b, .st-adv summary b { font-size: 15px; }
.st-head span, .st-adv summary span { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.st-head span b { font-size: inherit; color: var(--ink-2); }
.st-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.st-field { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); }
.st-field > span:first-child { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 18px; }
.st-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.st-input:focus-within { border-color: var(--s1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--s1) 18%, transparent); }
.st-input input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; color: var(--ink); padding: 0 4px 0 12px; font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; outline: none; }
.st-input em { font-style: normal; font-size: 12px; color: var(--muted); padding-right: 12px; white-space: nowrap; }
.st-field.big .st-input input { height: 46px; font-size: 18px; font-weight: 650; }
.st-note { font-size: 12px; color: var(--muted); margin: 0; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.st-adv summary { cursor: pointer; list-style: none; }
.st-adv summary::-webkit-details-marker { display: none; }
.st-adv .chev { font-style: normal; font-size: 22px; color: var(--muted); transition: transform .25s; align-self: center; }
.st-adv[open] .chev { transform: rotate(90deg); }
.st-group { display: grid; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.st-group h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.st-card .chips { margin: 0; }
@media (max-width: 720px) {
  dialog.st-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .st-form { height: 100dvh; max-height: 100dvh; }
  .st-top { padding-top: calc(14px + env(safe-area-inset-top)); }
  .st-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .st-foot .btn { flex: 1; }
  .st-fields { grid-template-columns: 1fr 1fr; }
  .st-fields:has(.big) { grid-template-columns: 1fr; }
}
.sheet-foot { text-align: center; margin: 0; }
.brand { flex: 0 1 auto; min-width: 0; }
.brand p { max-width: 24ch; }
.sections { min-width: 0; flex: 1 1 auto; }

/* community counters */
.comm-estimate { margin-bottom: 14px; line-height: 1.5; }
.comm-estimate:empty { display: none; }
.comm-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comm-counts > div { display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); opacity: 0; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: calc(var(--i) * 80ms); }
.comm-counts i { grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 20px; background: var(--surface-2); }
.comm-counts b { font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.comm-counts span { font-size: 12.5px; color: var(--ink-2); }
.comm-counts p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) { .comm-counts { grid-template-columns: 1fr; } }

.comm-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 16px; }
.comm-scope p { flex-basis: 100%; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); transition: background .2s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch input:checked + i { background: color-mix(in srgb, var(--s1) 30%, var(--surface-2)); border-color: var(--s1); }
.switch input:checked + i::after { transform: translateX(16px); background: var(--s1); }
.switch input:focus-visible + i { outline: 2px solid var(--s1); outline-offset: 2px; }
#hh-biz-hint { display: block; margin-top: 6px; }
body.vstop { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--page); }
.vstop-card { max-width: 420px; width: 100%; display: grid; gap: 12px; }
.vstop-card h2 { margin: 0; }

.invite-dlg { display: grid; gap: 14px; max-width: 480px; }
.inv-link { display: flex; gap: 8px; }
.inv-link input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--page); color: var(--ink); padding: 0 12px; font: inherit; font-size: 13.5px; }
.inv-ways { display: flex; gap: 8px; flex-wrap: wrap; }
.inv-ways .btn { text-decoration: none; }
.inv-link[hidden], .inv-ways[hidden] { display: none; }
.invite-dlg .card-head { flex-wrap: nowrap; align-items: flex-start; gap: 12px; }
.invite-dlg .card-head .icon-btn { flex: none; }

.beta-note.testers { line-height: 1.55; }
.dropzone.flash { animation: dzFlash 1.6s ease-out; }
@keyframes dzFlash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--s1) 55%, transparent); border-color: var(--s1); } 100% { box-shadow: 0 0 0 0 transparent; } }

.tl-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; }
.tl-tog { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; transition: background .15s, color .15s, border-color .15s; }
.tl-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tl-tog i { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--c); display: grid; place-items: center; flex: none; }
.tl-tog input:checked + i { background: var(--c); }
.tl-tog input:checked + i::after { content: ''; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.tl-tog:has(input:checked) { color: var(--ink); background: var(--surface); border-color: color-mix(in srgb, var(--c, var(--border)) 45%, var(--border)); }
.tl-tog:has(input:focus-visible) { outline: 2px solid var(--s1); outline-offset: 2px; }

.temp-sw { flex: none; white-space: nowrap; }

/* ---------- new layout (beta, html[data-ui="new"]): sidebar ≥ 1100 px, icon rail 721–1099 px, bottom bar ≤ 720 px ---------- */
.sidebar, .subnav { display: none; }
[data-ui="new"] .topbar .brand, [data-ui="new"] .topbar .sections { display: none; }
[data-ui="new"] .subnav { display: flex; align-items: center; flex: 1; min-width: 0; }
[data-ui="new"] .sn-title { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-ui="new"] .sn-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 2px; scroll-behavior: smooth; }
[data-ui="new"] .sn-tabs::-webkit-scrollbar { display: none; }
[data-ui="new"] .sn-tabs a { color: var(--ink-2); text-decoration: none; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 550; white-space: nowrap; transition: background .2s, color .2s; }
[data-ui="new"] .sn-tabs a:hover { background: var(--surface-2); }
[data-ui="new"] .sn-tabs a.on { background: var(--ink); color: var(--page); }
/* offers and plan are their own pages in the new layout: no calculator switcher above them */
[data-ui="new"] #calc .calc-nav [data-tab="offers"], [data-ui="new"] #calc .calc-nav [data-tab="plan"] { display: none; }
[data-ui="new"] #calc[data-tab="offers"] > .section-title, [data-ui="new"] #calc[data-tab="offers"] > .calc-nav,
[data-ui="new"] #calc[data-tab="plan"] > .section-title, [data-ui="new"] #calc[data-tab="plan"] > .calc-nav { display: none; }

[data-ui="new"] .sidebar { display: flex; flex-direction: column; gap: 18px; position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 25; padding: 14px 12px 16px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border-right: 1px solid var(--border); overflow-y: auto; scrollbar-width: none; }
[data-ui="new"] body { padding-left: 236px; }
.sb-brand { display: flex; gap: 10px; align-items: center; padding: 4px 6px; color: var(--ink); text-decoration: none; min-width: 0; }
.sb-brand img { flex: none; }
.sb-brand > span { display: grid; min-width: 0; }
.sb-brand b { font-size: 15px; white-space: nowrap; }
.sb-brand small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-nav { display: grid; gap: 2px; }
.sb-sec { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 550; transition: background .2s, color .2s; }
.sb-sec svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.sb-sec:hover { background: var(--surface-2); color: var(--ink); }
.sb-sec.on { color: var(--s1); background: color-mix(in srgb, var(--s1) 13%, transparent); }
.sb-sub { display: grid; gap: 1px; margin: 2px 0 8px 22px; padding-left: 20px; border-left: 1px solid var(--grid); }
.sb-sub a { padding: 6px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 13px; }
.sb-sub a:hover { background: var(--surface-2); }
.sb-sub a.on { color: var(--ink); font-weight: 650; background: var(--surface-2); }
.sb-foot { margin-top: auto; display: grid; gap: 2px; }
.sb-ui { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; text-align: left; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.sb-ui:hover { background: var(--surface-2); color: var(--ink); }

@media (max-width: 1099px) { /* icon rail */
  [data-ui="new"] .sidebar { width: 76px; padding: 12px 8px; gap: 14px; align-items: stretch; }
  [data-ui="new"] body { padding-left: 76px; }
  [data-ui="new"] .sb-brand { justify-content: center; padding: 4px 0; }
  [data-ui="new"] .sb-brand > span, [data-ui="new"] .sb-sub, [data-ui="new"] .sb-ui span { display: none; }
  [data-ui="new"] .sb-sec { flex-direction: column; gap: 3px; padding: 8px 2px; font-size: 10.5px; font-weight: 600; text-align: center; }
  [data-ui="new"] .sb-foot .sb-sec span { display: none; }
  [data-ui="new"] .sb-ui { text-align: center; padding: 8px 0; }
  [data-ui="new"] .sections { display: none; }
}
@media (max-width: 720px) { /* phone: compact top bar with the page tabs, bottom bar with the sections */
  [data-ui="new"] .sidebar { display: none; }
  [data-ui="new"] body { padding-left: 0; }
  [data-ui="new"] .topbar { display: flex; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; }
  [data-ui="new"] .topbar .actions > :not(.acct) { display: none; }
  [data-ui="new"] .topbar .avatar { width: 34px; height: 34px; }
  [data-ui="new"] .sn-tabs { margin-left: -4px; }
  [data-ui="new"] main { padding-top: 14px; }
}

/* new layout: dashboard */
[data-ui="classic"] .ui-new { display: none !important; }
[data-ui="new"] .home-cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.home-cards .home-card:nth-child(4) { animation-delay: .24s; }
.home-card.alert { border-color: color-mix(in srgb, var(--critical) 55%, var(--border)); }
.home-card.alert .hero-num { color: var(--critical); }
.home-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { /* two cards side by side, the fuel card across the full width: prices left, history right */
  .home-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #home-fuel-card { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); grid-template-areas: "head head" "now chart" "km chart"; column-gap: 24px; align-content: start; }
  #home-fuel-card > .card-head { grid-area: head; } #home-fuel { grid-area: now; } #ch-home-fuel { grid-area: chart; height: 100% !important; min-height: 110px; } #home-fuel-km { grid-area: km; }
}
@media (min-width: 1500px) { /* room for three in a row */
  .home-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #home-fuel-card { grid-column: auto; display: block; }
  #ch-home-fuel { height: 96px !important; min-height: 0; }
}
.spot { display: grid; gap: 6px; }
.spot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.spot-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; height: 64px; }
.spot-bars > div { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--grid); }
.spot-bars i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--muted) 45%, transparent); transition: height .8s cubic-bezier(.2,.7,.2,1); }
.spot-bars i.best { background: var(--good); }
.spot-bars i.now { background: var(--s1); }
.spot-bars i.neg { background: var(--s3); }
.spot-lbl { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; font-size: 11.5px; color: var(--muted); }
#home-plan .plan-total { display: flex; justify-content: space-between; padding: 8px 4px 0; font-size: 13px; }
.spot-bars > div.pending { border-bottom-style: dashed; }
@media (max-width: 720px) { /* phone: the number cards become a swipeable row, so the charts below are reachable sooner */
  [data-ui="new"] .home-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 -16px; padding: 2px 16px 6px; scroll-padding: 0 16px; }
  [data-ui="new"] .home-cards::-webkit-scrollbar { display: none; }
  [data-ui="new"] .home-cards .home-card { scroll-snap-align: start; }
}
.fuel-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.fuel-now > div { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.fuel-now span { font-size: 12px; color: var(--muted); }
.fuel-now b { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.fuel-now b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.fuel-now em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.fuel-now em.up { color: var(--critical); } .fuel-now em.down { color: var(--good-text); }
#home-fuel-km { color: var(--ink-2); margin-top: 6px; }
.fuel-now { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.fuel-now > div { display: grid; gap: 1px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.fuel-now span { font-size: 12px; color: var(--muted); }
.fuel-now b { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.fuel-now b small { font-size: 11px; color: var(--muted); font-weight: 500; }
.fuel-now em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); }
.fuel-now em.up { color: var(--critical); } .fuel-now em.down { color: var(--good-text); }
#home-fuel-km { color: var(--ink-2); margin-top: 6px; }
