/* ControlMapping — "Analyst workbench" design system. Source: scripts/site/workbench.css
   (copied to public/assets/ by scripts/generate.js). Dark tokens follow the Claude Design mock;
   light mirrors them. Theme: OS preference unless html[data-theme] is set by the ◐ toggle. */

/* Geist and Geist Mono, self-hosted (2026-10-27): no request to Google Fonts, so no visitor IP goes to Google. Variable fonts
   (weights 400-600), split by Google's unicode ranges so a page downloads only the subsets it uses. Licence: geist-OFL.txt (SIL OFL 1.1). */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-latin.woff2') 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: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-mono-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-mono-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-mono-symbols2.woff2') format('woff2'); unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-mono-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-mono-latin-ext.woff2') 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/geist-mono-latin.woff2') 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; }


:root {
  --bg: #0e1013; --panel: #121418; --panel-2: #15181d; --hover: #1a1d23; --sel: #232838;
  --hair: #1d2026; --border: #262a31; --border-2: #333842;
  --text: #e6e7ea; --text-2: #c3c7cd; --text-dim: #9aa0a8; --text-faint: #8a9099;
  --accent: #a9a3ff; --accent-ink: #0e1013; --brand: #5b52f0;
  --t-related: #e0b860; --t-edit: #9fc3d8; --t-none: #8a9099;
  --bar-covered: #e6e7ea;
  --surface: var(--panel); /* alias used by inline styles in older templates */
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, 'PingFang SC', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Microsoft YaHei', 'Malgun Gothic', 'Noto Sans Arabic', 'Geeza Pro', 'Noto Sans Devanagari', 'Kohinoor Devanagari', monospace;
  --sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'PingFang SC', 'Hiragino Sans', 'Apple SD Gothic Neo', 'Microsoft YaHei', 'Malgun Gothic', 'Noto Sans CJK SC', 'Noto Sans Arabic', 'Geeza Pro', 'Noto Sans Devanagari', 'Kohinoor Devanagari', sans-serif;
  --topbar-h: 49px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f6f4; --panel: #ffffff; --panel-2: #f0f1f3; --hover: #eef0f3; --sel: #e7e5ff;
    --hair: #eceef1; --border: #dfe2e6; --border-2: #c8ccd2;
    --text: #15171c; --text-2: #383c43; --text-dim: #565b64; --text-faint: #62676f;
    --accent: #4a42d6; --accent-ink: #ffffff;
    --t-related: #8a5a00; --t-edit: #22617f; --t-none: #62676f;
    --bar-covered: #15171c;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f6f6f4; --panel: #ffffff; --panel-2: #f0f1f3; --hover: #eef0f3; --sel: #e7e5ff;
  --hair: #eceef1; --border: #dfe2e6; --border-2: #c8ccd2;
  --text: #15171c; --text-2: #383c43; --text-dim: #565b64; --text-faint: #62676f;
  --accent: #4a42d6; --accent-ink: #ffffff;
  --t-related: #8a5a00; --t-edit: #22617f; --t-none: #62676f;
  --bar-covered: #15171c;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 13.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, code, kbd { font-family: var(--mono); }
.skip { position: absolute; inset-inline-start: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 6px 10px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Shell ── */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--topbar-h); padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
.brand { font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 600; }
.jump { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-2); background: var(--bg); color: var(--text-dim); padding: 6px 10px; font: 12.5px var(--mono); cursor: pointer; text-align: start; }
.jump:hover { border-color: var(--accent); }
.jump .q { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd, .kbd { border: 1px solid var(--border-2); padding: 0 5px; font-size: 11px; color: var(--text-dim); background: transparent; }
.top-actions { margin-inline-start: auto; display: flex; gap: 6px; }
.btn { font: 12px var(--mono); color: var(--text-2); background: transparent; border: 1px solid var(--border-2); padding: 4px 9px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.on { background: var(--sel); border-color: var(--accent); color: var(--text); }
.rail-toggle { display: none; }

.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.rail { width: 224px; flex-shrink: 0; background: var(--panel); border-inline-end: 1px solid var(--border); padding: 14px 0; display: flex; flex-direction: column; gap: 18px; position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.rail h2 { font: 500 11px var(--mono); color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; margin: 0; padding: 0 14px 6px; }
.rail-nav a { display: flex; justify-content: space-between; padding: 5px 14px; color: var(--text); border-inline-start: 2px solid transparent; }
.rail-nav a:hover { background: var(--hover); text-decoration: none; }
.rail-nav a.on { background: var(--hover); border-inline-start-color: var(--accent); }
.rail-nav a span { font: 11px var(--mono); color: var(--text-dim); }
.rail-fws a { display: grid; grid-template-columns: minmax(0, 1fr) 38px; gap: 8px; padding: 3px 14px; color: var(--text); }
.rail-fws a:hover { background: var(--hover); text-decoration: none; }
.rail-fws a.on { background: var(--hover); }
.rail-fws a span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-fws a span:last-child { font: 11px var(--mono); text-align: end; color: var(--text-2); }
.legend { margin-top: auto; padding: 0 14px; display: flex; flex-direction: column; gap: 4px; font: 11px var(--mono); }
.legend div { display: flex; gap: 8px; }
.legend a { color: var(--text-dim); margin-top: 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 14px 20px 48px; width: 100%; max-width: 1240px; }
.content.wide { max-width: none; }
.prose-col { max-width: 74ch; }
.foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--border); font: 11.5px var(--mono); color: var(--text-dim); display: flex; gap: 14px; flex-wrap: wrap; }
.foot a { color: var(--text-dim); }

.crumbs, .breadcrumbs { font: 12px var(--mono); color: var(--text-dim); margin: 0 0 14px; }
.crumbs a, .breadcrumbs a { color: var(--text-dim); }
.crumbs a:hover, .breadcrumbs a:hover { color: var(--accent); }
.crumbs .here { color: var(--text); }
.breadcrumbs .sep { margin: 0 6px; }

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.01em; margin: 0; }
.page-title { font-size: 20px; margin: 0 0 4px; }
.page-sub { color: var(--text-2); margin: 0 0 16px; max-width: 80ch; }
.section-title, .mapping-section h2, .related-section h2 { font-size: 14px; margin: 22px 0 8px; }
.label { font: 500 11px var(--mono); color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.dim { color: var(--text-dim); } .faint { color: var(--text-faint); }

/* ── Tier glyphs (glyph + label carry meaning; colour is backup) ── */
.tg { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.tg .g { display: inline-block; width: 1.1em; text-align: center; }
.tg-def { color: var(--accent); } .tg-xwalk { color: var(--accent); }
.tg-related { color: var(--t-related); } .tg-edit { color: var(--t-edit); } .tg-none { color: var(--t-none); }

/* ── Workbench table ── */
.wt { width: 100%; border-collapse: collapse; }
.wt th { font: 500 11px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; text-align: start; padding: 6px 10px; border-bottom: 1px solid var(--border); position: sticky; top: var(--topbar-h); background: var(--bg); z-index: 2; }
.wt td { padding: 7px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.wt tr.sec td { background: var(--panel-2); font: 12px var(--mono); border-bottom: 1px solid var(--border); }
.wt tr.gap-row td, .wt tr.is-none td { background: color-mix(in srgb, var(--panel-2) 55%, transparent); }
.lvl { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); border: 1px solid var(--border-2); border-radius: 3px; padding: 0 4px; white-space: nowrap; }
.wt tbody tr:not(.sec):hover td { background: var(--hover); }
.wt .ids { font: 12px var(--mono); }
.wt .ids a { margin-inline-end: 6px; }
.wt .src { color: var(--text-dim); font-size: 12px; }
.wt .fwc { font-weight: 500; white-space: nowrap; }
.wt details summary { cursor: pointer; color: var(--text-dim); font: 11.5px var(--mono); margin-top: 4px; }

/* ── Legacy template classes, restyled ── */
.page-wrap, .site-header, .site-nav { all: unset; }
.mapping-id { display: inline-block; font: 12px var(--mono); color: var(--text); border: 1px solid var(--border-2); padding: 0 6px; margin: 1px 4px 1px 0; }
a.mapping-id { color: var(--accent); }
a.mapping-id:hover { border-color: var(--accent); text-decoration: none; }
.mapping-id.big { font-size: 15px; padding: 2px 8px; }
.mapping-table { width: 100%; border-collapse: collapse; }
.mapping-table th { font: 500 11px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; text-align: start; padding: 6px 10px; border-bottom: 1px solid var(--border); background: transparent; }
.mapping-table td { padding: 7px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; font-size: 13px; }
.mapping-table tr:hover td { background: var(--hover); }
.fw-name-cell { font-weight: 500; white-space: nowrap; }
.fw-dot { display: none; }
.req { margin: 2px 0 8px; }
.req-title { color: var(--text-2); }
.req-ev { color: var(--text-dim); font-size: 12px; }
.req-fw { font: 12px var(--mono); }
.req-text { margin: 10px 0 0; padding: 10px 12px; border: 1px solid var(--border); background: var(--panel); font-size: 13.5px; line-height: 1.6; }
.req-text cite { display: block; margin-top: 6px; font: normal 11px var(--mono); color: var(--text-dim); }
.basis { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 0 4px; border: 1px solid currentColor; }
.basis-crosswalk { color: var(--accent); } .basis-editorial { color: var(--t-edit); } .basis-anchor, .basis-together { color: var(--accent); }
.not-covered { color: var(--t-none); font-family: var(--mono); font-size: 12px; }
.ctrl-header { margin-bottom: 8px; }
.ctrl-sym { font: 600 13px var(--mono); color: var(--text-dim); margin-inline-end: 8px; }
.ctrl-title { font-size: 20px; display: inline; }
.ctrl-domain { display: inline-block; font: 11px var(--mono); border: 1px solid var(--border-2); color: var(--text-2) !important; background: transparent !important; padding: 1px 6px; margin-inline-start: 8px; vertical-align: 3px; }
.ctrl-desc { color: var(--text-2); max-width: 80ch; margin: 6px 0; }
.ctrl-coverage { font: 12px var(--mono); color: var(--text-dim); margin: 4px 0; }
.mapping-section { margin-top: 18px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.topic-chip { font-size: 12.5px; padding: 2px 8px; border: 1px solid var(--border-2); color: var(--text); }
.topic-chip:hover { border-color: var(--accent); text-decoration: none; }
.cta, .cta.secondary { display: inline-block; font: 600 12px var(--mono); padding: 7px 12px; border: 1px solid var(--accent); background: var(--accent) !important; color: var(--accent-ink) !important; border-radius: 0 !important; }
.cta.secondary { background: transparent !important; color: var(--accent) !important; }
.cta:hover { text-decoration: none; filter: brightness(1.08); }
.fw-stats { display: flex; gap: 0; border: 1px solid var(--border); margin: 10px 0 16px; flex-wrap: wrap; }
.fw-stat { padding: 8px 14px; border-inline-end: 1px solid var(--border); }
.fw-stat-num { font: 600 18px var(--mono); }
.fw-stat-label { font: 11px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; }
.fw-hero { margin-bottom: 8px; } .fw-hero h2 { font-size: 20px; } .fw-desc { color: var(--text-2); max-width: 80ch; }
.domain-group { margin-top: 16px; }
.domain-group h3 { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border) !important; color: var(--text) !important; padding-bottom: 4px; margin-bottom: 4px; }
.ctrl-list, .related-grid, .all-controls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0; }
.ctrl-list-item, .related-card { display: flex; gap: 8px; align-items: baseline; padding: 5px 8px; border-bottom: 1px solid var(--hair); color: var(--text); background: transparent !important; }
.ctrl-list-item:hover, .related-card:hover { background: var(--hover) !important; text-decoration: none; }
.cli-sym, .rc-sym, .related-sym { font: 600 12px var(--mono); color: var(--text-dim) !important; min-width: 2.2em; }
.cli-ids { font: 11px var(--mono); color: var(--text-dim); margin-inline-start: auto; }
.gap-section, .fw-crosslinks, .related-section { margin-top: 18px; }
.gap-section h3, .fw-crosslinks h3 { font-size: 14px; margin-bottom: 6px; }
.fw-crosslinks-list { display: flex; flex-wrap: wrap; gap: 4px; }
.fw-crosslinks-list a { font: 12px var(--mono); border: 1px solid var(--border-2); padding: 2px 8px; color: var(--text); }
.site-footer { display: none; }
.theme-btn { font: 12px var(--mono); color: var(--text-2); background: transparent; border: 1px solid var(--border-2); padding: 4px 9px; cursor: pointer; }
.theme-btn.active { background: var(--sel); border-color: var(--accent); color: var(--text); }
dl.glossary { margin: 0; max-width: 78ch; }
dl.glossary dt { font-weight: 600; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--hair); margin-top: 4px; }
dl.glossary dd { margin: 4px 0 10px; color: var(--text-2); font-size: 14px; line-height: 1.65; }
ul.changes { list-style: none; margin-inline-start: 0 !important; }
ul.changes li { padding: 6px 0; border-bottom: 1px solid var(--hair); }
details { border-radius: 0 !important; }
.prose h3 { font-size: 15px; margin: 22px 0 6px; }
.prose p, .prose li { color: var(--text-2); line-height: 1.7; font-size: 14px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 12px 20px; padding: 0; }
.prose li { margin-bottom: 4px; }
.prose { max-width: 80ch; }
.prose h2 { font-size: 17px; margin: 28px 0 8px; letter-spacing: -0.01em; }
.prose strong { color: var(--text); }
.prose .wt { margin: 8px 0; }
/* Cards: guide index, comparisons index, home entry points */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 12px 0 8px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); background: var(--panel); color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card b { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.card .dim { font-size: 13px; line-height: 1.5; }
.hero { margin: 4px 0 14px; max-width: 86ch; }
.hero h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; font-weight: 600; }
.hero-sub { font-size: 15px; color: var(--text-2); line-height: 1.6; margin: 0; }
.cards.entry .card a { font-size: 13px; }
.legend-line { margin: 4px 0 0; }
.wt.decision th[scope="row"] { font-weight: 600; color: var(--text); width: 22%; text-align: start; vertical-align: top; }
.wt.decision td { color: var(--text-2); vertical-align: top; }
.topic-summary { max-width: 90ch; color: var(--text-2); font-size: 14px; line-height: 1.65; margin: 6px 0 12px; }
@media (max-width: 860px) { .hero h1 { font-size: 22px; } }
.about3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }
.about3 section { border: 1px solid var(--border); background: var(--panel); padding: 12px 14px; }
.about3 h2.label { margin: 0 0 6px; }
.about3 p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
@media (max-width: 860px) { .about3 { grid-template-columns: 1fr; } }
.prose .lede { font-size: 15px; color: var(--text); }
.prose .small { font-size: 12px; }

/* ── Gap bar + counts (gap view, comparisons) ── */
.gap-bar { display: flex; height: 8px; width: 100%; max-width: 360px; background: var(--border); gap: 2px; }
.gap-bar .g-together, .gap-bar .b-cov { background: var(--bar-covered); }
.gap-bar .g-csf, .gap-bar .b-rel { background: var(--t-related); }
.gap-bar .g-none, .gap-bar .b-none { background: repeating-linear-gradient(90deg, var(--t-none) 0 2px, transparent 2px 4px); }
.gap-counts { display: flex; gap: 14px; flex-wrap: wrap; font: 12px var(--mono); color: var(--text-2); margin: 6px 0; }
.gap-counts i { display: none; }
.cmp-dir { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 16px; }
.cmp-list { margin-top: 10px; border: 1px solid var(--border); background: var(--panel); padding: 8px 12px; }
.cmp-list summary { cursor: pointer; font: 600 12.5px var(--mono); }
.cmp-group { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); margin: 12px 0 4px; }

/* ── Home: runner + matrix ── */
.runner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 12px; border-bottom: 1px solid var(--border); font-family: var(--mono); }
.runner select { font: 12.5px var(--mono); color: var(--text); background: var(--bg); border: 1px solid var(--border-2); padding: 5px 8px; }
.runner .meta { margin-inline-start: auto; color: var(--text-dim); font-size: 12px; }
.orient { color: var(--text-2); margin: 12px 0 2px; max-width: 90ch; }
.matrix-wrap { overflow: auto; max-height: calc(100vh - var(--topbar-h) - 40px); border: 1px solid var(--border); margin-top: 10px; }
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--hair); }
.matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--panel); font: 500 11px var(--mono); color: var(--text-2); padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.matrix thead th a { color: var(--text-2); }
.matrix th.topic, .matrix td.topic { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--bg); text-align: start; min-width: 210px; max-width: 230px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-inline-end: 1px solid var(--border); }
.matrix thead th.topic { z-index: 4; background: var(--panel); }
.matrix td.topic a { color: var(--text); }
.matrix td.topic .n { font: 11px var(--mono); color: var(--text-faint); margin-inline-end: 6px; }
.matrix td.cell { width: 62px; text-align: center; font: 14px var(--mono); border-inline-start: 1px solid var(--hair); padding: 2px 0; }
.matrix td.cell a { display: block; color: inherit; }
.matrix td.cell a:hover { text-decoration: none; background: var(--hover); }
.matrix td.cnt { font: 11px var(--mono); color: var(--text-2); text-align: end; padding: 0 8px; }
.matrix tr.dom td { background: var(--panel-2); font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); padding: 5px 8px; position: sticky; inset-inline-start: 0; }
.matrix tbody tr:not(.dom):hover td { background: var(--hover); }
.matrix tbody tr:not(.dom):hover td.topic { background: var(--hover); }

/* ── Gap view ── */
.gv-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.gv-head h1 { font: 600 15px var(--mono); }
.gv-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); font: 12px var(--mono); }
.gv-tools input { flex: 1; min-width: 160px; font: 12px var(--mono); background: var(--bg); color: var(--text); border: 1px solid var(--border-2); padding: 5px 8px; }
.gv-tools .k { color: var(--text-dim); }
.gv { display: flex; align-items: flex-start; gap: 0; }
.gv-table { flex: 1; min-width: 0; }
.gv-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 150px minmax(90px, 160px); gap: 10px; padding-block: 5px; padding-inline: 10px 12px; border-bottom: 1px solid var(--hair); border-inline-start: 2px solid transparent; cursor: pointer; align-items: baseline; }
.gv-row.hdr { cursor: default; font: 500 11px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); position: sticky; top: var(--topbar-h); background: var(--bg); z-index: 2; }
.gv-row .id { font: 500 12.5px var(--mono); }
.gv-row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-row .cp { font: 12px var(--mono); color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv-row:not(.hdr):hover { background: var(--hover); }
.gv-row.none { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.gv-row.on { background: var(--sel); border-inline-start-color: var(--accent); }
.gv-sec { display: flex; justify-content: space-between; gap: 8px; padding: 6px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border); font: 12px var(--mono); }
.gv-sec .s { color: var(--text-2); }
.inspector { width: 340px; flex-shrink: 0; border-inline-start: 1px solid var(--border); background: var(--panel); padding: 16px; position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.inspector .bigid { font: 500 28px var(--mono); letter-spacing: -.02em; line-height: 1.1; word-break: break-word; }
.inspector .ttl { font-size: 15px; font-weight: 500; }
.kv { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px 10px; font: 12px var(--mono); border-top: 1px solid var(--border); padding-top: 10px; }
.kv > span:nth-child(odd) { color: var(--text-dim); }
.box { border: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.box.dashed { border-style: dashed; border-color: var(--border-2); }
.ev-item { font-size: 12.5px; }
.ev-item .mapping-id { margin-inline-end: 6px; }

/* ── Requirement page ── */
.rq { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; border-top: 1px solid var(--border); }
.rq-left { border-inline-end: 1px solid var(--border); padding-block: 18px; padding-inline: 0 16px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: var(--topbar-h); }
.rq-left .bigid { font: 500 38px var(--mono); letter-spacing: -.03em; line-height: 1.05; word-break: break-word; }
.rq-left .ttl { font-size: 17px; font-weight: 600; }
.rq-right { min-width: 0; padding: 6px 0 0; padding-inline-start: 16px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .btn { font-size: 11px; }

/* ── ⌘K palette ── */
.palette { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette[hidden] { display: none; }
.palette-box { width: min(640px, 92vw); background: var(--panel); border: 1px solid var(--border-2); box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.palette input { width: 100%; font: 14px var(--mono); background: var(--bg); color: var(--text); border: 0; border-bottom: 1px solid var(--border); padding: 12px 14px; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 4px 0; max-height: 50vh; overflow-y: auto; }
.palette li a { display: flex; gap: 10px; align-items: baseline; padding: 6px 14px; color: var(--text); }
.palette li a .kind { font: 10.5px var(--mono); color: var(--text-dim); text-transform: uppercase; width: 6.5em; flex-shrink: 0; }
.palette li a .sub { color: var(--text-dim); font-size: 12px; margin-inline-start: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.palette li.on a, .palette li a:hover { background: var(--sel); text-decoration: none; }
.palette .hint { font: 11px var(--mono); color: var(--text-dim); padding: 6px 14px; border-top: 1px solid var(--border); }

/* ── Languages ── */
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; font: 12px var(--mono); color: var(--text-2); border: 1px solid var(--border-2); padding: 4px 9px; white-space: nowrap; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::before { content: '文A '; color: var(--text-dim); }
.lang summary:hover, .lang[open] summary { border-color: var(--accent); color: var(--text); }
.lang-menu { position: absolute; top: calc(100% + 4px); inset-inline-end: 0; z-index: 50; background: var(--panel); border: 1px solid var(--border-2); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); padding: 4px 0; min-width: 150px; display: grid; }
.lang-menu a { padding: 4px 12px; color: var(--text); font-size: 13px; }
.lang-menu a:hover { background: var(--hover); text-decoration: none; }
.lang-menu a[aria-current] { color: var(--accent); }
.i18n-note { color: var(--text-dim); font-size: 12px; }
/* Arabic letters must join: no letter-spacing; scripts without capitals don't uppercase anyway */
:lang(ar) * { letter-spacing: 0 !important; }
:lang(zh) body, :lang(ja) body, :lang(ko) body, :lang(hi) body, :lang(ar) body { line-height: 1.65; }
[dir="rtl"] .ids, [dir="rtl"] .mono, [dir="rtl"] code { unicode-bidi: plaintext; }
/* Requirement titles stay English: lay them out left-to-right inside right-to-left pages (ellipsis at the end). */
[dir="rtl"] .gv-row .t, [dir="rtl"] .gv-row .cp { direction: ltr; text-align: end; }
/* Table cells mostly hold English titles and notes: resolve each cell's direction from its own text. */
[dir="rtl"] td { unicode-bidi: plaintext; }
/* Translated button labels run longer than English ones. */
.content .btn { white-space: normal; max-width: 100%; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .gv { flex-direction: column; align-items: stretch; }
  .inspector { width: auto; position: static; max-height: none; border-inline-start: 0; border-top: 1px solid var(--border); }
  .rq { grid-template-columns: 1fr; }
  .rq-left { position: static; border-inline-end: 0; border-bottom: 1px solid var(--border); padding-inline-end: 0; }
  .rq-right { padding-inline-start: 0; }
}
@media (max-width: 860px) {
  .rail-toggle { display: inline-block; }
  .rail { position: fixed; inset-inline-start: 0; top: var(--topbar-h); z-index: 40; transform: translateX(-105%); transition: transform .15s; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
  [dir="rtl"] .rail { transform: translateX(105%); }
  .rail.open, [dir="rtl"] .rail.open { transform: none; }
  .lang-menu { position: fixed; top: var(--topbar-h); inset-inline-end: 8px; }
  .lang summary { font-size: 0; padding: 4px 8px; }
  #themeBtn span { display: none; }
  .lang summary::before { content: '文A'; font-size: 12px; color: var(--text-2); }
  .jump .q { display: none; }
  .jump { flex: 0 0 auto; }
  .top-actions a.btn { display: none; } /* "Sources" is in the rail as Methodology; keeps the bar within 390px */
  .topbar { overflow: hidden; }
  .content { padding: 12px 12px 40px; }
  .gv-row { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .gv-row .cp, .gv-row.hdr span:nth-child(4) { display: none; }
  .runner .meta { display: none; }
  .wt thead { display: none; }
  .wt, .wt tbody, .wt tr, .wt td { display: block; width: 100%; }
  .wt tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .wt td { border: 0; padding: 2px 0; min-width: 0 !important; }
  .wt td.fwc { font-size: 14px; }
  .wt tr.sec td { padding: 6px 8px; }
  .wt th { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, .rail, .palette, .actions, .runner { display: none !important; }
  .shell { display: block; }
}

/* table refinements */
.wt td.ids { min-width: 160px; }
.wt .ids .mapping-id { white-space: nowrap; }

/* ── Blog ── */
.post { max-width: 76ch; }
.post h1 { font-size: 32px; line-height: 1.18; letter-spacing: -0.02em; font-weight: 600; margin: 6px 0 10px; }
.post-dek { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 0 0 10px; }
.post-meta { font: 12.5px var(--mono); color: var(--text-dim); margin: 0 0 16px; }
.post-hero, .post-fig { margin: 18px 0 22px; }
.post-hero img, .post-fig img { width: 100%; height: auto; display: block; border: 1px solid var(--border); }
.post figcaption { font-size: 12.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }
.post-toc { border: 1px solid var(--border); background: var(--panel); padding: 12px 16px; margin: 0 0 20px; }
.post-toc ol { margin: 6px 0 0 18px; padding: 0; font-size: 14px; line-height: 1.7; }
.post-body h2 { font-size: 21px; margin: 34px 0 10px; scroll-margin-top: calc(var(--topbar-h) + 12px); }
.post-body h3 { font-size: 16px; margin: 22px 0 6px; }
.post-body p, .post-body li { font-size: 15.5px; line-height: 1.75; }
.post-body .wt { margin: 12px 0 18px; font-size: 13.5px; }
.post .stat { border-inline-start: 3px solid var(--accent); padding: 8px 14px; background: var(--panel); }
.post .callout { border: 1px solid var(--border-2); background: var(--panel); padding: 12px 16px; margin: 14px 0; color: var(--text-2); font-size: 14.5px; line-height: 1.65; }
.post-cta { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--accent); padding: 16px; margin: 28px 0 14px; }
.post-cta .btn { align-self: flex-start; }
.draft-flag { font: 600 12px var(--mono); color: #1a1205; background: #e0b860; padding: 6px 10px; display: inline-block; }
.post-card { padding: 0; overflow: hidden; }
.post-card img { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--border); }
.post-card > span, .post-card > b { padding: 0 14px; }
.post-card > .label { padding-top: 12px; }
.post-card > .dim { padding-bottom: 14px; }
@media (max-width: 860px) { .post h1 { font-size: 25px; } .post-body p, .post-body li { font-size: 15px; } }

/* ── Link marks, sitewide since 2026-10-27 (they replaced the old text glyphs) ──
   From the Claude Design brief (design/design-brief.md): marks differ in shape and brightness, not only colour.
   Crosswalk = solid square, editorial = outlined square, loosely related = amber ring ("check"), no link = dash,
   topic definition (CSF) = diamond. markHtml()/tierGlyph() in generate.js; gap.js mirrors them. */
:root {
  --mk: #a594ff; --mk-soft: rgba(165, 148, 255, .18); --mk-tint: rgba(165, 148, 255, .09); --mk-text: #c9c1ff;
  --chk: #e3a63f; --chk-text: #f0bd62; --mk-none: #4a4d58; --seg-off: #2a2d36;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --mk: #5b49e0; --mk-soft: rgba(91, 73, 224, .14); --mk-tint: rgba(91, 73, 224, .07); --mk-text: #4a38cf;
    --chk: #b06a00; --chk-text: #8a5100; --mk-none: #8b8e9a; --seg-off: #dcdee5;
  }
}
:root[data-theme="light"] {
  --mk: #5b49e0; --mk-soft: rgba(91, 73, 224, .14); --mk-tint: rgba(91, 73, 224, .07); --mk-text: #4a38cf;
  --chk: #b06a00; --chk-text: #8a5100; --mk-none: #8b8e9a; --seg-off: #dcdee5;
}
.legend[hidden] { display: none; }
.mk { display: inline-block; vertical-align: middle; flex: none; }
/* Sized to match the original 14px glyphs and table rows (owner, 2026-10-27: keep the original table size). */
.mk-x { width: 10px; height: 10px; border-radius: 2px; background: var(--mk); }
.mk-e { width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid var(--mk); background: var(--mk-soft); }
.mk-l { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--chk); }
.mk-n { width: 9px; height: 2px; background: var(--mk-none); }
.mk-d { width: 7px; height: 7px; margin: 0 1px; background: var(--mk); transform: rotate(45deg); }
/* Mark + label everywhere else (legends, requirement/topic/framework/comparison tables, the rail legend). */
.tg { display: inline-flex; align-items: center; gap: 6px; vertical-align: baseline; }
.tg-def, .tg-xwalk, .tg-edit { color: var(--mk-text); } .tg-related { color: var(--chk-text); } .tg-none { color: var(--text-dim); }
.legend .tg { font-size: 11px; }
.gap-bar { background: transparent; border-radius: 4px; overflow: hidden; }
.gap-bar .g-together, .gap-bar .b-cov { background: var(--mk); }
.gap-bar .g-csf, .gap-bar .b-rel { background: var(--chk); }
.gap-bar .g-none, .gap-bar .b-none { background: var(--mk-none); }
.cmp-list summary .mk { margin-inline-end: 2px; vertical-align: 1px; }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; flex: none; }
.sw-x { background: var(--mk); } .sw-l { background: var(--chk); } .sw-n { background: var(--mk-none); }
.mk-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 8px 0 0; font-size: 12px; color: var(--text-2); }
.mk-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mk-legend > a { margin-inline-start: auto; font-size: 12px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.st-x, .st-e { color: var(--mk-text); } .st-l { color: var(--chk-text); } .st-n { color: var(--text-dim); }

/* Matrix */
.matrix td.cell a { display: grid; place-items: center; height: 18px; }
.matrix td.cell a:hover { background: var(--hover); }
.matrix .hl { background-image: linear-gradient(var(--mk-tint), var(--mk-tint)); }
.matrix thead th.hl a { color: var(--text); }
.matrix th.topic .def { font-weight: 400; color: var(--text-dim); }
.matrix td.cnt { white-space: nowrap; }
/* "Mapped in": one thin bar (share of all frameworks) + the count; per-framework segments got cramped. */
.mbar { display: inline-block; width: 44px; height: 5px; margin-inline-end: 8px; border-radius: 3px; overflow: hidden; background: var(--seg-off); vertical-align: middle; }
.mbar i { display: block; height: 100%; background: var(--mk); }

/* ── Matrix columns that scale with more frameworks (2026-10-27) ──
   Grouped headers (generate.js FW_GROUPS), a "Columns" picker (home.js), full width on big screens, and
   sideways scroll with the topic column pinned as the fallback. */
.matrix .off { display: none; }
.matrix thead tr.gh th.grp { height: 24px; padding: 0 4px; font: 500 10.5px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--hair); border-inline-start: 1px solid var(--border-2); }
.matrix thead tr.fh th { top: 24px; }
.matrix thead th.topic, .matrix thead th.mi { vertical-align: bottom; }
.mx-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.cols { position: relative; }
.cols[hidden] { display: none; }
.cols summary { list-style: none; }
.cols summary::-webkit-details-marker { display: none; }
.cols summary span { color: var(--text-dim); margin-inline-start: 4px; }
.cols[open] summary { border-color: var(--accent); color: var(--text); }
.cols-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 20; width: 300px; max-width: calc(100vw - 24px); padding: 10px 12px; background: var(--panel); border: 1px solid var(--border-2); box-shadow: 0 10px 40px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.cols-panel fieldset { margin: 0; padding: 0 0 6px; border: 0; border-bottom: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: 2px 14px; }
.cols-panel legend { padding: 0; margin-bottom: 4px; font: 500 11px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.cols-panel label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 26px; }
.cols-panel input:disabled + * , .cols-panel label:has(input:disabled) { color: var(--text-dim); cursor: default; }
.cols-panel p { margin: 0; font-size: 12px; }
.cols-foot { display: flex; gap: 6px; }
.rail-fws .rail-g { display: block; padding: 8px 14px 2px; font: 10.5px var(--mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
/* Home: the page keeps its normal width, but the matrix may use a wide screen when many columns are shown. */
.content.home-wide { max-width: none; }
:where(.content.home-wide > :not(.matrix-wrap)) { max-width: 1200px; } /* zero specificity: elements keep their own narrower max-width (hero) */
.content.home-wide > .matrix-wrap { width: fit-content; min-width: min(100%, 1200px); max-width: 100%; }

/* Gap view */
.sec-bar .b-cov { background: var(--mk); }
.sec-bar .b-rel { background: var(--chk); }
.sec-bar .b-none { background: var(--mk-none); }
#gvCounts { display: inline-flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-2); }
.cnt-i { display: inline-flex; align-items: center; gap: 6px; }
#gvFilters .btn { display: inline-flex; align-items: center; gap: 6px; }
.gv-sec { justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.gv-sec .gn { font-weight: 600; color: var(--text); }
.gv-sec .s { font-family: var(--sans); }
.sec-bar { margin-inline-start: auto; display: flex; gap: 2px; width: 100px; height: 6px; border-radius: 3px; overflow: hidden; }
.gv-row.on { background: var(--mk-tint); border-inline-start-color: var(--mk); }
.kv .st { font-size: 12px; }
.ev-item .req-ev .st { font-size: 12px; }
@media (max-width: 860px) { .sec-bar { display: none; } .mk-legend > a { margin-inline-start: 0; } }
/* Grouped options (<optgroup>) make the framework dropdowns wider: let them shrink on phones instead of widening the page. */
.runner label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.runner select { min-width: 0; max-width: 100%; }
@media (max-width: 860px) { .cols-panel { inset-inline-end: auto; inset-inline-start: 0; } }
/* Blog: posts pinned to the frameworks that existed when written (generate.js postScopeNote) */
.post-scope { font-size: 13px; line-height: 1.55; color: var(--text-dim); border-inline-start: 2px solid var(--border-2); padding: 4px 10px; margin: -6px 0 16px; }
