/* Adamard design system -- matched to adamard.am, 2026-08-25; one shared
 * token set with the site and the customer dashboard 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 dashboard carry too.
 * This file's own names (--bg, --accent, --text-faint, ...) are mapped onto
 * those --ad-* tokens rather than restated. Restating them is how this file
 * drifted: its --text-faint was still #6B7A70 / #7D8B82 (3.75:1 / 3.57:1)
 * after the dashboard had fixed the same token. The motion rules are in
 * design/MOTION.md. This console's CSP is `style-src 'self'`, so everything
 * here is a stylesheet rule; nothing relies on inline styles.
 *
 * 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.
 * Status colours split the same way: --ok/--warn/--danger for fills, borders
 * and tints, --ok-text/--warn-text/--danger-text for text.
 *
 * Theme follows the site: the visitor's saved choice, otherwise the system
 * appearance (dark where none is stated), set on <html data-theme> by
 * theme.js before first paint.
 */
/* 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 ==== */

/* This console's names for the shared tokens. Theme switching happens inside the token block (light base,
   dark via data-theme or the system), 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);
  --on-danger: var(--ad-on-danger);
  --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);
  --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);

  /* ---- 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 */

  --sidebar-w: 220px;

}



* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-ui); font-size: var(--ad-fs-sm); line-height: 1.5;
}

input, button, select { font: inherit; }

/* --- login --- */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--ad-space-5); }
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--ad-shadow-2);
}
.login-badge {
  display: inline-block; font-size: var(--ad-fs-xs); font-weight: 700; letter-spacing: .06em;
  color: var(--danger-text); border: 1px solid var(--danger); border-radius: var(--ad-radius-pill);
  padding: var(--ad-space-1) var(--ad-space-2); margin-bottom: var(--ad-space-3);
}
.login-card h1 { margin: 0 0 var(--ad-space-1); font-size: var(--ad-fs-lg); }
.dim { color: var(--text-dim); }
.small { font-size: var(--ad-fs-sm); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.xsmall { font-size: var(--ad-fs-xs); }
.login-card label { display: block; margin-top: var(--ad-space-4); font-size: var(--ad-fs-sm); color: var(--text-dim); }
.login-card input {
  display: block; width: 100%; margin-top: var(--ad-space-1); padding: var(--ad-space-2) var(--ad-space-3); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.login-card .btn { margin-top: var(--ad-space-4); width: 100%; padding-block: var(--ad-space-3); font-weight: 600; }
.error { margin-top: var(--ad-space-3); color: var(--danger-text); font-size: var(--ad-fs-sm); }
.success { margin-top: var(--ad-space-3); color: var(--ok-text); font-size: var(--ad-fs-sm); }
.login-card .switch-link { display: block; margin-top: var(--ad-space-4); text-align: center; font-size: var(--ad-fs-sm); color: var(--text-dim); }
.login-card .switch-link a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }

/* --- app shell: sidebar + content (Part A: five zones, not one flat page) --- */
.app {
  min-height: 100vh; min-height: 100dvh; display: flex;
  /* The sidebar column is painted on .app too, so it runs the full page height
     on a long page and in full-page captures, not only the first screen. */
  background: linear-gradient(90deg, var(--surface) calc(var(--sidebar-w) - 1px), var(--border) calc(var(--sidebar-w) - 1px) var(--sidebar-w), transparent var(--sidebar-w));
}

.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: var(--ad-space-4) var(--ad-space-3); position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.sidebar-brand {
  font-weight: 700; letter-spacing: .03em; padding: var(--ad-space-1) var(--ad-space-2) var(--ad-space-4); font-size: var(--ad-fs-md);
}
/* The Adakam lockup is an inline SVG with only a viewBox: without a height it
 * fills the sidebar's width. Same size as the dashboard's .brand-lockup. */
.sidebar-brand .brand { display: flex; align-items: center; gap: var(--ad-space-2); }
.brand-lockup { height: 24px; width: auto; flex: none; color: var(--text); }
.brand-sub { color: var(--text-dim); font-weight: 600; }
.sidebar-brand .badge {
  display: block; font-size: var(--ad-fs-xs); font-weight: 700; color: var(--danger-text);
  border: 1px solid var(--danger); border-radius: var(--ad-radius-pill); padding: 2px var(--ad-space-2);
  margin-top: var(--ad-space-2); width: fit-content;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.zone-btn {
  display: flex; align-items: center; gap: var(--ad-space-3); text-align: left; background: none; border: none;
  color: var(--text-dim); padding: var(--ad-space-3) var(--ad-space-3); border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--ad-fs-sm);
}
.zone-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: .85; }
.zone-btn.active .zone-icon { opacity: 1; }
.zone-btn .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex-shrink: 0;
  visibility: hidden; /* a dot means an alert; the space stays so labels do not shift */
}
.zone-btn.has-alert .dot { visibility: visible; }
.zone-btn:hover { background: var(--surface-2); color: var(--text); }
/* The selected item also gets a 3px start-edge marker (no layout change): on light the
   lime tint alone is 1.06:1 and the text is the body colour, so colour cannot carry it. */
.zone-btn.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.zone-btn, #client-list li { position: relative; }
.zone-btn.active::before, #client-list li.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); }
.sidebar-who {
  border-top: 1px solid var(--border); padding-top: var(--ad-space-3); font-size: var(--ad-fs-xs); color: var(--text-dim);
}
.sidebar-who .btn { display: flex; margin-top: var(--ad-space-1); padding-inline: 0; color: var(--accent-text); }

.content { flex: 1; min-width: 0; padding: var(--ad-space-5) 28px; max-width: 1160px; }
.zone-header { margin-bottom: 20px; }
.zone-header h1 { margin: 0 0 var(--ad-space-1); font-size: var(--ad-fs-lg); }
.zone-header p { margin: 0; color: var(--text-dim); font-size: var(--ad-fs-sm); }


.grid-3 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--ad-space-4); }
.grid-3 .wide { grid-column: 1 / -1; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--ad-space-4) var(--ad-space-4); margin-bottom: var(--ad-space-5);
  /* Wide data tables (per-client error rates, cost tracking, people) have
   * more columns than a narrow viewport can show. Without this they were
   * clipped at the right edge with no way to reach the cut-off columns --
   * the rightmost data was simply unreadable rather than merely awkward.
   * Scrolling the card keeps every column reachable and costs nothing on a
   * wide screen, where there is no overflow to scroll. */
  overflow-x: auto;
}
/* Heading vs. description color are now deliberately different -- a
 * heading (.card h2 / .section h3) uses the brightest text color so it's
 * unmistakably the most prominent thing in its container; a description
 * (.card-desc, sits right under a heading) stays on --text-dim so it
 * reads as clearly secondary, not competing with the heading for
 * attention. Previously both used --text-dim and read at the same
 * visual weight. */
.card h2 { margin: 0 0 var(--ad-space-1); font-size: var(--ad-fs-sm); color: var(--text); font-weight: 700; }
.card-desc { color: var(--text-dim); font-size: var(--ad-fs-sm); margin: 0 0 var(--ad-space-4); }
/* Reserved for the single most important card per zone (e.g. Monitor's
 * "Right now" strip) — not for general emphasis, so it keeps meaning
 * something. */
.card.primary { border-color: var(--accent-soft); border-width: 2px; }
.card.primary h2 { font-size: var(--ad-fs-md); color: var(--text); }
/* ---------- badge (design/COMPONENTS.md) ----------
   One .badge plus a variant; app.js badgeClass() maps a status to one.
   Tint and border from the fill colour, text from the *-text token, the
   same as the dashboard (the fills alone were under 4.5:1 as text). */
.badge {
  display: inline-flex; align-items: center; gap: var(--ad-space-1);
  padding: 2px 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;
  text-transform: none; vertical-align: middle;
}
.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-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); }
/* Ops badges follow a label in headings. */
h2 .badge, h3 .badge { margin-left: var(--ad-space-1); }

.placeholder {
  color: var(--text-faint); font-size: var(--ad-fs-sm); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: var(--ad-space-4); text-align: center;
}

/* near-live strip (Monitor zone) */
.live-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ad-space-3); font-size: var(--ad-fs-sm); }
/* A long "stuck" note wraps instead of running past the card edge on phones. */
.live-strip .badge { white-space: normal; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0;
}
.live-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 1.6s ease-in-out 3; }
@media (prefers-reduced-motion: reduce) { .live-dot.on { animation: none; } }
/* Voice server unreachable (P06): an alert, not an idle dot. Danger start
   bar, the octagon-x (the one angular status shape) and the word. */
.live-strip.down {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-inline-start: 3px solid var(--danger);
  border-radius: var(--radius-sm); padding: var(--ad-space-2) var(--ad-space-3);
}
.live-down-text { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: var(--ad-space-1) var(--ad-space-2); color: var(--text); }
.live-down-icon { flex: none; align-self: center; color: var(--danger); }
@media (forced-colors: active) { .live-down-icon { color: CanvasText; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* stat tiles (Business zone) */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--ad-space-3); }
.stat-tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--ad-space-3) var(--ad-space-4); }
.stat-tile .n { font-size: var(--ad-fs-xl); font-weight: 700; line-height: 1; }
.stat-tile .l { font-size: var(--ad-fs-xs); color: var(--text-dim); margin-top: var(--ad-space-1); }

/* Cost tracking card: summary tiles (same .stat-tile component as the
 * Business zone's Clients tiles, reused rather than a new one-off style),
 * a labeled filter row, and right-aligned numeric table columns -- the
 * left-align-text/right-align-numbers convention most cost/billing UIs
 * use so digits line up for scanning instead of ragging left. */
.cost-summary { margin: var(--ad-space-4) 0; }
.filter-bar { display: flex; gap: var(--ad-space-4); align-items: flex-end; flex-wrap: wrap; margin-bottom: var(--ad-space-4); }
.filter-field { display: flex; flex-direction: column; gap: var(--ad-space-1); }
.filter-label { font-size: var(--ad-fs-xs); color: var(--text-dim); }
.filter-field select {
  padding: var(--ad-space-2) var(--ad-space-2); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
}
.cost-table th.num, .cost-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cost-total-cell { color: var(--text); }
.bars {
  display: flex; align-items: flex-end; gap: var(--ad-space-1); height: 90px; margin-top: var(--ad-space-4);
  /* Faint 25/50/75/100% gridlines so relative bar heights are easier to
   * judge at a glance -- pure CSS, no markup change needed. */
  background-image: repeating-linear-gradient(
    to top, var(--border) 0, var(--border) 1px, transparent 1px, transparent 25%
  );
}
.bar { flex: 1; background: var(--accent-line); border-radius: 2px 2px 0 0; min-height: 2px; opacity: .85; }
.bar:hover { opacity: 1; }
.bar-labels { display: flex; gap: var(--ad-space-1); margin-top: var(--ad-space-1); }
.bar-label { flex: 1; text-align: center; font-size: var(--ad-fs-xs); color: var(--text-faint); white-space: nowrap; }
/* Stepped height classes, not inline style="height:...%" — this app's CSP
 * (style-src 'self', no unsafe-inline) silently drops inline style
 * attributes, so app.js picks the nearest one of these instead. */
.bar-h-0   { height: 2%; }   .bar-h-5   { height: 5%; }   .bar-h-10  { height: 10%; }
.bar-h-15  { height: 15%; }  .bar-h-20  { height: 20%; }  .bar-h-25  { height: 25%; }
.bar-h-30  { height: 30%; }  .bar-h-35  { height: 35%; }  .bar-h-40  { height: 40%; }
.bar-h-45  { height: 45%; }  .bar-h-50  { height: 50%; }  .bar-h-55  { height: 55%; }
.bar-h-60  { height: 60%; }  .bar-h-65  { height: 65%; }  .bar-h-70  { height: 70%; }
.bar-h-75  { height: 75%; }  .bar-h-80  { height: 80%; }  .bar-h-85  { height: 85%; }
.bar-h-90  { height: 90%; }  .bar-h-95  { height: 95%; }  .bar-h-100 { height: 100%; }

.state-ok { color: var(--ok-text); }
.state-bad { color: var(--danger-text); }
.state-pending { color: var(--warn-text); }
.kb-sync-result { margin: -4px 0 var(--ad-space-2); }
.call-view-btn { margin-left: auto; }
.mt-sm { margin-top: var(--ad-space-1); }

.go-live-summary {
  margin: var(--ad-space-3) 0; padding: var(--ad-space-3) var(--ad-space-4); border-radius: var(--radius-sm);
  border: 1px solid currentColor;
}
.go-live-summary.state-ok { background: var(--ok-soft); }
.go-live-summary.state-bad { background: var(--danger-soft); }
.go-live-summary-headline { font-weight: 700; font-size: var(--ad-fs-md); margin-bottom: var(--ad-space-2); color: inherit; }
.go-live-summary-row { font-size: var(--ad-fs-sm); padding: 2px 0; }

table { width: 100%; border-collapse: collapse; font-size: var(--ad-fs-sm); margin-top: var(--ad-space-2); }
th, td { text-align: left; padding: var(--ad-space-2) var(--ad-space-2); border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: var(--ad-fs-xs); }
th.sortable { user-select: none; }
th.sortable:hover { color: var(--text); }
/* The sort control is a real button inside the header (app.js makeSortable). */
.th-sort { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
/* Sort buttons were 18 px tall; 24 px is the WCAG 2.5.8 minimum target. */
.th-sort { min-height: 24px; display: inline-flex; align-items: center; gap: var(--ad-space-1); }
.th-sort:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 2px; border-radius: 2px; }
.sort-arrow::after { content: " ↕"; opacity: .4; font-size: var(--ad-fs-xs); }
th[aria-sort="ascending"] .sort-arrow::after { content: " ↑"; opacity: 1; color: var(--accent-text); }
th[aria-sort="descending"] .sort-arrow::after { content: " ↓"; opacity: 1; color: var(--accent-text); }
tr.bad td { color: var(--danger-text); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

.split { display: grid; grid-template-columns: 260px 1fr; gap: var(--ad-space-4); align-items: start; }
.client-list-pane, .client-detail-pane {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--ad-space-4);
}
.search-input {
  width: 100%; padding: var(--ad-space-2) var(--ad-space-3); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); margin-bottom: var(--ad-space-3);
}
#client-list, .plain-list { list-style: none; margin: var(--ad-space-2) 0 0; padding: 0; }
#client-list li, .plain-list li {
  padding: var(--ad-space-2) var(--ad-space-3); border-radius: var(--radius-sm); cursor: pointer; color: var(--text-dim);
}
#client-list li:hover, .plain-list li:hover { background: var(--surface-2); }
#client-list li.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.li-sub { display: block; font-size: var(--ad-fs-xs); color: var(--text-faint); margin-top: 1px; }

/* Client-detail pane tabs -- groups what used to be 11 flat stacked
 * sections. Echoes .zone-btn/.zone-btn.active's visual language rather
 * than inventing a new one, since it's the same "which thing is active"
 * pattern one level down. flex-wrap added when this grew from 4 tabs to 6
 * (splitting out Phone & Numbers and separating API Keys & Export from
 * Integrations) -- the content pane is narrower than the viewport (the
 * sidebar eats ~220px), so 6 unwrapped tabs can run past the edge on a
 * laptop-width screen. */
.tabs { display: flex; flex-wrap: wrap; gap: var(--ad-space-1); border-bottom: 1px solid var(--border); margin: var(--ad-space-4) 0 var(--ad-space-4); }
.tab {
  background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-dim);
  padding: var(--ad-space-2) var(--ad-space-4); font-size: var(--ad-fs-sm); font-weight: 600; cursor: pointer; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent-line); }

.section { margin-bottom: var(--ad-space-5); }
.section h3 { font-size: var(--ad-fs-sm); font-weight: 700; color: var(--text); margin: 0 0 var(--ad-space-2); }
.row { display: flex; gap: var(--ad-space-2); align-items: center; flex-wrap: wrap; margin-bottom: var(--ad-space-2); }
.row input, .row select { padding: var(--ad-space-2) var(--ad-space-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
/* A select in a row never grows past its card: an option as long as a long
   organisation name made the Test go-live select ~800px wide at phone width. */
.row select { max-width: 100%; min-width: 0; }
/* ---------- 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. */
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);
}
button.btn:hover { border-color: var(--text-faint); }
button.btn:active:not(:disabled) { transform: scale(var(--ad-press-scale)); transition-duration: 0ms; }
button.btn-primary { background: var(--accent); border-color: var(--ad-accent-edge); color: var(--on-accent); }
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; }
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; }
}

pre.result { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--ad-space-3); font-family: var(--mono); font-size: var(--ad-fs-xs); overflow-x: auto; max-height: 260px; }

/* call browser (Support zone) */
.call-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--ad-space-3) var(--ad-space-3); margin-bottom: var(--ad-space-2); background: var(--surface-2); }
.call-row-head { display: flex; align-items: center; gap: var(--ad-space-3); flex-wrap: wrap; font-size: var(--ad-fs-sm); }
.call-row-head .muted { color: var(--text-faint); font-size: var(--ad-fs-xs); }
.call-transcript { margin-top: var(--ad-space-3); font-size: var(--ad-fs-sm); white-space: pre-wrap; border-top: 1px solid var(--border); padding-top: var(--ad-space-3); }
.call-transcript.empty { color: var(--text-faint); font-style: italic; }
audio { width: 100%; margin-top: var(--ad-space-3); }

/* people zone */
.new-password-box {
  background: var(--ok-soft); border: 1px solid var(--ok); border-radius: var(--radius-sm);
  padding: var(--ad-space-3) var(--ad-space-3); margin-top: var(--ad-space-2); font-family: var(--mono); font-size: var(--ad-fs-sm); word-break: break-all;
}
.new-password-box .warn-line { display: block; font-family: var(--font-ui); font-size: var(--ad-fs-xs); color: var(--text-dim); margin-bottom: var(--ad-space-2); }

/* Ops toasts (design/COMPONENTS.md, "Toast"). #toast is the live region: it is
   always rendered, and a message is one .toast box inside it. */
.toast-region {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: var(--ad-z-toast);
  max-width: min(480px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: var(--ad-space-2);
}
.toast {
  display: flex; align-items: center; gap: var(--ad-space-3);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: var(--ad-space-3) var(--ad-space-4); box-shadow: var(--ad-shadow-2); font-size: var(--ad-fs-sm); z-index: var(--ad-z-toast);
}
.toast-close { margin-left: auto; }
.toast.ok { border-color: var(--ok); color: var(--ok-text); }
.toast.err { border-color: var(--danger); color: var(--danger-text); }


/* ---- 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, .h-card {
  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); }

/* Uppercase micro-labels: the site sets .label as 600/13px with
 * 0.03em tracking -- adopt that rather than each panel's ad-hoc styling. */
.label, th, .eyebrow {
  font-family: var(--font-ui);
  font-weight: 600;
}

/* Digits that sit in columns should line up. */
td, .num, .stat-value, .metric { font-variant-numeric: tabular-nums; }


/* ---- governance zone ----------------------------------------------------
 * Plan capabilities and the audit log on one screen. No inline styles
 * anywhere here: this app sends `style-src 'self'` with no 'unsafe-inline',
 * so a style= attribute is silently dropped and the layout quietly breaks. */
.gov-plan {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--ad-space-4);
  margin-bottom: var(--ad-space-4);
  background: var(--surface-2);
}
.gov-plan-head {
  display: flex;
  align-items: baseline;
  gap: var(--ad-space-2);
  flex-wrap: wrap;
  margin-bottom: var(--ad-space-2);
}
.gov-plan-head strong { font-family: var(--font-display); font-size: var(--ad-fs-md); }
.gov-plan-head .btn { margin-left: auto; }

.gov-caps { width: 100%; }
.gov-caps td {
  padding: var(--ad-space-1) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  font-size: var(--ad-fs-sm);
}
.gov-caps tr:last-child td { border-bottom: none; }
.gov-cap-val { text-align: right; white-space: nowrap; }

#gov-audit-filters { align-items: center; gap: var(--ad-space-2); margin-bottom: var(--ad-space-2); }
#gov-audit-pager { gap: var(--ad-space-2); margin-top: var(--ad-space-2); }
#gov-audit-table td { vertical-align: top; }
#gov-audit-table code { font-family: var(--mono); font-size: var(--ad-fs-xs); }

/* A capability shown on a CRM plan is never read by anything -- both
 * enforcement points resolve from ai_operator_tier. Dim it so nobody
 * configures a value believing it takes effect. */
.gov-inapplicable { margin: 0 0 var(--ad-space-2); }
/* Muted text, not opacity: opacity took the text and badges below AA
 * contrast (audit 2026-11-19). The note above says why it is inert. */
.gov-caps-inert td { color: var(--text-dim); }

.calls-pager { align-items: center; gap: var(--ad-space-2); margin-bottom: var(--ad-space-2); }

/* A deactivated account should be legible as such at a glance, not only via
   its badge -- the row is still readable, just clearly not live. */
tr.row-inactive td { color: var(--text-dim); }
.people-actions { display: flex; gap: var(--ad-space-2); flex-wrap: wrap; align-items: center; }


/* 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;
}

.cost-margin-table { width: 100%; }
.cost-margin-table td, .cost-margin-table th { padding: var(--ad-space-1) var(--ad-space-2); font-size: var(--ad-fs-sm); }
.cost-margin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- notice (design/COMPONENTS.md) ----------
   A short message inside the page: .notice plus info / ok / warn / danger,
   the same variants as the dashboard (ops sets them a little tighter). */
.notice { border-radius: var(--radius-sm); padding: var(--ad-space-2) var(--ad-space-3); font-size: var(--ad-fs-sm); margin: var(--ad-space-2) 0; }
.notice-info { background: var(--accent-soft); border: 1px solid var(--ad-line-strong); color: var(--text); }
.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); }
.notice-warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); color: var(--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); }

/* ---- in-page dialog (app.js openDialog) ----------------------------------
 * Replaces the native prompt/confirm chains (QA walk O1). Static markup in
 * index.html; no inline styles, same CSP reason as everywhere else here. */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--ad-z-modal);
  display: grid; place-items: center; padding: var(--ad-space-4);
  /* The near-black --on-accent ink, as on the dashboard (tinted towards the
     green ground rather than pure black). */
  background: var(--ad-scrim);
}
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--ad-space-5); box-shadow: var(--ad-shadow-3);
}
.modal h2 { margin: 0 0 var(--ad-space-2); font-size: var(--ad-fs-lg); }
.modal-message p { margin: 0 0 var(--ad-space-2); color: var(--text-dim); font-size: var(--ad-fs-sm); }
.dlg-field { margin-top: var(--ad-space-3); }
.dlg-field label { display: block; font-size: var(--ad-fs-sm); color: var(--text); margin-bottom: var(--ad-space-1); }
.dlg-field input, .dlg-field select, .dlg-field textarea {
  display: block; width: 100%; padding: var(--ad-space-2) var(--ad-space-3); font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.dlg-field textarea { resize: vertical; min-height: 64px; }
.dlg-field [aria-invalid="true"] { border-color: var(--danger); }
.dlg-help { display: block; margin-top: var(--ad-space-1); font-size: var(--ad-fs-xs); color: var(--text-dim); }
.modal-hint {
  margin: var(--ad-space-3) 0 0; padding: var(--ad-space-2); font-size: var(--ad-fs-sm);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--radius-sm);
}
.modal-actions { display: flex; justify-content: flex-end; gap: var(--ad-space-2); margin-top: var(--ad-space-4); flex-wrap: wrap; }
.modal :focus-visible { outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: var(--ad-focus-offset); }

/* Purchase requests waiting longer than a day (QA walk O2). */
tr.overdue td { background: var(--danger-soft); }
.request-overdue { font-weight: 600; }

/* Infra health: one named line per check (QA walk O5). */
.infra-check { padding: var(--ad-space-1) 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.infra-check > span { margin-right: var(--ad-space-2); }

/* Versions tab (ops Versions zone) */
.num { font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.versions-body { margin: var(--ad-space-3) 0; }
.versions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: var(--ad-space-3); }
#zone-versions select { max-width: 100%; }
.diff-before, .diff-after { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 12ch; }
.versions-dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--ad-space-2) var(--ad-space-4); margin: 0; }
.versions-dl dt { color: var(--text-dim); }
.versions-dl dd { margin: 0; overflow-wrap: anywhere; }
.diff-before { color: var(--danger-text); }
.diff-after { color: var(--ok-text); }
/* ---------- 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; } }
@media (max-width: 640px) {
  .versions-dl { grid-template-columns: 1fr; }
  /* One column on phones: the client list sits above the client detail, and
     the Monitor cards stack, instead of two squeezed columns where the
     detail pane ran 110 px past the screen (overnight audit 2026-11-17). */
  .split, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
/* Versions tables at phone width: each row becomes a small card with the
   column name before each value, so nothing hides past a scroll edge. */
@media (max-width: 640px) {
  table.stack-narrow thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  table.stack-narrow, table.stack-narrow tbody, table.stack-narrow tr, table.stack-narrow td { display: block; width: 100%; }
  table.stack-narrow tr { padding: var(--ad-space-2) 0; border-bottom: 1px solid var(--border); }
  table.stack-narrow td { border: none; padding: 2px 0; }
  table.stack-narrow td[data-label]::before {
    content: attr(data-label); display: block; font-size: var(--ad-fs-xs); color: var(--text-dim);
  }
}
/* Phone width: the sidebar becomes a top bar with a scrolling zone row, so
   every zone gets the full width. Desktop layout is unchanged. */
@media (max-width: 820px) {
  .app { flex-direction: column; background: none; }
  .sidebar {
    width: auto; height: auto; position: static; padding: var(--ad-space-3) var(--ad-space-4);
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .sidebar-brand { display: flex; align-items: center; gap: var(--ad-space-3); padding: 0 0 var(--ad-space-2); }
  .sidebar-brand .badge { margin-top: 0; }
  .sidebar .brand-lockup { height: 24px; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; gap: var(--ad-space-1); padding-bottom: var(--ad-space-1); }
  .zone-btn { flex-shrink: 0; min-height: 44px; }
  .sidebar-who { display: flex; flex-wrap: wrap; gap: var(--ad-space-1) var(--ad-space-4); align-items: center; padding-top: var(--ad-space-2); }
  .sidebar-who .btn { display: inline-flex; margin-top: 0; min-height: 44px; }
  /* Touch screens: every button is at least 44 px tall (31-39 px at 375,
     overnight audit 2026-11-17). Desktop sizes are unchanged. */
  button.btn { min-height: 44px; }
  .content { padding: var(--ad-space-4); }
}

/* Checkboxes were the 13px browser default; WCAG 2.5.8 asks for a 24px
   target. 24px box, and the whole label row toggles it (44px tall on phones). */
input[type="checkbox"] { width: 24px; height: 24px; margin: 0; accent-color: var(--accent-line); flex: none; }
label:has(> input[type="checkbox"]) {
  display: inline-flex; align-items: center; gap: var(--ad-space-2); min-height: 24px; cursor: pointer;
}

/* ---- Adakam shell 2026-11-19 (docs/brand-adakam-2026-11-19.md) ---------- */
/* A header cell anchors its sr-only label: otherwise the 1 px box is placed
   against the page and pokes out of a sideways-scrolling card. */
th { position: relative; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Brand: the tile mark and "Adakam Ops". */
.brand-tile { width: 28px; height: 28px; flex: none; border-radius: 5px; }
/* The tile is #232323, the dark page colour: give it an edge there. */
:root[data-theme="dark"] .brand-tile { box-shadow: 0 0 0 1px var(--ad-line-strong); }
.brand-name { font-weight: 700; color: var(--text); letter-spacing: 0; }
/* Top bar (52 px): environment badge at the start, theme pill at the end. */
.ops-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ops-main > .content { flex: 1 0 auto; }
.ops-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ad-space-3);
  min-height: 52px; padding: var(--ad-space-1) 28px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: var(--ad-z-sticky);
}
.env-badge {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px var(--ad-space-3);
  border-radius: var(--ad-radius-pill); background: var(--ad-danger-soft); color: var(--danger-text);
  font-size: var(--ad-fs-xs); font-weight: 700; letter-spacing: .02em;
}
.env-badge.env-test { background: var(--ad-info-soft); color: var(--ad-info-text); }
.corner-pill {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  padding: 2px; border: 1px solid var(--border); border-radius: var(--ad-radius-pill); background: var(--surface);
}
.pill-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--ad-radius-pill);
  background: none; color: var(--text-dim); cursor: pointer;
}
.pill-btn:hover { background: var(--surface-2); color: var(--text); }
.ico-sun { display: none; }
:root[data-theme="dark"] .ico-sun { display: block; }
:root[data-theme="dark"] .ico-moon { display: none; }
.login-wrap { position: relative; }
.login-pill { position: absolute; top: var(--ad-space-4); right: var(--ad-space-4); }
/* O2: a scrolling card shows its keyboard focus. */
.card[tabindex="0"]:focus-visible, .scroll-x[tabindex="0"]:focus-visible { outline: 2px solid var(--ad-focus-ring); outline-offset: 2px; }
/* O7: on touch screens and at phone width every control is at least 44 px. */
@media (pointer: coarse), (max-width: 820px) {
  button, .btn, select, input:not([type="checkbox"]):not([type="radio"]), .zone-btn, .th-sort { min-height: 44px; }
  .skip-link { display: inline-flex; align-items: center; min-height: 44px; }
  .th-sort { min-width: 44px; }
  label:has(> input[type="checkbox"]) { min-height: 44px; }
  .pill-btn { width: 44px; height: 44px; }
  .login-card .switch-link a { display: inline-flex; align-items: center; min-height: 44px; }
  .ops-topbar { padding: var(--ad-space-1) var(--ad-space-4); }
  .ops-main { width: 100%; }
}

/* ---- command menu (design PR 16; app.js openCommandMenu) ------------------
 * A modal finder: dim scrim (focus on one task), a solid raised panel near
 * the top so results grow downwards, options with a visible active row. The
 * only motion is a short rise-and-fade on open, and only when the person has
 * not asked for reduced motion; closing is instant, so input is never held. */
.topbar-end { display: flex; align-items: center; gap: var(--ad-space-2); }
.cmdk-trigger {
  display: inline-flex; align-items: center; gap: var(--ad-space-2);
  min-height: 36px; padding: 0 var(--ad-space-2) 0 var(--ad-space-3);
  border: 1px solid var(--ad-line-strong); border-radius: var(--ad-radius-control);
  background: var(--surface); color: var(--text-dim); font: inherit; font-size: var(--ad-fs-sm); cursor: pointer;
}
.cmdk-trigger:hover { background: var(--surface-2); color: var(--text); }
.cmdk-trigger:focus-visible, .cmdk-close:focus-visible { outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: var(--ad-focus-offset); }
.kbd {
  display: inline-flex; align-items: center; min-width: 1.5em; justify-content: center;
  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;
}
.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: 560px; max-height: 70vh; max-height: 70dvh;
  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 {
  display: flex; align-items: center; gap: var(--ad-space-2);
  padding: var(--ad-space-2) var(--ad-space-2) var(--ad-space-2) var(--ad-space-4);
  border-bottom: 1px solid var(--ad-line); color: var(--text-dim);
}
.cmdk-field input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: none; color: var(--text);
  font: inherit; font-size: var(--ad-fs-md);
}
/* The field's own focus ring would sit inside the panel edge; the panel
   is the focused surface and the caret shows where typing goes. */
.cmdk-field input:focus { outline: none; }
.cmdk-field:focus-within { border-bottom-color: var(--ad-focus-ring); }
.cmdk-close {
  min-height: 32px; padding: 0 var(--ad-space-2); 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; cursor: pointer;
}
.cmdk-list { list-style: none; margin: 0; padding: var(--ad-space-1); overflow-y: auto; overscroll-behavior: contain; }
.cmdk-opt {
  display: flex; align-items: center; gap: var(--ad-space-2);
  min-height: 44px; padding: var(--ad-space-1) var(--ad-space-3); border-radius: var(--ad-radius-control);
  cursor: pointer; color: var(--text); border-left: 3px solid transparent;
}
.cmdk-opt[aria-selected="true"] { background: var(--ad-accent-soft); border-left-color: var(--ad-accent-line); }
.cmdk-opt:hover { background: var(--surface-2); }
.cmdk-opt[aria-selected="true"]:hover { background: var(--ad-accent-soft); }
.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-family: var(--ad-font-mono); font-size: var(--ad-fs-xs); }
.cmdk-tag { margin-left: auto; flex: none; color: var(--text-dim); font-size: var(--ad-fs-xs); }
.cmdk-empty { margin: 0; padding: var(--ad-space-5) var(--ad-space-4); color: var(--text-dim); text-align: center; text-wrap: pretty; }
.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); } }
@media (max-width: 640px) {
  .cmdk-backdrop { padding: var(--ad-space-2); }
  .cmdk { max-height: calc(100dvh - 16px); }
  .cmdk-trigger { padding: 0; width: 44px; min-height: 44px; justify-content: center; }
  .cmdk-trigger-text, .cmdk-trigger .kbd, .cmdk-foot { display: none; }
}
@media (pointer: coarse) { .cmdk-trigger .kbd, .cmdk-foot { display: none; } .cmdk-trigger, .cmdk-close { min-height: 44px; min-width: 44px; } }

/* ═══ CLIENT PAGE (design PR 17) ═══════════════════════════════════════════ */
.field-label { display: block; margin-bottom: var(--ad-space-1); font-size: var(--ad-fs-sm); font-weight: 600; color: var(--text); }
#client-list li { padding: 0; }
.client-pick {
  display: block; width: 100%; min-height: 44px; padding: var(--ad-space-2) var(--ad-space-3); border: 0; border-radius: var(--radius-sm);
  background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
}
.split.client-open { grid-template-columns: minmax(0, 1fr); }
.client-head { margin-bottom: var(--ad-space-3); }
.client-back {
  min-height: 44px; padding: 0 var(--ad-space-1); margin-left: calc(-1 * var(--ad-space-1)); border: 0; background: none;
  color: var(--accent-text); font: inherit; font-size: var(--ad-fs-sm); cursor: pointer;
}
.client-back:hover { text-decoration: underline; }
.client-title { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ad-space-3); flex-wrap: wrap; }
.client-title h1 { margin: 0; font-size: var(--ad-fs-xl); overflow-wrap: anywhere; }
.client-title h1:focus { outline: none; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + var(--ad-space-1)); z-index: var(--ad-z-dropdown);
  min-width: 260px; max-width: calc(100vw - 2 * var(--ad-space-4)); margin: 0; padding: var(--ad-space-1); list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--ad-shadow-2);
}
.menu [role="menuitem"] {
  display: block; width: 100%; min-height: 44px; padding: var(--ad-space-2) var(--ad-space-3); border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer;
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus { background: var(--surface-2); }
.menu [role="menuitem"]:focus-visible { outline: var(--ad-focus-width) solid var(--ad-focus-ring); outline-offset: calc(-1 * var(--ad-focus-width)); }
/* Restart while a restart runs: still focusable (the menu stays navigable), visibly busy. */
.menu [role="menuitem"][aria-disabled="true"] { color: var(--text-dim); cursor: progress; }
@media (prefers-reduced-motion: no-preference) {
  .menu:not([hidden]) { animation: cmdk-rise var(--ad-dur-dropdown) var(--ad-ease-out); }
}
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--ad-space-3) var(--ad-space-5); margin: 0; }
.facts dt { font-size: var(--ad-fs-xs); color: var(--text-dim); }
.facts dd { margin: 2px 0 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .menu-wrap { width: 100%; }
  #client-actions-btn { width: 100%; min-height: 44px; }
  .menu { left: 0; right: 0; min-width: 0; }
}
