/* Hallmark · macrostructure: Workbench · tone: technical-editorial · anchor hue: pine (Cromoteca Pro tokens, locked)
 * genre: editorial · theme: existing brand system — VTC Bayard / Neue Haas Display / SF Mono · enrichment: none
 * pre-emit critique: P4 H4 E4 S5 R4 V4
 *
 * Cromoteca Tools — the suite shell shared by /tools/depth-of-field/ and
 * /tools/aspect-ratio-calculator/. Light values are the Pro workspace's (assets/pro.css);
 * the dark set is their counterpart. Load after /assets/brand-fonts.css.
 */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  color-scheme: light;
  --bg: #EFEEEB; --card: #FBFAF7; --inset: #F4F2EC; --row-sel: #E9E8E2;
  --border: #E4E2DB; --hair: #EDEBE4; --border-strong: rgba(28, 26, 24, .2);
  --text: #26241F; --ink: #1B1A18; --muted: #6F6B62; --faint: #8C877D;
  --accent: #3B4A3E; --accent-tint: #E7EAE4; --accent-line: #D5D9D0; --on-accent: #F5F3EE;
  --sage: #6E7F58; --sage-soft: #A3B18A;
  --stage: #E9E8E2; --veil: rgba(239, 238, 235, .78);
  --shadow-card: 0 1px 0 rgba(27, 26, 24, .03), 0 14px 34px -26px rgba(27, 26, 24, .4);
  --shadow-lift: 0 2px 4px rgba(27, 26, 24, .06), 0 22px 44px -28px rgba(27, 26, 24, .5);
  --mono: ui-monospace, "SF Mono", Menlo, Monaco, monospace;
  --sans: 'Neue Haas Display', -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --display: 'VTC Bayard', Georgia, serif;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --space-xs: 4px; --space-sm: 8px; --space-md: 12px; --space-lg: 20px; --space-xl: 32px; --space-2xl: 48px;
  --radius-sm: 9px; --radius-md: 12px; --radius-lg: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121210; --card: #1B1A18; --inset: #24231F; --row-sel: #2A2925;
  --border: #34322D; --hair: #2A2925; --border-strong: rgba(236, 234, 227, .24);
  --text: #DEDBD2; --ink: #ECEAE3; --muted: #A8A49A; --faint: #8A867C;
  --accent: #A3B18A; --accent-tint: #252A20; --accent-line: #3A4233; --on-accent: #141A16;
  --sage: #A3B18A; --sage-soft: #6E7F58;
  --stage: #171715; --veil: rgba(18, 18, 16, .8);
  --shadow-card: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -28px rgba(0, 0, 0, .9);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 24px 48px -28px rgba(0, 0, 0, .95);
}
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; min-height: 100vh;
  transition: background-color 240ms var(--ease-out), color 240ms var(--ease-out);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; }
button, input, select { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sage); outline-offset: 2px; border-radius: 6px; }
.lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; line-height: 1.3; }
.num { font-variant-numeric: tabular-nums; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.t-top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--border); }
.t-top-in { max-width: 1280px; margin: 0 auto; min-height: 56px; padding: 8px 24px; display: flex; align-items: center; gap: 14px; }
.t-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--inset); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; gap: 2.5px; padding: 5px; flex-shrink: 0; }
.t-mark i { height: 2.5px; border-radius: 1px; background: var(--ink); display: block; }
.t-mark i:nth-child(2) { background: var(--accent); }
.t-word { font-family: var(--display); font-size: 20px; letter-spacing: .5px; text-transform: lowercase; color: var(--ink); }
.t-word:hover { text-decoration: none; }
.t-badge { padding: 3px 8px; border: 1px solid var(--accent-line); border-radius: 999px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; color: var(--accent); background: var(--accent-tint); }
.t-nav { display: flex; gap: 4px; margin-left: 12px; min-width: 0; }
.t-nav a { padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.t-nav a:hover { color: var(--text); background: var(--row-sel); text-decoration: none; }
.t-nav a[aria-current="page"] { color: var(--text); background: var(--border); font-weight: 500; }
.t-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.t-icon { width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: border-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.t-icon:hover { border-color: var(--border-strong); color: var(--ink); }
.t-icon:active { transform: scale(.96); }
.t-icon svg { width: 14px; height: 14px; }
.t-avatar { width: 28px; height: 28px; border-radius: 999px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--mono); font-size: 10.5px; }
.t-avatar:hover { text-decoration: none; color: var(--on-accent); opacity: .9; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out), opacity 160ms var(--ease-out); will-change: transform; }
.btn:hover { text-decoration: none; }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent); color: var(--on-accent); }
.btn-line { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-line:hover { border-color: var(--border-strong); color: var(--ink); }
.btn:active { opacity: .86; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: default; pointer-events: none; }
.btn[data-state="loading"] { opacity: .7; pointer-events: none; }
.btn[data-state="error"] { border-color: #8E3B2F; color: #8E3B2F; background: var(--card); }

/* ── Page ────────────────────────────────────────────────────────────────── */
.t-main { max-width: 1280px; margin: 0 auto; padding: 32px 24px 56px; }
.t-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-lg) var(--space-xl); align-items: end; margin-bottom: var(--space-lg); }
.t-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4.2vw, 44px); line-height: 1.05; letter-spacing: .5px; text-transform: lowercase; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.t-lede { margin-top: 10px; color: var(--muted); max-width: 58ch; font-size: clamp(14px, 1.1vw + 10.5px, 15.5px); text-wrap: balance; }
/* No stranded last words: headings and short copy are balanced, longer copy avoids orphans. */
.t-head h1, .t-lock h2, .t-notes h2, .r-guide h2, .r-ref-head h2, .fit h3, .t-soon, .r-hint { text-wrap: balance; }
.t-note, .t-notes p, .t-lock p, .t-credit, .r-guide p, .r-ref-head p, .r-format p, .fit p, .r-reftable .nm span { text-wrap: pretty; }

/* Segmented navigation between the tools */
.t-bar { display: flex; align-items: center; gap: var(--space-md) var(--space-lg); flex-wrap: wrap; margin-bottom: var(--space-md); }
.t-tabs { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--row-sel); border: 1px solid var(--border); }
.t-tabs a { padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out); }
.t-tabs a:hover { color: var(--ink); text-decoration: none; }
.t-tabs a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 26, 24, .12); }
.t-soon { font-size: 12.5px; color: var(--faint); }

/* Access: Pro · 1 free use · free session running · used */
.t-access { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.t-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.t-chip i { width: 6px; height: 6px; border-radius: 999px; background: var(--faint); display: block; }
.t-chip[data-kind="pro"] { border-color: var(--accent-line); background: var(--accent-tint); color: var(--accent); }
.t-chip[data-kind="pro"] i, .t-chip[data-kind="live"] i { background: var(--sage); }
.t-chip[data-kind="live"] { color: var(--text); }
.t-chip[hidden], .t-access .btn[hidden] { display: none; }

/* ── Stage: the card the tool lives in ───────────────────────────────────── */
.t-stage { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: clip; }
.t-stage-in { transition: opacity 260ms var(--ease-out), filter 260ms var(--ease-out); }
.t-stage[data-access="locked"] .t-stage-in { opacity: .42; filter: saturate(.6); }
.t-stage[data-access="locked"] .t-stage-in, .t-stage[data-access="preview"] .t-stage-in { pointer-events: none; user-select: none; }
.t-frame { display: block; width: 100%; height: 1120px; border: 0; background: transparent; }
/* While the tool is a preview or locked, a clear sheet lies over it: touches land on the page
   (so the page scrolls normally and a tap pauses the demo) instead of on the framed tool,
   whatever a browser does with `inert`. It is gone the moment a session is open. */
.t-shield { position: absolute; inset: 0; z-index: 2; touch-action: pan-y; }
.t-stage[data-access="open"] .t-shield { display: none; }
.t-note { position: relative; z-index: 3; }

/* Preview note: sits above the tool while it plays unattended */
.t-note { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--inset); font-size: 13px; color: var(--muted); }
.t-note b { font-weight: 500; color: var(--text); }
.t-note[hidden] { display: none; }
.t-note > span { flex: 1 1 240px; min-width: 0; }
.t-note .btn { min-height: 40px; flex: 0 0 auto; }

/* Lock panel: inside the stage, never a popup */
/* Sticky, so it stays in view however tall the tool is; the negative margin lays it over
   the foot of the tool instead of adding to the stage's height. */
.t-lock { position: sticky; bottom: 20px; width: min(560px, calc(100% - 32px)); margin: -196px auto 20px; padding: 22px 24px; border-radius: var(--radius-md); background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lift); z-index: 5; }
.t-lock[hidden] { display: none; }
.t-lock h2 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: .4px; text-transform: lowercase; color: var(--ink); }
.t-lock p { margin-top: 8px; color: var(--muted); font-size: 13.5px; max-width: 52ch; }
.t-lock .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.t-stage[data-access="locked"] { min-height: 420px; }
@keyframes t-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.t-lock:not([hidden]) { animation: t-rise 320ms var(--ease-out); }

/* ── Notes under the tool ────────────────────────────────────────────────── */
.t-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); margin-top: var(--space-xl); }
.t-notes h2 { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.t-notes p { color: var(--muted); font-size: 13.5px; }
.t-credit { margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); max-width: 86ch; }
.t-foot { border-top: 1px solid var(--border); }
.t-foot-in { max-width: 1280px; margin: 0 auto; padding: 22px 24px 40px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; }
.t-foot a { color: var(--muted); white-space: nowrap; }
.t-foot a:hover { color: var(--ink); text-decoration: none; }
@media (pointer: coarse) {
  .t-foot-in { row-gap: 0; }
  .t-foot a { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ── Aspect Ratio Calculator ─────────────────────────────────────────────── */
.r-grid { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); }
.r-controls { padding: 22px 24px 24px; border-right: 1px solid var(--border); display: grid; gap: 20px; align-content: start; min-width: 0; }
.r-view { padding: 22px 24px 24px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.r-field { display: grid; gap: 8px; min-width: 0; }
.r-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 32px; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-family: var(--mono); font-size: 12px; color: var(--text); cursor: pointer; white-space: nowrap; transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out), color 160ms var(--ease-out); will-change: transform; }
.chip:hover { border-color: var(--border-strong); }
.chip:active { opacity: .8; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[disabled] { opacity: .5; cursor: default; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--row-sel); border: 1px solid var(--border); width: max-content; max-width: 100%; }
.seg button { min-height: 30px; padding: 5px 12px; border: 0; background: transparent; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 26, 24, .12); }
.r-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.r-pair .x { padding-bottom: 9px; color: var(--faint); font-family: var(--mono); font-size: 13px; }
.inp { display: grid; gap: 6px; min-width: 0; }
.inp span { font-size: 12px; color: var(--muted); }
.inp input, .inp select { width: 100%; min-width: 0; height: 38px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--inset); font-family: var(--mono); font-size: 14px; color: var(--ink); transition: border-color 160ms var(--ease-out), background-color 160ms var(--ease-out); }
.inp input:hover, .inp select:hover { border-color: var(--border-strong); }
.inp input:focus-visible, .inp select:focus-visible { outline: 2px solid var(--sage); outline-offset: 1px; background: var(--card); }
.inp input[data-solved="1"] { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }
.inp input[aria-invalid="true"] { border-color: #8E3B2F; }
.inp input:disabled, .inp select:disabled { opacity: .6; }
.r-hint { font-size: 12.5px; color: var(--muted); }
.r-hint[data-kind="error"] { color: #8E3B2F; }
:root[data-theme="dark"] .r-hint[data-kind="error"], :root[data-theme="dark"] .btn[data-state="error"] { color: #D9A99E; border-color: #A85B4C; }

.r-canvas { position: relative; height: clamp(240px, 34vw, 380px); border-radius: var(--radius-md); background: var(--stage); border: 1px solid var(--border); display: grid; place-items: center; overflow: clip; }
.r-shape { position: relative; background: var(--card); border: 1px solid var(--border-strong); border-radius: 4px; box-shadow: var(--shadow-lift); transition: width 360ms var(--ease-out), height 360ms var(--ease-out); will-change: transform; }
.r-shape::before, .r-shape::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.r-shape::before { background: linear-gradient(to right, transparent calc(33.333% - .5px), var(--hair) calc(33.333% - .5px), var(--hair) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), var(--hair) calc(66.666% - .5px), var(--hair) calc(66.666% + .5px), transparent calc(66.666% + .5px)); }
.r-shape::after { background: linear-gradient(to bottom, transparent calc(33.333% - .5px), var(--hair) calc(33.333% - .5px), var(--hair) calc(33.333% + .5px), transparent calc(33.333% + .5px), transparent calc(66.666% - .5px), var(--hair) calc(66.666% - .5px), var(--hair) calc(66.666% + .5px), transparent calc(66.666% + .5px)); }
.r-shape b { position: absolute; font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; z-index: 1; }
.r-shape .w { left: 50%; bottom: -22px; transform: translateX(-50%); }
.r-shape .h { top: 50%; right: -8px; transform: translate(100%, -50%); }
.r-shape .c { left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--sans); font-size: clamp(20px, 3vw, 28px); font-weight: 500; color: var(--ink); letter-spacing: -.2px; }

.r-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); min-width: 0; will-change: transform; transition: border-color 200ms var(--ease-out); }
.stat:hover { border-color: var(--border-strong); }
/* Ratios are set in the UI face: VTC Bayard draws ":" as a double bar, which reads as "=". */
.stat b { display: block; margin-top: 6px; font-family: var(--sans); font-weight: 500; font-size: 21px; line-height: 1.15; letter-spacing: -.2px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.r-fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fit { padding: 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; min-width: 0; }
.fit-pic { height: 72px; display: grid; place-items: center; }
.fit-out { position: relative; background: var(--ink); border-radius: 3px; overflow: hidden; transition: width 320ms var(--ease-out), height 320ms var(--ease-out); }
.fit-src { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--sage-soft); transition: width 320ms var(--ease-out), height 320ms var(--ease-out); }
.fit[data-kind="crop"] .fit-out { background: transparent; outline: 1.5px dashed var(--muted); outline-offset: 0; overflow: visible; }
.fit[data-kind="crop"] .fit-src { opacity: .55; }
.fit h3 { font-size: 13px; font-weight: 500; color: var(--ink); }
.fit p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.r-guide { padding: 22px 24px 24px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 36px; }
.r-guide h2 { font-size: 14px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.r-guide p { font-size: 13.5px; color: var(--muted); max-width: 56ch; }

/* Formats, grouped by where they are used */
.r-groups { display: grid; gap: 12px; }
.r-group { display: grid; gap: 6px; min-width: 0; }
.r-group .lbl { font-size: 9.5px; color: var(--faint); }
.r-format { padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--accent-line); background: var(--accent-tint); min-width: 0; }
.r-format-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.r-format b { font-size: 15px; font-weight: 500; color: var(--ink); letter-spacing: -.1px; }
.r-format-top span { font-family: var(--mono); font-size: 12px; color: var(--accent); white-space: nowrap; }
.r-format p { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.r-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.r-row .btn { min-height: 38px; }
.btn[data-state="success"] { border-color: var(--accent-line); background: var(--accent-tint); color: var(--accent); }

/* A frame line: what the delivery format keeps of the picture */
.r-guideline { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 1.5px dashed var(--sage); border-radius: 2px; z-index: 1; pointer-events: none; transition: width 320ms var(--ease-out), height 320ms var(--ease-out); }
.r-guideline i { position: absolute; left: 5px; bottom: 5px; padding: 1px 5px; border-radius: 4px; background: var(--card); font-family: var(--mono); font-style: normal; font-size: 10px; letter-spacing: .04em; color: var(--sage); white-space: nowrap; }

/* The frame this shape occupies in each delivery raster */
.r-std { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.std { display: grid; gap: 4px; align-content: start; min-width: 0; padding: 12px 14px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); text-align: left; cursor: pointer; transition: border-color 180ms var(--ease-out), background-color 180ms var(--ease-out), transform 120ms var(--ease-out); }
.std b { font-family: var(--sans); font-size: 17px; font-weight: 500; line-height: 1.2; letter-spacing: -.2px; color: var(--ink); white-space: nowrap; }
.std .sub { font-size: 12px; line-height: 1.35; color: var(--muted); }
.std:hover { border-color: var(--border-strong); }
.std:active { transform: translateY(1px); }
.std[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); }
.std[aria-pressed="true"] b { color: var(--accent); }
.std:disabled { cursor: default; opacity: .6; }
.std:disabled:active { transform: none; }

/* Format reference — open to read; loading a row into the calculator needs a live session */
.r-ref { margin-top: var(--space-xl); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: clip; }
.r-ref-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; padding: 24px 24px 20px; }
.r-ref-head h2 { font-family: var(--display); font-weight: 400; font-size: 26px; line-height: 1.1; letter-spacing: .4px; text-transform: lowercase; color: var(--ink); }
.r-ref-head p { margin-top: 8px; max-width: 64ch; font-size: 13.5px; color: var(--muted); }
.r-reftable { width: 100%; border-collapse: collapse; font-size: 13px; }
.r-reftable[data-set="tv"] [data-set="dci"], .r-reftable[data-set="dci"] [data-set="tv"] { display: none; }
.r-reftable thead th { padding: 10px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--inset); text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; vertical-align: bottom; }
.r-reftable thead th:first-child { padding-left: 24px; }
.r-reftable thead th[data-set] { text-align: right; padding-right: 24px; }
.r-reftable thead th span { display: block; margin-top: 2px; letter-spacing: .02em; color: var(--faint); }
.r-reftable .grp th { padding: 18px 24px 7px; text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.r-reftable tr[data-id] > * { padding: 9px 12px; border-top: 1px solid var(--hair); vertical-align: top; transition: background-color 180ms var(--ease-out); }
.r-reftable tr[data-id] th { padding-left: 24px; width: 1%; text-align: left; font-weight: 400; white-space: nowrap; }
.r-reftable tr[data-id] td[data-set] { width: 1%; padding-right: 16px; text-align: right; }
.r-reftable .pick, .r-reftable .sz { border: 0; background: transparent; font-family: var(--mono); font-size: 13px; cursor: default; white-space: nowrap; }
.r-reftable .pick { padding: 1px 0; color: var(--ink); }
.r-reftable .sz { padding: 3px 8px; border-radius: 6px; color: var(--text); transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out); }
.r-reftable .dec { display: block; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.r-reftable .nm-sm { display: none; }
.r-reftable .nm b { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.r-reftable .nm span { display: block; font-size: 12.5px; color: var(--muted); max-width: 60ch; }
.r-reftable[data-live="1"] .pick, .r-reftable[data-live="1"] .sz { cursor: pointer; }
.r-reftable[data-live="1"] .pick:hover { text-decoration: underline; text-underline-offset: 3px; }
.r-reftable[data-live="1"] .sz:hover { background: var(--row-sel); color: var(--ink); }
.r-reftable[data-live="1"] .sz:active { opacity: .75; }
.r-reftable tr[data-current="true"] > * { background: var(--accent-tint); }
.r-reftable tr[data-current="true"] th { box-shadow: inset 2px 0 0 var(--accent); }
.r-reftable tr[data-current="true"] .pick { color: var(--accent); }
.r-reftable tbody tr:last-child > * { padding-bottom: 14px; }

/* ── Tools hub (the generated /tools/ page uses its own styles) ──────────── */

/* The simulator stacks its two columns below ~1040px; start the frame near that height so
   the page doesn't jump when the real height arrives. */
@media (max-width: 1040px) { .t-frame { height: 2260px; } }
@media (max-width: 960px) {
  .r-grid { grid-template-columns: minmax(0, 1fr); }
  .r-controls { border-right: 0; border-bottom: 1px solid var(--border); }
  .r-guide { grid-template-columns: minmax(0, 1fr); }
  .t-notes { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
}
@media (max-width: 720px) {
  .t-top-in { padding: 8px 16px; gap: 10px; }
  .t-nav { margin-left: 4px; gap: 0; }
  .t-nav a { padding: 6px 8px; }
  .t-nav .hide-sm, .t-right .hide-sm { display: none; }
  .t-main { padding: 22px 16px 44px; }
  .t-head { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .t-access { margin-left: 0; }
  .t-tabs { width: 100%; }
  .t-tabs a { flex: 1; text-align: center; padding: 8px 6px; }
  .r-controls, .r-view, .r-guide { padding: 18px 16px 20px; }
  .r-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-fit { grid-template-columns: minmax(0, 1fr); }
  .r-std { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r-shape .h { top: 7px; right: 8px; transform: none; padding: 0 4px; border-radius: 4px; background: var(--card); }
  .r-ref-head { padding: 20px 16px 16px; }
  .r-ref-head .seg { width: 100%; }
  .r-ref-head .seg button { flex: 1; padding: 5px 6px; }
  .r-reftable thead th:first-child, .r-reftable tr[data-id] th, .r-reftable .grp th { padding-left: 16px; }
  .r-reftable thead th[data-set], .r-reftable tr[data-id] td[data-set] { padding-right: 8px; }
  .r-reftable thead th { padding-left: 4px; padding-right: 4px; letter-spacing: .08em; }
  .r-reftable tr[data-id] > * { padding-left: 4px; padding-right: 4px; }
  .r-reftable .nm span { display: none; }
  .t-lock { bottom: 12px; padding: 18px; margin-top: -210px; }
  .t-lock h2 { font-size: 22px; }
}
@media (max-width: 560px) {
  /* The name moves under the ratio so the two sizes keep their width. */
  .r-reftable thead th:nth-child(2), .r-reftable .nm, .r-reftable .dec { display: none; }
  .r-reftable .nm-sm { display: block; margin-top: 1px; font-size: 12px; line-height: 1.3; color: var(--muted); white-space: normal; }
  .r-reftable tr[data-id] th { width: auto; }
  .r-reftable .sz { padding: 3px 4px; font-size: 12px; }
}
@media (max-width: 380px) {
  .std b { font-size: 15.5px; }
  .r-row { grid-template-columns: minmax(0, 1fr); }
  .t-word { font-size: 18px; }
  .t-nav a { font-size: 12.5px; padding: 6px; }
  .stat b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: 120ms !important; }
  .r-shape, .fit-out, .fit-src, .r-guideline { transition: none; }
}
