/* Ladda Laris – customer portal. Mobile first, light theme.
   Brand from laris.se: Raleway (light headings, tracked uppercase buttons and nav), navy #16308e band,
   cyan #33c3f0 accents, #f5f7fa page, #222 text, square-ish 4px corners. Cyan is never used for text on white
   (contrast); text and buttons use navy. */
/* Layers (all in the root stacking context): tabs 20 < install banner 25 < top bar 30 < skip link 50.
   The top bar is sticky (and a flex item of body), so it is its own stacking context: the account menu inside it
   can never rise above anything the top bar itself is below. That is why the top bar must be the highest layer. */
:root {
  --navy: #16308e;
  --navy-deep: #0f2368;
  --navy-line: rgb(255 255 255 / 0.14);
  --cyan: #33c3f0;
  --cyan-soft: #e3f6fd;
  --cyan-line: #9edcf4;
  --ink: #222;
  --ink-2: #555b66;
  --line: #e1e1e1;
  --line-2: #c9ced6;
  --surface: #fff;
  --bg: #f5f7fa;
  --ok: #17703f;
  --ok-soft: #e4f4ea;
  --warn: #8a5300;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fcebea;
  --mute-soft: #eceff3;
  --radius: 6px;
  --radius-sm: 4px;
  --space-xs: 4px; --space-sm: 8px; --space-md: 12px; --space-lg: 16px; --space-xl: 24px; --space-2xl: 32px; --space-3xl: 48px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: Raleway, "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --track: 0.1em;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  /* Raleway draws old-style figures by default; an app full of kWh and codes reads better with lining ones. */
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
}
body.authed { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
a { color: var(--navy); text-decoration-color: var(--cyan); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--navy); }
strong, b { font-weight: 700; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: var(--radius-sm); }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: var(--space-sm) var(--space-md); z-index: 50; }
.skip:focus { left: var(--space-sm); top: var(--space-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar: the navy band from laris.se, with the app icon and a tracked wordmark. */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  background: var(--navy); color: #fff;
  padding: calc(var(--space-sm) + var(--safe-t)) max(var(--space-lg), var(--safe-r)) var(--space-sm) max(var(--space-lg), var(--safe-l));
  min-height: calc(60px + var(--safe-t));
}
.brand { display: inline-flex; align-items: center; gap: var(--space-md); color: inherit; text-decoration: none; min-height: 44px; }
.brand .mark { width: 36px; height: 36px; display: block; flex: none; }
.wordmark { font-size: 1rem; font-weight: 400; text-transform: uppercase; letter-spacing: 0.22em; line-height: 1; white-space: nowrap; }
.wordmark b { font-weight: 700; }
.account { position: relative; }
.account summary {
  list-style: none; cursor: pointer; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: rgb(255 255 255 / 0.12); color: #fff; font-weight: 700;
  border: 1.5px solid rgb(255 255 255 / 0.35); user-select: none;
}
.account summary::-webkit-details-marker { display: none; }
.account summary::marker { content: ""; }
.account summary:hover, .account[open] summary { background: rgb(255 255 255 / 0.24); }
.account summary:focus-visible { outline-color: var(--cyan); outline-offset: 3px; border-radius: 50%; }
.account .menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(290px, calc(100vw - 32px));
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-sm); box-shadow: 0 14px 36px rgb(15 35 104 / 0.22);
  animation: drop 160ms var(--ease) both;
}
.account .menu::before { /* small arrow pointing at the avatar */
  content: ""; position: absolute; top: -6px; right: 16px; width: 10px; height: 10px; background: var(--surface);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg);
}
.menu-who { margin: 0; padding: var(--space-sm) var(--space-md) var(--space-md); overflow-wrap: anywhere; color: var(--ink-2); font-size: 0.875rem; border-bottom: 1px solid var(--line); margin-bottom: var(--space-xs); }
.menu-who strong { color: var(--ink); font-size: 0.9375rem; }
.account form { margin: 0; }
.menu-item {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 var(--space-md); border: 0; border-radius: var(--radius-sm);
  background: none; font: inherit; font-size: 0.9375rem; font-weight: 600; color: var(--navy); text-decoration: none; text-align: left; cursor: pointer;
}
.menu-item:hover, .menu-item[aria-current] { background: var(--mute-soft); }

/* Bottom tab bar on phones (becomes the laris.se-style nav band on wide screens). */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgb(15 35 104 / 0.06);
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
}
.tabs a {
  position: relative; min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-2); text-decoration: none; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: var(--track);
}
.tabs a::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: 40px; height: 3px; margin-left: -20px;
  background: var(--cyan); border-radius: 0 0 3px 3px; transform: scaleX(0); transition: transform 200ms var(--ease);
}
.tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a:first-child svg { fill: currentColor; stroke: none; }
.tabs a[aria-current="page"] { color: var(--navy); }
.tabs a[aria-current="page"]::before { transform: scaleX(1); }

main { flex: 1 0 auto; width: 100%; max-width: 640px; margin: 0 auto; padding: var(--space-xl) var(--space-lg) var(--space-2xl); padding-left: max(var(--space-lg), var(--safe-l)); padding-right: max(var(--space-lg), var(--safe-r)); outline: none; }
.narrow { max-width: 440px; margin: 0 auto; }

/* Type: light Raleway headings like laris.se. */
h1 { font-size: 2.25rem; line-height: 1.1; font-weight: 300; letter-spacing: -0.03em; margin: 0 0 var(--space-md); color: var(--ink); }
h2 { font-size: 1.375rem; line-height: 1.25; font-weight: 400; margin: 0; letter-spacing: -0.01em; color: var(--ink); }
p { margin: 0 0 var(--space-md); }
.page-head { margin-bottom: var(--space-xl); }
.lede { color: var(--ink-2); font-size: 1.0625rem; max-width: 60ch; }
.lede strong { color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.tagline {
  font-size: 0.9375rem; color: var(--ink-2); margin: calc(-1 * var(--space-sm)) 0 var(--space-xl);
}
.tagline strong { color: var(--ink); }
.flash, .notice { background: var(--cyan-soft); border: 1px solid var(--cyan-line); border-left: 4px solid var(--cyan); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sm); margin-bottom: var(--space-xl); color: var(--ink); }
.error { background: var(--bad-soft); color: var(--bad); border: 1px solid #f1c3bf; border-left: 4px solid var(--bad); padding: var(--space-md) var(--space-lg); border-radius: var(--radius-sm); }
.aside { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-md) var(--space-lg); font-size: 0.9375rem; }

/* Buttons: laris.se's tracked uppercase labels, at app-sized touch targets. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  min-height: 48px; padding: 0 var(--space-xl); border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: var(--track);
  text-decoration: none; text-align: center; line-height: 1.2; cursor: pointer; touch-action: manipulation;
  background: var(--surface); color: var(--navy);
  transition: transform 120ms var(--ease), background-color 160ms var(--ease), border-color 160ms var(--ease);
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-deep); }
.btn.secondary { background: var(--surface); color: var(--navy); border-color: var(--line-2); }
.btn.secondary:hover { border-color: var(--navy); }
.btn.ghost { background: transparent; color: var(--navy); }
.btn.ghost:hover { background: var(--mute-soft); }
.btn.small { min-height: 44px; padding: 0 var(--space-lg); font-size: 0.8125rem; }
.btn[disabled] { opacity: 0.7; cursor: progress; }
.btn.start[disabled] { opacity: 1; background: var(--navy-deep); color: rgb(255 255 255 / 0.9); box-shadow: none; }
.stack { display: grid; gap: var(--space-sm); margin: var(--space-xl) 0; }
.stack label { font-weight: 600; font-size: 0.9375rem; }
.stack .btn { margin-top: var(--space-md); min-height: 56px; width: 100%; font-size: 0.9375rem; }
input[type=email], input[type=text], input:not([type]), input[inputmode] {
  width: 100%; min-height: 52px; padding: 0 var(--space-lg); font: inherit; font-size: 1.0625rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  transition: border-color 160ms var(--ease);
}
input:hover { border-color: #9aa1ad; }
input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 1px; border-color: var(--navy); }
input::placeholder { color: #8a909b; }
textarea {
  width: 100%; min-height: 96px; padding: var(--space-md) var(--space-lg); font: inherit; font-size: 1.0625rem; line-height: 1.4; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); resize: vertical;
  transition: border-color 160ms var(--ease);
}
textarea:hover { border-color: #9aa1ad; }
textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 1px; border-color: var(--navy); }
[aria-invalid="true"] { border-color: var(--bad); }
.stack label:not(:first-child) { margin-top: var(--space-sm); }
.stack .field-help, .stack .field-error { margin: 0; font-size: 0.875rem; }
.field-error { color: var(--bad); font-weight: 600; }
.optional { font-weight: 400; color: var(--ink-2); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.signup-cta { margin-top: var(--space-xl); padding-top: var(--space-xl); border-top: 1px solid var(--line); }
.signup-cta .btn { width: 100%; min-height: 52px; }
input.code { font-size: 1.75rem; font-weight: 600; letter-spacing: 0.35em; font-variant-numeric: lining-nums tabular-nums; text-align: center; text-indent: 0.35em; min-height: 64px; }

/* Chargers */
.charger { margin-bottom: var(--space-2xl); }
.charger-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-md); }
.conn { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.conn::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.conn.on { color: var(--ok); }
.conn.off { color: var(--ink-2); }
.outlets { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-md); }
.outlet {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--space-lg) var(--space-lg) var(--space-lg) calc(var(--space-lg) + 4px); display: grid; gap: var(--space-sm);
  box-shadow: 0 1px 2px rgb(15 35 104 / 0.04);
}
.outlet::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.outlet p { margin: 0; }
.outlet-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }
.outlet-name { font-weight: 600; font-size: 1.125rem; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.2; white-space: nowrap;
  background: var(--mute-soft); color: var(--ink-2);
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.s-free .chip { background: var(--mute-soft); color: var(--ink-2); }
.s-ready { border-color: var(--cyan-line); box-shadow: 0 0 0 3px var(--cyan-soft); }
.s-ready::before { background: var(--cyan); }
.s-ready .chip { background: var(--cyan-soft); color: var(--navy); }
.s-ready .chip::before { background: var(--cyan); box-shadow: 0 0 0 2px var(--navy) inset; }
.s-charging::before { background: var(--ok); }
.s-charging .chip { background: var(--ok-soft); color: var(--ok); }
.s-charging .chip::before { animation: pulse 1.6s var(--ease) infinite; }
.s-done::before, .s-paused::before, .s-finishing::before { background: #e0a43a; }
.s-done .chip, .s-paused .chip, .s-finishing .chip { background: var(--warn-soft); color: var(--warn); }
.s-fault::before { background: var(--bad); }
.s-fault .chip { background: var(--bad-soft); color: var(--bad); }
.s-offline { background: #fafbfc; }
.s-offline .chip { background: var(--mute-soft); color: var(--ink-2); }
.s-offline .chip::before { background: transparent; border: 1.5px solid currentColor; box-sizing: border-box; }
.mine { border-color: #a9d8bb; }
.mine-label { font-size: 0.75rem; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: var(--track); }
.occupant { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-sm); font-size: 0.9375rem; min-width: 0; }
.occ-label { flex-basis: 100%; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: var(--track); }
.occ-company { font-weight: 600; color: var(--ink); }
.occ-unknown { font-weight: 400; color: var(--ink-2); }
.occ-mail { overflow-wrap: anywhere; min-width: 0; padding: 4px 0; }
.meter { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); font-variant-numeric: lining-nums tabular-nums; }
.meter .kw { font-size: 2rem; font-weight: 300; letter-spacing: -0.02em; color: var(--ink); line-height: 1.1; }
.meter .kwh { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 0.9375rem; }
.charger-hint { margin: calc(-1 * var(--space-xs)) 0 var(--space-md); }
.start-form { margin-top: var(--space-xs); }
.btn.start {
  width: 100%; min-height: 60px; font-size: 1rem; letter-spacing: 0.12em;
  background: var(--navy); color: #fff; border-radius: var(--radius-sm);
  box-shadow: 0 6px 18px rgb(22 48 142 / 0.28);
}
.btn.start:not([disabled])::before {
  content: ""; width: 20px; height: 20px; flex: none; background: var(--cyan);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 1.5 4 14h6.5L9 22.5 20 9h-6.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 1.5 4 14h6.5L9 22.5 20 9h-6.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn.start:hover { background: var(--navy-deep); }
.btn.start .spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgb(255 255 255 / 0.35); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.progress { border-radius: var(--radius-sm); padding: var(--space-md) var(--space-lg); margin-bottom: var(--space-xl); font-weight: 600; background: var(--cyan-soft); color: var(--navy-deep); border: 1px solid var(--cyan-line); border-left: 4px solid var(--cyan); }
.progress.ok { background: var(--ok-soft); color: #135c34; border-color: #a9d8bb; border-left-color: var(--ok); }
.progress.bad { background: var(--bad-soft); color: var(--bad); border-color: #f1c3bf; border-left-color: var(--bad); }
.progress p { margin: 0; }
.progress p + p { margin-top: var(--space-xs); font-weight: 400; }
.updated { text-align: center; }

/* Empty states */
.empty { background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); padding: var(--space-xl); }
.empty h2 { margin-bottom: var(--space-sm); }
.empty p:last-child { margin-bottom: 0; }

/* History */
.history { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(15 35 104 / 0.04); }
.tx { padding: var(--space-md) var(--space-lg); display: grid; gap: 2px; }
.tx + .tx { border-top: 1px solid var(--line); }
.tx.ongoing { box-shadow: inset 4px 0 0 var(--ok); }
.tx-row { display: flex; justify-content: space-between; gap: var(--space-md); }
.tx-row.sub { color: var(--ink-2); font-size: 0.9375rem; }
.tx-date { font-weight: 600; }
.tx-date::first-letter { text-transform: uppercase; }
.tx-kwh { font-weight: 700; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; color: var(--navy); }
abbr { text-decoration: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; vertical-align: 1px; }
.more { text-align: center; margin-top: var(--space-xl); }

/* Stats */
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--mute-soft); border-radius: var(--radius); padding: 4px; gap: 4px; margin-bottom: var(--space-xl); }
.segmented a { min-height: 44px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.segmented a:hover { color: var(--navy); }
.segmented a[aria-current] { background: var(--surface); color: var(--navy); box-shadow: 0 1px 3px rgb(15 35 104 / 0.15); }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); margin: 0 0 var(--space-xl); }
.totals div { display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-lg); }
.totals div:first-child { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: inset 0 -4px 0 var(--cyan); }
.totals dt { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }
.totals dd { margin: var(--space-xs) 0 0; font-size: 2rem; line-height: 1.15; white-space: nowrap; font-weight: 300; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }
.totals small { font-size: 1rem; font-weight: 600; letter-spacing: 0; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-lg); }
.bar-label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); margin-bottom: 6px; font-size: 0.9375rem; }
.bar-label > span:first-child { white-space: nowrap; }
.bar-value { white-space: nowrap; color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; }
.bar-value strong { color: var(--ink); }
.bar { height: 10px; background: var(--mute-soft); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; min-width: 2px; background: var(--cyan); border-radius: 999px; }
.bars .current .bar span { background: var(--navy); }

/* Profile */
.facts { margin: 0 0 var(--space-md); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgb(15 35 104 / 0.04); }
.facts > div { padding: var(--space-md) var(--space-lg); display: grid; gap: 2px; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts dt { font-size: 0.75rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: var(--track); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.tag-list { list-style: none; margin: 0; padding: 0; }
.setting { margin: var(--space-2xl) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-lg); display: grid; gap: var(--space-md); }
.setting h2 { font-size: 1.125rem; font-weight: 600; }
.setting .hint { margin: 0; }
.setting .btn { justify-self: start; }
.switch { display: flex; align-items: center; gap: var(--space-md); cursor: pointer; font-weight: 600; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line-2); transition: background-color 160ms var(--ease); }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 160ms var(--ease); }
.switch input:checked + .switch-track { background: var(--navy); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--cyan); outline-offset: 2px; }
.profile-foot { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: center; justify-content: space-between; }
.profile-foot form { margin: 0; }

/* Install banner */
.install {
  position: fixed; left: var(--space-md); right: var(--space-md); z-index: 25;
  bottom: calc(var(--space-md) + var(--safe-b));
  display: flex; gap: var(--space-md); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--cyan); border-radius: var(--radius); padding: var(--space-lg);
  box-shadow: 0 16px 40px rgb(15 35 104 / 0.22);
  max-width: 560px; margin: 0 auto;
  animation: rise 360ms var(--ease) both;
}
body.authed .install { bottom: calc(var(--tabs-h) + var(--safe-b) + var(--space-md)); }
.install[hidden] { display: none; }
.install .mark { width: 44px; height: 44px; flex: none; border-radius: 10px; }
.install-text p { margin: 4px 0 var(--space-md); color: var(--ink-2); font-size: 0.9375rem; }
.install .share { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.install-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (max-width: 359px) {
  .wordmark { letter-spacing: 0.14em; font-size: 0.9375rem; }
  h1 { font-size: 2rem; }
  .totals dd { font-size: 1.625rem; }
}

/* Wide screens: one deliberate 640px column; the tabs become a navy nav band under the top bar, like laris.se. */
@media (min-width: 760px) {
  body.authed { padding-bottom: 0; }
  /* Line the bar and tabs up with the text column (640px wide, 16px inner padding). */
  .topbar, .tabs { padding-left: max(var(--space-xl), calc((100vw - 640px) / 2 + var(--space-lg))); padding-right: max(var(--space-xl), calc((100vw - 640px) / 2 + var(--space-lg))); }
  .topbar { position: relative; min-height: 72px; } /* scrolls away; stays above the sticky tabs (z 20) */
  .brand .mark { width: 40px; height: 40px; }
  .wordmark { font-size: 1.125rem; }
  .tabs {
    position: sticky; top: 0; bottom: auto; display: flex; gap: var(--space-xl);
    background: var(--navy); border-top: 1px solid var(--navy-line); box-shadow: 0 2px 10px rgb(15 35 104 / 0.18);
  }
  .tabs a { min-height: 52px; flex-direction: row; gap: var(--space-sm); font-size: 0.8125rem; color: rgb(255 255 255 / 0.82); }
  .tabs a::before { top: auto; bottom: 0; left: 0; right: 0; width: auto; margin: 0; border-radius: 3px 3px 0 0; }
  .tabs a:hover, .tabs a[aria-current="page"] { color: #fff; }
  .tabs svg { width: 18px; height: 18px; }
  main { padding-top: var(--space-3xl); }
  body.authed .install { bottom: var(--space-lg); }
  h1 { font-size: 2.75rem; }
  /* Logged-out pages sit on a card, so the short forms do not float in empty space. */
  body.anon .narrow { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: var(--radius); padding: var(--space-2xl) 40px; box-shadow: 0 8px 28px rgb(15 35 104 / 0.08); }
  body.anon .narrow > :last-child { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .btn:active { transform: none; }
}
