/*
 * Main Quest HQ design tokens: colour, type, space.
 * The palette, faces and radii are CBN Ventures' own (apps/cbnventures/src/styles/global.css):
 * purple, light purple and dark purple with the yellow accent, ink text and the dark
 * surfaces. Older variable names (green-*, orange-*) are kept as roles so every component
 * reads the CBN colours through them.
 */
:root {
  /* Brand purples. The "green" names are roles: deepest band, primary dark, primary, light. */
  --green-950: #0c0a14;        /* footer surface: deepest band */
  --green-900: #5438a5;        /* primary dark: headings, links, focus */
  --green-800: #7850ed;        /* primary purple */
  --green-500: #9373f0;        /* light purple: fills, icons, large display only */
  --green-100: #efeafd;        /* quiet tint for selected states */

  /* Action: the CBN yellow, always with ink text on it. */
  --orange-600: #ffe500;       /* yellow: large fills, rules, action buttons */
  --orange-500: #ffe500;       /* action button fill (ink text on it) */
  --orange-200: #fff6a3;       /* focus ring + accents on dark bands */
  --orange-700: #6b5d00;       /* yellow's text role on white (dark gold, 6.4:1) */

  /* Surfaces + ink */
  --paper: #f6f4fd;            /* page background: a faint lavender */
  --paper-2: #ece8fb;          /* sunken panels, table heads */
  --sheet: #ffffff;            /* white card surfaces */
  --rule: #e0e0e0;             /* hairlines */
  --rule-strong: #b9b2d6;      /* card borders */
  --ink: #1a1a1a;              /* strongest text */
  --text: #2b2836;             /* body text */
  --muted: #5c5770;            /* secondary text */
  --on-dark: #ffffff;
  --on-dark-muted: #c9c3e0;
  --surface-dark: #13111c;     /* header band and dark panels */

  /* Text and line roles of the brand colours. In the dark theme these turn light, while
     the purple and yellow fills (bands, buttons, card heads) stay as they are. */
  --heading: var(--ink);
  --accent-ink: var(--green-900);        /* links, purple labels */
  --accent-ink-soft: var(--green-800);   /* eyebrows, quieter labels */
  --accent-line: var(--green-800);       /* purple borders, outlines, focus ring */
  --accent-line-soft: var(--green-500);
  --orange-ink: var(--orange-700);       /* yellow's text role */

  /* Component surfaces */
  --field: #ffffff;
  --placeholder: #77728a;
  --plate: #fbfaff;
  --sheet-hover: #faf8ff;
  --panel-shadow: rgba(30, 20, 70, 0.16);
  --error-ink: #c62828;
  --error-bg: #fdeeee;
  --mark-bg: #fff6a3;                    /* search-match highlight */
  --footer-field: #ffffff;
  --footer-field-ink: #1a1a1a;
  --footer-field-muted: #5c5770;
  --footer-field-line: #ffffff;

  /* Status tones (ink, fill, line). */
  --tone-green-ink: #1b6b3a; --tone-green-bg: #e7f6ec; --tone-green-line: #3f9a5f;
  --tone-blue-ink: #2a4fa8; --tone-blue-bg: #eaf0fd; --tone-blue-line: #5478d6;
  --tone-teal-ink: #1f6b66; --tone-teal-bg: #e5f3f1; --tone-teal-line: #2f8a83;
  --tone-yellow-ink: #6b5d00; --tone-yellow-bg: #fffbd6; --tone-yellow-line: #d8c200;
  --tone-orange-ink: #9a4a00; --tone-orange-bg: #fff1e2; --tone-orange-line: #e08a2e;
  --tone-red-ink: #b3261e; --tone-red-bg: #fdecea; --tone-red-line: #d9534a;
  --tone-purple-ink: #5438a5; --tone-purple-bg: #efeafd; --tone-purple-line: #7850ed;

  --chart-google: #7850ed; --chart-microsoft: #ffcf00; --chart-linkedin: #9373f0;
  --heat: #5438a5; --heat-on: #ffffff;

  color-scheme: light;

  /* Type: Unbounded for display, Plus Jakarta Sans for body, Space Grotesk for labels. */
  --font-display: "Unbounded", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-label: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Grotesk", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-body: 1.0625rem;        /* 17px desktop; 16px under 700px */
  --fs-small: 1rem;            /* 16px: meta, captions, labels (never smaller) */
  --fs-lead: clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
  --fs-h4: 1.125rem;
  --fs-h3: clamp(1.25rem, 0.5vw + 1.1rem, 1.5rem);
  --fs-h2: clamp(1.5rem, 1.2vw + 1.1rem, 2.25rem);
  --fs-h1: clamp(1.75rem, 2.4vw + 1rem, 3rem);
  --lh-body: 1.5;
  --lh-tight: 1.25;

  /* Space (4px base) */
  --s-1: 0.25rem; --s-2: 0.5rem; --s-3: 0.75rem; --s-4: 1rem; --s-5: 1.5rem;
  --s-6: 2rem; --s-7: 3rem; --s-8: 4rem; --s-9: 6rem;

  --gutter: 16px;
  --max: 1200px;
  --measure: 70ch;
  --radius: 13px;              /* CBN tile corners */
  --radius-card: 22px;         /* CBN card corners */
  --radius-pill: 999px;
  --tap: 48px;                 /* min tap target (>= 44px) */
  --header-h: 76px;

  /* CBN's "pop" under-shadows: buttons sit on a solid drop that lifts on hover. */
  --ease-pop: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow-pop: 0 6px 0 rgba(180, 162, 0, 0.45);
  --shadow-pop-hover: 0 8px 0 rgba(180, 162, 0, 0.45);
  --shadow-pop-purple: 0 6px 0 rgba(60, 38, 130, 0.45);
  --shadow-pop-purple-hover: 0 8px 0 rgba(60, 38, 130, 0.45);
  --shadow-pop-ghost: 0 6px 0 rgba(128, 128, 128, 0.2);
  --shadow-card: 0 10px 0 rgba(84, 56, 165, 0.08);
}

@media (min-width: 700px) { :root { --gutter: 32px; } }
@media (max-width: 699px) { :root { --fs-body: 1rem; } }
@media (max-width: 899px) { :root { --header-h: 124px; } }

/* ---------- Dark theme ----------
 * "Auto" (no data-theme on <html>) follows the device; the appearance switch sets
 * data-theme="light" or "dark". light-dark() picks by the color-scheme in force, so every
 * token below flips together. Browsers without light-dark() keep the light theme, and the
 * switch hides itself there.
 */
@supports (color: light-dark(#000, #fff)) {
  :root {
    color-scheme: light dark;

    --paper: light-dark(#f6f4fd, #0c0a14);
    --paper-2: light-dark(#ece8fb, #13111c);
    --sheet: light-dark(#ffffff, #1a1726);
    --rule: light-dark(#e0e0e0, #2c2840);
    --rule-strong: light-dark(#b9b2d6, #4a4466);
    --ink: light-dark(#1a1a1a, #f4f2fb);
    --text: light-dark(#2b2836, #dcd8ec);
    --muted: light-dark(#5c5770, #aaa4c4);
    --green-100: light-dark(#efeafd, #251f3d);

    --heading: light-dark(#1a1a1a, #f4f2fb);
    --accent-ink: light-dark(#5438a5, #b9a6f7);
    --accent-ink-soft: light-dark(#7850ed, #c8b9f9);
    --accent-line: light-dark(#7850ed, #9373f0);
    --accent-line-soft: light-dark(#9373f0, #7850ed);
    --orange-ink: light-dark(#6b5d00, #ffe500);

    --field: light-dark(#ffffff, #120f1c);
    --placeholder: light-dark(#77728a, #8d87a6);
    --plate: light-dark(#fbfaff, #181524);
    --sheet-hover: light-dark(#faf8ff, #221e31);
    --panel-shadow: light-dark(rgba(30, 20, 70, 0.16), rgba(0, 0, 0, 0.55));
    --error-ink: light-dark(#c62828, #ff9c8f);
    --error-bg: light-dark(#fdeeee, #3b1915);
    --mark-bg: light-dark(#fff6a3, #4a4100);
    --footer-field: light-dark(#ffffff, #120f1c);
    --footer-field-ink: light-dark(#1a1a1a, #f4f2fb);
    --footer-field-muted: light-dark(#5c5770, #aaa4c4);
    --footer-field-line: light-dark(#ffffff, rgba(255, 255, 255, 0.45));

    --tone-green-ink: light-dark(#1b6b3a, #8fe0ab); --tone-green-bg: light-dark(#e7f6ec, #132a1c); --tone-green-line: light-dark(#3f9a5f, #5fbf80);
    --tone-blue-ink: light-dark(#2a4fa8, #a9c0f7); --tone-blue-bg: light-dark(#eaf0fd, #161f38); --tone-blue-line: light-dark(#5478d6, #6f8fe0);
    --tone-teal-ink: light-dark(#1f6b66, #93d6cf); --tone-teal-bg: light-dark(#e5f3f1, #12292a); --tone-teal-line: light-dark(#2f8a83, #57b0a8);
    --tone-yellow-ink: light-dark(#6b5d00, #ffe500); --tone-yellow-bg: light-dark(#fffbd6, #2a2600); --tone-yellow-line: light-dark(#d8c200, #bfa900);
    --tone-orange-ink: light-dark(#9a4a00, #ffb870); --tone-orange-bg: light-dark(#fff1e2, #2e1d0d); --tone-orange-line: light-dark(#e08a2e, #e08a2e);
    --tone-red-ink: light-dark(#b3261e, #f3a197); --tone-red-bg: light-dark(#fdecea, #2e1715); --tone-red-line: light-dark(#d9534a, #d9695e);
    --tone-purple-ink: light-dark(#5438a5, #c8b9f9); --tone-purple-bg: light-dark(#efeafd, #251f3d); --tone-purple-line: light-dark(#7850ed, #9373f0);

    --chart-google: light-dark(#7850ed, #9373f0); --chart-microsoft: light-dark(#ffcf00, #ffe500); --chart-linkedin: light-dark(#9373f0, #b9a6f7);
    --heat: light-dark(#5438a5, #9373f0); --heat-on: light-dark(#ffffff, #0c0a14);
  }

  :root[data-theme="light"] { color-scheme: light; }
  :root[data-theme="dark"] { color-scheme: dark; }
}

/* packages/core/src/css/flag-offsets.css */
:root {
  --iti-flag-width: 20px;
  --iti-flag-count: 244;
}
.iti__ac {
  --iti-flag-offset: 0;
}
.iti__ad {
  --iti-flag-offset: -1;
}
.iti__ae {
  --iti-flag-offset: -2;
}
.iti__af {
  --iti-flag-offset: -3;
}
.iti__ag {
  --iti-flag-offset: -4;
}
.iti__ai {
  --iti-flag-offset: -5;
}
.iti__al {
  --iti-flag-offset: -6;
}
.iti__am {
  --iti-flag-offset: -7;
}
.iti__ao {
  --iti-flag-offset: -8;
}
.iti__ar {
  --iti-flag-offset: -9;
}
.iti__as {
  --iti-flag-offset: -10;
}
.iti__at {
  --iti-flag-offset: -11;
}
.iti__au {
  --iti-flag-offset: -12;
}
.iti__aw {
  --iti-flag-offset: -13;
}
.iti__ax {
  --iti-flag-offset: -14;
}
.iti__az {
  --iti-flag-offset: -15;
}
.iti__ba {
  --iti-flag-offset: -16;
}
.iti__bb {
  --iti-flag-offset: -17;
}
.iti__bd {
  --iti-flag-offset: -18;
}
.iti__be {
  --iti-flag-offset: -19;
}
.iti__bf {
  --iti-flag-offset: -20;
}
.iti__bg {
  --iti-flag-offset: -21;
}
.iti__bh {
  --iti-flag-offset: -22;
}
.iti__bi {
  --iti-flag-offset: -23;
}
.iti__bj {
  --iti-flag-offset: -24;
}
.iti__bl {
  --iti-flag-offset: -25;
}
.iti__bm {
  --iti-flag-offset: -26;
}
.iti__bn {
  --iti-flag-offset: -27;
}
.iti__bo {
  --iti-flag-offset: -28;
}
.iti__bq {
  --iti-flag-offset: -29;
}
.iti__br {
  --iti-flag-offset: -30;
}
.iti__bs {
  --iti-flag-offset: -31;
}
.iti__bt {
  --iti-flag-offset: -32;
}
.iti__bw {
  --iti-flag-offset: -33;
}
.iti__by {
  --iti-flag-offset: -34;
}
.iti__bz {
  --iti-flag-offset: -35;
}
.iti__ca {
  --iti-flag-offset: -36;
}
.iti__cc {
  --iti-flag-offset: -37;
}
.iti__cd {
  --iti-flag-offset: -38;
}
.iti__cf {
  --iti-flag-offset: -39;
}
.iti__cg {
  --iti-flag-offset: -40;
}
.iti__ch {
  --iti-flag-offset: -41;
}
.iti__ci {
  --iti-flag-offset: -42;
}
.iti__ck {
  --iti-flag-offset: -43;
}
.iti__cl {
  --iti-flag-offset: -44;
}
.iti__cm {
  --iti-flag-offset: -45;
}
.iti__cn {
  --iti-flag-offset: -46;
}
.iti__co {
  --iti-flag-offset: -47;
}
.iti__cr {
  --iti-flag-offset: -48;
}
.iti__cu {
  --iti-flag-offset: -49;
}
.iti__cv {
  --iti-flag-offset: -50;
}
.iti__cw {
  --iti-flag-offset: -51;
}
.iti__cx {
  --iti-flag-offset: -52;
}
.iti__cy {
  --iti-flag-offset: -53;
}
.iti__cz {
  --iti-flag-offset: -54;
}
.iti__de {
  --iti-flag-offset: -55;
}
.iti__dj {
  --iti-flag-offset: -56;
}
.iti__dk {
  --iti-flag-offset: -57;
}
.iti__dm {
  --iti-flag-offset: -58;
}
.iti__do {
  --iti-flag-offset: -59;
}
.iti__dz {
  --iti-flag-offset: -60;
}
.iti__ec {
  --iti-flag-offset: -61;
}
.iti__ee {
  --iti-flag-offset: -62;
}
.iti__eg {
  --iti-flag-offset: -63;
}
.iti__eh {
  --iti-flag-offset: -64;
}
.iti__er {
  --iti-flag-offset: -65;
}
.iti__es {
  --iti-flag-offset: -66;
}
.iti__et {
  --iti-flag-offset: -67;
}
.iti__fi {
  --iti-flag-offset: -68;
}
.iti__fj {
  --iti-flag-offset: -69;
}
.iti__fk {
  --iti-flag-offset: -70;
}
.iti__fm {
  --iti-flag-offset: -71;
}
.iti__fo {
  --iti-flag-offset: -72;
}
.iti__fr {
  --iti-flag-offset: -73;
}
.iti__ga {
  --iti-flag-offset: -74;
}
.iti__gb {
  --iti-flag-offset: -75;
}
.iti__gd {
  --iti-flag-offset: -76;
}
.iti__ge {
  --iti-flag-offset: -77;
}
.iti__gf {
  --iti-flag-offset: -78;
}
.iti__gg {
  --iti-flag-offset: -79;
}
.iti__gh {
  --iti-flag-offset: -80;
}
.iti__gi {
  --iti-flag-offset: -81;
}
.iti__gl {
  --iti-flag-offset: -82;
}
.iti__gm {
  --iti-flag-offset: -83;
}
.iti__gn {
  --iti-flag-offset: -84;
}
.iti__gp {
  --iti-flag-offset: -85;
}
.iti__gq {
  --iti-flag-offset: -86;
}
.iti__gr {
  --iti-flag-offset: -87;
}
.iti__gt {
  --iti-flag-offset: -88;
}
.iti__gu {
  --iti-flag-offset: -89;
}
.iti__gw {
  --iti-flag-offset: -90;
}
.iti__gy {
  --iti-flag-offset: -91;
}
.iti__hk {
  --iti-flag-offset: -92;
}
.iti__hn {
  --iti-flag-offset: -93;
}
.iti__hr {
  --iti-flag-offset: -94;
}
.iti__ht {
  --iti-flag-offset: -95;
}
.iti__hu {
  --iti-flag-offset: -96;
}
.iti__id {
  --iti-flag-offset: -97;
}
.iti__ie {
  --iti-flag-offset: -98;
}
.iti__il {
  --iti-flag-offset: -99;
}
.iti__im {
  --iti-flag-offset: -100;
}
.iti__in {
  --iti-flag-offset: -101;
}
.iti__io {
  --iti-flag-offset: -102;
}
.iti__iq {
  --iti-flag-offset: -103;
}
.iti__ir {
  --iti-flag-offset: -104;
}
.iti__is {
  --iti-flag-offset: -105;
}
.iti__it {
  --iti-flag-offset: -106;
}
.iti__je {
  --iti-flag-offset: -107;
}
.iti__jm {
  --iti-flag-offset: -108;
}
.iti__jo {
  --iti-flag-offset: -109;
}
.iti__jp {
  --iti-flag-offset: -110;
}
.iti__ke {
  --iti-flag-offset: -111;
}
.iti__kg {
  --iti-flag-offset: -112;
}
.iti__kh {
  --iti-flag-offset: -113;
}
.iti__ki {
  --iti-flag-offset: -114;
}
.iti__km {
  --iti-flag-offset: -115;
}
.iti__kn {
  --iti-flag-offset: -116;
}
.iti__kp {
  --iti-flag-offset: -117;
}
.iti__kr {
  --iti-flag-offset: -118;
}
.iti__kw {
  --iti-flag-offset: -119;
}
.iti__ky {
  --iti-flag-offset: -120;
}
.iti__kz {
  --iti-flag-offset: -121;
}
.iti__la {
  --iti-flag-offset: -122;
}
.iti__lb {
  --iti-flag-offset: -123;
}
.iti__lc {
  --iti-flag-offset: -124;
}
.iti__li {
  --iti-flag-offset: -125;
}
.iti__lk {
  --iti-flag-offset: -126;
}
.iti__lr {
  --iti-flag-offset: -127;
}
.iti__ls {
  --iti-flag-offset: -128;
}
.iti__lt {
  --iti-flag-offset: -129;
}
.iti__lu {
  --iti-flag-offset: -130;
}
.iti__lv {
  --iti-flag-offset: -131;
}
.iti__ly {
  --iti-flag-offset: -132;
}
.iti__ma {
  --iti-flag-offset: -133;
}
.iti__mc {
  --iti-flag-offset: -134;
}
.iti__md {
  --iti-flag-offset: -135;
}
.iti__me {
  --iti-flag-offset: -136;
}
.iti__mf {
  --iti-flag-offset: -137;
}
.iti__mg {
  --iti-flag-offset: -138;
}
.iti__mh {
  --iti-flag-offset: -139;
}
.iti__mk {
  --iti-flag-offset: -140;
}
.iti__ml {
  --iti-flag-offset: -141;
}
.iti__mm {
  --iti-flag-offset: -142;
}
.iti__mn {
  --iti-flag-offset: -143;
}
.iti__mo {
  --iti-flag-offset: -144;
}
.iti__mp {
  --iti-flag-offset: -145;
}
.iti__mq {
  --iti-flag-offset: -146;
}
.iti__mr {
  --iti-flag-offset: -147;
}
.iti__ms {
  --iti-flag-offset: -148;
}
.iti__mt {
  --iti-flag-offset: -149;
}
.iti__mu {
  --iti-flag-offset: -150;
}
.iti__mv {
  --iti-flag-offset: -151;
}
.iti__mw {
  --iti-flag-offset: -152;
}
.iti__mx {
  --iti-flag-offset: -153;
}
.iti__my {
  --iti-flag-offset: -154;
}
.iti__mz {
  --iti-flag-offset: -155;
}
.iti__na {
  --iti-flag-offset: -156;
}
.iti__nc {
  --iti-flag-offset: -157;
}
.iti__ne {
  --iti-flag-offset: -158;
}
.iti__nf {
  --iti-flag-offset: -159;
}
.iti__ng {
  --iti-flag-offset: -160;
}
.iti__ni {
  --iti-flag-offset: -161;
}
.iti__nl {
  --iti-flag-offset: -162;
}
.iti__no {
  --iti-flag-offset: -163;
}
.iti__np {
  --iti-flag-offset: -164;
}
.iti__nr {
  --iti-flag-offset: -165;
}
.iti__nu {
  --iti-flag-offset: -166;
}
.iti__nz {
  --iti-flag-offset: -167;
}
.iti__om {
  --iti-flag-offset: -168;
}
.iti__pa {
  --iti-flag-offset: -169;
}
.iti__pe {
  --iti-flag-offset: -170;
}
.iti__pf {
  --iti-flag-offset: -171;
}
.iti__pg {
  --iti-flag-offset: -172;
}
.iti__ph {
  --iti-flag-offset: -173;
}
.iti__pk {
  --iti-flag-offset: -174;
}
.iti__pl {
  --iti-flag-offset: -175;
}
.iti__pm {
  --iti-flag-offset: -176;
}
.iti__pr {
  --iti-flag-offset: -177;
}
.iti__ps {
  --iti-flag-offset: -178;
}
.iti__pt {
  --iti-flag-offset: -179;
}
.iti__pw {
  --iti-flag-offset: -180;
}
.iti__py {
  --iti-flag-offset: -181;
}
.iti__qa {
  --iti-flag-offset: -182;
}
.iti__re {
  --iti-flag-offset: -183;
}
.iti__ro {
  --iti-flag-offset: -184;
}
.iti__rs {
  --iti-flag-offset: -185;
}
.iti__ru {
  --iti-flag-offset: -186;
}
.iti__rw {
  --iti-flag-offset: -187;
}
.iti__sa {
  --iti-flag-offset: -188;
}
.iti__sb {
  --iti-flag-offset: -189;
}
.iti__sc {
  --iti-flag-offset: -190;
}
.iti__sd {
  --iti-flag-offset: -191;
}
.iti__se {
  --iti-flag-offset: -192;
}
.iti__sg {
  --iti-flag-offset: -193;
}
.iti__sh {
  --iti-flag-offset: -194;
}
.iti__si {
  --iti-flag-offset: -195;
}
.iti__sj {
  --iti-flag-offset: -196;
}
.iti__sk {
  --iti-flag-offset: -197;
}
.iti__sl {
  --iti-flag-offset: -198;
}
.iti__sm {
  --iti-flag-offset: -199;
}
.iti__sn {
  --iti-flag-offset: -200;
}
.iti__so {
  --iti-flag-offset: -201;
}
.iti__sr {
  --iti-flag-offset: -202;
}
.iti__ss {
  --iti-flag-offset: -203;
}
.iti__st {
  --iti-flag-offset: -204;
}
.iti__sv {
  --iti-flag-offset: -205;
}
.iti__sx {
  --iti-flag-offset: -206;
}
.iti__sy {
  --iti-flag-offset: -207;
}
.iti__sz {
  --iti-flag-offset: -208;
}
.iti__tc {
  --iti-flag-offset: -209;
}
.iti__td {
  --iti-flag-offset: -210;
}
.iti__tg {
  --iti-flag-offset: -211;
}
.iti__th {
  --iti-flag-offset: -212;
}
.iti__tj {
  --iti-flag-offset: -213;
}
.iti__tk {
  --iti-flag-offset: -214;
}
.iti__tl {
  --iti-flag-offset: -215;
}
.iti__tm {
  --iti-flag-offset: -216;
}
.iti__tn {
  --iti-flag-offset: -217;
}
.iti__to {
  --iti-flag-offset: -218;
}
.iti__tr {
  --iti-flag-offset: -219;
}
.iti__tt {
  --iti-flag-offset: -220;
}
.iti__tv {
  --iti-flag-offset: -221;
}
.iti__tw {
  --iti-flag-offset: -222;
}
.iti__tz {
  --iti-flag-offset: -223;
}
.iti__ua {
  --iti-flag-offset: -224;
}
.iti__ug {
  --iti-flag-offset: -225;
}
.iti__us {
  --iti-flag-offset: -226;
}
.iti__uy {
  --iti-flag-offset: -227;
}
.iti__uz {
  --iti-flag-offset: -228;
}
.iti__va {
  --iti-flag-offset: -229;
}
.iti__vc {
  --iti-flag-offset: -230;
}
.iti__ve {
  --iti-flag-offset: -231;
}
.iti__vg {
  --iti-flag-offset: -232;
}
.iti__vi {
  --iti-flag-offset: -233;
}
.iti__vn {
  --iti-flag-offset: -234;
}
.iti__vu {
  --iti-flag-offset: -235;
}
.iti__wf {
  --iti-flag-offset: -236;
}
.iti__ws {
  --iti-flag-offset: -237;
}
.iti__xk {
  --iti-flag-offset: -238;
}
.iti__ye {
  --iti-flag-offset: -239;
}
.iti__yt {
  --iti-flag-offset: -240;
}
.iti__za {
  --iti-flag-offset: -241;
}
.iti__zm {
  --iti-flag-offset: -242;
}
.iti__zw {
  --iti-flag-offset: -243;
}

/* packages/core/src/css/intlTelInput.css */
:root {
  --iti-hover-color: rgba(0, 0, 0, 0.05);
  --iti-border-color: #ccc;
  --iti-country-selector-bg: white;
  --iti-icon-color: #555;
  --iti-spacer-horizontal: 10px;
  --iti-flag-height: calc(var(--iti-flag-width) * 3 / 4);
  --iti-globe-icon-size: 17px;
  --iti-clear-icon-size: 15px;
  --iti-close-icon-size: 20px;
  --iti-border-width: 1px;
  --iti-arrow-size: 5px;
  --iti-arrow-width: 1.5px;
  --iti-arrow-padding: 7px;
  --iti-mobile-popup-margin: 44px;
  --iti-strict-reject-flash-color: rgba(255, 0, 0, 0.12);
}
.iti {
  position: relative;
  display: inline-block;
}
.iti * {
  box-sizing: border-box;
}
.iti input.iti__tel-input,
.iti input.iti__tel-input[type=text],
.iti input.iti__tel-input[type=tel] {
  position: relative;
  z-index: 0;
  display: block;
  min-width: 100%;
  margin: 0 !important;
}
.iti__a11y-text {
  width: 1px;
  height: 1px;
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  position: absolute;
}
.iti__country-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  padding: var(--iti-border-width);
}
.iti__selected-country {
  z-index: 1;
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border-radius: 0;
  font-weight: inherit;
  line-height: inherit;
  text-decoration: none;
}
.iti__selected-country-primary {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--iti-arrow-padding) 0 var(--iti-spacer-horizontal);
}
.iti__selected-dial-code {
  margin-left: 4px;
}
.iti__arrow {
  margin-left: var(--iti-arrow-padding);
  margin-top: -2px;
  width: var(--iti-arrow-size);
  height: var(--iti-arrow-size);
  box-sizing: border-box;
  border-right: var(--iti-arrow-width) solid var(--iti-icon-color);
  border-bottom: var(--iti-arrow-width) solid var(--iti-icon-color);
  transform: rotate(45deg);
}
.iti__arrow--up {
  margin-top: 4px;
  transform: rotate(-135deg);
}
.iti__country-selector {
  border-radius: 3px;
  background-color: var(--iti-country-selector-bg);
}
.iti--inline-country-selector .iti__country-selector {
  border: var(--iti-border-width) solid var(--iti-border-color);
  box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
}
.iti--inline-country-selector:not(.iti--detached-country-selector) .iti__country-selector {
  position: absolute;
  z-index: 2;
  left: 0;
}
.iti__search-input {
  width: 100%;
  border-width: 0;
  border-radius: 3px;
  padding-left: calc(var(--iti-spacer-horizontal) + var(--iti-globe-icon-size) + var(--iti-spacer-horizontal));
  padding-right: calc(var(--iti-spacer-horizontal) + var(--iti-clear-icon-size) + var(--iti-spacer-horizontal));
}
[dir=rtl] .iti__search-input {
  padding-left: inherit;
  padding-right: 30px;
  background-position: right 8px center;
}
.iti__search-input::-webkit-search-cancel-button {
  appearance: none;
}
.iti__search-input,
.iti__country {
  padding-top: 8px;
  padding-bottom: 8px;
}
.iti__search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--iti-border-color);
}
.iti__search-icon {
  position: absolute;
  left: var(--iti-spacer-horizontal);
  display: flex;
  pointer-events: none;
}
[dir=rtl] .iti__search-icon {
  left: auto;
  right: var(--iti-spacer-horizontal);
}
.iti__search-icon-svg {
  width: var(--iti-globe-icon-size);
  height: var(--iti-globe-icon-size);
  display: block;
  stroke: var(--iti-icon-color);
  fill: none;
  stroke-width: 3;
}
.iti__search-clear {
  position: absolute;
  right: calc(var(--iti-spacer-horizontal) / 2);
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  padding: calc(var(--iti-spacer-horizontal) / 2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
}
.iti__search-clear .iti__search-clear-x {
  stroke-width: 2;
}
.iti__search-clear .iti__search-clear-bg {
  fill: var(--iti-icon-color);
}
[dir=rtl] .iti__search-clear {
  right: auto;
  left: var(--iti-spacer-horizontal);
}
.iti__search-clear:hover,
.iti__search-clear:focus-visible {
  background: var(--iti-hover-color);
  outline: none;
}
.iti__search-clear-svg {
  width: var(--iti-clear-icon-size);
  height: var(--iti-clear-icon-size);
  display: block;
}
.iti__no-results {
  text-align: center;
  padding: 30px 0;
}
.iti__country-list {
  list-style: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  outline: none;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
}
.iti--inline-country-selector .iti__country-list {
  max-height: 185px;
}
.iti--flexible-dropdown-width .iti__country-list {
  white-space: nowrap;
}
@media (max-width: 500px) {
  .iti--flexible-dropdown-width .iti__country-list {
    white-space: normal;
  }
}
.iti__country {
  display: flex;
  align-items: center;
  padding-left: var(--iti-spacer-horizontal);
  padding-right: var(--iti-spacer-horizontal);
}
.iti__country.iti__highlight {
  background-color: var(--iti-hover-color);
}
.iti__country-name {
  flex-grow: 1;
}
.iti__country-check {
  margin-left: var(--iti-spacer-horizontal);
  display: flex;
  align-items: center;
  color: var(--iti-icon-color);
}
.iti__country-check-svg {
  width: var(--iti-clear-icon-size);
  height: var(--iti-clear-icon-size);
  display: block;
}
.iti__country-list .iti__flag {
  margin-right: var(--iti-spacer-horizontal);
  flex-shrink: 0;
}
[dir=rtl] :is(.iti__country-list .iti__flag) {
  margin-right: 0;
  margin-left: var(--iti-spacer-horizontal);
}
:is(.iti--has-country-selector .iti__country-container:has(+ input[disabled]), .iti--has-country-selector .iti__country-container:has(+ input[readonly])) button.iti__selected-country {
  cursor: not-allowed;
}
:is(.iti--has-country-selector .iti__country-container:has(+ input[disabled]), .iti--has-country-selector .iti__country-container:has(+ input[readonly])) button.iti__selected-country .iti__arrow {
  visibility: hidden;
}
.iti--has-country-selector .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country-primary:hover,
.iti--has-country-selector .iti__country-container:not(:has(+ input[disabled])):not(:has(+ input[readonly])) .iti__selected-country[aria-expanded=true] .iti__selected-country-primary {
  background-color: var(--iti-hover-color);
}
.iti--detached-country-selector {
  position: fixed;
  top: -1000px;
  left: -1000px;
  z-index: 1060;
}
.iti--detached-country-selector:hover {
  cursor: pointer;
}
.iti--detached-country-selector {
  top: calc(anchor(bottom) + 3px);
  left: anchor(left);
  position-try-fallbacks: --iti-flip-above;
}
@position-try --iti-flip-above {
  top: auto;
  bottom: calc(anchor(top) + 3px);
}
.iti__hide {
  display: none;
}
.iti__v-hide {
  visibility: hidden;
}
.iti--fullscreen-popup.iti--detached-country-selector {
  background-color: rgba(0, 0, 0, 0.5);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  position: fixed;
  padding: var(--iti-mobile-popup-margin);
  padding-bottom: calc(var(--iti-mobile-popup-margin) + var(--iti-virtual-keyboard-height, 0px));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.iti--fullscreen-popup .iti__country-selector {
  display: flex;
  flex-direction: column;
  max-height: 100%;
  position: relative;
}
.iti--fullscreen-popup .iti__close-button {
  position: absolute;
  bottom: 100%;
  right: calc(-1 * var(--iti-mobile-popup-margin));
  width: var(--iti-mobile-popup-margin);
  height: var(--iti-mobile-popup-margin);
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
[dir=rtl] :is(.iti--fullscreen-popup .iti__close-button) {
  right: auto;
  left: calc(-1 * var(--iti-mobile-popup-margin));
}
.iti--fullscreen-popup .iti__close-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}
.iti--fullscreen-popup .iti__close-button-svg {
  width: var(--iti-close-icon-size);
  height: var(--iti-close-icon-size);
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}
.iti--fullscreen-popup .iti__country,
.iti--fullscreen-popup .iti__search-input {
  padding-top: 10px;
  padding-bottom: 10px;
}
.iti--fullscreen-popup .iti__search-input {
  font-size: max(16px, 1em);
}
.iti--fullscreen-popup .iti__country {
  padding-left: 10px;
  padding-right: 10px;
  line-height: 1.5em;
}
.iti__flag {
  height: var(--iti-flag-height);
  width: var(--iti-flag-width);
  border-radius: 1px;
  box-shadow: 0px 0px 1px 0px #888;
  background-image: image-set(var(--iti-path-flags-1x) 1x, var(--iti-path-flags-2x) 2x);
  background-repeat: no-repeat;
  background-position: calc(var(--iti-flag-offset, 100) * var(--iti-flag-width)) 0;
  background-size: calc(var(--iti-flag-count) * var(--iti-flag-width)) var(--iti-flag-height);
}
.iti__loading {
  position: relative;
  background: none;
  box-shadow: none;
}
.iti__loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: var(--iti-flag-height);
  height: var(--iti-flag-height);
  box-sizing: border-box;
  border: 2px solid var(--iti-icon-color);
  border-right-color: transparent;
  border-radius: 50%;
  animation: iti-spinner 1s linear infinite;
}
@keyframes iti-spinner {
  to {
    transform: rotate(360deg);
  }
}
.iti__strict-reject-animation .iti__tel-input,
.iti__strict-reject-animation .iti__selected-country {
  animation: iti-strict-reject-shake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@media (prefers-reduced-motion: reduce) {
  .iti__strict-reject-animation .iti__tel-input {
    animation: iti-strict-reject-flash 0.3s ease-out both;
  }
  .iti__strict-reject-animation .iti__selected-country {
    animation: none;
  }
}
@keyframes iti-strict-reject-shake {
  10%, 90% {
    transform: translateX(-1px);
  }
  20%, 80% {
    transform: translateX(2px);
  }
  30%, 50%, 70% {
    transform: translateX(-3px);
  }
  40%, 60% {
    transform: translateX(3px);
  }
}
@keyframes iti-strict-reject-flash {
  40% {
    background-color: var(--iti-strict-reject-flash-color);
  }
}
.iti__globe {
  background: none;
  box-shadow: none;
  height: var(--iti-globe-icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.iti__globe .iti__globe-svg {
  width: 100%;
  height: 100%;
  fill: var(--iti-icon-color);
}
@supports (-webkit-appearance: none) and (not (background: -webkit-canvas(foo))) {
  .iti__tel-input:focus {
    outline-offset: 1px;
  }
}

/* packages/core/src/css/intlTelInputWithAssets.css */
:root {
  --iti-path-flags-1x: url(img/flags.webp?v=1.6.2);
  --iti-path-flags-2x: url(img/flags@2x.webp?v=1.6.2);
}

/*
 * Main Quest HQ styles. Tokens come from tokens.css, built on the CBN Ventures brand
 * (apps/cbnventures/src/styles/global.css): purple and yellow, Unbounded headings, Plus
 * Jakarta Sans body text, Space Grotesk labels, rounded tiles and pill buttons that sit on
 * a solid "pop" under-shadow.
 */

/* ---------- Fonts (self-hosted, the same files cbnventures.io uses) ---------- */
@font-face { font-family: "Unbounded"; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/fonts/unbounded-latin-700-normal.woff2?v=1.6.2") 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: "Unbounded"; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/fonts/unbounded-latin-ext-700-normal.woff2?v=1.6.2") 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: "Unbounded"; font-style: normal; font-display: swap; font-weight: 800; src: url("/assets/fonts/unbounded-latin-800-normal.woff2?v=1.6.2") 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: "Unbounded"; font-style: normal; font-display: swap; font-weight: 800; src: url("/assets/fonts/unbounded-latin-ext-800-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/fonts/plus-jakarta-sans-latin-400-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 400; src: url("/assets/fonts/plus-jakarta-sans-latin-ext-400-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/fonts/plus-jakarta-sans-latin-500-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/fonts/plus-jakarta-sans-latin-ext-500-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 600; src: url("/assets/fonts/plus-jakarta-sans-latin-600-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 600; src: url("/assets/fonts/plus-jakarta-sans-latin-ext-600-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/fonts/plus-jakarta-sans-latin-700-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/fonts/plus-jakarta-sans-latin-ext-700-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 800; src: url("/assets/fonts/plus-jakarta-sans-latin-800-normal.woff2?v=1.6.2") 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: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 800; src: url("/assets/fonts/plus-jakarta-sans-latin-ext-800-normal.woff2?v=1.6.2") 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: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/fonts/space-grotesk-latin-500-normal.woff2?v=1.6.2") 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: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 500; src: url("/assets/fonts/space-grotesk-latin-ext-500-normal.woff2?v=1.6.2") 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: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 600; src: url("/assets/fonts/space-grotesk-latin-600-normal.woff2?v=1.6.2") 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: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 600; src: url("/assets/fonts/space-grotesk-latin-ext-600-normal.woff2?v=1.6.2") 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: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/fonts/space-grotesk-latin-700-normal.woff2?v=1.6.2") 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: "Space Grotesk"; font-style: normal; font-display: swap; font-weight: 700; src: url("/assets/fonts/space-grotesk-latin-ext-700-normal.woff2?v=1.6.2") 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; }

/* ---------- Base ---------- */
:root {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237850ed' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9a6f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b9a6f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  overflow-x: clip;
}
img, svg { max-width: 100%; height: auto; display: block; }
/* Tables set their lines at the font's own spacing, tighter than body text: every list was
   laid out that way while the pages ran in quirks mode, which gives tables that spacing. */
table { line-height: normal; }
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: var(--lh-tight);
  margin: 0 0 var(--s-4);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-size: clamp(1.875rem, 1.6vw + 1.3rem, 2.5rem); font-weight: 800; }
h2 { font-size: var(--fs-h4); font-weight: 700; }
h3 { font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
p { margin: 0 0 var(--s-4); }
strong { color: var(--ink); }
a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 3px; border-radius: 2px; }
code, .mono { font-family: var(--font-mono); font-size: 0.9375em; }
code { background: var(--paper-2); padding: 1px 5px; border-radius: 3px; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }

/* Text then a button: the cbnventures.io hero keeps 24px between its copy and its call to
   action. Paragraphs end with a 12px margin and HQ's grid sections use a 12px gap, so a
   button (or row of them) right after text adds 12px to reach the same 24px. */
:is(p, .hint, .field__hint, .lead, .flash, .muted) + :is(.btn, .form-actions, .section__actions, .login__actions, .button-row) { margin-top: var(--s-3); }

/* A staging or demo copy: a band in the cbnventures.io dark surface above every page, with
   the copy's name on a glass label (the site's eyebrow, yellow pip and all) and a ghost
   pill that opens What's this?. Staging sits on the dark
   purple so the two copies never look alike; production has no band. */
.environment-bar {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px;
  padding: 8px var(--gutter); background: #13111c; color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-label); font-size: 0.8125rem; line-height: 1.3;
}
.environment-bar--staging { background: #5438a5; border-bottom-color: rgba(255, 255, 255, 0.18); }
.environment-bar__tag {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--radius-pill);
}
.environment-bar__pip { width: 7px; height: 7px; flex: none; background: #ffe500; border-radius: var(--radius-pill); }
.environment-bar__help {
  padding: 3px 12px; font: 700 0.75rem/1.4 var(--font-label); color: #fff; cursor: pointer;
  background: transparent; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: var(--radius-pill);
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.environment-bar__help:hover { background: #ffe500; border-color: #ffe500; color: #1a1a1a; }
.environment-bar__help:focus-visible { outline: 2px solid #ffe500; outline-offset: 2px; }
/* The bar scrolls away with the page, as on the website. Signed in, the header drops its
   6px top band, so the bar sits straight on the header with no line between them. */
.has-environment .app { --header-h: 73px; }
/* The sign-in and PDF pages' green top stripe gives way to the bar, as on the website. */
.has-environment .login, .has-environment .pdf-loading { border-top: 0; }
.has-environment .app-header { border-top: 0; }
.has-environment .app-header::before { display: none; }
/* What's this?: the window over the page that tells demo, staging and production apart. */
.check-dialog.environment-help { width: min(50rem, calc(100% - 2 * var(--s-4))); margin: auto; }
.environment-help::backdrop { background: rgb(20 17 15 / 55%); }
.environment-help__scroll { overflow-x: auto; margin-top: var(--s-3); }
.environment-help__table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.environment-help__sites { display: grid; gap: var(--s-1); min-width: 0; }
.environment-help__site { display: block; overflow-wrap: normal; word-break: keep-all; }
.environment-help__table th, .environment-help__table td { padding: var(--s-2) var(--s-3) var(--s-2) 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.environment-help__table thead th { color: var(--ink); border-bottom-color: var(--rule-strong); white-space: nowrap; }
.environment-help__table tbody th { font-weight: 700; color: var(--ink); }
.environment-help__table a { color: var(--accent-ink); }
/* A check for the real service, a cross for a stand-in and a dash for off, each with its
   note beside it, such as Test mode. */
.environment-mark { display: inline-flex; align-items: center; gap: 6px; }
.environment-mark__icon { flex: none; width: 18px; height: 18px; stroke-width: 2.5; }
.environment-mark--yes .environment-mark__icon { color: var(--tone-green-ink); }
.environment-mark--no .environment-mark__icon { color: var(--tone-red-ink); }
.environment-mark--off .environment-mark__icon { color: var(--muted); }
.environment-help__legend li { display: inline-flex; align-items: center; gap: 6px; }
.environment-help__legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: var(--s-3) 0 0; padding: 0; list-style: none; color: var(--muted); }
/* On a phone each service is a block of its own, with each copy's answer labelled, so the
   table needs no sideways scroll. */
@media (max-width: 559px) {
  .environment-help__table thead { display: none; }
  .environment-help__table tr { display: grid; gap: 2px; padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); }
  .environment-help__table th, .environment-help__table td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-2); padding: 0; border: 0; }
  .environment-help__table tbody th { display: block; }
  .environment-help__table td::before { content: attr(data-label); color: var(--muted); }
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--green-900); color: #fff; padding: 12px 16px; font-weight: 700;
}
.skip-link:focus { top: 8px; }

/* The gutter comes from the width, so a component's own padding can never remove it. */
.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-ink-soft);
  margin: 0 0 var(--s-2);
}

/* ---------- Buttons (CBN pill buttons on a pop under-shadow) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 10px 24px;
  font-family: var(--font-label); font-size: 1rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1.2;
  border-radius: var(--radius-pill); border: 2px solid transparent;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: transform 250ms var(--ease-pop), box-shadow 250ms var(--ease-pop), background-color 150ms ease-out;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--action { background: var(--orange-500); color: #1a1a1a; box-shadow: var(--shadow-pop); }
.btn--action:hover { box-shadow: var(--shadow-pop-hover); }
.btn--primary { background: var(--green-800); color: #fff; box-shadow: var(--shadow-pop-purple); }
.btn--primary:hover { background: var(--green-900); box-shadow: var(--shadow-pop-purple-hover); }
/* Destructive confirm (data-confirm-tone="danger"): a fixed red pill, white text 6.6:1 in
   both themes. */
.btn--danger { background: #b42318; color: #fff; box-shadow: 0 6px 0 rgba(120, 20, 15, 0.35); }
.btn--danger:hover { background: #912018; }
.btn--outline { background: transparent; color: var(--accent-ink); border-color: var(--accent-line); }
.btn--outline:hover { background: var(--green-100); }
.btn--quiet { min-height: 40px; padding: 6px 16px; font-size: 0.9375rem; background: transparent; color: var(--accent-ink); border-color: var(--rule-strong); }
.btn--quiet:hover { border-color: var(--accent-line); background: var(--green-100); transform: none; }
/* An icon-only button: a square as tall as the other buttons. Its tooltip shows the same
   words as its aria-label on hover and keyboard focus, and opens rightward from its left
   edge so it never runs off a phone screen. It only exists while shown, so a hidden one
   never widens a scrolling table; in a table it opens leftward to stay inside it. */
.btn--icon { position: relative; width: var(--tap); padding: 0; }
.btn--icon svg { width: 20px; height: 20px; }
.btn--icon::after {
  content: none; position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5;
  padding: 6px 10px; border-radius: var(--radius); background: var(--ink); color: var(--paper);
  font-size: 0.875rem; font-weight: 700; line-height: 1.3; white-space: nowrap;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 120ms ease-out;
}
.btn--icon:hover::after, .btn--icon:focus-visible::after { content: attr(aria-label); opacity: 1; visibility: visible; }
.data .btn--icon::after { left: auto; right: 0; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; cursor: pointer; }
.link-button:hover { text-decoration-thickness: 3px; }

/* ---------- App shell ---------- */
/* The signed-in pages use the width of a wide screen, where lists and tables need it;
   forms and reading text keep narrower measures of their own. */
.app { --max: 1920px; --bar-h: 72px; --header-h: 79px; --rail-w: 96px; --tabbar-h: 61px; display: flex; flex-direction: column; min-height: 100vh; }
.app-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--sheet);
  border-bottom: 3px solid var(--green-800);
}
.app-header__bar { display: flex; align-items: center; gap: var(--s-5); height: var(--bar-h); padding-inline: var(--gutter); }
.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; flex: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
/* The CBN star in yellow on a purple tile, as cbnventures.io shows it. */
.brand__mark {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 7px;
  background: var(--green-800); border-radius: var(--radius); box-shadow: 0 4px 0 rgba(60, 38, 130, 0.35);
}
.brand__mark img { width: 100%; height: 100%; }
.brand__name { display: flex; align-items: baseline; gap: var(--s-2); line-height: 1.1; white-space: nowrap; }
.brand__app { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; color: var(--heading); }
.brand__company { font-family: var(--font-label); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-ink-soft); }
.brand__company::before { content: "·"; margin-right: var(--s-2); color: var(--muted); }
/* Quick find: a search box between the logo and the bell. Ctrl K (⌘K on a Mac) puts the
   cursor in it, and the key sits inside the box's right end as a reminder. */
.quick-find { position: relative; flex: 0 1 32rem; min-width: 14rem; margin: 0 auto; }
.quick-find__icon { position: absolute; top: 50%; left: 12px; width: 20px; height: 20px; margin-top: -10px; color: var(--muted); pointer-events: none; }
.quick-find__box {
  width: 100%; min-height: 44px; padding: 0 76px 0 42px; font: 400 1rem var(--font-body); color: var(--ink);
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); appearance: none;
}
.quick-find__box::placeholder { color: var(--placeholder); opacity: 1; }
.quick-find__box:focus-visible { border-color: var(--accent-line); }
.quick-find__key {
  position: absolute; top: 50%; right: 10px; transform: translateY(-50%); padding: 2px 6px;
  font: 600 0.75rem var(--font-mono); color: var(--muted); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius);
}
/* Once something is typed, the key gives way to the browser's clear button, which takes
   the key's place at the box's right end. */
.quick-find__box:not(:placeholder-shown) { padding-right: 12px; }
.quick-find__box:not(:placeholder-shown) + .quick-find__key { display: none; }
/* Live matches under a quick find box (the header's, or the quick find page's on a phone):
   a few rows per kind under the kind's name, then a row that opens every result. */
.find-suggest { position: relative; }
.search-form__row .find-suggest { flex: 1; min-width: 0; }
.search-form__row .find-suggest input { width: 100%; }
.find-suggest__list {
  position: absolute; z-index: 45; top: calc(100% + 4px); left: 0; right: 0; max-height: min(70vh, 32rem); overflow-y: auto;
  padding: 4px 0; background: var(--sheet); border: 2px solid var(--accent-line); border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--panel-shadow); text-align: left;
}
.find-suggest__group + .find-suggest__group { border-top: 1px solid var(--rule); }
.find-suggest__kind {
  padding: var(--s-2) 12px 2px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
}
.find-suggest__option { display: grid; gap: 2px; min-height: 44px; padding: 8px 12px; cursor: pointer; overflow-wrap: anywhere; }
.find-suggest__option[aria-selected="true"], .find-suggest__option:hover { background: var(--green-100); }
.find-suggest__name { font-weight: 700; color: var(--ink); }
.find-suggest__detail { font-size: 0.875rem; color: var(--muted); }
.find-suggest__empty { padding: 10px 12px; color: var(--muted); }
.find-suggest__option--all { align-content: center; border-top: 1px solid var(--rule); }
.find-suggest__option--all .find-suggest__name { color: var(--accent-ink); }
/* Tablets: the logo drops its "HQ" tag and the box its key, so the whole hint in
   the box still shows beside the rail. */
@media (max-width: 899px) {
  .brand__company, .quick-find__key { display: none; }
  .quick-find__box { padding-right: 12px; }
}

/* The bell, the account and every section are <details> disclosures, so
   they open without JavaScript; app.ts closes them on Escape, on a click elsewhere, and
   when focus leaves them. */
.nav-menu { position: relative; }
/* Safari still lays out a closed menu's contents, which can push the page sideways. */
[data-nav-menu]:not([open]) > :not(summary) { display: none; }
.nav-menu__toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--s-3);
  color: var(--ink); font-weight: 700; cursor: pointer; list-style: none; border-radius: var(--radius);
}
.nav-menu__toggle::-webkit-details-marker { display: none; }
/* Hover tints the button like the side rail's links, with no line that would shift its contents. */
.nav-menu__toggle:hover, .nav-menu[open] > .nav-menu__toggle { background: var(--green-100); }
.nav-menu__toggle.is-current { color: var(--accent-ink); box-shadow: inset 0 -3px 0 var(--orange-600); }
.nav-menu__chevron { flex: none; width: 16px; height: 16px; transition: transform 0.15s; }
.nav-menu[open] .nav-menu__chevron { transform: rotate(180deg); }
/* Help, the bell and the account end the bar. On a phone a search button joins them,
   standing in for the quick find box. */
.app-tools { display: flex; flex: none; align-items: center; gap: var(--s-1); }
.app-tools__find { display: none; }
.app-tools__find-icon { width: 22px; height: 22px; }
.app-tools__help {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 var(--s-2);
  color: var(--ink); border-radius: var(--radius);
}
.app-tools__help:hover, .app-tools__help.is-current { background: var(--green-100); }
.app-tools__help-icon { flex: none; width: 22px; height: 22px; }

/* The section rail down the left: each section an icon with its name under it, staying in
   place while the page scrolls. Its column is drawn by the row behind it, so the column
   runs the page's full height while the rail itself is only as tall as its sections. A
   section opens a fly-out beside it, listing its groups and each page with a line on what
   it holds; on a computer it also opens when the mouse rests on it (app.ts). The
   list starts right at the header's line, so the first section's tint meets it, and stops
   1px short of the column's right border, so a tinted section leaves the border showing. */
.app-body { position: relative; display: flex; flex: 1; }
/* The notices and the page share the column beside the rail, so the rail and its
   fly-outs start right under the header and never cut through a notice. */
.app-column { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.app-body::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--rail-w); background: var(--sheet); border-right: 1px solid var(--rule); }
.app-rail {
  position: sticky; z-index: 30; top: var(--header-h); align-self: flex-start; flex: none;
  width: var(--rail-w); max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.app-rail__list { display: grid; gap: 2px; margin: 0; padding: 0 1px var(--s-2) 0; list-style: none; }
.app-rail__item--more { display: none; }
.app-rail__link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; padding: var(--s-2) var(--s-1);
  color: var(--ink); font: 700 0.8125rem/1.2 var(--font-body); text-align: center; text-decoration: none; list-style: none;
  border: 0 solid transparent; border-inline-width: 3px; cursor: pointer;
}
.app-rail__link::-webkit-details-marker { display: none; }
.app-rail__link { position: relative; }
.app-rail__badge--corner { position: absolute; top: 6px; left: calc(50% + 6px); }
.app-rail__badge--start { right: calc(50% + 6px); left: auto; }
.app-rail__link:hover { background: var(--green-100); text-decoration: none; }
.app-rail__link:focus-visible, .app-rail__page:focus-visible { outline-offset: -3px; }
.app-rail__link.is-current { color: var(--accent-ink); background: var(--green-100); border-left-color: var(--green-800); }
.app-rail__menu[open] > .app-rail__link { color: var(--accent-ink); background: var(--green-100); }
.app-rail__icon { flex: none; width: 24px; height: 24px; }
.app-rail__label { max-width: 100%; overflow-wrap: anywhere; }
/* The fly-out runs from the header's bottom edge down to the footer's top edge: app.ts sets
   --flyout-top and --flyout-bottom from where they are on screen. */
.app-rail__flyout {
  position: fixed; z-index: 45; top: var(--flyout-top, var(--header-h)); bottom: var(--flyout-bottom, 0px); left: var(--rail-w); width: 320px; overflow-y: auto; padding: var(--s-4) 0;
  background: var(--sheet); border-right: 1px solid var(--rule-strong); box-shadow: 12px 0 28px var(--panel-shadow);
}
.app-rail__title { margin: 0 0 var(--s-3); padding: 0 var(--s-5) var(--s-3); border-bottom: 1px solid var(--rule); font: 600 0.8125rem var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink-soft); }
.app-rail__group-title { margin: 0; padding: 0 var(--s-5) var(--s-2); font: 600 0.75rem var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.app-rail__pages { margin: 0; padding: 0; list-style: none; }
.app-rail__page { display: grid; gap: 2px; padding: 10px var(--s-5) 10px calc(var(--s-5) - 3px); color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.app-rail__page:hover { background: var(--green-100); text-decoration: none; }
.app-rail__page[aria-current="page"] { background: var(--green-100); border-left-color: var(--orange-600); }
.app-rail__name {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;

  font-weight: 700;
}
.app-rail__page[aria-current="page"] .app-rail__name { color: var(--accent-ink); }
.app-rail__detail { font-size: 0.875rem; line-height: 1.4; color: var(--muted); }
.app-rail__group + .app-rail__group, .app-rail__subgroup + .app-rail__subgroup { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--rule); }

/* The bell's panel lines up with the bell's right edge; on a phone it spans the bar. A new
   notification has an orange edge and "New" written out. */
.notice-menu__bell { flex: none; width: 22px; height: 22px; }
.app-rail__badge, .notice-menu__count {
  display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--orange-500); color: #14110f; font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; line-height: 1;
}
.notice-panel {
  position: absolute; z-index: 45; top: calc(100% + 6px); right: 0; width: 380px; max-height: 70vh; overflow-y: auto;
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--panel-shadow);
}
.notice-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--rule); }
.notice-panel__title { margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.notice-panel__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0 var(--s-3); }
.notice-panel__actions form { margin: 0; }
.notice-panel__actions .link-button, .notice-panel__all { display: inline-flex; align-items: center; min-height: var(--tap); font-size: 0.9375rem; }
.notice-panel__empty { margin: 0; padding: var(--s-4); font-size: 0.9375rem; color: var(--muted); }
.notice-list { margin: 0; padding: 0; list-style: none; }
.notice-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; min-width: 0; }
.notice-item + .notice-item { border-top: 1px solid var(--rule); }
.notice-item__link {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s-3); align-items: start; min-height: 0;
  padding: var(--s-3) var(--s-4); border-bottom: 0; border-left: 3px solid transparent; color: var(--ink); font-weight: 400; text-decoration: none;
}
a.notice-item__link:hover { background: var(--green-100); }
.notice-item--new .notice-item__link { border-left-color: var(--orange-600); }
.notice-item__dismiss-form, .notice-item__action-form { margin: 0; }
.notice-item__dismiss {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  background: none; border: 0; color: var(--muted); font: 700 1.125rem/1 var(--font-body); cursor: pointer;
}
.notice-item__dismiss:hover { background: var(--green-100); color: var(--accent-ink); }
.notice-item__dismiss-icon { width: 18px; height: 18px; }
/* On the notifications page, Dismiss and Restore sit in the middle of their row, however
   many lines the notification takes; the bell's × stays beside the first line. */
.notice-item__action-form { align-self: center; padding: var(--s-2) var(--s-3) var(--s-2) 0; }
.notice-item__action { min-height: var(--tap); padding: 6px 12px; font-size: 0.9375rem; }
.notice-item__icon { width: 20px; height: 20px; margin-top: 2px; color: var(--muted); }
.notice-item--alert .notice-item__icon { color: var(--tone-orange-ink); }
.notice-item--payment .notice-item__icon { color: var(--tone-green-ink); }
.notice-item__body { display: grid; gap: 2px; min-width: 0; }
.notice-item__text { font-size: 0.9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.notice-item__meta { display: flex; flex-wrap: wrap; gap: 0 var(--s-2); font-size: 0.8125rem; color: var(--muted); }
.notice-item__new { font-weight: 700; color: var(--accent-ink); }
.notice-item__resolved { font-weight: 700; color: var(--tone-green-ink); }
.notice-list--page { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }

/* The account: the person's initials in a green circle (and their name on a wide screen),
   opening who is signed in, the other language and Sign out. */
.account-menu__toggle { gap: var(--s-2); padding: 0 var(--s-2); }
.account-menu__avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--green-900); color: #fff; font-size: 0.875rem; font-weight: 700; line-height: 1;
}
.account-menu__name { display: none; max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1440px) { .account-menu__name { display: inline; } }
.account-panel {
  position: absolute; z-index: 45; top: calc(100% + 6px); right: 0; width: 300px;
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--panel-shadow);
}
.account-panel__who { display: grid; gap: 2px; margin: 0; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--rule); line-height: 1.35; }
.account-panel__label { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.account-panel__name { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.account-panel__email { font-size: 0.9375rem; color: var(--muted); overflow-wrap: anywhere; }
.account-panel__list { margin: 0; padding: var(--s-2) 0; list-style: none; }
.account-panel__list form { margin: 0; }
.account-panel__item {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-4);
  font: 700 1rem var(--font-body); color: var(--ink); text-align: left; text-decoration: none;
  background: none; border: 0; border-left: 3px solid transparent; cursor: pointer;
}
.account-panel__item:hover { background: var(--green-100); text-decoration: none; }
.account-panel__icon { flex: none; width: 20px; height: 20px; color: var(--muted); }

/* Mobile mode, at 1024px and below: a search button stands in for the quick find box, the
   rail becomes a tab bar along the bottom of the screen, and a section's pages open as a
   sheet above it. When a person can open more sections than five tabs hold, the fifth is
   More, holding the rest. */
@media (max-width: 1024px) {
  .app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  /* An opened calendar or list stops short of the fixed tab bar when it scrolls into view. */
  .date-picker__panel, .country-picker__panel { scroll-margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--s-3)); }
  .app--no-sections { padding-bottom: 0; }
  .quick-find { display: none; }
  .app-tools { margin-left: auto; }
  .app-tools__find {
    display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 var(--s-2);
    color: var(--ink); border-bottom: 3px solid transparent;
  }
  .app-tools__find:hover { border-bottom-color: var(--rule-strong); }
  .app-body::before { display: none; }
  .app-rail {
    position: fixed; z-index: 35; top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: none; overflow: visible;
    padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--sheet); border-top: 1px solid var(--rule);
  }
  .app-rail__list { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; padding: 0; }
  .app-rail__item--home { display: none; }
  .app--no-sections .app-rail { display: none; }
  .app-rail__item--overflow { display: none; }
  .app-rail__item--more { display: block; }
  .app-rail__link { min-height: 60px; padding: 6px 2px; font-size: 0.75rem; border-width: 3px 0; }
  .app-rail__link.is-current { border-top-color: var(--orange-600); }
  .app-rail__flyout {
    /* A full sheet from the header to the tab bar, so its top edge never cuts through a notice. */
    top: var(--header-h); right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); left: 0; width: auto;
    max-height: none;
    border-right: 0; box-shadow: 0 -10px 28px var(--panel-shadow);
  }
  .app-rail__title, .app-rail__group-title, .app-rail__page { padding-inline: var(--gutter); }
  .app-rail__page { padding-left: calc(var(--gutter) - 3px); }
  .settings-form[data-dirty] .settings-form__actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--s-3)); }
}
/* Phones: the logo, the search button, the bell and the initials share one row, so the logo
   is a step smaller and the account drops its arrow. The bell's and the account's panels
   span the bar. */
@media (max-width: 559px) {
  .app-header__bar { position: relative; column-gap: var(--s-2); }
  .brand__mark { width: 40px; height: 40px; }
  .app-tools { gap: 0; }
  .notice-menu__toggle { padding: 0 var(--s-2); }
  .account-menu__toggle { padding: 0 0 0 var(--s-1); }
  .account-menu__toggle .nav-menu__chevron { display: none; }
  .notice-menu, .account-menu { position: static; }
  .notice-panel, .account-panel { left: 0; right: 0; width: auto; }
}
/* The smallest phones (320px): the tab names are a step smaller and use the tab's whole
   width, so "Newsletters" stays on one line. */
@media (max-width: 359px) {
  .app-rail__link { padding-inline: 0; font-size: 0.6875rem; }
  .app-tools__find, .app-tools__help { min-width: 40px; padding: 0; }
  .notice-menu__toggle { gap: 4px; padding: 0 var(--s-1); }
}

.env-banner { background: var(--tone-yellow-bg); color: var(--tone-yellow-ink); border-bottom: 1px solid var(--tone-yellow-line); font-size: 0.9375rem; font-weight: 600; }
.env-banner .wrap { padding-block: var(--s-2); }
/* The banners' content lines up with the page: same left edge, same 1920px cap. */
.env-banner .wrap, .alert-banner__bar.wrap { margin-inline: var(--gutter) auto; }

/* A disputed payment that is not closed: on every page, above the notes, until it closes. */
.alert-banner { background: var(--error-bg); color: var(--error-ink); border-bottom: 1px solid var(--tone-red-line); font-size: 0.9375rem; font-weight: 600; }
/* While the client's bank reviews it, nothing is asked of CBN Ventures: the quiet blue tone. */
.alert-banner--info { background: var(--tone-blue-bg); color: var(--tone-blue-ink); border-bottom-color: var(--tone-blue-line); }
.alert-banner__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 var(--s-4); padding-block: var(--s-1); }
.alert-banner__text { margin: 0; padding-block: var(--s-1); }
.alert-banner__link { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.app-main { flex: 1; min-width: 0; padding-block: var(--s-6) var(--s-8); }
/* Pages start at the left, beside the rail, at every width: the breadcrumb and the page
   share one left edge, and a capped page (a form, a settings page) ends early on the right
   instead of floating in the middle. */
.app-main > .wrap { margin-inline: var(--gutter) auto; }
.app-main:focus { outline: none; }

.app-footer { border-top: 1px solid var(--rule); background: var(--sheet); color: var(--muted); font-size: 0.9375rem; }
/* The footer's content runs the whole footer, edge to edge inside the gutters. */
.app-footer__bar.wrap { width: auto; margin-inline: var(--gutter); }
.app-footer__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-3); min-height: 56px; padding-block: var(--s-2); }
.app-footer__about { margin: 0; }
/* Appearance: one small button showing the choice in force (Auto, Light or Dark), opening
   the three upward, each with a line on what it does. The choice is marked like the current
   page in the rail: a tint, an orange edge and a tick. */
.appearance { position: relative; flex: none; }
.appearance__toggle {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 36px; padding: 0 10px 0 var(--s-3);
  font: 600 0.9375rem/1 var(--font-body); color: var(--accent-ink); cursor: pointer; list-style: none;
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
.appearance__toggle::-webkit-details-marker { display: none; }
.appearance__toggle:hover, .appearance[open] > .appearance__toggle { background: var(--green-100); }
.appearance__now { display: none; }
.appearance[data-current="auto"] .appearance__now--auto,
.appearance[data-current="light"] .appearance__now--light,
.appearance[data-current="dark"] .appearance__now--dark { display: inline; }
.appearance__prefix { margin-inline-end: 0.25em; }
:lang(zh) .appearance__prefix { margin-inline-end: 0; }
.appearance__icon { flex: none; width: 18px; height: 18px; }
.appearance__chevron { flex: none; width: 16px; height: 16px; transition: transform 0.15s; }
.appearance[open] .appearance__chevron { transform: rotate(180deg); }
.appearance__panel {
  position: absolute; z-index: 45; right: 0; bottom: calc(100% + var(--s-2)); width: 280px; padding: var(--s-2) 0;
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--panel-shadow);
}
.appearance__title { margin: 0; padding: var(--s-1) var(--s-4) var(--s-2); font: 600 0.75rem/1.6 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.appearance__option {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 48px; margin: 0; padding: var(--s-1) var(--s-4) var(--s-1) calc(var(--s-4) - 3px);
  font: 700 1rem/1.3 var(--font-body); color: var(--ink); text-align: left; cursor: pointer;
  background: none; border: 0; border-left: 3px solid transparent;
}
.appearance__option:hover { background: var(--green-100); }
.appearance__option:focus-visible { outline-offset: -3px; }
.appearance__option[aria-pressed="true"] { background: var(--green-100); border-left-color: var(--orange-600); }
.appearance__option .appearance__icon { width: 20px; height: 20px; color: var(--muted); }
.appearance__option[aria-pressed="true"] .appearance__icon { color: var(--accent-ink); }
.appearance__text { display: grid; flex: 1; min-width: 0; }
.appearance__detail { font-size: 0.875rem; font-weight: 400; color: var(--muted); }
.appearance__check { flex: none; width: 18px; height: 18px; color: var(--accent-ink); visibility: hidden; }
.appearance__option[aria-pressed="true"] .appearance__check { visibility: visible; }
/* Mobile mode: a 44-pixel button. Phones: the version line takes two short lines beside
   it, and the button shows only the choice; "Appearance:" stays for screen readers. */
@media (max-width: 1024px) {
  .appearance__toggle { min-height: 44px; }
}
@media (max-width: 559px) {
  .app-footer__bar { flex-wrap: nowrap; }
  .app-footer__about { display: flex; flex-direction: column; min-width: 0; line-height: 1.4; }
  .app-footer__dot { display: none; }
  .appearance__prefix { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
}

/* ---------- Page head, flash, stats ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-6); margin-bottom: var(--s-6); }
.page-head__text { flex: 1 1 32rem; min-width: 0; }
.page-head__text > :last-child { margin-bottom: 0; }
.page-head h1 { margin-bottom: var(--s-3); overflow-wrap: anywhere; }
.page-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-3); }
.page-head__title h1 { margin-bottom: 0; }
.page-head__lead { color: var(--ink); font-size: 1.0625rem; }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.page-head__actions form { margin: 0; }
/* A quiet button in the page's head, such as a location's Delete, matches the buttons beside it. */
.page-head__actions .btn--quiet { min-height: var(--tap); padding: 10px 22px; font-size: 1.0625rem; }
/* A form message's Actions menu: one button that opens Mark as unread, Mark as qualified
   lead, Block sender and Delete, in the account menu's panel style. */
.actions-menu__toggle { gap: 6px; list-style: none; }
.actions-menu__toggle::-webkit-details-marker { display: none; }
.actions-panel { width: 260px; }
.actions-panel__item--danger, .actions-panel__item--danger .account-panel__icon { color: var(--error-ink); }
@media (max-width: 559px) {
  .actions-panel { left: 0; right: auto; }
}
/* A detail page's place in the list it was opened from: Previous, "12 of 46" and Next,
   two same-size buttons at the right of the page head. On a phone the row takes its own
   line with the count between, and narrow phones keep only the arrows. */
.list-steps { display: flex; flex: none; align-items: center; gap: var(--s-2); }
.list-steps__link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 8rem; min-height: var(--tap); padding: 0 12px;
  border: 2px solid var(--accent-line); border-radius: var(--radius);
  color: var(--accent-ink); font-size: 1rem; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap;
}
a.list-steps__link:hover { background: var(--green-100); text-decoration: none; }
.list-steps__link[aria-disabled="true"] { border-color: var(--rule); color: var(--muted); cursor: default; }
.list-steps__icon { flex: none; width: 18px; height: 18px; }
.list-steps__count { min-width: 4.5rem; color: var(--muted); font-size: 0.9375rem; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 559px) {
  .list-steps { flex: 1 1 100%; justify-content: space-between; }
}
@media (max-width: 479px) {
  .list-steps__link { min-width: var(--tap); padding: 0; }
  .list-steps__label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .list-steps__icon { width: 20px; height: 20px; }
}
/* The Lost reason dialog's form on the pipeline board. */
.move-form { display: grid; gap: var(--s-3); margin: 0; }
.crumbs { margin: 0 0 var(--s-3); font-size: 0.9375rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; list-style: none; }
.crumbs li { min-width: 0; overflow-wrap: anywhere; }
.crumbs li + li::before { content: " / "; white-space: pre; }
/* On a small phone a long trail keeps only Home and the page above this one. */
@media (max-width: 480px) {
  .crumbs--short li:not(:first-child):not(.crumbs__parent) { display: none; }
}
/* The home icon sits on the same left edge as the eyebrow and title, with the separator's
   own spacing after it; its tap area reaches out around it without moving it. */
.crumbs__home { position: relative; display: inline-flex; align-items: center; vertical-align: middle; }
.crumbs__home::after { content: ""; position: absolute; inset: -14px -8px; }
.crumbs__home-icon { flex: 0 0 auto; width: 1rem; height: 1rem; transform: translateY(-1px); }
:lang(zh) .crumbs__home-icon { transform: translateY(-1.75px); }

.flash { margin: 0 0 var(--s-5); padding: var(--s-3) var(--s-4); border: 1px solid var(--tone-green-line); border-radius: var(--radius); background: var(--tone-green-bg); color: var(--tone-green-ink); font-weight: 600; }
.flash--error { border-color: var(--tone-red-line); background: var(--error-bg); color: var(--error-ink); }
.flash--warn { border-color: var(--tone-yellow-line); background: var(--tone-yellow-bg); color: var(--tone-yellow-ink); }
.draft-pages__reminder a { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Home ---------- */
.home-head { margin-bottom: var(--s-6); }
.home-head__date { margin: 0 0 var(--s-2); font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.home-head h1 { margin-bottom: var(--s-3); font-size: clamp(2.25rem, 2.3vw + 1.3rem, 3.5rem); }
.home-head__summary { margin: 0; color: var(--ink); font-size: 1.125rem; }
.home-grid, .home-side { display: grid; gap: var(--s-5); align-items: start; }
.home-grid .home-card { margin: 0; }
.home-side { min-width: 0; }
.home-todos { margin: 0; padding: 0; list-style: none; }
.home-todo + .home-todo { border-top: 1px solid var(--rule); }
.home-todo__link {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 20px; align-items: center; gap: var(--s-3);
  min-height: 76px; padding: var(--s-3) 0; color: var(--ink); text-decoration: none;
}
.home-todo:first-child .home-todo__link { padding-top: 0; }
.home-todo:last-child .home-todo__link { padding-bottom: 0; }
.home-todo__link:hover { text-decoration: none; }
.home-todo__link:hover .home-todo__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.home-todo__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); }
.home-todo__icon svg { width: 22px; height: 22px; }
.home-todo--red .home-todo__icon { color: var(--tone-red-ink); background: var(--tone-red-bg); }
.home-todo--orange .home-todo__icon { color: var(--tone-orange-ink); background: var(--tone-orange-bg); }
.home-todo--blue .home-todo__icon { color: var(--tone-blue-ink); background: var(--tone-blue-bg); }
.home-todo--yellow .home-todo__icon { color: var(--tone-yellow-ink); background: var(--tone-yellow-bg); }
.home-todo__body { display: grid; gap: 2px; min-width: 0; }
.home-todo__title { overflow-wrap: anywhere; }
.home-todo__detail { color: var(--muted); font-size: 0.9375rem; line-height: 1.4; overflow-wrap: anywhere; }
/* The deadline pill and the chevron keep their own columns, so every row's chevron sits
   in the same place whether or not the row has a pill. */
.home-todo__deadline { grid-column: 3; justify-self: end; }
.home-todo__chevron { grid-column: 4; grid-row: 1; width: 20px; height: 20px; color: var(--muted); }
/* A warning with nothing to check or read keeps a Done button where the chevrons sit, so
   the button's right edge lines up with every other row's chevron. */
.home-todo--done { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); }
.home-todo--done .home-todo__link { grid-template-columns: auto minmax(0, 1fr); }
.home-todo--done .home-todo__chevron { display: none; }
.home-todo__done { margin: 0; padding: var(--s-3) 0; }
.home-todo:first-child .home-todo__done { padding-top: 0; }
.home-todo:last-child .home-todo__done { padding-bottom: 0; }
.home-quick__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--s-3); }
.home-quick__link { justify-content: flex-start; width: 100%; height: 100%; min-width: 0; min-height: var(--tap); }
.home-quick__link span { min-width: 0; overflow-wrap: normal; word-break: normal; }
.home-quick__icon { flex: none; width: 20px; height: 20px; }
/* Healthy checks read in body text; only the small icon carries the green (or the orange
   of a check that needs a look). */
.home-fine__list { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.home-fine__line { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: var(--s-2); align-items: start; color: var(--ink); line-height: 1.45; overflow-wrap: anywhere; }
.home-fine__icon { width: 18px; height: 18px; margin-top: 0.15em; color: var(--tone-green-ink); }
.home-fine__line--warn .home-fine__icon { color: var(--tone-orange-ink); }
/* Running fine on Home: a grid of quiet tiles, one a service, its name over a short muted
   status line; the small check sits beside words that say the same. */
.home-status { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 8.5rem), 1fr)); grid-auto-rows: 1fr; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.home-status__tile { display: grid; grid-template-rows: auto 1fr; align-content: start; gap: 2px; min-width: 0; padding: var(--s-2) var(--s-3); border: 1px solid var(--rule); border-radius: var(--radius); }
.home-status__label { font-size: 0.875rem; font-weight: 600; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.home-status__state { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 6px; align-items: start; color: var(--muted); font-size: 0.8125rem; line-height: 1.35; overflow-wrap: anywhere; }
.home-status__icon { width: 12px; height: 12px; margin-top: 0.15em; color: var(--tone-green-ink); }
/* The smallest phones stack the tiles in one column, so each is only as tall as its words. */
@media (max-width: 359px) {
  .home-status { grid-auto-rows: auto; }
}
@media (max-width: 559px) {
  .home-todo__link { grid-template-columns: 40px minmax(0, 1fr) 18px; }
  .home-todo__icon { width: 40px; height: 40px; }
  .home-todo__deadline { grid-column: 2; justify-self: start; margin-top: var(--s-1); }
  .home-todo__chevron { grid-column: 3; width: 18px; height: 18px; }
  .home-todo__deadline + .home-todo__chevron { grid-row: 1 / span 2; }
}
@media (max-width: 430px) {
  .home-quick__links { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1025px) {
  .home-grid { grid-template-columns: minmax(0, 1.8fr) minmax(18rem, 0.8fr); }
  .home-grid--solo { grid-template-columns: minmax(0, 1fr); }
  .home-quick__links { grid-template-columns: 1fr; }
}
/* Home's own touches: the date row, the switch that hides the money (top right, below
   the summary on phones), its calm note, and the one-time milestone note. Nothing here
   moves or animates; the holiday strip below is the one exception. */
.home-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-5); }
.home-head > * { grid-column: 1; }
.home-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-4); margin-bottom: var(--s-2); }
.home-head__meta .home-head__date { margin: 0; }
.home-milestone {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) var(--tap); align-items: center; gap: var(--s-3);
  margin: 0 0 var(--s-6); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4);
  color: var(--ink); background: var(--tone-orange-bg); border: 1px solid var(--tone-orange-line); border-radius: var(--radius);
}
.home-milestone__badge { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--tone-orange-ink); background: var(--sheet); }
.home-milestone__icon { width: 22px; height: 22px; }
.home-milestone__text { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.home-milestone__form { margin: 0; }
.home-milestone__close {
  display: grid; place-items: center; width: var(--tap); height: var(--tap); padding: 0;
  color: var(--muted); background: none; border: 0; border-radius: var(--radius); cursor: pointer;
}
.home-milestone__close:hover { color: var(--ink); background: var(--sheet); }
.home-milestone__close:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.home-milestone__close-icon { width: 20px; height: 20px; }
@media (max-width: 559px) {
  .home-head { grid-template-columns: minmax(0, 1fr); }
}

/* Holiday art: flat shapes coloured by class, so one drawing works in both themes. The
   greens lighten in the dark theme; orange, white and the constant ink stay put. */
.holiday-art {
  --art-sky: #e3ecd9; --art-deep: #054010; --art-mid: #579d3a; --art-soft: #cfe0c3;
  --art-accent: #dc7030; --art-warm: #f6c39d; --art-snow: #ffffff; --art-ink: #054010;
}
@supports (color: light-dark(#000, #fff)) {
  .holiday-art {
    --art-sky: light-dark(#e3ecd9, #1c3123); --art-deep: light-dark(#054010, #a9d99b);
    --art-mid: light-dark(#579d3a, #6fae67); --art-soft: light-dark(#cfe0c3, #2a4630);
    --art-warm: light-dark(#f6c39d, #eeb07c); --art-snow: light-dark(#ffffff, #eef2ec);
  }
}
.holiday-art .art-sky { fill: var(--art-sky); }
.holiday-art .art-deep { fill: var(--art-deep); }
.holiday-art .art-mid { fill: var(--art-mid); }
.holiday-art .art-soft { fill: var(--art-soft); }
.holiday-art .art-accent { fill: var(--art-accent); }
.holiday-art .art-warm { fill: var(--art-warm); }
.holiday-art .art-snow { fill: var(--art-snow); }
.holiday-art .art-ink { fill: var(--art-ink); }
.holiday-art .art-line-deep { stroke: var(--art-deep); }
.holiday-art .art-line-mid { stroke: var(--art-mid); }
.holiday-art .art-line-accent { stroke: var(--art-accent); }
.holiday-art .art-line-warm { stroke: var(--art-warm); }
.holiday-art .art-line-snow { stroke: var(--art-snow); }
.holiday-art .art-line-ink { stroke: var(--art-ink); }

/* A federal holiday's strip at the top of Home: the picture, the greeting and a short
   line. On the festive holidays a layer over it plays confetti, leaves or snow once a
   day (src/islands/holiday-burst.ts); it never takes clicks and reduced motion skips it. */
.home-holiday {
  position: relative; display: grid; grid-template-columns: 13rem minmax(0, 1fr); align-items: center; gap: var(--s-5);
  margin: 0 0 var(--s-6); padding: var(--s-3) var(--s-5) var(--s-3) var(--s-3);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; overflow: hidden;
}
.home-holiday::after { content: ""; position: absolute; inset: auto 0 0 0; height: 4px; background: linear-gradient(90deg, var(--green-500) 0 70%, var(--orange-600) 70% 100%); }
.home-holiday__art { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.home-holiday__art .holiday-art { display: block; width: 100%; height: 100%; }
.home-holiday__text { min-width: 0; }
.home-holiday__title {
  margin: 0 0 var(--s-2); max-width: none;
  font-family: var(--font-display); font-size: clamp(1.375rem, 0.9vw + 1.1rem, 2rem); font-weight: 800; line-height: 1.15;
  color: var(--heading); overflow-wrap: anywhere;
}
.home-holiday__subline { margin: 0; max-width: 60ch; font-size: 1.0625rem; line-height: 1.45; color: var(--text); }
/* Snow is a pale blue-grey on the white sheet and white on the dark one. */
.home-holiday__burst { --holiday-snow: #c8d8de; position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
@supports (color: light-dark(#000, #fff)) { .home-holiday__burst { --holiday-snow: light-dark(#c8d8de, #eef2ec); } }
.holiday-piece {
  position: absolute; top: -18px; left: var(--x); width: 9px; height: 4px;
  background: var(--piece); border-radius: 1px; opacity: 0;
  animation: holiday-fall var(--duration) linear var(--delay) forwards;
}
.holiday-piece--leaf { width: 13px; height: 13px; border-radius: 0 100% 0 100%; }
.holiday-piece--snow { width: 7px; height: 7px; border-radius: 50%; }
@keyframes holiday-fall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), var(--fall), 0) rotate(var(--spin)); }
}
@media (prefers-reduced-motion: reduce) { .home-holiday__burst { display: none; } }
@media (max-width: 767px) {
  .home-holiday { grid-template-columns: 9.5rem minmax(0, 1fr); gap: var(--s-4); padding-right: var(--s-4); }
  .home-holiday__subline { font-size: 1rem; }
}
@media (max-width: 479px) {
  .home-holiday { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-4); }
  .home-holiday__art { aspect-ratio: 16 / 9; }
  .home-holiday__text { padding-inline: var(--s-2); }
}

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; list-style: none; margin: 0 0 var(--s-6); padding: 0; border: 1px solid var(--rule-strong); background: var(--sheet); border-radius: var(--radius); }
.stats li { display: grid; gap: 4px; padding: var(--s-4) var(--s-5); border-left: 1px solid var(--rule); }
.stats li:first-child { border-left: 0; }
.stats--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-note { margin: calc(var(--s-6) * -1 + var(--s-3)) 0 var(--s-6); }
.stats__label { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.stats__value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; color: var(--heading); line-height: 1.1; }
.stats__value--alert { color: var(--error-ink); }
@media (max-width: 599px) {
  .stats { grid-template-columns: 1fr; }
  .stats li { border-left: 0; border-top: 1px solid var(--rule); }
  .stats li:first-child { border-top: 0; }
}

/* ---------- Sheets, plates, sections ---------- */
.sheet { margin: 0 0 var(--s-5); padding: var(--s-5); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-card); box-shadow: var(--shadow-card); min-width: 0; }
fieldset.sheet { padding-top: var(--s-4); }
.backup-automatic { display: grid; gap: var(--s-4); min-width: 0; margin: 0 0 var(--s-5); padding: 0; border: 0; }
.backup-automatic > .btn { justify-self: start; }
.backup-automatic > .switch { padding-top: 0; border-top: 0; }
.sheet__title {
  display: block; padding: 0; margin: 0 0 var(--s-4);
  font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink-soft);
}
/* The legend floats so it sits inside the sheet like a heading; everything after it
   clears the float, including content that appears after a hidden sibling. */
fieldset.sheet > .sheet__title { float: left; width: 100%; }
fieldset.sheet > :not(legend) { clear: both; }
.sheet__subtitle { margin: var(--s-5) 0 var(--s-3); }
.sheet__subtitle--first { margin-top: var(--s-4); }
/* A section's description runs the full width of its sheet, with the same space under
   it as under the title, whatever follows; so does a notice inside the section. */
.sheet > .sheet__lead, .sheet > .flash { margin-bottom: var(--s-4); }
.sheet > :last-child:not(dialog) { margin-bottom: 0; }
.backup-card { display: grid; justify-items: start; gap: var(--s-3); }
.backup-card > * { margin: 0; }
.backup-card > [data-backup-confirm] { display: none; }
.backup-privacy { font-weight: 400; }
.backup-progress:empty { display: none; }
.backup-progress { color: var(--muted); }
.backup-meter { display: block; width: 100%; max-width: 24rem; height: 8px; margin-top: var(--s-2); appearance: none; border: 0; border-radius: 999px; background: var(--rule); overflow: hidden; }
.backup-meter::-webkit-progress-bar { background: var(--rule); border-radius: 999px; }
.backup-meter::-webkit-progress-value { background: var(--accent-line); border-radius: 999px; }
.backup-meter::-moz-progress-bar { background: var(--accent-line); border-radius: 999px; }
.backup-summary { width: 100%; padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.backup-summary h3 { margin: 0 0 var(--s-2); font-size: 1rem; }
.backup-summary ul { margin: 0; padding-left: 1.4em; }
.backup-file { width: max-content; }
@media (max-width: 1024px) {
  .backup-file { width: 100%; }
}
.section { margin-top: var(--s-7); }

.plate {
  position: relative; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 0; overflow: hidden; margin: 0 0 var(--s-5);
}
.plate__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; padding: 16px 20px 4px; color: var(--accent-ink); font-family: var(--font-label); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
/* The record's number sits in the cbnventures.io glass label: a tinted pill with a yellow pip. */
.plate__head b { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; color: var(--accent-ink); font-weight: 700; letter-spacing: 0.08em; background: var(--green-100); border: 1px solid var(--accent-line-soft); border-radius: var(--radius-pill); }
.plate__head b::before { content: ""; width: 7px; height: 7px; flex: none; background: #ffe500; border-radius: var(--radius-pill); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.plate__body { padding: var(--s-2) 18px; }
.plate dl { margin: 0; display: grid; }
.plate dl > div { display: grid; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.plate dl > div:last-child { border-bottom: 0; }
@media (min-width: 560px) { .plate dl > div { grid-template-columns: 8.5rem 1fr; align-items: baseline; } }
.plate dt { font-family: var(--font-mono); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.plate dd { min-width: 0; margin: 0; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }
.plate .form-field-value { font-weight: 400; white-space: pre-wrap; }
.plate .readout { font-family: var(--font-mono); font-size: 1.375rem; font-weight: 600; color: var(--accent-ink); white-space: nowrap; overflow-wrap: normal; }
/* An amount readout sits under its label with the row's full width, so a large amount stays
   on one line instead of breaking inside the number. */
.plate dl > div:has(> .readout) { grid-template-columns: minmax(0, 1fr); container-type: inline-size; }
.dd-sub { display: block; font-weight: 400; color: var(--muted); font-size: 0.9375rem; }

/* An email on a sub-line keeps the sub-line's colour; only its own text is the link. */
.dd-sub > a[href^="mailto:"] { color: inherit; }
.pill + .dd-sub, .pill-row + .dd-sub { margin-top: var(--s-2); }

/* Integration details use the same compact label-value rhythm as a plate, without the
   plate frame. Long translated labels wrap in their own column at every width. */
.details-list { margin: 0 0 var(--s-4); display: grid; }
.details-list > div { display: grid; gap: 2px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.details-list > div:first-child { padding-top: 0; }
.details-list > div:last-child { border-bottom: 0; padding-bottom: 0; }
@media (min-width: 560px) { .details-list > div { grid-template-columns: minmax(8.5rem, 14rem) minmax(0, 1fr); align-items: baseline; } }
.details-list dt { font-family: var(--font-mono); font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.details-list dd { margin: 0; color: var(--ink); font-weight: 700; overflow-wrap: anywhere; }

/* A website form message: the message on the left, the details about it in a sidebar on
   the right, with each label above its value. In mobile mode the sidebar follows the
   message. The sidebar stays in view only while it fits under the header (detail-page.ts). */
.form-detail { display: grid; gap: var(--s-5); align-items: start; }
.form-detail__main, .form-detail__side { display: grid; gap: var(--s-5); min-width: 0; }
.form-detail__main > .plate, .form-detail__side > .plate { margin: 0; }
.form-detail__side .plate dl > div { grid-template-columns: minmax(0, 1fr); }
.form-detail__side .page-address__values li { grid-template-columns: minmax(0, 1fr); gap: 0; }
.plate__note { margin: 0; padding: 12px 0; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }
.form-message .form-field-value { max-width: 70ch; line-height: 1.6; }
@media (min-width: 560px) {
  .form-message dl { grid-template-columns: fit-content(14rem) minmax(0, 1fr); }
  .form-message dl > div { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
@media (min-width: 1025px) {
  .form-detail { grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); }
  .form-detail__side.is-sticky { position: sticky; top: calc(var(--header-h) + var(--s-6)); }
}

.detail-grid { display: grid; gap: var(--s-5); align-items: start; }
.detail-grid > * { margin-bottom: 0; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: 1.3fr 1fr; } }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-4); padding: 12px 0; border-bottom: 1px solid var(--rule); }
.link-list li:first-child { padding-top: 0; }
.link-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.link-list li > span:first-child { flex: none; font-weight: 700; color: var(--ink); }
/* A value too wide to sit beside its name drops to a line of its own, still at the right. */
.link-list li > :last-child:not(:first-child) { margin-left: auto; text-align: right; }
.link-list li > .hash { min-width: 0; text-align: right; }

/* ---------- Tables ---------- */
/* Relative, so hidden screen reader text inside a wide table stays inside its scroll box
   instead of widening the whole page. */
.table-wrap { position: relative; overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
/* Wide tables keep a visible scrollbar (styling the WebKit scrollbar turns off macOS's
   hidden overlay one) and fade their right edge while more columns wait there. The fade
   follows the table's own scroll, so it's gone at the end and never shows on a table that
   fits. The scrollbar strip stays unfaded. */
@property --table-fade { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes table-fade { 0%, 92% { --table-fade: 56px; } 100% { --table-fade: 0px; } }
@media (min-width: 1025px) {
  .table-wrap {
    animation: table-fade linear both;
    animation-timeline: scroll(self inline);
    mask-image: linear-gradient(to left, transparent, #000 var(--table-fade)), linear-gradient(#000, #000);
    mask-position: top, bottom;
    mask-size: 100% calc(100% - 14px), 100% 14px;
    mask-repeat: no-repeat;
  }
  .table-wrap::-webkit-scrollbar { height: 14px; }
  .table-wrap::-webkit-scrollbar-track { background: var(--paper-2); border-top: 1px solid var(--rule); }
  .table-wrap::-webkit-scrollbar-thumb { background: var(--accent-line); border: 3px solid var(--paper-2); border-radius: 999px; }
}
/* A note under a table sits as far below it as the note under each log. */
.table-wrap + .field__hint, .table-wrap + .hint { margin-top: var(--s-3); }
.table-wrap + .form-actions { margin-top: var(--s-6); }
.data { width: 100%; border-collapse: collapse; font-size: 1rem; }
.data th, .data td { padding: 12px var(--s-4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.data thead th { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); border-bottom: 2px solid var(--accent-line); white-space: nowrap; }
.sort-header-label { display: none; }
.sort-link { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; color: inherit; font: inherit; text-decoration: none; }
.sort-link:hover { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.sort-link:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 3px; }
.sort-link__arrow { position: relative; flex: none; width: 0.7em; height: 0.8em; opacity: 1; }
.sort-link__arrow::before, .sort-link__arrow::after { content: ""; position: absolute; left: 0.05em; border-right: 0.3em solid transparent; border-left: 0.3em solid transparent; }
.sort-link__arrow::before { top: 0; border-bottom: 0.3em solid currentColor; }
.sort-link__arrow::after { bottom: 0; border-top: 0.3em solid currentColor; }
.sort-link__arrow--asc::after, .sort-link__arrow--desc::before { display: none; }
.sort-link__arrow--none { opacity: 0; }
.sort-link:hover .sort-link__arrow--none, .sort-link:focus-visible .sort-link__arrow--none { opacity: 0.45; }
/* The frame draws the line under the last row, so its cells have none of their own. In
   mobile mode each row is a card, so the last cell of every card has none. */
@media (min-width: 1025px) { .data tbody tr:last-child > * { border-bottom: 0; } }
/* The tick boxes match the alerts and People tables'. In the table each one sits in the
   middle of its column, level with the first line of the row; in a mobile card it sits at
   the start of the value, like the other values. */
.forms-table__select { width: 1%; }
.forms-table__select input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--accent-line); }
@media (min-width: 1025px) {
  .data .forms-table__select { text-align: center; }
  .forms-table__select input[type="checkbox"] { display: grid; margin: 0 auto; }
}
.forms-table__received { display: inline-flex; flex-wrap: wrap; gap: 0 var(--s-2); }
.forms-table__received-piece { white-space: nowrap; }
@media (min-width: 1025px) { .forms-table__from { overflow-wrap: anywhere; } }
.selection-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.selection-bar__count {
  margin: 0;
  color: var(--muted);
}
/* Buttons side by side share one width, the widest one's. */
.selection-bar__actions {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--s-2);
}
.selection-bar > .btn--icon { flex-shrink: 0; }
.is-unread { font-weight: 700; }
.is-unread .dd-sub,
.is-unread .muted { font-weight: 700; }
.js .selection-bar {
  position: fixed;
  right: 0;
  z-index: 30;

  width: fit-content;
  margin: 0 auto;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-5);
  gap: var(--s-5);

  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px var(--panel-shadow);
}
.js .selection-bar__count {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.js .selection-bar[data-empty] { display: none; }
/* With rows picked on a phone or tablet, the page ends above the floating bar, so the
   footer under the last rows can still be reached. */
@media (max-width: 1024px) {
  .js .app:has([data-selection-bar]:not([data-empty])) {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 66px + var(--s-3));
  }
}
@media (max-width: 1024px) {
  .js .selection-bar {
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--s-3));
    left: 0;

    max-width: calc(100% - 2 * var(--gutter));
  }
}
/* On a phone the bar stays one row: worded buttons show their short label, while screen
   readers keep the full one. The bar floats over the page; nothing moves for it. */
.selection-bar__short { display: none; }
@media (max-width: 600px) {
  .js .selection-bar {
    width: calc(100% - 2 * var(--gutter));
    padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
    gap: var(--s-2);
  }
  .js .selection-bar__count { margin-right: auto; }
  .js .selection-bar__actions .btn { padding-inline: var(--s-3); }
  .js .selection-bar__full { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .js .selection-bar__short { display: inline; }
}
@media (min-width: 1025px) {
  .js .selection-bar {
    bottom: var(--s-5);
    left: var(--rail-w);

    max-width: calc(100% - var(--rail-w) - 2 * var(--gutter));
  }
}
/* The two status headings may wrap on desktop so their columns stay compact. */
@media (min-width: 1025px) {
  .forms-table thead th.forms-table__status { white-space: normal; }
}
.data tbody tr:has([data-row-link]) { cursor: pointer; }
/* The whole row opens, so its main link drops the underline and keeps its colour and
   weight; it stays a link for Tab, a new tab and screen readers, with the focus ring. */
.data [data-row-link], .data [data-row-link]:hover { text-decoration: none; }
.data tbody tr:has([data-row-link]):hover :is(th, td) { background: var(--sheet-hover); }
/* Totals: one strong rule under the lines, quiet steps (subtotal, discount, tax), then the
   final total set apart by a thin rule and a heavier, larger figure. */
.data tfoot th, .data tfoot td { padding-top: 8px; padding-bottom: 8px; line-height: 1.5; border-top: 0; border-bottom: 0; font-weight: 400; color: var(--muted); background: var(--paper-2); }
.data tfoot td { color: var(--ink); }
.data tfoot tr:first-child > * { padding-top: 16px; border-top: 2px solid var(--rule-strong); }
.data tfoot tr:last-child > * { padding-bottom: 16px; font-weight: 700; color: var(--ink); }
.data tfoot tr:last-child:not(:first-child) > * { padding-top: 16px; border-top: 1px solid var(--rule); font-size: 1.0625rem; }
.data tfoot tr:nth-last-child(2) > * { padding-bottom: 16px; }
.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A sortable number heading puts its arrow before the words, so the words end over the
   numbers' right edge. */
@media (min-width: 1025px) {
  .data th.num .sort-link { flex-direction: row-reverse; }
}
.strong-link { font-weight: 700; }
@media (max-width: 1024px) {
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  .data thead { display: none; }
  /* A sortable list keeps its real heading links above the cards. The first sortable cell
     supplies the one translated label; plain, selection and action headings stay hidden. */
  .data thead:has([data-sort-link]) { display: block; width: 100%; margin-bottom: var(--s-3); }
  .data thead:has([data-sort-link]) tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
  .data thead:has([data-sort-link]) th { display: none; }
  .data thead:has([data-sort-link]) th[aria-sort] { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 0; text-align: left; background: none; border: 0; white-space: normal; }
  .data thead:has([data-sort-link]) th[aria-sort] > .sort-header-label { display: block; flex: none; color: var(--muted); white-space: nowrap; }
  .data thead:has([data-sort-link]) th[aria-sort] ~ th[aria-sort] > .sort-header-label { display: none; }
  .data thead:has([data-sort-link]) .sort-link { min-width: 0; min-height: 44px; padding: 0 var(--s-3); line-height: 1.2; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: 999px; white-space: normal; overflow-wrap: anywhere; }
  .data thead:has([data-sort-link]) .sort-link:hover { background: var(--green-100); border-color: var(--accent-line); text-decoration: none; }
  .data thead:has([data-sort-link]) th[aria-sort="ascending"] .sort-link, .data thead:has([data-sort-link]) th[aria-sort="descending"] .sort-link { color: var(--accent-ink); background: var(--green-100); border-color: var(--accent-line); }
  .data, .data tbody, .data tr, .data td, .data tfoot, .data tfoot tr { display: block; width: 100%; }
  .data tbody tr { margin-bottom: var(--s-3); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
  .data td { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-3); padding: 10px var(--s-4); border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
  .data tbody tr > :last-child { border-bottom: 0; }
  .data td.num { text-align: left; }
  .data td::before { content: attr(data-label); min-width: 0; white-space: normal; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
  /* A row heading, such as a network's name, spans its card like the cells under it. */
  .data tbody th { display: block; width: 100%; }
  /* Every part of a value stays in the value column, so a second line, such as a name
     under a date, never drops under the label. */
  .data td > * { grid-column: 2; }
  .data td > .pill, .data td > .source { justify-self: start; }
  .data td .pill-row { display: grid; justify-items: start; width: 100%; }
  .data td .pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; border-radius: 14px; }
  .cell-stack > .source { white-space: normal; }
  /* On a phone the totals are one box: the steps, then the final total under a rule. */
  .data tfoot { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
  .data tfoot tr { display: flex; justify-content: space-between; gap: var(--s-3); padding: 6px var(--s-4); }
  .data tfoot tr:first-child { padding-top: 12px; }
  .data tfoot tr:last-child { padding-bottom: 12px; }
  .data tfoot tr:last-child:not(:first-child) { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--rule); }
  .data tfoot th, .data tfoot td, .data tfoot tr:first-child > *, .data tfoot tr:last-child > *, .data tfoot tr:last-child:not(:first-child) > * { display: inline; padding: 0; border: 0; background: none; width: auto; }
}
/* On a small phone a card's label sits above its value, so a long label never runs into
   the value beside it. */
@media (max-width: 480px) {
  .data td { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .data td::before { white-space: normal; }
  .data td > * { grid-column: auto; }
}

/* A white paper has one visible picker action. JavaScript hides the small submit fallback
   and sends a chosen PDF at once; without it, the same native form still submits. */
.white-paper-upload { margin: 0; }
.white-paper-upload__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.white-paper-upload__button { width: max-content; }
.white-paper-upload__button[aria-disabled="true"] { opacity: 0.6; cursor: progress; pointer-events: none; }
.white-paper-upload__error { margin-top: var(--s-2); }
@media (max-width: 1024px) {
  .data td.white-papers-table__file { grid-template-columns: minmax(0, 1fr); }
  .data td.white-papers-table__file > * { grid-column: auto; }
  .white-paper-upload__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
  .white-paper-upload__button { width: 100%; }
}

/* Newsletters: the four template cards, the readiness note, the send and schedule
   sheets, four counts in a row, and the desktop and phone previews side by side. */
.newsletter-templates { display: grid; gap: var(--s-4); margin: 0 0 var(--s-6); padding: 0; list-style: none; }
@media (min-width: 640px) { .newsletter-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.newsletter-template { display: grid; gap: var(--s-2); height: 100%; margin: 0; color: var(--ink); text-decoration: none; }
.newsletter-template:hover { border-color: var(--accent-line); background: var(--sheet-hover); }
.newsletter-template:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.newsletter-template__title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; color: var(--heading); }
.newsletter-template__detail { color: var(--muted); }
.newsletter-readiness p { margin: 0 0 var(--s-2); }
.newsletter-readiness ul, .newsletter-errors { margin: 0; padding-left: 1.25em; }
.newsletter-errors { margin: 0 0 var(--s-5); padding: var(--s-3) var(--s-4) var(--s-3) calc(var(--s-4) + 1.25em); border: 1px solid var(--tone-red-line); border-left-width: 4px; border-radius: var(--radius); background: var(--error-bg); color: var(--error-ink); font-weight: 600; }
.newsletter-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 559px) {
  .newsletter-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .newsletter-stats li:nth-child(3) { border-left: 0; }
  .newsletter-stats li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
/* The consent log: six numbers for the last 30 days (three by two up to 1024px, two by two
   on a phone), a note under them, the CSV link under the table, and short consent IDs. */
.consent-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (min-width: 560px) and (max-width: 1024px) {
  .consent-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .consent-stats li:nth-child(4) { border-left: 0; }
  .consent-stats li:nth-child(n + 4) { border-top: 1px solid var(--rule); }
}
@media (max-width: 559px) {
  .consent-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consent-stats li:nth-child(3) { border-left: 0; }
  .consent-stats li:nth-child(n + 3) { border-top: 1px solid var(--rule); }
}
.consent-stats__note { margin: calc(var(--s-6) * -1 + var(--s-3)) 0 var(--s-6); font-size: 0.9375rem; }
.consent-why__retention { margin: 0; }
.consent-export { margin: var(--s-4) 0 0; }
.consent-id, .consent-nowrap { white-space: nowrap; }

/* Company visits: Keep and Not a company side by side at the same width. */
.company-visit-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.company-visit-actions form { display: contents; }
.company-visit-actions .btn { justify-content: center; padding-inline: var(--s-3); white-space: nowrap; }
@media (min-width: 1025px) {
  /* Both columns are as wide as the longer button, so Not a company never spills out. */
  .company-visit-actions { grid-template-columns: repeat(2, 1fr); width: max-content; min-width: 15rem; }
}
@media (max-width: 400px) {
  .company-visit-actions { grid-template-columns: minmax(0, 1fr); }
}
.consent-id { width: fit-content; font-family: var(--font-mono); font-size: 0.875rem; }
.data th.consent-choices-head { text-align: center; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.data th.consent-service-head { width: 5.5rem; font-size: 0.75rem; letter-spacing: 0; text-align: center; vertical-align: bottom; white-space: normal; }
/* The arrow sits under a service's name, so the name alone sets how narrow its column can wrap. */
.data th.consent-service-head .sort-link { flex-direction: column; gap: 2px; justify-content: center; white-space: normal; }
.data tr > th.consent-service-head:first-child, .data tr > td.consent-mark-cell:nth-child(4) { border-left: 1px solid var(--rule); }
.data tr > th.consent-service-head:last-child, .data tr > td.consent-mark-cell:nth-child(9) { border-right: 1px solid var(--rule); }
.data td.consent-mark-cell { text-align: center; }
.data td.consent-mark-cell, .data th.consent-service-head { padding-inline: 6px; }
.data td.consent-choices-cell { display: none; }
.consent-choices { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-4); align-items: center; max-width: 22rem; }
.consent-choices .environment-mark { justify-self: end; }
/* From 1440px Recorded and How stay on one line, and the service headers wrap instead;
   narrower, they wrap too, so the table never scrolls sideways. */
@media (min-width: 1440px) {
  .data td.consent-line { white-space: nowrap; }
}
@media (max-width: 1024px) {
  .data td.consent-mark-cell { display: none; }
  .data td.consent-choices-cell { display: grid; }
  /* Each record lists its services under Choices, so only the base columns sort here. */
  .data thead:has([data-sort-link]) th.consent-service-head[aria-sort] { display: none; }
}

/* Cookie choices on a form message, contact or client: the latest choice per service, then
   every record folded under a link-styled summary. */
.cookie-choices__none { margin: 0; padding: 12px 0; color: var(--muted); }
.cookie-choices .cookie-choices__none { padding: 0; }
.cookie-history details > summary { display: inline; list-style: none; font-weight: 400; }
/* A page address: its site and page, then the values after the "?" folded under a
   link-styled summary, each name beside its value. */
.page-address { display: grid; gap: var(--s-1); justify-items: start; min-width: 0; }
.page-address > a, .page-address > span { overflow-wrap: anywhere; }
.page-address__more > summary { display: inline; list-style: none; font-weight: 400; }
.page-address__more > summary::-webkit-details-marker { display: none; }
.page-address__values { margin: var(--s-2) 0 0; padding: 0 0 0 var(--s-3); list-style: none; display: grid; gap: var(--s-1); border-left: 2px solid var(--rule-strong); font-weight: 400; font-size: var(--fs-small); }
.page-address__values li { display: grid; grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr); gap: var(--s-3); overflow-wrap: anywhere; }
.page-address__name { font-family: var(--font-mono); color: var(--muted); }
@media (max-width: 559px) { .page-address__values li { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.cookie-history details > summary::-webkit-details-marker { display: none; }
.cookie-history__list { margin: var(--s-3) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s-3); font-weight: 400; }
.cookie-history__list li { display: grid; gap: 2px; padding-left: var(--s-3); border-left: 2px solid var(--rule-strong); }

.newsletter-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.newsletter-preview { display: grid; gap: var(--s-5); align-items: start; }
.newsletter-preview__frame { margin: 0; min-width: 0; }
.newsletter-preview__frame figcaption { margin: 0 0 var(--s-2); font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.newsletter-preview__frame--desktop .email-frame { height: 900px; }
.newsletter-preview__frame--phone .email-frame { width: 375px; max-width: 100%; height: 760px; }
@media (min-width: 1025px) { .newsletter-preview { grid-template-columns: minmax(0, 1fr) 377px; } }
:lang(zh) .newsletter-preview__frame figcaption { letter-spacing: 0; text-transform: none; }
/* Writing a newsletter: the form on the left and the email as readers see it on the right,
   following what is typed. Narrower screens stack them, the preview under the form. */
.newsletter-editor { display: grid; gap: var(--s-5); align-items: start; margin-bottom: var(--s-6); }
.newsletter-editor > .sheet { margin: 0; min-width: 0; }
.newsletter-form__actions { margin: var(--s-5) 0 0; }
.newsletter-form__actions .btn { min-width: 9.75rem; justify-content: center; }
.newsletter-live__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin-bottom: var(--s-3); }
.newsletter-live__head .sheet__title { margin: 0; }
.newsletter-live__sizes { display: flex; gap: var(--s-2); }
.newsletter-live__sizes .btn { min-width: 6.5rem; justify-content: center; }
.newsletter-live__sizes .btn[aria-pressed="true"] { border-color: var(--accent-line); background: var(--green-100); color: var(--accent-ink); }
.newsletter-live__box .email-frame { height: 760px; transition: width 0.15s; }
.newsletter-live__box--phone .email-frame { width: 375px; max-width: 100%; margin-inline: auto; }
.newsletter-live .field__hint { margin: var(--s-3) 0 0; }
/* Newsletter post picker (older newsletters) and the post's newsletter list. */
.blog-editor__fields, .newsletter-posts { margin: 0; padding: 0; border: 0; min-width: 0; }
.newsletter-posts legend { padding: 0; margin-bottom: var(--s-2); font-weight: 700; }
.newsletter-posts .check { margin-top: var(--s-2); }
.blog-newsletters { margin: 0 0 var(--s-3); padding: 0; list-style: none; display: grid; gap: var(--s-3); }
.blog-newsletters > li { display: grid; gap: 2px; padding-left: var(--s-3); border-left: 2px solid var(--rule-strong); min-width: 0; overflow-wrap: anywhere; }

/* Post editor, laid out like a writing app under the usual page head: the title and the
   formatted text on a sheet that hugs a comfortable reading measure, centred in the room
   left of the Post sidebar, which sits flush right and slides in at 1024px and below. */
.app-main--full > .wrap { width: auto; margin-inline: var(--gutter); }
.post-editor .page-head { margin-bottom: var(--s-4); }
.post-editor .page-head__actions { margin-left: auto; justify-content: flex-end; }
.post-editor .page-head__actions .btn svg { width: 18px; height: 18px; }
.post-editor .page-head__actions .btn--icon { width: var(--tap); }
.post-editor__toggle[aria-expanded="true"] { background: var(--green-100); }
.post-editor__more { position: relative; }
.post-editor__more > summary { list-style: none; cursor: pointer; }
.post-editor__more > summary::-webkit-details-marker { display: none; }
.post-editor__menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; display: grid; min-width: 15rem; padding: var(--s-1); background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(20 17 15 / 18%); }
.post-editor__menu form { margin: 0; }
.post-editor__menu-item { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: var(--ink); text-align: left; text-decoration: none; background: none; border: 0; border-radius: 4px; cursor: pointer; }
.post-editor__menu-item:hover, .post-editor__menu-item:focus-visible { background: var(--paper-2); }
.post-editor__menu-item--danger { color: var(--error-ink); }
.post-editor__errors { margin-bottom: var(--s-4); }
.post-editor__layout { display: grid; gap: var(--s-5); align-items: start; }
.post-editor__fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.post-editor__canvas { display: flex; flex-direction: column; min-width: 0; min-height: calc(100dvh - var(--header-h) - var(--s-6)); padding: var(--s-5) var(--s-6) var(--s-6); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
/* The fieldset only disables the fields of a deleted post; its children lay out in the sheet. */
.post-editor__canvas > .post-editor__fields { display: contents; }
.post-editor__writer { display: flex; flex: 1 1 auto; flex-direction: column; }
.post-editor__canvas .post-writer, .post-editor__canvas .post-editor__body { flex: 1 1 auto; }
.post-writer > * { max-width: 90ch; }
.post-writer > table, .post-writer > .post-figure { max-width: none; }
/* The title and the post text are fields: the standard border and background, a hover
   border, the field focus, and the text cursor everywhere inside. */
.post-editor__label { display: block; margin: 0 0 6px; font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.post-editor__title, .post-editor__body { display: block; width: 100%; color: var(--ink); resize: none; overflow: hidden; field-sizing: content; cursor: text; }
.post-editor__title { margin: 0 0 var(--s-4); padding: 10px 14px; font: 700 clamp(1.75rem, 1.2rem + 1.6vw, 2.375rem)/1.2 var(--font-display); background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); }
.post-editor__title:hover, .post-editor__box:hover { border-color: var(--muted); }
.post-editor__title:focus-visible { border-color: var(--accent-line); }
.post-editor__title[aria-invalid="true"] { border-color: var(--error-ink); }
.post-editor__body { width: 100%; min-height: 20rem; font: 400 1rem/1.7 var(--font-mono); color: var(--text); }
.post-editor__title::placeholder, .post-editor__body::placeholder { color: var(--placeholder); opacity: 1; }
.post-editor__box { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); }
.post-editor__box:has(.post-writer:focus, .post-editor__body:focus) { border-color: var(--accent-line); outline: 3px solid var(--accent-line); outline-offset: 3px; }
.post-editor__toolbar { position: sticky; top: var(--header-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-1) var(--s-2); padding: 4px; background: var(--sheet); border-bottom: 1px solid var(--rule); border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0; }
.post-editor__tools { display: flex; flex-wrap: wrap; gap: 2px; }
.post-editor__modes { display: inline-flex; overflow: hidden; border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.post-editor__modes .btn { min-height: 40px; border: 0; border-radius: 0; }
.post-editor__modes .btn + .btn { border-left: 1px solid var(--rule-strong); }
.post-editor__toolbar .post-editor__modes .btn[aria-pressed="true"] { border-color: var(--rule-strong); }
.post-editor__toolbar .btn--quiet { border-color: transparent; }
.post-editor__toolbar .btn--quiet:hover { border-color: var(--rule-strong); }
.post-editor__toolbar .btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--green-100); border-color: var(--accent-line); }
.post-editor__link { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule); }
.post-editor__link input { flex: 1 1 14rem; min-width: 0; min-height: var(--tap); padding: 10px 12px; font: 400 1rem var(--font-body); color: var(--ink); background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); }
.post-editor__hint { margin: var(--s-3) 0 0; font-size: 0.875rem; color: var(--muted); }
/* The visual writing area reads like the post: the site's type, the post's spacing. */
.post-writer { min-height: 20rem; caret-color: var(--accent-ink); white-space: pre-wrap; overflow-wrap: anywhere; font: 400 1.125rem/1.75 var(--font-body); color: var(--text); }
/* Both writing areas fill the editor box under its toolbar, with room inside so the
   text never meets the border; the box shows the focus. */
.post-writer, .post-editor__canvas .post-editor__body { position: relative; padding: var(--s-4) var(--s-5); background: transparent; border: 0; border-radius: 0 0 var(--radius) var(--radius); cursor: text; }
.post-writer:focus, .post-writer:focus-visible, .post-editor__canvas .post-editor__body:focus, .post-editor__canvas .post-editor__body:focus-visible { outline: none; }
.post-writer[data-empty="true"]::before { content: attr(data-placeholder); position: absolute; top: var(--s-4); left: var(--s-5); color: var(--placeholder); pointer-events: none; }
.post-writer > :first-child { margin-top: 0; }
.post-writer p { margin: 0 0 1em; }
.post-writer h2, .post-writer h3, .post-writer h4 { margin: 1.4em 0 0.5em; font-family: var(--font-display); line-height: 1.25; color: var(--ink); }
.post-writer h2 { font-size: 1.625rem; }
.post-writer h3 { font-size: 1.3125rem; }
.post-writer h4 { font-size: 1.125rem; }
/* A heading's link anchor is a quiet tag, shown while the pointer is on the heading. */
.post-writer [data-anchor]::after { content: attr(data-anchor); display: inline-block; margin-left: 0.5em; padding: 1px 8px; font: 400 0.75rem/1.5 var(--font-mono); vertical-align: middle; color: var(--muted); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; visibility: hidden; }
.post-writer [data-anchor]:hover::after { visibility: visible; }
.post-writer ul, .post-writer ol { margin: 0 0 1em; padding-left: 1.5em; }
.post-writer li > p { margin-bottom: 0.25em; }
.post-writer blockquote { margin: 0 0 1em; padding-left: var(--s-4); border-left: 3px solid var(--accent-line); color: var(--ink); }
.post-writer a { color: var(--accent-ink); text-decoration: underline; }
.post-writer hr { margin: 1.5em 0; border: 0; border-top: 1px solid var(--rule-strong); }
.post-writer img { max-width: 100%; height: auto; }
.post-writer table { width: 100%; margin: 0 0 1em; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.5; }
.post-writer th, .post-writer td { padding: 6px 10px; text-align: left; vertical-align: top; border: 1px solid var(--rule-strong); }
.post-writer th { background: var(--paper-2); color: var(--ink); }
.post-writer code { font-family: var(--font-mono); font-size: 0.9em; }
.post-figure { margin: 0 0 1.25em; }
.post-figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: var(--radius); }
.post-figure__caption { display: block; width: 100%; margin-top: var(--s-2); padding: 4px 0; font: 400 0.9375rem/1.5 var(--font-body); color: var(--muted); text-align: center; background: transparent; border: 0; border-bottom: 1px solid var(--rule); }
.post-figure__caption:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.post-figure__alt { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-1); font-size: 0.8125rem; color: var(--muted); }
.post-figure__alt input { flex: 1 1 auto; min-width: 0; padding: 4px 8px; font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--rule-strong); border-radius: 4px; }
.post-html { position: relative; margin: 0 0 1em; padding: var(--s-2) var(--s-3); font: 400 0.8125rem/1.5 var(--font-mono); color: var(--muted); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; user-select: none; }
.post-html__label { display: block; margin-bottom: 2px; font-family: var(--font-body); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.post-html-inline { font-size: 0.8125rem; color: var(--muted); }
.ProseMirror-selectednode { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.ProseMirror-hideselection *::selection { background: transparent; }
.post-editor__sidebar { min-width: 0; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.post-editor__sidebar-head { display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--rule); }
.post-editor__sidebar-title { margin: 0; font-size: 1.0625rem; }
.post-panel { border-bottom: 1px solid var(--rule); }
.post-editor__sidebar > .post-panel:last-child { border-bottom: 0; }
.post-panel__title { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 12px var(--s-4); font-weight: 700; color: var(--ink); list-style: none; cursor: pointer; }
.post-panel__title::-webkit-details-marker { display: none; }
.post-panel__title::after { content: ""; width: 8px; height: 8px; margin: -4px 4px 0 var(--s-2); border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; }
.post-panel[open] > .post-panel__title::after { margin-top: 4px; transform: rotate(-135deg); }
.post-panel__title:hover { background: var(--paper-2); }
.post-panel__body { padding: 0 var(--s-4) var(--s-4); }
.post-panel__facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-2) var(--s-3); align-items: center; margin: 0 0 var(--s-4); }
.post-panel__facts dt { color: var(--muted); }
.post-panel__facts dd { margin: 0; }
.post-panel__link { overflow-wrap: anywhere; }
/* The address: the fixed /resources/blogs/ and the editable slug read as one field. */
.post-panel__address { display: flex; flex-wrap: wrap; align-items: baseline; min-height: 48px; padding: 10px 12px; font: 400 1.0625rem var(--font-body); background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); }
.post-panel__address:focus-within { border-color: var(--accent-line); }
.post-panel__address:has([aria-invalid="true"]) { border-color: var(--error-ink); }
.post-panel__prefix { flex: none; color: var(--muted); white-space: nowrap; }
.field .post-panel__path { flex: 1 1 12ch; min-width: 0; min-height: 0; padding: 0; line-height: inherit; resize: none; overflow-x: auto; overflow-y: hidden; white-space: pre; overflow-wrap: normal; scrollbar-width: none; background: transparent; border: 0; border-radius: 0; outline: none; field-sizing: content; }
.field .post-panel__path::-webkit-scrollbar { display: none; }
.post-panel__wide { width: 100%; justify-content: center; }
.post-tags__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.post-tags__chips:empty { display: none; }
.post-tags__chip { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 2px 2px 2px 12px; font-size: 0.9375rem; color: var(--ink); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px; }
.post-tags__chip--suggest { padding: 2px 12px; font: inherit; font-size: 0.875rem; cursor: pointer; }
.post-tags__chip--suggest:hover { border-color: var(--accent-line); }
.post-tags__remove { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; font-size: 1.125rem; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.post-tags__remove:hover, .post-tags__remove:focus-visible { color: var(--ink); background: var(--rule); }
.post-tags__suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.post-banner { display: grid; gap: var(--s-3); }
.post-banner__thumb { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
.post-banner__buttons { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-2); }
.post-banner .field { margin-bottom: 0; }
.post-history { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
.post-history__entry { display: grid; gap: 2px; min-width: 0; padding-left: var(--s-3); border-left: 2px solid var(--rule-strong); }
.post-history__what, .post-history__when { margin: 0; }
.post-history__what { color: var(--ink); }
.post-history__when { font-size: 0.875rem; color: var(--muted); }
.post-history__changes { margin-top: var(--s-2); font-size: 0.9375rem; overflow-wrap: anywhere; }
.post-history__field { font-weight: 700; color: var(--ink); }
.post-history__arrow { color: var(--muted); }
.post-history__more { margin-top: var(--s-2); }
.post-history__more > summary { font-weight: 700; color: var(--accent-ink); cursor: pointer; }
.post-history__names { font-weight: 400; color: var(--muted); }
.post-history__diff { margin-top: var(--s-3); }
.post-history__diff > .post-history__field { margin: 0 0 var(--s-1); }
.post-history__plain { max-height: 20rem; margin: 0; padding: var(--s-2) var(--s-3); overflow: auto; font-size: 0.875rem; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--paper-2); border-radius: var(--radius); }
.line-diff { max-height: 24rem; margin: 0; padding: var(--s-1) 0; overflow: auto; font: 400 0.8125rem/1.5 var(--font-mono); list-style: none; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.line-diff__line { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); padding: 1px var(--s-2) 1px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.line-diff__mark { text-align: center; color: var(--muted); }
.line-diff__line del, .line-diff__line ins { text-decoration: none; }
.line-diff__line--removed { color: var(--error-ink); background: color-mix(in srgb, var(--error-ink) 10%, transparent); }
.line-diff__line--removed .line-diff__mark { color: var(--error-ink); }
.line-diff__line--added { color: var(--accent-ink); background: color-mix(in srgb, var(--accent-line) 14%, transparent); }
.line-diff__line--added .line-diff__mark { color: var(--accent-ink); }
.line-diff__gap { padding: 2px var(--s-2) 2px 1.5rem; font-family: var(--font-body); font-style: italic; color: var(--muted); }
@media (min-width: 1025px) {
  .post-editor__layout { grid-template-columns: minmax(0, 1fr) 380px; }
  .post-editor[data-settings="closed"] .post-editor__layout { grid-template-columns: minmax(0, 1fr); }
  .post-editor[data-settings="closed"] .post-editor__sidebar { display: none; }
  /* The settings scroll on their own beside a long post; their scrollbar always shows, so
     a panel cut off at the bottom reads as more to scroll, not as a cropped card. */
  .post-editor__sidebar { position: sticky; top: calc(var(--header-h) + var(--s-3)); max-height: calc(100vh - var(--header-h) - var(--s-6)); overflow: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
  .post-editor__sidebar-head [data-post-settings-close] { display: none; }
}
@media (min-width: 1800px) {
  .post-editor__layout { grid-template-columns: minmax(0, 1fr) 420px; }
}
@media (max-width: 1024px) {
  .post-editor--js .post-editor__sidebar { position: fixed; inset: 0 0 0 auto; z-index: 70; width: min(100%, 380px); overflow: auto; border-radius: 0; box-shadow: 0 0 0 100vmax rgb(20 17 15 / 45%); }
  .post-editor--js[data-settings="closed"] .post-editor__sidebar { display: none; }
}
@media (max-width: 640px) {
  .post-editor .page-head__actions { width: 100%; }
  .post-editor .page-head__actions > .btn:not(.btn--icon), .post-editor .page-head__actions > form { flex: 1 1 0; min-width: 0; }
  .post-editor .page-head__actions > form > .btn { width: 100%; padding-inline: 8px; }
  .post-editor .page-head__actions > .btn:not(.btn--icon) { padding-inline: 8px; }
  .post-editor__more { margin-left: auto; }
  .post-editor__canvas { padding: var(--s-4) var(--s-3) var(--s-5); }
  .post-editor .page-head__actions { gap: var(--s-2); }
  .post-editor .page-head__actions .btn { white-space: nowrap; }
  .post-editor__toolbar { position: static; }
}
@media (max-width: 400px) {
  .post-editor .page-head__actions > .btn:not(.btn--icon), .post-editor .page-head__actions > form > .btn { padding-inline: 4px; font-size: 0.9375rem; }
}
.blog-image-upload__choose { position: relative; }
/* A styled file picker in a form saved later: the button shows the chosen file's name,
   wrapping a long one inside the field, and takes the focus ring of its hidden input. */
.file-choice { position: relative; width: max-content; max-width: 100%; overflow-wrap: anywhere; }
.file-choice:has(input:focus-visible) { outline: 3px solid var(--accent-line); outline-offset: 3px; }
/* Newsletter blocks: each block a framed card with its number, kind and tools on one
   line, its fields under it; two short fields share a row from 1025px, and post pickers
   stay one per row so long titles fit. */
.nl-blocks { margin-top: var(--s-5); }
.nl-blocks__title { margin: 0 0 var(--s-3); font-size: 1.125rem; }
.nl-blocks__list { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s-3); }
.nl-block { min-width: 0; padding: var(--s-3) var(--s-4) var(--s-4); border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet); }
.nl-block--dragging { opacity: 0.55; border-style: dashed; }
.nl-block__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.nl-block__handle { display: inline-grid; place-items: center; width: 32px; height: var(--tap); color: var(--muted); cursor: grab; touch-action: none; }
.nl-block__handle[hidden] { display: none; }
.nl-block__handle svg { width: 20px; height: 20px; }
.nl-block__name { flex: 1 1 auto; min-width: 0; font-weight: 700; color: var(--ink); }
.nl-block__tools { display: flex; gap: var(--s-1); margin-left: auto; }
.nl-block__tools .btn:disabled { opacity: 0.4; cursor: not-allowed; }
.nl-block__body { margin-top: var(--s-3); }
.nl-block__pair, .nl-block__trio { display: grid; gap: 0 var(--s-4); }
.nl-block .check { margin-top: var(--s-1); }
.nl-blocks__add { display: grid; gap: var(--s-2); margin-top: var(--s-4); }
.nl-blocks__add-title { font-weight: 700; color: var(--ink); }
.nl-blocks__add-buttons { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.nl-blocks__add-buttons .btn { gap: 6px; }
.nl-blocks__add-buttons svg { width: 18px; height: 18px; }
.nl-rich__bar { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.nl-rich__bar .btn[aria-pressed="true"], .nl-rich__bar .btn[aria-expanded="true"] { border-color: var(--accent-line); background: var(--green-100); color: var(--accent-ink); }
.nl-rich__link { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.nl-rich__link input { flex: 1 1 12rem; width: auto; }
.nl-rich__area { min-height: 140px; padding: 10px 12px; font: 400 1.0625rem/1.6 var(--font-body); color: var(--ink); background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); overflow-wrap: anywhere; }
.nl-rich__area:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; border-color: var(--accent-line); }
.nl-rich__area p { margin: 0 0 0.75em; }
.nl-rich__area ul, .nl-rich__area ol { margin: 0 0 0.75em; padding-left: 1.5em; }
.nl-rich__area a { color: var(--accent-ink); }
.nl-image { display: grid; gap: var(--s-3); }
.nl-image__thumb { display: block; max-width: 100%; max-height: 220px; width: auto; border-radius: var(--radius); border: 1px solid var(--rule); }
.nl-image__thumb[hidden] { display: none; }
.nl-image__upload { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.nl-image__upload[hidden] { display: none; }
.nl-image .field__error { margin: 0; color: var(--error-ink); font-weight: 700; }
@media (min-width: 1025px) {
  .nl-block__pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 1280px) {
  .newsletter-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .newsletter-live { position: sticky; top: calc(var(--header-h) + var(--s-4)); }
  .newsletter-live__box .email-frame { height: calc(100vh - var(--header-h) - 12rem); min-height: 480px; }
}

/* ---------- Status pills ---------- */
/* An uploaded file: icon, name and size, and Download, which wraps under the name on a
   phone. Its virus check sits under the box. */
.file-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: 12px var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper-2); }
.file-card__icon { width: 24px; height: 24px; color: var(--muted); }
.file-card__name { display: block; font-weight: 700; overflow-wrap: anywhere; }
.file-card__meta { display: block; font-size: 0.875rem; color: var(--muted); }
.file-card + .file-card__check { margin-top: 4px; }
@media (max-width: 640px) {
  .file-card { grid-template-columns: auto minmax(0, 1fr); justify-self: stretch; width: 100%; }
  .file-card__download { grid-column: 2; justify-self: start; }
}
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: 999px; border: 1px solid; font-size: 0.875rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill--paid, .pill--sent, .pill--processed, .pill--delivered, .pill--opened, .pill--clicked, .pill--viewed, .pill--copied, .pill--won, .pill--applied, .pill--ready { color: var(--tone-green-ink); background: var(--tone-green-bg); border-color: var(--tone-green-line); }
.pill--sending, .pill--processing, .pill--received, .pill--simulated, .pill--requested, .pill--pending, .pill--partly-refunded, .pill--double, .pill--delayed, .pill--waiting, .pill--copying, .pill--under-review, .pill--open, .pill--partly-paid, .pill--credit, .pill--attention { color: var(--tone-yellow-ink); background: var(--tone-yellow-bg); border-color: var(--tone-yellow-line); }
.pill--failed, .pill--rejected, .pill--bounced, .pill--complained, .pill--needs-response, .pill--lost, .pill--dispute-lost, .pill--overdue { color: var(--tone-red-ink); background: var(--tone-red-bg); border-color: var(--tone-red-line); }
/* An invoice or quote that is with the client and not settled yet: in progress, not done. */
.pill--awaiting { color: var(--tone-blue-ink); background: var(--tone-blue-bg); border-color: var(--tone-blue-line); }
.pill--void, .pill--draft, .pill--ignored, .pill--duplicate, .pill--refunded, .pill--canceled, .pill--started, .pill--nomatch, .pill--closed, .pill--demo { color: var(--muted); background: var(--paper-2); border-color: var(--rule-strong); }
.pill-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }

/* Where a QuickBooks record was made: a square tag, so it never reads as a status. */
.source { display: inline-flex; align-items: center; min-height: 26px; padding: 1px 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius); font-size: 0.875rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.source--hq { color: var(--accent-ink); border-color: var(--accent-line); background: var(--green-100); }

/* ---------- Empty state ---------- */
.empty { margin: 0 0 var(--s-5); padding: var(--s-7) var(--s-5); text-align: center; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.empty:last-child { margin-bottom: 0; }
.empty p { margin-inline: auto; max-width: 48ch; }
.empty > :last-child { margin-bottom: 0; }
.empty__title { font-family: var(--font-display); font-size: var(--fs-h4); font-weight: 750; color: var(--heading); margin-bottom: var(--s-2); }

/* ---------- Forms ---------- */
/* A field in a grid row keeps its natural height (label, control, hint) instead of
   stretching to the tallest field beside it, so controls line up along the top. */
.field { display: grid; align-content: start; gap: 6px; margin-bottom: var(--s-4); min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label { font-weight: 700; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1.0625rem var(--font-body); color: var(--ink);
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius);
}
.field select { appearance: none; overflow: hidden; text-overflow: ellipsis; padding-right: 40px; background-image: var(--select-chevron); background-position: right 8px center; background-size: 20px 20px; background-repeat: no-repeat; }
/* Checkboxes are drawn, so they look the same in every browser: Safari's own box is small
   and nearly white when it is empty. */
input[type="checkbox"] {
  appearance: none; display: inline-grid; place-content: center; flex: none; width: 22px; height: 22px; margin: 0; vertical-align: middle;
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: 4px; cursor: pointer;
}
input[type="checkbox"]::before { content: ""; width: 12px; height: 7px; margin-top: -3px; border: solid var(--field); border-width: 0 0 3px 3px; transform: rotate(-45deg); visibility: hidden; }
input[type="checkbox"]:checked { background: var(--accent-line); border-color: var(--accent-line); }
input[type="checkbox"]:checked::before { visibility: visible; }
input[type="checkbox"]:focus-visible { outline: 3px solid var(--accent-line); outline-offset: 2px; }
input[type="checkbox"]:disabled { cursor: not-allowed; opacity: 0.5; }
/* Number boxes drop the browser's own up and down arrows, which Safari draws inside the box. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); opacity: 1; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { border-color: var(--accent-line); }
.field [aria-invalid="true"] { border-color: var(--error-ink); }
.field__hint { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.grid-2, .grid-3 { display: grid; gap: var(--s-4); margin-bottom: var(--s-4); }
/* A column group spaces its own rows and the block after it, at every width, so a page
   never needs its own rule to keep the next field from touching it. */
.grid-2:last-child, .grid-3:last-child { margin-bottom: 0; }
.settings-columns { display: grid; gap: 0 var(--s-4); }
.switch-list > .switch:first-child { border-top: 0; }
.settings-column > .switch { border-top: 0; }
.mobile-verify { display: flex; gap: var(--s-2); align-items: stretch; }
.mobile-verify input { flex: 1 1 auto; min-width: 0; }
.mobile-verify .btn { flex: none; min-height: 48px; }
.check-dialog__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
.check-dialog__buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin-top: var(--s-4); }
.check-dialog__buttons .btn { min-height: var(--tap); font-size: 1.0625rem; }
@media (max-width: 480px) { .check-dialog__buttons { grid-template-columns: 1fr; } }
@media (min-width: 1025px) { .settings-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .settings-column + .settings-column { border-top: 1px solid var(--rule); }
  /* A field that ends a stacked column keeps the switches' 12px off the next line. */
  .settings-column:not(:last-child) > .field:last-child { padding-bottom: var(--s-3); }
}
/* The payment reminders' send time sits in the first column, above the three switches. */
.invoice-reminder-time { margin-bottom: var(--s-4); padding-bottom: var(--s-4); border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-2 > .field, .grid-3 > .field { margin-bottom: 0; }
/* A phone number and its extension share one grid cell, the extension kept narrow. */
.phone-pair { display: grid; grid-template-columns: minmax(0, 1fr) 7rem; align-items: start; gap: 0 var(--s-3); min-width: 0; }
/* A contact's other phone numbers: each box with Make main and Remove beside it on wide
   screens, and under it at 1024px and below. */
.phone-other { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 0 var(--s-4); min-width: 0; margin-bottom: var(--s-4); }
.phone-other > .field { margin-bottom: 0; }
@media (max-width: 1024px) {
  .phone-other { grid-template-columns: max-content max-content minmax(0, 1fr); }
  .phone-other > .field { grid-column: 1 / -1; }
}
/* On a small phone the phone number and its extension take a row each. */
@media (max-width: 480px) {
  .phone-pair { grid-template-columns: minmax(0, 1fr); }
  .phone-pair > .field:last-child { max-width: 9rem; }
}
.field--check { align-content: end; }

/* The CBN Ventures calendar (src/islands/date-picker.ts): a button drawn like a field that
   opens a month grid under it. Without JavaScript the plain date input shows instead. */
.date-picker { position: relative; }
.date-picker__trigger {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1.0625rem var(--font-body); color: var(--ink); text-align: left;
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer;
}
.date-picker__trigger:hover { border-color: var(--accent-line-soft); }
.date-picker__trigger:focus-visible, .date-picker__trigger[aria-expanded="true"] { border-color: var(--accent-line); }
.date-picker__icon { flex: none; width: 20px; height: 20px; color: var(--accent-ink); }
.date-picker__panel {
  position: absolute; z-index: 30; top: 100%; left: 0; width: 320px; max-width: calc(100vw - 32px); padding: var(--s-3);
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--panel-shadow);
}
.date-picker__panel--end { left: auto; right: 0; }
.date-picker__head { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.date-picker__title { margin: 0; text-align: center; font-family: var(--font-display); font-size: 1.0625rem; font-weight: 700; color: var(--ink); }
.date-picker__nav {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  color: var(--accent-ink); background: transparent; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.date-picker__nav:hover { background: var(--green-100); border-color: var(--rule); }
.date-picker__nav svg { width: 20px; height: 20px; }
.date-picker__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.date-picker__grid th {
  padding: 0 0 6px; text-align: center; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.date-picker__grid td { height: 40px; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink); border-radius: var(--radius); cursor: pointer; }
.date-picker__grid td:hover { background: var(--green-100); }
.date-picker__grid td.is-outside { color: var(--placeholder); }
.date-picker__grid td[aria-current="date"] { box-shadow: inset 0 0 0 2px var(--orange-600); font-weight: 700; }
.date-picker__grid td[aria-selected="true"] { background: var(--accent-line); color: var(--sheet); font-weight: 700; }
.date-picker__grid td[aria-disabled="true"] { background: transparent; color: var(--placeholder); text-decoration: line-through; cursor: not-allowed; }
.date-picker__grid td:focus-visible { position: relative; z-index: 1; outline-offset: 1px; }
.date-picker__foot { display: flex; justify-content: flex-end; margin-top: var(--s-2); padding-top: var(--s-2); border-top: 1px solid var(--rule); }
@media (max-width: 559px) {
  .date-picker__panel, .date-picker__panel--end { left: 0; right: 0; width: auto; }
}
.check { display: flex; gap: var(--s-3); align-items: flex-start; min-height: 48px; padding-top: 10px; font-weight: 700; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--green-900); flex: none; }
/* A check inside a form field keeps its drawn box: the field's text-box height, padding
   and corner would otherwise stretch it. */
.field .check input[type="checkbox"] { min-height: 0; padding: 0; border-radius: 4px; }
.check:has(input:disabled) { color: var(--muted); cursor: not-allowed; }

.form-actions { display: grid; gap: var(--s-3); }
.form-actions--inline { display: flex; flex-wrap: wrap; margin-bottom: var(--s-6); }
/* Save and Cancel side by side: the same kind of button at the same width. */
.form-actions--even > .btn { min-width: 9rem; }
/* On a small phone a row of buttons shares the width evenly, and a button that wraps to
   its own line fills it, so stacked buttons match in size. */
@media (max-width: 480px) {
  .page-head__actions:has(> :nth-child(2)) { width: 100%; }
  .form-actions--inline > .btn, .page-head__actions > .btn, .page-head__actions > form, .page-head__actions > .actions-menu { flex: 1 1 0; min-width: fit-content; }
  .page-head__actions > form > .btn, .page-head__actions > .actions-menu > .btn { width: 100%; }
  /* An icon button keeps its square, so it is never squeezed or pushed onto a row of its own. */
  .page-head__actions > .btn--icon, .page-head__actions > form:has(> .btn--icon) { flex: none; }
  .page-head__actions > form > .btn--icon { width: var(--tap); }
  .form-actions--inline > .btn { padding-inline: 14px; }
  /* Header buttons share the same narrower padding, so two of them fit one row in equal halves. */
  .page-head__actions > .btn:not(.btn--icon), .page-head__actions > form > .btn:not(.btn--icon) { padding-inline: 12px; }
  /* A newsletter draft: Send a test to me across the top, then Schedule and Send now in
     equal halves beside Delete. */
  .page-head__actions:has(> .newsletter-head__test) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--tap); }
  .page-head__actions > .newsletter-head__test { grid-column: 1 / -1; }
}
.data td .form-actions--inline { margin-bottom: 0; }
/* A phone number stays on one line in a list. */
.data a[href^="tel:"] { white-space: nowrap; }
.form-error { margin: 0; padding: var(--s-3) var(--s-4); background: var(--error-bg); color: var(--error-ink); border: 1px solid var(--tone-red-line); border-radius: var(--radius); font-weight: 600; }

/* Every page and every form uses the full page width from the left edge (decided
   2026-11-08). */

/* Invoice form: the work on the left, the summary and fee switches on the right. */
/* The 16px below the form keeps the space above the footer the page was laid out with
   while it ran in quirks mode, which gives a form that margin. */
.invoice-form { display: grid; gap: var(--s-5); align-items: start; margin-bottom: var(--s-4); }
@media (min-width: 1025px) { .invoice-form { grid-template-columns: minmax(0, 1fr) 340px; } .invoice-form__side { position: sticky; top: 104px; } }
.invoice-form__main > .sheet:last-child { margin-bottom: 0; }

/* The suggestions hang from the search box itself, just under it, not from the whole
   field with its hints. */
.combo__anchor { position: relative; }
.combo__list {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px 0; list-style: none;
  max-height: 320px; overflow-y: auto; background: var(--sheet); border: 2px solid var(--accent-line); border-radius: var(--radius); box-shadow: 0 10px 28px var(--panel-shadow);
}
.combo__list li { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--rule); }
.combo__list li:last-child { border-bottom: 0; }
.combo__list li[aria-selected="true"], .combo__list li:hover { background: var(--green-100); }
.combo__name { display: block; font-weight: 700; color: var(--ink); }
.combo__meta { display: block; font-size: 0.9375rem; color: var(--muted); }
.combo__empty { color: var(--muted); cursor: default; }

.client-card { margin: 0 0 var(--s-4); padding: var(--s-4); background: var(--plate); border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.client-card p { margin: 0 0 var(--s-1); }
.client-card__name { font-weight: 700; color: var(--ink); font-size: 1.0625rem; }
.client-card__address { color: var(--muted); white-space: pre-line; }

.lines { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); container-type: inline-size; }
.lines:empty { display: none; }
.lines__limit { margin-top: var(--s-2); }
/* Lines lay out by the width of their own column (container query), not the window,
   because the summary column beside them takes a fixed share of wide screens. */
/* Narrow: the item and its remove button, the description, quantity and a wider rate, then
   the line's amount on its own row, so a five-figure amount never runs into the rate. */
.line {
  display: grid; gap: var(--s-3); align-items: end; padding: var(--s-4); background: var(--plate); border: 1px solid var(--rule); border-radius: var(--radius);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
  grid-template-areas: "item item remove" "description description description" "qty rate rate" "amount amount amount";
}
.line .field { margin: 0; }
.line__item { grid-area: item; }
.line__description { grid-area: description; }
.line__qty { grid-area: qty; }
.line__rate { grid-area: rate; }
.line__amount { grid-area: amount; display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.line__amount-label { font-weight: 700; color: var(--ink); }
.line__amount output { font-family: var(--font-mono); font-weight: 600; color: var(--accent-ink); }
.line__remove { grid-area: remove; justify-self: end; align-self: end; width: 44px; height: 48px; display: grid; place-items: center; background: transparent; color: var(--muted); border: 2px solid var(--rule-strong); border-radius: var(--radius); cursor: pointer; }
/* On a small phone the remove button moves down beside the amount, so the item picker
   gets the line's full width. */
@media (max-width: 480px) {
  .line { grid-template-areas: "item item item" "description description description" "qty rate rate" "amount amount remove"; }
  /* A long amount drops under its label rather than running into the remove button. */
  .line__amount { flex-wrap: wrap; min-width: 0; }
}
.line__remove:hover { color: var(--error-ink); border-color: var(--error-ink); }
.line__remove svg { width: 18px; height: 18px; }
/* Wide: one row. The item column is never narrower than its "Choose an item" prompt. The
   amount column grows to the widest line amount (the script sets --amount-chars; its
   monospaced characters are 0.632em wide), so it never runs into the remove button. */
@container (min-width: 760px) {
  .line { grid-template-columns: minmax(12rem, 1.3fr) minmax(0, 1.4fr) 76px 128px max(104px, calc(var(--amount-chars, 0) * 0.632em)) 44px; grid-template-areas: "item description qty rate amount remove"; }
  .line__amount { display: grid; grid-template-rows: auto 48px; justify-items: end; align-content: start; gap: 6px; min-height: 0; padding-top: 0; border-top: 0; }
  .line__amount output { display: flex; align-items: center; justify-content: flex-end; min-height: 48px; }
}

.summary .plate__body { padding-block: 0; }
/* The new invoice's total also shrinks to fit when it is very long: the script sets --chars
   to its length, and the readout's monospaced characters are 0.632em wide. */
.summary .readout { font-size: min(1.375rem, calc(100cqi / (var(--chars, 1) * 0.632))); }
.summary__limit { margin: 0 0 12px; }
.summary__tax { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.fees .field__hint, .methods .field__hint { margin-bottom: var(--s-4); }
.fees .field__hint:last-child { margin: var(--s-2) 0 0; }

/* Fee switches: a real checkbox drives a drawn track, so keyboard and screen readers work. */
.switch { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: var(--s-3); align-items: start; padding: var(--s-3) 0; border-top: 1px solid var(--rule); cursor: pointer; }
.switch input { position: absolute; width: 48px; height: 28px; margin: 0; opacity: 0; cursor: pointer; }
.switch__track { position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--rule-strong); transition: background 0.15s; margin-top: 2px; }
.switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--accent-line); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--accent-line); outline-offset: 3px; }
.switch:has(input:disabled), .switch input:disabled { cursor: not-allowed; }
.switch input[type="checkbox"]:disabled { opacity: 0; }
.switch input:disabled + .switch__track, .switch:has(input:disabled) .switch__text { opacity: 0.5; }
.switch__text { display: grid; gap: 2px; }
.switch__text > span { color: var(--muted); font-size: 0.9375rem; }
.switch__text strong { font-size: 1rem; }
.switch__estimate { color: var(--accent-ink) !important; font-weight: 700; }
.switch__estimate:empty { display: none; }
/* A switch that belongs to the one above it sits under that one's words and shows only
   while that one is on, with or without JavaScript. */
.switch--nested { margin-left: calc(48px + var(--s-3)); }
.switch:has(> input:not(:checked)) + .switch--nested { display: none; }

/* Settings pages use the full page width, like the Status page and the lists. */
.settings-page { min-width: 0; }
.settings-form .sheet { margin-bottom: var(--s-5); }
.connection p { margin-bottom: var(--s-3); }
.connection form { margin: 0; }
.connection__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
/* Usage on Settings: a card per count, grouped by service, laid out like the configuration
   check below it. A bar's track is a lighter step of its fill's tone, green while there is
   room, amber from 80% and red from 95%, with the words under it so colour never works
   alone. A column is 16rem at least, or the whole width on a phone narrower than that. */
.usage { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
@media (min-width: 560px) { .usage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .usage { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.usage-card { display: grid; align-content: start; gap: var(--s-2); padding: var(--s-4); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.usage-card__label { margin: 0; font-size: 0.9375rem; font-weight: 700; color: var(--muted); }
.usage-card__value { margin: 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.usage-card__of { margin-left: var(--s-1); font-size: 1rem; font-weight: 400; color: var(--muted); }
.usage-card__detail { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.meter { display: grid; gap: var(--s-2); }
.meter__bar svg { display: block; width: 100%; height: 8px; }
.meter__track { fill: var(--tone-green-bg); }
.meter__fill { fill: var(--tone-green-line); }
.meter__bar--near .meter__track { fill: var(--tone-orange-bg); }
.meter__bar--near .meter__fill { fill: var(--tone-orange-line); }
.meter__bar--at .meter__track { fill: var(--tone-red-bg); }
.meter__bar--at .meter__fill { fill: var(--tone-red-line); }
/* The dark tone backgrounds sit below the card, so the dark tracks are a step lighter. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .meter__track { fill: #2a4430; }
  :root:not([data-theme="light"]) .meter__bar--near .meter__track { fill: #4a301e; }
  :root:not([data-theme="light"]) .meter__bar--at .meter__track { fill: #55292a; }
}
:root[data-theme="dark"] .meter__track { fill: #2a4430; }
:root[data-theme="dark"] .meter__bar--near .meter__track { fill: #4a301e; }
:root[data-theme="dark"] .meter__bar--at .meter__track { fill: #55292a; }
.meter__note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.9375rem; font-weight: 700; }
.meter__note svg { flex: none; width: 16px; height: 16px; }
.meter__note--near { color: var(--tone-orange-ink); }
.meter__note--at { color: var(--tone-red-ink); }

/* Status cards: backups, California privacy law and search engines side by side on
   desktop, stacked in mobile mode. Each has its title, a fact in the Running fine look,
   and its page link at the foot, so the links line up across the row. */
.status-cards { display: grid; gap: var(--s-5); margin-bottom: var(--s-5); }
.status-cards > .status-card { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; margin: 0; }
.status-cards > .status-card > .sheet__title { margin-bottom: 0; }
.status-card__fact, .status-card__detail { margin: 0; }
.status-card__detail { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.status-card__link { width: fit-content; margin-top: auto; padding-top: var(--s-1); }
.status-measures { display: grid; gap: var(--s-4); }
.status-measure { display: grid; gap: var(--s-2); min-width: 0; }
.status-measure__head { display: flex; justify-content: space-between; gap: var(--s-3); margin: 0; font-weight: 700; color: var(--ink); }
.status-measure__percent { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-measure__value { margin: 0; color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (min-width: 1025px) {
  .status-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* The configuration check: a block per check, each opening its details in a dialog over
   the page. The blocks share the row's full width equally, up to four across on a wide
   screen, two in mobile mode and one per row on a phone. */
.check-grid { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin: 0; padding: 0; }
@media (min-width: 560px) {
  .check-grid[data-columns]:not([data-columns="0"], [data-columns="1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
  .check-grid[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .check-grid[data-columns="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Sync's service cards share the row between them, and each figure sits on one line
   beside its label instead of in the wide label column other detail lists use. */
.sync-services { grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }
.sync-services__details > div { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; }
.sync-services__details dd { text-align: right; white-space: nowrap; }
/* The state colour is an inset 4px stripe inside the 1px border, so it follows the
   rounded corners instead of a thick top border tapering into them. */
.check-card { --check-edge: var(--tone-green-line); display: grid; grid-template-rows: auto 1fr auto; gap: var(--s-2); padding: calc(var(--s-4) + 3px) var(--s-4) var(--s-4); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: inset 0 4px 0 var(--check-edge); }
.check-card--warn { --check-edge: var(--tone-orange-line); }
.check-card--demo { --check-edge: var(--rule-strong); }
.check-card__head { display: grid; justify-items: start; align-content: start; gap: var(--s-2); }
.check-card__name { margin: 0; font-size: 1.0625rem; }
.check-card__state { margin: 0; color: var(--muted); }
.check-card__open { justify-self: start; }
.check-card .check-card__open { margin-top: var(--s-4); }
.check-dialog { width: min(40rem, calc(100% - 2 * var(--s-4))); max-height: calc(100% - 2 * var(--s-5)); padding: 0; color: var(--text); background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.check-dialog::backdrop { background: rgb(20 17 15 / 55%); }
.check-dialog__body { padding: var(--s-5); }
.check-dialog__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); margin-bottom: var(--s-2); }
.check-dialog__title { margin: 0; }
.check-dialog__title:focus { outline: none; }
.check-dialog__state { margin: 0 0 var(--s-4); color: var(--muted); }
.check-dialog__subtitle { margin: var(--s-4) 0 var(--s-2); font-size: 1rem; color: var(--ink); }
.check-dialog__actions { display: flex; justify-content: flex-end; margin: var(--s-5) 0 0; }
/* A check that lists fields by record kind gets a wider dialog, so the lists run in
   columns instead of one long column. */
.check-dialog--wide { width: min(60rem, calc(100% - 2 * var(--s-4))); }

/* Set up fields' progress window: the backup meter across the window, the count and
   the last items made, newest first. */
.setup-progress { display: grid; gap: var(--s-2); margin-top: var(--s-3); }
.setup-progress__meter { max-width: none; margin-top: 0; }
.setup-progress__count { margin: 0; font-weight: 700; }
.setup-progress__list { margin: 0; padding-left: 1.4em; color: var(--muted); overflow-wrap: anywhere; }
.setup-progress__list:empty { display: none; }
.setup-progress ~ .flash { margin: var(--s-4) 0 0; }

/* Field names under a heading per record kind, in the body font, running in columns on a
   wide screen (three), in mobile mode (two) and one column on a phone. */
.field-groups { display: grid; gap: var(--s-4); margin: 0 0 var(--s-4); }
.field-groups__title { margin: 0 0 var(--s-2); font-size: 1rem; color: var(--ink); }
.field-groups__list { columns: 1; column-gap: var(--s-5); margin: 0; padding-left: 1.25rem; }
.field-groups__list li { margin: 0 0 var(--s-1); break-inside: avoid; }
@media (min-width: 560px) {
  .field-groups__list { columns: 2; }
}
@media (min-width: 1025px) {
  .field-groups__list { columns: 3; }
}

/* A setup step's permissions: one per line, the name on the left and its level lined up
   in a column beside it. */
.setup-permissions { display: grid; grid-template-columns: minmax(0, max-content) max-content; gap: 4px var(--s-5); margin-top: var(--s-2); }
.setup-permissions__row { display: contents; }
.setup-permissions__level { color: var(--muted); }

/* A saved secret's last three characters, beside "Set", to tell which one is saved. */
.check-items__tail { white-space: nowrap; }

/* Short settings fields two to a row on a wide screen, each hint under its own field and
   each row's fields lined up; stacked in mobile mode. A lone last field leaves its
   neighbour's place empty. */
.field-pairs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); margin: 0 0 var(--s-4); }
.field-pairs > .field { margin: 0; }
@media (min-width: 1025px) {
  .field-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-5); }
  .field-pairs--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* On a small phone a long sending address fits its box whole. */
@media (max-width: 400px) {
  .field-pairs input[type="email"] { font-size: 0.9375rem; }
}

/* Two short sheets side by side on a wide screen, equal in height, and stacked in mobile
   mode. */
.sheet-pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); margin: 0 0 var(--s-5); }
.sheet-pair > .sheet, .settings-form .sheet-pair > .sheet { margin: 0; }
@media (min-width: 1025px) {
  .sheet-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.external-link-dialog__address { margin: var(--s-2) 0 0; color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-small); overflow-wrap: anywhere; }
.confirm-dialog [data-confirm-dialog-text] { white-space: pre-line; }
.external-link-dialog__actions, .confirm-dialog__actions { gap: var(--s-3); }
.external-link-dialog__actions > .btn, .confirm-dialog__actions > .btn { flex: 1 1 0; min-height: 48px; }
.external-link-dialog[data-three-actions] .external-link-dialog__actions { flex-direction: column; }
.external-link-dialog[data-three-actions] .external-link-dialog__actions > .btn { flex-basis: auto; width: 100%; }
@media (max-width: 559px) {
  .external-link-dialog__actions, .confirm-dialog__actions { flex-direction: column; }
  .external-link-dialog__actions > .btn, .confirm-dialog__actions > .btn { flex-basis: auto; width: 100%; }
}
@media (min-width: 560px) {
  .external-link-dialog__actions, .confirm-dialog__actions { flex-direction: row; }
}
.check-items { list-style: none; margin: 0; padding: 0; }
.check-items__item { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--s-3); padding: 8px 0 8px 22px; border-bottom: 1px solid var(--rule); }
.check-items__item::before { content: ""; position: absolute; left: 2px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--tone-green-line); }
.check-items__item--warn::before { background: var(--orange-600); }
.check-items__name { font-weight: 600; color: var(--ink); }
.check-items__state { color: var(--muted); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.check-steps { margin: 0; padding-left: 1.4em; }
.check-steps li { margin-bottom: var(--s-3); }
/* The values a step names (webhook events, scopes, setting names, addresses): one per line,
   top down in their natural order, in the code font without chip boxes, easy to select.
   A long value wraps inside its own line. */
.code-list { display: grid; gap: 2px; min-width: 0; max-width: 100%; margin: var(--s-2) 0 0; padding: 0; list-style: none; }
.code-list li { min-width: 0; margin: 0; }
.code-list code { display: block; padding: 0; font-family: var(--font-mono); font-size: 0.9375rem; color: var(--ink); background: none; border-radius: 0; overflow-wrap: anywhere; }
.setup-link { display: block; margin-top: var(--s-2); }
.check-dialog__note { margin: var(--s-4) 0; }
.check-items__setting { display: block; width: fit-content; margin-top: 4px; font-size: var(--fs-small); font-weight: 400; }
.check-tips { margin: 0; padding-left: 1.4em; list-style: disc; }

/* Under an integration, the pages that work with it: a block each, laid out like the
   checks above them, with the line the menu shows for the page. */
.related-pages { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: var(--s-3); margin: 0; padding: 0; }
.related-pages__link {
  display: grid; align-content: start; gap: 2px; height: 100%; padding: var(--s-3) var(--s-4);
  color: var(--ink); text-decoration: none; border: 1px solid var(--rule); border-radius: var(--radius);
}
.related-pages__link:hover { border-color: var(--accent-line); background: var(--green-100); text-decoration: none; }
.related-pages__name { font-weight: 700; color: var(--accent-ink); }
.related-pages__detail { font-size: 0.9375rem; line-height: 1.4; color: var(--muted); }
.check-tips li { margin-bottom: var(--s-3); }

/* Alert tables: Profile, a person's page and a shared mailbox's page have one column per
   way an alert arrives (email, HQ, text). Rows are the alerts, grouped by
   area. In mobile mode each alert is a card. */
.alert-grid-wrap { margin-bottom: var(--s-5); }
.field__hint + .alert-grid-wrap { margin-top: var(--s-3); }
.alert-grid .alert-grid__alert { min-width: 14rem; font-weight: 400; }
.alert-grid__name { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.alert-grid__when { display: block; margin-top: 2px; font-size: 0.9375rem; color: var(--muted); }
.alert-grid__group th { font-weight: 700; color: var(--ink); background: var(--paper-2); }
.alert-grid tbody + tbody .alert-grid__group th { border-top: 1px solid var(--rule); }
.alert-grid input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent-line); cursor: pointer; }
.alert-grid input[type="checkbox"]:disabled { cursor: not-allowed; }
.alert-grid__none { color: var(--muted); }
.alert-grid__with { font-size: 0.875rem; color: var(--muted); white-space: nowrap; }
@media (min-width: 1025px) {
  .alert-grid .alert-grid__channel, .alert-grid .alert-grid__pick { width: 1%; text-align: center; }
  .alert-grid .alert-grid__pick input[type="checkbox"] { display: grid; margin: 1px auto 0; }
}
@media (max-width: 1024px) {
  .data.alert-grid tbody tr.alert-grid__group { margin: var(--s-5) 0 var(--s-2); background: none; border: 0; }
  .data.alert-grid tbody:first-of-type tr.alert-grid__group { margin-top: 0; }
  .data.alert-grid .alert-grid__group th { padding: 0; background: none; border: 0; }
  .data.alert-grid .alert-grid__alert { min-width: 0; padding: 10px var(--s-4); border-bottom: 1px solid var(--rule); }
  .data.alert-choices td { grid-template-columns: 10rem minmax(0, 1fr); align-items: center; }
}
/* Small phones: the way's name takes the room left by its box or "With email", so they never touch. */
@media (max-width: 479px) {
  .data.alert-choices td { grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); }
}
.alert-table__bounce { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 0.9375rem; }

/* Form emails follow the Forms menu: one group heading, then one full-width card per
   form. Each card names the actual emails that form sends instead of exposing storage
   fields as table columns. */
.form-email-form { width: 100%; }
.form-email-group { margin-bottom: var(--s-6); }
.form-email-group__title {
  margin: 0 0 var(--s-3); font: 600 0.8125rem var(--font-mono); letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
.form-email-group__cards { display: grid; gap: var(--s-4); }
.settings-form .form-email-card { margin: 0; }
.form-email-card__title { margin-bottom: var(--s-4); font-size: 1.125rem; }
.form-email-card__note { margin: var(--s-3) 0 0; }
.form-email-card__columns, .form-email-row { display: grid; grid-template-columns: minmax(12rem, 0.8fr) minmax(15rem, 1fr) minmax(15rem, 1fr); gap: var(--s-4); }
.form-email-card__columns {
  padding: 0 0 var(--s-2); font: 600 0.8125rem var(--font-mono); letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--accent-line);
}
.form-email-row { align-items: start; padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.form-email-row:last-child { padding-bottom: 0; border-bottom: 0; }
.form-email-row__email { padding-top: 13px; font-weight: 700; color: var(--ink); }
.form-email-row__email label { cursor: pointer; }
.form-email-row__field { margin: 0; }
.form-email-row__mobile-label { display: none; }
.form-email-row__plain { display: grid; align-content: center; min-height: 48px; }
.form-email-row__muted { color: var(--muted); }
@media (max-width: 1024px) {
  .form-email-card__columns { display: none; }
  .form-email-row { grid-template-columns: minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4) 0; }
  .form-email-row__email { padding-top: 0; }
  .form-email-row__mobile-label { display: block; font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
  .form-email-row__plain { align-content: start; gap: 6px; min-height: 0; }
}
:lang(zh) .form-email-group__title, :lang(zh) .form-email-card__columns, :lang(zh) .form-email-row__mobile-label { letter-spacing: 0; text-transform: none; }

/* The People page: directory matches, the add form and the read-only linked list. */
.people-results { margin: 0 0 var(--s-4); padding: 0; list-style: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.people-results__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-4); }
.people-results__item + .people-results__item { border-top: 1px solid var(--rule); }
.people-results__who { display: grid; gap: 2px; min-width: 0; }
.people-results__name { font-weight: 700; color: var(--ink); }
.people-add { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--rule); }
.people-add .sheet__subtitle { margin-bottom: var(--s-1); }
.people-add .form-actions--inline > .btn { flex: 1 1 9rem; justify-content: center; }
/* On a small phone the directory search box takes the full width and Search goes under it. */
@media (max-width: 400px) {
  .people-search .search-form__row { flex-wrap: wrap; }
  .people-search .search-form__row > input, .people-search .search-form__row > .btn { flex: 1 1 100%; }
}
/* Quick choices: a label over equal-width buttons that tick a preset's boxes. */
.people-presets { display: grid; gap: var(--s-2); max-width: 48rem; margin: var(--s-4) 0; }
.people-presets[hidden] { display: none; }
.people-presets__label { font-weight: 700; color: var(--ink); }
.people-presets__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
@media (min-width: 1025px) { .people-presets__choices { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.people-presets__choices .btn { width: 100%; }
.people-areas__item > span { display: grid; gap: 2px; }
.people-areas__item .dd-sub { font-weight: 400; }
.permission-grid { min-width: 0; margin: 0 0 var(--s-4); }
.permission-grid__presets { margin-top: 0; }
.permission-grid__summary { margin: 0 0 var(--s-3); font-weight: 700; color: var(--ink); }
.permission-grid__table .permission-grid__head { width: 6.5rem; text-align: center; }
.permission-grid__section th, .permission-grid__section td { font-weight: 700; color: var(--ink); background: var(--paper-2); vertical-align: middle; }
.permission-grid__section-action { text-align: right; white-space: nowrap; }
.permission-grid__section .link-button { font-weight: 400; }
.permission-grid__table tbody + tbody .permission-grid__section > * { border-top: 1px solid var(--rule); }
.permission-grid__thing { font-weight: 400; }
.permission-grid__name { display: block; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.permission-grid__detail { display: block; margin-top: 2px; font-size: 0.9375rem; color: var(--muted); }
.permission-grid__none { color: var(--muted); }
.permission-grid__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
/* Each box is a real checkbox; on a phone its short name shows beside it as a toggle. */
.grid-box { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); cursor: pointer; }
.grid-box input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent-line); cursor: pointer; }
.grid-box input[type="checkbox"]:disabled { cursor: not-allowed; }
.grid-box:has(input:disabled) { cursor: not-allowed; }
.grid-box--extra { min-height: 40px; padding: 6px 12px; color: var(--ink); background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: 999px; }
.grid-box--extra:has(input:checked) { background: var(--green-100); border-color: var(--accent-line); }
@media (min-width: 1025px) {
  .permission-grid__table .permission-grid__box { text-align: center; vertical-align: middle; }
  .permission-grid__table .permission-grid__extras { vertical-align: middle; }
  .permission-grid__table .permission-grid__thing { min-width: 16rem; }
  .grid-box:not(.grid-box--extra) .grid-box__label { display: none; }
  .grid-box:not(.grid-box--extra) { min-width: var(--tap); min-height: 32px; }
}
@media (max-width: 1024px) {
  .data.permission-grid__table tbody tr.permission-grid__section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); margin: var(--s-5) 0 var(--s-2); background: none; border: 0; }
  .data.permission-grid__table tbody:first-of-type tr.permission-grid__section { margin-top: 0; }
  .data.permission-grid__table .permission-grid__section > * { display: block; width: auto; padding: 0; background: none; border: 0; }
  .data.permission-grid__table .permission-grid__section > td::before { content: none; }
  .data.permission-grid__table tr.permission-grid__row { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-4); }
  .data.permission-grid__table .permission-grid__thing { flex: 1 0 100%; padding: 0 0 var(--s-2); border: 0; }
  .data.permission-grid__table .permission-grid__box { display: block; flex: 1 1 0; min-width: 0; padding: 0; border: 0; }
  .data.permission-grid__table .permission-grid__box::before, .data.permission-grid__table .permission-grid__extras::before { content: none; }
  .data.permission-grid__table .permission-grid__extras { display: block; flex: 1 0 100%; padding: var(--s-2) 0 0; border: 0; }
  .data.permission-grid__table .permission-grid__box--none, .data.permission-grid__table .permission-grid__extras--none { display: none; }
  .data.permission-grid__table td > * { grid-column: auto; }
  .permission-grid__box .grid-box { display: flex; width: 100%; min-height: var(--tap); padding: 6px var(--s-2); font-weight: 700; color: var(--ink); white-space: nowrap; overflow-wrap: normal; background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); }
  .permission-grid__box .grid-box:has(input:checked) { background: var(--green-100); border-color: var(--accent-line); }
  .grid-box--extra { min-height: var(--tap); }
}
/* Narrow phones: each toggle puts its name under its box, so three still fit a row. */
@media (max-width: 599px) {
  .permission-grid__box .grid-box { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 0.9375rem; }
}
/* The People list fits its sheet on desktop: Mobile, Last sign-in and the trash button
   keep narrow fixed columns, and the person and what they can open share the rest and wrap. */
@media (min-width: 1025px) {
  .people-table { table-layout: fixed; }
  .people-table thead th { white-space: normal; }
  .people-table thead th:nth-child(3) { width: 12.5rem; }
  .people-table thead th:nth-child(4) { width: 10rem; }
  .people-table thead th:nth-child(5) { width: calc(var(--tap) + 2 * var(--s-4)); }
  .people-table tbody th, .people-table tbody td { overflow-wrap: anywhere; }
  .people-table tbody th, .people-table tbody td { vertical-align: middle; }
}
.people-table__phone { white-space: nowrap; }
.person-row__action { text-align: right; }
.person-remove-form { display: inline-flex; margin: 0; }
.person-remove { color: var(--error-ink); border-color: var(--error-ink); }
.person-remove:hover { background: color-mix(in srgb, var(--error-ink) 10%, transparent); border-color: var(--error-ink); }
.people-change-list { display: grid; gap: var(--s-1); margin: 0; padding: 0; list-style: none; }
@media (min-width: 1025px) {
  .people-changes-table td:nth-child(3) { min-width: 16rem; }
}
.people-remove-actions { max-width: 28rem; }

/* A person page keeps the three settings in familiar sheets. */
.person-mobile { max-width: 36rem; }
/* Without People and security Edit the fieldset disables the whole form; its sheets lay out as before. */
.person-page__fields { display: contents; min-width: 0; margin: 0; padding: 0; border: 0; }
/* The sender stands apart from the table's note above it, as far as the heading below. */

/* Text only screen readers hear, such as the label of the new alert address field. */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Label and value pairs, such as the Stripe webhook setup: labels in a narrow column. */
.pairs { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s-2) var(--s-4); margin: 0; }
.pairs dt { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.pairs dd { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; min-width: 0; }
.pairs code { overflow-wrap: anywhere; }
@media (max-width: 559px) {
  .pairs { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pairs dd { margin-bottom: var(--s-2); }
}

/* ---------- Timeline, logs ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule-strong); }
.timeline__item { position: relative; display: grid; gap: 2px var(--s-4); padding: 0 0 var(--s-4) var(--s-5); }
.timeline__item::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--accent-line); }
.timeline__item--error::before, .timeline__item--failed-payment::before, .timeline__item--bounced::before, .timeline__item--rejected::before, .timeline__item--complained::before { border-color: var(--error-ink); background: var(--error-bg); }
.timeline__item--warning::before, .timeline__item--delayed::before, .timeline__item--dispute::before { border-color: var(--orange-600); background: var(--tone-orange-bg); }
.timeline__item--paid::before { background: var(--accent-line); }
.timeline__time { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--muted); }
/* A SHA-256 in a line has no spaces, so it may break anywhere instead of widening the entry. */
.timeline__detail { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.timeline__actor { font-size: 0.9375rem; color: var(--muted); }
@media (min-width: 760px) { .timeline__item { grid-template-columns: 13rem 1fr auto; align-items: baseline; } }

.email-frame { display: block; width: 100%; height: 720px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: #f7f4ec; }
.code-block { margin: 0; padding: var(--s-4); max-height: 640px; overflow: auto; background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); font-size: 0.875rem; line-height: 1.5; }
.code-block code { background: none; padding: 0; white-space: pre; }
.error-text { color: var(--error-ink) !important; }

/* A dispute's evidence SHA-256 and file id: all of it, so it can be checked against the copy. */
.hash { display: block; max-width: 34ch; font-size: 0.8125rem; line-height: 1.45; overflow-wrap: anywhere; color: var(--ink); }

/* An invoice's Shared drive copies: a tab per kind of record with its count. Without
   JavaScript the tab row stays hidden and every kind shows under its own heading. */
.archive-tabs { display: grid; gap: var(--s-4); }
.archive-tabs__list { justify-self: start; max-width: 100%; }
.archive-tabs__list > .tabs__tab { margin: 0; background: transparent; border: 0; font: inherit; font-weight: 600; color: var(--accent-ink); cursor: pointer; }
.archive-tabs__list > .tabs__tab[aria-selected="true"] { background: var(--accent-line); color: var(--sheet); }
.archive-tabs__heading { margin: 0 0 var(--s-2); font-family: var(--font-mono); font-size: 0.875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.archive-tabs.is-tabbed .archive-tabs__heading { display: none; }

/* Each copy reads by what it is and when; the stored file name and folder sit under it,
   small and muted. */
.archive-file { display: grid; gap: 2px; min-width: 0; }
.archive-file__time { color: var(--ink); font-size: 0.9375rem; }
.archive-file__meta { color: var(--muted); font-size: 0.8125rem; line-height: 1.45; overflow-wrap: anywhere; }

/* The start of a copy's SHA-256, the whole of it in the tooltip and behind Copy. */
.archive-hash { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-3); }
.archive-hash__value { font-size: 0.8125rem; color: var(--ink); white-space: nowrap; cursor: help; }
.archive-hash__copy { font-size: 0.875rem; }
.section__lead { color: var(--muted); }
.section__actions { margin-top: var(--s-4); }

/* ---------- Payments and refunds ---------- */
/* A table cell with more than one line (a pill and its reason, a time and who) keeps them
   together, so on phones they stay beside the cell's label. */
.cell-stack { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.num > .cell-stack { justify-items: end; }
.data td.nowrap { white-space: nowrap; }
.cell-stack form { margin: 4px 0 0; }
.refund-double { display: grid; gap: var(--s-3); justify-items: start; }
.refund-double p { margin: 0; }
.refund-double__form { margin: 0; }
.refund-form .form-actions { align-items: center; }
/* Refund lines: one amount box per invoice line, right-aligned with the billed amounts
   beside it; on phones each line is a card and its box takes the card's width. */
.refund-lines { margin-bottom: var(--s-4); }
.refund-lines__label { font-weight: 700; color: var(--ink); }
.refund-lines .data td { vertical-align: middle; }
.refund-lines .data td.num input { width: 10rem; text-align: right; font-variant-numeric: tabular-nums; }
.refund-lines output { font-family: var(--font-mono); }
.refund-history__amount { justify-items: end; }
@media (max-width: 1024px) {
  .refund-lines .data td.num input { width: 100%; text-align: left; }
  .num > .cell-stack, .refund-history__amount { justify-items: start; }
}

/* The invoice references: under the dates on the invoice form, and under the QuickBooks
   choice on the Settings page with its explanation and review link. */
@media (min-width: 640px) {
  .invoice-form__references, .settings__references { margin-top: var(--s-4); }
  .settings__references { row-gap: var(--s-2); }
}
.settings__references { display: grid; justify-items: start; gap: var(--s-2); }
.settings__references-hint { grid-column: 1 / -1; }
.settings__references-link { grid-column: 1 / -1; margin: var(--s-2) 0 0; }
.invoice-reference-preview { display: grid; gap: var(--s-2); margin-top: var(--s-3); padding: var(--s-3); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.invoice-reference-preview p { margin: 0; }
.invoice-reference-preview code { white-space: normal; overflow-wrap: anywhere; }
.invoice-reference-warning { display: grid; gap: var(--s-2); }
.invoice-reference-warning p, .invoice-reference-warning ul { margin: 0; }
.invoice-reference-warning ul { display: grid; gap: var(--s-1); padding-left: var(--s-5); }
.reference-review td { min-width: 12rem; overflow-wrap: anywhere; }
.reference-review .forms-table__select { min-width: 0; }
.reference-review__removed {
  padding: 1px 3px;
  color: var(--error-ink);
  background: var(--error-bg);
  text-decoration: line-through;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* The clients and QuickBooks list pages: the search box with its button on one row above
   the list, and a way back to the whole list while a search is shown. The column may
   narrow, so on a small phone the box shrinks instead of pushing the button off screen. */
.search-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; max-width: 40rem; margin: 0 0 var(--s-5); }
.search-form__clear { justify-self: start; font-size: 0.9375rem; }
.search-form label { font-weight: 700; color: var(--ink); }
.search-form__row { display: flex; gap: var(--s-2); }
.search-form__row input {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; font: 400 1.0625rem var(--font-body); color: var(--ink);
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius);
}
.search-form__row input::placeholder { color: var(--placeholder); opacity: 1; }
.search-form__row input:focus-visible { border-color: var(--accent-line); }
.search-form > .search-form__row + .field { margin-top: calc(var(--s-4) - 6px); }

/* Quick find: pages, invoices and clients in one list, a group each. A row is the match's
   name and a line under it, with its section, status or action at the right end. */
.find-results { display: grid; gap: var(--s-6); }
.find-group h2 { margin-bottom: var(--s-3); }
.find-group__none { margin: 0 0 var(--s-4); color: var(--muted); }
.find-group__none:last-child { margin-bottom: 0; }
.find-group__more { margin: var(--s-3) 0 0; }
.find-list { margin: 0; padding: 0; list-style: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.find-list__item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); padding: var(--s-3) var(--s-4); }
.find-list__item + .find-list__item { border-top: 1px solid var(--rule); }
.find-list__main { display: grid; gap: 2px; flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.client-form__country { max-width: 20rem; }

/* Client hub: compact service states, live detail panels and one card per decision. */
.service-states, .service-links { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.service-links { display: grid; }
.service-state { display: inline-flex; align-items: center; gap: var(--s-1); }
.service-state__icon { width: 14px; height: 14px; }
.pill.service-state::before { display: none; }
.service-state--linked { color: var(--tone-green-ink); background: var(--tone-green-bg); border-color: var(--tone-green-line); }
.service-state--waiting { color: var(--tone-yellow-ink); background: var(--tone-yellow-bg); border-color: var(--tone-yellow-line); }
.service-state--failed, .service-state--attention { color: var(--tone-red-ink); background: var(--tone-red-bg); border-color: var(--tone-red-line); }
.details-grid { display: grid; gap: var(--s-4); margin-bottom: var(--s-6); }
/* A half-width Details or Connected services sheet too narrow for a label beside its
   value puts the label above it, as mobile does, instead of squeezing the value. */
.details-grid > .sheet { container-type: inline-size; }
@container (max-width: 32rem) { .details-grid > .sheet .details-list > div { grid-template-columns: minmax(0, 1fr); } }
.section-block { margin-top: var(--s-6); }
.section-block + :is(.sheet, .plate, .flash, .table-wrap), .section + :is(.sheet, .plate, .flash, .table-wrap):not(.section) { margin-top: var(--s-6); }
.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.section-heading h2 { margin: 0; }
.directory-location td { background: var(--paper-2); }
/* In dark mode the sunken panel colour is almost the sheet's, so a nested row takes a
   lighter tint instead, still set apart from the rows above it. */
@supports (color: light-dark(#000, #fff)) {
  .directory-location td { background: light-dark(var(--paper-2), #24302a); }
}
@media (min-width: 1025px) { .directory-location td:first-child { padding-inline-start: 2.5rem; } }
@media (max-width: 1024px) { .data .directory-location { box-shadow: inset 4px 0 0 var(--accent-line-soft); } }
@media (min-width: 1025px) {
  .directory-location[data-depth="2"] td:first-child { padding-inline-start: 4rem; }
  .directory-location[data-depth="3"] td:first-child { padding-inline-start: 5.5rem; }
  .directory-location[data-depth="4"] td:first-child { padding-inline-start: 7rem; }
}
@media (max-width: 1024px) {
  .data .directory-location:is([data-depth="2"], [data-depth="3"], [data-depth="4"]) { width: auto; }
  .data .directory-location[data-depth="2"] { margin-inline-start: var(--s-3); }
  .data .directory-location[data-depth="3"] { margin-inline-start: calc(var(--s-3) * 2); }
  .data .directory-location[data-depth="4"] { margin-inline-start: calc(var(--s-3) * 3); }
}
.attention-list { display: grid; gap: var(--s-4); }
.attention-card { padding: var(--s-4); background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); }
.attention-card__head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--s-2) var(--s-4); }
.attention-card__head time { color: var(--muted); text-align: right; white-space: nowrap; }
.attention-card__title { display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.attention-card__title input { flex: none; margin: 0; }
.attention-card__title .strong-link { text-decoration: none; }
.attention-card__title .strong-link:hover { color: var(--accent-ink); }
/* On a small phone a review card's date goes under its title. */
@media (max-width: 480px) {
  .attention-card__head { grid-template-columns: minmax(0, 1fr); }
  .attention-card__head time { text-align: left; }
}
.attention-compare { margin: var(--s-4) 0; }
.attention-compare .attention-compare__line { display: block; }
.attention-card__text { margin: var(--s-1) 0 0; }
.attention-records { display: grid; gap: var(--s-3); margin: var(--s-4) 0; }
.attention-record { display: grid; align-content: start; gap: var(--s-1); padding: var(--s-3); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.attention-actions { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-2); }
.attention-actions label { display: grid; gap: var(--s-1); }
.attention-actions > form .btn, .attention-actions > .btn { min-width: 9.75rem; min-height: 48px; justify-content: center; }
/* Search and Link to sit side by side on wide screens with their labels, fields and
   buttons on the same lines; at 1024px and below they stack. Each row is a field and a
   button of the same height, and the two buttons are the same width. */
.attention-link { flex: 1 1 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); margin-bottom: var(--s-2); }
.attention-link__form { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; min-width: 0; margin: 0; }
.attention-link__form label { display: block; font-weight: 700; color: var(--ink); }
.attention-link__row { display: flex; align-items: stretch; gap: var(--s-2); min-width: 0; }
.attention-link__row input, .attention-link__row select {
  flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; font: 400 1.0625rem var(--font-body); color: var(--ink);
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius);
}
.attention-link__row select { appearance: none; padding-right: 40px; background-image: var(--select-chevron); background-position: right 8px center; background-size: 20px 20px; background-repeat: no-repeat; }
.attention-link__row input:focus-visible, .attention-link__row select:focus-visible { border-color: var(--accent-line); }
.attention-link__row .btn { flex: none; min-width: 7.5rem; }
.attention-link > .flash { margin: 0; }
@media (min-width: 1025px) { .attention-link { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-5); } .attention-link > .flash { grid-column: 1 / -1; } }
.merge-progress { display: grid; gap: var(--s-4); margin: var(--s-4) 0 0; }
.merge-progress > .flash, .merge-progress > .details-list { margin: 0; }
.merge-steps dd { display: grid; justify-items: start; gap: var(--s-2); }
.merge-steps dd > p { margin: 0; }
.merge-choice { grid-template-columns: 24px minmax(0, 1fr); column-gap: var(--s-3); border-width: 2px; cursor: pointer; }
.merge-choice:hover { border-color: var(--accent-line-soft); }
.merge-choice:has(> input:checked) { background: var(--green-100); border-color: var(--accent-line); box-shadow: inset 0 0 0 1px var(--accent-line); }
.merge-choice:has(> input:focus-visible) { outline: 3px solid var(--accent-line); outline-offset: 3px; }
.merge-choice > input {
  display: grid; place-content: center; width: 24px; height: 24px; margin: 0; appearance: none;
  background: var(--field); border: 2px solid var(--accent-line); border-radius: 50%; cursor: pointer;
}
.merge-choice > input::before { content: ""; width: 12px; height: 12px; background: var(--accent-line); border-radius: 50%; transform: scale(0); transition: transform 100ms ease-out; }
.merge-choice > input:checked::before { transform: scale(1); }
.merge-choice > input:focus-visible { outline: 0; }
.merge-choice > span { display: grid; gap: var(--s-1); min-width: 0; }
.merge-actions .btn { min-height: var(--tap); }
/* The merge page's side-by-side comparison: one row per detail, the two records in two
   columns that line up, the row's name above them on phones and beside them on wide
   screens. */
.merge-compare { display: grid; gap: var(--s-4); margin: var(--s-4) 0; }
.merge-compare__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2) var(--s-3); align-items: stretch; }
.merge-compare__label { grid-column: 1 / -1; display: grid; gap: 2px; font-weight: 700; color: var(--ink); }
.merge-compare__label .dd-sub { font-weight: 400; }
.merge-compare__text { display: block; min-width: 0; overflow-wrap: anywhere; }
.merge-compare .merge-choice, .merge-compare__value { min-height: var(--tap); }
.merge-compare__value.is-kept { background: var(--green-100); border-color: var(--accent-line); }
.merge-plan { display: grid; gap: var(--s-2); margin: var(--s-5) 0 var(--s-4); padding: var(--s-4); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.merge-plan__title { margin: 0; font-size: 1.0625rem; }
.merge-plan__steps { display: grid; gap: var(--s-3); margin: 0; padding-left: var(--s-5); }
.merge-plan__steps li { display: grid; gap: 2px; }
.merge-excerpt { display: grid; gap: var(--s-1); min-width: 0; }
@media (min-width: 1025px) {
  .merge-compare { gap: var(--s-3); }
  .merge-compare__row { grid-template-columns: 11rem repeat(2, minmax(0, 1fr)); }
  .merge-compare__label { grid-column: auto; align-content: start; padding-top: var(--s-3); }
}
@media (min-width: 760px) { .attention-records { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }
/* Details and Connected services sit side by side only outside mobile mode; on a tablet
   each half is too narrow for a label beside its value. */
@media (min-width: 1025px) { .details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .details-grid--single { grid-template-columns: minmax(0, 1fr); } }

/* The Products and services page: the Active and Inactive tabs above the search, a long
   description cut to two lines in the list (the form shows all of it), and making one
   inactive in its own sheet under the form. */
.product-list__tabs, .account-list__tabs { margin: 0 0 var(--s-4); }
.sync-tabs { margin: 0 0 var(--s-5); }
.product-list__description { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.product-inactive { display: grid; gap: var(--s-3); justify-items: start; margin: 0; }
.product-inactive p { margin: 0; }
/* The product form: the current image above the file picker, which is drawn like the
   other fields with a button like the outline ones; the purchase box words follow the
   chosen type, and the purchase fields show once it is ticked (always without
   JavaScript, so the form still works). */
.product-form .field input[type="file"] { padding: 9px 12px; font-size: 1rem; }
.product-form .field input[type="file"]::file-selector-button {
  min-height: 40px; margin-right: var(--s-3); padding: 6px 14px;
  font: 700 1rem var(--font-body); color: var(--accent-ink);
  background: transparent; border: 2px solid var(--accent-line); border-radius: var(--radius); cursor: pointer;
}
.product-form .field input[type="file"]::file-selector-button:hover { background: var(--green-100); }
.product-form__image { display: block; max-width: min(12rem, 100%); max-height: 12rem; object-fit: contain; background: var(--field); border: 1px solid var(--rule); border-radius: var(--radius); }
.product-purchase .check { padding-top: 0; }
.product-purchase__label-other { display: none; }
.product-form:has(#product-type option[value="NonInventory"]:checked) .product-purchase__label-service { display: none; }
.product-form:has(#product-type option[value="NonInventory"]:checked) .product-purchase__label-other { display: inline; }
.product-purchase__note { margin-top: var(--s-2); }
.product-purchase__fields { margin-top: var(--s-4); }
.js .product-purchase:not(:has(#product-purchasing:checked)) .product-purchase__fields { display: none; }

/* The account form: the parent account shows once "Make this a subaccount" is ticked. */
.account-form__sub { margin-bottom: var(--s-1); }
.account-form__sub > .field:last-child { margin-bottom: var(--s-3); }
.account-form__sub .check { padding-top: 0; }
.account-form__parent { margin-top: var(--s-3); }
.js .account-form:not(:has(#account-sub:checked)) .account-form__parent { display: none; }

/* The client's billing street: one box per line, each added line with its remove button
   (the first line keeps the space, so every box is the same width), and "Add a line"
   under them, up to the five lines QuickBooks keeps. */
.street { min-width: 0; margin: 0 0 var(--s-4); padding: 0; border: 0; }
.street__legend { margin-bottom: 6px; padding: 0; font-weight: 700; color: var(--ink); }
.street__lines { display: grid; gap: var(--s-2); margin-bottom: var(--s-3); }
.street__line { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: var(--s-2); align-items: end; }
.street__line:only-child { grid-template-columns: minmax(0, 1fr); }
.street__line input, .street__lines > input {
  width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1.0625rem var(--font-body); color: var(--ink);
  background: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius);
}
.street__line input:focus-visible, .street__lines > input:focus-visible { border-color: var(--accent-line); }
.street__line .line__remove { grid-area: auto; }
.street__add { margin-bottom: var(--s-2); }
.street__add svg { width: 18px; height: 18px; }

/* The country dropdown: a button that reads like a select, opening a panel with a search
   box and every country with its flag. Long selects marked data-select-picker, such as the
   time zone on Settings -> General, use the same dropdown without flags. */
.country-picker { position: relative; }
.country-picker__button {
  width: 100%; min-height: 48px; padding: 10px 40px 10px 12px; text-align: left; font: 400 1.0625rem var(--font-body); color: var(--ink); cursor: pointer;
  background-color: var(--field); border: 2px solid var(--rule-strong); border-radius: var(--radius);
  background-image: var(--select-chevron); background-position: right 8px center; background-size: 20px 20px; background-repeat: no-repeat;
}
.country-picker__button:focus-visible, .country-picker__button[aria-expanded="true"] { border-color: var(--accent-line); }
.country-picker__panel {
  position: absolute; z-index: 20; top: 100%; left: 0; right: 0; overflow: hidden;
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: 0 10px 28px var(--panel-shadow);
}
/* Inside a field the search box drops the field's own box: only a line separates it from the list. */
.country-picker .country-picker__search { width: 100%; min-height: 48px; padding: 10px 12px; font: 400 1rem var(--font-body); color: var(--ink); background: var(--field); border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; }
.country-picker__search::placeholder { color: var(--placeholder); opacity: 1; }
.country-picker__search::-webkit-search-cancel-button { appearance: none; }
.country-picker .country-picker__search:focus-visible { outline: 0; border-bottom: 2px solid var(--accent-line); }
.country-picker__list { max-height: 264px; margin: 0; padding: 4px 0; overflow-y: auto; list-style: none; }
.country-picker__option { display: flex; align-items: center; gap: var(--s-2); padding: 10px 12px; color: var(--ink); cursor: pointer; }
.country-picker__option[aria-selected="true"], .country-picker__option:hover { background: var(--green-100); }
.country-picker__option .iti__flag { flex: none; }
.country-picker__empty { margin: 0; padding: 12px; color: var(--muted); }
/* The account picker: the country dropdown's field and panel, with the accounts as a tree.
   The field names the chosen account by its whole path, parents quiet and the account
   itself in bold; each level of the tree steps in along a guide line, and the chosen
   account carries a tick. The select stays in the form, out of sight, so a required
   account still stops a save. */
.account-picker__native { position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.account-picker__button { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.account-picker__button:disabled { cursor: not-allowed; opacity: 0.5; }
.account-picker__value { display: flex; align-items: baseline; min-width: 0; overflow: hidden; white-space: nowrap; }
.account-picker__value--empty { color: var(--muted); }
/* On a narrow field the parents give way first, then the account name, so the type stays whole. */
.account-picker__value .account-picker__trail { flex: 0 100 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.account-picker__value .account-picker__separator { flex: none; white-space: pre; color: var(--muted); }
.account-picker__value .account-picker__leaf { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.account-picker__value .account-picker__type { flex: none; }
.account-picker__list { max-height: 320px; }
.account-picker__option {
  position: relative; display: flex; align-items: center; gap: var(--s-2); min-height: 44px;
  padding: 10px 12px 10px calc(12px + var(--depth, 0) * 20px); color: var(--ink); cursor: pointer;
}
.account-picker__option::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 12px; width: calc(var(--depth, 0) * 20px);
  background: repeating-linear-gradient(to right, transparent 0 7px, var(--rule) 7px 8px, transparent 8px 20px);
}
.account-picker__option[data-active], .account-picker__option:hover { background: var(--green-100); }
.account-picker__option[aria-selected="true"] { font-weight: 700; }
.account-picker__option[aria-selected="true"]::after {
  content: ""; flex: none; width: 12px; height: 7px; margin: -3px 4px 0 auto;
  border: solid var(--accent-ink); border-width: 0 0 3px 3px; transform: rotate(-45deg);
}
.account-picker__option[aria-disabled="true"] { color: var(--muted); cursor: not-allowed; }
.account-picker__option--context { color: var(--muted); }
.account-picker__name { min-width: 0; overflow-wrap: anywhere; }
.account-picker__name .account-picker__trail, .account-picker__name .account-picker__separator { color: var(--muted); }
.account-picker__type { margin-left: var(--s-2); font-size: 0.9375rem; font-weight: 400; color: var(--muted); }
.list-picker > input { padding-right: 40px; background-image: var(--select-chevron); background-position: right 8px center; background-size: 20px 20px; background-repeat: no-repeat; }

/* The phone field (intl-tel-input). The library sets its defaults on :root; set on body,
   these win whatever order the styles load in. */
body {
  --iti-border-width: 2px;
  --iti-spacer-horizontal: 12px;
  --iti-arrow-padding: 3px;
  --iti-arrow-size: 20px;
  --iti-icon-color: var(--muted);
  --iti-border-color: var(--rule-strong);
  --iti-country-selector-bg: var(--sheet);
  --iti-hover-color: var(--green-100);
}
.field .iti { display: block; }
.iti__selected-country { color: var(--ink); }
.field .iti__selected-country { font-size: 1.0625rem; }
/* The phone picker uses the same centred 20px Lucide ChevronDown as the app's selects. */
.iti .iti__arrow {
  flex: none; margin-top: 0; border: 0; background: var(--iti-icon-color); transform: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%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'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.iti .iti__arrow--up { margin-top: 0; transform: rotate(180deg); }
.iti__selected-country:focus-visible { outline-offset: -3px; }
.iti__country-selector { border-radius: var(--radius); color: var(--text); }
.iti--inline-country-selector .iti__country-selector { box-shadow: 0 8px 24px var(--panel-shadow); }
.iti__country-list .iti__country { margin: 0; font-size: var(--fs-small); }
.iti--inline-country-selector .iti__country-list { max-height: 15.75rem; }
.iti__dial-code { color: var(--muted); }
.iti__country-selector .iti__search-input {
  min-height: 48px; border: 0; border-radius: 0; background: var(--field); color: var(--ink); font-size: var(--fs-small);
  padding-left: calc(var(--iti-spacer-horizontal) * 2 + var(--iti-globe-icon-size));
  padding-right: calc(var(--iti-spacer-horizontal) * 2 + var(--iti-clear-icon-size));
}
.iti__country-selector .iti__search-input:focus-visible { outline-offset: -3px; }

/* A dispute's evidence: the saved documents with their remove buttons and the styled
   picker that saves new ones at once, then the evidence form's two same-size buttons
   with what the drawn PDF came to beside them. Both stack full width on a phone. */
.evidence-unfinished { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); }
.evidence-documents__list { list-style: none; margin: 0 0 var(--s-4); padding: 0; }
.evidence-documents__item { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 12px 0; border-bottom: 1px solid var(--rule); }
.evidence-documents__item:first-child { padding-top: 0; }
.evidence-documents__item form { flex: none; margin: 0; }
.evidence-documents__file { min-width: 0; overflow-wrap: anywhere; }
.evidence-upload { display: grid; gap: var(--s-2); justify-items: start; margin: 0; }
.evidence-upload__button { width: max-content; }
.evidence-upload__button[aria-disabled="true"] { opacity: 0.6; cursor: progress; pointer-events: none; }
.evidence-upload .field__hint, .evidence-upload .form-error { margin: 0; }
.evidence-form .form-actions { align-items: center; margin-bottom: 0; }
.evidence-form__buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); width: min(100%, 36rem); }
.evidence-form__buttons:has(> :only-child) { grid-template-columns: minmax(0, 18rem); }
@media (max-width: 1024px) {
  .evidence-upload, .evidence-upload__button { width: 100%; }
  .evidence-unfinished .btn { width: 100%; }
  .evidence-form__buttons, .evidence-form__buttons:has(> :only-child) { width: 100%; grid-template-columns: minmax(0, 1fr); }
}

/* Log pages: which entries a page shows beside the page links, wrapping onto two rows on
   a phone, and the note on how the log is trimmed under them. */
.list-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); margin-top: var(--s-4); }
.pager { display: flex; flex: 1 1 34rem; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-4); }
.pager__status { margin: 0; color: var(--muted); font-size: 0.9375rem; }
.pager__links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.pager__link {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); color: var(--accent-ink); font-weight: 600; text-decoration: none;
}
a.pager__link:hover { border-color: var(--accent-line); background: var(--green-100); text-decoration: none; }
.pager__link[aria-current="page"] { border-color: var(--green-900); background: var(--green-900); color: #fff; }
.pager__link[aria-disabled="true"] { border-color: var(--rule); color: var(--muted); opacity: 0.6; }
.pager__gap { padding: 0 var(--s-1); color: var(--muted); }
.page-size { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.page-size__label {
  display: flex;
  align-items: center;
  gap: var(--s-2);

  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 400;
}
.page-size__select, .page-size__submit { min-height: 40px; }
.page-size__select {
  appearance: none;

  width: auto;
  min-height: 40px;
  padding: 0 36px 0 12px;

  color: var(--accent-ink);
  font: 600 1rem var(--font-body);

  background-color: transparent;
  background-image: var(--select-chevron);
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);

  cursor: pointer;
}
.page-size__select:hover { border-color: var(--accent-line); background-color: var(--green-100); }
.page-size__submit { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 559px) {
  .list-footer, .pager, .page-size { width: 100%; }
  .page-size { justify-content: flex-start; }
}
@media (min-width: 560px) {
  .list-footer, .pager, .page-size { width: auto; }
}
.log-note { margin: var(--s-3) 0 0; color: var(--muted); font-size: 0.9375rem; }

/* Log filters: a panel of fields above the email and webhook logs, side by side where
   they fit and one under another on a phone, applied together by the button. */
.log-filters { margin: 0 0 var(--s-5); padding: var(--s-4); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.log-filters__fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--s-4); }
.log-filters__fields .field { margin: 0; }
/* The merged transaction lists give search its own row, then keep their narrower filters
   equal: six columns on a wide desktop, three on a narrow one, two on tablets, and one
   on phones. */
@media (min-width: 1280px) {
  .log-filters__fields .field--wide { grid-column: span 2; }
  .log-filters--transactions .log-filters__fields { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .log-filters--transactions .log-filters__fields .field--wide { grid-column: 1 / -1; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
  .log-filters__fields .field--wide { grid-column: span 2; }
  .log-filters--transactions .log-filters__fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .log-filters--transactions .log-filters__fields .field--wide { grid-column: 1 / -1; }
}
@media (max-width: 1024px) {
  /* Search takes its own row, wide enough for its whole placeholder. */
  .log-filters__fields .field--wide { grid-column: 1 / -1; }
  .log-filters--transactions .log-filters__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 559px) {
  .log-filters--transactions .log-filters__fields { grid-template-columns: minmax(0, 1fr); }
}
/* On a small phone a search placeholder shrinks to fit its box. */
@media (max-width: 480px) {
  .log-filters__fields .field--wide input[type="search"]::placeholder { font-size: 0.8125rem; }
}
.log-filters__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); margin-top: var(--s-4); }

/* The pay page log's and Website forms' tabs, one control like the appearance switch,
   each with its count, and any sort beside them, dropping under them on a phone. A row
   with a More menu stays on one line: app.ts moves the tabs that don't fit into More,
   keeping the first tab and the open one in the row. Without JavaScript the tabs wrap. */
.log-toolbar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4); margin: 0 0 var(--s-5); }
/* A segmented control: a pill outline with 4px inside it, and each segment its own pill,
   so the selected fill always sits inside the outline (inner radius = outer − border −
   padding) whichever segment it is, with no square corners poking out. */
.tabs { --tabs-pad: 4px; display: inline-flex; flex-wrap: wrap; gap: var(--tabs-pad); padding: var(--tabs-pad); border: 2px solid var(--accent-line); border-radius: var(--radius-pill); }
.tabs--more { display: flex; min-width: 0; width: max-content; max-width: 100%; }
.tabs--more.is-fitted { flex-wrap: nowrap; }
.tabs--more.is-fitted > .tabs__tab { flex: 0 0 auto; white-space: nowrap; }
.tabs__more { flex: 0 0 auto; }
.tabs__more-toggle { height: 100%; white-space: nowrap; cursor: pointer; list-style: none; border-radius: var(--radius-pill); }
.tabs__more-toggle::-webkit-details-marker { display: none; }
.tabs__more[open] > .tabs__more-toggle { background: var(--green-100); }
.tabs__menu {
  position: absolute; z-index: 45; top: calc(100% + 6px); right: -2px; min-width: 15rem; padding: var(--s-1) 0;
  background: var(--sheet); border: 1px solid var(--rule-strong); border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--panel-shadow);
}
.tabs__menu > .tabs__tab { display: flex; justify-content: space-between; width: 100%; white-space: nowrap; border-radius: 0; }
.tabs__tab { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; font-weight: 600; color: var(--accent-ink); text-decoration: none; border-radius: var(--radius-pill); }
.tabs__tab:hover { background: var(--green-100); text-decoration: none; }
.tabs__tab[aria-current="page"] { background: var(--accent-line); color: var(--sheet); }
.tabs__count { font-family: var(--font-mono); font-size: 0.875rem; }
/* Phones: a step less padding, so the first tab, the open one and More fit on one line
   even at 320px wide. */
@media (max-width: 559px) {
  .tabs__tab { gap: 6px; padding: 0 var(--s-3); }
  /* Two tabs fit side by side on a phone; three or more stack into one full-width column. */
  .tabs:not(.tabs--more):has(> .tabs__tab:nth-child(3)) { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; border-radius: var(--radius-card); }
  .tabs:not(.tabs--more):has(> .tabs__tab:nth-child(3)) > .tabs__tab { width: 100%; border-radius: calc(var(--radius-card) - 2px - var(--tabs-pad)); }
}
.log-toolbar__sort { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-2); margin: 0; }
.log-toolbar__sort .field { min-width: 12rem; margin: 0; }

/* The log settings: the limits under the lead, the trimming switch, then Trim now with
   its hint. */
/* How long log entries are kept and the Cloudflare plan, side by side from 640px like
   the PO and quote choices. The line on the database size sits under both, 6px below
   like a field's own hint. */
.settings__keep { margin-top: var(--s-4); }
.settings__keep .field:has(+ .settings__keep-hint) { margin-bottom: 6px; }
.settings__keep-hint { grid-column: 1 / -1; }
.settings__limits { margin-top: var(--s-4); }
.log-rules { display: grid; gap: var(--s-2); margin-bottom: var(--s-4); }
.log-rules .field__hint { margin: 0; }
/* Four limits sit two by two from 640px, a field's spacing apart. */
@media (min-width: 640px) { .settings__limits { row-gap: var(--s-4); } }
.settings__switch { margin-top: var(--s-4); }

/* Settings save bar: once a setting differs from what was saved, the Save button rises into
   a bar pinned to the bottom of the screen with a note, so nobody takes the page for saving
   by itself. "Show changes" opens a small list above the bar, each change with an undo. */
.settings-form__actions { position: relative; align-items: center; gap: var(--s-3) var(--s-4); }
.settings-form__unsaved { min-width: 0; }
.settings-form__unsaved-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--s-3); margin: 0; font-weight: 700; color: var(--ink); }
.settings-form__unsaved-text .link-button { font-weight: 400; }
.settings-form[data-dirty] .settings-form__actions {
  position: sticky; bottom: var(--s-3); z-index: 30; justify-content: space-between;
  padding: var(--s-3) var(--s-4); background: var(--sheet); border: 2px solid var(--accent-line); border-radius: var(--radius); box-shadow: 0 10px 28px var(--panel-shadow);
  animation: settings-save-rise 0.2s ease-out;
}
@keyframes settings-save-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .settings-form[data-dirty] .settings-form__actions { animation: none; } }
.settings-form__changes {
  position: absolute; left: 0; bottom: calc(100% + var(--s-2)); width: min(32rem, 100%); max-height: min(50vh, 26rem); overflow-y: auto;
  padding: var(--s-3) var(--s-4); background: var(--sheet); border: 2px solid var(--accent-line); border-radius: var(--radius); box-shadow: 0 10px 28px var(--panel-shadow);
}
.settings-form__changes-title { margin: 0 0 var(--s-1); font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
:lang(zh) .settings-form__changes-title { letter-spacing: 0; text-transform: none; }
.settings-form__changes-list { display: grid; margin: 0; padding: 0; list-style: none; }
.settings-form__change { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s-3); align-items: center; padding: var(--s-2) 0; border-top: 1px solid var(--rule); }
.settings-form__change:first-child { border-top: 0; }
.settings-form__change-name { grid-column: 1; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.settings-form__change-values { grid-column: 1; color: var(--muted); overflow-wrap: anywhere; }
.settings-form__undo { grid-column: 2; grid-row: 1 / span 2; }
.settings__trim { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); margin-top: var(--s-3); }
.settings__trim .field__hint { flex: 1 1 20rem; }
/* On a small phone the buttons stack, each the full width, so they match in size. */
@media (max-width: 480px) {
  .settings__trim > .btn { flex: 1 1 100%; }
}


/* ---------- Sign-in page ---------- */
/* Laid out like the cbnventures.io hero: its purple gradient with two soft tints, the
   welcome on the left and a glass panel on the right. The body is a column exactly one
   screen tall at least, so the environment bar, the page and its footer line share that
   height and nothing scrolls while the content fits. */
.login {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; color: #fff;
  background-color: #5438a5;
  background-image:
    radial-gradient(circle at top right, rgba(147, 115, 240, 0.55), transparent 55%),
    radial-gradient(circle at bottom left, rgba(84, 56, 165, 0.6), transparent 55%),
    linear-gradient(160deg, #6a44d6 0%, #5438a5 55%, #3d2a7a 100%);
}
.login__main {
  flex: 1 0 auto; display: grid; align-items: center; gap: var(--s-6);
  width: min(100%, 1040px); margin: 0 auto; padding: var(--s-6) var(--gutter);
}
@media (min-width: 860px) { .login__main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--s-8); } }
.login__intro { display: grid; gap: var(--s-4); align-content: center; }
/* A one-panel page (an error or "not found" while signed out): the glass panel alone,
   centred, with the title, the message and its button. */
@media (min-width: 860px) { .login__main--single { grid-template-columns: minmax(0, 560px); justify-content: center; } }
.login__message h1 { margin: var(--s-2) 0 0; color: #fff; font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem); line-height: 1.1; }
.login__message .login__lead { max-width: none; }
/* The cbnventures.io hero puts 24px between its copy and its button; so does HQ. */
.login__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.login__panel .login__actions { margin-top: var(--s-2); }
.login__brand { display: flex; align-items: center; gap: var(--s-3); }
.login__mark { flex: none; width: 44px; height: 44px; padding: 7px; background: #13111c; border-radius: var(--radius); }
.login__name { display: grid; gap: 2px; line-height: 1.1; }
.login__app { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 800; letter-spacing: -0.02em; }
.login__company { font-family: var(--font-label); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.75); }
.login__kicker { display: inline-flex; align-items: center; gap: 10px; margin: var(--s-4) 0 0; font: 700 0.6875rem var(--font-label); letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.82); }
.login__kicker-rule { width: 18px; height: 2px; background: #ffe500; }
.login__intro h1 { margin: 0; color: #fff; font-size: clamp(2rem, 3.2vw + 1rem, 3.5rem); line-height: 1.05; }
.login__lead { margin: 0; max-width: 34ch; font-size: var(--fs-lead); color: rgba(255, 255, 255, 0.85); }
.login__panel {
  display: grid; gap: var(--s-4); padding: var(--s-6);
  background: rgba(19, 17, 28, 0.55); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--radius-card);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.login__panel .flash { margin: 0; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--radius); }
.login__panel .flash--error { background: rgba(244, 67, 54, 0.18); border-color: rgba(255, 156, 143, 0.6); }
.login__panel .flash--warn { background: rgba(255, 229, 0, 0.14); border-color: rgba(255, 229, 0, 0.55); }
.btn--google { width: 100%; gap: var(--s-3); background: #ffe500; color: #1a1a1a; box-shadow: var(--shadow-pop); }
.btn--google:hover { box-shadow: var(--shadow-pop-hover); }
.google-logo { width: 22px; height: 22px; flex: none; padding: 2px; background: #fff; border-radius: 50%; }
.login__dev { display: grid; gap: var(--s-3); }
.login__dev-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.login__dev-actions .btn { width: 100%; }
.btn--ghost-light { color: #fff; background: transparent; border: 2px solid rgba(255, 255, 255, 0.5); box-shadow: var(--shadow-pop-ghost); }
.btn--ghost-light:hover { color: #fff; border-color: #fff; }
.login__dev-note { font-size: 0.875rem; color: rgba(255, 255, 255, 0.7); }
.login__help { margin: 0; padding-top: var(--s-4); border-top: 1px solid rgba(255, 255, 255, 0.14); font-size: 0.9375rem; color: rgba(255, 255, 255, 0.75); }
.login__foot { margin: 0; padding: 0 var(--gutter) var(--s-4); text-align: center; font: 600 0.8125rem var(--font-label); letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.7); }
@media (max-width: 479px) {
  .login__main { gap: var(--s-4); padding-block: var(--s-4); }
  .login__intro { gap: var(--s-3); }
  .login__kicker { margin-top: var(--s-2); }
  .login__panel { gap: var(--s-3); padding: var(--s-4); }
  .login__panel .login__actions { margin-top: var(--s-3); }
  .login__dev-actions { gap: var(--s-2); }
  .login__help { padding-top: var(--s-3); }
}

/* ---------- PDF preview loading screen ---------- */
/* The tab a PDF preview opens in, while the PDF is drawn: the CBN mark and a bar that
   sweeps across under it. With reduced motion the bar stays still. */
.pdf-loading { margin: 0; min-height: 100vh; background: var(--paper); position: relative; }
.pdf-loading__main { display: grid; place-items: center; align-content: center; gap: var(--s-5); min-height: 100vh; padding: var(--s-6) var(--gutter); }
.pdf-loading__main .brand__mark { width: 64px; height: 64px; }
.pdf-loading__bar { position: relative; width: min(240px, 60vw); height: 4px; overflow: hidden; background: var(--green-100); border-radius: 2px; }
.pdf-loading__bar::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--accent-line); border-radius: 2px; animation: pdf-loading-sweep 1.2s ease-in-out infinite; }
.pdf-loading__label { margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@keyframes pdf-loading-sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .pdf-loading__bar::after { animation: none; width: 100%; opacity: 0.5; } }
:lang(zh) .pdf-loading__label { letter-spacing: 0; text-transform: none; }

/* The Ads page: a small spend-by-month chart (Google blue, Microsoft teal, both from the
   tone tokens so dark mode follows), the qualifying choices and the latest refused uploads. */
.empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); }
.empty__actions .btn { flex: 1 1 16rem; max-width: 20rem; }
.ads-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0 0 var(--s-4); padding: 0; list-style: none; font-size: var(--fs-small); color: var(--muted); }
.ads-legend__item { display: inline-flex; align-items: center; gap: var(--s-2); }
.ads-legend__swatch { width: 14px; height: 14px; border-radius: 2px; }
.ads-legend__swatch--google { background: var(--chart-google); }
.ads-legend__swatch--microsoft { background: var(--chart-microsoft); }
.ads-chart { display: grid; gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.ads-chart__row { display: grid; grid-template-columns: 6rem minmax(0, 1fr) 11rem; align-items: center; gap: var(--s-3); }
.ads-chart__month { font-variant-numeric: tabular-nums; color: var(--muted); }
:lang(zh) .ads-chart__month { word-break: keep-all; }
@media (min-width: 560px) {
  :lang(zh) .ads-chart__row { grid-template-columns: 7rem minmax(0, 1fr) 11rem; }
}
.ads-chart__bars { display: block; width: 100%; min-width: 0; height: 20px; background: var(--paper-2); border-radius: 2px; overflow: hidden; }
.ads-chart__bar--google { fill: var(--chart-google); }
.ads-chart__bar--microsoft { fill: var(--chart-microsoft); }
.ads-chart__value { display: grid; justify-items: end; font-variant-numeric: tabular-nums; }
.ads-chart__leads { font-size: var(--fs-small); color: var(--muted); }
.ads-rule { display: grid; gap: var(--s-3); margin: 0 0 var(--s-4); padding: 0; border: 0; min-width: 0; }
.ads-rule__legend { margin: 0 0 var(--s-2); padding: 0; font-weight: 700; color: var(--ink); }
.ads-uploads__title { margin: var(--s-5) 0 var(--s-3); font-size: var(--fs-h4); }
.ads-uploads { display: grid; gap: var(--s-3); margin: 0 0 var(--s-4); padding: 0; list-style: none; }
.ads-uploads__item { display: grid; gap: var(--s-1); min-width: 0; overflow-wrap: anywhere; }
/* The funnel from impressions to paid revenue: one tile a step, wrapping on narrow
   screens. Each count links to the form messages behind it. */
.ads-period { min-width: 0; }
/* The campaign by month grid: one green, darker for more spend, so a month that cost a
   lot stands out at a glance; the two darkest steps take light text. */
.ads-grid__wrap { padding: var(--s-3) var(--s-4); }
.ads-order { margin: 0 0 var(--s-3); }
.ads-grid { width: 100%; border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; }
.ads-grid th { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; padding: 0 0 var(--s-1); white-space: nowrap; }
.ads-grid .ads-grid__corner { text-align: left; vertical-align: bottom; }
.ads-grid__month, .ads-grid__year { display: block; }
.ads-grid__year { font-weight: 400; }
.ads-grid .ads-grid__name { font-family: var(--font-body); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); text-align: left; padding: var(--s-1) var(--s-3) var(--s-1) 0; white-space: normal; min-width: 10rem; vertical-align: middle; }
.ads-grid__network { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-small); font-weight: 400; color: var(--muted); }
.ads-grid__network::before { content: ""; width: 10px; height: 10px; border-radius: 2px; }
.ads-grid__network--google-ads::before { background: var(--chart-google); }
.ads-grid__network--microsoft-ads::before { background: var(--chart-microsoft); }
.ads-grid__network--linkedin-ads::before { background: var(--chart-linkedin); }
.ads-grid__cell { height: 3rem; min-width: 3.5rem; border-radius: 4px; text-align: center; vertical-align: middle; font-size: 0.875rem; line-height: 1.2; color: var(--ink); }
.ads-grid__cell--l0 { background: var(--paper-2); }
.ads-grid__cell--l1 { background: color-mix(in srgb, var(--heat) 14%, transparent); }
.ads-grid__cell--l2 { background: color-mix(in srgb, var(--heat) 30%, transparent); }
.ads-grid__cell--l3 { background: color-mix(in srgb, var(--heat) 48%, transparent); }
.ads-grid__cell--l4 { background: color-mix(in srgb, var(--heat) 85%, transparent); color: var(--heat-on); }
.ads-grid__cell--l5 { background: var(--heat); color: var(--heat-on); }
.ads-grid__spend, .ads-grid__contacts { display: block; }
.ads-grid__contacts { font-size: var(--fs-small); font-weight: 700; }
.ads-grid__contacts a { text-decoration: none; }
.ads-grid__contacts a:hover { text-decoration: underline; }
.ads-grid__cell--l4 a, .ads-grid__cell--l5 a { color: inherit; }
.ads-grid .ads-grid__corner, .ads-grid .ads-grid__name, .ads-grid .ads-grid__total { width: 1%; }
.ads-grid th.ads-grid__total, .ads-grid td.ads-grid__total { text-align: right; padding-left: var(--s-3); white-space: nowrap; font-size: 0.875rem; }
.ads-grid td.ads-grid__total .ads-grid__contacts { font-weight: 400; color: var(--muted); }
.ads-grid__key { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-3) 0 var(--s-4); font-size: var(--fs-small); color: var(--muted); }
.ads-grid__scale { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; }
.ads-grid__swatches { display: inline-flex; gap: 2px; }
.ads-grid__swatch { width: 18px; height: 14px; border-radius: 3px; }
/* On a phone the grid keeps its own sideways scroll, with the campaign names held in
   place, so the page itself never scrolls sideways. */
.ads-grid .ads-grid__name, .ads-grid .ads-grid__corner { position: sticky; left: 0; z-index: 1; background: var(--sheet); }
@media (max-width: 1024px) {
  .table-wrap.ads-grid__wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--rule); padding-left: 0; }
  .ads-grid .ads-grid__name, .ads-grid .ads-grid__corner { padding-left: var(--s-3); box-shadow: 1px 0 0 var(--rule); }
  .ads-grid .ads-grid__name { min-width: 8.5rem; }
}
/* On a small phone the names scroll with the months, so they never cover half the
   screen, and the legend wraps. */
@media (max-width: 600px) {
  .ads-grid .ads-grid__name, .ads-grid .ads-grid__corner { position: static; box-shadow: none; }
  .ads-grid .ads-grid__name { min-width: 7rem; font-size: 0.875rem; }
  .ads-grid__network { font-size: 0.8125rem; }
  .ads-grid .ads-grid__quiet { display: none; }
}
.ads-fold > summary { display: inline-block; list-style: none; margin-bottom: var(--s-3); }
.ads-fold > summary::-webkit-details-marker { display: none; }
/* The campaign table holds eleven columns: its headings wrap onto two lines and its cells
   sit closer, so it fits the wide layout without scrolling sideways. */
.data.ads-table thead th { white-space: normal; vertical-align: bottom; }
.ads-table th, .ads-table td { padding-left: var(--s-2); padding-right: var(--s-2); }
.ads-table td:nth-child(2) { min-width: 11rem; }
.ads-period .field { margin: 0; }
.ads-period__row { display: flex; gap: var(--s-2); }
.ads-period__row select { width: auto; min-width: 12rem; }
.ads-funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.ads-funnel__step { display: grid; align-content: start; gap: var(--s-1); min-width: 0; padding: var(--s-3) var(--s-4); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.ads-funnel__label { font-size: var(--fs-small); color: var(--muted); }
.ads-funnel__value { font-size: var(--fs-h4); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ads-funnel__sub { font-size: var(--fs-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.ads-milestones { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.ads-milestones__step { display: grid; gap: 2px; padding-left: var(--s-4); border-left: 3px solid var(--rule); }
.ads-milestones__step.is-done { border-left-color: var(--tone-green-line); }
.ads-milestones__name { font-weight: 700; color: var(--ink); }
.ads-messages__scope { margin: 0 0 var(--s-4); }
@media (max-width: 1024px) {
  .ads-funnel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ads-funnel { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 419px) {
  .ads-funnel { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 559px) {
  .ads-chart__row { grid-template-columns: minmax(0, 1fr) auto; }
  .ads-chart__bars { grid-column: 1 / -1; grid-row: 2; }
  .ads-period, .ads-period__row select { width: 100%; min-width: 0; }
  .ads-period__row select { flex: 1; }
}

/* Settings, API tokens: a new token in a read-only box with its Copy button beside it,
   in the code font so similar characters can be told apart. */
.api-token-dialog .flash { margin: var(--s-3) 0 var(--s-4); }
.api-token-dialog .check-dialog__actions { display: flex; justify-content: flex-end; margin-top: var(--s-5); }
.api-token-copy { max-width: none; margin: 0 0 var(--s-3); }
.search-form__row input.mono { font-family: var(--font-mono); font-size: 0.9375rem; }

/* The areas a Write token can use show only while Write is the access chosen. */
.api-token-form:not(:has(input[name="scope"][value="write"]:checked)) .api-token-areas { display: none; }
.api-token-areas .permission-grid { margin-bottom: var(--s-2); }

/* Help: the guides as one bordered list, and each guide's numbered steps with their
   pictures framed like cards and never wider than the screen. */
.help-list__items { margin: 0; padding: 0; list-style: none; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.help-list__items > li + li { border-top: 1px solid var(--rule); }
.help-list__link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--tap); padding: var(--s-3) var(--s-4);
  color: var(--ink); font-weight: 700; text-decoration: none;
}
.help-list__link:hover { background: var(--green-100); }
.help-list__title { min-width: 0; overflow-wrap: anywhere; }
.help-list__chevron { flex: none; width: 20px; height: 20px; color: var(--muted); }
.help-guide { max-width: 48rem; min-width: 0; }
.help-guide h2 { margin: var(--s-6) 0 var(--s-3); }
.help-guide > h2:first-child { margin-top: 0; }
.help-guide__steps, .help-guide__bullets { margin: 0 0 var(--s-5); padding-left: 1.5rem; }
.help-guide li + li { margin-top: var(--s-4); }
.help-guide li > p { margin: 0; overflow-wrap: anywhere; }
.help-guide__figure { margin: var(--s-3) 0 0; }
.help-guide__picture { display: block; max-width: 100%; height: auto; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
.help-guide code { font-family: var(--font-mono); font-size: 0.9375rem; }

/* ---------- Sales pipeline ---------- */

/* The four numbers over the board: four across on desktop, two on tablets and phones in
   landscape, one on small phones. */
.pipeline-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pipeline-sources { display: grid; gap: 2px; margin: 4px 0 0; font-size: 0.9375rem; }
.pipeline-sources > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 var(--s-3); }
.pipeline-sources dt { color: var(--muted); }
.pipeline-sources dd { margin: 0; color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 1024px) {
  .pipeline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-stats li { border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
  .pipeline-stats li:nth-child(odd) { border-left: 0; }
  .pipeline-stats li:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 599px) {
  .pipeline-stats { grid-template-columns: minmax(0, 1fr); }
  .pipeline-stats li, .pipeline-stats li:nth-child(-n+2) { border-left: 0; border-top: 1px solid var(--rule); }
  .pipeline-stats li:first-child { border-top: 0; }
}

/* The Board and List switch with the owner and source filters on one row. The Apply
   button is as tall as the boxes beside it. */
.pipeline-bar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin: 0 0 var(--s-5); }
.pipeline-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3); margin: 0; }
.pipeline-filters .field { width: 14rem; margin: 0; }
.pipeline-filters .btn { min-height: 48px; }
@media (max-width: 559px) {
  .pipeline-bar, .pipeline-filters { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; }
  .pipeline-filters .field { width: auto; }
  .pipeline-switch { display: flex; }
  .pipeline-switch > .tabs__tab { flex: 1 1 0; justify-content: center; }
}

/* The board: a column per open stage and Won side by side on desktop; at 1024px and
   below the stage tabs choose the one column shown. The folded Lost column lays its
   cards out across the width. */
.pipeline-tabs { margin: 0 0 var(--s-4); }
.pipeline-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-3); align-items: start; }
.pipeline-board--closed { grid-template-columns: minmax(0, 1fr); margin-top: var(--s-4); }
.pipeline-board--closed .pipeline-column__cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.pipeline-column { display: grid; gap: var(--s-3); min-width: 0; padding: var(--s-3); background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.pipeline-column.is-drop-target { background: var(--green-100); border-color: var(--accent-line); outline: 2px dashed var(--accent-line); outline-offset: 2px; }
.pipeline-column__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--s-2); }
.pipeline-column__title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 1.0625rem; }
.pipeline-column__count { font-family: var(--font-mono); font-size: 0.875rem; color: var(--muted); }
.pipeline-column__total { flex: 1 0 100%; font-family: var(--font-mono); font-size: 0.9375rem; font-weight: 600; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.pipeline-column__empty { margin: 0; font-size: 0.9375rem; }
.pipeline-column__cards { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
@media (min-width: 1025px) {
  .pipeline-tabs { display: none; }
}
@media (max-width: 1024px) {
  .pipeline-board { grid-template-columns: minmax(0, 1fr); }
  .pipeline-board:not(.pipeline-board--closed) > .pipeline-column:not(.is-active) { display: none; }
}

/* One deal on the board. The whole card opens the deal; its Change form stays folded
   until asked for. */
.pipeline-card { display: grid; gap: 4px; min-width: 0; padding: var(--s-3); background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.pipeline-card:hover { background: var(--sheet-hover); border-color: var(--rule-strong); }
.pipeline-card.is-dragging { opacity: 0.5; }
.pipeline-card__name { overflow-wrap: anywhere; }
.pipeline-card__new { justify-self: start; }
.pipeline-card.is-unread { border-color: var(--tone-blue-line); }
.pipeline-card__company, .pipeline-card__owner { color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.pipeline-card__value { color: var(--ink); font-weight: 700; }
.pipeline-card__next { font-size: 0.9375rem; }
.pipeline-card__invoice { justify-self: start; min-height: 40px; margin-top: 4px; padding: 6px 16px; font-size: 1rem; }
.pipeline-card__invoice-link { justify-self: start; margin-top: 4px; font-size: 0.9375rem; }
.pipeline-card__change { margin-top: 4px; cursor: auto; }
.pipeline-card__change > summary { list-style: none; font-size: 0.9375rem; }
.pipeline-card__change > summary::-webkit-details-marker { display: none; }
.pipeline-card__change[open] > summary { margin-bottom: var(--s-2); }
.pipeline-money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* A deal's next step and its due date, which turns red and says Overdue once it passes. */
.next-step { display: grid; gap: 2px; }
.next-step__text { overflow-wrap: anywhere; }
.next-step__due { color: var(--muted); font-size: 0.9375rem; }
.next-step--overdue .next-step__due { color: var(--error-ink); font-weight: 700; }

/* The Change form on a card and in a deal's Change stage window. */
.stage-form { display: grid; gap: var(--s-2); margin: 0; }
.stage-form .field { margin: 0; }
.stage-form > .btn { justify-self: start; min-height: 40px; padding: 6px 16px; font-size: 1rem; }
.check-dialog .stage-form { gap: var(--s-3); }

/* The lost deals of the last 90 days, folded under the board. */
.pipeline-closed { margin-top: var(--s-6); }
.pipeline-closed__toggle { display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); font-weight: 700; color: var(--accent-ink); cursor: pointer; list-style: none; }
.pipeline-closed__toggle::-webkit-details-marker { display: none; }
.pipeline-closed[open] .pipeline-closed__toggle .nav-menu__chevron { transform: rotate(180deg); }

/* A deal's page and the Opportunities section of a company or contact. */
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0 0 var(--s-4); }
.section-head h2 { margin: 0; }
.pipeline-company { display: grid; gap: 4px; margin: 0 0 var(--s-4); }
.pipeline-company__label { font-weight: 700; color: var(--ink); }
.pipeline-company__name { overflow-wrap: anywhere; }
.pipeline-inline-form { display: inline; margin: 0; }
.pipeline-payments { margin-top: var(--s-4); }
.twenty-status { display: grid; justify-items: end; gap: 4px; text-align: right; }

/* ---------- Dark theme: swap to the logo made for dark backgrounds ---------- */
@media (prefers-color-scheme: dark) {
}
.api-tokens-table td { vertical-align: middle; }
.sheet__tools { margin: 0 0 var(--s-4); }
.block-form { display: grid; gap: var(--s-3); margin: 0; }
.block-form__values { display: grid; gap: 0; min-width: 0; margin: 0; padding: 0; border: 0; }
.block-form__duration { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
.block-form__duration .field { margin-bottom: 0; }
.block-form:not(:has(select[name="duration"] option[value="custom"]:checked)) .block-form__date { display: none; }
.block-form__value, .block-value { overflow-wrap: anywhere; }
@media (max-width: 1024px) {
  .block-form__duration { grid-template-columns: minmax(0, 1fr); }
}
