/* InvictusCAD - shared design tokens. Loaded by BOTH the studio (/) and Jobs (/next),
   before their own stylesheets. Solaris Marine palette (2026-10-04, B12b): brand blue #1a6db5,
   navy #0D1824 / #0B1421, cool-grey neutrals, light and dark. Text tokens are >= 4.5:1 on
   --hull-0..--hull-3 (ratios in ux-audit/b12b-shots/CONTRAST.md).
   Two name sets resolve to the same values: --hull-*, --rule (studio) and --bg, --panel, --line (Jobs).
   Roles: --accent = blue for text, links, lines, focus; --accent-deep = solid fill behind white text
   (primary buttons, own chat bubbles); --accent-hover = that fill on hover; --accent-ink = text on a
   solid --accent fill; --accent-text = accent words on their own tint (a chip), >= 4.5:1 on that tint over a
   panel and over a hovered row (RC22.6 UX P1-5: light 6.28:1 / 5.65:1, dark 5.65:1 / 4.55:1). */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-var-latin.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../fonts/jetbrainsmono-var-latin.woff2") format("woff2"); }
/* the InvictusCAD wordmark only (header lockup); see fonts/ibm-plex/README.md */
@font-face { font-family: "IBM Plex Sans Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex/ibmplexsanscondensed-600-latin.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex/ibmplexmono-500-latin.woff2") format("woff2"); }

:root {
  /* dark (default) */
  --navy: #0d1824;
  --hull-0: #0b1421; --hull-1: #0e1826; --hull-2: #132033; --hull-3: #192a41; --hull-4: #213550;
  --rule: #1c2c42; --rule-strong: #2c425c;
  --ink: #e8eef5; --ink-2: #b8c4d3; --ink-3: #9dacbf; --ink-4: #94a5ba;
  --accent: #5ba8ea; --accent-deep: #1f6fb8; --accent-hover: #1a5c9c; --accent-ink: #0b1421; --wash: rgba(91,168,234,.13);
  --accent-text: #5ba8ea;
  --ok: #3fb27f; --warn: #e0a13a; --err: #f4786d;
  --stale: #a8977c;   /* out of date: a muted amber-grey, never --warn (W6); 6.3:1 on --panel */
  --yellow-cell: rgba(255,217,102,.16); --yellow-line: rgba(255,217,102,.55);
  --scrim: rgba(5,10,18,.55);
  --shadow: 0 8px 24px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.25);
  --elev-1: 0 1px 2px rgba(0,0,0,.18);
  --elev-2: 0 8px 28px rgba(0,0,0,.35);
  /* one colour per parts-list item (W3): item n uses --item-((n-1) % 12 + 1). one hue per item in both themes (only the lightness differs), >= 3:1 against --hull-1, every pair >= 19 CIE76 apart,
     checked for deuteranopia / protanopia / tritanopia with tools/palette_check.py (see docs/DRAWING-WORKSPACE.md); the item number always sits beside the chip */
  --item-1: #8963EA;
  --item-2: #C89D99;
  --item-3: #EE9C5B;
  --item-4: #82AFFE;
  --item-5: #A5A1BE;
  --item-6: #BC6400;
  --item-7: #FED5CA;
  --item-8: #627BAE;
  --item-9: #78E1FF;
  --item-10: #85727C;
  --item-11: #CCE199;
  --item-12: #AE744B;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --hull-0: #f5f7fa; --hull-1: #ffffff; --hull-2: #fafbfd; --hull-3: #eef2f6; --hull-4: #e3e9f0;
    --rule: #dfe5ec; --rule-strong: #c9d2dc;
    --ink: #0d1824; --ink-2: #3b4a5c; --ink-3: #4d5d70; --ink-4: #566679;
    --accent: #1a6db5; --accent-deep: #1a6db5; --accent-hover: #14558e; --accent-ink: #ffffff; --wash: rgba(26,109,181,.08);
    --accent-text: #14558e;
    --ok: #167240; --warn: #995a00; --err: #be3128;
    --stale: #6f5f48;   /* 6.2:1 on --panel */
    --scrim: rgba(13,24,36,.45);
    --yellow-cell: #fff6d6; --yellow-line: #e8c65a;
    --shadow: 0 8px 24px rgba(13,24,36,.10), 0 2px 6px rgba(13,24,36,.06);
    --elev-1: 0 1px 2px rgba(13,24,36,.06), 0 1px 1px rgba(13,24,36,.04);
    --elev-2: 0 10px 30px rgba(13,24,36,.14);
    /* one colour per parts-list item (W3): item n uses --item-((n-1) % 12 + 1). one hue per item in both themes (only the lightness differs), >= 3:1 against --hull-1, every pair >= 19 CIE76 apart,
       checked for deuteranopia / protanopia / tritanopia with tools/palette_check.py (see docs/DRAWING-WORKSPACE.md); the item number always sits beside the chip */
    --item-1: #9971FA;
    --item-2: #AB817D;
    --item-3: #904D0C;
    --item-4: #2463AA;
    --item-5: #5A5770;
    --item-6: #CC7013;
    --item-7: #74534A;
    --item-8: #123764;
    --item-9: #1398B3;
    --item-10: #413039;
    --item-11: #7C904E;
    --item-12: #592B03;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --hull-0: #f5f7fa; --hull-1: #ffffff; --hull-2: #fafbfd; --hull-3: #eef2f6; --hull-4: #e3e9f0;
  --rule: #dfe5ec; --rule-strong: #c9d2dc;
  --ink: #0d1824; --ink-2: #3b4a5c; --ink-3: #4d5d70; --ink-4: #566679;
  --accent: #1a6db5; --accent-deep: #1a6db5; --accent-hover: #14558e; --accent-ink: #ffffff; --wash: rgba(26,109,181,.08);
  --accent-text: #14558e;
  --ok: #167240; --warn: #995a00; --err: #be3128;
  --stale: #6f5f48;
  --scrim: rgba(13,24,36,.45);
  --yellow-cell: #fff6d6; --yellow-line: #e8c65a;
  --shadow: 0 8px 24px rgba(13,24,36,.10), 0 2px 6px rgba(13,24,36,.06);
  --elev-1: 0 1px 2px rgba(13,24,36,.06), 0 1px 1px rgba(13,24,36,.04);
  --elev-2: 0 10px 30px rgba(13,24,36,.14);
  /* one colour per parts-list item (W3): item n uses --item-((n-1) % 12 + 1). one hue per item in both themes (only the lightness differs), >= 3:1 against --hull-1, every pair >= 19 CIE76 apart,
     checked for deuteranopia / protanopia / tritanopia with tools/palette_check.py (see docs/DRAWING-WORKSPACE.md); the item number always sits beside the chip */
  --item-1: #9971FA;
  --item-2: #AB817D;
  --item-3: #904D0C;
  --item-4: #2463AA;
  --item-5: #5A5770;
  --item-6: #CC7013;
  --item-7: #74534A;
  --item-8: #123764;
  --item-9: #1398B3;
  --item-10: #413039;
  --item-11: #7C904E;
  --item-12: #592B03;
  color-scheme: light;
}

/* Jobs names for the same colours (aliases: they follow the theme above) */
:root {
  --bg: var(--hull-0); --panel: var(--hull-1); --raise: var(--hull-2); --hover: var(--hull-3); --sel: var(--hull-4);
  --line: var(--rule); --line-2: var(--rule-strong);

  /* type: one family pair, one scale */
  /* Simplified-Chinese fallbacks (2026-10-03, i18n): Inter has no CJK glyphs, so Chinese
     falls through to the system's own face instead of a random serif. */
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", monospace;
  /* K14 (RC22.6, ux-audit/rc226-big/design-system/SPEC.md section 2): eight sizes named by role, a 12 px floor, nothing
     between 12 and 13. meta: captions, timestamps, hints, badges, chips, column headers, labels, kbd, capitalised labels
     (600, --track-caps); ui: buttons, fields, tabs, menu items, nav, table data, toasts; body: answers, notes, dialog text,
     the composer; title: panel, card, dialog, rail and empty-state titles; h2: section headings; h1: the page title;
     fig: key figures (tiles, totals); touch: fields on a coarse pointer only (a phone does not zoom a 16 px field).
     Exempt from the floor: the "CAD" wordmark, glyphs standing in for icons, text inside drawings and the canvas,
     sup/sub in units, Pricing's grand total (tools/typescale_codemod.py EXEMPT; tests/test_typescale.py). */
  --fs-meta: 12px;   --lh-meta: 16px;
  --fs-ui: 13px;     --lh-ui: 18px;
  --fs-body: 13.5px; --lh-body: 20px;
  --fs-title: 15px;  --lh-title: 20px;
  --fs-h2: 18px;     --lh-h2: 24px;
  --fs-h1: 22px;     --lh-h1: 28px;
  --fs-fig: 24px;    --lh-fig: 28px;
  --fs-touch: 16px;
  --track-caps: .05em;
  /* the old names, aliases until nothing reads them (the stylesheets use the role names: tests/test_typescale.py) */
  --fs-xs: var(--fs-meta); --fs-sm: var(--fs-meta); --fs-md: var(--fs-body); --fs-lg: var(--fs-title); --fs-xl: var(--fs-h2); --fs-2xl: var(--fs-h1);
  /* spacing: 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  /* radii: controls 6, fields and menus 8, panels 12 */
  --r: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 8px; --r-xl: 12px;
  --h-ctl: 32px; --h-ctl-sm: 26px;
  /* UX review K5 (17 Oct): a solid accent ring with a surface-coloured gap (the 35% halo was about 2:1 against the page) */
  --focus: 0 0 0 2px var(--hull-1), 0 0 0 4px var(--accent);
  --ease: cubic-bezier(.2,.7,.2,1);
}

/* Latin tracking (.06em caps labels, -.02em headings) crowds or airs out Chinese glyphs */
:root:lang(zh-CN) * { letter-spacing: normal; }

::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
