/*
 * G-Sat: Gaia Dedicated CSAT.
 *
 * The look is GAiA Desk's, token for token (gaia-desk-main/Frontend/GAiA,
 * src/index.css and src/lib/surfaces.ts): Apple's system face first, Inter
 * elsewhere; a "Spotify" dark canvas at 6% with cards as a 4.5% white wash
 * behind a heavy blur; a grey (not white) light theme; green as light rather
 * than as fill: a wash, a hairline and a glow pooling below whatever is
 * selected; 0.5rem radii on controls, 0.75rem on cards. The canvas is
 * GAiA's sign-in backdrop: a deep field with stars and a green bloom.
 *
 * --brand, --on-brand and --on-brand-deep are written into every page by the
 * server (see views/layout.js) from the instance's brand colour, or the
 * client's own on their pages, so a client's colour flows through buttons,
 * bars and links without any of this needing to know what it is.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(/fonts/inter-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --brand: #18b451;              /* GAiA --primary, hsl(142 76% 40%) */
  --on-brand: #0c0c10;           /* readable on --brand; the page recomputes it */
  --on-brand-deep: #ffffff;      /* readable on the button gradient; the page recomputes it */
  --brand-strong: var(--brand);  /* --brand nudged for text; see @supports below */
  --brand-hi: var(--brand);      /* top of a button */
  --brand-lo: var(--brand);      /* bottom of a button */
  --brand-glow: rgba(16, 185, 129, .45);
  --brand-wash: rgba(16, 185, 129, .12);
  --brand-wash-soft: rgba(16, 185, 129, .07);
  --brand-line: rgba(16, 185, 129, .30);

  /* GAiA dark: the "Spotify" scale */
  --bg: hsl(0 0% 6%);
  --bg-2: hsl(0 0% 8%);
  --bg-3: hsl(0 0% 10%);
  --text: hsl(0 0% 98%);
  --text-2: hsl(0 0% 85%);
  --muted: hsl(0 0% 65%);
  --border: hsl(0 0% 15%);
  --border-hover: hsl(0 0% 20%);
  --input: hsl(0 0% 12%);
  --secondary: hsl(0 0% 12%);
  --secondary-hover: hsl(0 0% 15%);
  --sidebar: hsl(0 0% 4%);

  --glass-bg: rgba(255, 255, 255, .045);
  --glass-border: rgba(255, 255, 255, .07);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 8px 28px -18px rgba(0, 0, 0, .7);
  --glass-blur: blur(40px) saturate(1.8);
  --bar-bg: rgba(255, 255, 255, .03);
  --bar-border: rgba(255, 255, 255, .06);
  --highlight: rgba(255, 255, 255, .10);   /* the hairline along a selected item's top edge */
  --star: rgba(226, 255, 238, .55);

  --good: hsl(142 76% 55%);
  --warn: hsl(39 96% 55%);
  --bad: hsl(0 84% 60%);
  --on-bad: #ffffff;
  --rating: var(--brand-strong);

  /* Report series, GAiA's chart tokens: one hue per series, brand green first. */
  --chart-1: hsl(162 83% 35%);
  --chart-2: hsl(217 91% 60%);
  --chart-3: hsl(39 96% 38%);
  --chart-4: hsl(258 90% 66%);
  --chart-5: hsl(350 78% 50%);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .4), 0 2px 4px -2px rgb(0 0 0 / .4);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .6), 0 8px 10px -6px rgb(0 0 0 / .6);

  --radius: .75rem;              /* cards (rounded-xl) */
  --radius-md: .5rem;            /* controls (rounded-lg / --radius) */
  --radius-sm: .375rem;          /* small controls (rounded-md) */
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: light) {
  :root {
    /* GAiA light: grey, not white: cards sit above the page (95% on 91%). */
    --bg: hsl(0 0% 91%);
    --bg-2: hsl(0 0% 89%);
    --bg-3: hsl(0 0% 86%);
    --text: hsl(0 0% 8%);
    --text-2: hsl(0 0% 25%);
    --muted: hsl(0 0% 38%);
    --border: hsl(0 0% 80%);
    --border-hover: hsl(0 0% 74%);
    --input: hsl(0 0% 88%);
    --secondary: hsl(0 0% 88%);
    --secondary-hover: hsl(0 0% 85%);
    --sidebar: hsl(0 0% 89%);

    --glass-bg: rgba(255, 255, 255, .38);
    --glass-border: rgba(0, 0, 0, .07);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 -1px 0 rgba(0, 0, 0, .05), 0 8px 28px -18px rgba(0, 0, 0, .4);
    --bar-bg: rgba(229, 229, 229, .6);
    --bar-border: rgba(0, 0, 0, .07);
    --highlight: rgba(255, 255, 255, .45);
    --star: transparent;

    --good: hsl(142 76% 32%);
    --warn: hsl(28 92% 37%);
    --bad: hsl(0 84% 45%);

    --chart-1: hsl(152 72% 29%);
    --chart-2: hsl(212 68% 50%);
    --chart-3: hsl(28 92% 37%);
    --chart-4: hsl(254 63% 58%);
    --chart-5: hsl(344 64% 46%);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);
  }
}

/*
 * A client's colour has to stay readable as text on their own dashboard. Text
 * wants more contrast than a button does, so it is pulled toward the canvas:
 * darker on light, lighter on dark. The button is GAiA's: a gradient from a
 * slightly lifted brand colour down to a deepened one. Browsers without
 * color-mix keep --brand, which is the old behaviour, not a broken one.
 */
@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --brand-strong: color-mix(in srgb, var(--brand) 82%, #fff);
    --brand-hi: color-mix(in srgb, var(--brand) 92%, #fff);
    --brand-lo: color-mix(in srgb, var(--brand) 68%, #000);
    --brand-glow: color-mix(in srgb, var(--brand) 45%, transparent);
    --brand-wash: color-mix(in srgb, var(--brand) 12%, transparent);
    --brand-wash-soft: color-mix(in srgb, var(--brand) 7%, transparent);
    --brand-line: color-mix(in srgb, var(--brand) 30%, transparent);
  }
  @media (prefers-color-scheme: light) {
    :root { --brand-strong: color-mix(in srgb, var(--brand) 72%, #000); }
  }
}

*, *::before, *::after { box-sizing: border-box; }
/*
 * clip, not hidden: hidden turns the body into a scroll container and a
 * scroll container between a sticky element and the viewport un-sticks it,
 * which let the sidebar scroll away with the page. clip only cuts the
 * overflow. The hidden line stays first as the fallback for old browsers.
 */
html, body { overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0; padding: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Inter', system-ui, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
/* GAiA's deep backdrop: a green bloom low on the left, stars, and a vignette. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1px 1px at 12% 18%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 33% 71%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 57% 32%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 78% 84%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 91% 14%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 66% 57%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 22% 46%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 47% 9%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 84% 43%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 6% 88%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 40% 92%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 72% 4%, var(--star), transparent 100%),
    radial-gradient(1100px 760px at 22% 62%, var(--brand-wash), transparent 62%),
    radial-gradient(900px 700px at 96% 4%, var(--brand-wash-soft), transparent 60%);
  background-size: 420px 420px, 380px 380px, 520px 520px, 460px 460px, 340px 340px, 600px 600px, 440px 440px, 500px 500px, 360px 360px, 480px 480px, 560px 560px, 400px 400px, 100% 100%, 100% 100%;
}
body > * { position: relative; z-index: 1; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-glow); border-radius: var(--radius-sm); }

/* ------------------------------------------------------------------ shell */

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

/* GAiA's nav panel: frosted, with a very faint green light along its right edge. */
.sidenav {
  position: sticky; top: 0; height: 100vh; z-index: 5;
  display: flex; flex-direction: column; gap: 6px; padding: 14px 12px;
  border-right: 1px solid var(--bar-border);
  background:
    linear-gradient(to left, var(--brand-wash-soft) 0%, transparent 100%),
    var(--glass-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.5); backdrop-filter: blur(12px) saturate(1.5);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand .name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand .mark {
  width: 30px; height: 30px; flex: none;
  background: url(/gaia-mark-white.png) center / contain no-repeat;
}
@media (prefers-color-scheme: light) { .brand .mark { background-image: url(/gaia-mark.png); } }
.sidenav .brand { padding: 4px 8px 14px; border-bottom: 1px solid var(--bar-border); margin-bottom: 8px; }
.sidenav nav { display: flex; flex-direction: column; gap: 6px; }
/* GAiA's sidebarMenuButton: a faint green plate, a hairline along its top, light below. */
.sidenav nav a {
  display: flex; align-items: center; min-height: 36px; padding: 8px 10px;
  border-radius: var(--radius-md); color: var(--text-2); font-weight: 500; letter-spacing: -.006em;
  transition: background-color .2s, box-shadow .2s, color .2s;
}
/* Washes only, no outer glows: a glow thrown downward lands on the next
   item and reads as two plates overlapping. */
.sidenav nav a:hover { background: var(--brand-wash-soft); color: var(--text); text-decoration: none; }
.sidenav nav a[aria-current="page"] {
  background: var(--brand-wash); color: var(--text); font-weight: 600;
  box-shadow: inset 0 1px 0 var(--highlight);
}
/* The rainmeter moment: a thin clock, the day spelled wide, the date under
   it, sitting just above the account block. The clock is filled by panel.js
   from the viewer's own machine; without JavaScript only day and date show. */
.sidenav .side-day { margin-top: auto; padding: 12px 8px 14px; font-weight: 300; color: var(--text); }
.sidenav .side-day .clock { font-size: 32px; font-weight: 200; letter-spacing: .06em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sidenav .side-day .day { margin-top: 6px; font-size: 14px; letter-spacing: .26em; text-transform: uppercase; white-space: nowrap; }
.sidenav .side-day .date { margin-top: 2px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sidenav .side-foot {
  margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--bar-border);
  display: flex; flex-direction: column; gap: 10px;
}
.sidenav .side-day + .side-foot { margin-top: 0; }
.sidenav .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidenav .side-foot button { width: 100%; }

/* ------------------------------------------------------------------- intro */

/*
 * The Global Nova mark greets the first panel page of a browser session: it
 * fades in over a dark field, holds a beat, and the whole veil lifts away.
 * panel.js reveals it (sessionStorage keeps it to once per session) and
 * removes it afterwards. The veil stays dark in both themes; the mark's own
 * canvas is near-black, and the radial mask melts its square edges into it.
 */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: hsl(0 0% 5%);
  transition: opacity .7s ease;
}
.intro img {
  width: min(52vw, 340px); height: auto;
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  opacity: 0;
}
/* Two animations share the timeline: the entrance runs once, then the
   pulse takes over the transform and beats until the veil lifts. */
.intro.in img {
  animation: intro-in .9s cubic-bezier(.2, .9, .3, 1) forwards,
             intro-pulse 1.5s ease-in-out .9s infinite;
}
@keyframes intro-in {
  from { opacity: 0; transform: scale(.92); filter: blur(4px); }
  to { opacity: 1; transform: scale(1); filter: blur(0) drop-shadow(0 0 26px rgba(24, 180, 81, .18)); }
}
@keyframes intro-pulse {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 26px rgba(24, 180, 81, .18)); }
  50% { opacity: 1; transform: scale(1.05); filter: drop-shadow(0 0 44px rgba(24, 180, 81, .42)) brightness(1.08); }
}
.intro.leave { opacity: 0; pointer-events: none; }

/* --------------------------------------------------------------------- page */

.page { max-width: 1120px; width: 100%; margin: 0 auto; padding: 32px 28px 72px; }
.card, .kpi, .bars, form, .row > *, .split > * { min-width: 0; }

h1 { font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 32px 0 12px; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1; margin: 0 0 14px; }
.lede { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

/* Glass: GAiA's Card. */
.card, .kpi, .table-wrap, .empty {
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}

/* ---------------------------------------------------------------- numbers */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 18px 20px; }
.kpi .label { font-size: 13px; color: var(--muted); letter-spacing: -.006em; }
.kpi .value { margin-top: 6px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
/* The selected-item recipe on the headline number: green wash, hairline, light below. */
.kpi.primary {
  background: linear-gradient(180deg, var(--brand-wash), var(--brand-wash-soft));
  border-color: var(--brand-line);
  /* Kept shorter than the gap below the row, so the glow never touches the
     next card and makes the sections look overlapped. */
  box-shadow: inset 0 1px 0 var(--highlight), 0 4px 12px -9px var(--brand-glow);
}
.kpi.primary .value { color: var(--brand-strong); }

/* ------------------------------------------------------------------ cards */

.card { padding: 20px; margin-bottom: 20px; }
.card > h3:first-child { margin-top: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.split3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .split3 { grid-template-columns: 1fr; } }

.bar-row { display: grid; grid-template-columns: 130px 1fr 48px; gap: 12px; align-items: center; margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }
.track { height: 8px; background: var(--secondary); border-radius: 999px; overflow: hidden; }
/* The reports' neon tube, in the page's brand colour so a client's own
   colour still flows through their dashboard: darker start, brand middle,
   lit tip, and a tight-plus-wide halo. */
.fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-lo), var(--brand) 72%, var(--brand-hi));
  box-shadow: 0 0 10px var(--brand-glow);
  box-shadow: 0 0 6px color-mix(in srgb, var(--brand) 75%, transparent), 0 0 20px var(--brand-glow);
}
.fill.dist { opacity: .85; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ----------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; }
.table-wrap { overflow-x: auto; }
/* Middle, not top: rows mix one-line and two-line cells, and top alignment
   leaves the short cells hanging off the row's visual centre line. */
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--bar-border); vertical-align: middle; }
th { background: var(--bar-bg); font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .2s; }
tbody tr:hover td { background: var(--brand-wash-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.stars { color: var(--rating); letter-spacing: 1px; white-space: nowrap; }
td a { font-weight: 500; color: var(--text); }
td a:hover { color: var(--brand-strong); }
.comment { max-width: 380px; overflow-wrap: anywhere; }
/* Long comments fold to three lines; panel.js adds a Show more toggle when
   there is more to show. Without JavaScript nothing is hidden. */
.comment-text.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Plain text, not a button: every trace of the button chrome is stripped,
   including the height, glow and hover filter the global button rules add. */
.comment .more, .comment .more:hover, .comment .more:active {
  display: inline; height: auto; min-height: 0; margin: 4px 0 0; padding: 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  filter: none; transform: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--brand-strong);
}
.comment .more:hover { text-decoration: underline; }
/* No focus ring blob after a click either; keyboard focus keeps the underline. */
.comment .more:focus, .comment .more:focus-visible { box-shadow: none; outline: none; text-decoration: underline; border-radius: 0; }

/* Sortable column headers: the triangle says which way the sort points. */
th a.sort {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-weight: 500; text-decoration: none;
}
th a.sort:hover { color: var(--text); text-decoration: none; }
th a.sort.on { color: var(--text); }
th a.sort .arrow { font-size: 9px; line-height: 1; color: var(--brand-strong); }
th a.sort .arrow.idle { color: var(--muted); opacity: .6; }
th.num a.sort { justify-content: flex-end; width: 100%; }

/* GAiA's chips: quiet at rest, lit green when they mean something. */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; letter-spacing: .01em;
  background: var(--secondary); border: 1px solid var(--border); color: var(--muted);
}
.pill.on { color: var(--brand-strong); background: var(--brand-wash); border-color: var(--brand-line); box-shadow: 0 3px 12px -3px var(--brand-glow); }
.pill.off { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }

.linkbox {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 0;
  padding: 10px 12px; background: var(--bar-bg); border: 1px solid var(--bar-border); border-radius: var(--radius-md);
}
.linkbox code {
  flex: 1 1 100%;
  min-width: 0;              /* without this the URL sets the page width */
  overflow-x: auto;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
}
@media (min-width: 721px) { .linkbox code { flex: 1 1 auto; } }

/* ------------------------------------------------------------------ forms */

form.stack { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
/* The filter strip above a table: fields flex and share the width, the
   button group keeps its natural size and stays on one line. */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar > div { flex: 1 1 170px; min-width: 0; }
.filter-bar > .actions { flex: 0 0 auto; flex-wrap: nowrap; }
label.f { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], textarea, select {
  width: 100%; height: 36px; padding: 4px 12px; font: inherit; font-size: 14px;
  color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input:hover, textarea:hover, select:hover { border-color: var(--border-hover); }
textarea { height: auto; min-height: 90px; padding: 8px 12px; resize: vertical; font-family: inherit; }
select { background: var(--bg-2); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand-line); box-shadow: 0 0 0 1px var(--brand-line); }
input::placeholder, textarea::placeholder { color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: auto; height: auto; accent-color: var(--brand); }

/* GAiA's Button, default variant: a brand gradient, an inset highlight, a green glow. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 36px; padding: 0 16px; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--on-brand-deep); background: linear-gradient(180deg, var(--brand-hi), var(--brand-lo));
  border: 0; border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 4px 16px -6px var(--brand-glow);
  cursor: pointer; text-decoration: none;
  transition: background-color .2s, box-shadow .2s, transform .2s, filter .2s;
}
button:hover, .button:hover { text-decoration: none; filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 22px -6px var(--brand-glow); }
button:active, .button:active { transform: scale(.98); }
/* The outline variant: a border, a green wash on hover. */
button.ghost, .button.ghost {
  color: var(--text); background: transparent; border: 1px solid var(--border); box-shadow: var(--shadow-sm); filter: none;
}
button.ghost:hover, .button.ghost:hover { background: var(--brand-wash); border-color: var(--brand-line); box-shadow: inset 0 1px 0 var(--highlight), 0 3px 12px -3px var(--brand-glow); }
button.danger, .button.danger { background: var(--bad); color: var(--on-bad); box-shadow: var(--shadow-sm); }
button.danger:hover, .button.danger:hover { filter: brightness(1.08); box-shadow: var(--shadow-sm); }
button.small, .button.small { height: 32px; padding: 0 12px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* A cell wearing .actions must stay a cell: flex pulls it out of the table
   layout and the button lands beside the row instead of inside it. */
td.actions { display: table-cell; white-space: nowrap; text-align: right; vertical-align: middle; }
/* A form inside an actions cell is a block by default and stacked the
   buttons; inline keeps Copy link and Delete on one line. */
td.actions form { display: inline-block; margin-left: 8px; vertical-align: middle; }

.flash {
  padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 18px; font-weight: 500; border: 1px solid;
  overflow: hidden; transition: opacity .5s ease, max-height .5s ease, margin .5s ease, padding .5s ease, border-width .5s ease;
}
/* panel.js adds this a few seconds after a success message appears. */
.flash.bye { opacity: 0; max-height: 0 !important; margin: 0; padding-top: 0; padding-bottom: 0; border-width: 0; }
.flash.ok { color: var(--brand-strong); background: var(--brand-wash); border-color: var(--brand-line); box-shadow: inset 0 1px 0 var(--highlight); }
.flash.err { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }

.empty { padding: 32px; text-align: center; color: var(--muted); border-style: dashed; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
/* An order number is one token; broken across lines it stops being scannable. */
td.mono { white-space: nowrap; overflow-wrap: normal; }
/* The tick has to be legible on the dark canvas. */
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--brand); flex: none; }
/* The native calendar popup follows the page's theme instead of opening white. */
input[type="date"] { color-scheme: dark; min-width: 150px; }
@media (prefers-color-scheme: light) { input[type="date"] { color-scheme: light; } }

/*
 * The app's own calendar, drawn by panel.js in place of the browser popup:
 * a glass card, mint accents, the selected day lit like every other chosen
 * thing in the panels.
 */
.cal-pop {
  position: fixed; z-index: 70; width: 254px; padding: 12px;
  background: color-mix(in srgb, var(--bg) 92%, var(--brand));
  border: 1px solid var(--brand-line); border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--highlight), 0 18px 40px -12px rgb(0 0 0 / .7), 0 0 18px -6px var(--brand-glow);
  opacity: 0; transform: translateY(6px) scale(.98); pointer-events: none;
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, .9, .3, 1.15);
}
.cal-pop.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 2px 4px 10px; }
.cal-title { font-size: 14px; font-weight: 600; }
.cal-nav button {
  height: 26px; width: 26px; padding: 0; margin-left: 4px; font-size: 16px; line-height: 1;
  color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); box-shadow: none;
}
.cal-nav button:hover { color: var(--text); background: var(--brand-wash-soft); border-color: var(--brand-line); box-shadow: none; filter: none; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); padding: 2px 0 6px; }
.cal-day {
  height: 30px; padding: 0; font-size: 13px; font-weight: 500;
  color: var(--text-2); background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); box-shadow: none;
}
.cal-day:hover { color: var(--text); background: var(--brand-wash); box-shadow: none; filter: none; }
.cal-day.out { color: var(--muted); opacity: .45; }
.cal-day.now { border-color: var(--brand-line); }
.cal-day.sel {
  color: var(--on-brand-deep); background: linear-gradient(180deg, var(--brand-hi), var(--brand-lo));
  box-shadow: 0 0 12px -3px var(--brand-glow);
}
.cal-foot { display: flex; justify-content: space-between; margin: 10px 4px 0; }
.cal-foot button {
  height: auto; padding: 2px 0; font-size: 12.5px; font-weight: 500;
  color: var(--brand-strong); background: none; border: 0; box-shadow: none;
}
.cal-foot button:hover { text-decoration: underline; background: none; box-shadow: none; filter: none; }

/* ------------------------------------------------------------------ login */

/* GAiA's sign-in screen: the name top-left, the card on the right, the day
   bottom-left, on the deep backdrop. */
.login {
  --bg: hsl(0 0% 6%); --text: hsl(0 0% 98%); --text-2: hsl(0 0% 85%); --muted: hsl(0 0% 65%);
  --border: hsl(0 0% 15%); --input: hsl(0 0% 12%); --highlight: rgba(255, 255, 255, .10); --star: rgba(226, 255, 238, .55);
  --brand-strong: color-mix(in srgb, var(--brand) 82%, #fff);
  position: relative; min-height: 100vh; padding: 20px 28px 32px;
  display: grid; grid-template-rows: auto 1fr auto; color: var(--text);
}
/* The backdrop is deep in both themes. */
.login::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1px 1px at 12% 18%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 33% 71%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 57% 32%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 78% 84%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 91% 14%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 66% 57%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 22% 46%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 47% 9%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 84% 43%, var(--star), transparent 100%),
    radial-gradient(1.5px 1.5px at 6% 88%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 40% 92%, var(--star), transparent 100%),
    radial-gradient(1px 1px at 72% 4%, var(--star), transparent 100%),
    radial-gradient(900px 700px at 24% 48%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 62%),
    radial-gradient(700px 600px at 96% 4%, color-mix(in srgb, var(--brand) 6%, transparent), transparent 60%),
    hsl(0 0% 6%);
  background-size: 420px 420px, 380px 380px, 520px 520px, 460px 460px, 340px 340px, 600px 600px, 440px 440px, 500px 500px, 360px 360px, 480px 480px, 560px 560px, 400px 400px, 100% 100%, 100% 100%, 100% 100%;
}
/* The mark on the left, the name with the tagline stacked under it on the right. */
/*
 * Whisper-quiet review snippets filling the empty middle of the sign-in
 * canvas: faint white, each breathing on its own slow cycle. Decoration
 * only: no pointer events, hidden from screen readers, still under the
 * card, and perfectly still for anyone who asked for less motion.
 */
.quiet-reviews { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.login > :not(.quiet-reviews) { position: relative; z-index: 1; }
/*
 * Warp: every rating is born deep in space at the vanishing point: tiny,
 * dim, out of focus: and streams past the viewer toward the edge it was
 * aimed at (--dx/--dy), swelling and accelerating the whole way, then slips
 * off screen. The easing curve is the warp: almost still while far away,
 * rushing by the end. Everything animates on transform, opacity and filter
 * only, so the flow stays liquid on the GPU. Negative delays mean the
 * stream is already in full flight at first paint.
 */
.quiet-reviews span {
  /* Dead centre of the screen: the warp core, Star Trek style. */
  position: absolute; left: 50%; top: 50%; white-space: nowrap;
  color: rgba(255, 255, 255, .16); font-weight: 500; letter-spacing: .01em;
  opacity: 0; will-change: transform, opacity, filter;
  animation: warp-pass var(--t, 12s) cubic-bezier(.6, .02, .9, .5) infinite;
  animation-delay: var(--d, 0s);
}
.quiet-reviews i, .quiet-reviews .star-only { font-style: normal; color: rgba(226, 255, 238, .5); letter-spacing: 3px; }
.quiet-reviews i { font-size: .8em; }
.quiet-reviews .s1 { font-size: 13px; font-weight: 400; color: rgba(255, 255, 255, .10); }
.quiet-reviews .s2 { font-size: 18px; }
.quiet-reviews .s3 { font-size: 25px; font-weight: 600; letter-spacing: -.01em; color: rgba(255, 255, 255, .20); }
@keyframes warp-pass {
  0% { transform: translate(-50%, -50%) scale(.25); opacity: 0; filter: blur(7px); }
  22% { opacity: 1; filter: blur(1.5px); }
  90% { opacity: 1; }
  100% { transform: translate(-50%, -50%) translate(var(--dx, 40vw), var(--dy, 0vh)) scale(1.9); opacity: 0; filter: blur(.5px); }
}
/* No motion asked for: the ratings hold still, part-way along their path. */
@media (prefers-reduced-motion: reduce) {
  .quiet-reviews span {
    animation: none; opacity: .45; filter: none;
    transform: translate(-50%, -50%) translate(calc(var(--dx, 40vw) * .55), calc(var(--dy, 0vh) * .55));
  }
}
@media (max-width: 900px) { .quiet-reviews { display: none; } }

.login-top { display: flex; align-items: center; gap: 12px; }
.login-top .brand-lines { display: flex; flex-direction: column; gap: 1px; }
.login-top .brand { align-items: center; }
.login-top .brand .mark { width: 32px; height: 32px; background-image: url(/gaia-mark-white.png); }
.login-top .brand .name { font-size: 17px; }
.login-top .tagline { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.login-card { display: grid; place-items: center; justify-content: end; padding: 32px 0; }
@media (max-width: 900px) { .login-card { justify-content: center; } }
/* GAiA's AuthCard: a hairline frame that fades from the top, a bloom behind, dark glass. */
.login .card {
  position: relative; width: min(100%, 384px); padding: 26px; border-radius: 25px; border: 0;
  background: rgba(12, 16, 14, .62);
  -webkit-backdrop-filter: blur(40px); backdrop-filter: blur(40px);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .75);
}
.login .card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 26px; pointer-events: none; padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .04) 50%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.login .card::after {
  content: ""; position: absolute; inset: -24px; z-index: -1; border-radius: 36px; pointer-events: none;
  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand) 28%, transparent) 0%, transparent 65%);
  filter: blur(40px);
}
.login .logo { display: block; max-height: 44px; margin: 0 0 18px; }
.login .wordmark { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 6px; }
.login .sub { margin: 0 0 22px; font-size: 14px; color: var(--muted); }
.login label.f { font-size: 13px; color: var(--text); }
/* Recessed wells cut into the glass. */
.login input[type="email"], .login input[type="password"] {
  height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px;
  background: rgba(0, 0, 0, .25); border-color: rgba(255, 255, 255, .08);
}
.login input:focus { border-color: var(--brand-line); box-shadow: 0 0 0 1px var(--brand-line); }
.login form button {
  position: relative; overflow: hidden; width: 100%; height: 44px; margin-top: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 6px 24px -6px var(--brand-glow);
}
.login form button:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 10px 32px -6px var(--brand-glow); }
/* The gloss sweep across the top half. */
.login form button::before { content: ""; position: absolute; inset: 0 0 50%; background: linear-gradient(180deg, rgba(255, 255, 255, .25), transparent); pointer-events: none; }
.login .foot-note { margin: 18px 0 0; text-align: center; }
.login .flash { margin-bottom: 14px; }
.daystamp { font-weight: 300; color: var(--text); }
.daystamp .day { font-size: 40px; letter-spacing: .32em; text-transform: uppercase; line-height: 1.1; }
.daystamp .date { margin-top: 6px; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------------ misc */

.trend { display: flex; align-items: flex-end; gap: 3px; height: 72px; margin-top: 8px; }
.trend .col {
  flex: 1; min-width: 4px; max-width: 34px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand) 35%, var(--brand-lo));
  box-shadow: 0 0 12px -2px var(--brand-glow);
  box-shadow: 0 0 8px color-mix(in srgb, var(--brand) 55%, transparent), 0 0 18px var(--brand-glow);
  opacity: .95; transition: opacity .2s;
}
.trend .col:hover { opacity: 1; }

/* ----------------------------------------------------------------- reports */

.chart svg { display: block; width: 100%; height: auto; }
.chart .tick { font-size: 11px; fill: var(--muted); }
.chart .donut-total { font-size: 26px; font-weight: 600; fill: var(--text); }
.chart.donut { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.chart.donut svg { width: 190px; flex: none; }
/* The language list sits beside the ring, one language per line. */
.donut-legend { display: grid; gap: 12px; min-width: 0; }
.donut-legend .lang-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.donut-legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend .lang { font-weight: 600; min-width: 88px; }
.donut-legend .nums { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }

/*
 * The chart tooltip: one floating glass chip, moved and shown by panel.js
 * for whatever mark carries data-tip. It fades and lifts in; pointer-events
 * stay off so it never steals the hover from the mark under it.
 */
.chart-tip {
  position: fixed; z-index: 60; pointer-events: none;
  padding: 7px 11px; border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg) 88%, var(--brand));
  border: 1px solid var(--brand-line);
  box-shadow: inset 0 1px 0 var(--highlight), 0 6px 20px -6px rgb(0 0 0 / .6), 0 0 14px -4px var(--brand-glow);
  font-size: 12.5px; font-weight: 500; color: var(--text); white-space: nowrap;
  opacity: 0; transform: translateY(5px) scale(.97);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .9, .3, 1.2);
}
.chart-tip.show { opacity: 1; transform: translateY(0) scale(1); }

/* Horizontal comparison bars: stores side by side, the funnel. */
.hbars { display: grid; gap: 12px; }
.hbar-row { display: grid; grid-template-columns: 130px 1fr 76px; gap: 12px; align-items: center; }
.hbar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 10px; background: var(--bar-bg); border: 1px solid var(--bar-border); border-radius: 999px; overflow: hidden; }
.hbar-fill {
  height: 100%; border-radius: 999px;
  /* Neon tube: darker at the start, brand in the middle, a lit tip at the
     end, and a two-layer halo (tight and wide) around the whole bar. */
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--chart-1) 55%, transparent),
    var(--chart-1) 72%,
    color-mix(in srgb, var(--chart-1) 72%, #fff));
  box-shadow:
    0 0 6px color-mix(in srgb, var(--chart-1) 75%, transparent),
    0 0 20px color-mix(in srgb, var(--chart-1) 40%, transparent);
}
.hbar-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; white-space: nowrap; }

.logo-preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 84px; margin: 10px 0 14px; padding: 12px;
  background: var(--bar-bg); border: 1px dashed var(--border); border-radius: var(--radius-md);
}
.logo-preview img { max-height: 56px; max-width: 100%; }
/* The native file input is a ~21px sliver; give it a real box to tap. */
input[type="file"] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit; font-size: 13px; color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border); border-radius: var(--radius-md);
  cursor: pointer;
}
input[type="file"]:hover { border-color: var(--brand-line); }
input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 6px 12px;
  font: inherit; font-size: 12px; font-weight: 500;
  color: var(--on-brand-deep); background: linear-gradient(180deg, var(--brand-hi), var(--brand-lo));
  border: 0; border-radius: var(--radius-sm); cursor: pointer;
}

.pager {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  align-items: center; justify-content: space-between;
  margin: 12px 0 0;
}
.pager [aria-disabled="true"] { opacity: .45; cursor: default; }
@media (max-width: 720px) { .pager { justify-content: center; } }


/* ---------------------------------------------------------------------------
   Phones and small tablets.

   The sidebar becomes a top bar with a scrolling row of links; a table with
   eight columns is unreadable on a 390px screen, so each row becomes a small
   card with its own labels; and a finger needs about 44px of height to hit a
   control reliably, where a mouse needs 26.
   --------------------------------------------------------------------------- */

@media (max-width: 860px) {
  /* minmax(0,...) and min-width:0: without them the nav's unwrappable row
     of links sets the grid column's minimum, the whole shell lays out
     wider than the phone, and the clipped right edge is unreachable. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell > * { min-width: 0; }
  .sidenav {
    position: sticky; top: 0; height: auto; z-index: 10;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px;
    border-right: 0; border-bottom: 1px solid var(--bar-border);
    background: var(--glass-bg);
  }
  .sidenav .brand { padding: 0; border: 0; margin: 0; }
  .sidenav .side-day { display: none; }    /* the top bar has no room for a clock */
  .sidenav .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; flex-direction: row; align-items: center; }
  .sidenav .who { display: none; }         /* the email is not worth a line here */
  .sidenav .side-foot button { width: auto; }
  .sidenav nav {
    order: 3; flex: 1 1 100%; min-width: 0; flex-direction: row; gap: 4px;
    overflow-x: auto; scrollbar-width: none; margin-bottom: -4px;
  }
  .sidenav nav::-webkit-scrollbar { display: none; }
  /* A thumb needs about 44px; the text alone is 27, so the link gets the
     rest as padding instead of the row growing taller. */
  .sidenav nav a { white-space: nowrap; min-height: 40px; padding: 0 12px; }
  .page { padding: 20px 16px 56px; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .page { padding: 18px 14px 56px; }

  /* A link inside a table is how you get to a store or a client, so on a
     phone it has to be a target, not a 17px line of text. */
  .table-wrap td a { display: inline-flex; align-items: center; min-height: 40px; }
  .crumbs a { display: inline-block; padding: 6px 2px; }

  h1 { font-size: 22px; }
  h2 { margin: 26px 0 10px; }

  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px 16px; }
  .kpi .value { font-size: 22px; }
  .kpis .kpi:first-child { grid-column: 1 / -1; }   /* the headline number gets the width */
  .kpis .kpi:first-child .value { font-size: 30px; }

  .split { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 96px 1fr 44px; gap: 10px; }

  /* Comfortable targets: 44px, and 16px text so iOS does not zoom on focus. */
  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="date"], select, textarea {
    height: 44px; min-height: 44px; font-size: 16px;
  }
  textarea { height: auto; }
  input[type="color"] { min-height: 44px; }
  button, .button { height: 44px; padding: 0 16px; }
  button.small, .button.small { height: 40px; padding: 0 14px; font-size: 13px; }
  .actions { gap: 10px; }
  .actions > form { display: contents; }
  .check { min-height: 44px; align-items: center; }
  .check input { width: 20px; height: 20px; }

  /* Each row becomes a card, with the column headings moved into the cells. */
  .table-wrap { overflow: visible; border: 0; background: transparent; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .table-wrap table { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; }
  .table-wrap tr {
    display: block;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .table-wrap tr:last-child { margin-bottom: 0; }
  .table-wrap tbody tr:hover td { background: transparent; }
  .table-wrap td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    padding: 5px 0; border: 0; text-align: right;
  }
  .table-wrap td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    font-size: 12px; font-weight: 500; color: var(--muted);
  }
  .table-wrap td[data-label=""]::before, .table-wrap td:not([data-label])::before { content: none; }
  .table-wrap td.primary {
    display: block; text-align: left;
    font-size: 16px; font-weight: 600;
    padding-bottom: 8px; margin-bottom: 6px;
    border-bottom: 1px solid var(--bar-border);
  }
  .table-wrap td.primary .small { font-weight: 400; }
  .table-wrap td.comment { display: block; text-align: left; max-width: none; }
  .table-wrap td.comment::before { display: block; margin-bottom: 2px; }
  .table-wrap td.actions { flex-wrap: wrap; justify-content: flex-start; padding-top: 10px; }
  /* A stacked card should not show a heading with nothing under it. */
  .table-wrap td.blank { display: none; }
  .table-wrap td.actions::before { flex-basis: 100%; }

  /* The bar next to a distribution row is decoration; the numbers are the point. */
  .table-wrap td.spread { display: none; }

  .login { padding: 16px 18px 24px; }
  .login-top { flex-wrap: wrap; gap: 4px 12px; }
  .daystamp .day { font-size: 26px; letter-spacing: .24em; }
  .trend { height: 60px; }
  .linkbox { padding: 10px; }
}

@media (max-width: 400px) {
  .page { padding: 16px 12px 48px; }
  .kpis { gap: 8px; }
  .bar-row { grid-template-columns: 84px 1fr 40px; }
}
