/*! Tiansight 侍天 design system v0.7 — one-file bundle.
 * Source: brand/fonts.css, brand/tokens.css, brand/base.css, brand/components.css · generated by scripts/build_dist.py, do not edit.
 * Webfont files are not bundled; faces fall back to local serifs until brand/fonts/ is filled.
 * Tokens as data: dist/tokens.json · icon sprite: dist/icons.svg · changelog: CHANGELOG.md
 */

/* ══ brand/fonts.css ══════════════════════════════════════════ */
/* Tiansight 侍天 — self-hosted webfonts. Load before tokens.css.
   Files are not bundled: place woff2 files in brand/fonts/ (see brand/fonts/README.md).
   Each face tries the locally installed font first, then the hosted file; when neither
   exists the stacks in tokens.css fall back to system serifs, never to sans-serif. */

/* Noto Serif SC 思源宋体 — CN display, headings, body, aux */
@font-face { font-family: "Noto Serif SC"; font-weight: 300; font-style: normal; font-display: swap;
  src: local("Noto Serif SC Light"), local("NotoSerifSC-Light"), url("../brand/fonts/NotoSerifSC-Light.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("Noto Serif SC"), local("NotoSerifSC-Regular"), url("../brand/fonts/NotoSerifSC-Regular.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-weight: 500; font-style: normal; font-display: swap;
  src: local("Noto Serif SC Medium"), local("NotoSerifSC-Medium"), url("../brand/fonts/NotoSerifSC-Medium.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-weight: 600; font-style: normal; font-display: swap;
  src: local("Noto Serif SC SemiBold"), local("NotoSerifSC-SemiBold"), url("../brand/fonts/NotoSerifSC-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif SC"; font-weight: 700; font-style: normal; font-display: swap;
  src: local("Noto Serif SC Bold"), local("NotoSerifSC-Bold"), url("../brand/fonts/NotoSerifSC-Bold.woff2") format("woff2"); }

/* Noto Serif — Latin captions and quotes */
@font-face { font-family: "Noto Serif"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("Noto Serif"), local("NotoSerif-Regular"), url("../brand/fonts/NotoSerif-Regular.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: local("Noto Serif Italic"), local("NotoSerif-Italic"), url("../brand/fonts/NotoSerif-Italic.woff2") format("woff2"); }
@font-face { font-family: "Noto Serif"; font-weight: 700; font-style: normal; font-display: swap;
  src: local("Noto Serif Bold"), local("NotoSerif-Bold"), url("../brand/fonts/NotoSerif-Bold.woff2") format("woff2"); }

/* IBM Plex Mono — hex, tokens, data, prices only */
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: local("IBM Plex Mono"), local("IBMPlexMono-Regular"), url("../brand/fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: local("IBM Plex Mono Medium"), local("IBMPlexMono-Medium"), url("../brand/fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* ══ brand/tokens.css ══════════════════════════════════════════ */
/* Tiansight 侍天 — foundation tokens.
   Source: the published guide (brand/guide.md), provenance in brand/source.json.
   Section 1 values are the published palette and are checked by scripts/check.py.
   Everything below "derived" is derived from the guide's stated rules; nothing here
   comes from the supplied export's proposal scales. */
:root {
  color-scheme: light;

  /* ── 1. Color / 色彩 — published palette ─────────────────── */
  --surface: #F4F0E7;       /* 淡墨纸 Pale Manuscript — base canvas */
  --paper: #FFFDF8;         /* 宣纸 Paper — raised content */
  --ink-primary: #EFE6D2;   /* 素墨 Ink — primary brand color: fields, key actions */
  --charcoal: #17130D;      /* 玄墨 Charcoal — titles, primary text */
  --gold: #76551F;          /* 土金 Earth Gold — rules, strokes, navigation */
  --gold-hi: #D4A862;       /* 明金 Bright Gold — active state, key numbers */
  --gold-deep: #76551F;     /* 深金 Deep Gold — captions, EN labels (same hex as --gold; kept as its own token, ruling Q3 v0.7) */
  --ink-muted: #706758;     /* 素墨灰 Ink Muted — secondary text */
  --seal: #8C3228;          /* 朱红 Vermillion — seal, negation, warnings, ≤ 5% */

  /* surfaces (derived, on pale manuscript) */
  --line: rgba(23, 19, 13, 0.18);          /* hairline */
  --line-strong: rgba(23, 19, 13, 0.34);   /* hairline-strong */
  --card-border: rgba(118, 85, 31, 0.34);
  --rule: var(--gold);                     /* structural rule, 1px */
  --watermark: rgba(118, 85, 31, 0.10);    /* compass ring behind heroes */
  --scrim: rgba(23, 19, 13, 0.55);
  --focus: rgba(118, 85, 31, 0.5);

  /* text roles */
  --text: var(--charcoal);
  --text-muted: var(--ink-muted);
  --text-caption: var(--gold-deep);
  --text-key: var(--gold-hi);              /* key numbers 28px+, active states — never body-size on pale */
  --text-tagline: var(--gold-deep);        /* 智慧领航者 at every size (ruling Q2 v0.7) */
  --text-on-charcoal: var(--surface);
  --text-on-charcoal-key: var(--gold-hi);

  /* inverse surface — one card per view (百年共创 tier); never a page ground (v0.7) */
  --surface-inverse: var(--charcoal);
  --text-on-inverse: var(--surface);
  --muted-on-inverse: rgba(244, 240, 231, 0.72);
  --line-inverse: rgba(244, 240, 231, 0.22);

  /* gold ramp — hover one step darker, press two (v0.7) */
  --gold-100: #F3E7CF;
  --gold-300: #D4A862;
  --gold-400: #A8842F;
  --gold-500: #76551F;
  --gold-600: #5C4218;
  --gold-700: #3F2D0F;
  --gold-hover: var(--gold-600);
  --gold-press: var(--gold-700);

  /* shadow — dialogs and overlays only; cards stay bordered (v0.7) */
  --shadow-1: 0 1px 2px rgba(23, 19, 13, 0.08);
  --shadow-2: 0 2px 6px rgba(23, 19, 13, 0.10);
  --shadow-3: 0 6px 18px rgba(23, 19, 13, 0.12);
  --shadow-4: 0 14px 40px rgba(23, 19, 13, 0.16);

  /* state */
  --positive: var(--gold-hi);              /* ✓ */
  --negative: var(--seal);                 /* ✕, warnings */

  /* charts (guide §5): 1 series = gold-hi; 2 = + charcoal; 3 = + seal */
  --chart-1: var(--gold-hi);
  --chart-2: var(--charcoal);
  --chart-3: var(--seal);
  --chart-axis: var(--ink-muted);
  --chart-grid: var(--line);
  --chart-benchmark: rgba(112, 103, 88, 0.45);
  /* semantic set — report/ only, when 增长 must be told from 关注 (v0.7) */
  --chart-growth: #4E6B3F;
  --chart-caution: #B98B2A;
  --chart-benchmark-solid: #6E6355;
  --chart-loss: var(--seal);

  /* ── 2. Typography / 字体 ─────────────────────────────────── */
  --font-cn: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-en: "Noto Serif", "Source Han Serif", "Songti SC", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --weight-aux: 300;
  --weight-body: 400;
  --weight-medium: 500;
  --weight-title: 600;
  --weight-strong: 700;

  --text-display: clamp(3rem, 8vw, 6rem);  /* 48–96px, 侍天 lockup */
  --text-h1: clamp(2.25rem, 5vw, 3.5rem);  /* 36–56px */
  --text-h2: clamp(1.75rem, 3.5vw, 2.5rem);/* 28–40px */
  --text-h3: 1.75rem;                      /* 28px */
  --text-body: 1.125rem;                   /* 18px */
  --text-small: 0.875rem;                  /* 14px */
  --text-caption: 0.8125rem;               /* 13px */
  --text-mono: 0.8125rem;                  /* 13px */
  --type-ui: 1rem;                         /* 16px forms, buttons (v0.7) */
  --type-table: 0.875rem;                  /* 14px table body */
  --type-badge: 0.75rem;                   /* 12px badges */
  --type-tick: 0.6875rem;                  /* 11px chart ticks */

  --leading-display: 1;
  --leading-h1: 1.1;
  --leading-h2: 1.15;
  --leading-h3: 1.3;
  --leading-body: 1.7;
  --leading-small: 1.8;
  --leading-caption: 1.4;
  --leading-mono: 1.5;

  --tracking-display: 0.14em;
  --tracking-caps: 0.34em;
  --tracking-caps-tight: 0.3em;
  --tracking-tagline: 0.5em;

  --measure-cn: 36em;   /* 28–38 CN chars per line */
  --measure-en: 66ch;   /* 60–72 EN chars per line */

  /* ── 7. Layout / 版式 ─────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 48px;
  --space-9: 64px;
  --space-10: 96px;

  --container: 1280px;
  --columns: 12;
  --gutter: 48px;
  --section-gap: 96px;
  --card-pad: 24px;             /* 20–28px card, 24–32px inner */
  --card-pad-lg: 32px;

  --radius: 2px;                /* never round */
  --radius-pill: 999px;         /* outline status badge only */

  --swatch: 32px;               /* token row swatch 30–34px */

  /* mark */
  --mark-min-inline: 24px;
  --mark-min-hero: 64px;

  /* motion — quiet, short, no bounce */
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-reveal: 700ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-sticky: 100;
  --z-overlay: 400;
  --z-modal: 500;
}
@media (max-width: 640px) {
  :root {
    --gutter: 24px;
    --section-gap: 64px;
    --card-pad: 20px;
    --card-pad-lg: 24px;
  }
}

/* ══ brand/base.css ══════════════════════════════════════════ */
/* Tiansight 侍天 — element defaults on the published foundation.
   Requires tokens.css. Serif end-to-end; mono only for hex, tokens, data, prices. */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background: var(--surface);
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-cn);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

/* headings: 600, charcoal, CN never italic */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-cn);
  font-weight: var(--weight-title);
  font-style: normal;
}
h1 { font-size: var(--text-h1); line-height: var(--leading-h1); }
h2 { font-size: var(--text-h2); line-height: var(--leading-h2); }
h3 { font-size: var(--text-h3); line-height: var(--leading-h3); }
h4 { font-size: var(--text-body); line-height: var(--leading-h3); }

p { margin: 0 0 var(--space-4); max-width: var(--measure-cn); }
p:lang(en) { max-width: var(--measure-en); }
small, .ts-small {
  font-size: var(--text-small);
  font-weight: var(--weight-aux);
  line-height: var(--leading-small);
}
strong, b { font-weight: var(--weight-title); }
em { font-style: normal; color: var(--gold-hi); }          /* CN emphasis = color, not italic */
em:lang(en), .ts-latin em { font-style: italic; color: inherit; }

a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid var(--line-strong);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
a:hover { color: var(--charcoal); border-bottom-color: var(--gold); }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--space-7) 0;
}
hr.ts-hairline { border-top-color: var(--line); }

code, kbd, samp, pre, .ts-mono, .ts-num {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: var(--leading-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
pre { margin: 0 0 var(--space-4); white-space: pre-wrap; overflow-wrap: anywhere; }

img, svg { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
figcaption { font-size: var(--text-small); color: var(--text-muted); }

table { border-collapse: collapse; width: 100%; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
}
th {
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-caption);
  border-top: 0;
  border-bottom: 1px solid var(--rule);
}
tbody tr:last-child td { border-bottom: 1px solid var(--line); }
td.ts-num, th.ts-num { text-align: right; }

[id] { scroll-margin-top: 80px; }
::selection { background: var(--ink-primary); color: var(--charcoal); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Latin caption / eyebrow: UPPERCASE, letter-spaced, deep gold */
.ts-caption, .ts-eyebrow {
  font-family: var(--font-en);
  font-size: var(--text-caption);
  font-weight: var(--weight-body);
  line-height: var(--leading-caption);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-caption);
}
.ts-latin { font-family: var(--font-en); }
.ts-muted { color: var(--text-muted); }
.ts-key { color: var(--text-key); }
.ts-measure { max-width: var(--measure-cn); }
.ts-measure-en { max-width: var(--measure-en); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  html, body { background: var(--surface); }
  @page { margin: 0; }
  a { border-bottom: 0; }
}

/* ══ brand/components.css ══════════════════════════════════════════ */
/* Tiansight 侍天 — CSS components on the published foundation (guide §5, §7).
   Requires tokens.css and base.css. Prefix: .ts-  No raw hex here: every color is a token. */

/* ── Layout ───────────────────────────────────────────────── */
.ts-container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.ts-section { padding-block: var(--section-gap); scroll-margin-top: 72px; }
.ts-section + .ts-section { border-top: 1px solid var(--line); }
.ts-grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: var(--space-6);
}
.ts-grid > * { grid-column: span var(--span, 12); }
@media (max-width: 900px) { .ts-grid > * { grid-column: span var(--span-md, 12); } }
@media (max-width: 640px) { .ts-grid > * { grid-column: span 12; } }
.ts-stack > * + * { margin-top: var(--space-4); }
.ts-center { text-align: center; }

/* ── Heading pair: CN heading + UPPERCASE EN caption ───────── */
.ts-heading { display: flex; flex-direction: column; gap: var(--space-2); }
.ts-heading .ts-caption { order: -1; }
.ts-heading .ts-sub {
  color: var(--text-muted);
  font-weight: var(--weight-aux);
  max-width: var(--measure-cn);
}

/* ── Display lockup / tagline (cover pattern, guide §7) ───── */
.ts-lockup {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--space-5);
  position: relative;
}
.ts-display {
  font-family: var(--font-cn);
  font-size: var(--text-display);
  font-weight: var(--weight-title);
  line-height: var(--leading-display);
  letter-spacing: var(--tracking-display);
  margin-inline-end: calc(-1 * var(--tracking-display)); /* optical centre with tracking */
  color: var(--text);
}
.ts-tagline {
  font-family: var(--font-cn);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  letter-spacing: var(--tracking-tagline);
  margin-inline-end: calc(-1 * var(--tracking-tagline));
  color: var(--text-tagline);
}
.ts-lockup > hr, .ts-divider {
  width: 72px; margin: 0; border-top: 1px solid var(--rule);
}

/* ── Rules & framing: hairlines, double rules, corner ticks ── */
.ts-rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.ts-rule-double { border: 0; border-top: 3px double var(--rule); margin: 0; }
.ts-frame {
  position: relative;
  border: 1px solid var(--card-border);
  padding: var(--card-pad-lg);
  background: var(--paper);
}
.ts-frame::before, .ts-frame::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--gold); border-style: solid;
}
.ts-frame::before { top: 6px; left: 6px; border-width: 1px 0 0 1px; }
.ts-frame::after { bottom: 6px; right: 6px; border-width: 0 1px 1px 0; }
.ts-frame-double { outline: 1px solid var(--card-border); outline-offset: 4px; }

/* ── Compass-ring watermark (concentric circles + crosshair) ─ */
.ts-compass {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.ts-compass svg {
  position: absolute; width: var(--compass-size, 560px); height: var(--compass-size, 560px);
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  color: var(--watermark);
}
.ts-compass ~ * { position: relative; z-index: 1; }

/* ── Card ─────────────────────────────────────────────────── */
.ts-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--card-pad);
  color: var(--text);
}
.ts-card > .ts-caption { margin-bottom: var(--space-2); }
.ts-card-title {
  font-size: 1.25rem; /* 18–20px */
  font-weight: var(--weight-title);
  line-height: var(--leading-h3);
  margin: 0 0 var(--space-3);
}
.ts-card p:last-child { margin-bottom: 0; }
.ts-card[data-index]::after {   /* 天干 index: 壹 貳 叁 … top-right, vermillion */
  content: attr(data-index);
  position: absolute; top: var(--space-4); right: var(--space-4);
  font-family: var(--font-cn); font-size: var(--text-small); font-weight: var(--weight-title);
  color: var(--seal); line-height: 1;
}
.ts-card-field { background: var(--ink-primary); border-color: var(--card-border); }
.ts-card-charcoal { background: var(--charcoal); color: var(--text-on-charcoal); border-color: var(--gold); }
.ts-card-charcoal .ts-card-title, .ts-card-charcoal h3 { color: var(--text-on-charcoal); }
.ts-card-charcoal .ts-caption { color: var(--text-on-charcoal-key); }
.ts-card-charcoal .ts-muted { color: var(--gold-hi); }
.ts-card-charcoal[data-index]::after { color: var(--gold-hi); }
.ts-card-interactive { transition: border-color var(--dur-base) var(--ease); cursor: pointer; }
.ts-card-interactive:hover { border-color: var(--gold); }
.ts-card-interactive:active { transform: translateY(1px); }

/* ── Token / table row: hairline top, swatch, mono hex, usage ─ */
.ts-token-row {
  display: grid;
  grid-template-columns: var(--swatch) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.6fr);
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
}
.ts-token-row:last-child { border-bottom: 1px solid var(--line); }
.ts-swatch {
  width: var(--swatch); height: var(--swatch);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--swatch-color, var(--ink-primary));
}
.ts-token-row .ts-token-name { font-size: var(--text-small); font-weight: var(--weight-body); line-height: var(--leading-caption); }
.ts-token-row .ts-token-name small { display: block; color: var(--text-muted); }
.ts-token-row .ts-hex { color: var(--gold-hi); }
.ts-token-row .ts-hex[data-small] { color: var(--gold-deep); }
.ts-token-row .ts-usage { font-size: var(--text-small); color: var(--text-muted); line-height: var(--leading-caption); }
@media (max-width: 640px) {
  .ts-token-row { grid-template-columns: var(--swatch) 1fr; }
  .ts-token-row .ts-usage { grid-column: 2; }
}

/* ── Badges ───────────────────────────────────────────────── */
.ts-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  line-height: var(--leading-mono);
  letter-spacing: 0;
  white-space: nowrap;
  border-radius: var(--radius);
  background: var(--ink-primary);
  color: var(--charcoal);
  border: 1px solid transparent;
}
.ts-badge-outline {                    /* status: pill, gold border, bright-gold text */
  background: transparent;
  color: var(--gold-hi);
  border-color: var(--gold);
  border-radius: var(--radius-pill);
}
.ts-badge-seal { background: var(--seal); color: var(--paper); }

/* ── ✓ / ✕ list ───────────────────────────────────────────── */
.ts-check-list { list-style: none; margin: 0; padding: 0; }
.ts-check-list li {
  position: relative; padding-left: 1.6em; margin-bottom: var(--space-2);
}
.ts-check-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  font-family: var(--font-en); font-weight: var(--weight-strong);
  color: var(--positive);
}
.ts-check-list li[data-no]::before, .ts-check-list li.no::before {
  content: "✕"; color: var(--negative);
}

/* ── Buttons: ink field carries the key action ─────────────── */
.ts-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px;
  padding: 10px 24px;
  font-family: var(--font-cn);
  font-size: var(--text-small);
  font-weight: var(--weight-medium);
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--charcoal);
  background: var(--ink-primary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ts-button:hover { border-color: var(--gold); background: var(--paper); color: var(--charcoal); }
.ts-button:active { transform: translateY(1px); }                     /* stamp press */
.ts-button-secondary { background: transparent; border-color: var(--gold); color: var(--gold); }
.ts-button-secondary:hover { background: var(--ink-primary); color: var(--gold-hover); border-color: var(--gold-hover); }
.ts-button-secondary:active { color: var(--gold-press); border-color: var(--gold-press); }
.ts-button-quiet { background: transparent; border-color: transparent; color: var(--gold); padding-inline: var(--space-3); }
.ts-button-quiet:hover { background: transparent; border-color: transparent; color: var(--gold-hover); }
.ts-button-quiet:active { color: var(--gold-press); }
.ts-button-charcoal { background: var(--charcoal); border-color: var(--charcoal); color: var(--surface); }
.ts-button-charcoal:hover { background: var(--charcoal); border-color: var(--gold); color: var(--gold-hi); }
.ts-button-lg { min-height: 52px; padding: 14px 32px; font-size: var(--text-body); }
.ts-button-sm { min-height: 36px; padding: 6px 16px; font-size: var(--text-caption); }
.ts-button[disabled], .ts-button[aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
.ts-button .ts-latin { font-size: var(--text-caption); letter-spacing: var(--tracking-caps-tight); text-transform: uppercase; }

/* ── Form fields: ink field, hairline, 2px ────────────────── */
.ts-field { display: flex; flex-direction: column; gap: var(--space-2); }
.ts-label {
  font-size: var(--text-small); font-weight: var(--weight-medium); color: var(--text);
}
.ts-input, .ts-select, .ts-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font: inherit;
  font-size: var(--text-small);
  color: var(--charcoal);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color var(--dur-fast) var(--ease);
}
.ts-input::placeholder, .ts-textarea::placeholder { color: var(--text-muted); font-weight: var(--weight-aux); }
.ts-input:hover, .ts-select:hover, .ts-textarea:hover { border-color: var(--gold); }
.ts-input:focus, .ts-select:focus, .ts-textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--gold); }
.ts-input[aria-invalid="true"] { border-color: var(--seal); }
.ts-hint { font-size: var(--text-caption); color: var(--text-muted); }
.ts-error { font-size: var(--text-caption); color: var(--seal); }

/* ── Stat: key number in mono, label as caption ───────────── */
.ts-stat { display: flex; flex-direction: column; gap: var(--space-1); }
.ts-stat .ts-value {
  font-family: var(--font-mono);
  font-size: 2.5rem;                 /* 40px: bright gold is legible only at display sizes */
  font-weight: var(--weight-medium);
  line-height: 1.1;
  color: var(--text-key);
  font-variant-numeric: tabular-nums;
}
.ts-stat .ts-value small { font-family: var(--font-cn); font-size: var(--text-body); color: var(--text); margin-left: 0.25em; font-weight: var(--weight-body); }
.ts-stat .ts-value.ts-charcoal { color: var(--charcoal); }
.ts-stat .ts-boundary { font-size: var(--text-small); color: var(--text-muted); font-weight: var(--weight-aux); }

/* ── Quote: editorial, hairline, seal mark ────────────────── */
.ts-quote {
  margin: 0; padding: var(--space-5) 0 var(--space-5) var(--space-6);
  border-left: 1px solid var(--gold);
  font-size: 1.25rem; line-height: 1.6; color: var(--text);
}
.ts-quote footer { margin-top: var(--space-3); font-size: var(--text-small); color: var(--text-muted); }

/* ── Step marker: Chinese numeral in a hairline circle ─────── */
.ts-step {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--gold); border-radius: 50%;
  font-family: var(--font-cn); font-size: var(--text-small); font-weight: var(--weight-title);
  color: var(--gold);
}
.ts-step[aria-current="step"] { background: var(--ink-primary); color: var(--charcoal); border-color: var(--charcoal); }

/* ── Seal stamp: vermillion square containing 侍 / 侍天 ─────── */
.ts-seal-stamp {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--stamp-size, 56px); height: var(--stamp-size, 56px);
  background: var(--seal); color: var(--surface);
  font-family: var(--font-cn); font-weight: var(--weight-title);
  font-size: calc(var(--stamp-size, 56px) * 0.5); line-height: 1;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--seal);
  letter-spacing: 0.04em;
}
.ts-seal-stamp[data-two] { flex-direction: column; font-size: calc(var(--stamp-size, 56px) * 0.36); line-height: 1.05; }

/* ── Mark: the published logo with its clear-space rule ───── */
.ts-mark { display: inline-block; height: var(--mark-size, 40px); width: auto; }
.ts-mark img { height: 100%; width: auto; }
.ts-mark-clear { box-sizing: content-box; padding: calc(var(--mark-size, 40px) * 0.5); }   /* ≥ one ring radius */
.ts-lockup-row { display: inline-flex; align-items: center; gap: var(--space-4); }
.ts-lockup-row .ts-wordmark {
  display: flex; flex-direction: column; gap: 2px;
}
.ts-lockup-row .ts-wordmark { justify-content: center; }
.ts-lockup-row .ts-wordmark .ts-caption { font-size: var(--text-small); color: var(--charcoal); }
.ts-lockup-row .ts-wordmark b { /* deprecated v0.7: the mark already reads 侍天, never repeat it beside the mark */ font-family: var(--font-cn); font-size: 1.25rem; font-weight: var(--weight-title); letter-spacing: var(--tracking-display); line-height: 1; }
.ts-lockup-row .ts-alliance { border-left: 1px solid var(--gold); padding-left: var(--space-4); margin-left: var(--space-2); }

/* ── Navigation: hairline, gold rules, active = bright gold rule ─ */
.ts-nav { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: center; }
.ts-nav a {
  border-bottom: 1px solid transparent; padding-block: var(--space-2);
  color: var(--text); font-size: var(--text-small);
}
.ts-nav a:hover { border-bottom-color: var(--gold-hover); color: var(--gold-hover); }
.ts-nav a[aria-current="page"] { border-bottom-color: var(--gold-hi); color: var(--charcoal); }
.ts-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* ── Ledger table variants ────────────────────────────────── */
.ts-table-ledger td:first-child { color: var(--text-muted); font-size: var(--text-small); }
.ts-table-ledger tr[data-total] td { border-top: 1px solid var(--gold); font-weight: var(--weight-title); }

/* ── Chart chrome: hairline axes, ink-muted ticks ─────────── */
.ts-chart { position: relative; }
.ts-chart svg { overflow: visible; }
.ts-chart polyline, .ts-chart path.line,
.ts-chart polyline.series-1, .ts-chart polyline.series-2, .ts-chart polyline.series-3, .ts-chart polyline.benchmark { fill: none; }
.ts-chart .axis { stroke: var(--chart-grid); }
.ts-chart .axis-base { stroke: var(--line-strong); }
.ts-chart .tick {
  font-family: var(--font-mono); font-size: 11px; fill: var(--chart-axis);
}
.ts-chart .series-1 { stroke: var(--chart-1); fill: var(--chart-1); }
.ts-chart .series-2 { stroke: var(--chart-2); fill: var(--chart-2); }
.ts-chart .series-3 { stroke: var(--chart-3); fill: var(--chart-3); }
.ts-chart .benchmark { stroke: var(--chart-benchmark); stroke-dasharray: 3 4; fill: none; }
.ts-chart .label { font-family: var(--font-cn); font-size: var(--text-caption); fill: var(--text); }
.ts-chart .source { font-size: var(--text-caption); color: var(--text-muted); margin-top: var(--space-2); }

/* ── Reveal motion: fade + ≤ 12px rise, once ─────────────── */
@keyframes ts-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ts-reveal { animation: ts-rise var(--dur-reveal) var(--ease-out) both; }

/* ── Do / Don't specimen helper ───────────────────────────── */
.ts-verdict { display: flex; flex-direction: column; gap: var(--space-3); }
.ts-verdict > .ts-caption { display: flex; align-items: center; gap: var(--space-2); }
.ts-verdict[data-no] > .ts-caption { color: var(--seal); }

/* ── Icons: circles and lines, stroke 1.5, currentColor (brand/icons.svg) ── */
.ts-icon {
  display: inline-block; width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.3em;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter;
}
.ts-icon-sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.ts-icon-lg { width: 1.75em; height: 1.75em; }
.ts-button .ts-icon { width: 1.1em; height: 1.1em; vertical-align: -0.2em; }

/* ── Charcoal ground: one scope class inverts every component for an opener, closer or one card ── */
.ts-ground-charcoal, .ts-card-charcoal {
  background: var(--charcoal); color: var(--text-on-charcoal);
}
.ts-ground-charcoal h1, .ts-ground-charcoal h2, .ts-ground-charcoal h3, .ts-ground-charcoal h4,
.ts-card-charcoal h1, .ts-card-charcoal h2, .ts-card-charcoal h3, .ts-card-charcoal h4, .ts-card-charcoal .ts-card-title { color: var(--text-on-charcoal); }
.ts-ground-charcoal .ts-caption, .ts-ground-charcoal .ts-eyebrow, .ts-ground-charcoal .ts-muted, .ts-ground-charcoal .ts-tagline,
.ts-card-charcoal .ts-caption, .ts-card-charcoal .ts-muted, .ts-card-charcoal[data-index]::after { color: var(--gold-hi); }
.ts-ground-charcoal a { color: var(--gold-hi); border-bottom-color: var(--gold); }
.ts-ground-charcoal a:hover { color: var(--surface); }
.ts-ground-charcoal hr, .ts-ground-charcoal .ts-rule, .ts-ground-charcoal .ts-divider { border-top-color: var(--gold); }
.ts-ground-charcoal .ts-card { background: var(--charcoal); border-color: var(--gold); color: var(--text-on-charcoal); }
.ts-ground-charcoal .ts-card-field { background: var(--ink-primary); color: var(--charcoal); }
.ts-ground-charcoal .ts-card-field .ts-caption { color: var(--gold-deep); }
.ts-ground-charcoal .ts-badge { background: var(--ink-primary); color: var(--charcoal); }
.ts-ground-charcoal .ts-badge-outline { background: transparent; color: var(--gold-hi); border-color: var(--gold); }
.ts-ground-charcoal .ts-button { background: var(--ink-primary); color: var(--charcoal); border-color: var(--gold); }
.ts-ground-charcoal .ts-button:hover { background: var(--surface); }
.ts-ground-charcoal .ts-button-secondary { background: transparent; color: var(--gold-hi); border-color: var(--gold); }
.ts-ground-charcoal .ts-button-secondary:hover { background: var(--charcoal); color: var(--surface); }
.ts-ground-charcoal .ts-button-quiet { background: transparent; border-color: transparent; color: var(--gold-hi); }
.ts-ground-charcoal .ts-check-list li::before { color: var(--gold-hi); }
.ts-ground-charcoal .ts-check-list li[data-no]::before { color: var(--seal); }
.ts-ground-charcoal .ts-step { border-color: var(--gold); color: var(--gold-hi); }
.ts-ground-charcoal .ts-stat .ts-value { color: var(--gold-hi); }
.ts-ground-charcoal .ts-stat .ts-value small, .ts-ground-charcoal .ts-stat .ts-boundary { color: var(--surface); }
.ts-ground-charcoal th, .ts-ground-charcoal td { border-color: var(--gold); }
.ts-ground-charcoal th { color: var(--gold-hi); }
.ts-ground-charcoal .ts-compass svg { color: var(--gold); opacity: 0.35; }
.ts-ground-charcoal .ts-seal-stamp { box-shadow: inset 0 0 0 2px var(--charcoal), inset 0 0 0 3px var(--seal); }
.ts-ground-charcoal .ts-mark { display: inline-grid; place-items: center; background: var(--ink-primary); border-radius: var(--radius); padding: 10%; }
.ts-ground-charcoal ::selection { background: var(--gold-hi); color: var(--charcoal); }

/* ── Accessibility helpers ────────────────────────────────── */
.ts-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ts-skip { position: absolute; left: var(--space-4); top: -100px; z-index: calc(var(--z-modal) + 1); background: var(--charcoal); color: var(--gold-hi); padding: var(--space-2) var(--space-4); border: 1px solid var(--gold); border-radius: var(--radius); font-size: var(--text-small); }
.ts-skip:focus { top: var(--space-4); outline: 2px solid var(--gold-hi); }

/* ── Tag: removable chip, square ──────────────────────────── */
.ts-tag { display: inline-flex; align-items: center; gap: var(--space-2); padding: 2px 10px; font-size: var(--text-small); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--paper); color: var(--text); }
.ts-tag[aria-pressed="true"], .ts-tag.on { background: var(--ink-primary); border-color: var(--gold); }
.ts-tag button { all: unset; cursor: pointer; line-height: 1; color: var(--text-muted); }
.ts-tag button:hover, .ts-tag button:focus-visible { color: var(--seal); }

/* ── Notice: inline message, hairline, no icon slop ───────── */
.ts-notice { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--line-strong); border-left: 3px solid var(--gold); background: var(--paper); border-radius: var(--radius); font-size: var(--text-small); }
.ts-notice .ts-icon { color: var(--gold); margin-top: 2px; }
.ts-notice b { display: block; font-weight: var(--weight-title); }
.ts-notice-warn { border-left-color: var(--seal); } .ts-notice-warn .ts-icon { color: var(--seal); }
.ts-notice-key { border-left-color: var(--gold-hi); background: var(--ink-primary); }

/* ── Disclosure: native details, hairline rule ────────────── */
.ts-disclosure { border-top: 1px solid var(--line); }
.ts-disclosure:last-of-type { border-bottom: 1px solid var(--line); }
.ts-disclosure summary { list-style: none; cursor: pointer; padding: var(--space-4) 0; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); font-weight: var(--weight-title); }
.ts-disclosure summary::-webkit-details-marker { display: none; }
.ts-disclosure summary .ts-icon { color: var(--gold); transition: transform var(--dur-base) var(--ease); }
.ts-disclosure[open] summary .ts-icon { transform: rotate(180deg); }
.ts-disclosure summary:hover { color: var(--gold); }
.ts-disclosure summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ts-disclosure .body { padding: 0 0 var(--space-5); color: var(--text); }
.ts-disclosure .body p { max-width: var(--measure-cn); }

/* ── Tabs ─────────────────────────────────────────────────── */
.ts-tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.ts-tabs [role="tab"] { font: inherit; font-size: var(--text-small); padding: var(--space-2) var(--space-4); background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-muted); cursor: pointer; }
.ts-tabs [role="tab"]:hover { color: var(--text); }
.ts-tabs [role="tab"][aria-selected="true"] { color: var(--charcoal); border-bottom-color: var(--gold-hi); font-weight: var(--weight-title); }
.ts-tabs [role="tab"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ts-tabs-pill { border-bottom: 0; }
.ts-tabs-pill [role="tab"] { border: 1px solid var(--gold); border-radius: var(--radius-pill); color: var(--gold); padding: 6px 14px; margin: 0; }
.ts-tabs-pill [role="tab"][aria-selected="true"] { background: var(--charcoal); color: var(--gold-hi); border-color: var(--charcoal); }
[role="tabpanel"][hidden] { display: none; }

/* ── Tooltip: pure CSS, charcoal, mono ────────────────────── */
.ts-tip { position: relative; }
.ts-tip::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); background: var(--charcoal); color: var(--surface); font-family: var(--font-mono); font-size: 12px; line-height: 1.4; padding: 5px 9px; border: 1px solid var(--gold); border-radius: var(--radius); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--dur-fast) var(--ease); z-index: var(--z-overlay); }
.ts-tip:hover::after, .ts-tip:focus-visible::after { opacity: 1; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.ts-breadcrumb { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; list-style: none; margin: 0; padding: 0; font-size: var(--text-small); }
.ts-breadcrumb li + li::before { content: "·"; color: var(--gold); margin-right: var(--space-2); }
.ts-breadcrumb a { border: 0; color: var(--text-muted); }
.ts-breadcrumb a:hover { color: var(--gold); }
.ts-breadcrumb [aria-current="page"] { color: var(--text); }

/* ── Pagination ───────────────────────────────────────────── */
.ts-pagination { display: flex; gap: var(--space-1); align-items: center; list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: var(--text-small); }
.ts-pagination a, .ts-pagination span { display: inline-flex; min-width: 36px; height: 36px; align-items: center; justify-content: center; padding: 0 var(--space-2); border: 1px solid transparent; border-radius: var(--radius); color: var(--text-muted); }
.ts-pagination a:hover { border-color: var(--gold); color: var(--gold); }
.ts-pagination [aria-current="page"] { background: var(--ink-primary); border-color: var(--gold); color: var(--charcoal); }

/* ── Progress: hairline track, ink fill, gold marker ──────── */
.ts-progress { display: flex; flex-direction: column; gap: var(--space-1); }
.ts-progress .track { position: relative; height: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ts-progress .fill { height: 100%; background: var(--charcoal); transition: width var(--dur-base) var(--ease); }
.ts-progress .fill.key { background: var(--gold-hi); }
.ts-progress .meta { display: flex; justify-content: space-between; font-size: var(--text-caption); color: var(--text-muted); font-family: var(--font-mono); }

/* ── Dialog: native <dialog>, paper panel, corner ticks ───── */
.ts-dialog { border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--paper); color: var(--text); padding: var(--card-pad-lg); max-width: min(560px, calc(100vw - 2 * var(--gutter))); box-shadow: none; }
.ts-dialog::backdrop { background: var(--scrim); }
.ts-dialog[open] { box-shadow: var(--shadow-3); }   /* the one shadowed surface (v0.7) */
.ts-dialog h2, .ts-dialog h3 { margin-bottom: var(--space-3); }
.ts-dialog .actions { display: flex; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.ts-dialog[open] { animation: ts-rise var(--dur-base) var(--ease-out) both; }

/* ── Table sorting affordance ─────────────────────────────── */
th[aria-sort] { cursor: pointer; }
th[aria-sort]::after { content: " ↕"; color: var(--line-strong); }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--gold); }
th[aria-sort="descending"]::after { content: " ↓"; color: var(--gold); }

/* ── Component states, explicit so every consumer matches ── */
.ts-button:focus-visible, .ts-input:focus-visible, .ts-select:focus-visible, .ts-tag:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ts-button[aria-pressed="true"] { background: var(--charcoal); color: var(--gold-hi); border-color: var(--charcoal); }
.ts-input:disabled, .ts-select:disabled, .ts-textarea:disabled { opacity: 0.4; cursor: not-allowed; background: var(--surface); }
.ts-input:read-only { background: var(--surface); color: var(--text-muted); }
.ts-card[aria-selected="true"], .ts-card.selected { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
