/* Kasbo Inbox design tokens (brand blue from the Kasbo suite, /root/kasbo-site docs/design/DESIGN.md) (docs/design/DESIGN-SYSTEM.md section 3). Owner: A.
   Components only use these, never raw hex. The dark block is repeated twice on purpose (system dark and
   [data-theme="dark"]); keep both copies identical. */
:root {
  color-scheme: light dark;

  /* brand */
  --brand: #2B4CFF;
  --brand-strong: #1F38D8;
  --brand-ink: #06113A;
  --brand-mid: #182DAB;
  --brand-tint: #E4ECFF;
  --brand-wash: #EDF3FF;
  --brand-ring: #AFC7FF;
  --on-brand: #FFFFFF;
  --amber: #FFB703; --on-amber: #06113A;
  --on-ink: #FFFFFF;
  --on-ink-2: #E4ECFF;
  --on-ink-link: #AFC7FF;
  --link: #1F38D8;
  --side-active: #2B4CFF;
  --chip-on: #06113A; --on-chip: #FFFFFF;
  --hero-a: #06113A; --hero-b: #182DAB; --hero-c: #2B4CFF;

  /* surfaces. WhatsApp-familiar layout (docs/review-2026-11-19/WHATSAPP-FEEL-SPEC.md, Option B): flat white panes,
     a cool blue-grey canvas behind the chat, hairline pane dividers. None of WhatsApp's colours (spec S3). */
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #EFF1F6;
  --surface-3: #E3E6EF;
  --scrim: rgb(6 17 58 / .55);
  --canvas: #F0F2F7;      /* chat canvas, hue 267 (WhatsApp wallpaper is hue 80) */
  --canvas-dot: #DEE3F0;  /* dot grid on the canvas only, never behind text */
  --rail: #F0F2F7;        /* desktop nav rail */
  --pane-line: #DFE4ED;   /* divider between panes and under bars */

  /* chat bubbles and ticks (spec S5, S6: Kasbo blue tint, never green; read ticks deep Kasbo blue, not WhatsApp sky blue) */
  --bubble-in: #FFFFFF;
  --bubble-out: #E1EBFF;
  --bubble-meta: #525E7A;
  --tick-read: #2B4CFF;
  /* wait badges in the unread-count slot: white 12px bold text, 5.29:1 and 5.02:1 */
  --wait-badge: #C8323A;
  --due-badge: #B45309;
  --on-wait-badge: #FFFFFF;

  /* stage labels: bg + fg pairs (all above 7:1); 1-6 by stage order, ok = won, grey = lost / not a lead */
  --lb-1: #E4ECFF; --lb-1-fg: #182F95;
  --lb-2: #E0F2FE; --lb-2-fg: #0B4A6F;
  --lb-3: #FEF3C7; --lb-3-fg: #78350F;
  --lb-4: #FCE7F3; --lb-4-fg: #831843;
  --lb-5: #FFEDD5; --lb-5-fg: #7C2D12;
  --lb-6: #E2E8F0; --lb-6-fg: #1E293B;
  --lb-ok: #DCFCE7; --lb-ok-fg: #14532D;
  --lb-grey: #EFF1F6; --lb-grey-fg: #3D4968;

  /* text */
  --ink: #0B1430;
  --ink-2: #3D4968;
  --muted: #525E7A;
  --faint: #828DA9;

  /* lines */
  --line: #DFE4ED;
  --line-2: #C8CEDD;

  /* status: fg / bg / solid (dot) */
  --st-us-fg: #B42318;   --st-us-bg: #FEE4E2;   --st-us: #E5484D;
  --st-due-fg: #92400E;  --st-due-bg: #FEF3C7;  --st-due: #F59E0B;
  --st-them-fg: #364057; --st-them-bg: #EBEEF4; --st-them: #828DA9;
  --st-cold-fg: #075985; --st-cold-bg: #E0F2FE; --st-cold: #0EA5E9;
  --st-quiet-fg: #525E7A;--st-quiet-bg: #EFF1F6;--st-quiet: #AAB3C8;
  --st-ok-fg: #166534;   --st-ok-bg: #DCFCE7;   --st-ok: #22C55E;
  --swipe-done: #15803D;  /* swipe-to-Done reveal behind a chat row (white text on it, both themes) */
  --ai-fg: #1F38D8;      --ai-bg: #E4ECFF;
  --err-toast: #7A1610;
  /* count badge: white 12px bold text needs 4.5:1, so it gets its own deeper red (5.3:1), not the status dot */
  --badge: #C8323A; --on-badge: #FFFFFF;

  /* avatars: pastel bg + dark text, picked by hashing the WhatsApp id */
  --av-1: #E4ECFF; --av-1-fg: #182F95;
  --av-2: #FEE4E2; --av-2-fg: #8A1C12;
  --av-3: #E0F2FE; --av-3-fg: #0B4A6F;
  --av-4: #DCFCE7; --av-4-fg: #14532D;
  --av-5: #FEF3C7; --av-5-fg: #78350F;
  --av-6: #FCE7F3; --av-6-fg: #831843;

  /* focus */
  --focus: #2B4CFF;

  /* type */
  --font-display: "Bricolage Grotesque", "Bricolage Fallback", "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Figtree", "Figtree Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-hero: 800 40px/44px var(--font-display);
  --t-brand: 700 22px/28px var(--font-display);   /* "Kasbo Inbox" wordmark in the top bar */
  --t-h1: 800 24px/30px var(--font-display);
  --t-h2: 700 20px/26px var(--font-display);
  --t-h3: 700 18px/24px var(--font-display);
  --t-big: 800 34px/38px var(--font-display);
  --t-huge: 800 56px/56px var(--font-display);
  --t-pane: 700 17px/22px var(--font-body);       /* conversation header name, pane titles */
  --t-row: 600 17px/22px var(--font-body);        /* chat row name (700 when waiting or due) */
  --t-preview: 400 15px/20px var(--font-body);
  --t-time: 500 12px/16px var(--font-body);
  --t-bubble: 400 16px/22px var(--font-body);
  --t-chip: 600 14px/20px var(--font-body);
  --t-badge: 700 12px/16px var(--font-body);
  --t-body: 400 16px/24px var(--font-body);
  --t-label: 700 16px/20px var(--font-body);
  --t-small: 500 15px/20px var(--font-body);
  --t-meta: 600 13px/16px var(--font-body);
  --t-over: 700 12px/16px var(--font-body);
  /* section and group labels: sentence case, no tracking (replaces the small-caps eyebrow, Monzo/Linear style) */
  --t-section: 600 15px/20px var(--font-body);

  /* spacing (4px grid) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;
  --gutter: 16px;
  --pad: 16px;

  /* radii: one base with two steps (8 / 12 / 20). --r-xs and --r-xl are kept as aliases for older rules. */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
  --r-xs: var(--r-sm); --r-xl: var(--r-lg);

  /* elevation */
  --e-0: none;
  --e-1: 0 1px 2px rgb(6 17 58 / .05), 0 8px 24px -12px rgb(6 17 58 / .15);
  --e-2: 0 -6px 20px -14px rgb(6 17 58 / .33);
  --e-3: 0 18px 40px -12px rgb(6 17 58 / .45);
  --e-raise: 0 1px 2px rgb(6 17 58 / .08), 0 2px 6px rgb(6 17 58 / .06);
  --e-bubble: 0 1px .5px rgb(6 17 58 / .10);      /* level 1: bubbles, day chips, system chips */
  --e-menu: 0 1px 2px rgb(6 17 58 / .06), 0 8px 24px rgb(6 17 58 / .12); /* level 2: menus, selection bar, drawer */

  /* sizes */
  --tap: 52px; --tap-min: 44px; --top-h: 56px; --content-max: 1120px;
  --tabs-h: 64px;              /* bottom tabs, plus the safe area */
  --rail-w: 64px;              /* desktop nav rail */
  --list-w: clamp(320px, 30vw, 440px); /* chat list pane in the split view */
  --drawer-w: 380px;           /* chat info drawer */
  --conv-head-h: 60px;
  --row-h: 72px;               /* chat row min height: avatar 48 + 12 top and bottom */
  --row-inset: 76px;           /* divider starts after the avatar: 16 gutter + 48 + 12 */
  --av-md: 48px; --av-sm: 40px;
  --chip-h: 32px;              /* visible; the hit area is 44 (::before outset) */
  /* older names, kept so screens not rebuilt yet keep their offsets */
  --nav-h: var(--tabs-h); --side-w: var(--rail-w);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  /* motion */
  --dur-1: 90ms; --dur-2: 160ms; --dur-3: 240ms; --dur-4: 340ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --ease-inout: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.5, .6, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #5E89FF; --brand-strong: #83A7FF; --brand-ink: #050A1A; --brand-mid: #11247C; --brand-tint: #162762; --brand-wash: #111E46; --brand-ring: #243B83;
    --on-brand: #081025; --amber: #FFB703; --on-ink: #FFFFFF; --on-ink-2: #CADBFF; --on-ink-link: #AFC7FF; --link: #83A7FF; --chip-on: #5E89FF; --on-chip: #081025; --hero-a: #0D1C52; --hero-b: #182DAB; --hero-c: #2B4CFF;
    --bg: #081025; --surface: #0F1A38; --surface-2: #1A243F; --surface-3: #202D52; --scrim: rgb(2 4 16 / .7);
    --canvas: #070D1F; --canvas-dot: #101932; --rail: #070D1F; --pane-line: #202D52;
    --bubble-in: #0F1A38; --bubble-out: #162762; --bubble-meta: #8A99BB; --tick-read: #A6C2FF;
    --wait-badge: #C8323A; --due-badge: #B45309; --on-wait-badge: #FFFFFF;
    --lb-1: #162762; --lb-1-fg: #A6C2FF; --lb-2: #0B2433; --lb-2-fg: #7DD3FC; --lb-3: #33240B; --lb-3-fg: #FCD34D; --lb-4: #3A1028; --lb-4-fg: #F9A8D4;
    --lb-5: #3A1A0A; --lb-5-fg: #FDBA74; --lb-6: #1E2533; --lb-6-fg: #CBD5E1; --lb-ok: #0F2A1A; --lb-ok-fg: #86EFAC; --lb-grey: #1A243F; --lb-grey-fg: #BEC8DE;
    --ink: #E3ECFF; --ink-2: #BEC8DE; --muted: #8A99BB; --faint: #5F6D8F;
    --line: #202D52; --line-2: #32426E;
    --st-us-fg: #FFB4A8;   --st-us-bg: #3B1410;   --st-us: #FF6B61;
    --st-due-fg: #FCD34D;  --st-due-bg: #33240B;  --st-due: #F59E0B;
    --st-them-fg: #BEC8DE; --st-them-bg: #1A243F; --st-them: #828DA9;
    --st-cold-fg: #7DD3FC; --st-cold-bg: #0B2433; --st-cold: #38BDF8;
    --st-quiet-fg: #8A99BB;--st-quiet-bg: #141F3C;--st-quiet: #525E7A;
    --st-ok-fg: #86EFAC;   --st-ok-bg: #0F2A1A;   --st-ok: #22C55E;
    --ai-fg: #A6C2FF;      --ai-bg: #162762;
    --err-toast: #7A1610;
    --badge: #C8323A; --on-badge: #FFFFFF;
    --av-1: #162762; --av-1-fg: #CADBFF; --av-2: #3B1410; --av-2-fg: #FFC9C0; --av-3: #0B2433; --av-3-fg: #BAE6FD;
    --av-4: #0F2A1A; --av-4-fg: #BBF7D0; --av-5: #33240B; --av-5-fg: #FDE68A; --av-6: #3A1029; --av-6-fg: #FBCFE8;
    --focus: #FFB703;
    --e-1: 0 0 0 1px var(--line);
    --e-2: 0 -1px 0 var(--line);
    --e-3: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgb(0 0 0 / .7);
    --e-raise: 0 0 0 1px var(--line-2);
    --e-bubble: 0 1px .5px rgb(0 0 0 / .45);
    --e-menu: 0 0 0 1px var(--line-2), 0 8px 24px rgb(0 0 0 / .5);
  }
}
:root[data-theme="dark"] {
    --brand: #5E89FF; --brand-strong: #83A7FF; --brand-ink: #050A1A; --brand-mid: #11247C; --brand-tint: #162762; --brand-wash: #111E46; --brand-ring: #243B83;
    --on-brand: #081025; --amber: #FFB703; --on-ink: #FFFFFF; --on-ink-2: #CADBFF; --on-ink-link: #AFC7FF; --link: #83A7FF; --chip-on: #5E89FF; --on-chip: #081025; --hero-a: #0D1C52; --hero-b: #182DAB; --hero-c: #2B4CFF;
    --bg: #081025; --surface: #0F1A38; --surface-2: #1A243F; --surface-3: #202D52; --scrim: rgb(2 4 16 / .7);
    --canvas: #070D1F; --canvas-dot: #101932; --rail: #070D1F; --pane-line: #202D52;
    --bubble-in: #0F1A38; --bubble-out: #162762; --bubble-meta: #8A99BB; --tick-read: #A6C2FF;
    --wait-badge: #C8323A; --due-badge: #B45309; --on-wait-badge: #FFFFFF;
    --lb-1: #162762; --lb-1-fg: #A6C2FF; --lb-2: #0B2433; --lb-2-fg: #7DD3FC; --lb-3: #33240B; --lb-3-fg: #FCD34D; --lb-4: #3A1028; --lb-4-fg: #F9A8D4;
    --lb-5: #3A1A0A; --lb-5-fg: #FDBA74; --lb-6: #1E2533; --lb-6-fg: #CBD5E1; --lb-ok: #0F2A1A; --lb-ok-fg: #86EFAC; --lb-grey: #1A243F; --lb-grey-fg: #BEC8DE;
    --ink: #E3ECFF; --ink-2: #BEC8DE; --muted: #8A99BB; --faint: #5F6D8F;
    --line: #202D52; --line-2: #32426E;
    --st-us-fg: #FFB4A8;   --st-us-bg: #3B1410;   --st-us: #FF6B61;
    --st-due-fg: #FCD34D;  --st-due-bg: #33240B;  --st-due: #F59E0B;
    --st-them-fg: #BEC8DE; --st-them-bg: #1A243F; --st-them: #828DA9;
    --st-cold-fg: #7DD3FC; --st-cold-bg: #0B2433; --st-cold: #38BDF8;
    --st-quiet-fg: #8A99BB;--st-quiet-bg: #141F3C;--st-quiet: #525E7A;
    --st-ok-fg: #86EFAC;   --st-ok-bg: #0F2A1A;   --st-ok: #22C55E;
    --ai-fg: #A6C2FF;      --ai-bg: #162762;
    --err-toast: #7A1610;
    --badge: #C8323A; --on-badge: #FFFFFF;
    --av-1: #162762; --av-1-fg: #CADBFF; --av-2: #3B1410; --av-2-fg: #FFC9C0; --av-3: #0B2433; --av-3-fg: #BAE6FD;
    --av-4: #0F2A1A; --av-4-fg: #BBF7D0; --av-5: #33240B; --av-5-fg: #FDE68A; --av-6: #3A1029; --av-6-fg: #FBCFE8;
    --focus: #FFB703;
    --e-1: 0 0 0 1px var(--line);
    --e-2: 0 -1px 0 var(--line);
    --e-3: 0 0 0 1px var(--line-2), 0 18px 40px -12px rgb(0 0 0 / .7);
    --e-raise: 0 0 0 1px var(--line-2);
    --e-bubble: 0 1px .5px rgb(0 0 0 / .45);
    --e-menu: 0 0 0 1px var(--line-2), 0 8px 24px rgb(0 0 0 / .5);
}
@media (min-width: 900px) {
  :root { --gutter: 28px; --pad: 20px; --t-hero: 800 60px/62px var(--font-display); }
}
@media (prefers-contrast: more) {
  :root { --line: var(--line-2); --pane-line: var(--line-2); --muted: var(--ink-2); --bubble-meta: var(--ink-2); }
}
