/* Swiss Electricity Tariff Database — light theme, palette per dataviz spec */
:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --good: #0ca30c;
  --warning: #fab219;
  --critical: #d03b3b;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- top bar ---------- */
#topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  z-index: 20;
}
#brand { display: flex; align-items: center; gap: 10px; }
#brand .logo { font-size: 22px; }
#brand h1 { font-size: 16px; margin: 0; font-weight: 650; }
#brand .sub { font-size: 11.5px; color: var(--muted); }

#modes {
  display: flex;
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.mode {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.mode:hover { background: rgba(11,11,11,0.05); }
.mode.active { background: var(--surface); color: var(--ink); font-weight: 600;
               box-shadow: 0 1px 2px rgba(11,11,11,0.10); }

#controls { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; }
#controls label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
#controls select {
  font: inherit; font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  max-width: 230px;
}

#searchbox { position: relative; }
#search {
  font: inherit; font-size: 13px;
  padding: 6px 10px;
  width: 230px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
#search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
#search-results {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 300px;
  max-height: 320px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(11,11,11,0.14);
  z-index: 50;
}
#search-results .group { padding: 6px 10px 2px; font-size: 11px; text-transform: uppercase;
                          letter-spacing: 0.04em; color: var(--muted); }
#search-results .item { display: block; width: 100%; text-align: left; border: 0;
  background: none; font: inherit; padding: 7px 12px; cursor: pointer; color: var(--ink); }
#search-results .item:hover { background: rgba(42,120,214,0.08); }
#search-results .item small { color: var(--muted); }

/* ---------- layout ---------- */
main { position: relative; flex: 1; display: flex; min-height: 0; }
#map { flex: 1; background: #eef2f5; }

/* The panel carries a whole DSO — tariff tables, JSON, charts — and 400px was
   whatever fitted the first screen it was built on. The width is the reader's
   call, and it is remembered so it does not have to be made again. */
#panel-resizer {
  flex: 0 0 6px;
  cursor: col-resize;
  background: var(--border);
  position: relative;
}
#panel-resizer::after {          /* a wider grab area than the visible line */
  content: ""; position: absolute; inset: 0 -4px;
}
#panel-resizer:hover, #panel-resizer:focus-visible,
#panel-resizer.dragging { background: var(--accent, #2a78d6); outline: none; }
body.resizing-panel { cursor: col-resize; user-select: none; }

#panel {
  width: 400px;
  max-width: 44vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 18px 28px;
}

/* ---------- legend ---------- */
#legend {
  position: absolute;
  left: 14px;
  bottom: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(11,11,11,0.08);
  z-index: 10;
  max-width: 260px;
}
#legend h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; }
.legend-row { display: flex; align-items: center; gap: 7px; margin: 3px 0; color: var(--ink-2); }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border); flex: none; }
/* the caution stripes that mark unverified, machine-read data on the map */
.legend-hatch {
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 2px,
    rgba(120,78,8,0.62) 2px, rgba(120,78,8,0.62) 3.4px);
}

/* ---------- map tooltip ---------- */
#map-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(11,11,11,0.16);
  padding: 7px 10px;
  font-size: 12.5px;
  z-index: 30;
  max-width: 260px;
}
#map-tooltip .t-name { font-weight: 600; margin-bottom: 2px; }
#map-tooltip .t-val { color: var(--ink-2); }

/* ---------- panel content ---------- */
#panel h2 { font-size: 17px; margin: 4px 0 2px; }
#panel h3 { font-size: 13px; margin: 20px 0 8px; color: var(--ink-2);
            text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.panel-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stat-tile {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.stat-tile .v { font-size: 21px; font-weight: 650; }
.stat-tile .v small { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.stat-tile .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.delta-up { color: #a02c2c; }        /* higher price = adverse */
.delta-down { color: #006300; }      /* success text token */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 999px; padding: 3px 10px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border);
}
.badge.good { color: #006300; background: rgba(12,163,12,0.10); }
.badge.warning { color: #7a5200; background: rgba(250,178,25,0.16); }
.badge.critical { color: var(--critical); background: rgba(208,59,59,0.10); }
.badge.neutral { color: var(--ink-2); background: var(--page); }

figure.chart { margin: 0 0 6px; }
figure.chart figcaption { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.chart svg { display: block; width: 100%; height: auto; background: var(--surface); }

.chart-tip {
  position: fixed;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(11,11,11,0.16);
  padding: 6px 9px;
  font-size: 12px;
  z-index: 60;
}
.chart-tip b { display: block; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data th, table.data td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--grid);
}
table.data th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* the component currently selected in the header — highlighted in rankings */
table.data td.hl, table.data th.hl { font-weight: 700; color: var(--ink); }

.muni-list { columns: 2; font-size: 12.5px; color: var(--ink-2); padding-left: 18px; margin: 6px 0; }
details summary { cursor: pointer; font-size: 13px; color: var(--accent); margin: 6px 0; }

.back-btn {
  border: 1px solid var(--border);
  background: var(--page);
  border-radius: 6px;
  font: inherit; font-size: 12.5px;
  padding: 5px 10px;
  cursor: pointer;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.back-btn:hover { background: rgba(11,11,11,0.05); }

.note { font-size: 12px; color: var(--muted); line-height: 1.45; }
.spinner { color: var(--muted); padding: 30px 0; text-align: center; }

@media (max-width: 900px) {
  main { flex-direction: column; }
  #panel { width: 100%; max-width: none; border-left: 0; border-top: 1px solid var(--border);
           max-height: 45vh; }
  /* stacked layout: there is no horizontal edge left to drag */
  #panel-resizer { display: none; }
  #legend { bottom: auto; top: 12px; }
}

/* --- completion programme progress ------------------------------------------ */
.rd-head { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.rd-bars { display: flex; flex-direction: column; gap: 6px; }
.rd-row { display: grid; grid-template-columns: 108px 1fr 60px 46px;
  align-items: center; gap: 8px; font-size: 12px; }
.rd-label { color: var(--ink-2); }
.rd-track { position: relative; height: 12px; border-radius: 6px;
  background: var(--page); border: 1px solid var(--border); overflow: hidden; }
.rd-fill { position: absolute; inset: 0 auto 0 0; background: #1c7f3e; border-radius: 6px; }
/* pale bar behind the count bar = share of the supplied area */
.rd-fill.area { background: rgba(28,127,62,0.25); }
.rd-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.rd-num span { color: var(--muted); }
.rd-need { color: var(--muted); }

/* --- cross-check findings grouped by reviewer action ------------------------ */
.fgroup { border: 1px solid var(--border); border-radius: 8px; margin: 8px 0;
  background: var(--surface); }
.fgroup > summary { cursor: pointer; padding: 8px 10px; font-size: 12.5px;
  list-style-position: inside; }
.fgroup > summary:hover { background: var(--page); }
.fgroup > .finding { margin: 0 10px 8px; }

/* --- workbench: path to an acknowledged data set ---------------------------- */
.checklist { border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); padding: 10px 12px; margin: 8px 0 16px; }
.ck-head { font-weight: 650; font-size: 13px; display: flex; align-items: center;
  gap: 8px; margin-bottom: 8px; }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck-step { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; }
.ck-mark { flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
  border: 1px solid var(--border); background: var(--page); color: var(--ink-2); }
.ck-step.done > .ck-mark { background: #1c7f3e; border-color: #1c7f3e; color: #fff; }
.ck-step.todo > .ck-mark { background: #fff3d6; border-color: #eda100; color: #7a5200; }
.ck-body { display: flex; flex-direction: column; font-size: 12.5px; line-height: 1.35; }
.ck-body small { color: var(--muted); }
.ck-body .ck-todo { color: #7a5200; }
.ck-step.done .ck-body b { color: var(--muted); font-weight: 500; }
.ck-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.btn-primary { padding: 6px 12px; border: 0; border-radius: 7px; cursor: pointer;
  background: #1c7f3e; color: #fff; font-weight: 600; font-size: 12.5px; }
.btn-primary[data-force] { background: #eda100; color: #3a2a00; }
.btn-ghost { padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); cursor: pointer; font-size: 12px; color: var(--ink-2); }
.btn-ghost:hover { background: var(--page); }
.flash { background: rgba(12,163,12,0.10); border: 1px solid rgba(12,163,12,0.35);
  color: #006300; border-radius: 8px; padding: 7px 10px; font-size: 12.5px;
  margin: 6px 0; }
.fbar { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 7px; }
.finding.resolved { opacity: 0.62; }

/* --- feed-in matrix builder ------------------------------------------------- */
.fi-scroll { overflow-x: auto; }
.fi-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.fi-table th { text-align: left; font-weight: 600; color: var(--muted);
  padding: 3px 4px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.fi-table td { padding: 3px 4px; vertical-align: middle; }
.fi-table select, .fi-table input { font-size: 12px; padding: 3px 4px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
  max-width: 140px; }


/* --- collection a reviewer can start from the page ------------------------ */

.ck-run { display: block; margin-top: 4px; }

.job-btn {
  font-size: 12px;
  padding: 3px 9px;
}
.job-btn[disabled] { opacity: .55; cursor: not-allowed; }

.job-last {
  margin-left: 7px;
  font-size: 11.5px;
  color: var(--muted);
}
.job-last.failed { color: var(--critical); }


/* --- filing documents fetched by hand ------------------------------------- */

/* `display: flex` below would otherwise beat the hidden attribute's own
   display: none, leaving an invisible full-screen overlay that swallows every
   click on the page behind it. */
#import-panel[hidden] { display: none; }

#import-panel {
  position: fixed;
  inset: 0;
  background: rgba(11, 11, 11, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow: auto;
}

.import-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  width: min(940px, 100%);
  box-shadow: 0 12px 40px rgba(11, 11, 11, 0.22);
}

.import-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

#import-plan { max-height: 55vh; overflow: auto; margin-top: 10px; }

.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--grid);
  padding: 4px 6px;
  position: sticky;
  top: 0;
  background: var(--surface);
}
.imp-table td { padding: 3px 6px; border-bottom: 1px solid var(--grid); }
.imp-table tr.sure td { background: rgba(12, 163, 12, 0.05); }
.imp-table tr.unsure td { background: rgba(250, 178, 25, 0.10); }
.imp-table tr.none td { background: rgba(208, 59, 59, 0.07); }
.imp-path { color: var(--muted); font-size: 11.5px; }

/* --- chart controls ----------------------------------------------------------
   The profile chart answers three different questions depending on how it is
   read — what each component costs, what the customer pays in total, and what
   the live market is doing right now — so how it is drawn is the reader's
   choice rather than ours. */
.chart-controls { display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap; margin: 2px 0 8px; }
.seg-group { display: inline-flex; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden; }
.seg { border: 0; background: var(--surface); font: inherit; font-size: 12px;
  padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.seg + .seg { border-left: 1px solid var(--border); }
.seg:hover { background: rgba(42,120,214,0.08); }
.seg.on { background: var(--accent); color: #fff; }
.chart-controls select { font-size: 12px; padding: 4px 6px; max-width: 100%; }

/* The legend is the control: clicking a component drops it from the chart. */
.chart-legend { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 8px; }
.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; border-radius: 5px; background: none;
  font: inherit; font-size: 12px; color: var(--ink-2); cursor: pointer;
  padding: 2px 6px; }
.chart-legend .lg:hover { border-color: var(--border); }
.chart-legend .lg .sw { width: 12px; height: 3px; border-radius: 2px; }
.chart-legend .lg.off { color: var(--muted); text-decoration: line-through; }
.chart-legend .lg.off .sw { opacity: 0.3; }
.lg-live { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  color: #0a7a3f; border: 1px solid rgba(10,122,63,0.35); border-radius: 3px;
  padding: 0 3px; }

/* the DSO panel's counterpart to the map's caution stripes */
.unverified-note {
  border: 1px solid var(--caution-line, #e6d2ab);
  border-left: 3px solid #8a5a12;
  background: var(--caution-soft, #fbf2e2);
  border-radius: 4px; padding: 8px 11px; margin: 8px 0;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2, #3d4652);
}
.unverified-note b { color: #6d4708; }

/* ---------- Path A: find one tariff ---------- */
.pa {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--page);
  padding: 10px 12px;
  margin: 10px 0 14px;
}
.pa-head { font-size: 12px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.pa-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pa-field { display: flex; flex-direction: column; gap: 3px;
  font-size: 11px; color: var(--muted); }
.pa-field select { font: inherit; font-size: 13px; padding: 5px 6px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--ink); width: 100%; }
.pa-field select:disabled { color: var(--muted); background: var(--page); }

.pa-card { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.pa-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pa-name { font-size: 15px; font-weight: 650; }
.pa-meta { font-size: 12px; color: var(--muted); margin: 3px 0 8px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pa-price { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 8px; }
.pa-big { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pa-big small { font-size: 12px; font-weight: 500; color: var(--muted); }
.pa-cmp { font-size: 13px; font-weight: 600; }
.pa-cmp small { display: block; font-size: 10.5px; font-weight: 400;
  color: var(--muted); max-width: 180px; line-height: 1.3; }
.pa-cmp.up { color: #a02c2c; }      /* above the median = dearer */
.pa-cmp.down { color: #006300; }
.pa-windows, .pa-lines { margin: 6px 0; }
.pa-windows td, .pa-lines td { padding: 3px 8px 3px 0; }
.pa-warn {
  background: var(--caution-soft, #fbf2e2);
  border: 1px solid var(--caution-line, #e6d2ab);
  border-left: 3px solid #8a5a12;
  border-radius: 4px; padding: 7px 10px; margin: 8px 0 4px;
  font-size: 12px; color: var(--ink-2); }

@media (max-width: 520px) {
  .pa-fields { grid-template-columns: 1fr; }
}

/* ============================================================================
   The tariff finder (body.finder) — the public front page.

   The status page keeps the rules above; everything here belongs to the page
   that answers "what does electricity cost here, and what is it made of".
   ========================================================================= */

body.finder #controls { gap: 12px; }
body.finder #controls label.check { gap: 6px; cursor: pointer; }
body.finder #controls label.check input { accent-color: var(--accent); }
body.finder #controls label[hidden] { display: none; }

#secondary { display: flex; align-items: center; gap: 12px; margin-left: 14px;
  font-size: 12px; }
#secondary a { color: var(--muted); text-decoration: none; }
#secondary a:hover { color: var(--accent); text-decoration: underline; }
#langswitch { display: flex; gap: 2px; }
.lang { border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 4px; padding: 2px 6px; font-size: 11px; cursor: pointer; }
.lang.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- legend ---------- */
body.finder #legend { padding: 10px 12px; font-size: 11.5px; }
.lg-title { font-weight: 650; margin-bottom: 6px; font-size: 12px; }
.lg-row { display: flex; align-items: center; gap: 7px; margin: 3px 0; color: var(--ink-2); }
.lg-row i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--border);
  flex: none; }
.lg-note { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--grid);
  color: var(--muted); max-width: 230px; line-height: 1.4; }
.lg-note.strong { color: var(--ink-2); font-weight: 600; }

/* ---------- map tooltip ---------- */
body.finder #map-tooltip { padding: 7px 10px; line-height: 1.45; }
.tt-name { font-weight: 650; margin-bottom: 3px; }
.tag.dyn { color: #7a5200; background: rgba(250,178,25,0.16); border-radius: 3px;
  padding: 0 5px; font-size: 11px; }

/* ---------- panel: the start state ---------- */
.start .lead { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; margin: 6px 0 16px; }
.start h3 { font-size: 13px; margin: 22px 0 6px; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: 0.04em; }
.start p { line-height: 1.55; color: var(--ink-2); font-size: 13px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; }
.tile b { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile span { font-size: 12px; color: var(--ink-2); margin-left: 4px; }
.tile em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted);
  margin-top: 3px; }
.partkeys, .stack-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.pk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
  color: var(--ink-2); }
.pk i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.pk b { font-variant-numeric: tabular-nums; }

/* ---------- panel: an operator ---------- */
.dso .back { border: 0; background: none; color: var(--accent); cursor: pointer;
  padding: 0; font-size: 12.5px; }
.dso h2 { margin: 6px 0 14px; font-size: 18px; line-height: 1.25; }

.chooser { display: grid; gap: 8px; background: var(--surface); padding: 12px;
  border: 1px solid var(--border); border-radius: 8px; }
.chooser label { display: grid; grid-template-columns: 118px 1fr; align-items: center;
  gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.chooser select, .chooser input {
  width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 5px 7px;
  background: var(--page); color: var(--ink); font: inherit; font-size: 12.5px; }
.chooser .kwh { display: flex; align-items: center; gap: 6px; }
.chooser .kwh input { width: 96px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- the headline figure ---------- */
.headline { margin: 16px 0 4px; }
.headline .big { display: inline-flex; align-items: baseline; gap: 5px; margin-right: 18px; }
.headline .big b { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em; }
.headline .big span { font-size: 13px; color: var(--ink-2); }
.headline .big.alt b { font-size: 24px; color: var(--ink-2); }
.headline .at { font-size: 12px; color: var(--muted); margin-top: 2px; }
.headline .split { font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }

/* ---------- the composition bar ---------- */
.stack { display: flex; height: 34px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); }
.stack .seg { display: flex; align-items: center; justify-content: center;
  min-width: 2px; transition: width 180ms ease; }
.stack .seg span { color: #fff; font-size: 11.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; text-shadow: 0 1px 1px rgba(0,0,0,0.25); }

/* ---------- the line-item table ---------- */
table.bill { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.bill th, table.bill td { padding: 8px 6px; border-bottom: 1px solid var(--grid);
  vertical-align: top; text-align: left; }
table.bill thead th { color: var(--muted); font-weight: 600; font-size: 11.5px;
  white-space: nowrap; }
table.bill tbody th { font-weight: 600; width: 30%; }
table.bill tbody th i { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
  margin-right: 5px; }
table.bill tbody th em { display: block; font-style: normal; font-weight: 400;
  font-size: 11px; color: var(--muted); margin: 2px 0 0 14px; line-height: 1.35; }
table.bill .num { text-align: right; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
table.bill .num small { color: var(--muted); font-size: 10.5px; }
table.bill td.tariff select { width: 100%; max-width: 100%; font: inherit; font-size: 12px;
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px;
  background: var(--page); color: var(--ink); }
table.bill td.tariff select:disabled { background: var(--surface); color: var(--ink-2);
  -webkit-appearance: none; appearance: none; }
.fixed-name { font-weight: 500; }
.why { display: block; font-style: normal; font-size: 11px; color: var(--muted);
  margin-top: 3px; line-height: 1.3; }
.why.flag { color: #7a5200; font-weight: 600; }
tr.needs-check { background: rgba(250, 178, 25, 0.07); }

/* ---------- the time-of-use chart ---------- */
.tou { margin: 10px 0 18px; }
.tou-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px;
  font-weight: 600; margin-bottom: 6px; }
.tou-head i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.tou-panel { margin: 6px 0; }
.tou-label { font-size: 11.5px; color: var(--muted); margin-bottom: 1px; }
.tou svg { display: block; width: 100%; height: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px; }
.tou svg .ax { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.tou svg .ax.right { text-anchor: end; }
.tou svg .grid { stroke: var(--grid); stroke-width: 1; }

table.mini { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
table.mini td, table.mini th { padding: 4px 6px; border-bottom: 1px solid var(--grid);
  text-align: left; }
table.mini thead th { color: var(--muted); font-weight: 600; font-size: 11px; }
table.mini .num { text-align: right; font-variant-numeric: tabular-nums; }
table.mini .num small { color: var(--muted); font-size: 10px; }

/* ---------- notices and small print ---------- */
.dso .warn { background: rgba(250, 178, 25, 0.13); border-left: 3px solid var(--warning);
  padding: 8px 10px; border-radius: 0 5px 5px 0; font-size: 12.5px; color: var(--ink-2);
  line-height: 1.45; margin: 12px 0; }
details.notes, details.federal { margin: 12px 0; }
details.notes ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px;
  color: var(--ink-2); line-height: 1.5; }
details.notes li { margin-bottom: 5px; }
.source { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--grid);
  font-size: 12px; }
.source a { color: var(--accent); }
.loading { padding: 24px 0; color: var(--muted); }
.muted { color: var(--muted); }
.muted.pad { padding: 8px 10px; }

body.finder #search-results button { display: block; width: 100%; text-align: left;
  border: 0; background: none; padding: 6px 10px; font: inherit; font-size: 12.5px;
  cursor: pointer; color: var(--ink); }
body.finder #search-results button:hover { background: rgba(42,120,214,0.08); }

@media (max-width: 900px) {
  .chooser label { grid-template-columns: 1fr; gap: 3px; }
  .tiles { grid-template-columns: 1fr; }
}

.caption { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin: 8px 0 0; }

/* A bill the sheet cannot complete — a dynamic tariff's work price lives on a
   quarter-hourly feed, so there is no total to print. */
.headline.partial .big b { color: var(--ink-2); }
.headline .plus { margin: 8px 0 0; font-size: 13px; color: var(--ink-2);
  line-height: 1.5; }
.headline .plus b { color: var(--ink); }
.dyn-src { font-size: 12px; color: var(--muted); margin: 6px 0 0; word-break: break-all; }
.dyn-src a { color: var(--accent); }
.stack .seg.unknown { flex: 1 0 22%; min-width: 40px;
  background: repeating-linear-gradient(135deg, #e6e5df 0 6px, #f4f3ef 6px 12px); }
.pk i.unknown { background: repeating-linear-gradient(135deg, #e6e5df 0 3px, #f4f3ef 3px 6px);
  border: 1px solid var(--border); }
table.bill .dyn { color: #7a5200; font-weight: 600; }
table.bill tr.unpriced { background: rgba(250, 178, 25, 0.05); }

/* the Gemeinde picker sits under the fee tariff's own selector */
table.bill td.tariff select[data-bfs] { margin-top: 5px; }

/* An operator's customerType can be a paragraph (Romande Energie files a whole
   product description). It is the DSO's own text and stays available — but
   clamped, expanding on hover/focus, instead of dwarfing the numbers. */
table.bill td.tariff .why {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
table.bill td.tariff:hover .why, table.bill td.tariff:focus-within .why {
  -webkit-line-clamp: unset;
}
