/*
 * 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%);

  /* Data-mark glow: the neon lives only on the dark canvas. */
  --data-glow: 0 0 6px color-mix(in srgb, var(--chart-1) 75%, transparent), 0 0 20px color-mix(in srgb, var(--chart-1) 40%, transparent);
  --brand-bar-glow: 0 0 8px color-mix(in srgb, var(--brand) 55%, transparent), 0 0 18px var(--brand-glow);
  --brand-fill-glow: 0 0 6px color-mix(in srgb, var(--brand) 75%, transparent), 0 0 20px var(--brand-glow);

  --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:not([data-theme="dark"]) {
    /* 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%);


    --data-glow: 0 1px 2px rgb(0 0 0 / .16);
    --brand-bar-glow: 0 1px 2px rgb(0 0 0 / .14);
    --brand-fill-glow: 0 1px 2px rgb(0 0 0 / .14);
    --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);
  }
}
/* The same light values when the viewer forces the light theme. */
:root[data-theme="light"] {
    /* 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%);


    --data-glow: 0 1px 2px rgb(0 0 0 / .16);
    --brand-bar-glow: 0 1px 2px rgb(0 0 0 / .14);
    --brand-fill-glow: 0 1px 2px rgb(0 0 0 / .14);
    --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:not([data-theme="dark"]) { --brand-strong: color-mix(in srgb, var(--brand) 72%, #000); }
}
/* The same light values when the viewer forces the light theme. */
:root[data-theme="light"] { --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) {
  :root:not([data-theme="dark"]) .sidenav .brand .mark { background-image: url(/gaia-mark.png); }
}
/* The same light values when the viewer forces the light theme. */
:root[data-theme="light"] .sidenav .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); }
/* Theme picker: Auto / Light / Dark, one small segmented control. */
.theme-pick {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bar-bg); border: 1px solid var(--bar-border); border-radius: var(--radius-md);
}
.theme-pick button {
  flex: 1; height: 26px; padding: 0 8px; font-size: 12px; font-weight: 500;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); box-shadow: none;
}
.theme-pick button:hover { color: var(--text); background: var(--brand-wash-soft); box-shadow: none; filter: none; }
.theme-pick button.on {
  color: var(--text); background: var(--brand-wash); border-color: var(--brand-line);
  box-shadow: inset 0 1px 0 var(--highlight);
}

.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: var(--brand-fill-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"], input[type="number"], 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) {
  :root:not([data-theme="dark"]) input[type="date"] { color-scheme: light; }
}
/* The same light values when the viewer forces the light theme. */
:root[data-theme="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: var(--brand-bar-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); }

/* On the light canvas the SVG neon halo becomes a plain soft shadow: CSS
   filter beats the SVG filter attribute, so this overrides rep-glow and
   friends without touching the markup. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .chart svg [filter] { filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / .22)); }
}
:root[data-theme="light"] .chart svg [filter] { filter: drop-shadow(0 1px 1.5px rgb(0 0 0 / .22)); }

/* 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. The halo is a token: two-layer neon in the dark, a whisper of a
     shadow in the light. */
  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: var(--data-glow, 0 0 10px var(--brand-glow));
}
.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 */
  /* Theme picker: Auto / Light / Dark, one small segmented control. */
.theme-pick {
  display: flex; gap: 2px; padding: 3px;
  background: var(--bar-bg); border: 1px solid var(--bar-border); border-radius: var(--radius-md);
}
.theme-pick button {
  flex: 1; height: 26px; padding: 0 8px; font-size: 12px; font-weight: 500;
  color: var(--muted); background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm); box-shadow: none;
}
.theme-pick button:hover { color: var(--text); background: var(--brand-wash-soft); box-shadow: none; filter: none; }
.theme-pick button.on {
  color: var(--text); background: var(--brand-wash); border-color: var(--brand-line);
  box-shadow: inset 0 1px 0 var(--highlight);
}

.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"], input[type="number"], 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; }
}

/* ------------------------------------------------------------------ G-Sub */

/* One hue per status, the same on every pill, tab and chart of the panel. */
.pill.st-new        { --st: var(--chart-2); }
.pill.st-in_progress { --st: var(--chart-3); }
.pill.st-saved      { --st: var(--chart-1); }
.pill.st-delayed  { --st: var(--chart-4); }
.pill.st-cancelled  { --st: var(--chart-5); }
.pill[class*="st-"] {
  color: color-mix(in srgb, var(--st) 80%, var(--text));
  background: color-mix(in srgb, var(--st) 14%, transparent);
  border-color: color-mix(in srgb, var(--st) 34%, transparent);
  box-shadow: 0 3px 12px -5px color-mix(in srgb, var(--st) 60%, transparent);
  white-space: nowrap;
}

/* The queue's status tabs: a segmented control with counts. */
.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 16px;
  background: var(--bar-bg); border: 1px solid var(--bar-border); border-radius: 12px;
}
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 9px;
  font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none;
  border: 1px solid transparent;
}
.tabs a:hover { color: var(--text); background: var(--brand-wash); }
.tabs a[aria-current="page"] {
  color: var(--text); background: var(--brand-wash); border-color: var(--brand-line);
  box-shadow: inset 0 1px 0 var(--edge, rgba(255,255,255,.1)), 0 3px 12px -4px var(--brand-glow);
}
.tabs .count {
  min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center;
  font-size: 11px; font-variant-numeric: tabular-nums; background: var(--secondary); color: var(--muted);
}
.tabs a[aria-current="page"] .count { background: var(--brand-line); color: var(--text); }

/* One request: what the customer said on the left, the agent's desk on the right. */
.request-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .request-grid { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 8px; } }
.quote {
  margin: 0; padding: 12px 14px; border-radius: var(--radius-md, 12px); white-space: pre-wrap;
  background: var(--bar-bg); border: 1px solid var(--bar-border); font-size: 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before {
  content: ""; position: absolute; left: 4px; top: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-strong); box-shadow: 0 0 8px var(--brand-glow);
}
.timeline li::after {
  content: ""; position: absolute; left: 7.5px; top: 18px; bottom: 2px; width: 1px; background: var(--bar-border);
}
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline .what { font-size: 14px; }
.timeline .note { margin-top: 4px; font-size: 13px; color: var(--muted); white-space: pre-wrap; }

.age { font-variant-numeric: tabular-nums; white-space: nowrap; }
.age.late { color: var(--warn); font-weight: 600; }

/* Stacked month bars carry their legend on the same hues as the pills. */
.month-table td.num { white-space: nowrap; }
.rate-up { color: var(--brand-strong); font-weight: 600; }
.month-table tr.total td { border-top: 1px solid var(--bar-border); background: var(--bar-bg); }
.pill.st-waiting    { --st: var(--warn); }
.pill.st-completed  { --st: var(--muted); }
.tabs.subtle { background: transparent; border-style: dashed; }
.tabs.subtle a { padding: 5px 10px; font-size: 12.5px; }

/* Three-way switch (Hidden / Optional / Required) on the form settings page. */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--bar-bg); border: 1px solid var(--bar-border); flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span { display: inline-block; padding: 5px 11px; border-radius: 8px; font-size: 12.5px; color: var(--muted); border: 1px solid transparent; }
.seg input:checked + span { color: var(--text); background: var(--brand-wash); border-color: var(--brand-line); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Fields that only matter for one status: panel.js shows them when it is picked. */
.reason-box { border: 1px solid var(--brand-line); border-radius: 12px; padding: 12px 14px; margin: 0; background: var(--brand-wash); }
.reason-box legend { padding: 0 6px; font-size: 13px; font-weight: 600; }
.when-status[hidden] { display: none; }
.inline-edit { display: inline-block; } .inline-edit summary { list-style: none; cursor: pointer; } .inline-edit summary::-webkit-details-marker { display: none; }
.reason-box .row + div { margin-top: 10px; }

/*
 * G-Sub's sign-in stream: subscription products instead of G-Sat's ratings.
 * Same warp flight (.quiet-reviews span); each item is a line icon, the
 * product, and a small chip saying what is happening to the subscription.
 */
.quiet-subs span { display: inline-flex; align-items: center; gap: .55em; }
.quiet-subs .sub-icon { width: 1.35em; height: 1.35em; flex: none; color: rgba(226, 255, 238, .42); }
.quiet-subs .chip {
  font-style: normal; font-size: .72em; font-weight: 500; letter-spacing: .01em;
  padding: .18em .65em; border-radius: 999px;
  color: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .04);
}
.quiet-subs .chip.ok { color: rgba(140, 240, 180, .7); border-color: rgba(24, 180, 81, .35); background: rgba(24, 180, 81, .08); }
.quiet-subs .chip.pause { color: rgba(196, 170, 255, .7); border-color: rgba(150, 110, 250, .35); background: rgba(150, 110, 250, .08); }
.quiet-subs .chip.warn { color: rgba(255, 200, 120, .75); border-color: rgba(245, 160, 40, .35); background: rgba(245, 160, 40, .08); }

/*
 * The menu with its icons: one line-icon family (src/views/icons.js), muted
 * at rest, in the brand colour on the page you are on. Settings sits below
 * a hairline, apart from the daily work, with the same gear in the tabs.
 */
.sidenav nav a { gap: 11px; }
.sidenav nav .ico { width: 18px; height: 18px; flex: none; color: var(--muted); transition: color .2s, transform .2s; }
.sidenav nav a:hover .ico { color: var(--text); }
.sidenav nav a[aria-current="page"] .ico { color: var(--brand-strong); }
.sidenav nav a:hover .ico { transform: translateX(1px); }
.sidenav nav a.nav-settings { margin-top: 14px; position: relative; }
.sidenav nav a.nav-settings::before {
  content: ""; position: absolute; left: 10px; right: 10px; top: -10px; border-top: 1px solid var(--bar-border);
}
.sidenav nav a.nav-settings:hover .ico { transform: rotate(45deg); }
.sidenav nav a.nav-settings .ico { transition: color .2s, transform .45s cubic-bezier(.2, .9, .3, 1); }

.settings-tabs { margin-bottom: 22px; gap: 6px; }
.settings-tabs a { gap: 8px; padding: 8px 14px; }
.settings-tabs .ico { width: 16px; height: 16px; flex: none; color: var(--muted); }
.settings-tabs a[aria-current="page"] .ico { color: var(--brand-strong); }
@media (max-width: 720px) {
  .settings-tabs a span { font-size: 12.5px; }
}

/* Numbers look like every other field: no browser spinners. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Logging a contact: result and channel wide, minutes narrow; the call-back
   date appears only for "Call back later" (panel.js). */
.contact-grid { display: grid; gap: 12px; align-items: end; }
.date-time { display: grid; grid-template-columns: minmax(150px, 220px) 110px; gap: 10px; }
.callback-at { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--brand-line); background: var(--brand-wash); }
.when-value[hidden] { display: none; }

/* The contact form row: result, channel, when, minutes. */
.contact-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.25fr) 96px; }
@media (max-width: 1100px) { .contact-grid { grid-template-columns: 1fr 1fr; } .contact-grid > :first-child { grid-column: auto; } }
.date-time.compact { grid-template-columns: minmax(0, 1fr) 92px; gap: 8px; }
.callback-at .label-retry { display: none; }
.callback-at:not(.is-required) .label-callback { display: none; }
.callback-at:not(.is-required) .label-retry { display: inline; }
.callback-at:not(.is-required) { border-style: dashed; background: transparent; }
.callback-at input[type="date"], .callback-at select { background: var(--bg-2); }

/* The case page: the customer's side and recent activity stack on the left,
   as tall as the agent's desk on the right; the activity list scrolls. */
.request-grid { align-items: stretch; }
.col-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col-stack > .card { margin: 0; }
.recent { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 220px; }
.recent-list { list-style: none; margin: 0; padding: 0 4px 0 0; flex: 1 1 0; min-height: 0; max-height: 520px; overflow-y: auto; }
@media (max-width: 960px) { .recent-list { max-height: 320px; } }
.recent-list li {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 2px 10px; padding: 8px 0 8px 12px;
  border-bottom: 1px solid var(--bar-border); position: relative; font-size: 13px;
}
.recent-list li:last-child { border-bottom: 0; }
.recent-list li::before { content: ""; position: absolute; left: 0; top: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.recent-list li.tone-new::before { background: var(--chart-2); }
.recent-list li.tone-status::before { background: var(--brand-strong); }
.recent-list li.tone-contact::before { background: var(--chart-4); }
.recent-list li.tone-warn::before { background: var(--warn); }
.recent-list .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.recent-list .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-list .who { grid-column: 2 / 4; color: var(--muted); font-size: 12px; }
.recent-list .state { grid-column: 3; grid-row: 1; align-self: start; }
.recent-list .state .pill { font-size: 11px; padding: 1px 8px; }
.request-grid { margin-bottom: 18px; }

/* ---------------------------------------------------- My appointments */
.cal-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cal-step { display: flex; gap: 6px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } }
.week-card { padding: 0; overflow: hidden; }

.wk { --hour: 60px; --gutter: 64px; font-size: 12.5px; }
.wk-head, .wk-allday { display: grid; grid-template-columns: var(--gutter) repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--bar-border); }
.wk-head { padding: 12px 0 8px; }
.wk-gutter { color: var(--muted); font-size: 10.5px; text-align: right; padding-right: 8px; align-self: center; }
.wk-day { text-align: center; color: var(--muted); font-weight: 500; }
.wk-day .num { color: var(--text); }
.wk-day.today { color: var(--text); font-weight: 600; }
.wk-day.today .num { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; background: var(--chart-5); color: #fff; }
.wk-allday { min-height: 30px; }
.wk-allday .wk-cell { border-left: 1px solid var(--bar-border); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wk-chip {
  display: block; padding: 2px 7px; border-radius: 5px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); text-decoration: none;
}
.wk-chip.follow { --cat: var(--chart-1); background: color-mix(in srgb, var(--cat) 28%, transparent); border-left: 3px solid var(--cat); }
.wk-body { position: relative; display: grid; grid-template-columns: var(--gutter) repeat(7, minmax(0, 1fr)); height: max(560px, calc(100vh - 250px)); overflow-y: auto; }
.wk-hours .wk-hour { height: var(--hour); position: relative; top: -7px; color: var(--muted); font-size: 10.5px; text-align: right; padding-right: 8px; }
.wk-col {
  position: relative; border-left: 1px solid var(--bar-border); height: calc(var(--hour) * 24);
  background-image: linear-gradient(to bottom, var(--bar-border) 1px, transparent 1px);
  background-size: 100% var(--hour);
}
.wk-col.today { background-color: color-mix(in srgb, var(--brand) 4%, transparent); }
.wk-event {
  position: absolute; display: flex; flex-direction: column; justify-content: center; overflow: hidden;
  padding: 3px 8px; border-radius: 6px; text-decoration: none; color: var(--text); line-height: 1.25; gap: 1px;
  --cat: var(--chart-4);
  background: color-mix(in srgb, var(--cat) 32%, var(--bg-2, #151515)); border-left: 3px solid var(--cat);
  transition: filter .15s, transform .15s;
}
.wk-event:hover { filter: brightness(1.15); text-decoration: none; z-index: 2; }
.wk-event .t { font-size: 11.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-event .m { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Overdue keeps its subcategory colour and gets a red ring and dot. */
.wk-event.overdue { box-shadow: inset 0 0 0 1.5px var(--chart-5); }
.wk-event.overdue::after { content: ""; position: absolute; top: 5px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--chart-5); }
[data-move] { cursor: grab; touch-action: none; -webkit-user-drag: none; user-select: none; }
.wk-event.dragging, .wk-chip.dragging { cursor: grabbing; z-index: 5; opacity: .92; box-shadow: 0 10px 28px -8px rgba(0,0,0,.6), inset 0 0 0 1.5px var(--cat); transition: none; }
.wk-event.saving, .wk-chip.saving { opacity: .6; }
.cal-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  padding: 10px 16px; border-radius: 10px; font-size: 13px; color: var(--text);
  background: color-mix(in srgb, var(--bg-2, #151515) 92%, transparent); border: 1px solid var(--brand-line);
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.6); backdrop-filter: blur(10px);
}
.cat-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cat-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--cat); margin-right: 6px; }
.wk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--chart-5); z-index: 3; }
.wk-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--chart-5); }
.wk-now span { position: absolute; right: 4px; top: -18px; font-size: 10px; color: #fff; background: var(--chart-5); border-radius: 4px; padding: 0 4px; }

.notes h3 { display: flex; align-items: center; gap: 8px; }
.notes .count, .note-group .count {
  min-width: 22px; padding: 0 7px; border-radius: 999px; font-size: 11px; text-align: center; font-variant-numeric: tabular-nums;
  background: var(--secondary); color: var(--muted);
}
.note-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bar-border); }
.note-group h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.note-group h4::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.note-group.tone-bad h4::before { background: var(--chart-5); }
.note-group.tone-bad .count { background: color-mix(in srgb, var(--chart-5) 22%, transparent); color: var(--text); }
.note-group.tone-today h4::before { background: var(--chart-4); }
.note-group.tone-follow h4::before { background: var(--chart-1); }
.note-group.tone-new h4::before { background: var(--chart-2); }
.note-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.note-group li a {
  display: grid; gap: 1px; padding: 7px 9px; border-radius: 8px; text-decoration: none; color: var(--text);
  background: var(--bar-bg); border: 1px solid transparent;
}
.note-group li a:hover { border-color: var(--brand-line); text-decoration: none; }
.note-group .who { font-size: 13px; font-weight: 500; }
.note-group .meta { font-size: 11.5px; color: var(--muted); }

/* Wide pages (the calendar): use the screen instead of the reading column. */
.page.wide { max-width: 1760px; }

/*
 * Scrollbars in the panel's own material: thin, translucent, no white track,
 * brighter on hover. Firefox reads the first two lines, Chrome and Safari the
 * ::-webkit rules.
 */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text) 22%, transparent) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text) 18%, transparent); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--brand) 55%, transparent); }
*::-webkit-scrollbar-corner { background: transparent; }

/* Agent picker: the list and "Assign to me" side by side. */
.assign-row { display: flex; gap: 8px; align-items: center; }
.assign-row select { flex: 1; min-width: 0; }
.assign-row button { white-space: nowrap; }

/* History: what happened on the left, the status it left the case in on the right. */
.timeline .what-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.timeline .what-row .pill { flex: none; font-size: 11.5px; }

/* Settings → Statuses */
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 8px;
  background: var(--st, var(--muted)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
input[type="color"] { width: 44px; height: 38px; padding: 3px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--input); cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }

/* Subcategory pills: each subcategory in its own colour (Settings → Case statuses). */
.pill.cat {
  color: color-mix(in srgb, var(--cat) 78%, var(--text));
  background: color-mix(in srgb, var(--cat) 15%, transparent);
  border-color: color-mix(in srgb, var(--cat) 36%, transparent);
  white-space: nowrap;
}
.pill.cat::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cat); margin-right: 6px; vertical-align: 1px; }
.cat-colors { display: flex; flex-wrap: wrap; gap: 10px 18px; margin: 4px 0 14px; }
.cat-color { display: flex; align-items: center; gap: 8px; }
.cat-color input[type="color"] { width: 34px; height: 30px; }
.cat-actions { display: flex; gap: 8px; }
.note-group li a { border-left: 3px solid var(--cat, transparent); }
.note-group.tone-upcoming h4::before { background: var(--chart-2); }
