/* ==========================================================================
   Components the docs pages share, on top of td-shell.css. One copy, so a
   page's content file carries words and structure, and never styling.
   ========================================================================== */

.meta-row { margin-top: 14px; font: 12.5px/1.5 var(--mono); color: var(--ink-3); }

/* A page opens with its landing register straight under the title. */
.td-doc > .lede { font-size: 18.5px; margin-top: 28px; }

.invite { margin-top: 1.6em; padding-top: 14px; border-top: 1px dashed var(--line-2); color: var(--ink-2); font-size: 15px; }

/* a page with only a Brief has no tab bar, and its one panel always shows */
.reg-panel.single { display: block; }
.reg-panel.single .reg-head { margin-top: 26px; }

/* heading anchors, for linking straight to a part of a register */
.td-doc h2[id], .td-doc h3[id] { scroll-margin-top: 20px; }
.td-doc .hash { margin-left: .4em; font-weight: 400; color: var(--ink-3); text-decoration: none; opacity: 0; }
.td-doc h2:hover .hash, .td-doc h3:hover .hash, .td-doc .hash:focus-visible { opacity: 1; }

/* sources, one list per page */
.src-head { margin-top: 64px !important; font: 600 15px/1.2 var(--mono) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3) !important; }
.src { font-size: 14px; }
.src li { margin: .25em 0; }

/* figures drawn in SVG from the shell's tokens, so they repaint with the mode */
.figwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 10px; }
.figwrap svg { display: block; width: 100%; min-width: 620px; height: auto; }
.flow text { font-family: var(--mono); }
.flow .box { fill: var(--bg-2); stroke: var(--line-2); }
.flow .hot { fill: color-mix(in srgb, var(--acc) 10%, var(--bg-2)); stroke: var(--acc); }
.flow .you { fill: color-mix(in srgb, var(--you) 10%, var(--bg-2)); stroke: var(--you); }
.flow .warm { fill: color-mix(in srgb, var(--amber) 10%, var(--bg-2)); stroke: var(--amber); }
.flow .t1 { fill: var(--ink); font-size: 13px; font-weight: 600; }
.flow .t2 { fill: var(--ink-3); font-size: 11px; }
.flow .ln { stroke: var(--ink-3); fill: none; stroke-width: 1.4; }
.flow .back { stroke: var(--you); fill: none; stroke-width: 1.4; stroke-dasharray: 5 4; }
.flow .lbl { fill: var(--you); font-size: 11.5px; }
.flow .ah { fill: var(--ink-3); }
.flow .ahy { fill: var(--you); }

/* the three registers, explained once on the introduction */
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 26px 0 8px; }
.three div { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.three b { display: block; font: 700 14px/1.2 var(--mono); color: var(--phos); margin-bottom: 6px; }
.three span { font-size: 14px; color: var(--ink-2); line-height: 1.5; }

/* the page map, generated from nav.json */
.map { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.map section { padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: 12px; }
.map h3 { margin: 0 0 10px !important; font: 600 11.5px/1 var(--mono) !important; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3) !important; }
.map ul { list-style: none; margin: 0; padding: 0; }
.map li { margin: 0; padding: 5px 0; border-top: 1px solid var(--line); font-size: 15px; display: flex; gap: 10px; align-items: baseline; }
.map li:first-child { border-top: 0; }
.map li a { text-decoration: none; color: var(--ink); font-weight: 600; white-space: nowrap; }
.map li a:hover { color: var(--acc-2); }
.map li small { margin-left: auto; color: var(--ink-3); font-size: 12.5px; text-align: right; }
.map li.soon { color: var(--ink-3); }
.map li.soon::after { content: "soon"; margin-left: auto; font: 500 10px/1.9 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* a "soon" page in the spine is text, not a link to nowhere */
.td-group span.is-soon { display: flex; align-items: center; gap: 10px; padding: 6px 12px; margin: 1px 0; font-size: 14.5px; line-height: 1.35; color: var(--ink-3); }
.td-group span.is-soon::after { content: "soon"; margin-left: auto; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; }

/* a link to a page still being written reads as text */
.td-doc .soon-link { color: var(--ink); border-bottom: 1px dotted var(--ink-3); cursor: help; }

/* a key table: the chord in its own column, never wrapped */
.keys td:first-child { white-space: nowrap; }
.keys td:first-child kbd + kbd { margin-left: 2px; }

/* a definition list for small references */
.defs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 1.3em; }
.defs dt { font: 600 13.5px/1.5 var(--mono); color: var(--phos); }
.defs dd { margin: 0; color: var(--ink); }

/* search results carry a snippet and where they sit */
.td-pal li { flex-wrap: wrap; }
.td-pal li .snip { flex-basis: 100%; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-pal li .snip mark { background: none; color: var(--acc-2); font-weight: 600; }

@media (max-width: 900px) {
  .three, .map { grid-template-columns: minmax(0, 1fr); }
  .defs { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .defs dd { margin-bottom: 8px; }
}

/* The CRT page's barrel figure (docsite/tools/barrel-figure.mjs): the frame is
   the pane, .tube is where content lands, the corners left over are black glass. */
.barrel .frame { fill: #050806; stroke: var(--line-2); }
.barrel .tube { fill: color-mix(in srgb, var(--acc) 7%, #06100a); stroke: none; }
.barrel .g { stroke: var(--ink-3); stroke-width: .6; fill: none; opacity: .75; }
.barrel .g2 { stroke: var(--acc); stroke-width: 1.2; fill: none; }
.barrel text { font-family: var(--mono); }
.barrel .t1 { fill: var(--ink); font-size: 13px; font-weight: 600; }
.barrel .t2 { fill: var(--ink-3); font-size: 11px; }

/* The skins page's figure: one tab strip per built-in skin, drawn by hand from
   each skin's shape and metric tokens (app/skins/*.toml) over the hacker
   palette. A reconstruction, and its caption says so. */
.skinfig { display: grid; gap: 10px; }
.skinfig .row { display: grid; grid-template-columns: 116px 1fr; align-items: center; gap: 12px; }
.skinfig .who { font: 600 12px/1.2 var(--mono); color: var(--ink); }
.skinfig .who span { display: block; font-weight: 400; color: var(--ink-3); font-size: 11px; margin-top: 2px; }
.skinfig .strip { display: flex; gap: 4px; align-items: center; padding: 8px 10px; background: #03100a; border-radius: 8px; font: 12px/1 var(--mono); color: #86efac; }
.skinfig .tab { padding: 4px 6px; color: rgba(134, 239, 172, .7); }
.skinfig .tab.on { color: #86efac; }
.skinfig .chip { margin-left: auto; padding: 1px 5px; color: #03100a; background: #22c55e; }
.sk-default .tab { border: 1px solid rgba(34, 197, 94, .35); border-radius: 4px; background: linear-gradient(#0c2718, #071a10); }
.sk-default .tab.on { border-color: #22c55e; box-shadow: 0 0 5.25px rgba(34, 197, 94, .55); }
.sk-default .chip { border-radius: 4px; }
.sk-deco .strip { border-radius: 0; }
.sk-deco .tab { border: 3px double rgba(34, 197, 94, .5); background: #071a10; letter-spacing: .14em; padding: 4px 8px; }
.sk-deco .tab.on { border-color: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, .6); }
.sk-deco .chip { letter-spacing: .14em; padding: 1px 7px; }
.sk-console .strip { border-radius: 0; gap: 6px; }
.sk-console .tab { text-transform: uppercase; padding: 6px 10px; background: #071a10; }
.sk-console .tab.on { box-shadow: inset 0 -3px 0 #22c55e; }
.sk-console .chip { text-transform: uppercase; padding: 1px 7px; }

/* The text-crawl page's figure (docsite/tools/crawl-figure.mjs). */
.crawl .frame { fill: #050806; stroke: var(--line-2); }
.crawl .plane { fill: color-mix(in srgb, var(--acc) 7%, #06100a); }
.crawl .row { fill: var(--acc); opacity: .85; }
.crawl text { font-family: var(--mono); }
.crawl .t1 { fill: var(--ink); font-size: 13px; font-weight: 600; }
.crawl .t2 { fill: var(--ink-3); font-size: 11px; }

/* Inline code may break anywhere: a long path in a sentence or a definition
   otherwise pushes the whole pane sideways on a phone. Code blocks keep their
   own horizontal scroll. */
:not(pre) > code { overflow-wrap: anywhere; }
