/* Adamard design system -- matched to adamard.am, 2026-08-25; one shared
 * token set with the site and the ops console since 2026-11-05.
 *
 * Colours, radii, the focus ring, motion durations/easings/distances and the
 * shared keyframes all come from the token block below: a verbatim copy of
 * design/tokens.css, which the marketing site and the ops console carry too.
 * The names this file has always used (--bg, --accent, --text-dim, ...) are
 * mapped onto those --ad-* tokens rather than restated, so the apps cannot
 * drift apart again (ops had already drifted on --text-faint). The motion
 * rules are in design/MOTION.md.
 *
 * ACCENT HAS TWO ROLES, and mixing them up reintroduces a real accessibility
 * failure:
 *   --accent       the brand lime #D8EF50, a FILL only. Its text is always
 *                  --on-accent, #232323 in both themes (12.3:1). On the light
 *                  page lime is 1.2:1, so a lime button also gets a 1px
 *                  --ad-accent-edge there. Never hard-code either.
 *   --accent-text  accent-coloured TEXT (links): #232323 on light, lime on dark.
 *   --accent-line  state lines, checks, bars and the active marker: the same
 *                  split, so they reach 3:1 in both themes.
 * Every status colour now has the same split: --ok/--warn/--danger are fills,
 * borders and tints; --ok-text/--warn-text/--danger-text are text. In light
 * mode the fill green and amber are only 2.8-3.3:1 as text, which is what A16
 * measured on the badges, the links and "Saved and live."
 *
 * Theme: the user's saved choice, otherwise LIGHT (owner decision
 * 2026-11-21; the system appearance no longer picks dark), set on
 * <html data-theme> by theme.js before first paint. Both themes come from
 * the owner's brand book (2026-11-20): light #F4F4F4 / #232323 text, dark
 * #232323 / #F4F4F4 text, lime #D8EF50 accent fills.
 */
/* Noto Sans and Noto Sans Armenian (SIL OFL 1.1, fonts/Noto-OFL.txt),
   the brand book's body face, self-hosted. Variable 100-900, one file per
   script; the browser loads only the scripts a page uses. */
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/noto-sans-cyrillic-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/noto-sans-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/noto-sans-latin-ext-wght-normal.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;
}
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/noto-sans-latin-wght-normal.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: 'Noto Sans Armenian';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/noto-sans-armenian-armenian-wght-normal.woff2') format('woff2');
  unicode-range: U+0308, U+0530-058F, U+2010, U+2024, U+25CC, U+FB13-FB17;
}

/* ==== adamard design tokens: BEGIN ==== */
/* Adakam design tokens v2 (owner's brand book 2026-11-20, applied to the
 * apps 2026-11-26). One design system for adamard.am, dashboard.adamard.am and
 * ops.adamard.am (and the CRM, which can copy this block as is). Brand rules
 * and contrast numbers: site/adakam/BRAND.md; design/MOTION.md for motion.
 *
 * Each app carries a verbatim copy (different origins, no shared build):
 *   backend/app/static/app.css          (customer dashboard)
 *   backend/admin_app/static/app.css    (ops console)
 *   site/src/styles/globals.css         (old marketing site; opt-in with
 *                                        --site, its owner syncs it separately)
 * Edit design/tokens.css, then run `node design/sync-tokens.mjs`.
 * backend/tests/test_design_system.mjs fails if an app copy drifts.
 *
 * LIGHT is the base (:root): page #F4F4F4, text #232323. Dark applies under
 * prefers-color-scheme: dark unless <html data-theme="light">, or when
 * <html data-theme="dark">: page #232323, text #F4F4F4.
 * Accent roles: --ad-accent is lime #D8EF50, a FILL only; text on it is
 * --ad-on-accent (#232323, 12.3:1). On the light page lime is 1.2:1, so it is
 * never text or a state line there: --ad-accent-text and --ad-accent-line are
 * #232323 on light and lime on dark, and a lime button gets a 1px
 * --ad-accent-edge on light. Blue, green and orange are small brand fills.
 * Status colours (ok, warn, danger, info) stay separate from the brand accents.
 */
:root {
  color-scheme: light;
  --ad-bg: #F4F4F4; /* page: brand light base */
  --ad-surface: #FFFFFF; /* cards, panels, inputs */
  --ad-surface-2: #EBEBEB; /* sunken: table heads, notes, code */
  --ad-surface-3: #E5E5E5; /* raised: hover rows, nav hover, menus (apps; the site uses #FFFFFF) */
  --ad-line: #DCDCDC; /* dividers only (decorative) */
  --ad-line-strong: #808080; /* control edges (3.6:1 on bg, 3.9:1 on surface, 3.1:1 on surface-3) */
  --ad-text: #232323; /* brand dark base: body and headings (14.3:1 on bg) */
  --ad-text-dim: #5C5C5C; /* secondary text (6.1:1 on bg, 5.6:1 on surface-2) */
  --ad-accent: #D8EF50; /* lime: FILL of the primary action and small brand marks */
  --ad-accent-hover: #CBE63A; /* its hover/pressed step */
  --ad-accent-edge: #232323; /* 1px edge so the lime fill reads on the light page */
  --ad-accent-line: #232323; /* state lines (current page, featured plan) and hero call lines: must reach 3:1 */
  --ad-hero-glow: rgb(35 35 35 / .05); /* neutral on light: no lime haze */
  --ad-grid-line: rgb(35 35 35 / .07);
  --ad-accent-text: #232323; /* links and accent-coloured TEXT: never a brand accent on light */
  --ad-on-accent: #232323; /* text/icons on any accent fill (12.3:1 on lime) */
  --ad-accent-soft: #F0F8C8; /* lime tint: highlighted blocks, active rows */
  --ad-blue: #88BDFC;
  --ad-orange: #E26230;
  --ad-green: #5DDB99;
  --ad-blue-soft: #E3EFFE;
  --ad-green-soft: #DDF5E8;
  --ad-orange-soft: #FBE4DA;
  --ad-ok: #2E8A57;
  --ad-ok-text: #17703D;
  --ad-ok-soft: #E3F4E8;
  --ad-warn: #BA7917;
  --ad-warn-text: #8A5300;
  --ad-warn-soft: #FFF1D6;
  --ad-danger: #C02222; /* stop: failures, field errors, delete (4.77:1 on #E5E5E5, 6.0:1 on #FFFFFF) */
  --ad-danger-text: #B02B27;
  --ad-danger-soft: #FEEBE9;
  --ad-on-danger: #FFFFFF;
  --ad-info: #3977A8;
  --ad-info-text: #1F5FBF;
  --ad-info-soft: #E6EEFB;
  --ad-neutral-text: #5E5E5E;
  --ad-neutral-soft: #EBEBEB;
  --ad-neutral-edge: #767676; /* 3:1 non-text edge */
  --ad-focus-ring: #232323; /* 2px focus outline (14.3:1) */
  --ad-text-faint: var(--ad-text-dim); /* legacy alias */
  --ad-selection: #F0F8C8;
  --ad-shadow-1: 0 1px 2px rgb(35 35 35 / .06), 0 1px 3px rgb(35 35 35 / .08);
  --ad-shadow-2: 0 4px 14px rgb(35 35 35 / .07), 0 1px 3px rgb(35 35 35 / .05);
  --ad-shadow-3: 0 12px 32px rgb(35 35 35 / .12), 0 2px 6px rgb(35 35 35 / .06);
  --ad-shadow: var(--ad-shadow-3);
  --ad-scrim: rgb(35 35 35 / .48);
  --ad-bg-rgb: 244 244 244;
  --ad-surface-rgb: 255 255 255;
  --ad-surface-2-rgb: 235 235 235;
  --ad-line-rgb: 220 220 220;
  --ad-text-rgb: 35 35 35;
  --ad-text-dim-rgb: 92 92 92;
  --ad-accent-rgb: 216 239 80;
  --ad-accent-text-rgb: 35 35 35;
  --ad-on-accent-rgb: 35 35 35;
  --ad-ok-rgb: 46 138 87;
  --ad-warn-rgb: 186 121 23;
  --ad-danger-rgb: 192 34 34;
  --ad-info-rgb: 57 119 168;
  --ad-accent-hover-rgb: 203 230 58;
  --ad-ok-text-rgb: 23 112 61;
  --ad-warn-text-rgb: 138 83 0;
  --ad-danger-text-rgb: 176 43 39;
  --ad-neutral-text-rgb: 94 94 94;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ad-bg: #232323; /* page: brand dark base */
  --ad-surface: #2C2C2C; /* cards, panels, inputs */
  --ad-surface-2: #1C1C1C; /* sunken: notes, footer, code */
  --ad-surface-3: #333333; /* raised: popovers, menus */
  --ad-line: #3A3A3A; /* dividers only (decorative) */
  --ad-line-strong: #808080; /* control edges (4.0:1 on bg, 3.2:1 on surface-3) */
  --ad-text: #F4F4F4; /* brand light base (14.3:1 on bg) */
  --ad-text-dim: #B3B3B3; /* secondary text (7.5:1 on bg, 6.0:1 on surface-3) */
  --ad-accent: #D8EF50; /* lime fill (12.3:1 against bg) */
  --ad-accent-hover: #E4F57E;
  --ad-accent-edge: transparent;
  --ad-accent-line: #D8EF50;
  --ad-hero-glow: rgb(216 239 80 / .12);
  --ad-grid-line: rgb(255 255 255 / .07);
  --ad-accent-text: #D8EF50; /* lime links and accent text on dark (12.3:1) */
  --ad-on-accent: #232323;
  --ad-accent-soft: #3B4020; /* lime tint on dark: text 9.8:1, dim 5.2:1 */
  --ad-blue: #88BDFC;
  --ad-orange: #E26230;
  --ad-green: #5DDB99;
  --ad-blue-soft: #22303F;
  --ad-green-soft: #1F3A2C;
  --ad-orange-soft: #43281D;
  --ad-ok: #5DDB99;
  --ad-ok-text: #5FD08A;
  --ad-ok-soft: #1C3A27;
  --ad-warn: #E9B452;
  --ad-warn-text: #FFC15E;
  --ad-warn-soft: #3D2E12;
  --ad-danger: #FF8076; /* 4.66:1 on #3A3A3A, 6.4:1 on #232323 */
  --ad-danger-text: #F98F84;
  --ad-danger-soft: #3B1C1A;
  --ad-on-danger: #170C0B;
  --ad-info: #88BDFC;
  --ad-info-text: #7FB0FF;
  --ad-info-soft: #1D2B44;
  --ad-neutral-text: #A8A8A8;
  --ad-neutral-soft: #3A3A3A;
  --ad-neutral-edge: #8C8C8C; /* 3:1 non-text edge */
  --ad-focus-ring: #D8EF50;
  --ad-text-faint: var(--ad-text-dim); /* legacy alias */
  --ad-selection: #3B4020;
  --ad-shadow-1: 0 1px 2px rgb(0 0 0 / .40);
  --ad-shadow-2: 0 6px 16px rgb(0 0 0 / .40);
  --ad-shadow-3: 0 16px 40px rgb(0 0 0 / .50);
  --ad-shadow: var(--ad-shadow-3);
  --ad-scrim: rgb(0 0 0 / .62);
  --ad-bg-rgb: 35 35 35;
  --ad-surface-rgb: 44 44 44;
  --ad-surface-2-rgb: 28 28 28;
  --ad-line-rgb: 58 58 58;
  --ad-text-rgb: 244 244 244;
  --ad-text-dim-rgb: 179 179 179;
  --ad-accent-rgb: 216 239 80;
  --ad-accent-text-rgb: 216 239 80;
  --ad-on-accent-rgb: 35 35 35;
  --ad-ok-rgb: 93 219 153;
  --ad-warn-rgb: 233 180 82;
  --ad-danger-rgb: 255 128 118;
  --ad-info-rgb: 136 189 252;
  --ad-accent-hover-rgb: 228 245 126;
  --ad-ok-text-rgb: 95 208 138;
  --ad-warn-text-rgb: 255 193 94;
  --ad-danger-text-rgb: 249 143 132;
  --ad-neutral-text-rgb: 168 168 168;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ad-bg: #232323; /* page: brand dark base */
    --ad-surface: #2C2C2C; /* cards, panels, inputs */
    --ad-surface-2: #1C1C1C; /* sunken: notes, footer, code */
    --ad-surface-3: #333333; /* raised: popovers, menus */
    --ad-line: #3A3A3A; /* dividers only (decorative) */
    --ad-line-strong: #808080; /* control edges (4.0:1 on bg, 3.2:1 on surface-3) */
    --ad-text: #F4F4F4; /* brand light base (14.3:1 on bg) */
    --ad-text-dim: #B3B3B3; /* secondary text (7.5:1 on bg, 6.0:1 on surface-3) */
    --ad-accent: #D8EF50; /* lime fill (12.3:1 against bg) */
    --ad-accent-hover: #E4F57E;
    --ad-accent-edge: transparent;
    --ad-accent-line: #D8EF50;
    --ad-hero-glow: rgb(216 239 80 / .12);
    --ad-grid-line: rgb(255 255 255 / .07);
    --ad-accent-text: #D8EF50; /* lime links and accent text on dark (12.3:1) */
    --ad-on-accent: #232323;
    --ad-accent-soft: #3B4020; /* lime tint on dark: text 9.8:1, dim 5.2:1 */
    --ad-blue: #88BDFC;
    --ad-orange: #E26230;
    --ad-green: #5DDB99;
    --ad-blue-soft: #22303F;
    --ad-green-soft: #1F3A2C;
    --ad-orange-soft: #43281D;
    --ad-ok: #5DDB99;
    --ad-ok-text: #5FD08A;
    --ad-ok-soft: #1C3A27;
    --ad-warn: #E9B452;
    --ad-warn-text: #FFC15E;
    --ad-warn-soft: #3D2E12;
    --ad-danger: #FF8076; /* 4.66:1 on #3A3A3A, 6.4:1 on #232323 */
    --ad-danger-text: #F98F84;
    --ad-danger-soft: #3B1C1A;
    --ad-on-danger: #170C0B;
    --ad-info: #88BDFC;
    --ad-info-text: #7FB0FF;
    --ad-info-soft: #1D2B44;
    --ad-neutral-text: #A8A8A8;
    --ad-neutral-soft: #3A3A3A;
    --ad-neutral-edge: #8C8C8C; /* 3:1 non-text edge */
    --ad-focus-ring: #D8EF50;
    --ad-text-faint: var(--ad-text-dim); /* legacy alias */
    --ad-selection: #3B4020;
    --ad-shadow-1: 0 1px 2px rgb(0 0 0 / .40);
    --ad-shadow-2: 0 6px 16px rgb(0 0 0 / .40);
    --ad-shadow-3: 0 16px 40px rgb(0 0 0 / .50);
    --ad-shadow: var(--ad-shadow-3);
    --ad-scrim: rgb(0 0 0 / .62);
    --ad-bg-rgb: 35 35 35;
    --ad-surface-rgb: 44 44 44;
    --ad-surface-2-rgb: 28 28 28;
    --ad-line-rgb: 58 58 58;
    --ad-text-rgb: 244 244 244;
    --ad-text-dim-rgb: 179 179 179;
    --ad-accent-rgb: 216 239 80;
    --ad-accent-text-rgb: 216 239 80;
    --ad-on-accent-rgb: 35 35 35;
    --ad-ok-rgb: 93 219 153;
    --ad-warn-rgb: 233 180 82;
    --ad-danger-rgb: 255 128 118;
    --ad-info-rgb: 136 189 252;
    --ad-accent-hover-rgb: 228 245 126;
    --ad-ok-text-rgb: 95 208 138;
    --ad-warn-text-rgb: 255 193 94;
    --ad-danger-text-rgb: 249 143 132;
    --ad-neutral-text-rgb: 168 168 168;
  }
}

:root {
  /* ---- type ---- */
  /* One sans for everything: Noto Sans (Latin, Cyrillic) and Noto Sans
     Armenian, variable 100-900, SIL OFL 1.1. The brand book's heading face
     (Arm Hmk Imagine Square) has no web licence on record, so headings use
     Noto Sans at a heavier weight until it does. */
  --ad-font-ui: 'Noto Sans', 'Noto Sans Armenian', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ad-font-display: var(--ad-font-ui);
  --ad-font-mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --ad-fw-body: 400;
  --ad-fw-strong: 600;
  --ad-fw-head: 700;          /* app headings (sans) */
  --ad-fw-display: 800;       /* site display (Noto Sans) */

  /* App scale: five sizes, nothing under 12px. */
  --ad-fs-xs: .75rem;         /* 12px  badges, captions, table heads */
  --ad-fs-sm: .875rem;        /* 14px  app body, tables, controls */
  --ad-fs-md: 1rem;           /* 16px  inputs, site body, small headings */
  --ad-fs-lg: 1.3125rem;      /* 21px  section headings, site h3 */
  --ad-fs-xl: 1.6875rem;      /* 27px  page headings, KPI numbers */
  /* Site additions. */
  --ad-fs-lede: 1.125rem;     /* 18px  hero sentence, section intro */
  --ad-fs-2xl: 2.25rem;       /* 36px  site h2 */
  --ad-fs-display: clamp(2.75rem, 1.6rem + 4.2vw, 4.5rem); /* 44-72px hero h1 */

  --ad-lh-display: 1.08;
  --ad-lh-head: 1.25;
  --ad-lh-body: 1.55;
  --ad-tracking-display: -0.02em; /* Latin/Cyrillic only; 0 for :lang(hy) */
  --ad-measure: 65ch;

  /* ---- space: 4px base ---- */
  --ad-space-1: .25rem;       /* 4 */
  --ad-space-2: .5rem;        /* 8 */
  --ad-space-3: .75rem;       /* 12 */
  --ad-space-4: 1rem;         /* 16 */
  --ad-space-5: 1.5rem;       /* 24 */
  --ad-space-6: 2rem;         /* 32 */
  --ad-space-7: 3rem;         /* 48  site section gap (phone) */
  --ad-space-8: 4rem;         /* 64 */
  --ad-space-9: 6rem;         /* 96  site section gap (desktop) */

  /* ---- shape ---- */
  --ad-radius-sm: 4px;        /* badges inside rows, checkboxes */
  --ad-radius-control: 8px;   /* buttons, inputs, menus items */
  --ad-radius-panel: 12px;    /* app panels, tables, dialogs */
  --ad-radius-card: 16px;     /* site cards (example call card) */
  --ad-radius-pill: 999px;    /* settings pill, status tags */
  --ad-border: 1px;
  --ad-focus-width: 2px;
  --ad-focus-offset: 2px;

  /* ---- sizes ---- */
  --ad-control-h: 2.5rem;     /* 40px desktop controls */
  --ad-control-h-sm: 2rem;    /* 32px dense ops controls (pointer only) */
  --ad-target: 2.75rem;       /* 44px touch target minimum */
  --ad-header-site: 4rem;     /* 64 */
  --ad-header-app: 3.75rem;   /* 60 dashboard + CRM */
  --ad-header-ops: 3.25rem;   /* 52 */
  --ad-sidebar: 15rem;        /* 240 */
  --ad-container: 73.75rem;   /* 1180 */
  --ad-gutter: max(16px, 4vw);

  /* ---- stacking ---- */
  --ad-z-sticky: 20;
  --ad-z-dropdown: 30;
  --ad-z-overlay: 40;
  --ad-z-modal: 50;
  --ad-z-toast: 60;
  --ad-z-skip: 100;

  /* ---- motion: durations ---- */
  --ad-dur-press: 120ms;
  --ad-dur-hover: 150ms;
  --ad-dur-dropdown: 200ms;
  --ad-dur-dropdown-exit: 160ms;
  --ad-dur-enter: 240ms;
  --ad-dur-exit: 192ms;
  --ad-dur-move: 320ms;
  --ad-dur-move-exit: 256ms;
  --ad-dur-reveal: 480ms;
  --ad-dur-theme: 200ms;      /* colour-only transition on a user toggle */
  --ad-dur-pulse: 420ms;
  --ad-stagger: 30ms;

  /* ---- motion: easings (no overshoot) ---- */
  --ad-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ad-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ad-ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* ---- motion: distances and scales ---- */
  --ad-press-scale: 0.97;
  --ad-pop-scale: 0.95;
  --ad-rise: 8px;
  --ad-rise-lg: 16px;
  --ad-knob-stretch: 1.12;
  --ad-icon-blur: 4px;
  --ad-pulse-scale: 1.04;
  --ad-pulse-spread: 6px;

  /* ---- breakpoints ----
     Custom properties cannot be used inside @media, so these are the rule
     rather than tokens. Use max-width queries with exactly these widths:
       phone   @media (max-width: 640px)
       tablet  @media (max-width: 820px)   (the sidebar becomes a top bar)
       drawer  @media (max-width: 1023px)  (dashboard sidebar becomes a drawer) */
}

:root:lang(hy) { --ad-tracking-display: 0; --ad-lh-display: 1.18; --ad-lh-head: 1.32; }

@media (prefers-reduced-motion: reduce) {
  :root {
    --ad-dur-press: 0ms;
    --ad-dur-move: 0ms;
    --ad-dur-move-exit: 0ms;
    --ad-dur-reveal: 0ms;
    --ad-dur-theme: 0ms;
    --ad-dur-pulse: 0ms;
    --ad-stagger: 0ms;
    --ad-press-scale: 1;
    --ad-pop-scale: 1;
    --ad-rise: 0px;
    --ad-rise-lg: 0px;
    --ad-knob-stretch: 1;
    --ad-icon-blur: 0px;
    --ad-pulse-scale: 1;
    --ad-pulse-spread: 0px;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* ---- keyframes (unchanged names, so existing animations keep working) ---- */
@keyframes ad-fade-in { from { opacity: 0; } }
@keyframes ad-fade-out { to { opacity: 0; } }
@keyframes ad-pop-in { from { opacity: 0; scale: var(--ad-pop-scale); } }
@keyframes ad-pop-out { to { opacity: 0; scale: var(--ad-pop-scale); } }
@keyframes ad-rise-in { from { opacity: 0; translate: 0 var(--ad-rise); } }
@keyframes ad-settle-in { from { translate: 0 calc(var(--ad-rise) / 2); } }
@keyframes ad-pulse-ring {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ad-ok) 55%, transparent); }
  to { box-shadow: 0 0 0 var(--ad-pulse-spread) transparent; }
}
@keyframes ad-pulse-scale { 40% { scale: var(--ad-pulse-scale); } }
@keyframes ad-breathe { to { opacity: .55; } }
@keyframes ad-spin { to { rotate: 360deg; } }

/* Masked reveal: a left-to-right wipe instead of a fade. */
@keyframes ad-mask-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* Two identical stretches: a switch alternates between them so the
   animation restarts on every toggle (same name = no restart). */
@keyframes ad-knob-stretch-on { 50% { scale: var(--ad-knob-stretch) 1; } }
@keyframes ad-knob-stretch-off { 50% { scale: var(--ad-knob-stretch) 1; } }
/* A colour change revealed by a circle growing out of the control that
   caused it (the theme switch). The page sets --ad-reveal-x/-y/-r. */
@keyframes ad-reveal-circle {
  from { clip-path: circle(0 at var(--ad-reveal-x, 50%) var(--ad-reveal-y, 0%)); }
  to { clip-path: circle(var(--ad-reveal-r, 150%) at var(--ad-reveal-x, 50%) var(--ad-reveal-y, 0%)); }
}

/* ---- base primitives every surface shares ---- */
/* Colour-only transition while the user flips the theme (theme-init adds
   .ad-theme-anim to <html> for --ad-dur-theme, then removes it). */
html.ad-theme-anim, html.ad-theme-anim * {
  transition: background-color var(--ad-dur-theme) ease, color var(--ad-dur-theme) ease,
    border-color var(--ad-dur-theme) ease, fill var(--ad-dur-theme) ease, stroke var(--ad-dur-theme) ease !important;
}
::selection { background: var(--ad-selection); color: var(--ad-text); }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: var(--ad-focus-width) solid var(--ad-focus-ring);
  outline-offset: var(--ad-focus-offset);
}
:where(.ad-num, td.num, th.num, .kpi-value) { font-variant-numeric: tabular-nums; }

/* Stagger index: the first ten items of an .ad-stagger list, and table rows,
   get --ad-i = 0..9 (the rest share 10). Inert until a rule uses it. */
:where(.ad-stagger > *, tbody > tr):nth-child(2) { --ad-i: 1; }
:where(.ad-stagger > *, tbody > tr):nth-child(3) { --ad-i: 2; }
:where(.ad-stagger > *, tbody > tr):nth-child(4) { --ad-i: 3; }
:where(.ad-stagger > *, tbody > tr):nth-child(5) { --ad-i: 4; }
:where(.ad-stagger > *, tbody > tr):nth-child(6) { --ad-i: 5; }
:where(.ad-stagger > *, tbody > tr):nth-child(7) { --ad-i: 6; }
:where(.ad-stagger > *, tbody > tr):nth-child(8) { --ad-i: 7; }
:where(.ad-stagger > *, tbody > tr):nth-child(9) { --ad-i: 8; }
:where(.ad-stagger > *, tbody > tr):nth-child(10) { --ad-i: 9; }
:where(.ad-stagger > *, tbody > tr):nth-child(n+11) { --ad-i: 10; }

.ad-stagger > * {
  animation: ad-rise-in var(--ad-dur-enter) var(--ad-ease-out) both;
  animation-delay: calc(var(--ad-i, 0) * var(--ad-stagger));
}

/* Same-document view transitions (shared elements, the theme reveal) move
   on the same curve as everything else. */
::view-transition-group(*) {
  animation-duration: var(--ad-dur-move);
  animation-timing-function: var(--ad-ease-in-out);
}
/* The old page stays fully drawn underneath while the new one is unmasked
   over it, so the two states overlap and there is never a blank frame. The
   UA's default plus-lighter blend would add the two together; turn it off. */
:root[data-ad-transition="theme"]::view-transition-old(root),
:root[data-ad-transition="theme"]::view-transition-new(root) { mix-blend-mode: normal; }
:root[data-ad-transition="theme"]::view-transition-old(root) { animation: none; }
:root[data-ad-transition="theme"]::view-transition-new(root) {
  animation: ad-reveal-circle var(--ad-dur-reveal) var(--ad-ease-in-out);
}
/* ==== adamard design tokens: END ==== */

/* ==== Dashboard dark (brand book 2026-11-20): BEGIN ====
 * The dashboard's dark theme is the shared token block's dark (#232323 page,
 * #F4F4F4 text, lime accent), the same as adamard.am. The 2026-11-21 "bold
 * dark" override that used to sit here is gone. theme.js always writes
 * data-theme (light when nothing is saved), so the system appearance alone
 * never turns the dashboard dark.
 *
 * Increase Contrast (prefers-contrast: more): secondary text up to #D0D0D0
 * (10.2:1 on #232323, 8.2:1 on #333333) and dividers drawn at the
 * control-edge colour. */
@media (prefers-contrast: more) {
  :root[data-theme="dark"] {
    --ad-text-dim: #D0D0D0;
    --ad-text-dim-rgb: 208 208 208;
    --ad-line: #808080;
    --ad-line-rgb: 128 128 128;
  }
}
/* ==== Dashboard dark: END ==== */

/* This app's names for the shared tokens. Theme switching happens in the token block (light base,
   dark via data-theme only), so nothing here repeats per theme. */
:root {

  /* ---- ground + surfaces ---- */
  --bg: var(--ad-bg);
  --surface: var(--ad-surface);
  --surface-2: var(--ad-surface-2);
  --border: var(--ad-line);

  /* ---- text ---- */
  --text: var(--ad-text);
  --text-dim: var(--ad-text-dim);
  --text-faint: var(--ad-text-faint);

  /* ---- accent: see the role split in the header comment ---- */
  --accent: var(--ad-accent);
  --accent-text: var(--ad-accent-text);
  --accent-dim: var(--ad-accent-hover);
  --on-accent: var(--ad-on-accent);
  --accent-soft: var(--ad-accent-soft);
  --accent-line: var(--ad-accent-line); /* state lines, checks, bars: 3:1 on both themes */

  /* ---- semantic: fill/border/tint, and the text role ---- */
  --ok: var(--ad-ok);
  --ok-text: var(--ad-ok-text);
  --ok-soft: var(--ad-ok-soft);
  --warn: var(--ad-warn);
  --warn-text: var(--ad-warn-text);
  --warn-soft: var(--ad-warn-soft);
  --danger: var(--ad-danger);
  --danger-text: var(--ad-danger-text);
  --on-danger: var(--ad-on-danger);
  --danger-soft: var(--ad-danger-soft);

  /* ---- shape: 16px cards / 8px controls; depth from translucency and
     hairline borders rather than shadows ---- */
  --radius: var(--ad-radius-card);
  --radius-sm: var(--ad-radius-control);
  /* Fully rounded ends (badges, chips, bar tracks). Circles use 50%. */
  --radius-pill: var(--ad-radius-pill);
  /* Behind a dialog: the near-black --on-accent ink in both themes (it is
     tinted towards the green ground, unlike pure black). */
  --scrim: var(--ad-scrim);
  /* Icons are drawn at this opacity in both themes; they stay within the text's contrast. */
  --icon-opacity: .9;

  /* ---- type: self-hosted, see the @font-face block above ---- */
  --font-ui: var(--ad-font-ui);
  --font-display: var(--ad-font-ui); /* Noto Sans headings (no licensed heading face yet) */
  --mono: var(--ad-font-mono); /* IDs, phone numbers, durations */

  /* Type scale, spacing, elevation and stacking order are the shared
     --ad-fs-*, --ad-space-*, --ad-shadow-* and --ad-z-* tokens above, used
     directly (no per-app copies, so this file and ops cannot disagree).
     --ad-fs-xs is only for small labels and badges; body, table and card
     text is --ad-fs-sm or larger. */

  /* The demo badge exists to NOT read as a normal action, so it stays
     deliberately outside the green family (the shared "info" blue). */
  --demo: var(--ad-info);
  --demo-text: var(--ad-info-text);
}


* { box-sizing: border-box; }

/* The `hidden` attribute must actually hide things.
 *
 * The UA stylesheet's [hidden] { display: none } is an attribute selector with
 * specificity (0,1,0) — the same as a class selector. Author styles win ties
 * against the UA sheet, so `.app { display: flex }` and
 * `.login-wrap { display: grid }` below silently defeated it, and BOTH views
 * rendered at once: the login screen filled the viewport while the dashboard
 * sat 100vh below the fold. Login worked; it just looked like nothing happened.
 *
 * !important is the right tool here, not a shortcut: `hidden` is a browser-level
 * assertion that an element is not relevant, and no layout rule should be able
 * to override it. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  font-size: var(--ad-fs-sm);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Text role (A16): the fill green is 3.1:1 on white in light mode. */
a { color: var(--accent-text); text-decoration: none; }
/* Links inside running text need more than colour to stand out (WCAG 1.4.1):
   the accent is only 1.07:1 against the text around it. Buttons and nav keep
   their own look. */
:is(p, li, td, .notice, .small, .check-row) a:not(.btn) {
  text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px;
}

/* One focus ring for every control, the same as the site's and ops's. */
:focus-visible {
  outline: var(--ad-focus-width) solid var(--ad-focus-ring);
  outline-offset: var(--ad-focus-offset);
}
h1, h2, h3 { margin: 0 0 var(--ad-space-2); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--ad-fs-xl); }
h2 { font-size: var(--ad-fs-lg); }
h3 { font-size: var(--ad-fs-md); }
p { margin: 0 0 var(--ad-space-3); color: var(--text-dim); text-wrap: pretty; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  display: flex;
  flex-direction: column;
  /* Stays in view while the page scrolls, so Account settings and Sign out
     are always reachable without scrolling. The nav scrolls inside it instead. */
  position: sticky; top: 0;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}

/* The Adakam lockup (docs/brand-adakam-2026-11-19.md): the jade tile mark in
 * its fixed brand colours, the wordmark drawn in currentColor so it follows
 * the theme. One inline SVG with role="img" and aria-label="Adakam". */
.brand {
  padding: 0 1.25rem 1.25rem;
  display: flex; align-items: center; gap: var(--ad-space-2);
  font-weight: 700; font-size: var(--ad-fs-md);
}
.login-brand { justify-content: center; padding-bottom: 1.25rem; }
.brand-lockup { height: 28px; width: auto; flex: none; color: var(--text); }
/* The brand-book logo: the hand in the accent line colour (#232323 on light,
   lime on dark), the ADAKAM wordmark in the text colour. */
.brand-lockup .brand-hand { fill: var(--accent-line); }
.brand-lockup .brand-word { fill: currentColor; }

/* Nav: the active fill wipes in from the left (a masked colour change rather
 * than a flat swap) while the old one wipes out, 20% faster, at the same
 * time, so the two states overlap. go() only toggles .active, so the
 * transition runs on the same buttons. */
.nav {
  display: flex; flex-direction: column; gap: 2px; padding: 2px var(--ad-space-2);
  /* Takes the space the account group leaves; scrolls on short windows. The
     2px vertical padding keeps focus rings from being clipped at the edges. */
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
}
.nav button {
  display: flex; align-items: center; gap: var(--ad-space-3);
  width: 100%; min-height: 40px; text-align: left;
  padding: var(--ad-space-2) var(--ad-space-3);
  background: none; border: 0; border-radius: var(--radius-sm);
  background-image: linear-gradient(var(--accent-soft), var(--accent-soft));
  background-repeat: no-repeat; background-position: left center; background-size: 0% 100%;
  color: var(--text-dim); font: inherit; font-size: var(--ad-fs-sm); cursor: pointer;
  transition: background-size var(--ad-dur-exit) var(--ad-ease-in),
              background-color var(--ad-dur-hover) var(--ad-ease-out),
              color var(--ad-dur-hover) var(--ad-ease-out),
              transform var(--ad-dur-press) var(--ad-ease-out);
}
.nav button:hover { background-color: var(--ad-surface-3); color: var(--text); }
.nav button.active {
  background-size: 100% 100%; color: var(--text); font-weight: 600;
  transition-duration: var(--ad-dur-enter), var(--ad-dur-hover), var(--ad-dur-hover), var(--ad-dur-press);
  transition-timing-function: var(--ad-ease-out);
}
.nav button { position: relative; }
.nav button.active::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 0; width: 3px;
  border-radius: 0 var(--ad-radius-sm) var(--ad-radius-sm) 0; background: var(--accent-line);
}
.nav button:active { transform: scale(var(--ad-press-scale)); transition-duration: 0ms; }
/* Icons (nav glyphs and the inline SVGs from app.js icon()): one size, the
   text colour, and one opacity token shared by both themes. */
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px; color: inherit; opacity: var(--icon-opacity); }

.sidebar-foot { margin-top: auto; flex: none; padding: var(--ad-space-4) 1.25rem 0; border-top: 1px solid var(--border); }
.sidebar-foot .btn { width: 100%; }
.sidebar-foot .btn + .btn { margin-top: var(--ad-space-2); }
.who { font-size: var(--ad-fs-xs); color: var(--text-faint); margin-bottom: var(--ad-space-2); word-break: break-all; }

/* Headings that app.js focuses after a view or card change (tabindex="-1"):
   no ring for a mouse click, the normal ring for keyboard users. */
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--ad-space-5); gap: var(--ad-space-4);
}
.content { padding: var(--ad-space-5); max-width: 1080px; width: 100%; }

/* ---------- pieces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  margin-bottom: var(--ad-space-4);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--ad-space-4); margin-bottom: var(--ad-space-4); }

.grid { display: grid; gap: var(--ad-space-4); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--ad-space-4) 1.15rem; }
.stat .label { font-size: var(--ad-fs-xs); color: var(--text-faint); margin-bottom: var(--ad-space-1); }
.stat .value { font-size: var(--ad-fs-xl); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
/* A value that is text rather than a number (a caller's phone number). */
.stat .value.value-sm { font-size: var(--ad-fs-md); }
.stat .sub { font-size: var(--ad-fs-sm); color: var(--text-dim); margin-top: var(--ad-space-1); }

.badge {
  display: inline-flex; align-items: center; gap: var(--ad-space-1);
  padding: var(--ad-space-1) var(--ad-space-2); border-radius: var(--radius-pill);
  font-size: var(--ad-fs-xs); font-weight: 600; letter-spacing: .02em;
  border: 1px solid transparent; white-space: nowrap;
}
/* Tint and border from the fill colour, text from the *-text token (A16):
   the fills were 2.8:1 as text on their own tint in light mode. */
.badge-ok { background: var(--ad-ok-soft); color: var(--ok-text); border-color: color-mix(in srgb, var(--ok) 38%, transparent); }
.badge-warn { background: var(--ad-warn-soft); color: var(--warn-text); border-color: color-mix(in srgb, var(--warn) 38%, transparent); }
.badge-danger { background: var(--ad-danger-soft); color: var(--danger-text); border-color: color-mix(in srgb, var(--danger) 38%, transparent); }
.badge-demo { background: color-mix(in srgb, var(--demo) 18%, transparent); color: var(--demo-text); border-color: color-mix(in srgb, var(--demo) 45%, transparent); }
.badge-dim { background: var(--surface-2); color: var(--text-dim); border-color: var(--border); }
.badge-accent { background: var(--ad-accent-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-line) 38%, transparent); }
.badge-info { background: var(--ad-info-soft); color: var(--ad-info-text); border-color: color-mix(in srgb, var(--ad-info-text) 38%, transparent); }
.badge-neutral { background: var(--ad-neutral-soft); color: var(--ad-neutral-text); border-color: color-mix(in srgb, var(--ad-neutral-edge) 45%, transparent); }
/* A state badge (app.js stateBadge): an icon slot before the label, so each
   of the five states also differs in shape, not only in colour. */
.badge-state { font-size: var(--ad-fs-xs); letter-spacing: 0; }
.badge-state .ico { flex: none; width: 14px; height: 14px; }
.needs-main .badge-state { align-self: flex-start; margin-block: var(--ad-space-1); white-space: normal; }
/* A row of badges (a knowledge base's languages). */
.badge-list { display: flex; flex-wrap: wrap; gap: var(--ad-space-2); }

/* Demo-mode banner: deliberately loud. Nobody should be able to mistake a demo
   action for a real one, internally or in front of a guest. */
.demo-banner {
  display: flex; align-items: flex-start; gap: var(--ad-space-3);
  background: color-mix(in srgb, var(--demo) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--demo) 50%, transparent);
  border-left: 3px solid var(--demo);
  border-radius: var(--radius);
  padding: var(--ad-space-3) var(--ad-space-4); margin-bottom: var(--ad-space-4);
}
.demo-banner .t { font-weight: 700; color: var(--demo-text); font-size: var(--ad-fs-sm); margin-bottom: var(--ad-space-1); }
.demo-banner .d { font-size: var(--ad-fs-sm); color: var(--text-dim); }

.notice { border-radius: var(--radius); padding: var(--ad-space-3) var(--ad-space-4); font-size: var(--ad-fs-sm); margin-bottom: var(--ad-space-4); }
.notice-info { background: var(--accent-soft); border: 1px solid var(--ad-line-strong); color: var(--text-dim); }
.notice-warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent); color: var(--text-dim); }
.notice-ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border: 1px solid color-mix(in srgb, var(--ok) 38%, transparent); color: var(--text-dim); }
/* Something failed (sign-in, forgot, reset, dialog validation): a 3px danger
   start bar and the Lucide octagon-x (ISC, see app.js), the one angular
   status shape, so it never reads as a warning. The text stays --text. */
.notice-danger {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent); color: var(--text);
  position: relative;
  border-inline-start: 3px solid var(--danger);
  padding-inline-start: calc(var(--ad-space-3) + 16px + var(--ad-space-2));
}
.notice-danger::before {
  content: ""; position: absolute; width: 16px; height: 16px;
  inset-inline-start: var(--ad-space-3); top: var(--ad-space-3);
  top: calc(var(--ad-space-3) + (1lh - 16px) / 2);
  background: var(--danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
@media (forced-colors: active) {
  .notice-danger::before { forced-color-adjust: none; background: CanvasText; }
}
/* A success message confirms itself with one short pulse when it appears
   (or is un-hidden: display:none -> block restarts the animation). */
.notice-ok:not([hidden]) { animation: ad-pulse-ring var(--ad-dur-pulse) var(--ad-ease-out); }

.check-row {
  display: flex; align-items: flex-start; gap: var(--ad-space-2);
  font-size: var(--ad-fs-sm); color: var(--text-dim); cursor: pointer;
}
.check-row input[type="checkbox"], .check-row input[type="radio"] { width: auto; margin-top: var(--ad-space-1); accent-color: var(--accent-line); }
/* The browser default box is 13 px; 18 px plus the label row meets the 24 px
   target (WCAG 2.5.8), the same size as the ops console and the tour. */
.check-row input[type="checkbox"], .check-row input[type="radio"] { width: 24px; height: 24px; flex: none; }
.check-row label { display: inline; font-size: inherit; font-weight: 400; color: inherit; margin: 0; cursor: pointer; }
.check-row a { color: var(--accent-text); }

/* The plan-request dialog's allowance / overage / language lines. */
.plan-facts { list-style: none; padding: 0; margin: var(--ad-space-1) 0 var(--ad-space-4); color: var(--text-dim); }
.plan-facts li { padding: var(--ad-space-1) 0 var(--ad-space-1) 1.2rem; position: relative; }
.plan-facts li::before { content: "•"; position: absolute; left: .35rem; color: var(--text-faint); }

/* ---------- button (design/COMPONENTS.md) ----------
   .btn + one variant (.btn-primary / .btn-danger / .btn-ghost) + one size
   (.btn-sm), always in that order. Press: scale to 0.97 the instant the
   pointer goes down (nothing tweens while it is held), ease back on release.
   Same rules in the dashboard and ops. A link that goes somewhere (the 404
   page, Help) can wear the same look as a.btn: base, primary and small only. */
a.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ad-space-2);
  font: inherit; font-size: var(--ad-fs-sm); font-weight: 500;
  padding: var(--ad-space-2) var(--ad-space-4); border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer;
  transition: background-color var(--ad-dur-hover) var(--ad-ease-out),
              border-color var(--ad-dur-hover) var(--ad-ease-out),
              transform var(--ad-dur-press) var(--ad-ease-out);
}
a.btn:hover, button.btn:hover { border-color: var(--text-faint); }
a.btn { text-decoration: none; }
button.btn:active:not(:disabled) { transform: scale(var(--ad-press-scale)); transition-duration: 0ms; }
a.btn-primary, button.btn-primary { background: var(--accent); border-color: var(--ad-accent-edge); color: var(--on-accent); }
a.btn-primary:hover, button.btn-primary:hover { background: var(--accent-dim); border-color: var(--ad-accent-edge); box-shadow: 0 0 0 1px var(--ad-accent-edge); }
/* --on-danger is near-black on the dark theme's red and white on the light
   theme's deeper red: both over 5.8:1 (white on the dark red is 3.3:1). */
button.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
button.btn-danger:hover { border-color: var(--danger); filter: brightness(1.08); }
/* Quiet actions that sit in running text or a footer (Sign out, Skip). */
button.btn-ghost { background: transparent; border-color: transparent; }
button.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
a.btn-sm, button.btn-sm { padding: var(--ad-space-1) var(--ad-space-2); }
button.btn:disabled { opacity: .5; cursor: not-allowed; }
/* Loading: set aria-busy="true" (and disabled) while a request runs. The
   label stays readable; a small ring turns beside it. Reduced motion keeps
   the ring still. */
button.btn[aria-busy="true"], button.btn[aria-busy="true"]:disabled { opacity: .75; cursor: progress; }
button.btn[aria-busy="true"]::after {
  content: ""; flex: none; width: 1em; height: 1em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: ad-spin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  button.btn[aria-busy="true"]::after { animation: none; border-right-color: currentColor; opacity: .5; }
}

input, textarea, select {
  font: inherit; font-size: var(--ad-fs-sm); width: 100%;
  padding: var(--ad-space-2) var(--ad-space-3);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus, textarea:focus, select:focus { outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; min-height: 76px; font-family: inherit; }
/* A field the last error is about (markInvalid in app.js): a danger edge
   that is 2px, so it is not colour alone; the error text is read out through
   aria-describedby. Focus keeps the normal ring. */
:is(input, textarea, select)[aria-invalid="true"]:not(:focus) { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
label { display: block; font-size: var(--ad-fs-sm); font-weight: 500; color: var(--text-dim); margin-bottom: var(--ad-space-1); }
.field { margin-bottom: var(--ad-space-3); }

table { width: 100%; border-collapse: collapse; font-size: var(--ad-fs-sm); }
th { text-align: left; font-size: var(--ad-fs-xs); color: var(--text-faint); font-weight: 600; padding: var(--ad-space-2) var(--ad-space-2); border-bottom: 1px solid var(--border); }
td { padding: var(--ad-space-2); border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { transition: background-color var(--ad-dur-hover) var(--ad-ease-out); }
tbody tr.clickable:hover { background: var(--surface-2); cursor: pointer; }

/* List rows settle in 30ms apart when a view renders (the shared token
   block numbers them with --ad-i; rows past the tenth arrive together).
   The card around them is already drawn, so the view never flashes blank.
   Same for the setup checklist's steps. */
.content tbody > tr,
.setup-list > li {
  animation: ad-rise-in var(--ad-dur-enter) var(--ad-ease-out) both;
  animation-delay: calc(var(--ad-i, 0) * var(--ad-stagger));
}
.setup-list > li:nth-child(2) { --ad-i: 1; }
.setup-list > li:nth-child(3) { --ad-i: 2; }
.setup-list > li:nth-child(4) { --ad-i: 3; }
.setup-list > li:nth-child(5) { --ad-i: 4; }
.setup-list > li:nth-child(n+6) { --ad-i: 5; }
/* Nested scrollers keep the native rubber-band at their own edge instead of
   handing the gesture on to the page (overscroll-behavior: contain, never
   none, which would also kill the bounce). */
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
/* The scroller must also be the containing block. Otherwise an absolutely
   positioned child (the .sr-only "Details" header on Calls) is placed
   against the page, outside the clip, and the whole page scrolls sideways
   on phones (719 px wide at 375, overnight audit 2026-11-17). */
.table-wrap { position: relative; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.rec-yes { display: inline-flex; align-items: center; gap: 4px; }
.calls-table th.num, .calls-table td[data-col="duration"] { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calls-table td[data-col="caller"] { font-variant-numeric: tabular-nums; white-space: nowrap; }
.calls-table .call-sum { display: block; max-width: 44ch; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 400; font-size: var(--ad-fs-sm); color: var(--text-dim); font-variant-numeric: normal; }
.call-summary p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.call-back { display: inline-flex; align-items: center; gap: var(--ad-space-2); min-height: 44px; padding-inline: var(--ad-space-4); text-decoration: none; }
.call-back span { font-variant-numeric: tabular-nums; }
@media (min-width: 641px) { .calls-table th.num, .calls-table td[data-col="duration"] { padding-inline-end: var(--ad-space-5); } }
.calls-table td .row-link:not(.btn) { color: inherit; font-weight: 600; text-decoration: none; }
.calls-table td .row-link:not(.btn):hover { text-decoration: underline; }
.empty .btn { margin-top: var(--ad-space-3); }
.export-menu { position: relative; display: inline-block; }
.export-menu > .btn { display: inline-flex; align-items: center; gap: var(--ad-space-1); }
.export-menu .menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: var(--ad-z-dropdown);
  min-width: 176px; padding: 4px;
  background: var(--ad-surface-3); border: 1px solid var(--border); border-radius: var(--ad-radius-panel); box-shadow: var(--ad-shadow-2);
}
.export-menu .menu[hidden] { display: none; }
.export-menu .menu button {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: var(--ad-radius-control); background: none; color: var(--text);
  font: inherit; font-size: var(--ad-fs-sm); text-align: start; cursor: pointer;
}
.export-menu .menu button:hover, .export-menu .menu button:focus-visible { background: var(--surface-2); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.status-ok { color: var(--ok-text); }
/* "Saved and live." and friends: the class is set when the save succeeds,
   which starts this one-shot pulse. */
.status-ok, .pw-ok { display: inline-block; animation: ad-pulse-scale var(--ad-dur-pulse) var(--ad-ease-out); }
.status-error { color: var(--danger-text); }
.small { font-size: var(--ad-fs-sm); }
/* The browser default for <small> is "smaller" (11.7px here), off the scale. */
small { font-size: var(--ad-fs-xs); }
.right { text-align: right; }
.row { display: flex; align-items: center; gap: var(--ad-space-2); }
.stack { display: flex; flex-direction: column; gap: var(--ad-space-2); }

/* ---------- onboarding ---------- */
.steps { display: flex; gap: var(--ad-space-2); margin-bottom: 1.25rem; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 120px;
  padding: var(--ad-space-2) var(--ad-space-3); border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: var(--ad-fs-sm); color: var(--text-faint);
}
.step .n { font-weight: 700; margin-right: var(--ad-space-2); }
.step.active { border-color: var(--accent-line); color: var(--text); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.step.done { border-color: var(--ok); color: var(--ok-text); }

.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 1.75rem; text-align: center; color: var(--text-dim);
  cursor: pointer; background: var(--surface-2); font: inherit;
}
.dropzone { transition: border-color var(--ad-dur-hover) var(--ad-ease-out), color var(--ad-dur-hover) var(--ad-ease-out); }
.dropzone:hover, .dropzone.over { border-color: var(--accent-line); color: var(--text); }
/* While a file is being dragged over it the zone answers immediately: no
   tweening while the pointer is held. */
.dropzone.over { transition: none; }

/* ---------- pricing ---------- */
.tier {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; position: relative;
  display: flex; flex-direction: column;
}
.tier.recommended { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.tier .rec-flag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent); font-size: var(--ad-fs-xs); font-weight: 700;
  padding: var(--ad-space-1) var(--ad-space-2); border-radius: var(--radius-pill);
}
.tier .price { font-size: var(--ad-fs-xl); font-weight: 700; letter-spacing: -.03em; margin: var(--ad-space-2) 0 .1rem; font-variant-numeric: tabular-nums; }
.tier .per { font-size: var(--ad-fs-xs); color: var(--text-faint); }
.tier ul { list-style: none; padding: 0; margin: var(--ad-space-4) 0; font-size: var(--ad-fs-sm); color: var(--text-dim); flex: 1; }
.tier li { padding: var(--ad-space-1) 0; display: flex; gap: var(--ad-space-2); }
/* The marks are the Lucide check and minus (ISC, see app.js) used as masks,
   so they are drawn in currentColor at the same weight in every font. */
.tier li::before {
  content: ""; flex: none; width: 1rem; height: 1rem; margin-top: var(--ad-space-1);
  color: var(--ok); background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tier li.off { color: var(--text-faint); }
.tier li.off::before {
  color: var(--text-faint);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--ad-space-5); }
.login-card { width: 100%; max-width: 380px; }
/* The auth cards name themselves in an h1 that keeps the old h2 size. */
.login-card h1 { font-size: var(--ad-fs-lg); }
/* Two links under a sign-in card, spaced apart rather than joined by a dot. */
.link-pair { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: var(--ad-space-5); margin-top: var(--ad-space-4); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; padding: var(--ad-space-5); z-index: var(--ad-z-modal); }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--ad-shadow-3); max-width: 680px; width: 100%; max-height: 85vh; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem; }
/* Entrance only when a modal OPENS (modal() adds .is-entering when nothing
   was open); a modal that re-renders in place -- loading -> loaded -- must
   not pop again. Backdrop fades, the card grows from 95% on ease-out, and
   its contents settle 30ms apart as it lands. Closing is instant: modal
   markup is removed outright, so there is nothing left to animate. */
.modal-backdrop.is-entering { animation: ad-fade-in var(--ad-dur-enter) var(--ad-ease-out); }
.modal-backdrop.is-entering .modal { animation: ad-pop-in var(--ad-dur-enter) var(--ad-ease-out); }
.modal-backdrop.is-entering .modal > * {
  animation: ad-rise-in var(--ad-dur-enter) var(--ad-ease-out) both;
  animation-delay: calc(var(--ad-dur-enter) / 2 + var(--ad-i, 0) * var(--ad-stagger));
}
.modal > :nth-child(2) { --ad-i: 1; }
.modal > :nth-child(3) { --ad-i: 2; }
.modal > :nth-child(n+4) { --ad-i: 3; }

.transcript { font-size: var(--ad-fs-sm); }
.turn { padding: var(--ad-space-2) var(--ad-space-3); border-radius: var(--radius-sm); margin-bottom: var(--ad-space-2); }
.turn.caller { background: var(--surface-2); }
/* AI turns: lime tint plus a 3px start-edge rule, since the tint alone is faint on light. */
.turn.ai { background: var(--accent-soft); position: relative; }
.turn.ai::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--accent-line); }
.turn .role { font-size: var(--ad-fs-xs); color: var(--text-faint); margin-bottom: var(--ad-space-1); }

.chat { max-height: 320px; overflow-y: auto; overscroll-behavior: contain; padding-right: var(--ad-space-1); }
.msg { margin-bottom: var(--ad-space-2); display: flex; }
.msg .bubble { padding: var(--ad-space-2) var(--ad-space-3); border-radius: var(--radius); max-width: 78%; font-size: var(--ad-fs-sm); }
.msg.ai .bubble { background: var(--surface-2); border-bottom-left-radius: 3px; }
.msg.me { justify-content: flex-end; }
.msg.me .bubble { background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 3px; }

.empty { text-align: center; padding: 2.5rem var(--ad-space-4); color: var(--text-faint); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent-line); border-radius: 50%; animation: ad-spin .7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

@media (max-width: 820px) {
  /* Touch screens: every button is at least 44 px tall (small buttons were
     31 px at 375, overnight audit 2026-11-17). Desktop sizes are unchanged. */
  button.btn, .content select { min-height: 44px; }
  .content { padding: var(--ad-space-4); padding-bottom: calc(var(--ad-space-4) + env(safe-area-inset-bottom)); }
  /* Four stats two by two on a phone instead of four full-width rows. */
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat .value { font-size: var(--ad-fs-lg); }
  /* A71: the fixed 56px, no-wrap bar overflowed sideways at 390px during a
     live call (h1 + "Call in progress right now" + total + two Export
     buttons is ~450px against 342px). It now grows instead: the title and
     the live indicator share the first row, the actions take their own row
     below, and a long badge may wrap inside the bar. */
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; row-gap: var(--ad-space-2); padding: var(--ad-space-2) var(--ad-space-4); }
  #topbar-right { flex: 1 0 100%; flex-wrap: wrap; }
  #topbar-right:empty { display: none; }
  .topbar .badge { white-space: normal; }
}


/* ---- display type -------------------------------------------------------
 * Noto Sans 700 for headings (Adakam brand book 2026-11-20). The
 * serif --ad-font-display is for the marketing site only. Letter-spacing
 * -0.02em on Latin/Cyrillic heads, 0 for Armenian (see :lang(hy) below). */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: var(--ad-fs-xl); }
h2 { font-size: var(--ad-fs-lg); }
h3 { font-size: var(--ad-fs-md); }

/* Micro-labels: Noto Sans 600 in sentence case, untracked. Tracked capitals
 * read as a template; the weight and the fainter colour already set them
 * apart from the value under them. */
.label, th, .eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0;
}

/* Digits that sit in columns, or change while you watch, should line up. */
td, .num, .bar-row > strong { font-variant-numeric: tabular-nums; }


/* Skip link: visually hidden until focused, then anchored top-left. Uses the
 * accent fill, so it takes --on-accent for its text like every other fill.
 * `tabindex="-1"` on <main> is what makes the jump actually move focus rather
 * than only scrolling -- without it the link moves the viewport and leaves the
 * screen reader where it was, which is worse than not having one. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--ad-z-skip);
  padding: var(--ad-space-2) var(--ad-space-4);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ---- business billing --------------------------------------------------
 * The details form is a <details> so an org that has already filled it in is
 * not made to scroll past a form they are done with -- but it opens itself
 * when something is still missing, because a collapsed form is exactly how a
 * required field goes unnoticed. */
.billing-details { margin-top: var(--ad-space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.billing-details > summary {
  padding: var(--ad-space-2) var(--ad-space-3); cursor: pointer; font-weight: 600; font-size: var(--ad-fs-sm);
}
.billing-details > summary:hover { background: var(--surface-2); }
.billing-details form {
  padding: 0 var(--ad-space-3) var(--ad-space-3); display: grid; gap: var(--ad-space-2);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.billing-details label { display: flex; flex-direction: column; gap: var(--ad-space-1); font-size: var(--ad-fs-sm); color: var(--text-dim); }
.billing-details input, .billing-details select {
  padding: var(--ad-space-2) var(--ad-space-2); background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.billing-details input:focus, .billing-details select:focus {
  outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: -1px; border-color: transparent;
}
.billing-details button[type=submit] { grid-column: 1 / -1; justify-self: start; }

/* ---- connect your own number ------------------------------------------ */
.connect-form { display: grid; gap: var(--ad-space-3); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.connect-form label { display: flex; flex-direction: column; gap: var(--ad-space-1); font-size: var(--ad-fs-sm); color: var(--text-dim); }
.connect-form input {
  padding: var(--ad-space-2) var(--ad-space-2); background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.connect-form input:focus { outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: -1px; border-color: transparent; }
.connect-form button[type=submit] { grid-column: 1 / -1; justify-self: start; }
.connect-instructions {
  width: 100%; padding: var(--ad-space-3); font-family: var(--mono); font-size: var(--ad-fs-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical;
}

/* Analytics bars stay dependency-free so they render identically with live
   data and on a slow connection. */
.bar-row { display: grid; grid-template-columns: minmax(90px, 1fr) 3fr 2rem; gap: var(--ad-space-2); align-items: center; margin: var(--ad-space-2) 0; font-size: var(--ad-fs-sm); }
.bar-label { overflow-wrap: anywhere; line-height: 1.3; color: var(--text-dim); }
/* On a phone the label takes its own line above the bar, so long Armenian
   and Russian labels are read in full instead of cut off. */
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 1fr 2rem; row-gap: var(--ad-space-1); }
  .bar-label { grid-column: 1 / -1; }
}
/* Under the Calls table: how many are shown, and Show more. */
.calls-more { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--ad-space-2); margin-top: var(--ad-space-3); font-variant-numeric: tabular-nums; }
/* Calls filters (design PR 7): search and two selects on one row that wraps
   on a phone. The controls keep the page's own input and select styles. */
.calls-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--ad-space-3); margin-bottom: var(--ad-space-3); }
.calls-filters .field { flex: 1 1 200px; min-width: 0; margin: 0; }
.calls-filters input, .calls-filters select { min-height: 44px; }
.calls-none { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ad-space-2); padding: var(--ad-space-3) 0; }
.calls-none p { margin: 0; }
.bar-row > strong { text-align: right; font-weight: 600; }
.bar-track { height: .5rem; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
/* Bars are revealed by a left-to-right mask rather than faded in. */
.bar-fill { display: block; height: 100%; min-width: 2px; background: var(--accent-line); border-radius: inherit; animation: ad-mask-in var(--ad-dur-reveal) var(--ad-ease-out) both; }
.select-sm { padding: var(--ad-space-1) var(--ad-space-2); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.analytics-hero { display:flex; justify-content:space-between; gap:var(--ad-space-4); align-items:flex-start; padding:1.25rem var(--ad-space-5); margin-bottom:var(--ad-space-4); border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); }
.analytics-hero h2 { margin:var(--ad-space-1) 0 var(--ad-space-2); font-family:var(--font-display); font-size:var(--ad-fs-lg); }
.analytics-hero p { max-width:680px; margin:0; color:var(--text-dim); line-height:1.55; }
/* A small line above a heading that says which part of the page this is:
   sentence case, untracked, in the dim text colour (not the accent). */
.eyebrow { color:var(--text-dim); font-size:var(--ad-fs-xs); font-weight:600; }
.period-note { white-space:nowrap; color:var(--text-dim); font-size:var(--ad-fs-sm); font-variant-numeric:tabular-nums; }
.next-actions { margin-bottom:var(--ad-space-4); }
.next-actions h2 { margin:var(--ad-space-1) 0 0; }
.action-list { display:grid; gap:var(--ad-space-2); }
.action-item { display:flex; gap:var(--ad-space-3); padding:var(--ad-space-3) var(--ad-space-3); border-radius:var(--radius-sm); background:var(--surface-2); border-left:3px solid var(--accent-line); }
.action-item strong { display:block; margin-bottom:var(--ad-space-1); }
.action-item p { margin:0; color:var(--text-dim); line-height:1.45; font-size:var(--ad-fs-sm); }
.action-icon { width:1.45rem; height:1.45rem; flex:0 0 1.45rem; display:grid; place-items:center; border-radius:50%; background:var(--accent-soft); color:var(--accent-text); font-weight:700; }
.action-warn { border-left-color:var(--warn); }.action-warn .action-icon { color:var(--warn-text); background:var(--warn-soft); }
.action-danger { border-left-color:var(--danger); }.action-danger .action-icon { color:var(--danger-text); background:var(--danger-soft); }
.action-good { border-left-color:var(--ok); }.action-good .action-icon { color:var(--ok-text); background:var(--ok-soft); }
.section-caption { display:flex; justify-content:space-between; align-items:center; margin:1.15rem 0 var(--ad-space-2); font-size:var(--ad-fs-sm); font-weight:600; color:var(--text-dim); }
@media (max-width: 640px) { .analytics-hero { flex-direction:column; } .period-note { align-self:flex-start; } .section-caption { align-items:flex-start; gap:var(--ad-space-2); flex-direction:column; } }

/* 2026-10-28 design review: text links on the sign-in cards were 15-18px
   tall; padding makes them comfortable tap targets without moving the text. */
#show-signup-link, #show-login-link, #show-forgot-link { display: inline-block; padding: var(--ad-space-2) 0; }
.pw-ok { color: var(--ok-text); }
/* New-password strength meter (app.js passwordMeterMarkup): show/hide, a
   4-segment bar (decorative; the "Strength:" words carry the meaning), rules. */
.pw-meter { margin-top: var(--ad-space-2); }
/* Show/hide sits inside the field's end: a 44 px target, the eye swaps to
   eye-off while the password is visible (aria-pressed carries the state). */
.pw-field { position: relative; }
.pw-field input { min-height: 44px; padding-inline-end: 48px; }
.pw-toggle {
  position: absolute; inset-block-start: 0; inset-inline-end: 0; width: 44px; height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center; background: none; border: 0;
  border-radius: var(--radius-sm); color: var(--text-dim); cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle:focus-visible { outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: -2px; }
.pw-toggle[aria-pressed="true"] { color: var(--text); }
.pw-toggle .ico-eye-off, .pw-toggle[aria-pressed="true"] .ico-eye { display: none; }
.pw-toggle[aria-pressed="true"] .ico-eye-off { display: inline-flex; }
/* Phone: 16px fields stop iOS zooming in on focus; sign-in targets are 44px. */
@media (max-width: 640px) {
  .login-card input, .login-card select { font-size: var(--ad-fs-md); min-height: 44px; }
  .login-card .btn-primary { min-height: 44px; font-weight: 600; }
}
.pw-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--ad-space-1); }
.pw-seg { height: 6px; border-radius: var(--ad-radius-pill); background: var(--border); transition: background-color var(--ad-dur-hover) var(--ad-ease-out); }
.pw-seg.on.s1 { background: var(--danger); }
.pw-seg.on.s2 { background: var(--warn); }
.pw-seg.on.s3, .pw-seg.on.s4 { background: var(--ok); }
.pw-strength { margin: var(--ad-space-1) 0 var(--ad-space-1); min-height: 1.2em; font-weight: 600; }
.pw-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ad-space-1); }
.pw-rules li { display: flex; align-items: center; gap: var(--ad-space-2); }
.pw-rule-ok { color: var(--ok-text); }
.pw-rule-todo { color: var(--text-dim); }
.pw-rule-tip { color: var(--text-faint); }
@media (prefers-reduced-motion: reduce) { .pw-seg { transition: none; } }
/* Setup checklist on Overview / Preview. */
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-list li { display: flex; align-items: center; gap: var(--ad-space-3); justify-content: space-between; padding: var(--ad-space-3) 0; border-top: 1px solid var(--border); }
.setup-list li:first-child { border-top: 0; padding-top: 0; }
.setup-list li:last-child { padding-bottom: 0; }
.setup-list .mark { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: inline-grid; place-items: center; font-size: var(--ad-fs-xs); flex: none; border: 2px solid var(--text-faint); color: transparent; }
.setup-list li.done .mark { background: var(--accent); border-color: var(--accent-line); color: var(--on-accent); }
.setup-list .mark { transition: background-color var(--ad-dur-hover) var(--ad-ease-out), border-color var(--ad-dur-hover) var(--ad-ease-out); }
/* The onboarding wizard's .step pill (border, fill) must not draw a second
   box inside each checklist row. */
.setup-list .step { flex: 1; min-width: 0; padding: 0; background: none; border: 0; border-radius: 0; color: var(--text); font-size: var(--ad-fs-sm); }
.setup-list .step small { display: block; color: var(--text-dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Onboarding engine fields (app.engineFieldsSection). A fieldset is as wide
   as its widest row by default (min-inline-size: min-content), so the hours
   and services tables pushed the page sideways at phone width. Below 640px
   each table row becomes a small grid with visible labels. */
#eng-fields, #eng-fields fieldset { min-inline-size: 0; }
#eng-fields .grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
#eng-fields .grid > *, #eng-fields .row > * { min-width: 0; }
#eng-fields select { max-width: 100%; }
/* Hours by day: preset buttons, and a suggestion that is visibly not yet
   the owner's (dashed edge, muted times) until it is confirmed. */
.eng-presets { flex-wrap: wrap; gap: var(--ad-space-2); margin-bottom: var(--ad-space-2); }
.eng-presets .btn { min-height: 44px; }
.eng-hours { border: 1px solid transparent; border-radius: var(--radius-sm); padding: var(--ad-space-2); margin: 0 -.5rem var(--ad-space-3); }
.eng-hours.is-suggested { border: 1px dashed var(--warn); background: color-mix(in srgb, var(--warn) 6%, transparent); }
.eng-hours.is-suggested select { color: var(--text-dim); font-style: italic; }
.eng-suggested-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ad-space-2) var(--ad-space-2); margin: 0 0 var(--ad-space-2); font-size: var(--ad-fs-sm); color: var(--text-dim); }
.eng-hours .eng-table select { min-width: 0; font-variant-numeric: tabular-nums; }
#eng-h-copy { margin-top: var(--ad-space-2); min-height: 44px; }
@media (max-width: 640px) {
  .eng-table, .eng-table tbody, .eng-table tr, .eng-table td { display: block; }
  .eng-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .eng-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ad-space-2) var(--ad-space-2);
                  padding: var(--ad-space-2) 0; border-bottom: 1px solid var(--border); }
  .eng-table tr:last-child { border-bottom: 0; }
  .eng-table td { padding: 0; border: 0; min-width: 0; }
  .eng-table td:first-child { grid-column: 1 / -1; }
  .eng-table td[data-label]::before { content: attr(data-label); display: block; font-size: var(--ad-fs-xs);
                                      color: var(--text-faint); margin-bottom: var(--ad-space-1); }
  .eng-table input { min-width: 0; }
}

/* "Continue with Google" (app/api/v1/auth_google.py). Google's sign-in
   branding guidelines: 40px high, 12px side padding, 10px between the 20px
   G mark and the label, Roboto Medium 14/20, a 1px outline; dark theme
   #131314 fill, #8E918F outline, #E3E3E3 text; light theme white fill,
   #747775 outline, #1F1F1F text. The G mark keeps Google's colours in both
   themes. Roboto is not shipped (no new files), so the stack falls back.
   Size (14px = --ad-fs-sm) and the hover lift come from the design tokens. */
.google-signin { margin: 0 0 1rem; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 40px; padding: 0 12px;
  border: 1px solid #8e918f; border-radius: 4px;
  background: #131314; color: #e3e3e3;
  font-family: Roboto, Arial, system-ui, sans-serif; font-weight: 500; font-size: var(--ad-fs-sm);
  line-height: 20px; letter-spacing: .25px; cursor: pointer;
}
.btn-google:hover { background: #1f1f20; box-shadow: var(--ad-shadow-1); }
.btn-google:active { background: #2a2a2b; }
.btn-google:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 2px; }
.btn-google-icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
.btn-google-icon svg { width: 20px; height: 20px; display: block; }
:root[data-theme="light"] .btn-google { background: #fff; border-color: #747775; color: #1f1f1f; }
:root[data-theme="light"] .btn-google:hover { background: #f8f9fa; box-shadow: var(--ad-shadow-1); }
:root[data-theme="light"] .btn-google:active { background: #eceef0; }
.or-divider { display: flex; align-items: center; gap: .75rem; margin: 1rem 0 0; color: var(--text-dim); font-size: var(--ad-fs-sm); }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
#google-conn-section { margin-top: 1.25rem; }

/* ---------- first-run guide (app.js `tour`) ----------
 * A non-modal popover beside the section it describes; on phones it docks
 * at the bottom, clear of the sticky top bar where the targets live. Under
 * modals (--ad-z-overlay), above the phone bar and account panel.
 * Motion comes from the tokens, which reduced motion already turns into a
 * plain fade (--ad-pop-scale: 1). Colours are tokens only, so both themes work. */
.tour-pop {
  position: fixed; z-index: var(--ad-z-overlay); left: 248px; top: 5rem;
  width: min(340px, calc(100vw - 16px));
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--ad-shadow-2);
  padding: var(--ad-space-4) var(--ad-space-4);
}
.tour-pop.is-entering { animation: ad-pop-in var(--ad-dur-dropdown) var(--ad-ease-out); }
.tour-count { margin: 0 0 var(--ad-space-2); font-size: var(--ad-fs-xs); font-weight: 600; letter-spacing: .03em;
              color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tour-progress { display: flex; gap: var(--ad-space-1); list-style: none; margin: 0 0 var(--ad-space-3); padding: 0; }
.tour-progress li { flex: 1; height: 4px; border-radius: var(--ad-radius-pill); background: var(--border); }
.tour-progress li.is-done { background: var(--accent-line); }
.tour-progress li.is-current { background: color-mix(in srgb, var(--accent-line) 55%, var(--border)); }
.tour-done-line { display: flex; align-items: center; gap: var(--ad-space-1); margin: 0 0 var(--ad-space-2);
                  font-size: var(--ad-fs-sm); color: var(--ok-text); }
.tour-title { margin: 0 0 var(--ad-space-1); }
.tour-body { margin: 0 0 var(--ad-space-2); text-wrap: pretty; }
.tour-check { align-items: center; min-height: 44px; }
.tour-check input[type="checkbox"] { margin-top: 0; width: 24px; height: 24px; }
.tour-check label { padding: var(--ad-space-2) 0; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--ad-space-2); flex-wrap: wrap; }
.tour-steps { display: flex; gap: var(--ad-space-2); margin-left: auto; }
.tour-actions button.btn { min-height: 44px; min-width: 44px; padding-inline: var(--ad-space-4); }
/* The section the current step talks about. Dashed, so it never reads as
   keyboard focus. */
.tour-target { outline: 2px dashed var(--accent-text); outline-offset: 2px; }

@media (max-width: 820px) {
  .tour-pop {
    left: 0; right: 0; top: auto; bottom: 0; width: auto;
    border-radius: var(--radius) var(--radius) 0 0; border-bottom: 0;
    padding: var(--ad-space-4) calc(var(--ad-space-4) + env(safe-area-inset-right)) calc(var(--ad-space-4) + env(safe-area-inset-bottom)) calc(var(--ad-space-4) + env(safe-area-inset-left));
    max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain;
  }
  .tour-pop.is-entering { animation: ad-rise-in var(--ad-dur-enter) var(--ad-ease-out); }
  .tour-target { outline-offset: -2px; }
}

/* ---------- view loading (app.js VIEW_LOADING / VIEW_SKELETON) ----------
 * Nothing is drawn for the first 300ms; after that, quiet blocks in the
 * page's own shape (stat row, two cards) that breathe slowly. Reduced
 * motion keeps them still. */
.view-loading { min-height: 50vh; }
/* ---------- skeleton (design/COMPONENTS.md) ----------
   A .skeleton container (aria-hidden) holding .skeleton-block (a card-sized
   placeholder) and/or .skeleton-line (one line of text). They breathe
   slowly; reduced motion keeps them still. */
.skeleton { display: grid; gap: var(--ad-space-4); animation: ad-fade-in var(--ad-dur-enter) var(--ad-ease-out); }
.skeleton:has(> .skeleton-line) { gap: var(--ad-space-2); }
.skeleton-block, .skeleton-line { animation: ad-breathe 1.6s var(--ad-ease-in-out) infinite alternate; }
.skeleton-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-height: 6rem; }
.skeleton-line { display: block; height: .875rem; border-radius: var(--radius-pill); background: var(--border); }
@media (prefers-reduced-motion: reduce) { .skeleton-block, .skeleton-line { animation: none; } }
/* The dashboard's view skeleton: a stat row and two cards. */
.skeleton-block.is-stat { min-height: 6rem; }
.skeleton-block.is-card { min-height: 13rem; }
.skeleton-block.is-short { min-height: 8rem; }

/* ---------- undo toast (app.js showUndoToast) ----------
 * Bottom centre, clear of the phone's home bar; above dialogs (50) so an
 * Undo is never hidden behind one. */
.toast-root {
  position: fixed; z-index: var(--ad-z-toast); left: 50%; translate: -50% 0;
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100vw - 2rem);
}
.toast {
  display: flex; align-items: center; gap: var(--ad-space-4);
  padding: var(--ad-space-2) var(--ad-space-2) var(--ad-space-2) var(--ad-space-4);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--ad-shadow-2);
  font-size: var(--ad-fs-sm);
  animation: ad-rise-in var(--ad-dur-enter) var(--ad-ease-out);
}
/* A plain confirmation (app.js showToast) has no button, so even padding. */
.toast-plain { padding: var(--ad-space-3) var(--ad-space-4); }
.toast .toast-undo { min-height: 44px; min-width: 44px; font-weight: 600; color: var(--accent-text); }
/* Toast types (app.js showToast(message, type)): a 3px start bar and an icon
   in the state's text colour; the message itself stays in --text. */
.toast-success, .toast-info, .toast-waiting, .toast-danger { border-inline-start-width: 3px; }
.toast > .ico { flex: none; margin-inline-end: calc(-1 * var(--ad-space-2)); }
.toast-success { border-inline-start-color: var(--ad-ok-text); }
.toast-success > .ico { color: var(--ad-ok-text); }
.toast-info { border-inline-start-color: var(--ad-info-text); }
.toast-info > .ico { color: var(--ad-info-text); }
.toast-waiting { border-inline-start-color: var(--ad-warn-text); }
.toast-waiting > .ico { color: var(--ad-warn-text); }
.toast-danger { border-inline-start-color: var(--danger-text); }
.toast-danger > .ico { color: var(--danger-text); }
/* Seconds left to undo; fixed width so the button does not shift each tick. */
.toast-left { min-width: 3.5ch; text-align: end; color: var(--text-dim); font-size: var(--ad-fs-xs); }

/* ---------- Help & Support answers ---------- */
.faq { display: grid; gap: var(--ad-space-2); margin-bottom: var(--ad-space-4); }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); }
.faq summary {
  padding: var(--ad-space-3) var(--ad-space-4); min-height: 44px; cursor: pointer;
  font-size: var(--ad-fs-sm); font-weight: 600; color: var(--text);
}
.faq summary:hover { background: var(--surface-2); }
.faq details p { margin: 0; padding: 0 var(--ad-space-4) var(--ad-space-3); font-size: var(--ad-fs-sm); }
/* Help: Service status and Chat with support (design review 2026-11-27,
   P07). One row each: title and line on the start side, the button at the
   end; on a phone the button wraps under the text. */
.help-links { list-style: none; margin: 0 0 var(--ad-space-4); padding: 0; display: grid; gap: var(--ad-space-2); }
.help-links li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--ad-space-2) var(--ad-space-4);
  padding: var(--ad-space-3) var(--ad-space-4); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.help-links li > div { display: grid; gap: 2px; min-width: 0; flex: 1 1 16rem; }
/* The 404 page (404.html): the login card, with its two ways out side by side. */
.not-found h1 { margin-bottom: var(--ad-space-2); }
.not-found-actions { display: flex; flex-wrap: wrap; gap: var(--ad-space-2); margin: var(--ad-space-4) 0; }
/* Settings hub (design PR 9): one full-width row per entry, 44 px tall, a
   title and a one-line description. The text wraps; nothing is cut off. */
.settings-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ad-space-2); max-width: 640px; }
.settings-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; min-height: 44px; padding: var(--ad-space-3) var(--ad-space-4);
  text-align: left; font: inherit; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.settings-row:hover { background: var(--surface-2); }
.settings-row-title { font-weight: 600; }
.settings-row-desc { font-size: var(--ad-fs-sm); color: var(--text-dim); }

/* ---------- Account settings: Danger zone ---------- */
.danger-zone { margin-top: var(--ad-space-5); padding-top: var(--ad-space-4); border-top: 1px solid var(--border); }
.danger-zone h3 { color: var(--danger-text); }

/* ---------- utilities ----------
 * Small single-purpose classes for app.js markup, instead of inline
 * style="..." (which bypassed the tokens). Spacing steps are the shared
 * --ad-space-N scale (1 = 4px ... 6 = 32px). They come last in the file so
 * they win over a component's own margin (.card, .notice) at equal
 * specificity. Values that come from data (a bar's width) stay inline. */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--ad-space-1); }
.mt-2 { margin-top: var(--ad-space-2); }
.mt-3 { margin-top: var(--ad-space-3); }
.mt-4 { margin-top: var(--ad-space-4); }
.mt-5 { margin-top: var(--ad-space-5); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--ad-space-2); }
.mb-3 { margin-bottom: var(--ad-space-3); }
.mb-4 { margin-bottom: var(--ad-space-4); }
.ml-2 { margin-left: var(--ad-space-2); }
.mx-4 { margin-left: var(--ad-space-4); margin-right: var(--ad-space-4); }
.my-4 { margin-top: var(--ad-space-4); margin-bottom: var(--ad-space-4); }
.py-1 { padding-top: var(--ad-space-1); padding-bottom: var(--ad-space-1); }
.gap-2 { gap: var(--ad-space-2); }
.wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.text-center { text-align: center; }
.text-md { font-size: var(--ad-fs-md); }
.text-ok { color: var(--ok-text); }
.text-danger { color: var(--danger-text); }
.cursor-pointer { cursor: pointer; }
/* A label for a group that is not a form control (it has no <label>). */
.field-label { font-size: var(--ad-fs-sm); font-weight: 500; color: var(--text-dim); margin-bottom: var(--ad-space-1); }
.fieldset-bare { border: 0; padding: 0; margin: 0; }
.list-indent { margin: var(--ad-space-2) 0 var(--ad-space-2) var(--ad-space-4); padding: 0; }

/* "Connect my number" wizard (app.js cwCardHtml): one column of fields at a
   readable width; existing tokens only, no new colours. */
.cw-panel { margin-top: var(--ad-space-4); padding-top: var(--ad-space-4); border-top: 1px solid var(--border); }
.cw-form { max-width: 36rem; }
.cw-prose { max-width: 68ch; }
.cw-help { display: block; margin-top: var(--ad-space-1); }
.cw-form .check-row + .check-row { margin-top: var(--ad-space-2); }
.cw-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ad-space-3); }
.cw-codes { margin-block: var(--ad-space-3); }
#cw-card td .row { flex-wrap: wrap; }
/* Phones: each connection is a small block (number and way on top, the status,
   then the two buttons full width), like the Team table. */
@media (max-width: 640px) {
  .cw-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cw-table, .cw-table tbody { display: block; width: 100%; }
  .cw-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--ad-space-1);
    padding: var(--ad-space-3) 0; border-bottom: 1px solid var(--border);
  }
  .cw-table td { display: block; padding: 0; border: 0; min-width: 0; text-align: start; }
  .cw-table td[data-col="did"] { font-weight: 600; }
  .cw-table td[data-col="way"] { color: var(--text-dim); }
  .cw-table td[data-col="actions"] { margin-top: var(--ad-space-2); }
  .cw-actions { justify-content: stretch; }
  .cw-actions .btn { flex: 1 1 0; }
}
@media (max-width: 820px) { #cw-card .btn, #cw-card input:not([type=radio]), #cw-card select { min-height: 44px; } #cw-card .btn { padding-inline: var(--ad-space-4); } #cw-card .check-row { min-height: 44px; align-items: center; } }

/* Telegram card under the knowledge base (app.js telegramCardHtml): a token
   is ~46 characters, so the form and the prose keep a readable width. */
.tg-form { max-width: 36rem; }
#tg-card p, #tg-card ol, #tg-card .check-row, #tg-card .faint { max-width: 68ch; }
#tg-card ol { padding-left: var(--ad-space-5, 1.25rem); margin: var(--ad-space-3, 0.75rem) 0; }
#tg-card ol li + li { margin-top: var(--ad-space-1, 0.25rem); }
/* WhatsApp card (app.js whatsappCardHtml): same widths as Telegram; the
   webhook address and verify token sit in read-only fields with a Copy button. */
.wa-form { max-width: 36rem; }
#wa-card p, #wa-card ol, #wa-card .check-row, #wa-card .faint, #wa-card .field { max-width: 68ch; }
#wa-card ol { padding-left: var(--ad-space-5, 1.25rem); margin: var(--ad-space-3, 0.75rem) 0; }
#wa-card ol li + li { margin-top: var(--ad-space-1, 0.25rem); }
.wa-copy, .copy-row { display: flex; gap: var(--ad-space-2, 0.5rem); }
.wa-copy input, .copy-row input { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--ad-fs-sm); }
@media (max-width: 820px) { #wa-card .btn, #wa-card input:not([type=checkbox]) { min-height: 44px; } #wa-card .btn { padding-inline: var(--ad-space-4); } #wa-card .check-row { min-height: 44px; align-items: center; } }
@media (max-width: 820px) { #tg-card .btn { min-height: 44px; padding-inline: var(--ad-space-4); } #tg-card .check-row { min-height: 44px; align-items: center; } }
/* White on the dark theme's danger red is 3.3:1; --on-danger is near-black
   there and white on the light theme's deeper red (both over 5.8:1). */
.btn-danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.btn-danger:hover { filter: brightness(1.08); }

/* Language switcher: on the sign-in screen (top right of the card column) and
   at the top of the sidebar footer. Same select styling as the period picker. */

/* ---- audit 2026-11-19 fixes ------------------------------------------- */
/* D6: every checkbox and radio is at least 24x24 (WCAG 2.5.8), not only
   the ones inside .check-row. */
input[type="checkbox"], input[type="radio"] { min-width: 24px; min-height: 24px; accent-color: var(--accent-line); }
/* D8: headings take focus on view change for screen readers; a mouse user
   should not see a ring on them. Keyboard focus still shows it. */
h1[tabindex="-1"]:focus:not(:focus-visible), h2[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
/* P05 (design review 2026-11-27): a heading is not a control (WCAG 2.4.7
   asks for a ring on controls), and Chrome counts focus moved by script
   after a keyboard sign-in as focus-visible, which drew a black box round
   every page title. Focus still moves there for screen readers. */
:is(h1, h2, h3)[tabindex="-1"]:focus { outline: none; }
/* D10: on touch screens, and at phone width whatever the pointer, every
   control is at least 44 px tall, including the text links that switch the
   sign-in cards and the billing-details summary. */
@media (pointer: coarse), (max-width: 820px) {
  button, .btn, select, input:not([type="checkbox"]):not([type="radio"]), .nav button { min-height: 44px; }
  .skip-link, #show-signup-link, #show-login-link, #show-forgot-link { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }
  .billing-details > summary, .faq summary { min-height: 44px; }
}
/* D5: a scrolling table region shows its keyboard focus. */
.table-wrap[tabindex="0"]:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 2px; }

/* Calls on a phone (B2). The table stays a table in the DOM; each row is a
   list item: caller and time on line 1, outcome and duration on line 2,
   the recording icon at the end. The row link covers the row, so the whole
   row is a 44 px target. No sideways scroll. */
@media (max-width: 640px) {
  .calls-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .calls-table, .calls-table tbody { display: block; width: 100%; }
  .calls-table tr {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center;
    gap: var(--ad-space-1) var(--ad-space-3);
    min-height: 44px; padding: var(--ad-space-3) 0; border-bottom: 1px solid var(--border);
  }
  .calls-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .calls-table td[data-col="caller"] { grid-column: 1; grid-row: 1; font-weight: 600; overflow-wrap: anywhere; white-space: normal; }
  .calls-table td[data-col="when"] { grid-column: 2; grid-row: 1; justify-self: end; color: var(--text-dim); font-size: var(--ad-fs-sm); }
  .calls-table td[data-col="when"] .row-link { font-weight: 400; color: var(--text-dim); }
  .calls-table td[data-col="when"] .row-link::after { content: ""; position: absolute; inset: 0; }
  .calls-table td[data-col="outcome"] { grid-column: 1; grid-row: 2; }
  .calls-table td[data-col="duration"] { grid-column: 2; grid-row: 2; justify-self: end; color: var(--text-dim); font-size: var(--ad-fs-sm); }
  .calls-table td[data-col="recording"] { grid-column: 3; grid-row: 1 / 3; align-self: center; }
}

/* ---- shell 2026-11-19: corner pill, drawer (docs/brand-adakam-2026-11-19.md) */
/* Top bar: title and live indicator at the start, page actions, then the
   pill at the end edge. */
.topbar { justify-content: flex-start; }
#live-call-indicator { margin-inline-end: auto; }

/* Corner settings pill: language menu and theme toggle, 40 px buttons in a
   pill-shaped group (44 px on phones and touch screens). */
.corner-pill {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
}
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--radius-pill); background: none; color: var(--text-dim);
  font: inherit; font-size: var(--ad-fs-sm); font-weight: 600; cursor: pointer;
  transition: background-color var(--ad-dur-hover) var(--ad-ease-out), color var(--ad-dur-hover) var(--ad-ease-out);
}
.pill-btn:hover, .pill-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--text); }
.pill-btn svg { flex: none; }
.theme-btn { padding: 0; }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
.lang-code { letter-spacing: .02em; }
.lang-menu { position: relative; }
.lang-menu .menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: var(--ad-z-dropdown);
  min-width: 176px; margin: 0; padding: 4px; list-style: none;
  background: var(--ad-surface-3); border: 1px solid var(--border); border-radius: var(--ad-radius-panel); box-shadow: var(--ad-shadow-2);
}
.lang-menu .menu button {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ad-space-3);
  width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; border-radius: var(--ad-radius-control); background: none; color: var(--text);
  font: inherit; font-size: var(--ad-fs-sm); text-align: start; cursor: pointer;
}
.lang-menu .menu button:hover, .lang-menu .menu button:focus-visible { background: var(--surface-2); }
.lang-menu .menu button[aria-checked="true"] { font-weight: 600; }
/* The current language: a dot (shape, not colour alone, with the weight). */
.lang-menu .menu button[aria-checked="true"]::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-line); flex: none;
}
/* Sign-in screens: the pill sits in the top-right corner of the page. */
.login-wrap { position: relative; padding-top: calc(var(--ad-space-5) + 56px); }
.login-pill { position: absolute; top: calc(var(--ad-space-4) + env(safe-area-inset-top)); inset-inline-end: calc(var(--ad-space-4) + env(safe-area-inset-right)); }

/* Drawer under 1024 px. Closed it is display:none, so neither focus nor a
   screen reader can reach it; open it slides in over a scrim. */
.nav-toggle, .drawer-close { display: none; }
.drawer-scrim { display: none; }
@media (max-width: 1023px) {
  .nav-toggle { display: inline-flex; margin-inline-start: calc(-1 * var(--ad-space-2)); }
  .topbar { position: sticky; top: 0; z-index: var(--ad-z-sticky); }
  .sidebar {
    display: none; position: fixed; top: 0; bottom: 0; left: 0; z-index: var(--ad-z-modal);
    width: min(300px, 86vw); height: 100vh; height: 100dvh;
    box-shadow: var(--ad-shadow-3);
    padding: calc(1.25rem + env(safe-area-inset-top)) 0 calc(var(--ad-space-4) + env(safe-area-inset-bottom)) env(safe-area-inset-left);
  }
  .sidebar.is-open { display: flex; animation: ad-drawer-in var(--ad-dur-enter) var(--ad-ease-out); }
  .drawer-close { display: inline-flex; position: absolute; top: calc(var(--ad-space-3) + env(safe-area-inset-top)); right: var(--ad-space-3); }
  .drawer-scrim.is-open {
    display: block; position: fixed; inset: 0; z-index: var(--ad-z-overlay);
    background: var(--scrim); animation: ad-fade-in var(--ad-dur-enter) var(--ad-ease-out);
  }
  .nav button, .sidebar-foot .btn { min-height: 44px; }
}
@keyframes ad-drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar.is-open, .drawer-scrim.is-open { animation: none; } }
/* Phone: menu, title and pill share the first row; the live-call line and
   the page actions (Export) take their own rows under them. */
@media (max-width: 820px) {
  #topbar-right { order: 3; }
  .topbar > .corner-pill { margin-inline-start: auto; }
  #live-call-indicator { order: 2; flex-basis: 100%; margin-inline-end: 0; }
  #live-call-indicator:empty { display: none; }
  .topbar #page-title { min-width: 0; overflow-wrap: anywhere; }
}
@media (pointer: coarse), (max-width: 820px) {
  .pill-btn { min-width: 44px; height: 44px; }
  .corner-pill { padding: 1px; }
}

/* ---- command menu (T81; app.js openCommandMenu) ---------------------------
 * Same pattern as the ops console's menu: a dim scrim, a solid raised panel
 * near the top so results grow downwards, grouped options with a visible
 * active row (tint plus a start-edge bar, not colour alone). The only motion
 * is a short rise-and-fade on open, and only without reduced motion; closing
 * is instant, so input is never held. Targets are 44 px. */
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: var(--ad-space-2); flex: none;
  height: 40px; padding: 0 6px 0 var(--ad-space-3);
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-dim); font: inherit; font-size: var(--ad-fs-sm); cursor: pointer;
  transition: background-color var(--ad-dur-hover) var(--ad-ease-out), color var(--ad-dur-hover) var(--ad-ease-out);
}
.cmdk-trigger:hover { background: var(--surface-2); color: var(--text); }
.cmdk-trigger svg { flex: none; }
.cmdk-trigger .kbd { margin-inline-start: var(--ad-space-2); }
.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em;
  padding: 1px 6px; border: 1px solid var(--ad-line); border-radius: var(--ad-radius-sm);
  background: var(--surface-2); color: var(--text-dim);
  font-family: var(--ad-font-mono); font-size: var(--ad-fs-xs); font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.cmdk-backdrop {
  position: fixed; inset: 0; z-index: var(--ad-z-modal);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh var(--ad-space-4) var(--ad-space-4); background: var(--ad-scrim);
}
.cmdk {
  width: 100%; max-width: 600px; max-height: 72vh; max-height: 72dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--ad-radius-panel);
  box-shadow: var(--ad-shadow-3);
}
.cmdk-field {
  position: relative; display: flex; align-items: center; gap: var(--ad-space-2);
  padding: var(--ad-space-1) var(--ad-space-1) var(--ad-space-1) var(--ad-space-4);
  border-bottom: 1px solid var(--ad-line); color: var(--text-dim);
}
.cmdk-field > svg { flex: none; }
.cmdk-field input {
  flex: 1; min-width: 0; min-height: 48px; border: 0; background: none; color: var(--text);
  font: inherit; font-size: var(--ad-fs-md); text-overflow: ellipsis; /* 16 px: no iOS zoom on focus */
}
.cmdk-field input::placeholder { color: var(--text-dim); opacity: 1; }
/* The panel is the focused surface: the field line takes the focus colour
   instead of a ring drawn inside the panel edge. Forced colours keep a ring. */
.cmdk-field input:focus { outline: none; }
.cmdk-field:focus-within::after {
  content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--ad-focus-ring); pointer-events: none;
}
@media (forced-colors: active) {
  .cmdk-field input:focus-visible { outline: 2px solid Highlight; outline-offset: -2px; }
  .cmdk-opt[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
.cmdk-close { color: var(--text-dim); }
.cmdk-close:hover { background: var(--surface-2); color: var(--text); }
.cmdk-list { margin: 0; padding: var(--ad-space-1) var(--ad-space-1) var(--ad-space-2); overflow-y: auto; overscroll-behavior: contain; }
.cmdk-group {
  padding: var(--ad-space-3) var(--ad-space-3) var(--ad-space-1);
  color: var(--text-dim); font-size: var(--ad-fs-xs); font-weight: 600;
}
.cmdk-opt {
  display: flex; align-items: center; gap: var(--ad-space-3);
  min-height: 44px; padding: var(--ad-space-1) var(--ad-space-3); border-radius: var(--ad-radius-control);
  border-inline-start: 3px solid transparent; color: var(--text); cursor: pointer;
}
.cmdk-opt:hover { background: var(--surface-2); }
.cmdk-opt[aria-selected="true"], .cmdk-opt[aria-selected="true"]:hover { background: var(--ad-accent-soft); border-inline-start-color: var(--ad-accent-line); }
.cmdk-ico { display: inline-flex; flex: none; color: var(--text-dim); }
.cmdk-opt[aria-selected="true"] .cmdk-ico { color: var(--text); }
.cmdk-text { display: flex; flex-direction: column; min-width: 0; }
.cmdk-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cmdk-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: var(--ad-fs-xs); }
.cmdk-tag { margin-inline-start: auto; flex: none; padding-inline-start: var(--ad-space-2); color: var(--text-dim); font-size: var(--ad-fs-xs); }
.cmdk-empty, .cmdk-note { margin: 0; padding: var(--ad-space-5) var(--ad-space-4); color: var(--text-dim); text-align: center; text-wrap: pretty; }
.cmdk-note { padding: var(--ad-space-2) var(--ad-space-4) var(--ad-space-3); font-size: var(--ad-fs-sm); }
.cmdk-foot {
  display: flex; gap: var(--ad-space-4); margin: 0; padding: var(--ad-space-2) var(--ad-space-4);
  border-top: 1px solid var(--ad-line); color: var(--text-dim); font-size: var(--ad-fs-xs);
}
.cmdk-foot > span { display: inline-flex; align-items: center; gap: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .cmdk-backdrop:not([hidden]) { animation: cmdk-scrim var(--ad-dur-dropdown) var(--ad-ease-out); }
  .cmdk-backdrop:not([hidden]) .cmdk { animation: cmdk-rise var(--ad-dur-dropdown) var(--ad-ease-out); transform-origin: 50% 0; }
}
@keyframes cmdk-scrim { from { opacity: 0; } }
@keyframes cmdk-rise { from { opacity: 0; transform: translateY(calc(-1 * var(--ad-rise))) scale(.98); } }
@media (prefers-contrast: more) { .cmdk { border-color: var(--ad-line-strong); } }
/* Phone: the trigger is a 44 px search icon beside the pill (its name stays
   "Search"); the panel fills the screen inside the safe areas. */
@media (max-width: 820px) {
  .topbar > .cmdk-trigger { margin-inline-start: auto; }
  .topbar > .cmdk-trigger ~ .corner-pill { margin-inline-start: 0; }
  .cmdk-trigger { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .cmdk-trigger-text, .cmdk-trigger .kbd { display: none; }
}
@media (max-width: 640px) {
  .cmdk-backdrop {
    padding: calc(var(--ad-space-2) + env(safe-area-inset-top)) calc(var(--ad-space-2) + env(safe-area-inset-right))
      calc(var(--ad-space-2) + env(safe-area-inset-bottom)) calc(var(--ad-space-2) + env(safe-area-inset-left));
  }
  .cmdk { max-height: 100%; }
  .cmdk-foot { display: none; }
}
@media (pointer: coarse) {
  .cmdk-trigger .kbd, .cmdk-foot { display: none; }
  .cmdk-trigger { min-width: 44px; height: 44px; }
  .cmdk-opt { min-height: 48px; }
}

/* Desktop (sidebar beside the page): .app paints the sidebar column for the
   whole page height, so the sidebar colour and its border never stop at the
   first screen on a long page (the sticky sidebar itself is one screen tall).
   The top bar keeps its short labels on one line. */
.nowrap { white-space: nowrap; }
@media (min-width: 1024px) {
  .app { background: linear-gradient(to right, var(--surface-2) 239px, var(--border) 239px 240px, transparent 240px); }
  #topbar-right > .dim, #topbar-right > .badge, #live-call-indicator { white-space: nowrap; }
}

/* ---- Team (views.team in app.js) -------------------------------------- */
/* Loading: one card of row-shaped lines, the shape of the table. */
.skeleton-block.is-rows { min-height: 0; display: grid; gap: var(--ad-space-4); padding: var(--ad-space-5); }
.skeleton-block.is-rows .skeleton-line:nth-child(odd) { width: 82%; }
.skeleton-block.is-rows .skeleton-line.is-head { width: 40%; height: 1.125rem; }
.team-table td { vertical-align: middle; }
.team-table .team-email { overflow-wrap: anywhere; }
.team-table td.num, .team-table th.num { white-space: nowrap; }
.team-actions { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: var(--ad-space-2); }
.team-table td[data-col="actions"] { white-space: nowrap; }
.team-empty { padding: var(--ad-space-5) var(--ad-space-4); }
/* Phone: each person becomes a small card, no sideways scroll. Name and
   role first, the email under it, status and last sign-in as labelled lines,
   the actions full width at the end (44 px tall from the touch rule). */
@media (max-width: 640px) {
  .team-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .team-table, .team-table tbody { display: block; width: 100%; }
  .team-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ad-space-1) var(--ad-space-3);
    padding: var(--ad-space-3) 0; border-bottom: 1px solid var(--border);
  }
  .team-table td { display: block; padding: 0; border: 0; min-width: 0; text-align: start; }
  .team-table td[data-col="name"] { grid-column: 1; grid-row: 1; font-weight: 600; }
  .team-table td[data-col="role"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .team-table td[data-col="email"] { grid-column: 1 / -1; color: var(--text-dim); }
  .team-table td[data-col="status"], .team-table td[data-col="last"] { grid-column: 1 / -1; font-size: var(--ad-fs-sm); }
  .team-table td[data-col="status"]::before, .team-table td[data-col="last"]::before {
    content: attr(data-label) ": "; color: var(--text-dim);
  }
  .team-table td[data-col="actions"]:empty { display: none; }
  .team-table td[data-col="actions"] { grid-column: 1 / -1; margin-top: var(--ad-space-2); }
  .team-actions { justify-content: stretch; flex-wrap: wrap; }
  .team-table td[data-col="actions"] { white-space: normal; }
  .team-actions .btn { flex: 1 1 0; }
  .card-head:has(#team-invite) { flex-wrap: wrap; }
}

/* ---- Team: tabs, invites, roles grid, role editor (migration 058) ------- */
/* People / Roles: an underlined tab row (WAI-ARIA tabs; arrows move). */
.tabs { display: flex; gap: var(--ad-space-1); border-bottom: 1px solid var(--border); margin: 0 0 var(--ad-space-4); overflow-x: auto; }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: var(--ad-space-2) var(--ad-space-3); min-height: 44px; font: inherit; font-weight: 600;
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ad-text); }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent-text); }
.tab:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: -2px; border-radius: var(--ad-radius-sm, 6px); }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 4px; }
.team-invites { margin-top: var(--ad-space-6, 1.5rem); }
.team-invites h3 { margin: 0 0 var(--ad-space-2); }

/* Roles grid: areas down the side, roles across; the area column stays put
   while the roles scroll sideways on a narrow screen. */
.roles-wrap { overflow-x: auto; }
.roles-table { min-width: 100%; border-collapse: separate; border-spacing: 0; }
.roles-table th, .roles-table td { padding: var(--ad-space-2) var(--ad-space-3); border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.roles-table thead th { vertical-align: bottom; white-space: nowrap; }
.roles-table thead th .roles-name { display: block; font-weight: 600; }
.roles-table thead th .roles-custom { margin-top: var(--ad-space-1); }
.roles-table thead th .roles-edit { margin-top: var(--ad-space-1); margin-inline-start: var(--ad-space-1); }
.roles-table tbody th { font-size: var(--ad-fs-sm); color: var(--ad-text); font-weight: 600; min-width: 11rem; }
.roles-table .roles-area { display: block; }
.roles-table .roles-area-hint { display: block; font-size: var(--ad-fs-xs); color: var(--text-dim); font-weight: 400; }
.roles-table th:first-child { position: sticky; inset-inline-start: 0; background: var(--ad-surface); }
.roles-table td { white-space: nowrap; font-size: var(--ad-fs-sm); }
.roles-table td.roles-off { color: var(--text-dim); }
.roles-table td.roles-top { color: var(--ad-ok-text); font-weight: 600; }
/* Match the global last-row rule so the row header loses its line too. */
.roles-table tbody tr:last-child > th { border-bottom: 0; }

/* Role editor: one select per area, two columns where there is room. */
.role-levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--ad-space-4); }
.role-levels .field { margin: 0; }
.role-levels select { width: 100%; }
.role-edit-actions { flex-wrap: wrap; }
.role-delete { margin-inline-end: auto; color: var(--ad-danger-text); }
.invite-actions { flex-wrap: wrap; }

/* Accept screen: the company and role line stands out a little. */
.invite-lead { font-size: var(--ad-fs-md); margin: 0 0 var(--ad-space-1); overflow-wrap: anywhere; }
/* A button that reads as a link (actions that are not navigation). */
.link-btn {
  appearance: none; background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text);
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 24px;
}
.link-btn:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 2px; border-radius: 2px; }
@media (max-width: 640px) {
  .tab { flex: 1 1 0; }
  .role-delete { margin-inline-end: 0; width: 100%; }
  .invite-actions .btn { flex: 1 1 auto; min-height: 44px; }
}

/* ---- onboarding: folded extras (onboarding PR 4) -------------------------
 * The first screen and the review show only what a first call needs; the
 * rest stays one tap away. Same look as .billing-details. */
.ob-more { margin: var(--ad-space-4) 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ob-more > summary {
  min-height: 44px; display: flex; align-items: center; gap: var(--ad-space-2); list-style: none;
  padding: var(--ad-space-2) var(--ad-space-3); cursor: pointer; font-weight: 600; font-size: var(--ad-fs-sm);
}
.ob-more > summary::-webkit-details-marker { display: none; }
/* Disclosure chevron: points right when closed, down when open. */
.ob-more > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: rotate(-45deg); transition: transform .15s ease;
}
.ob-more[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) { .ob-more > summary::before { transition: none; } }
.ob-more > summary:hover { background: var(--surface-2); }
.ob-more > summary:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 2px; }
.ob-more[open] { padding: 0 var(--ad-space-3) var(--ad-space-3); }
.ob-more[open] > summary { margin: 0 calc(-1 * var(--ad-space-3)) var(--ad-space-3); }
/* Whole-row radio targets, 44 px tall (the radio itself is 24 px). */
.ob-type .check-row { min-height: 44px; align-items: center; }

/* Plans & billing: the price grids and bank transfer stay folded until asked for. */
#plan-grids h3 { font-size: var(--ad-fs-md); }
.crm-only > summary, .pay-details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.pay-details > summary h2 { margin: 0; }
@media (max-width: 640px) {
  .plan-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .plan-table, .plan-table tbody { display: block; width: 100%; }
  .plan-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ad-space-1) var(--ad-space-3);
    padding: var(--ad-space-3) 0; border-bottom: 1px solid var(--border);
  }
  .plan-table td { display: block; padding: 0; border: 0; min-width: 0; }
  .plan-table td[data-col="plan"] { grid-column: 1; grid-row: 1; font-weight: 600; }
  .plan-table td[data-col="status"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .plan-table td[data-col="product"] { grid-column: 1 / -1; grid-row: 2; color: var(--text-dim); }
  .plan-table td[data-col="paid"] { grid-column: 1 / -1; font-size: var(--ad-fs-sm); }
  .plan-table td[data-col="paid"]::before { content: attr(data-label) ": "; }
  .plan-table td[data-col="note"]:empty { display: none; }
}
/* Folded sections show that they open: a chevron that turns when open. */
.crm-only > summary::after, .pay-details > summary::after {
  content: ""; flex: none; margin-inline-start: auto; width: .5rem; height: .5rem;
  border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor;
  transform: rotate(45deg); color: var(--text-dim);
}
.crm-only[open] > summary::after, .pay-details[open] > summary::after { transform: rotate(-135deg); }
.crm-only > summary { gap: var(--ad-space-3); }
.pay-details > summary { gap: var(--ad-space-3); }
/* Home: status line, "Needs you", latest calls. */
.home-status { display: flex; align-items: flex-start; gap: var(--ad-space-3); margin-bottom: var(--ad-space-4); font-size: var(--ad-fs-md); font-weight: 600; }
.status-dot { flex: none; width: .75rem; height: .75rem; border-radius: 50%; background: var(--ok); margin-top: .45rem; }
.status-dot.is-paused, .status-dot.is-attention { background: var(--warn); }
.status-label { font-weight: 700; }
.needs-main strong { white-space: nowrap; }
/* The page title is one step above the Home status line: lg over md on a
   phone, xl over lg from 641 px. */
.topbar #page-title { font-size: var(--ad-fs-lg); line-height: 1.2; }
@media (min-width: 641px) {
  .topbar #page-title { font-size: var(--ad-fs-xl); }
  .home-status { font-size: var(--ad-fs-lg); }
  .calls-table td[data-col="caller"], .calls-table td[data-col="when"] { white-space: nowrap; }
}
.needs-list { list-style: none; margin: 0; padding: 0; }
.needs-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: var(--ad-space-3); padding: var(--ad-space-3) 0; border-top: 1px solid var(--border); }
.needs-row:first-child { border-top: 0; padding-top: 0; }
.needs-row:last-child { padding-bottom: 0; }
.needs-main { display: flex; flex-direction: column; min-width: 0; }
.needs-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.needs-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.needs-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--ad-space-2); }
.needs-actions .btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.home-status p { color: var(--text); text-wrap: balance; }
.home-stats { margin-bottom: var(--ad-space-4); }
.home-stats .grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.home-stats-empty { margin: 0; }
.needs-empty { text-wrap: pretty; }
@media (max-width: 640px) {
  .needs-row { grid-template-columns: minmax(0, 1fr) auto; }
  .needs-main { grid-column: 1 / -1; }
  .needs-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
