/* 3DFile.app: a workbench, like slicer / CAD software. Graphite + one signal orange.
   File extensions are mono "file tags" (.ext) - the one recurring motif. Hairlines, 6px radius, few shadows. */
:root {
  --bg: #f3f3f0;
  --surface: #ffffff;
  --ink: #1c1f23;
  --muted: #5b6068;
  --line: #d9d9d3;
  --accent: #c2410c;
  --lime-deep: #15803d;
  --amber: #92400e;
  --err-fg: #b91c1c;
  --ink-soft: color-mix(in srgb, var(--ink) 78%, var(--muted));
  --bg-2: color-mix(in srgb, var(--ink) 4%, var(--surface));
  --line-strong: color-mix(in srgb, var(--muted) 45%, var(--surface));
  --accent-hover: color-mix(in srgb, var(--accent) 82%, var(--ink));
  --accent-soft: color-mix(in srgb, var(--accent) 7%, var(--surface));
  --accent-fg: var(--surface);
  --lime-soft: color-mix(in srgb, var(--lime-deep) 6%, var(--surface));
  --amber-soft: color-mix(in srgb, var(--amber) 10%, var(--surface));
  --err-bg: color-mix(in srgb, var(--err-fg) 8%, var(--surface));
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  /* aliases used by the viewer engine's markup */
  --paper: var(--bg);
  --paper-2: var(--bg-2);
  --paper-3: var(--line);
  --faint: var(--muted);
  --rule: var(--line);
  --rule-2: var(--line);
  --rule-dashed: var(--line-strong);
  --shadow-sm: var(--shadow-xs);
  --radius: 6px;
  --font-sans: "Inter", system-ui, -apple-system, "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --header-h: 56px;
}
:root[data-theme="dark"] {
  --bg: #131518;
  --surface: #1b1e22;
  --ink: #e8e8e4;
  --muted: #9ba0a7;
  --line: #2d3137;
  --accent: #fb8a4c;
  --lime-deep: #4ade80;
  --amber: #fcd34d;
  --err-fg: #fca5a5;
  --accent-fg: var(--bg);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --lime-soft: color-mix(in srgb, var(--lime-deep) 12%, var(--surface));
  --amber-soft: color-mix(in srgb, var(--amber) 12%, var(--surface));
  --err-bg: color-mix(in srgb, var(--err-fg) 12%, var(--surface));
  --bg-2: color-mix(in srgb, var(--ink) 5%, var(--surface));
  --line-strong: color-mix(in srgb, var(--muted) 40%, var(--surface));
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter", system-ui, -apple-system, "PingFang SC", "Hiragino Sans", "Microsoft YaHei", sans-serif; font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.nums { font-variant-numeric: tabular-nums; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.skip:focus { left: 8px; }

/* File tag: the site's one motif */
.ext { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 22px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: 600 12px/1 var(--font-mono); letter-spacing: 0.02em; text-transform: uppercase; flex-shrink: 0; }
.ext::before { content: "."; color: var(--accent); }


/* Header: one row */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.bar { position: relative; display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; flex-shrink: 0; }
.brand-mark { width: 28px; height: 28px; border-radius: var(--radius); background: var(--ink); color: var(--surface); display: grid; place-items: center; }
.brand-tld { color: var(--muted); font-weight: 500; }
.brand-top { fill: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; height: 100%; }
.nav-item { height: 100%; display: flex; align-items: center; }
.nav-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink-soft); font: 500 14px var(--font-sans); cursor: pointer; }
.nav-btn:hover, .nav-btn[aria-expanded="true"] { background: var(--bg-2); color: var(--ink); }
.nav-btn.is-section { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.nav-btn .chev { transition: transform 0.15s; }
.nav-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.bar-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.icon-btn { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--ink-soft); font: 500 13px var(--font-sans); cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.lang-btn { border-color: var(--line); }
.i-sun, .i-close { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
.nav-toggle { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; }

/* Mega menu */
.menu { display: none; position: absolute; top: calc(100% + 1px); left: 24px; right: 24px; max-width: 980px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-md); }
.nav-item[data-open] .menu { display: block; }
.menu-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; }
.menu-col { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.menu-label { margin: 0 0 6px; padding: 0 8px; font: 600 12px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.menu-link { display: flex; align-items: flex-start; gap: 12px; padding: 8px; border-radius: var(--radius); }
.menu-link:hover, .menu-link:focus-visible { background: var(--bg-2); }
.menu-link[aria-current="page"] { background: var(--accent-soft); }
.menu-link .ext { margin-top: 1px; }
.menu-text { display: flex; flex-direction: column; min-width: 0; }
.menu-text b { font-size: 14px; font-weight: 600; line-height: 1.35; }
.menu-text small { font-size: 13px; color: var(--muted); line-height: 1.4; }
.menu-foot { display: flex; justify-content: space-between; gap: 12px; margin: 4px 8px 4px; padding: 12px 8px 4px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--accent); }
.menu-foot:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }


/* Format search */
.search { order: 3; position: relative; margin-left: auto; width: 260px; }
.search-icon { position: absolute; left: 10px; top: 10px; color: var(--muted); pointer-events: none; }
.search-input { width: 100%; height: 36px; padding: 0 32px 0 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); font: 14px var(--font-sans); -webkit-appearance: none; appearance: none; }
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-key { position: absolute; right: 8px; top: 8px; min-width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; font: 500 12px var(--font-mono); color: var(--muted); pointer-events: none; }
.search-input:focus ~ .search-key { display: none; }
.search-results { position: absolute; top: calc(100% + 6px); right: 0; width: 360px; max-height: 420px; overflow: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); z-index: 60; }
.search-results .menu-link { align-items: center; }
.search-results .menu-link[aria-selected="true"] { background: var(--accent-soft); }
.search-empty { margin: 0; padding: 10px 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* Buttons and controls (also used by the viewer engine) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--radius); font: 600 14px var(--font-sans); cursor: pointer; white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-secondary:not(:disabled):hover { background: var(--bg-2); }
.btn-ghost { background: transparent; color: var(--ink-soft); font-weight: 500; }
.btn-ghost:hover { background: var(--bg-2); color: var(--ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); font: 500 13px var(--font-sans); color: var(--ink-soft); background: var(--surface); cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip[aria-pressed="true"], .chip[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.segmented { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.segmented > button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 0; border-radius: 4px; background: transparent; font: 500 13px var(--font-sans); color: var(--muted); cursor: pointer; white-space: nowrap; }
.segmented > button:hover { color: var(--ink); }
.segmented > button[aria-selected="true"], .segmented > button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }
.segmented-sm > button { height: 26px; padding: 0 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.searchbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.searchbox:hover { border-color: var(--line-strong); }
.icon-tile { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); }
.input { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 8px 12px; font: 14px var(--font-sans); }
.notice { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.5; }
.notice-error { background: var(--err-bg); color: var(--err-fg); }
.notice-warn { background: var(--amber-soft); color: var(--amber); }
.notice-ok { background: var(--lime-soft); color: var(--lime-deep); }


/* Hero: compact, left-aligned; the drop zone is the main thing on screen */
.hero { padding: 32px 0 48px; }
.hero-head { max-width: 760px; margin: 0 0 24px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.hero h1 { margin: 0; font-size: 36px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.hero-sub { margin: 8px 0 0; font-size: 16px; line-height: 1.6; color: var(--muted); max-width: 680px; text-wrap: pretty; }

/* Drop zone */
.td-drop-shell { max-width: none; }
.td-drop-outer { padding: 6px; }
.td-drop-outer.is-drag { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.td-drop-inner { min-height: 300px; border: 1.5px dashed var(--line-strong); border-radius: 4px; padding: 32px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--bg-2); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }
.td-drop-outer.is-drag .td-drop-inner { border-color: var(--accent); }
.td-drop-idle { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; max-width: 560px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.td-drop-title { margin: 0; font-size: 18px; font-weight: 600; }
.td-drop-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; }
.td-or { font-size: 14px; color: var(--muted); }
.td-drop-err { max-width: 560px; text-align: left; }
.td-drop-meta { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.td-formats-line { font: 500 12px/1.7 var(--font-mono); letter-spacing: 0.02em; color: var(--ink-soft); }
.td-private-line { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--lime-deep); font-weight: 500; }
.td-drop-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.td-loading-text { margin: 0; font-size: 14px; color: var(--muted); }
@keyframes dot-wave { 0%,60%,100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-3px); opacity: 1; } }
.dot-wave { display: inline-flex; gap: 6px; color: var(--accent); }
.dot-wave > span { width: 8px; height: 8px; border-radius: 2px; background: currentColor; animation: dot-wave 1.1s ease-in-out infinite; }
.dot-wave > span:nth-child(2) { animation-delay: 0.15s; }
.dot-wave > span:nth-child(3) { animation-delay: 0.3s; }
@media (prefers-reduced-motion: reduce) { .dot-wave > span { animation: none; opacity: 1; } }

/* Workspace: stage left, inspector right */
.td-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 12px; align-items: stretch; }
.td-workspace-conv { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 960px) { .td-workspace, .td-workspace-conv { grid-template-columns: 1fr; } }
.td-stage-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 540px; }
.td-stage { flex: 1; width: 100%; min-height: 480px; background: var(--bg-2); }
.td-stage-hint { padding: 8px 14px; font: 500 12px var(--font-mono); color: var(--muted); border-top: 1px solid var(--line); text-align: center; background: var(--surface); }
.td-drop-overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-soft) 90%, transparent); color: var(--accent); font-weight: 600; font-size: 16px; border: 2px dashed var(--accent); border-radius: inherit; pointer-events: none; }


.td-aside { padding: 0; display: flex; flex-direction: column; gap: 0; }
.td-aside > * { padding: 16px 18px; }
.td-file-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.td-file-meta { min-width: 0; }
.td-file-label { font: 600 12px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.td-file-name { font: 600 14px var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-group { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.td-group-title { font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.td-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.td-ctrl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.td-anim-select { max-width: 170px; height: 32px; padding: 0 8px; font-size: 13px; }
.td-export-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.td-fixed-target { font: 600 22px var(--font-mono); letter-spacing: 0; }
.td-lost-note { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.td-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.td-check input { margin-top: 4px; accent-color: var(--accent); }
.td-check-hint { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.td-full { width: 100%; }
.td-conv-msg { font-size: 13px; color: var(--lime-deep); font-weight: 500; min-height: 16px; }
.td-conv-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.td-stats { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.td-stat-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding-bottom: 6px; border-bottom: 1px dotted var(--line); }
.td-stat-row:last-child { border-bottom: 0; padding-bottom: 0; }
.td-stat-row dt { color: var(--muted); }
.td-stat-row dd { margin: 0; font: 500 13px var(--font-mono); text-align: right; }

/* Next step: what to do with this format */
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.next-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 14px; font-weight: 600; }
.next-link { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; font-weight: 500; }
.next-link:hover { border-color: var(--accent); color: var(--accent); }
.next-link .ext { height: 22px; width: 48px; }
.next-link-plain { padding: 0 12px; }
.ext-to { background: var(--bg-2); }
.next-more { margin-left: auto; font-size: 14px; font-weight: 500; color: var(--accent); }
.next-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Directory (home + related) */
.section { padding: 56px 0; border-top: 1px solid var(--line); }
.prose-wrap { background: var(--surface); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 24px; }
.section-title { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
.section-sub { margin: 0; font-size: 15px; color: var(--muted); max-width: 520px; text-wrap: pretty; }
.prose-section p, .faq-item p, .menu-text small, .dir-text small { text-wrap: pretty; }
/* CJK labels read badly in a monospace face with letter-spacing */
:lang(zh-CN) .menu-label, :lang(zh-CN) .dir-label, :lang(zh-CN) .footer-col h3, :lang(zh-CN) .td-group-title, :lang(zh-CN) .td-file-label { font-family: var(--font-sans); letter-spacing: 0.02em; font-size: 13px; }
.dir { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dir-col { display: flex; flex-direction: column; padding: 12px; border-left: 1px solid var(--line); }
.dir-col:first-child { border-left: 0; }
.dir-label { margin: 0 0 8px; padding: 4px 8px 10px; border-bottom: 1px solid var(--line); font: 600 12px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.dir-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px; border-radius: var(--radius); }
.dir-row:hover { background: var(--bg-2); }
.dir-row:hover b { color: var(--accent); }
.dir-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dir-text b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.dir-text small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.dir-hub { margin-top: auto; border-top: 1px dashed var(--line); border-radius: 0; padding-top: 14px; }
.dir-flat { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; }
.dir-flat .dir-row { border-left: 1px solid var(--line); border-radius: 0; padding: 14px 16px; align-items: center; }
.dir-flat .dir-row:first-child { border-left: 0; }
.dir-arrow { color: var(--muted); }


/* Prose with an "on this page" rail on wide screens */
.prose-layout { display: grid; grid-template-columns: minmax(0, 780px); justify-content: center; }
.toc { display: none; }
@media (min-width: 1180px) {
  .prose-layout { grid-template-columns: 220px minmax(0, 780px); gap: 56px; justify-content: center; }
  .toc { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--header-h) + 24px); align-self: start; max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-left: 12px; border-left: 1px solid var(--line); }
  .toc-label { margin: 0 0 8px; font: 600 12px var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
  :lang(zh-CN) .toc-label { font-family: var(--font-sans); letter-spacing: 0.02em; font-size: 13px; }
  .toc a { position: relative; padding: 6px 0; font-size: 14px; line-height: 1.4; color: var(--muted); }
  .toc a:hover { color: var(--ink); }
  .toc a[aria-current="true"] { color: var(--ink); font-weight: 600; }
  .toc a[aria-current="true"]::before { content: ""; position: absolute; left: -13px; top: 6px; bottom: 6px; width: 2px; background: var(--accent); }
}

/* Prose, tables, FAQ */
.prose-section { margin-bottom: 48px; }
.prose-section:last-child { margin-bottom: 0; }
.prose-section h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.prose-section p { margin: 0 0 12px; font-size: 16px; color: var(--ink-soft); line-height: 1.7; }
.prose-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; border-top: 1px solid var(--ink); }
.prose-table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose-table td:first-child { font-weight: 600; width: 30%; padding-right: 24px; }
.prose-table td:last-child { color: var(--ink-soft); line-height: 1.6; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* Markdown body (page.body): same look as the structured sections */
.prose-md h2 { margin: 48px 0 12px; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
.prose-md h2:first-child { margin-top: 0; }
.prose-md h3 { margin: 24px 0 8px; font-size: 17px; font-weight: 700; }
.prose-md ul, .prose-md ol { margin: 0 0 12px; padding-left: 22px; color: var(--ink-soft); line-height: 1.7; }
.prose-md li { margin-bottom: 4px; }
.prose-md a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose-md strong { color: var(--ink); }
.prose-md code { font: 500 0.9em var(--font-mono); padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg-2); }
.prose-md table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; border-top: 1px solid var(--ink); }
.prose-md th { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line-strong); font-size: 13px; font-weight: 600; color: var(--muted); }
.prose-md td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); line-height: 1.6; }
.prose-md td:first-child { font-weight: 600; color: var(--ink); }
.prose-md blockquote { margin: 16px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg-2); color: var(--ink-soft); }
.prose-md blockquote p { margin: 0; }
.prose-md .table-wrap, .prose-md table { display: block; overflow-x: auto; }
.prose-md .btn { text-decoration: none; margin: 4px 8px 4px 0; }
@media (min-width: 641px) { .prose-md table { display: table; } }
.faq-list { display: flex; flex-direction: column; margin-top: 12px; border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; font-size: 16px; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font: 500 18px var(--font-mono); color: var(--muted); }
.faq-item[open] summary::after { content: "\2212"; color: var(--accent); }
.faq-item p { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); line-height: 1.7; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 32px; }
.footer-brand { margin: 0 0 8px; font-weight: 700; }
.footer-tag { margin: 0; font-size: 14px; color: var(--muted); max-width: 300px; }
.footer-col h3 { margin: 0 0 12px; font: 600 12px var(--font-mono); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }

/* Tablet and phone: nav becomes a full-screen sheet behind the menu button */
@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; }
  .nav { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; z-index: 49; flex-direction: column; align-items: stretch; gap: 0; height: auto; padding: 16px 16px 48px; overflow-y: auto; background: var(--surface); }
  .site-header[data-nav-open] .nav { display: flex; }
  .search { order: -1; width: 100%; margin: 0 0 12px; }
  .search-input { height: 44px; font-size: 16px; }
  .search-icon { top: 14px; }
  .search-key { display: none; }
  .search-results { position: static; width: auto; max-height: none; margin-top: 8px; box-shadow: none; }
  .nav-item { display: block; height: auto; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
  .nav-btn { width: 100%; justify-content: space-between; height: 44px; padding: 0 4px; font-size: 16px; font-weight: 600; color: var(--ink); box-shadow: none; border-radius: var(--radius); }
  .nav-btn.is-section { box-shadow: none; }
  .menu, .nav-item[data-open] .menu { display: block; position: static; max-width: none; padding: 0 0 8px; border: 0; box-shadow: none; }
  .nav-btn { pointer-events: none; }
  .nav-btn .chev { display: none; }
  .menu-cols { grid-template-columns: 1fr; }
}
@media (min-width: 641px) and (max-width: 960px) {
  .menu-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
  .menu-text small { display: none; }
}
@media (max-width: 960px) {
  .menu-col { padding: 8px 0; }
  .menu-label { padding: 0 4px; }
  .menu-link { padding: 10px 4px; }
  .menu-foot { margin: 4px 0; padding: 12px 4px 4px; }
  body[data-nav-lock] { overflow: hidden; }
  .dir { grid-template-columns: 1fr; }
  .dir-col { border-left: 0; border-top: 1px solid var(--line); }
  .dir-col:first-child { border-top: 0; }
  .dir-flat { grid-template-columns: 1fr 1fr; }
  .dir-flat .dir-row:nth-child(odd) { border-left: 0; }
  .dir-flat .dir-row:nth-child(n+3) { border-top: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .container, .container-narrow { padding: 0 16px; }
  .bar { gap: 12px; }
  .hero { padding: 20px 0 32px; }
  .hero h1 { font-size: 28px; }
  .section { padding: 40px 0; }
  .section-title { font-size: 22px; }
  .td-drop-inner { min-height: 260px; padding: 12px; }
  .td-drop-idle { padding: 20px 16px; }
  .td-drop-actions { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
  .td-drop-actions .btn { width: 100%; }
  .td-or { display: none; }
  .td-stage-card { min-height: 360px; }
  .td-stage { min-height: 320px; }
  .next-more { margin-left: 0; }
  .dir-flat { grid-template-columns: 1fr; }
  .dir-flat .dir-row { border-left: 0; border-top: 1px solid var(--line); }
  .dir-flat .dir-row:first-child { border-top: 0; }
  .prose-table { table-layout: fixed; }
  .prose-table td { padding: 8px 6px 8px 0; overflow-wrap: anywhere; }
  .prose-table td:first-child { white-space: normal; width: 32%; }
}
