/* ==========================================================================
   Claude Skills Team OS: design tokens, "drawing set"
   Commercial real estate runs on drawings, and nothing gets built until a drawing is
   stamped. Here nothing gets saved until the broker confirms. Blueprint paper, navy ink,
   one line blue, amber for what is still waiting, red ink for a refusal.
   IBM Plex Sans for text, IBM Plex Mono for the small uppercase labels.
   Light by default; dark ("blueprint at night") via prefers-color-scheme or
   <html data-theme="dark">. Every text pair below passes WCAG AA (4.5:1).
   ========================================================================== */

:root {
  /* ---------------------------------------------------------------- type */
  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --font-features: normal;

  --text-2xs: 10px;   --leading-2xs: 14px;   /* title block labels */
  --text-xs: 12px;    --leading-xs: 16px;
  --text-sm: 13px;    --leading-sm: 19px;
  --text-base: 14px;  --leading-base: 21px;
  --text-md: 15px;    --leading-md: 23px;
  --text-lg: 16px;    --leading-lg: 24px;
  --text-xl: 18px;    --leading-xl: 26px;
  --text-2xl: 22px;   --leading-2xl: 28px;
  --text-3xl: 26px;   --leading-3xl: 32px;   /* sheet titles */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --tracking-tight: -0.01em;
  --tracking-tighter: -0.02em;
  --tracking-caps: 0.07em;      /* mono uppercase labels: .06 to .08em */

  /* ------------------------------------------------------------- spacing */
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;

  /* --------------------------------------------------------------- radii: square-ish */
  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 4px;
  --radius-xl: 4px;
  --radius-full: 999px;   /* dots only */

  /* --------------------------------------------------------------- sizes */
  --control-sm: 28px;
  --control-md: 38px;
  --control-lg: 44px;     /* minimum touch target on phones */
  --topbar-height: 60px;
  --icon-sm: 14px;
  --icon-md: 16px;
  --icon-lg: 20px;
  --chat-max-width: 840px;
  --bubble-max-width: 540px;
  --grid-size: 24px;

  /* -------------------------------------------------------------- motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-stamp: cubic-bezier(0.3, 1.4, 0.5, 1);
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 360ms;

  /* ------------------------------------------------------ colour: light */
  --color-bg: #f4f7fb;                 /* blueprint paper */
  --color-grid: #dfe7f1;               /* its 24px grid */
  --color-surface: #ffffff;            /* sheets: cards, panes, the story band */
  --color-surface-subtle: #f8fafd;
  --color-surface-muted: #eaf0f7;
  --color-surface-hover: #eef3f9;
  --color-surface-inverse: #0f2240;    /* toasts */
  --color-control-track: #eaf0f7;
  --color-control-selected: #ffffff;

  --color-hairline: #e3eaf3;           /* rows inside a sheet */
  --color-border: #c9d6e6;
  --color-border-strong: #9fb4cf;      /* sheet edges, inputs, secondary buttons */

  --color-text: #0f2240;               /* navy ink: 14.8:1 on paper */
  --color-text-secondary: #3e5170;     /*  7.5:1 on paper */
  --color-text-tertiary: #5a6b87;      /*  5.0:1 on paper, 4.7:1 on muted */
  --color-text-inverse: #ffffff;

  --color-ink: #0f2240;                /* primary buttons and the SAVED stamp */
  --color-ink-hover: #1b3561;
  --color-on-ink: #ffffff;
  --color-stamp: #0f2240;              /* the SAVED stamp: navy ink */

  --color-accent: #2457a6;             /* line blue: drawing lines, links, kickers */
  --color-accent-hover: #1c4789;
  --color-accent-pressed: #163a70;
  --color-on-accent: #ffffff;
  --color-accent-text: #2457a6;        /* 6.5:1 on paper */
  --color-accent-soft: #eaf1fb;
  --color-accent-soft-text: #1c4789;
  --color-accent-border: #b8ccea;
  --color-focus-ring: rgba(36, 87, 166, 0.25);

  /* amber: what is still waiting for the broker */
  --color-amber-soft: #fff8ea;
  --color-amber-border: #ebcb8b;
  --color-amber-text: #8a5a0b;         /* 5.6:1 on amber soft */
  --color-amber-strong: #4a3608;       /* 10.9:1 */
  --color-amber-line: #b7791f;         /* leaders and dots on the drawing */

  /* saved is ink, not green: a stamped drawing */
  --color-success: #2457a6;
  --color-success-soft: #eaf1fb;
  --color-success-text: #1c4789;
  --color-success-border: #b8ccea;

  --color-warning: #b7791f;
  --color-warning-soft: #fff8ea;
  --color-warning-text: #8a5a0b;
  --color-warning-border: #ebcb8b;

  /* red ink: a refusal */
  --color-danger: #a8261c;
  --color-danger-soft: #fdf0ee;
  --color-danger-text: #a8261c;        /* 6.4:1 on danger soft */
  --color-danger-border: #e9b9b3;

  --color-bubble-out: #eaf0f7;
  --color-bubble-out-text: var(--color-text);

  /* ------------------------------------------------------------- shadows */
  --shadow-xs: 0 1px 0 rgba(15, 34, 64, 0.04);
  --shadow-sm: 0 1px 0 var(--color-border), 0 6px 14px -10px rgba(15, 34, 64, 0.25);
  --shadow-md: 0 1px 0 var(--color-border), 0 14px 28px -18px rgba(15, 34, 64, 0.3);
  --shadow-lg: 0 1px 0 var(--color-border), 0 24px 48px -28px rgba(15, 34, 64, 0.35);
  --shadow-xl: 0 -18px 40px -24px rgba(15, 34, 64, 0.35);
  --shadow-focus: 0 0 0 3px var(--color-focus-ring);
  --shadow-scroll: inset 0 -12px 10px -12px rgba(15, 34, 64, 0.3);   /* more below: the card's fields scroll */

  color-scheme: light;
}

/* ------------------------------------------- colour: dark, "blueprint at night" */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0b1628;
    --color-grid: #15243b;
    --color-surface: #111f36;
    --color-surface-subtle: #0e1a2f;
    --color-surface-muted: #18294a;
    --color-surface-hover: #162746;
    --color-surface-inverse: #e7eef8;
    --color-control-track: #0b1628;
    --color-control-selected: #1d3157;
    --color-hairline: #1c2e4d;
    --color-border: #263b5e;
    --color-border-strong: #3a5580;
    --color-text: #e7eef8;
    --color-text-secondary: #a9bad3;
    --color-text-tertiary: #8a9cb8;
    --color-text-inverse: #0b1628;
    --color-ink: #e7eef8;
    --color-ink-hover: #ffffff;
    --color-on-ink: #0b1628;
    --color-stamp: #a9c6f2;
    --color-accent: #7fa8e6;
    --color-accent-hover: #9bbcee;
    --color-accent-pressed: #6a95d6;
    --color-on-accent: #0b1628;
    --color-accent-text: #7fa8e6;
    --color-accent-soft: #142a4d;
    --color-accent-soft-text: #a9c6f2;
    --color-accent-border: #2e4a78;
    --color-focus-ring: rgba(127, 168, 230, 0.35);
    --color-amber-soft: #2a2010;
    --color-amber-border: #6b5222;
    --color-amber-text: #f2c46d;
    --color-amber-strong: #fbe3b0;
    --color-amber-line: #e0a84a;
    --color-success: #7fa8e6;
    --color-success-soft: #142a4d;
    --color-success-text: #a9c6f2;
    --color-success-border: #2e4a78;
    --color-warning: #e0a84a;
    --color-warning-soft: #2a2010;
    --color-warning-text: #f2c46d;
    --color-warning-border: #6b5222;
    --color-danger: #ff9a90;
    --color-danger-soft: #2e1618;
    --color-danger-text: #ff9a90;
    --color-danger-border: #6a2f2b;
    --color-bubble-out: #18294a;
    --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 0 #0a1424, 0 6px 14px -10px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 1px 0 #0a1424, 0 14px 28px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 1px 0 #0a1424, 0 24px 48px -28px rgba(0, 0, 0, 0.8);
    --shadow-xl: 0 -18px 40px -24px rgba(0, 0, 0, 0.8);
    --shadow-scroll: inset 0 -14px 12px -12px rgba(127, 168, 230, 0.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --color-bg: #0b1628;
  --color-grid: #15243b;
  --color-surface: #111f36;
  --color-surface-subtle: #0e1a2f;
  --color-surface-muted: #18294a;
  --color-surface-hover: #162746;
  --color-surface-inverse: #e7eef8;
  --color-control-track: #0b1628;
  --color-control-selected: #1d3157;
  --color-hairline: #1c2e4d;
  --color-border: #263b5e;
  --color-border-strong: #3a5580;
  --color-text: #e7eef8;
  --color-text-secondary: #a9bad3;
  --color-text-tertiary: #8a9cb8;
  --color-text-inverse: #0b1628;
  --color-ink: #e7eef8;
  --color-ink-hover: #ffffff;
  --color-on-ink: #0b1628;
  --color-stamp: #a9c6f2;
  --color-accent: #7fa8e6;
  --color-accent-hover: #9bbcee;
  --color-accent-pressed: #6a95d6;
  --color-on-accent: #0b1628;
  --color-accent-text: #7fa8e6;
  --color-accent-soft: #142a4d;
  --color-accent-soft-text: #a9c6f2;
  --color-accent-border: #2e4a78;
  --color-focus-ring: rgba(127, 168, 230, 0.35);
  --color-amber-soft: #2a2010;
  --color-amber-border: #6b5222;
  --color-amber-text: #f2c46d;
  --color-amber-strong: #fbe3b0;
  --color-amber-line: #e0a84a;
  --color-success: #7fa8e6;
  --color-success-soft: #142a4d;
  --color-success-text: #a9c6f2;
  --color-success-border: #2e4a78;
  --color-warning: #e0a84a;
  --color-warning-soft: #2a2010;
  --color-warning-text: #f2c46d;
  --color-warning-border: #6b5222;
  --color-danger: #ff9a90;
  --color-danger-soft: #2e1618;
  --color-danger-text: #ff9a90;
  --color-danger-border: #6a2f2b;
  --color-bubble-out: #18294a;
  --shadow-xs: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 0 #0a1424, 0 6px 14px -10px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 1px 0 #0a1424, 0 14px 28px -18px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 1px 0 #0a1424, 0 24px 48px -28px rgba(0, 0, 0, 0.8);
  --shadow-xl: 0 -18px 40px -24px rgba(0, 0, 0, 0.8);
  --shadow-scroll: inset 0 -14px 12px -12px rgba(127, 168, 230, 0.35);
  color-scheme: dark;
}
