/* Lumecount dashboard. Plain CSS, no build step (Q4).
 *
 * Design tokens first: every colour, radius and shadow is a variable, so the
 * dark theme only redefines tokens. Spacing sits on a 4 px grid and the type
 * scale steps by about 1.2. Pages use a small set of components: app shell,
 * page head, stat cards, cards, tables, notices, empty states, forms and
 * buttons. overview.js reads --series-*, --muted and --line for the chart. */

:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --side: #fbfbfe;
  --text: #11131f;
  --muted: #565d73;
  --faint: #656b82;
  --line: #e4e7f0;
  --line-strong: #cfd4e1;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-line: #c7c9fb;
  --on-accent: #ffffff;
  --pos: #067647;
  --pos-soft: #e3f6ec;
  --neg: #c0262d;
  --neg-soft: #fdeced;
  --warn: #8a5300;
  --warn-soft: #fff4dc;
  --series-cost: #d9590e;
  --series-revenue: #4f46e5;
  --series-revenue-fill: rgba(79, 70, 229, 0.10);
  --focus: #4f46e5;
  --shadow-sm: 0 1px 2px rgb(17 19 31 / 0.05);
  --shadow: 0 1px 2px rgb(17 19 31 / 0.04), 0 2px 8px rgb(17 19 31 / 0.04);
  --shadow-lg: 0 4px 12px rgb(17 19 31 / 0.06), 0 16px 40px rgb(17 19 31 / 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --side-w: 248px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: "Inter", "InterVariable", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d14;
    --surface: #131620;
    --surface-2: #1a1e2b;
    --side: #0f1119;
    --text: #eceef5;
    --muted: #a3a9bc;
    --faint: #8d93a8;
    --line: #242939;
    --line-strong: #343a4d;
    --accent: #908eff;
    --accent-hover: #aaa8ff;
    --accent-soft: #211f45;
    --accent-line: #3f3c86;
    --on-accent: #0b0d14;
    --pos: #4fd394;
    --pos-soft: #10301f;
    --neg: #ff7b80;
    --neg-soft: #3a1619;
    --warn: #f2b84b;
    --warn-soft: #32260e;
    --series-cost: #fb923c;
    --series-revenue: #908eff;
    --series-revenue-fill: rgba(144, 142, 255, 0.14);
    --focus: #aaa8ff;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 16px 40px rgb(0 0 0 / 0.45);
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.87em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
h1, h2, h3 { letter-spacing: -0.015em; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 24px; }
h1 .sub, h2 .sub { display: block; font-weight: 400; color: var(--muted); letter-spacing: 0; }
h1 .sub { font-size: 0.92rem; margin-top: 4px; }
h2 { font-size: 1.05rem; font-weight: 650; margin: 40px 0 12px; }
h2 .sub { font-size: 0.85rem; margin-top: 2px; }
h3 { font-size: 0.95rem; font-weight: 650; }
p { margin: 0 0 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 20; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 12px; color: var(--on-accent); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; letter-spacing: -0.015em; }
.brand:hover { color: var(--text); }
.brand img { display: block; }

/* App shell: a sidebar on wide screens, a top bar with a menu below 1024 px. */
.app {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  /* Paints the sidebar column the full page height, past the sticky box. */
  background: linear-gradient(to right, var(--side) calc(var(--side-w) - 1px), var(--line) 0 var(--side-w), var(--bg) 0);
}
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--side);
  border-right: 1px solid var(--line);
  z-index: 10;
}
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; }
.side-body { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: 4px 12px 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { margin: 18px 10px 6px; font-size: 0.7rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.nav-label:first-child { margin-top: 8px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 550;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.nav a::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  opacity: 0.85;
}
.nav a[href="/"] { --icon: url("icons/overview.svg"); }
.nav a[href="/tenants"] { --icon: url("icons/tenants.svg"); }
.nav a[href="/wallets"] { --icon: url("icons/wallets.svg"); }
.nav a[href="/budgets"] { --icon: url("icons/budgets.svg"); }
.nav a[href="/billing"] { --icon: url("icons/billing.svg"); }
.nav a[href="/connect"] { --icon: url("icons/connect.svg"); }
.nav a[href="/keys"] { --icon: url("icons/keys.svg"); }
.nav a[href="/pricebooks"] { --icon: url("icons/pricebooks.svg"); }
.nav a[href="/reconciliation"] { --icon: url("icons/reconciliation.svg"); }
.nav a[href="/audit"] { --icon: url("icons/audit.svg"); }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.nav a[aria-current="page"]::before { opacity: 1; }

.who {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px 4px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  min-width: 0;
}
.who-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.who .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 550; }
.avatar {
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-weight: 700; font-size: 0.85rem;
  text-transform: uppercase;
}
.role { align-self: flex-start; margin-top: 2px; font-size: 0.68rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); }
.who form { margin: 0; }
.who .signout {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--muted);
  background: transparent;
  border-color: var(--line-strong);
  box-shadow: none;
}
.who .signout:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.menu-toggle {
  min-height: 40px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
.menu-toggle::before {
  content: "";
  width: 18px; height: 18px;
  background: currentColor;
  -webkit-mask: url("icons/menu.svg") center / contain no-repeat;
  mask: url("icons/menu.svg") center / contain no-repeat;
}
.menu-toggle:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.menu-toggle[hidden] { display: none; }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

@media (max-width: 1023px) {
  /* The top bar is sticky: keep whatever the browser scrolls to (a focused
     control, an #anchor) below it, never under it (WCAG 2.4.11). Without
     nav.js the bar also holds the row of links, so it is taller. */
  html { scroll-padding-top: 72px; }
  html:has(.side:not(.collapsible)) { scroll-padding-top: 128px; }
  .app { display: block; background: var(--bg); }
  .side {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--side) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
  }
  .side-head { padding: 6px 16px; }
  .side-body { padding: 0 16px 12px; overflow: visible; }
  /* Without JavaScript: a scrollable row of links. */
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 4px; padding-bottom: 2px; }
  .nav-label { display: none; }
  .who { padding: 10px 0 0; }
  /* With nav.js: a menu behind the button. */
  .side.collapsible .side-body { display: none; }
  .side.collapsible.open .side-body { display: flex; max-height: calc(100vh - 60px); overflow-y: auto; }
  .side.collapsible .nav { flex-direction: column; overflow: visible; }
  .side.collapsible .nav-label { display: block; }
  .side.collapsible .nav a { min-height: 44px; }
}

/* Top bar on the signed-out pages */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-inner { max-width: 1160px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; }
@media (max-width: 760px) { .top-inner { padding: 6px 16px; } }

/* Page frame */
.frame { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 36px 40px 64px; }
.public main { max-width: 1160px; padding: 32px 24px 56px; }
@media (max-width: 1023px) { .frame { min-height: 0; } main { padding: 28px 24px 48px; } }
@media (max-width: 760px) { main, .public main { padding: 24px 16px 40px; } }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.82rem; }
.foot-inner { max-width: 1200px; margin: 0 auto; padding: 18px 40px; display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.public .foot-inner { max-width: 1160px; padding: 18px 24px; }
@media (max-width: 760px) { .foot-inner, .public .foot-inner { padding: 18px 16px; } }
/* The tagline gives way first: it wraps onto a second line while the links
   stay together in one row on the right. */
.foot-inner .tag { margin-right: auto; flex: 1 1 18rem; }
@media (max-width: 760px) { .foot-inner .tag { flex-basis: 100%; } }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--text); }
.foot form { margin: 0; }
.foot .linklike { background: none; border: 0; box-shadow: none; padding: 0; min-height: 24px; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
.foot .linklike:hover { color: var(--text); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; }
.crumbs { margin: 0 0 6px; font-size: 0.88rem; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a::before { content: "← "; }
.crumbs a:hover { color: var(--accent); }

/* Month switcher: a segmented pair of links */
.months { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; font-size: 0.88rem; }
.months a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; text-decoration: none; color: var(--text); font-weight: 550; }
.months a + a { border-left: 1px solid var(--line-strong); }
.months a:hover { background: var(--surface-2); color: var(--text); }

/* Cards */
.card, .scroll, .newkey, .upload, .create, .empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card { padding: 20px 24px; }
.card > h2:first-child { margin-top: 0; }
.card + .card { margin-top: 16px; }

/* Stat cards */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.totals + .card, .totals + .more { margin-top: 24px; }
@media (max-width: 560px) { .totals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .stat { padding: 14px 14px 12px; } }
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 16px;
  overflow: hidden;
}
.stat h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.82rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat h2::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: color-mix(in srgb, var(--faint) 55%, transparent); }
.stat.cost h2::before { background: var(--series-cost); }
.stat.revenue h2::before { background: var(--series-revenue); }
.stat.margin h2::before { background: var(--pos); }
.stat.margin:has(.neg) h2::before { background: var(--neg); }
.stat p { margin: 10px 0 6px; font-size: clamp(1.35rem, 0.9rem + 1.8vw, 1.9rem); overflow-wrap: anywhere; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat small { font-size: 0.8rem; font-weight: 550; color: var(--muted); letter-spacing: 0; }
.stat span { font-size: 0.82rem; color: var(--muted); }
/* Change against the same span of last month. Neutral by default (cost and
   events: more is not bad news); revenue and margin rising is green,
   falling red. The arrow and the words carry the direction, not colour. */
.stat p.delta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin: 8px 0 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0; line-height: 1.3; color: var(--muted); }
.stat p.delta .arrow { font-size: 0.7rem; color: inherit; }
.stat p.delta .vs { font-weight: 450; color: var(--muted); }
.stat p.delta.tone-pos { color: var(--pos); }
.stat p.delta.tone-neg { color: var(--neg); }

/* Tables */
/* position: relative keeps absolutely positioned children (visually hidden
   labels) inside the scroll box, so they cannot widen the page. */
.scroll { position: relative; overflow-x: auto; }
.scroll.tall { max-height: min(70vh, 760px); overflow: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
/* Cells sit 12 px apart and 16 px from the card's edge, so a nine-column
   table (tenants) fits a 1280 px window without scrolling sideways. */
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
/* A cell of free text or a row of pills: it wraps instead of widening the
   table past its card. */
td.wrap { white-space: normal; min-width: 8rem; }
td.wrap .pill { margin: 2px 0; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
thead th a { color: inherit; text-decoration: none; }
thead th a:hover { color: var(--text); }
thead th[aria-sort] { color: var(--text); }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr > * { transition: background-color 120ms var(--ease); }
tbody tr:hover > * { background: color-mix(in srgb, var(--accent-soft) 50%, transparent); }
tbody th { font-weight: 600; }
tbody th a { color: inherit; text-decoration: none; }
tbody th a:hover { color: var(--accent); text-decoration: underline; }
tfoot th, tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 700; background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.neg { color: var(--neg); }
.pos { color: var(--pos); }
.dim { color: var(--muted); }
td em, th em { font-style: normal; color: var(--muted); }
td form { margin: 0; }
/* Phones: wide tables scroll sideways inside their box. The row's name
   (the first th) stays pinned on the left so each figure keeps its label,
   a shadow on the right edge says there is more to scroll to (it fades as
   the end is reached: the cover gradient scrolls with the content, the
   shadow does not), and long lists no longer scroll inside a box of their
   own, which traps a thumb swiping down the page. */
@media (max-width: 760px) {
  .scroll {
    background:
      linear-gradient(to left, var(--surface) 40%, transparent) right / 32px 100% no-repeat local,
      radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--text) 22%, transparent), transparent) right / 12px 100% no-repeat scroll,
      var(--surface);
  }
  .scroll.tall { max-height: none; }
  .scroll tr > th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); white-space: normal; min-width: 9.5rem; max-width: 11rem; overflow-wrap: anywhere; }
  .scroll thead tr > th:first-child { z-index: 2; background: var(--surface-2); }
  .scroll tfoot tr > th:first-child { background: var(--surface-2); }
  .scroll tbody tr:hover > th:first-child { background: color-mix(in srgb, var(--accent-soft) 50%, var(--surface)); }
}

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--pos-soft); color: var(--pos); border-color: transparent; }
.pill.bad { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.ok::before, .pill.bad::before, .pill.warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Notices: warnings by default, role="status" for success, .error for errors */
.notice {
  display: block;
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  background: var(--warn-soft);
  color: var(--text);
  animation: notice-in 220ms var(--ease);
}
.notice[role="status"] { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 30%, transparent); border-left-color: var(--pos); }
.notice.error { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 30%, transparent); border-left-color: var(--neg); }
.notice h2, .notice h3, .notice h4 { margin: 2px 0 6px; }
.notice h4 { font-size: 0.95rem; font-weight: 650; }
.notice form { margin: 10px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.notice p:last-child { margin-bottom: 0; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Empty states */
.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  box-shadow: none;
}
.empty > p { max-width: 62ch; margin-left: auto; margin-right: auto; }
.empty strong { color: var(--text); }
.empty::before {
  content: "";
  display: block;
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border-radius: 12px;
  background: var(--accent-soft) url("mark.svg") center / 22px no-repeat;
}
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 16px 0 0; }
.more { color: var(--muted); font-size: 0.88rem; margin-top: 12px; }

/* Error pages (404, 500, ...) rendered for browsers in place of plain text */
.error-page { max-width: 36rem; margin: clamp(24px, 8vh, 96px) auto; text-align: center; }
.error-page h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 12px; }
.error-text { color: var(--muted); font-size: 1.05rem; }
.error-detail { display: inline-block; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }

/* Buttons: primary by default; .secondary and .danger vary it */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease), transform 100ms var(--ease);
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
button:active, .button:active { transform: translateY(1px); }
.button.secondary, button.secondary, .copy {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
.button.secondary:hover, button.secondary:hover, .copy:hover { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
button.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
button.danger:hover { background: color-mix(in srgb, var(--neg) 85%, #000); border-color: transparent; color: #fff; }
@media (prefers-color-scheme: dark) { button.danger, button.danger:hover { color: #1a0507; } }
button[disabled], button[aria-busy="true"] { opacity: 0.6; cursor: progress; }
/* A row of one-button forms, such as the plan Subscribe buttons */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.actions form { margin: 0; }

/* Forms */
input:not([type]), input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"],
input[type="datetime-local"], input[type="number"], select, textarea {
  font: inherit;
  font-size: 0.95rem;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  max-width: 100%;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
input[type="file"] { font: inherit; font-size: 0.9rem; max-width: 100%; color: var(--muted); }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-right: 12px; padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); box-shadow: 0 0 0 4px var(--accent-soft); }
input:user-invalid { border-color: var(--neg); }
label { font-weight: 550; font-size: 0.9rem; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }

/* Inline create forms (keys, Stripe customers, webhook) */
.create { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 16px 18px; margin: 0 0 20px; }
.create label { color: var(--muted); }
.create select, .create input:not([type]), .create input[type="text"], .create input[type="url"] { flex: 1 1 240px; min-width: 0; }
@media (max-width: 560px) { .create > * { flex-basis: 100%; } .create button { width: 100%; } }

/* New keys and quickstart */
.newkey { border: 1px solid var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); padding: 18px 20px; margin: 0 0 24px; }
.newkey h2, .newkey h3 { margin: 0 0 6px; }
.newkey label { display: block; margin: 14px 0 6px; }
.newkey input { width: 100%; font-family: var(--mono); font-size: 0.86rem; background: var(--surface-2); }
.keyrow { display: flex; gap: 8px; }
.keyrow input { flex: 1; min-width: 0; }
.copy { flex: none; padding: 8px 14px; }
.copy::before {
  content: "";
  width: 16px; height: 16px;
  background: currentColor;
  -webkit-mask: url("icons/copy.svg") center / contain no-repeat;
  mask: url("icons/copy.svg") center / contain no-repeat;
}
.copy.done { color: var(--pos); border-color: var(--pos); }
.copy.done::before { -webkit-mask-image: url("icons/check.svg"); mask-image: url("icons/check.svg"); }

/* Price books */
.upload { padding: 20px 24px; margin-top: 24px; }
.upload h2 { margin-top: 0; }
/* One column, each label above its field (scanned top to bottom in one
   line of sight), with any hint right under the field. */
.upload form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-width: 560px; }
.upload form label:not(:first-child) { margin-top: 10px; }
.upload .check { margin-top: 10px; }
.upload button { justify-self: start; margin-top: 14px; }
.field-hint { margin: 0; color: var(--muted); font-size: 0.82rem; }
.optional { font-weight: 450; color: var(--muted); }
@media (max-width: 560px) { .upload button { justify-self: stretch; } }
details { margin-top: 12px; }
summary { min-height: 32px; cursor: pointer; color: var(--muted); font-size: 0.9rem; font-weight: 550; margin-bottom: 8px; }
summary:hover { color: var(--text); }
pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Quickstart steps */
.steps { counter-reset: step; display: grid; gap: 16px; margin-top: 8px; }
.step { position: relative; padding-left: 66px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 22px; top: 20px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; font-size: 0.85rem;
}
.step h2 { margin-top: 2px; }
.step p:last-child { margin-bottom: 0; }
@media (max-width: 560px) { .step { padding-left: 20px; padding-top: 56px; } .step::before { left: 20px; top: 18px; } }

/* Chart: a card holding the readout (filled by overview.js) and the canvas.
   Without JavaScript both are empty and the card is hidden; the daily table
   below carries the same figures. */
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 8px; }
.chart-card:has(.chart:empty) { display: none; }
.chart { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; }
.chart-readout { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; min-height: 24px; margin: 0 4px 12px; font-size: 0.88rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.chart-readout:empty { visibility: hidden; }
.chart-readout .key { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 550; }
.chart-readout .day { color: var(--muted); font-weight: 500; margin-right: auto; }
.chart-readout .cost::before, .chart-readout .revenue::before, .chart-readout .margin::before { content: ""; width: 12px; height: 3px; border-radius: 2px; background: var(--series-cost); }
.chart-readout .revenue::before { background: var(--series-revenue); }
.chart-readout .margin::before { height: 8px; width: 8px; background: var(--pos); }
.chart-readout .margin.neg { color: var(--neg); }
.chart-readout .margin.neg::before { background: var(--neg); }
@media (max-width: 560px) { .chart-readout .day { flex-basis: 100%; } }
.uplot, .uplot * { font-family: var(--font); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 12px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.88rem; font-weight: 550; text-decoration: none; }

/* Sign-in and signup */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; min-height: calc(100vh - 200px); }
@media (max-width: 860px) { .auth { grid-template-columns: minmax(0, 1fr); gap: 28px; min-height: 0; } }
.eyebrow { display: inline-block; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 600; }
.pitch .lead { color: var(--text); font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 750; line-height: 1.12; letter-spacing: -0.025em; margin: 0 0 16px; }
.pitch .grad { background: linear-gradient(90deg, var(--accent), var(--series-cost)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pitch > p { color: var(--muted); font-size: 1.05rem; max-width: 34em; }
.features { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.features li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.features li::before { content: "✓"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--pos-soft); color: var(--pos); font-weight: 700; }
.features strong { display: block; }
.features span { color: var(--muted); font-size: 0.92rem; }
.auth-card { padding: 28px; max-width: 440px; width: 100%; justify-self: center; }
.auth-card h1 { font-size: 1.3rem; margin: 0 0 6px; }
.auth-card .hint { color: var(--muted); }
.providers { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 10px; }
.providers .button { width: 100%; }
/* Provider buttons follow each brand's guidelines: Google's neutral button
   with the four-colour G, GitHub's dark button with its mark. */
.button.provider { min-height: 44px; gap: 12px; font-weight: 600; box-shadow: var(--shadow-sm); }
.button.provider .pmark { flex: none; }
.button.google { background: #ffffff; color: #1f1f1f; border-color: #747775; }
.button.google:hover { background: #f8f9fa; color: #1f1f1f; border-color: #747775; }
.button.github { background: #24292f; color: #ffffff; border-color: #24292f; }
.button.github:hover { background: #32383f; color: #ffffff; border-color: #32383f; }
@media (prefers-color-scheme: dark) {
  .button.google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  .button.google:hover { background: #1f1f20; color: #e3e3e3; border-color: #8e918f; }
  .button.github { background: #f6f8fa; color: #1f2328; border-color: #f6f8fa; }
  .button.github:hover { background: #ffffff; color: #1f2328; border-color: #ffffff; }
}
.button[aria-busy="true"], button[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.button[aria-busy="true"]::after, button[aria-busy="true"]::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.trust { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 0.85rem; }
.trust::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 2px; background: var(--pos); -webkit-mask: url("icons/lock.svg") center / contain no-repeat; mask: url("icons/lock.svg") center / contain no-repeat; }
.switch { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.switch a { font-weight: 600; }
.field-hint { margin: -6px 0 0; font-size: 0.82rem; color: var(--muted); }
/* A field the server refused: red edge, and the message right under it in
   words that say how to fix it (linked with aria-describedby). The icon
   means the error does not rely on colour alone. */
input[aria-invalid="true"] { border-color: var(--neg); box-shadow: 0 0 0 1px var(--neg); }
.check.invalid input { outline: 2px solid var(--neg); outline-offset: 2px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; margin: -6px 0 0; font-size: 0.85rem; font-weight: 550; color: var(--neg); }
.field-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; background: var(--neg); color: var(--surface); font-size: 0.7rem; font-weight: 800; }
.preview { margin: 32px 0 0; max-width: 34em; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; }
.preview figcaption { padding: 10px 16px; font-size: 0.78rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); }
.preview table { font-size: 0.85rem; }
.preview th, .preview td { padding: 8px 16px; }
.preview thead th { position: static; }
@media (max-width: 860px) {
  .preview { display: none; }
  /* On phones the form comes first: it is why the visitor is here. */
  .auth-card { order: -1; padding: 22px 20px; }
  .pitch .lead { font-size: 1.6rem; }
}
.dev { display: grid; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--line-strong); }
.dev p { font-size: 0.88rem; color: var(--muted); }
.dev label { display: grid; gap: 6px; }
.dev input { width: 100%; }
.signup { display: grid; gap: 12px; margin-top: 16px; }
.signup input[type="text"] { width: 100%; }
.signup .check { font-size: 0.9rem; }
.signup .providers { margin: 8px 0 0; }
.signup .trust { margin-top: 4px; }

/* Budget meters: <meter> colours itself from low/high/optimum; these match
   it to the palette. No inline styles, so the CSP stays default-src 'self'. */
.used { display: flex; align-items: center; gap: 10px; min-width: 112px; }
meter { flex: 1; width: 72px; height: 8px; border: 0; border-radius: 999px; background: var(--surface-2); appearance: none; }
meter::-webkit-meter-bar { background: var(--surface-2); border: 0; border-radius: 999px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--pos); border-radius: 999px; }
meter::-webkit-meter-suboptimum-value { background: var(--warn); border-radius: 999px; }
meter::-webkit-meter-even-less-good-value { background: var(--neg); border-radius: 999px; }
meter:-moz-meter-optimum::-moz-meter-bar { background: var(--pos); border-radius: 999px; }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); border-radius: 999px; }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--neg); border-radius: 999px; }

/* Code blocks with a copy button (copy.js) */
.codeblock { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.codebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.codeblock pre, .checklist .codeblock pre { margin: 0; border: 0; border-radius: 0; }
.codebar .copy { min-height: 30px; padding: 4px 10px; font-size: 0.8rem; box-shadow: none; }

/* Overview: getting-started checklist */
.onboard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.onboard-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent); }
.onboard-head h2 { margin: 0 0 4px; font-size: 1.15rem; }
.onboard-head p { margin: 0; color: var(--muted); max-width: 60ch; }
.progress-wrap { display: grid; gap: 6px; min-width: 200px; }
.progress-wrap label { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
progress { width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--surface-2); appearance: none; overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width 250ms var(--ease); }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.checklist { list-style: none; margin: 0; padding: 8px 0; counter-reset: ob; }
.checklist li { counter-increment: ob; position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 16px; padding: 16px 24px; }
.checklist li + li { border-top: 1px solid var(--line); }
.checklist li::before {
  content: counter(ob);
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.82rem; font-weight: 700;
  background: var(--surface);
}
.checklist li.current::before { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.checklist li.done::before { content: ""; border-color: var(--pos); background: var(--pos) url("icons/check-white.svg") center / 16px no-repeat; }
.checklist h3 { margin: 3px 0 4px; font-size: 0.98rem; }
.checklist li.done h3 { color: var(--muted); font-weight: 600; }
.checklist li:not(.current) .step-body > p { color: var(--muted); }
.checklist li:not(.current):not(.done) h3 { color: var(--muted); }
.checklist .step-body > p:last-child { margin-bottom: 0; }
.checklist pre { margin: 12px 0; }
.checklist .button { margin-top: 4px; }
@media (max-width: 560px) { .checklist li { grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 16px; } .onboard-head { padding: 18px 16px; } }
.live { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 0.9rem; font-weight: 550; }
.pulse { position: relative; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 1.6s var(--ease) infinite; }
.live.arrived .pulse, .live.arrived .pulse::after { background: var(--pos); }
.live.stopped .pulse { background: var(--faint); }
.live.stopped .pulse::after { animation: none; }
@keyframes pulse { from { transform: scale(1); opacity: 0.6; } to { transform: scale(2.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-color-scheme: dark) { .checklist li.done::before { background-color: #15803d; border-color: #15803d; } }

/* Notices that explain a failed read: plain words first, the exact error
   folded away for engineers. */
.notice .tech, .step-notice .tech { margin: 8px 0 0; }
.notice .tech summary, .step-notice .tech summary { min-height: 24px; margin-bottom: 4px; font-size: 0.85rem; }
.tech code { display: block; overflow-wrap: anywhere; font-size: 0.82rem; color: var(--muted); }
.step-notice { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--warn, #b7791f); background: var(--warn-soft, transparent); border-radius: 6px; font-size: 0.92rem; }
.step-notice p { margin: 0 0 6px; }
.notice code.problem { overflow-wrap: anywhere; }

/* Tenants table: each tenant's share of the month's cost. The percentage is
   the content; the bar beside it is decorative (aria-hidden) and drawn with
   SVG attributes, since the CSP allows no inline styles. */
th.share, td.share { text-align: right; white-space: nowrap; }
.share-cell { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.share-num { min-width: 3.6em; font-variant-numeric: tabular-nums; }
.share-bar { width: 80px; height: 8px; flex: none; }
.share-bar .track { fill: var(--surface-2); }
.share-bar .fill { fill: var(--series-cost); }
@media (max-width: 600px) { .share-bar { width: 44px; } }

/* Connect your app (/connect). The flow card shows where a call goes and
   what Lumecount receives; the provider switch is two radios that CSS reads
   with :has(), so the choice needs no script and never reloads the page
   (a key shown once stays on screen). Browsers without :has() show both
   providers' snippets, each labelled. Tabs come from tabs.js; without it
   every panel shows, one after another, under its own heading. */
.flow-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px 32px; align-items: center; padding: 20px 24px; margin: 0 0 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.flow { list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-start; }
.flow li { position: relative; flex: 1 1 0; min-width: 0; display: grid; justify-items: center; gap: 6px; text-align: center; padding: 0 8px; }
/* The line runs from the previous node's centre to this one's, behind both
   (they are opaque), with the arrow head on the boundary between them. */
.flow li + li::before { content: ""; position: absolute; z-index: 0; top: 19px; left: -50%; right: 50%; height: 2px; background: var(--line-strong); }
.flow li + li::after { content: ""; position: absolute; z-index: 0; top: 15px; left: 0; width: 0; height: 0; border-left: 8px solid var(--line-strong); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.flow-node { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; font-size: 0.9rem; white-space: nowrap; }
.flow-proxy .flow-node { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 0.85rem; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-soft) 60%, transparent); }
.flow-note { color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.privacy { display: grid; gap: 10px; }
.privacy p { position: relative; margin: 0; padding-left: 30px; font-size: 0.9rem; color: var(--muted); }
.privacy strong { color: var(--text); }
.privacy p::before { content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%; }
.privacy-yes::before { background: var(--pos-soft) url("icons/check.svg") center / 12px no-repeat; }
.privacy-no::before { background: var(--accent-soft); }
.privacy-no::after { content: ""; position: absolute; left: 4px; top: 5px; width: 12px; height: 12px; background: var(--accent); -webkit-mask: url("icons/lock.svg") center / contain no-repeat; mask: url("icons/lock.svg") center / contain no-repeat; }
@media (prefers-color-scheme: dark) { .privacy-yes::before { background-image: url("icons/check-white.svg"); } }
@media (max-width: 860px) { .flow-card { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .flow-card { padding: 16px; }
  .flow { flex-direction: column; align-items: stretch; gap: 14px; }
  .flow li { grid-template-columns: auto minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; gap: 10px; padding: 0; }
  .flow li + li::before { top: -14px; left: 20px; right: auto; width: 2px; height: 14px; background: var(--line-strong); }
  .flow li + li::after { display: none; }
}

.provider-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.provider-pick legend { float: left; padding: 0; font-weight: 600; font-size: 0.92rem; }
.provider-pick .field-hint { flex-basis: 100%; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented label { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 16px; border-radius: 7px; font-weight: 600; font-size: 0.9rem; color: var(--muted); cursor: pointer; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }
.connect:has(#provider-openai:checked) .pv-anthropic,
.connect:has(#provider-anthropic:checked) .pv-openai { display: none; }

.connect .step { min-width: 0; }
.connect .newkey { margin: 14px 0 0; }
.key-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 4px 0 0; }
.tags { display: grid; gap: 10px; margin: 0 0 16px; }
.tags > div { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 4px 16px; align-items: baseline; }
.tags dt { font-weight: 600; }
.tags dd { margin: 0; color: var(--muted); font-size: 0.92rem; }
@media (max-width: 560px) { .tags > div { grid-template-columns: minmax(0, 1fr); } }

.tabs { margin: 16px 0 0; }
.tab-panel + .tab-panel { margin-top: 20px; }
.tab-title { margin: 0 0 8px; font-size: 0.92rem; }
/* Tabs wrap rather than scroll, so on a phone every option stays in view. */
.tablist { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 4px; border-bottom: 1px solid var(--line); }
.tablist [role="tab"] { flex: none; min-height: 40px; padding: 8px 14px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; background: none; box-shadow: none; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.tablist [role="tab"]:hover { background: var(--surface-2); color: var(--text); }
.tablist [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tablist [role="tab"]:active { transform: none; }
.tablist [role="tab"]:focus-visible { outline-offset: -2px; }
.tabs.is-tabbed .tab-panel + .tab-panel { margin-top: 0; }
.tabs.is-tabbed .tab-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tab-panel[hidden] { display: none; }
@media (max-width: 560px) {
  .tablist { gap: 6px; padding-bottom: 10px; }
  .tablist [role="tab"] { min-height: 36px; margin: 0; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; }
  .tablist [role="tab"][aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
}
.tab-panel:focus-visible { outline-offset: 4px; }

/* Connect page: the live check (connect.js). The status line reuses .live;
   once a call arrives, its fields show as a row of small cards. */
.live-check .live { margin: 0; }
.live-check.arrived .live { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 30%, transparent); }
.live-event { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 0; animation: notice-in 220ms var(--ease); }
.live-event[hidden] { display: none; }
.live-event > div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.live-event dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: var(--muted); }
.live-event dd { margin: 2px 0 0; font-family: var(--mono); font-size: 0.86rem; overflow-wrap: anywhere; }
.live-event dd em { font-family: var(--font); color: var(--muted); }
.live-untagged[hidden] { display: none; }
@media (max-width: 560px) { .live-event { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.live-check.arrived ~ .live-help { display: none; }
