/* Clankie docs: layout and docs components. Tokens, ground, header and footer
   come from the shared theme (Aero Day, Aero Night, Graphite). Reading surfaces
   are frosted sheets over that ground. */

/* Docs names for shared-theme tokens. */
:root {
  --text: var(--ink); --text-2: var(--ink-2); --text-3: var(--ink-3);
  --rollout: var(--sage); --triage: var(--plum); --decision: var(--accent);
  --hairline: var(--line); --wash: color-mix(in srgb, var(--ink) 7%, transparent);
  --panel: var(--paper-2); --edge: var(--paper-3);
}
html { scroll-padding-top: 108px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Focus (James, 2026-11-07 11:29 PM CT): no ring on mouse or tap focus. Keyboard
   focus gets a subtle cue in theme colours: links a thin soft outline; buttons
   and inputs a brighter border and a faint inner glow. Text inputs match
   :focus-visible on click too, so they use html.kbd (set by docs.js on keyboard use).
   Overrides the shared theme's 3px sage ring. */
:focus { outline: none; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px; border-radius: 8px; }
button:focus-visible, .btn:focus-visible { outline: none; border-color: color-mix(in srgb, var(--text) 50%, transparent) !important; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }
input:focus, input:focus-visible { outline: none; }
html.kbd input:focus { border-color: color-mix(in srgb, var(--text) 50%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); }

/* ---------- shared header: Docs is the current page ---------- */
.nav-links a[aria-current="page"] { color: var(--primary-ink); background: var(--primary); }

/* ---------- docs bar: sleek search strip above the unified reading shell ---------- */
.docs-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 10px var(--gutter) 14px; background: transparent; }
.nav-toggle, .nav-close { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; min-width: 38px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--glass-stroke); background: var(--glass); color: var(--text-2); cursor: pointer; font-size: .88rem; white-space: nowrap; flex: none; backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.nav-toggle:hover, .nav-close:hover { color: var(--text); }
.nav-close { padding: 0; }
.nav-toggle, .nav-drawer-head { display: none; }

/* search */
.search { position: relative; flex: 0 1 320px; }
.search input { width: 100%; height: 38px; padding: 0 14px 0 36px; border-radius: 999px; border: 1px solid var(--glass-edge, var(--glass-stroke)); background: var(--sheet); color: var(--text); font: 400 .9rem var(--sans); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 6px 20px var(--glass-shadow); }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { display: none; }
.search-ic { position: absolute; z-index: 1; left: 12px; top: 10px; width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.search-panel { position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: min(520px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow: auto; padding: 6px; border-radius: 18px;
  background: var(--menu-bg); color: var(--ink); border: 1px solid var(--glass-edge, var(--glass-stroke)); box-shadow: 0 24px 60px -20px rgba(0,0,0,.45); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); }
.search-panel ul { list-style: none; margin: 0; padding: 0; }
.search-panel li a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.search-panel li a[aria-selected="true"], .search-panel li a:hover { background: var(--wash); outline: 1px solid var(--glass-stroke); }
.sr-where { display: block; font: 500 .7rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sr-title { display: block; font-weight: 500; margin-top: 2px; }
.sr-snip { display: block; color: var(--text-2); font-size: .86rem; line-height: 1.45; margin-top: 2px; }
.sr-snip mark { background: none; color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--rollout); text-underline-offset: 3px; }
.search-empty { margin: 0; padding: 12px; color: var(--text-2); font-size: .9rem; }

/* ---------- unified sleek frosted Aero reading shell (1 surface, crisp hairlines) ---------- */
.doc-shell {
  display: grid; grid-template-columns: 232px minmax(0, 1fr) 204px; gap: 0;
  max-width: var(--maxw); width: calc(100% - 2 * var(--gutter)); margin: 0 auto;
  border-radius: 26px; background: var(--sheet); border: 1px solid var(--glass-edge, var(--glass-stroke));
  box-shadow: 0 24px 70px var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5);
  font-size: 16px; line-height: 1.65;
}
.doc-shell.no-toc { grid-template-columns: 232px minmax(0, 1fr); }
.doc-nav, .doc-toc { position: sticky; top: 82px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; }
.doc-nav { border-right: 1px solid var(--hairline); background: transparent; }
.doc-nav-inner { --nav-inset: 12px; padding: 24px 12px 32px; background: transparent; border: 0; border-radius: 0; }
.doc-toc { padding: 26px 20px 28px 18px; border-left: 1px solid var(--hairline); background: transparent; border-radius: 0; }
.nav-group + .nav-group { margin-top: 20px; }
.nav-label { margin: 0 0 7px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); opacity: 0.8; }
.doc-nav ul, .doc-toc ul { list-style: none; margin: 0; padding: 0; }
.doc-nav .nav-label { padding-left: var(--nav-inset); }
.doc-nav li a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px var(--nav-inset); border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: .9rem; transition: background .14s, color .14s; }
.doc-nav li a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.doc-nav li a[aria-current="page"] { color: var(--text); font-weight: 500; background: color-mix(in srgb, var(--text) 9%, transparent); }
.doc-nav li a[aria-current="page"]::before { content: ""; position: absolute; left: 3px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--rollout); }
.nav-tag { font: 500 .62rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.doc-toc li a { display: block; padding: 4px 0 4px 12px; border-left: 1px solid var(--hairline); color: var(--text-3); text-decoration: none; font-size: .82rem; line-height: 1.4; transition: color .14s, border-color .14s; }
.doc-toc li.toc-3 a { padding-left: 22px; }
.doc-toc li a:hover { color: var(--text); }
.doc-toc li a.is-active { color: var(--text); border-left-color: var(--rollout); font-weight: 500; }
.nav-backdrop { display: none; }

/* ---------- article: clean frameless editorial column inside the unified shell ---------- */
.doc-main { min-width: 0; padding: 0; background: transparent; }
.doc-main:focus { outline: none; }
.doc-article { max-width: 74ch; margin: 0 auto; padding: clamp(28px, 3.6vw, 44px) clamp(24px, 4vw, 52px) 56px; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
h1.serif { margin: 10px 0 0; font-family: "SF Pro Display", var(--sans); font-weight: 300; font-size: clamp(2rem, 3.8vw, 2.85rem); line-height: 1.08; letter-spacing: -0.032em; color: var(--text); }
.lede { margin: 14px 0 0; font-size: clamp(1.02rem, 1.35vw, 1.15rem); line-height: 1.55; color: var(--text-2); }
.toc-inline { display: none; margin-top: 20px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--card); }
.toc-inline summary { cursor: pointer; padding: 9px 14px; font-size: .88rem; color: var(--text-2); }
.toc-inline ul { list-style: none; margin: 0; padding: 0 14px 12px; }
.toc-inline li a { display: block; padding: 4px 0; color: var(--text-2); text-decoration: none; font-size: .88rem; }
.toc-inline li.toc-3 a { padding-left: 14px; }

.prose { margin-top: 28px; color: var(--text-2); }
.prose > * + * { margin-top: 1em; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose p, .prose li { max-width: 68ch; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a { color: var(--text); text-decoration: underline; text-decoration-color: var(--edge); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--text); }
.prose h2, .prose h3, .prose h4 { position: relative; color: var(--text); }
.prose h2 { margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid var(--hairline); font: 500 clamp(1.32rem, 2vw, 1.58rem)/1.2 "SF Pro Display", var(--sans); letter-spacing: -0.024em; }
.prose > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 1.75em; font: 600 1.06rem/1.35 var(--sans); letter-spacing: -0.012em; }
.prose h4 { margin-top: 1.4em; font: 600 .95rem/1.4 var(--sans); }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .65em; }
.anchor { position: absolute; left: -1.1em; width: 1em; color: var(--text-3); text-decoration: none; opacity: 0; font-family: var(--mono); font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--text-3); }
.prose hr { border: 0; height: 1px; margin: 2.2em 0; background: var(--line); }
:root[data-theme="graphite"] .prose hr { height: 22px; background: url("_theme/assets/graphite_dark.png") center 70% / 100% auto; image-rendering: pixelated; }
.prose blockquote { margin-left: 0; padding-left: 16px; border-left: 2px solid var(--edge); }

/* inline code + code blocks */
.prose :not(pre) > code { font: 500 .85em var(--mono); padding: .12em .42em; border-radius: 6px; background: var(--wash); border: 1px solid var(--hairline); color: var(--text); overflow-wrap: anywhere; }
.code { margin-top: 1.2em; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--code-fg) 16%, transparent); background: var(--code-bg); overflow: hidden; }
.code-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid color-mix(in srgb, var(--code-fg) 12%, transparent); background: color-mix(in srgb, var(--code-fg) 4%, var(--code-bg)); }
.code-lang { font: 500 .68rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--code-muted); }
.copy { min-width: 58px; height: 26px; padding: 0 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--code-fg) 22%, transparent); background: color-mix(in srgb, var(--code-fg) 7%, transparent); color: var(--code-fg); font: 500 .76rem var(--sans); cursor: pointer; }
.copy:hover { background: color-mix(in srgb, var(--code-fg) 15%, transparent); }
.copy.is-done { color: var(--code-ok, var(--rollout)); border-color: var(--code-ok, var(--rollout)); }
.code pre { margin: 0; padding: 13px 16px 15px; overflow-x: auto; font: 400 .85rem/1.6 var(--mono); color: var(--code-fg); tab-size: 2; background: transparent; }
.code pre:focus-visible { outline-offset: -4px; }

/* tables */
.table-wrap { margin-top: 1.2em; overflow-x: auto; border: 1px solid var(--hairline); border-radius: 14px; background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--hairline); }
.prose th { font: 500 .68rem var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--text); }

/* status tags + callouts */
.tag { display: inline-block; vertical-align: 1px; padding: 1px 8px; border-radius: 999px; font: 500 .66rem/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; border: 1px solid var(--glass-stroke); color: var(--text-2); }
.tag-today { color: var(--rollout); border-color: color-mix(in srgb, var(--rollout) 55%, transparent); }
.tag-dev { color: var(--text); }
.tag-planned { color: var(--text-2); border-style: dashed; }
.tag-open { color: var(--triage); border-color: color-mix(in srgb, var(--triage) 55%, transparent); }
.callout { margin-top: 1.6em; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--card); }
.prose .callout + * { margin-top: 1.6em; }
.callout > p { margin: 0; max-width: 64ch; font: 400 .96rem/1.55 var(--sans); color: var(--ink-2); }
.callout > p + p { margin-top: .5em; }
.callout-lead { font: 600 .92rem/1 var(--sans); letter-spacing: 0; color: var(--ink); }

/* ---------- diagrams (real themed vector & structured diagrams, never ASCII text) ---------- */
.diagram-fig { margin: 1.4em 0 0; padding: 16px 18px 18px; border-radius: 16px; border: 1px solid var(--hairline); background: var(--card); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent); }
.prose .diagram-fig + * { margin-top: 1.4em; }
.diagram-eyebrow { margin: 0 0 12px; font-size: .68rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* rollout SVG diagram */
.diag-svg { display: block; width: 100%; height: auto; overflow: visible; }
.diag-tall { display: none; }
.diag-node { fill: var(--sheet); stroke: var(--edge); stroke-width: 1.25; }
.diag-node-dashed { stroke-dasharray: 4 3; stroke: color-mix(in srgb, var(--text-3) 65%, transparent); }
.diag-node-muted { fill: color-mix(in srgb, var(--text) 4%, var(--sheet)); stroke: var(--hairline); }
.diag-node-sage { fill: color-mix(in srgb, var(--rollout) 10%, var(--sheet)); stroke: color-mix(in srgb, var(--rollout) 50%, transparent); }
.diag-node-live { fill: color-mix(in srgb, var(--rollout) 16%, var(--sheet)); stroke: var(--rollout); stroke-width: 1.6; }
.diag-node-plum { fill: color-mix(in srgb, var(--triage) 12%, var(--sheet)); stroke: color-mix(in srgb, var(--triage) 58%, transparent); }
.diag-live-dot { fill: var(--rollout); }
.diag-title { font: 600 12.5px/1 var(--sans); fill: var(--text); }
.diag-title-plum { fill: var(--triage); }
.diag-sub { font: 400 10.5px/1 var(--sans); fill: var(--text-3); }
.diag-verb { font: 500 10px/1 var(--mono); letter-spacing: .01em; fill: var(--text-3); }
.diag-verb-sage { fill: var(--rollout); }
.diag-verb-plum { fill: var(--triage); }
.diag-edge { stroke-width: 1.6; }
.diag-edge-thin { stroke-width: 1.25; opacity: .7; }
.diag-edge-soft { opacity: .6; }
.diag-edge-dashed { stroke-dasharray: 4 4; }
.diag-edge-muted { stroke: color-mix(in srgb, var(--text-3) 70%, transparent); }
.diag-edge-sage { stroke: var(--rollout); }
.diag-edge-plum { stroke: var(--triage); }
.diag-arrow-fill-muted { fill: color-mix(in srgb, var(--text-3) 70%, transparent); }
.diag-arrow-fill-sage { fill: var(--rollout); }
.diag-arrow-fill-plum { fill: var(--triage); }
.diag-pill { fill: var(--sheet); stroke: var(--hairline); stroke-width: 1.15; }
.diag-pill-sage { fill: color-mix(in srgb, var(--rollout) 11%, var(--sheet)); stroke: color-mix(in srgb, var(--rollout) 48%, transparent); }
.diag-pill-plum { fill: color-mix(in srgb, var(--triage) 11%, var(--sheet)); stroke: color-mix(in srgb, var(--triage) 48%, transparent); }
.diag-pill-text { font: 500 10.5px/1 var(--mono); fill: var(--text-2); }

/* concept record-hierarchy diagram */
.diagram-tree ol { list-style: none; margin: 0; padding: 0; max-width: none; }
.diagram-tree li { margin: 0; max-width: none; }
.diagram-tree li + li { margin-top: 0; }
.dt-branch { position: relative; margin: 10px 0 0 18px !important; padding-left: 18px !important; }
.dt-branch > .dt-item { position: relative; }
.dt-branch > .dt-item + .dt-item { margin-top: 10px; }
/* Clean curved L-elbow from parent into each child; stops immediately at last child with no dangling tail */
.dt-branch > .dt-item::before {
  content: ""; position: absolute; left: -18px; top: -10px; width: 18px; height: 34px;
  border-left: 1.5px solid color-mix(in srgb, var(--text-3) 38%, transparent);
  border-bottom: 1.5px solid color-mix(in srgb, var(--text-3) 38%, transparent);
  border-bottom-left-radius: 9px; pointer-events: none;
}
/* Continuing rail only when another sibling follows below */
.dt-branch > .dt-item:not(:last-child)::after {
  content: ""; position: absolute; left: -18px; top: 15px; bottom: 0; width: 1.5px;
  background: color-mix(in srgb, var(--text-3) 38%, transparent); pointer-events: none;
}
.prose .dt-card { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--hairline); background: var(--sheet); text-decoration: none; transition: border-color .14s, background .14s, transform .14s; }
.prose .dt-card:hover { border-color: var(--edge); background: color-mix(in srgb, var(--text) 4%, var(--sheet)); text-decoration: none; }
.dt-card-accent { border-color: color-mix(in srgb, var(--accent) 46%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--sheet)); }
.dt-card-sage { border-color: color-mix(in srgb, var(--rollout) 42%, transparent); background: color-mix(in srgb, var(--rollout) 7%, var(--sheet)); }
.dt-card-plum { border-color: color-mix(in srgb, var(--triage) 46%, transparent); background: color-mix(in srgb, var(--triage) 8%, var(--sheet)); }
.dt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dt-idx { font-size: .68rem; font-weight: 500; letter-spacing: .08em; color: var(--text-3); }
.dt-head strong { font: 600 .94rem/1.25 var(--sans); color: var(--text); }
.dt-card-plum .dt-head strong { color: var(--triage); }
.dt-badge { padding: 1px 8px; border-radius: 999px; font-size: .65rem; font-weight: 500; letter-spacing: .04em; color: var(--text-2); border: 1px solid var(--hairline); background: var(--card); }
.dt-badge-sage { color: var(--rollout); border-color: color-mix(in srgb, var(--rollout) 42%, transparent); }
.dt-desc { font-size: .84rem; line-height: 1.45; color: var(--text-2); }

@media (max-width: 640px) {
  .diagram-fig { padding: 14px 12px 14px; }
  .diag-wide { display: none; }
  .diag-tall { display: block; max-width: 360px; margin: 0 auto; }
  .dt-branch { margin-left: 10px !important; padding-left: 14px !important; }
  .dt-branch > .dt-item::before { left: -14px; width: 14px; }
  .dt-branch > .dt-item:not(:last-child)::after { left: -14px; }
}

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--hairline); }
.pager-link { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--hairline); background: var(--card); text-decoration: none; transition: border-color .15s, background .15s; }
.pager-link:hover { border-color: var(--edge); background: var(--wash); }
.pager-link span { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.pager-link strong { font-weight: 500; font-size: .96rem; }
.pager-link.next { text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .doc-shell, .doc-shell.no-toc { grid-template-columns: 220px minmax(0, 1fr); }
  .doc-toc { display: none; }
  .toc-inline { display: block; }
  .no-toc .toc-inline { display: none; }
}
@media (max-width: 860px) {
  .docs-bar { padding-top: 4px; padding-bottom: 12px; }
  .nav-toggle { display: inline-flex; }
  .search { flex: 1 1 auto; }
  .search-panel { left: auto; right: 0; }
  .doc-shell, .doc-shell.no-toc { display: block; width: calc(100% - 24px); border-radius: 22px; }
  .doc-nav { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; align-self: stretch; padding: 0; background: var(--menu-bg);
    border-right: 1px solid var(--glass-edge, var(--glass-stroke)); transform: translateX(-102%); visibility: hidden; transition: transform .25s cubic-bezier(.3,.7,.3,1), visibility 0s linear .25s; }
  .doc-nav-inner { padding: 16px 18px 40px; }
  .nav-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-left: var(--nav-inset); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
  .nav-drawer-head .nav-close { display: inline-grid; }
  body.nav-open .doc-nav { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.3,.7,.3,1); }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 9, 8, .5); }
  body.nav-open { overflow: hidden; }
  .doc-nav li a { padding-top: 10px; padding-bottom: 10px; }
  .doc-nav li a[aria-current="page"]::before { top: 12px; bottom: 12px; }
  .doc-article { padding: 24px 20px 40px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .doc-article { padding: 20px 16px 36px; }
  .code pre { font-size: .7rem; padding-left: 14px; padding-right: 14px; }
}
/* ---------- bottom-right frosted glass music player widget (hidden by default; reveals on bottom-right hover) ---------- */
.music-pill {
  position: fixed; z-index: 40;
  right: 20px; bottom: max(20px, env(safe-area-inset-bottom, 0px));
  height: 56px; padding: 6px 14px 6px 7px; border-radius: 28px;
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--glass-edge, var(--glass-stroke)); background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.45); backdrop-filter: blur(22px) saturate(1.45);
  box-shadow: 0 20px 50px -20px var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,.22);
  opacity: 0; transform: translate3d(0, 14px, 0) scale(0.97); pointer-events: none;
  transition: opacity .24s ease, transform .26s cubic-bezier(.22, 1, .36, 1), border-color .2s ease;
}
.music-pill.revealed,
.music-pill.nudge,
.music-pill:hover,
.music-pill:focus-within {
  opacity: 1; transform: translate3d(0, 0, 0) scale(1); pointer-events: auto;
}
.music-pill[data-playing="true"] { border-color: color-mix(in srgb, var(--sage) 55%, var(--glass-stroke)); }
.music-toggle {
  width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transition: transform .15s ease, background .2s ease;
}
.music-toggle:hover { transform: scale(1.05); }
.music-toggle:active { transform: scale(0.95); }
.music-toggle svg { width: 18px; height: 18px; display: block; }
.music-toggle .ic-pause { display: none; }
.music-pill[data-playing="true"] .music-toggle { background: var(--sage); color: #fff; }
:root[data-theme="night"] .music-pill[data-playing="true"] .music-toggle,
:root[data-theme="graphite"] .music-pill[data-playing="true"] .music-toggle { color: #0a1b10; }
.music-pill[data-playing="true"] .music-toggle .ic-play { display: none; }
.music-pill[data-playing="true"] .music-toggle .ic-pause { display: block; }
.music-meta { display: flex; flex-direction: column; gap: 5px; min-width: 162px; }
.music-top { display: flex; align-items: center; gap: 6px; font-size: 12.5px; line-height: 1; }
.music-title { font-weight: 600; color: var(--ink); white-space: nowrap; text-decoration: none; }
.music-title:hover { text-decoration: underline; text-underline-offset: 2px; }
.music-artist { font-weight: 500; color: var(--ink-soft); }
.music-time { margin-left: auto; font: 600 11px var(--mono); color: var(--ink-soft); white-space: nowrap; }
.music-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 11px; width: 11px; flex: none; }
.music-eq i { width: 2.5px; height: 4px; border-radius: 2px; background: var(--ink-soft); opacity: 0.55; transition: background .2s, opacity .2s; }
.music-eq i:nth-child(2) { height: 8px; }
.music-eq i:nth-child(3) { height: 5px; }
@keyframes music-eq { 0% { transform: scaleY(0.35); } 100% { transform: scaleY(1); } }
.music-pill[data-playing="true"] .music-eq i { background: var(--sage); opacity: 1; transform-origin: bottom; animation: music-eq 0.72s ease-in-out infinite alternate; }
.music-pill[data-playing="true"] .music-eq i:nth-child(2) { height: 11px; animation-delay: 0.16s; }
.music-pill[data-playing="true"] .music-eq i:nth-child(3) { height: 7px; animation-delay: 0.34s; }
.music-scrub { position: relative; height: 10px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.music-rail { width: 100%; height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.music-fill { height: 100%; width: 0%; border-radius: 999px; background: var(--sage); transition: width 0.12s linear; }
@keyframes music-nudge {
  0%, 100% { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16), 0 0 0 0 color-mix(in srgb, var(--sage) 55%, transparent); }
  50% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 7px transparent; }
}
.music-pill.nudge .music-toggle { animation: music-nudge 1.05s ease-in-out infinite; }
@media (max-width: 720px) {
  .music-pill { right: 12px; bottom: max(12px, env(safe-area-inset-bottom, 0px)); height: 46px; padding: 5px 12px 5px 5px; max-width: calc(100vw - 24px); }
  .music-toggle { width: 34px; height: 34px; }
  .music-toggle svg { width: 15px; height: 15px; }
  .music-meta { min-width: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  .tag, .code, .pager-link, .diagram-fig, .dt-card { border: 1px solid CanvasText; }
}
