/* --- Themes ---------------------------------------------------------------------------------------
   <html data-theme="..."> picks one (User.theme, see app/themes.py); "auto" follows the device (plain light by
   day, black in the dark). Each theme sets the page colours and its "sky": the light behind the glass panels,
   taken from the Nordic light it's named after. Panels are frosted glass (--glass with a backdrop blur) over
   it; --card is the same panel as a solid colour, for text on colour and for browsers or people that don't
   want transparency. The data palettes (price-level ramp, smart-plan orange, statistics slots --s1..--s8) are
   validated against every theme's --card: light for frost/midsummer/sand/contrast/daylight/tonight/paper/lavender, dark
   for the others (auto, tonight-auto and lavender-auto: each by the device). */

/* Light data palette */
:root {
  color-scheme: light;
  --lvl-cheap: #86b6ef; --lvl-normal: #2a78d6; --lvl-high: #104281; --planned: #eb6834;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --s-other: #7d858f; --s-unknown: #bfc4ca;
}
/* Dark data palette */
:root[data-theme="dark"], :root[data-theme="nord"], :root[data-theme="oled"], :root[data-theme="forest"], :root[data-theme="evening"],
:root[data-theme="tonight-dark"], :root[data-theme="lavender-dark"], :root[data-theme="black"] {
  color-scheme: dark;
  --lvl-cheap: #256abf; --lvl-normal: #5598e7; --lvl-high: #b7d3f6; --planned: #d95926;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --s-other: #8a939e; --s-unknown: #4d5560;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    color-scheme: dark;
    --lvl-cheap: #256abf; --lvl-normal: #5598e7; --lvl-high: #b7d3f6; --planned: #d95926;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #8a939e; --s-unknown: #4d5560;
  }
}

/* Frost (key "light"): a clear winter morning over a fjord, low sun to the east */
:root[data-theme="light"] {
  --bg: #eef2f4; --card: #fafcfc; --text: #16202a; --muted: #5a6872; --border: rgb(22 32 42 / 0.10); --grid: rgb(22 32 42 / 0.08);
  --accent: #24617a; --accent-text: #fff; --danger: #a5372b;
  --ok-bg: rgb(36 132 96 / 0.12); --err-bg: rgb(165 55 43 / 0.11); --info-bg: rgb(36 97 122 / 0.10);
  --glass: rgb(255 255 255 / 0.64); --edge: rgb(255 255 255 / 0.75);
  --sky: radial-gradient(55% 60% at 92% 0%, #f5dcc0 0%, rgb(245 220 192 / 0) 100%),
         radial-gradient(75% 70% at 0% 100%, #c6dce7 0%, rgb(198 220 231 / 0) 100%),
         linear-gradient(180deg, #e3ecf1 0%, #eff3f4 60%, #f3f5f4 100%);
  --shadow: 0 30px 60px -40px rgb(22 32 42 / 0.28);
}
/* Polar night (key "dark"): the long blue night, a thin aurora low in the north */
:root[data-theme="dark"] {
  --bg: #0b111a; --card: #141b25; --text: #e6edf2; --muted: #95a3af; --border: rgb(255 255 255 / 0.09); --grid: rgb(255 255 255 / 0.08);
  --accent: #86d8b6; --accent-text: #062016; --danger: #f0897a;
  --ok-bg: rgb(134 216 182 / 0.13); --err-bg: rgb(240 137 122 / 0.14); --info-bg: rgb(120 160 230 / 0.13);
  --glass: rgb(20 27 37 / 0.78); --edge: rgb(255 255 255 / 0.10);
  --sky: radial-gradient(80% 38% at 18% -4%, rgb(70 190 150 / 0.30) 0%, transparent 70%),
         radial-gradient(60% 50% at 100% 100%, rgb(60 80 160 / 0.30) 0%, transparent 70%),
         linear-gradient(180deg, #0c1420 0%, #0a0f17 100%);
  --shadow: 0 30px 60px -40px rgb(0 0 0 / 0.7);
}
/* Midsummer (light): the night that never gets dark, pale rose sky over a pine shore */
:root[data-theme="midsummer"] {
  --bg: #f4f0f0; --card: #fdfbfb; --text: #1f1d24; --muted: #625d68; --border: rgb(31 29 36 / 0.10); --grid: rgb(31 29 36 / 0.08);
  --accent: #2c5b4b; --accent-text: #fff; --danger: #a8352c;
  --ok-bg: rgb(44 91 75 / 0.12); --err-bg: rgb(168 53 44 / 0.11); --info-bg: rgb(80 90 160 / 0.10);
  --glass: rgb(255 255 255 / 0.62); --edge: rgb(255 255 255 / 0.75);
  --sky: radial-gradient(70% 55% at 50% -12%, #f7d9cf 0%, transparent 70%),
         radial-gradient(60% 50% at 100% 100%, #dfe3f3 0%, transparent 70%),
         linear-gradient(180deg, #f1e9ec 0%, #f6f3f3 60%, #f4f4f1 100%);
  --shadow: 0 30px 60px -40px rgb(31 29 36 / 0.26);
}
/* Forest (dark): spruce at dusk, moss green */
:root[data-theme="forest"] {
  --bg: #101413; --card: #191e1d; --text: #e7ebe8; --muted: #9ba49f; --border: rgb(255 255 255 / 0.08); --grid: rgb(255 255 255 / 0.07);
  --accent: #7cc7a6; --accent-text: #0e1a14; --danger: #f08a78;
  --ok-bg: rgb(124 199 166 / 0.13); --err-bg: rgb(240 138 120 / 0.14); --info-bg: rgb(120 170 190 / 0.12);
  --glass: rgb(25 30 29 / 0.78); --edge: rgb(255 255 255 / 0.09);
  --sky: radial-gradient(70% 45% at 80% -6%, rgb(90 150 110 / 0.22) 0%, transparent 70%),
         linear-gradient(180deg, #121816 0%, #0e1211 100%);
  --shadow: 0 30px 60px -40px rgb(0 0 0 / 0.7);
}
/* Nord: cool blue-grey, frost accent */
:root[data-theme="nord"] {
  --bg: #20242d; --card: #2a2f3a; --text: #eceff4; --muted: #a7b1c2; --border: rgb(236 239 244 / 0.10); --grid: rgb(236 239 244 / 0.08);
  --accent: #88c0d0; --accent-text: #1d2129; --danger: #e5838c;
  --ok-bg: rgb(163 190 140 / 0.16); --err-bg: rgb(229 131 140 / 0.16); --info-bg: rgb(136 192 208 / 0.14);
  --glass: rgb(42 47 58 / 0.80); --edge: rgb(236 239 244 / 0.10);
  --sky: radial-gradient(70% 50% at 15% -8%, rgb(136 192 208 / 0.18) 0%, transparent 70%),
         linear-gradient(180deg, #232833 0%, #1e222a 100%);
  --shadow: 0 30px 60px -40px rgb(0 0 0 / 0.6);
}
/* OLED: true black, saves power on OLED phones (no sky) */
:root[data-theme="oled"] {
  --bg: #000; --card: #0b0b0c; --text: #f2f2f2; --muted: #9c9c9c; --border: rgb(255 255 255 / 0.12); --grid: rgb(255 255 255 / 0.09);
  --accent: #3ddc97; --accent-text: #00140b; --danger: #ff6b6b;
  --ok-bg: rgb(61 220 151 / 0.13); --err-bg: rgb(255 107 107 / 0.14); --info-bg: rgb(90 150 230 / 0.14);
  --glass: rgb(11 11 12 / 0.80); --edge: rgb(255 255 255 / 0.10);
  --sky: none;
  --shadow: none;
}
/* Lingon (key "sand"): birch-bark paper, lingonberry red */
:root[data-theme="sand"] {
  --bg: #f1eee9; --card: #fcfbf9; --text: #26221f; --muted: #66605a; --border: rgb(38 34 31 / 0.11); --grid: rgb(38 34 31 / 0.08);
  --accent: #962d3c; --accent-text: #fff; --danger: #a52a1e;
  --ok-bg: rgb(60 120 80 / 0.12); --err-bg: rgb(165 42 30 / 0.11); --info-bg: rgb(70 100 140 / 0.10);
  --glass: rgb(255 255 255 / 0.62); --edge: rgb(255 255 255 / 0.75);
  --sky: radial-gradient(60% 50% at 90% -8%, #efd9cf 0%, transparent 70%),
         radial-gradient(60% 50% at 0% 100%, #e3e6dc 0%, transparent 70%),
         linear-gradient(180deg, #eeeae4 0%, #f4f2ee 100%);
  --shadow: 0 30px 60px -40px rgb(38 34 31 / 0.26);
}
/* Automatic (key "auto", and no theme): everyone's standard. Plain light by day, black in the dark, following the
   device; neutral greys and an ordinary blue (light blue at night) */
:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #111418; --muted: #555c66; --border: rgb(17 20 24 / 0.12); --grid: rgb(17 20 24 / 0.08);
  --accent: #1f5fbf; --accent-text: #fff; --danger: #b3261e;
  --ok-bg: rgb(30 130 80 / 0.10); --err-bg: rgb(179 38 30 / 0.09); --info-bg: rgb(31 95 191 / 0.09);
  --glass: rgb(255 255 255 / 0.72); --edge: rgb(255 255 255 / 0.80);
  --sky: linear-gradient(180deg, #eff1f4 0%, #f6f7f9 45%);
  --shadow: 0 30px 60px -40px rgb(17 20 24 / 0.22);
}
/* Light (key "plain") and Dark ("black"): Automatic's two halves, whatever the device says (the header's switch) */
:root[data-theme="plain"] { color-scheme: light; }
:root[data-theme="black"] {
  --bg: #0a0a0b; --card: #161618; --text: #f2f2f3; --muted: #a1a1aa; --border: rgb(255 255 255 / 0.10); --grid: rgb(255 255 255 / 0.07);
  --accent: #8ec5ff; --accent-text: #0a0a0b; --danger: #ff8f7a;
  --ok-bg: rgb(110 200 150 / 0.13); --err-bg: rgb(255 143 122 / 0.14); --info-bg: rgb(142 197 255 / 0.13);
  --glass: rgb(22 22 24 / 0.82); --edge: rgb(255 255 255 / 0.09);
  --sky: none;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]), :root[data-theme="auto"] {
    --bg: #0a0a0b; --card: #161618; --text: #f2f2f3; --muted: #a1a1aa; --border: rgb(255 255 255 / 0.10); --grid: rgb(255 255 255 / 0.07);
    --accent: #8ec5ff; --accent-text: #0a0a0b; --danger: #ff8f7a;
    --ok-bg: rgb(110 200 150 / 0.13); --err-bg: rgb(255 143 122 / 0.14); --info-bg: rgb(142 197 255 / 0.13);
    --glass: rgb(22 22 24 / 0.82); --edge: rgb(255 255 255 / 0.09);
    --sky: none;
    --shadow: none;
  }
}
/* Daylight and Evening, made with the Human Claude design: cool daylight paper, slate text, spruce green; the same
   at night */
:root[data-theme="daylight"] {
  --bg: #f5f7f6; --card: #ffffff; --text: #1f2b30; --muted: #59666b; --border: rgb(31 43 48 / 0.12); --grid: rgb(31 43 48 / 0.08);
  --accent: #1e6b57; --accent-text: #fff; --danger: #b3261e;
  --ok-bg: rgb(30 107 87 / 0.10); --err-bg: rgb(179 38 30 / 0.09); --info-bg: rgb(90 123 208 / 0.10);
  --glass: rgb(255 255 255 / 0.70); --edge: rgb(255 255 255 / 0.80);
  --sky: linear-gradient(180deg, #ecf2ef 0%, #f5f7f6 45%);
  --shadow: 0 30px 60px -40px rgb(31 43 48 / 0.25);
}
:root[data-theme="evening"] {
  --bg: #11181b; --card: #182226; --text: #e7eeec; --muted: #9aa9a7; --border: rgb(255 255 255 / 0.09); --grid: rgb(255 255 255 / 0.07);
  --accent: #6cc9a6; --accent-text: #08241a; --danger: #f08a7e;
  --ok-bg: rgb(108 201 166 / 0.13); --err-bg: rgb(240 138 126 / 0.14); --info-bg: rgb(110 150 230 / 0.13);
  --glass: rgb(24 34 38 / 0.80); --edge: rgb(255 255 255 / 0.09);
  --sky: linear-gradient(180deg, #131c20 0%, #0f1518 100%);
  --shadow: 0 30px 60px -40px rgb(0 0 0 / 0.7);
}
/* Tonight light and Tonight dark (keys "tonight", "tonight-dark"), from the "Tonight, plotted" canvas: cool paper
   white, blue-black ink and signal green; the same at night with mint. "tonight-auto" is light by day and dark in
   the dark, following the device. */
:root[data-theme="tonight"], :root[data-theme="tonight-auto"] {
  --bg: #f5f7fa; --card: #ffffff; --text: #0c1420; --muted: #4a5668; --border: rgb(12 20 32 / 0.12); --grid: rgb(12 20 32 / 0.08);
  --accent: #0b7a57; --accent-text: #fff; --danger: #b3261e;
  --ok-bg: rgb(11 122 87 / 0.10); --err-bg: rgb(179 38 30 / 0.09); --info-bg: rgb(31 95 191 / 0.09);
  --glass: rgb(255 255 255 / 0.72); --edge: rgb(255 255 255 / 0.80);
  --sky: linear-gradient(180deg, #edf1f6 0%, #f5f7fa 45%);
  --shadow: 0 30px 60px -40px rgb(12 20 32 / 0.25);
}
:root[data-theme="tonight-dark"] {
  --bg: #0c1420; --card: #131c2b; --text: #e8eef6; --muted: #a9b7ca; --border: rgb(255 255 255 / 0.10); --grid: rgb(255 255 255 / 0.07);
  --accent: #7ee0b8; --accent-text: #0c1420; --danger: #ff8f7a;
  --ok-bg: rgb(126 224 184 / 0.13); --err-bg: rgb(255 143 122 / 0.14); --info-bg: rgb(142 197 255 / 0.13);
  --glass: rgb(19 28 43 / 0.80); --edge: rgb(255 255 255 / 0.09);
  --sky: linear-gradient(180deg, #0f1828 0%, #0a111b 100%);
  --shadow: 0 30px 60px -40px rgb(0 0 0 / 0.7);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="tonight-auto"] {
    color-scheme: dark;
    --lvl-cheap: #256abf; --lvl-normal: #5598e7; --lvl-high: #b7d3f6; --planned: #d95926;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #8a939e; --s-unknown: #4d5560;
    --bg: #0c1420; --card: #131c2b; --text: #e8eef6; --muted: #a9b7ca; --border: rgb(255 255 255 / 0.10); --grid: rgb(255 255 255 / 0.07);
    --accent: #7ee0b8; --accent-text: #0c1420; --danger: #ff8f7a;
    --ok-bg: rgb(126 224 184 / 0.13); --err-bg: rgb(255 143 122 / 0.14); --info-bg: rgb(142 197 255 / 0.13);
    --glass: rgb(19 28 43 / 0.80); --edge: rgb(255 255 255 / 0.09);
    --sky: linear-gradient(180deg, #0f1828 0%, #0a111b 100%);
    --shadow: 0 30px 60px -40px rgb(0 0 0 / 0.7);
  }
}
/* Lavender (keys "lavender", "lavender-dark"; "lavender-auto" follows the device), from the design proposal the
   design Studio was made after: cool white, ink blue, a violet accent; at night a deep violet grey and lilac */
:root[data-theme="lavender"], :root[data-theme="lavender-auto"] {
  --bg: #f7f7fb; --card: #ffffff; --text: #24273b; --muted: #676b80; --border: rgb(36 39 59 / 0.09); --grid: rgb(36 39 59 / 0.07);
  --accent: #5849bd; --accent-text: #fff; --danger: #c0392b;
  --ok-bg: rgb(74 155 114 / 0.12); --err-bg: rgb(192 57 43 / 0.09); --info-bg: rgb(88 73 189 / 0.08);
  --glass: rgb(255 255 255 / 0.80); --edge: rgb(255 255 255 / 0.80);
  --sky: none;
  --shadow: 0 3px 10px rgb(40 32 76 / 0.03);
}
:root[data-theme="lavender-dark"] {
  --bg: #121220; --card: #1c1c2e; --text: #ececf6; --muted: #a3a5bd; --border: rgb(255 255 255 / 0.09); --grid: rgb(255 255 255 / 0.07);
  --accent: #a99cff; --accent-text: #17142e; --danger: #ff8f7a;
  --ok-bg: rgb(126 224 184 / 0.13); --err-bg: rgb(255 143 122 / 0.14); --info-bg: rgb(169 156 255 / 0.13);
  --glass: rgb(28 28 46 / 0.85); --edge: rgb(255 255 255 / 0.08);
  --sky: none;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="lavender-auto"] {
    color-scheme: dark;
    --lvl-cheap: #256abf; --lvl-normal: #5598e7; --lvl-high: #b7d3f6; --planned: #d95926;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
    --s-other: #8a939e; --s-unknown: #4d5560;
    --bg: #121220; --card: #1c1c2e; --text: #ececf6; --muted: #a3a5bd; --border: rgb(255 255 255 / 0.09); --grid: rgb(255 255 255 / 0.07);
    --accent: #a99cff; --accent-text: #17142e; --danger: #ff8f7a;
    --ok-bg: rgb(126 224 184 / 0.13); --err-bg: rgb(255 143 122 / 0.14); --info-bg: rgb(169 156 255 / 0.13);
    --glass: rgb(28 28 46 / 0.85); --edge: rgb(255 255 255 / 0.08);
    --sky: none;
    --shadow: none;
  }
}
/* Utility paper (key "paper"), from the canvas's "Swedish utility print": unbleached paper, black ink, forest green */
:root[data-theme="paper"] {
  --bg: #f3efe6; --card: #faf8f2; --text: #1a1a17; --muted: #5c5a52; --border: rgb(26 26 23 / 0.16); --grid: rgb(26 26 23 / 0.09);
  --accent: #1d6b47; --accent-text: #fff; --danger: #9c2a2a;
  --ok-bg: rgb(29 107 71 / 0.10); --err-bg: rgb(156 42 42 / 0.10); --info-bg: rgb(31 79 138 / 0.09);
  --glass: rgb(250 248 242 / 0.80); --edge: rgb(255 255 255 / 0.70);
  --sky: none;
  --shadow: none;
}
/* High contrast: black on white, strong borders and focus rings, no glass */
:root[data-theme="contrast"] {
  --bg: #fff; --card: #fff; --text: #000; --muted: #333; --border: #000; --grid: #8a8a8a;
  --accent: #003c9e; --accent-text: #fff; --danger: #a00000;
  --ok-bg: #d4f0d4; --err-bg: #f8d4d4; --info-bg: #d9e6fb;
  --glass: #fff; --edge: #000; --sky: none;
  --shadow: none;
}
:root[data-theme="contrast"] :focus-visible { outline: 3px solid #000; outline-offset: 2px; }
:root[data-theme="contrast"] a:not(.button) { text-decoration: underline; }

/* Derived from each theme's colours */
:root {
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --surface-2: color-mix(in srgb, var(--text) 4%, transparent);
  --field: color-mix(in srgb, var(--card) 72%, transparent);
  --ring: color-mix(in srgb, var(--accent) 40%, transparent);
  --blur: saturate(1.5) blur(22px);
  --radius: 24px; --radius-sm: 12px;
}
/* Glass needs the blur behind it: without it (or for people who ask for less transparency) panels are solid */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --glass: var(--card); } }
@media (prefers-reduced-transparency: reduce) { :root { --glass: var(--card); --field: var(--card); } }

/* --- Base ------------------------------------------------------------------------------------------ */
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/static/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: transparent; color: var(--text);  /* the sky (body::before) shows through */
  font: 16px/1.6 "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* The sky: fixed behind everything (background-attachment: fixed is ignored on phones) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--sky), var(--bg); pointer-events: none; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
h1, h2, h3 { margin-top: 0; font-weight: 520; letter-spacing: -0.02em; line-height: 1.2; }
h1 { font-size: 2.1rem; font-weight: 480; letter-spacing: -0.03em; }
h2 { font-size: 1.32rem; margin-top: 24px; }
h3 { font-size: 1.06rem; font-weight: 600; letter-spacing: -0.01em; }
.card > h2:first-child, .card > .row:first-child h2 { margin-top: 0; }

/* Header: a floating glass bar */
.top {
  position: sticky; top: 12px; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  max-width: 1048px; margin: 12px auto 0; padding: 8px 10px 8px 14px; border-radius: 20px;
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--edge); box-shadow: var(--shadow);
}
@media (max-width: 1080px) { .top { margin: 12px 16px 0; } }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.015em; text-decoration: none; color: var(--text); white-space: nowrap; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-text); }
.brand-mark svg { width: 22px; height: 22px; }  /* the Prisdalen mark: price bars, the bolt on the lowest */
.top nav { gap: 2px; margin-left: auto; }
.lang-switch button.flag { display: inline-grid; place-items: center; padding: 6px; background: none; border: 0; border-radius: 10px; cursor: pointer; box-shadow: none; }
.lang-switch button.flag svg { width: 22px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px var(--border); display: block; }
.lang-switch button.flag:hover { background: var(--surface-2); }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; }
.lang-switch button.mode svg { width: 18px; height: 18px; border-radius: 0; box-shadow: none; fill: none; stroke: currentColor; stroke-width: 1.8; color: var(--muted); }
.lang-switch button.mode:hover svg { color: var(--text); }
.top nav a, .top nav button.link { padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 500; text-decoration: none; }
.top nav a:hover, .top nav button.link:hover { color: var(--text); background: var(--surface-2); }
.top nav a[aria-current="page"] { color: var(--text); background: var(--field); box-shadow: 0 0 0 1px var(--border); }
@media (max-width: 720px) {
  .top { flex-wrap: wrap; top: 8px; margin: 8px 10px 0; padding: 8px 10px 4px; border-radius: 18px; }
  .top nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding-bottom: 4px; order: 2; }
  .lang-switch { margin-left: auto; }
  .lang-switch button.flag { padding: 4px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a, .top nav button.link { white-space: nowrap; padding: 6px 11px; }
  .top .news-link { display: inline-block; margin-left: auto; text-decoration: none; }
  .top .news-link + nav + .lang-switch { margin-left: 8px; }  /* the menu scrolls: Admin's count may be out of sight */
}
.news-link { display: none; }
/* Hooks for the design previews (base.html): the page's own title, the date, menu icons; not shown in the standard design */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.page-head, .nav-icon, .nav-label, .side-tip, .top-tools, .page-intro, .hero-visual, .studio-only { display: none; }
.tonight { display: none; }  /* the dashboard's "Tonight" is only rendered for the Human Claude design */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Layout: glass panels with room around them */
main { max-width: 1080px; margin: 48px auto 96px; padding: 0 16px; }
.card {
  background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--edge); border-radius: var(--radius); padding: 32px; margin-bottom: 28px; box-shadow: var(--shadow);
}
@media (max-width: 600px) { main { margin-top: 24px; padding: 0 12px; } .card { padding: 22px 18px; border-radius: 20px; margin-bottom: 20px; } }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: 0.86em; }
.warn { color: var(--danger); }
code { font: 0.86em/1.4 ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
pre.code { overflow-x: auto; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85em; }
pre.code code { background: none; padding: 0; }

/* Forms */
label { display: block; margin-bottom: 16px; font-weight: 500; font-size: 0.95em; }
input[type=email], input[type=password], input:not([type]), input[type=number], input[type=time], input[type=text], input[type=search], select, textarea {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--field); color: var(--text); font: inherit; font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=email], input[type=password], input:not([type]) { display: block; width: 100%; margin-top: 6px; }
textarea { display: block; width: 100%; margin-top: 6px; resize: vertical; }
input:hover, select:hover { border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
.row input:not([type]) { display: inline-block; width: auto; flex: 1; min-width: 160px; margin: 0; }
select { padding: 8px 10px; max-width: 100%; }
label > select:has(+ .small) { display: block; margin-top: 6px; }
label > select + .small { display: block; margin-top: 6px; font-weight: 400; }
/* the login forms of car brands (vehicle_scan.html): every field on its own line, full width */
.card.narrow label > input[type=text], .card.narrow label > select { display: block; width: 100%; margin-top: 6px; }

/* Buttons */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border: 1px solid transparent; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover, .button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
button.secondary, .button.secondary { background: var(--field); color: var(--text); border-color: var(--border); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 25%, var(--border)); }
button.link { display: inline; background: none; color: var(--accent); padding: 0; border: 0; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
button.danger, .danger { color: var(--danger); }
button.toggle.off { background: var(--muted); }
button.small, a.button.small { padding: 5px 12px; font-size: 0.9em; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.inline, .actions form { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-size: 0.86em; font-weight: 500; color: var(--muted); border-bottom-color: var(--border); }
tbody tr:last-child td { border-bottom: 0; }
@media (min-width: 601px) { td.actions { display: table-cell; } }
td code { background: none; padding: 0; }
.actions > form { min-width: 0; max-width: 100%; }
.actions select { max-width: 100%; }
.saved-logins { margin-top: 14px; }
.saved-logins form { display: inline; }

/* Messages and states */
.flash { padding: 14px 18px; border-radius: 16px; background: var(--info-bg); border: 1px solid var(--edge); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.flash.success { background: var(--ok-bg); }
.flash.error { background: var(--err-bg); color: var(--text); box-shadow: inset 3px 0 0 var(--danger); }
/* A page's messages as notes at the bottom when it reloaded where you were (base.html): solid, above the page */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 16px; translate: -50% 0; display: grid; gap: 8px; width: min(560px, calc(100% - 32px)); }
.toasts .flash { position: relative; margin: 0; padding-right: 44px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); color: var(--text);
  border: 1px solid var(--border); box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.35); backdrop-filter: none; -webkit-backdrop-filter: none; }
.toasts .flash.success { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.toasts .flash.error { background: color-mix(in srgb, var(--danger) 10%, var(--card)); }
.toast-close { position: absolute; top: 8px; right: 10px; padding: 4px 8px; font-size: 1.2rem; line-height: 1; color: var(--muted); text-decoration: none; }
ol.steps { padding-left: 1.4em; margin: 8px 0 18px; }
/* a charger's own price (dashboard settings) */
form.charger-price .actions { margin-bottom: 8px; }
table.price-periods { width: auto; margin: 4px 0 8px; }
table.price-periods th, table.price-periods td { padding: 4px 6px 4px 0; border: 0; }
table.price-periods input[type=time] { width: 7.5em; margin: 0; }
table.price-periods input[type=number] { width: 6em; margin: 0; }
@media (max-width: 600px) {
  table.price-periods { width: 100%; }
  table.price-periods thead { display: none; }
  table.price-periods tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
  table.price-periods td { display: block; padding: 0; }
  table.price-periods input[type=time], table.price-periods input[type=number], table.price-periods select { width: 100%; }
}
ol.steps li { margin-bottom: 8px; line-height: 1.5; }
.app-settings dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0; }
.app-settings dt { color: var(--muted); }
.app-settings dd { margin: 0; overflow-wrap: anywhere; }
.car-live.updating { opacity: 0.6; transition: opacity 0.3s; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 550; }
[hidden] { display: none !important; }  /* elements a script hides, also those with a display of their own (.check) */
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.account { border: 1px solid var(--border); border-radius: 16px; padding: 18px; margin-bottom: 14px; background: var(--surface-2); }
.account-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.charger { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.8em; font-weight: 550;
  background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
h1 .status, h2 .status { font-size: 0.8rem; vertical-align: middle; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.status.charging { background: var(--ok-bg); border-color: transparent; }
.status.charging::before { background: var(--accent); }
.status.waiting { background: var(--info-bg); border-color: transparent; }
.status.waiting::before { background: var(--lvl-normal); }
.status.offline { background: var(--err-bg); border-color: transparent; }
.status.offline::before { background: var(--danger); }
.events { margin: 6px 0 0; padding-left: 18px; }
/* Admin: what's new since the last visit (the menu's count and the page's top) */
.badge { display: inline-block; min-width: 1.4em; padding: 0 6px; border-radius: 999px; background: var(--danger); color: var(--card);
  font-size: 0.75em; font-weight: 600; line-height: 1.5; text-align: center; vertical-align: 0.1em; }
.news { border-left: 3px solid var(--danger); padding: 4px 0 4px 12px; margin: 8px 0 16px; }
.news h2 { margin-top: 0; }
.events li.new { font-weight: 500; }
@media (max-width: 600px) {
  table thead { display: none; }
  table td { display: block; border: 0; padding: 2px 0; }
  table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
}
/* A BRF page: the board's part under its own heading */
.section-title { margin: 48px 0 16px; padding-top: 16px; border-top: 1px solid var(--border); font-weight: 480; }
/* A BRF's charging per member: three short columns, which fit a phone as a table */
@media (max-width: 600px) {
  table.billing tr { display: table-row; padding: 0; }
  table.facts.billing td, table.facts.billing th { display: table-cell; width: auto; padding: 6px 6px 6px 0; border-bottom: 1px solid var(--border); }
  table.facts.billing td:not(:first-child), table.facts.billing th:not(:first-child) { text-align: right; white-space: nowrap; }
}
/* A BRF's savings per window: a table on a phone too, scrolled sideways inside the card if it must */
.scroll-x { overflow-x: auto; }
table.facts.savings td, table.facts.savings th:not(:first-child) { text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
  table.facts.savings thead { display: table-header-group; }
  table.facts.savings tr { display: table-row; padding: 0; }
  table.facts.savings td, table.facts.savings th { display: table-cell; width: auto; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9em; }
  table.facts.savings tbody th, table.facts.savings tr > th:first-child { min-width: 9em; }
  table.facts.savings .rule { display: none; }
}
/* The help page */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.help-toc a { padding: 5px 11px; border-radius: 999px; background: var(--surface-2); text-decoration: none; font-size: 0.9em; }
.help-list { margin: 8px 0 0; display: grid; gap: 12px; }
.help-item { display: grid; grid-template-columns: minmax(180px, 16em) 1fr; gap: 4px 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.help-item:last-child { border-bottom: 0; }
.help-item dt { font-weight: 600; }
.help-item dd { margin: 0; color: var(--muted); }
.where { margin: 0 0 6px; }
.subnav .help-link { margin-left: auto; }
@media (max-width: 720px) { .help-item { grid-template-columns: 1fr; } }
.code-big { font-size: 1.4em; letter-spacing: 0.12em; font-family: ui-monospace, monospace; }
.code-big.ocpp-url { font-size: 0.95em; letter-spacing: 0; word-break: break-all; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }
.status.cheap { background: var(--ok-bg); }
.status.high { background: var(--err-bg); }
.actions form.eco { display: inline-flex; flex-wrap: wrap; gap: 6px; }

.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.cheap, .bar.cheap { background: var(--lvl-cheap); }
.swatch.normal, .bar.normal { background: var(--lvl-normal); }
.swatch.high, .bar.high { background: var(--lvl-high); }
.swatch.now { background: transparent; border: 2px solid var(--text); }
.status.normal { background: var(--bg); }
.levels { list-style: none; padding: 0; }
.levels li { margin: 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); }
.row.spread { justify-content: space-between; margin-top: 0; }
.row.tight { margin-top: 0; }
.price-chart { margin: 16px 0 24px; }
.price-chart figcaption { font-weight: 600; margin-bottom: 8px; }
.plot { position: relative; height: 180px; border-bottom: 1px solid var(--border); }
.threshold { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); pointer-events: none; z-index: 1; }
.threshold span { position: absolute; top: -1.3em; font-size: 0.75em; color: var(--muted); background: var(--card); padding: 0 4px; }
.bars { position: absolute; inset: 0; display: flex; gap: 2px; }
.bar-slot { position: relative; flex: 1; min-width: 0; height: 100%; cursor: default; outline: none; }
.bar-slot:hover, .bar-slot:focus-visible { background: color-mix(in srgb, var(--muted) 12%, transparent); }
.bar { position: absolute; left: 0; right: 0; border-radius: 4px 4px 0 0; }
.bar-slot.is-now .bar { outline: 2px solid var(--text); outline-offset: 1px; }
.x-axis { position: relative; height: 1.4em; margin-top: 4px; }
.x-axis span { position: absolute; transform: translateX(-50%); }
.x-axis span:first-child { transform: none; }  /* 00 at the left edge */
.tip { position: absolute; z-index: 10; padding: 5px 9px; border-radius: 8px; background: var(--text); color: var(--card); font-size: 0.85em; white-space: nowrap; pointer-events: none; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-weight: 600; margin-bottom: 6px; }
fieldset .check { margin-bottom: 6px; }
.inline-check { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; }
.tariff input[type=number] { width: 5.5em; min-width: 0; flex: none; }
.tariff input[type=time] { width: auto; min-width: 0; flex: none; }
.tariff .row { margin-bottom: 6px; }
.threshold.left span { left: 0; }
.threshold.right span { right: 0; }
@media (max-width: 600px) {
  .bars { gap: 1px; }
  .bar { border-radius: 2px 2px 0 0; }
}

input[type=number] { display: block; margin-top: 6px; width: 10em; }
input[type=time] { display: block; margin-top: 6px; }

/* Prices: chart or table (a segmented switch, CSS only), and under the bars a lane per car's plan and the smart plan */
/* Segmented switches of links (stats.html: Split by / Show): like .view-switch, the chosen one lifted */
.seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; align-items: center; padding: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
nav.seg a { padding: 4px 12px; line-height: 1.4; border-radius: 999px; font-size: 0.85em; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
nav.seg a:hover { color: var(--text); }
nav.seg a[aria-current] { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
nav.seg a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.view-switch { display: inline-flex; align-items: center; padding: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.view-switch label { position: relative; display: inline-block; margin: 0; padding: 3px 12px; line-height: 1.4; border-radius: 999px; cursor: pointer; font-size: 0.8em; font-weight: 500; color: var(--muted); }
.view-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.view-switch label:has(input:checked) { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.view-switch label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.prices:has(input[name=price-view][value=table]:checked) .chart-view { display: none; }
.prices:has(input[name=price-view][value=chart]:checked) .table-view { display: none; }
.plot .bar { opacity: 0.92; }
.bar-slot:hover .bar, .bar-slot:focus-visible .bar { opacity: 1; filter: saturate(1.2); }
.bar-slot.is-now::before { content: ""; position: absolute; top: -6px; bottom: 0; left: 50%; border-left: 2px solid var(--text); opacity: 0.55; z-index: 2; pointer-events: none; }
.bar-slot.is-now::after { content: attr(data-now); position: absolute; top: -1.6em; left: 50%; transform: translateX(-50%); font-size: 0.7em; color: var(--text); background: var(--card); padding: 0 5px; border-radius: 6px; z-index: 3; white-space: nowrap; }
.bar-slot.is-now .bar { outline: none; }
.price-chart .plot { margin-top: 1.6em; }
.lane-track { display: flex; gap: 2px; height: 6px; margin-top: 4px; }  /* one mark per quarter hour, right under its price bar */
.lane-track span { flex: 1; border-radius: 2px; }
.lane-track span.on { background: var(--c); }
@media (max-width: 600px) { .lane-track { gap: 1px; } }
.lane-track.planned, .lane-names .planned { --c: var(--planned); }
.lane-names { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; color: var(--muted); }
.lane-names > span { display: inline-flex; align-items: center; gap: 6px; }
.lane-names .key { width: 8px; height: 8px; border-radius: 50%; }
.table-view { max-height: 28em; overflow-y: auto; }
.check input[type=number] { display: inline-block; width: 6em; margin: 0 4px; padding: 4px 6px; }
form.direct { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; white-space: nowrap; }
form.direct input[type=number] { display: inline-block; width: 4.2em; margin: 0; padding: 4px 6px; }
details.location { margin: 6px 0 0; }
details.location form { margin-top: 8px; max-width: 26em; }
details.location select { display: block; margin-top: 4px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
.tile { background: var(--surface-2); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.tile ul.per-car { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; }
.tile ul.per-car li { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.tile ul.per-car li > span:first-child { flex: 1 1 auto; }
.tile ul.per-car strong { font-size: 1em; }
.tile strong { font-size: 1.7em; font-weight: 450; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.problems { list-style: none; padding: 0; margin: 0; }
.problems li { padding: 6px 0; border-bottom: 1px solid var(--border); }
h2.danger { color: var(--danger); }
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.s5 { --c: var(--s5); } .s6 { --c: var(--s6); } .s7 { --c: var(--s7); } .s8 { --c: var(--s8); }
.other { --c: var(--s-other); } .unknown { --c: var(--s-unknown); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; list-style: none; padding: 0; margin: 8px 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); vertical-align: middle; }
.mchart { position: relative; margin: 8px 0 12px; }
.mplot { position: relative; display: flex; align-items: flex-end; justify-content: space-around; height: 220px; padding-left: 44px; border-bottom: 1px solid var(--muted); }
.mtick { position: absolute; left: 44px; right: 0; border-top: 1px solid var(--grid); pointer-events: none; }
.mtick span { position: absolute; left: -44px; top: -0.7em; width: 40px; text-align: right; font-size: 0.75em; color: var(--muted); }
.mcol { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.mcol:hover, .mcol:focus-visible { background: color-mix(in srgb, var(--muted) 10%, transparent); }
.mstack { width: min(24px, 70%); display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.mstack span { display: block; min-height: 2px; flex-basis: 0; background: var(--c); }
.mlabels { display: flex; justify-content: space-around; padding-left: 44px; font-size: 0.75em; color: var(--muted); text-align: center; }
.mlabels > span { flex: 1; }
.mtip { position: absolute; top: 0; z-index: 2; min-width: 150px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.25); font-size: 0.85em; pointer-events: none; }
.mtip div { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mtip .line { display: inline-block; width: 12px; height: 3px; border-radius: 2px; background: var(--c); }
.costs input[type=number] { display: inline-block; width: 6em; margin: 0 4px; padding: 4px 6px; }
.costs .inline-check { margin: 8px 0 0; }
@media (max-width: 600px) { .mlabels { font-size: 0.62em; } }
/* Account page */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.theme-choice { display: flex; gap: 12px; align-items: center; margin: 0; padding: 14px; border: 1px solid var(--border); border-radius: 16px; font-weight: 400; cursor: pointer; background: var(--surface-2); }
.theme-choice.chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-choice input { margin: 0; }
.theme-preview { display: inline-flex; gap: 3px; padding: 6px; border-radius: 10px; border: 1px solid var(--border); flex: none; }
.theme-preview > span { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 4px; font-size: 0.8em; font-weight: 600; }
.theme-preview i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.narrow-form { max-width: 26em; }
form.stack fieldset label { margin-bottom: 2px; }
h3.danger { color: var(--danger); margin-top: 24px; }
/* Admin */
.table-scroll { overflow-x: auto; }
table.facts th { width: 11em; font-weight: 500; color: var(--muted); vertical-align: top; }
@media (max-width: 600px) { table.facts th { display: block; width: auto; border: 0; padding-bottom: 0; } }
details.weekdays { margin: 4px 0 12px; }
.weekday-times th { font-weight: 500; width: 8em; }
.weekday-times td, .weekday-times th { padding: 4px 6px; border: 0; }
.weekday-times input[type=time] { margin: 0; }
@media (max-width: 600px) { .weekday-times tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; } .weekday-times th, .weekday-times td { display: block; } }
/* Prices page: charging plan per car, a strip per car in its statistics colour */
.car-picker { gap: 6px 16px; margin: 8px 0 12px; }
.car-plan { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 12px; }
.car-plan h3 { margin: 0 0 4px; }
.invite-link input { display: block; width: 100%; margin: 6px 0; font-family: ui-monospace, monospace; font-size: 0.9em; }
/* Charging statement: a printable page */
.statement-rows { margin-top: 12px; }
.statement-rows .num { text-align: right; white-space: nowrap; }
.statement-rows tfoot th { border-top: 2px solid var(--text); }
@media print {
  .top, .no-print, .flash:not(.error) { display: none !important; }
  body, .card { background: #fff !important; color: #000 !important; }
  .card { border: 0; padding: 0; }
  main { margin: 0; max-width: none; }
}
.getting-started ul { margin: 0; padding-left: 18px; }
.getting-started li { margin: 6px 0; }

/* Sign-in pages: the welcome next to the form, the home page's sections below (_home.html) */
.welcome { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px 64px; align-items: center; max-width: 1080px; margin: 56px auto; }
.welcome-intro h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 420; letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 20px; }
.welcome-intro .lead { font-size: 1.08rem; color: var(--muted); max-width: 32em; margin: 0; }
.eyebrow { display: block; margin-bottom: 18px; color: var(--muted); font-size: 0.95em; }
.welcome .card { margin: 0; padding: 40px; }
.welcome .card h2 { margin-top: 0; font-size: 1.35rem; }
.welcome form button { width: 100%; padding: 11px 16px; margin-top: 4px; }
@media (max-width: 820px) {
  .welcome { grid-template-columns: 1fr; gap: 28px; margin-top: 8px; }
  .welcome .card { padding: 22px 18px; order: -1; }  /* the form first on a phone */
}
/* Home (_home.html, below the sign-in forms): "Tonight, plotted". A night of spot prices as bars with the
   charging quarters in the accent, the night as a timeline, the association's chargers as a board (always dark),
   what it works with, and a last call. Instrument Sans with figures in JetBrains Mono; colours are the
   theme's, so Tonight light and dark (and every other theme) carry it. */
@font-face {
  font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/static/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
}
.home { --home-sans: "Instrument Sans", system-ui, sans-serif; --home-mono: "JetBrains Mono", ui-monospace, monospace;
  --home-rule: color-mix(in srgb, var(--text) 16%, var(--bg)); --home-bar: color-mix(in srgb, var(--text) 17%, var(--bg));
  font-family: var(--home-sans); }
.home.welcome { max-width: 1240px; align-items: end; row-gap: 0; }
.home.welcome .welcome-intro h1 { font-family: var(--home-sans); font-size: clamp(2.6rem, 6.4vw, 5.6rem); font-weight: 600; letter-spacing: -0.035em; line-height: 0.95; }
.home.welcome .welcome-intro .lead { font-size: 1.12rem; line-height: 1.5; }
.home .eyebrow, .home-label, .night-head, .night-axis, .night-mark, .home-steps time, .home-works dt, .board table { font-family: var(--home-mono); }
.home .eyebrow, .home-label { font-size: 0.82rem; letter-spacing: 0.02em; color: var(--muted); }
.home .card { border-radius: 16px; }
.home .button, .home form button { border-radius: 999px; }
.home.welcome > section:not(.card) > h2, .home.welcome .home-board h2 { font-family: var(--home-sans); font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.05; margin: 0 0 24px; }
.home.welcome .home-steps h3 { font-family: var(--home-sans); font-size: 1.35rem; font-weight: 600; margin: 0; }
.home > section:not(.card) { grid-column: 1 / -1; min-width: 0; }
.home > section:not(.card) + section { margin-top: clamp(48px, 6vw, 96px); }

/* The night, plotted */
.home-night { margin-top: 40px; padding: 24px 28px 20px; background: var(--card); border: 1px solid var(--home-rule); border-radius: 16px; }
.night-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--home-rule); font-size: 0.82rem; color: var(--muted); }
.night-key { display: flex; gap: 20px; }
.night-key span { display: inline-flex; align-items: center; gap: 8px; }
.night-key i { width: 10px; height: 10px; background: var(--home-bar); }
.night-key i.on, .night-bars i.on { background: var(--accent); }
.night-plot { position: relative; height: 340px; margin-top: 8px; }
.night-mark { position: absolute; top: 0; bottom: 0; padding: 4px 0 0 10px; border-left: 1px dashed color-mix(in srgb, var(--text) 40%, var(--bg)); font-size: 0.82rem; line-height: 1.4; color: var(--muted); }
.night-mark b { display: block; color: var(--text); font-weight: 700; }
.night-mark.on { border-left-color: var(--accent); }
.night-mark.on b { color: var(--accent); }
.night-mark.end { right: 0; padding: 4px 10px 0 0; border-left: 0; border-right: 1px dashed color-mix(in srgb, var(--text) 40%, var(--bg)); text-align: right; }
.night-bars { position: absolute; inset: auto 0 0 0; height: 260px; display: flex; align-items: flex-end; gap: 3px; }
.night-bars i { flex: 1 1 0; min-width: 0; background: var(--home-bar); border-radius: 2px 2px 0 0; }
.night-axis { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--home-rule); font-size: 0.82rem; color: var(--muted); }
.night-note { margin: 16px 0 0; font-size: 0.9rem; color: var(--muted); }

/* The night step by step */
.home.welcome .home-steps h2 { max-width: 760px; margin-bottom: 32px; }
.home-steps ol { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--home-rule); }
.home-steps li { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px 32px; padding: 24px 0; border-top: 1px solid var(--home-rule); }
.home-steps time { font-size: 2.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1; }
.home-steps time.quiet { color: var(--muted); }
.home-steps time.on { color: var(--accent); }
.home-steps p { margin: 0; font-size: 1.06rem; line-height: 1.55; color: var(--muted); }

/* The association's car park: a departure board, dark in every theme */
.home-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 48px; align-items: start; }
.home-board > div > p:not(.home-label) { margin: 0 0 16px; font-size: 1.06rem; line-height: 1.55; color: var(--muted); }
.board { background: light-dark(var(--text), color-mix(in srgb, var(--bg) 55%, #000)); color: #e8eef6;
  border: 1px solid light-dark(transparent, var(--home-rule)); border-radius: 16px; padding: 8px 0; overflow-x: auto; }
.board table { width: 100%; min-width: 340px; border-collapse: collapse; font-size: 0.94rem; }
.board caption { text-align: left; padding: 16px 24px; font-size: 0.82rem; color: #8f9db3; }
.board th { color: #8f9db3; font-size: 0.82rem; font-weight: 500; text-align: left; padding: 10px 12px; border: 0; }
.board td { padding: 14px 12px; border: 0; border-top: 1px solid rgb(255 255 255 / 0.1); }
.board th:first-child, .board td:first-child { padding-left: 24px; }
.board th:last-child, .board td:last-child { padding-right: 24px; }
.board .num { text-align: right; }
.board tfoot td { font-size: 0.82rem; }
/* stays a table on a phone (the box scrolls sideways), unlike other tables */
.board table thead { display: table-header-group; } .board table tr { display: table-row; padding: 0; border: 0; } .board table td { display: table-cell; padding: 14px 12px; border-top: 1px solid rgb(255 255 255 / 0.1); }
.board .go { color: #7ee0b8; } .board .wait { color: #f4c45a; } .board .stop { color: #ff8f7a; } .board .dim { color: #8f9db3; }

/* Everything it does: tiles by who it's for (_features.html) */
.features-page { margin-top: 24px; }
.home-features .feature-group { scroll-margin-top: 80px; }
.home-features .feature-group + .feature-group { margin-top: 40px; }
.home-features h2.home-label { margin: 0 0 14px; font-weight: 400; }
.features-call { gap: 12px; margin: 40px 0; }
.features-call .button { padding: 14px 26px; border-radius: 999px; color: var(--accent-text); text-decoration: none; }
.features-call .button.secondary { color: var(--text); }
.home-features ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.home-features li { padding: 18px 20px; background: var(--card); border: 1px solid var(--home-rule); border-radius: 16px; }
.home-features h4 { margin: 0 0 6px; font-family: var(--home-sans); font-size: 1.02rem; font-weight: 600; }
.home-features li p { margin: 0; font-size: 0.94rem; line-height: 1.5; color: var(--muted); }

/* The terms of use (terms.html, settings_agreement.html) */
.terms h2 { font-size: 1.05rem; margin: 24px 0 8px; }
.terms p, .terms li { line-height: 1.6; max-width: 72ch; }
.flash.terms-due { box-shadow: inset 3px 0 0 var(--accent); }

/* Works with */
.home.welcome .home-works h2 { font-size: 1.4rem; letter-spacing: -0.01em; margin-bottom: 32px; }
.home-works dl { margin: 0; border-bottom: 1px solid var(--home-rule); }
.home-works dl > div { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 4px 32px; padding: 20px 0; border-top: 1px solid var(--home-rule); }
.home-works dt { font-size: 0.82rem; color: var(--muted); padding-top: 3px; }
.home-works dd { margin: 0; font-size: 1.06rem; }

/* A last call */
.home.welcome .home-close h2 { font-size: clamp(2.6rem, 6.4vw, 5.6rem); letter-spacing: -0.035em; line-height: 0.95; }
.home-close .row { gap: 12px; margin: 28px 0 48px; }
.home-close .button { padding: 14px 26px; font-size: 1.06rem; color: var(--accent-text); text-decoration: none; }
.home-close .button.secondary { color: var(--text); }
@media (max-width: 820px) {
  .home-night { padding: 18px 16px 14px; margin-top: 8px; }
  .night-plot { height: 300px; }
  .night-bars { height: 190px; gap: 1px; }
  .night-mark { font-size: 0.75rem; }
  .night-mark.end { padding-top: 64px; }  /* under the cheapest stretch's label, which reaches the right edge */
  .home-steps li { grid-template-columns: 1fr; padding: 24px 0; }
  .home-steps time { font-size: 2rem; }
  .home-board { grid-template-columns: 1fr; gap: 28px; }
  .home-works dl > div { grid-template-columns: 1fr; }
}
/* The site mailbox's inbox (admin_inbox.html, admin_inbox_mail.html) */
.badge.mail { background: var(--accent); color: var(--accent-text); }
table.inbox tr.unread td { font-weight: 600; }
pre.mail-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; margin: 16px 0; max-width: 80ch; }
fieldset.mail-inbox { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin: 8px 0 0; }
.site-footer { max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; color: var(--muted); font-size: 0.82em; }

/* Dashboard: a card per charger and per car, the settings folded away */
.section { margin: 56px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 12px; }
.section-head h2 { margin: 0; font-size: 1.5rem; font-weight: 480; letter-spacing: -0.025em; }
.sub-head { margin: 28px 4px 12px; font-size: 1rem; font-weight: 500; color: var(--muted); }
.unit { margin-bottom: 14px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.unit-grid .unit { margin: 0; display: flex; flex-direction: column; }
.unit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.unit-head h3 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 520; letter-spacing: -0.02em; }
.unit-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.unit-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.unit p { margin: 10px 0 0; }
dl.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; }
dl.facts > div { background: var(--surface-2); padding: 12px 16px; border-radius: 14px; }
dl.facts dt { font-size: 0.82em; color: var(--muted); margin-bottom: 2px; }
dl.facts dd { margin: 0; font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
dl.facts.compact { grid-template-columns: repeat(2, 1fr); margin-top: 14px; }
dl.facts.compact:empty { display: none; }
.events { list-style: none; padding: 0; margin: 12px 0 0; }
.events li { padding: 3px 0; }
.events li .muted { display: inline-block; min-width: 6.5em; font-variant-numeric: tabular-nums; }
details.settings { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.unit-grid details.settings { margin-top: auto; padding-top: 12px; }
.unit-grid .unit > :nth-last-child(2) { margin-bottom: 16px; }
details.settings > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.92em; font-weight: 550; }
details.settings > summary::-webkit-details-marker { display: none; }
details.settings > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; margin-right: 2px; }
details.settings[open] > summary::before { transform: rotate(45deg); }
details.settings > summary:hover { color: var(--text); }
.settings-body { display: grid; gap: 16px; margin-top: 14px; }
.setting { display: grid; gap: 8px; min-width: 0; }
.setting select { max-width: 100%; min-width: 0; }  /* a long option made the row wider than a phone */
.setting > *, .setting .actions { min-width: 0; }
.setting-label { font-size: 0.9em; font-weight: 500; color: var(--muted); }
.settings-body details.location { margin: 0; }
.settings-body > form.row { margin: 0; }
/* Battery: the level, a bar with the target marked, when it was read */
.car-live { display: grid; gap: 8px; }
.soc { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.soc .status { align-self: center; }
.soc-value { font-size: 2.6rem; font-weight: 400; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.soc-bar { position: relative; height: 6px; border-radius: 999px; background: var(--surface-2); }
.soc-bar span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--accent); }
.soc-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); opacity: 0.55; }
/* Accounts and adding more, under each section */
.manage { margin: 18px 4px 0; }
.manage-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.92em; }
.manage > .row:first-child { margin-top: 0; }
.manage p, .manage details { margin-top: 12px; }
.card.empty { text-align: center; padding: 28px; }

/* A housing association's pages (board): association / overview / places & queues */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; }
.subnav a { padding: 7px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; text-decoration: none; background: var(--glass); border: 1px solid var(--edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.subnav a:hover { color: var(--text); }
.subnav a[aria-current="page"] { color: var(--accent-text); background: var(--accent); border-color: transparent; }
table.places td { padding-top: 10px; padding-bottom: 10px; }

/* When charging happens (_patterns.html): plain columns, one per hour or weekday */
.hbars { display: flex; align-items: flex-end; gap: 2px; height: 110px; margin: 4px 0 14px; }
.hbar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.hbar span { display: block; width: 100%; background: var(--s1); border-radius: 3px 3px 0 0; min-height: 1px; }
.hbar small { color: var(--muted); font-size: 0.7em; height: 1.3em; line-height: 1.3em; font-variant-numeric: tabular-nums; }
.hbars.week { height: 80px; max-width: 420px; gap: 6px; }
table.sessions td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 10px; }
/* The sessions list on a phone: a session per row block, its figures four across under the start */
@media (max-width: 600px) {
  table.sessions.list tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 10px; }
  table.sessions.list td:first-child, table.sessions.list td:last-child { grid-column: 1 / -1; }
  table.sessions.list td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.75em; }
}
/* The BRF set-up's steps (login, meter, site) */
form.step { margin: 16px 0; padding-top: 12px; border-top: 1px solid var(--border); }
form.step:first-of-type { border-top: 0; padding-top: 0; }
.hbars.months { height: 90px; }

/* Settings pages: brand tiles to connect a charger or add a car (they grow with more brands), quiet links */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.brand-tile { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface-2); color: var(--text); text-decoration: none; min-width: 0; overflow-wrap: anywhere; }
.brand-tile:hover, .brand-tile:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.unit-title { margin: 0 0 4px; font-size: 1.2rem; }
.unit-links { margin: 12px 0 0; text-align: right; }
.manage-link { margin: 4px 4px 0; }
.section-head h1 { margin: 0; font-size: 1.6rem; }

/* Charging curve (_curve.html) */
.curve { margin: 8px 0; }
.curve svg { width: 100%; height: auto; display: block; overflow: visible; }
.curve .bar { fill: var(--accent); opacity: 0.85; }
.curve .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.curve .grid { stroke: var(--grid); stroke-dasharray: 3 4; }
.curve .base { stroke: var(--muted, #888); }
.curve .axis { font-size: 11px; fill: var(--muted, #888); }
.curve.load path { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.curve.load .house { stroke: var(--s2); }
.curve.load .ev { stroke: var(--accent); stroke-width: 2.4; }
.curve.load .other { stroke: var(--s4); stroke-dasharray: 2 3; }
.curve.load .limit { stroke: var(--s6); stroke-dasharray: 6 4; }
.curve.load .fuse { stroke: var(--danger); stroke-dasharray: 8 4; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--muted); }
.legend .key { display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--muted); }
.legend .key.house { background: var(--s2); }
.legend .key.ev { background: var(--accent); }
.legend .key.other { background: var(--s4); }
.legend .key.limit { background: var(--s6); }
.legend .key.fuse { background: var(--danger); }
pre.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .curve .axis { font-size: 20px; }
  .curve.load path { stroke-width: 2.6; }
}

/* Driving log: an OpenStreetMap tile mosaic with the route drawn over it (app.trips.static_map). The tiles are light in every theme, so the line keeps one dark colour. */
.trip-map { position: relative; aspect-ratio: 640 / 400; overflow: hidden; border-radius: 16px; margin: 16px 0 8px; background: var(--surface-2); border: 1px solid var(--edge); }
.trip-map img { position: absolute; max-width: none; }
.trip-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trip-thumb { position: relative; display: block; width: 200px; max-width: 100%; aspect-ratio: 200 / 125; overflow: hidden; border-radius: 10px; margin-bottom: 6px; background: var(--surface-2); border: 1px solid var(--edge); }
.trip-thumb img { position: absolute; max-width: none; }
.trip-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trip-thumb .route { fill: none; stroke: #1f5a8a; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.trip-thumb circle { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.trip-thumb circle.start { fill: var(--s3); }
.trip-thumb circle.end { fill: var(--s8); }
.trip-map .route { fill: none; stroke: #1f5a8a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; vector-effect: non-scaling-stroke; }
.trip-map .straight { stroke: #1f5a8a; stroke-width: 3; stroke-dasharray: 8 6; vector-effect: non-scaling-stroke; }
.trip-map circle { stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; }
.trip-map circle.start { fill: var(--s3); }
.trip-map circle.end { fill: var(--s8); }
.trip-map figcaption { position: absolute; right: 0; bottom: 0; padding: 2px 8px; background: rgba(255, 255, 255, 0.8); color: #333; border-top-left-radius: 8px; }
.trip-map figcaption a { color: inherit; }
table.trips td:first-child, table.trips th:first-child { width: 2em; }
/* A day's summary above its trips: the day, how many trips, and the km driven, framed */
table.trips tr.day-head td { padding: 18px 0 8px; border-bottom: 0; vertical-align: middle; }
table.trips tbody.trip-day:first-of-type tr.day-head td { padding-top: 6px; }
.day-sum { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.day-name { font-weight: 600; }
.day-figures { display: inline-flex; align-items: baseline; gap: 12px; }
.day-km { font-size: 1.25em; font-weight: 650; letter-spacing: -0.01em; color: var(--accent); white-space: nowrap; }
@media (max-width: 600px) {
  table.trips tr { grid-template-columns: 2em 1fr 1fr 1fr; align-items: start; }
  table.trips td:first-child { grid-column: 1; }
  table.trips td:nth-child(2) { grid-column: 2 / -1; text-align: left; align-self: center; }
  table.trips td:nth-child(3) { grid-column: 1 / -1; }
  table.trips td:nth-child(4) { grid-column: 1 / 3; }
  table.trips td:last-child { grid-column: auto; }
  table.sessions.list.trips tr.day-head { grid-template-columns: 2em 1fr; align-items: center; border-bottom: 0; padding-bottom: 0; }
  table.sessions.list.trips tr.day-head td:first-child { grid-column: 1; }
  table.sessions.list.trips tr.day-head td:last-child { grid-column: 2; }
}
/* Car settings: the car's colour in charts (Vehicle.color), swatches as radio buttons */
.color-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swatch-choice { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 3px; border-radius: 999px; border: 2px solid transparent; }
.swatch-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-choice .key { width: 20px; height: 20px; border-radius: 50%; }
.swatch-choice.auto { padding-right: 10px; }
.swatch-choice:has(input:checked) { border-color: var(--text); }
.swatch-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Sessions: a small power curve per session (kW per quarter hour) */
.spark { display: block; width: 80px; height: 22px; margin: 4px 0 0 auto; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.former-car { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.former-car form { margin: 0; }
/* Switch between cars (templates/_car_switch.html, trips, statement): a pill per car */
.car-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.car-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); text-decoration: none; font-size: 0.9em; }
.car-switch a:hover { color: var(--text); }
.car-switch a[aria-current] { background: var(--card); color: var(--text); border-color: var(--text); font-weight: 500; }
.car-switch .key { width: 8px; height: 8px; border-radius: 50%; }
/* Statistics: every session of the period, searchable, in a scrolling table */
.session-search { margin: 8px 0 10px; }
.session-search input[type=search] { flex: 1; min-width: 12em; margin: 0; }
.sessions-all { max-height: 36em; overflow-y: auto; }
.sessions-all thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
/* Sign-up steps (welcome.html) */
.welcome-progress { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 20px; counter-reset: step; flex-wrap: wrap; }
.welcome-progress li { counter-increment: step; display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.9em; }
.welcome-progress li::before { content: counter(step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--card); font-weight: 600; }
.welcome-progress li[aria-current] { color: var(--text); font-weight: 500; }
.welcome-progress li[aria-current]::before { background: var(--accent); color: var(--accent-text); }
.welcome-progress li.done::before { content: "✓"; }
.welcome-skip { margin-top: 20px; }
/* Statistics: a session's car saved in place, and setting several at once */
.bulk-car { margin: 0 0 10px; }
.bulk-car select { width: auto; margin: 0; }
td.saved select { outline: 2px solid var(--accent); outline-offset: 1px; transition: outline-color 0.3s; }
/* Design previews (design.html): a sketch of each layout */
.design-choices { display: grid; gap: 12px; margin-top: 16px; }
.design-choice { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.design-choice.chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.design-swatch { position: relative; display: block; width: 120px; height: 76px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); background: var(--bg); }
.design-swatch span, .design-swatch::after { position: absolute; }
/* each a sketch of its layout, in the theme's own colours (a design never sets them) */
.design-swatch.glass { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 22%, var(--bg)), var(--bg)); }
.design-swatch.glass span { inset: 22px 12px 10px; border-radius: 8px; background: var(--card); opacity: 0.85; box-shadow: 0 -16px 0 -6px var(--card); }
.design-swatch.panel span { inset: 0 auto 0 0; width: 30px; background: color-mix(in oklab, var(--accent) 30%, #050807); box-shadow: 40px 12px 0 -2px var(--card), 72px 12px 0 -2px var(--card); }
.design-swatch.panel::after { content: ""; left: 0; top: 14px; width: 3px; height: 10px; background: color-mix(in oklab, var(--accent) 62%, #fff); }
.design-swatch.kvart { background: var(--card); }
.design-swatch.kvart span { inset: 0 0 auto 0; height: 16px; border-bottom: 1px solid var(--border); box-shadow: 0 30px 0 10px color-mix(in srgb, var(--text) 6%, var(--card)); }
.design-swatch.kvart::after { content: ""; left: 34px; top: 13px; width: 18px; height: 3px; background: var(--accent); }
.design-swatch.fjall span { inset: 0 auto 0 0; width: 42px; background: var(--accent); }
.design-swatch.fjall::after { content: ""; left: 6px; top: 34px; width: 28px; height: 10px; background: var(--accent-text); box-shadow: 0 14px 0 -3px var(--accent-text); opacity: 0.85; }
.design-swatch.magasin span { inset: 8px 12px auto; height: 22px; border-bottom: 3px double var(--text); background: linear-gradient(var(--text), var(--text)) center 4px / 56px 9px no-repeat; }
.design-swatch.magasin::after { content: ""; left: 12px; right: 12px; top: 40px; height: 28px;
  background: linear-gradient(var(--accent), var(--accent)) 50% 0 / 30px 4px no-repeat, linear-gradient(var(--border), var(--border)) 0 12px / 46% 2px no-repeat,
    linear-gradient(var(--border), var(--border)) 100% 12px / 46% 2px no-repeat, linear-gradient(var(--border), var(--border)) 0 20px / 46% 2px no-repeat, linear-gradient(var(--border), var(--border)) 100% 20px / 46% 2px no-repeat; }
.design-swatch.signal { background: linear-gradient(color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1px) 0 0 / 8px 8px, linear-gradient(90deg, color-mix(in srgb, var(--text) 8%, transparent) 1px, transparent 1px) 0 0 / 8px 8px, var(--bg); }
.design-swatch.signal span { inset: 0 0 auto 0; height: 8px; background: var(--text); box-shadow: 0 14px 0 6px var(--card); }
.design-swatch.signal::after { content: ""; left: 24px; top: 8px; width: 24px; height: 20px; background: var(--accent); }
.design-swatch.glod { background: radial-gradient(60% 60% at 90% 0%, color-mix(in srgb, var(--accent) 40%, transparent), transparent 70%), var(--bg); }
.design-swatch.glod span { left: 12px; top: 12px; width: 58px; height: 12px; border-radius: 6px; background: var(--text); opacity: 0.8; }
.design-swatch.glod::after { content: ""; left: 30px; right: 30px; bottom: 6px; height: 14px; border-radius: 8px; background: var(--card); box-shadow: 0 0 0 1px var(--border), inset 10px 0 0 var(--accent); }
.design-swatch.plotted { background: var(--bg); }
.design-swatch.plotted span { left: 10px; right: 10px; bottom: 10px; height: 34px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--text) 18%, var(--bg)) 0 62%, var(--accent) 62% 86%, color-mix(in srgb, var(--text) 18%, var(--bg)) 86%);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px); mask: repeating-linear-gradient(90deg, #000 0 4px, transparent 4px 6px); }
.design-swatch.plotted::after { content: ""; left: 10px; top: 10px; width: 64px; height: 10px; border-radius: 2px; background: var(--text); box-shadow: 0 14px 0 -2px color-mix(in srgb, var(--text) 30%, var(--bg)); }
.design-swatch.print { background: var(--bg); }
.design-swatch.print span { inset: 12px 10px auto; height: 18px; border-bottom: 2px solid var(--text); background: linear-gradient(var(--text), var(--text)) 0 2px / 50px 9px no-repeat; }
.design-swatch.print::after { content: ""; left: 10px; right: 10px; top: 40px; height: 26px;
  background: repeating-linear-gradient(180deg, transparent 0 7px, color-mix(in srgb, var(--text) 30%, var(--bg)) 7px 8px), linear-gradient(var(--accent), var(--accent)) 0 16px / 40% 8px no-repeat; }
.design-swatch.studio { background: var(--bg); }
.design-swatch.studio span { inset: 0 auto 0 0; width: 30px; background: var(--card); border-right: 1px solid var(--border); box-shadow: inset 0 18px 0 -12px color-mix(in srgb, var(--accent) 14%, var(--card)); }
.design-swatch.studio::after { content: ""; left: 38px; right: 8px; top: 10px; height: 26px; border-radius: 7px;
  background: radial-gradient(circle at 80% 40%, color-mix(in oklab, var(--accent) 72%, #fff), var(--accent) 45%, color-mix(in oklab, var(--accent) 62%, #000));
  box-shadow: 0 32px 0 4px var(--card); }
.design-buttons { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.design-swatch.human { background: var(--bg); }
.design-swatch.human span { left: 10px; right: 10px; top: 10px; height: 34px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--card));
  box-shadow: 0 0 0 1px var(--border); }
.design-swatch.human::after { content: ""; left: 18px; right: 18px; top: 32px; height: 8px; background: linear-gradient(90deg, var(--lvl-normal) 0 40%, var(--planned) 40% 70%, var(--lvl-normal) 70%);
  box-shadow: 0 22px 0 -2px var(--border), 0 30px 0 -2px var(--border); }
@media (max-width: 600px) { .design-choice { grid-template-columns: 1fr; } }
/* Statistics: one month's view (per day), with the months before and after */
.month-steps { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 6px 0 4px; }
.month-steps a { text-decoration: none; }
.mchart.daily .mcol { min-width: 0; }
.mchart.daily .mlabels span { font-variant-numeric: normal; }
