/* Herdr-style workspace: a full-height window of panes that scroll on their
   own. Neutral chrome; colour only for status and syntax. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono/JetBrainsMono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #141414;
  --side: #101010;
  --raise: #1c1c1c;
  --hover: #242424;
  --line: #232323;
  --line2: #303030;
  --pane-line: #282828;
  --purple: hsl(280 85% 71%);
  --cyan: #3fd8ff;
  --wire: #4f4f4f;
  --edge: #858585;
  --ink: #e8e6e3;
  --dim: #c9c6c1;
  --faint: #9d9a95;
  --idle: #6e6b66;
  --green: #7ee2a8;
  --amber: #e5b454;
  --blue: #6cb6ff;
  --oac: #ffc429;
  --oac-red: #e51937;
  --guap: #d4d7dc;
  --loomantix: #39a5d2;
  --accent: var(--green);
  --accent-2: var(--accent);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --explorer: 240px;
  --bar: 46px;
  --status: 32px;
  font-family: var(--mono);
  font-size: 15px;
}
.brand-oac { --accent: var(--oac); --accent-2: var(--oac-red); }
.brand-guap { --accent: var(--guap); --accent-2: var(--guap); }
.brand-loomantix { --accent: var(--loomantix); --accent-2: var(--loomantix); }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; font-variant-ligatures: none;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 700; line-height: 1.3; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }
img, svg { vertical-align: middle; }
[hidden] { display: none !important; }
::selection { background: #2b4a3a; color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.scroll:focus-visible { outline-offset: -2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 12px; z-index: 50; background: var(--ink); color: var(--bg); padding: 6px 12px; }
.skip-link:focus { top: 8px; }
.faint { color: var(--faint); }
.meta { margin-left: auto; padding-left: 12px; color: var(--faint); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: inherit; font-size: 0.8125rem; color: var(--faint); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-2); }
.upcoming .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }

/* Window */
.app {
  display: grid; height: 100vh;
  grid-template-columns: var(--explorer) minmax(0, 1fr);
  grid-template-rows: var(--bar) minmax(0, 1fr) minmax(var(--status), auto);
  grid-template-areas: "explorer top" "explorer main" "status status";
}
.topbar {
  grid-area: top; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 0 12px; border-bottom: 1px solid var(--line);
}
.tab-chip {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 3px 12px; border-radius: 6px; font-size: 0.875rem; font-weight: 700;
  background: var(--raise); border: 1px solid var(--line2);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search-trigger, .text-button { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 6px; color: var(--faint); font-size: 0.875rem; }
.search-trigger:hover, .text-button:hover { color: var(--ink); background: var(--raise); }
.icon { display: block; }
.text-button { text-transform: lowercase; }

.explorer {
  grid-area: explorer; min-height: 0; overflow-y: auto;
  background: var(--side); border-right: 1px solid var(--line);
  padding: 0 8px 12px;
}
.root { height: var(--bar); display: flex; align-items: center; padding: 0 10px; font-weight: 800; }
.tree a, .tree .item {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 3px 10px; border-radius: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--dim); white-space: nowrap;
}
.tree a:hover { background: var(--hover); color: var(--ink); }
.tree a[aria-current="page"] { background: var(--purple); color: #000; font-weight: 800; }
.tree a[aria-current="page"]::before, .tree a[aria-current="page"] .fi { color: #1a0a2a; }
.tree a::before, .tree .item::before { content: "├" / ""; color: var(--idle); font-weight: 400; margin-right: 2px; }
.tree > li:last-child > a::before, .tree > li:last-child > .item::before { content: "└" / ""; }
.tree .tree a::before, .tree .tree .item::before { content: "  ├" / ""; white-space: pre; }
.tree .tree > li:last-child > a::before, .tree .tree > li:last-child > .item::before { content: "  └" / ""; }
.tree .upcoming .item { color: var(--faint); }
.tree .meta { display: none; }
.fi { display: inline-grid; place-items: center; width: 16px; flex-shrink: 0; color: var(--faint); }
.fi-readme { color: var(--blue); }
.fi-md { color: #8fa9c9; }
.fi-toml { color: var(--amber); }
.fi-dir { color: #c9a35c; }
.fi-github { color: var(--ink); }
.fi-linkedin { color: #4f95e0; }
.tab-chip .icon { color: var(--faint); }

main { grid-area: main; min-width: 0; min-height: 0; padding: 10px; outline: none; }

.statusline {
  grid-area: status; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 6px; background: var(--side); border-top: 1px solid var(--line);
  font-size: 0.8125rem; font-weight: 600; color: var(--faint); white-space: nowrap;
}
.status-left, .status-right { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.status-left { overflow: visible; flex-wrap: wrap; max-width: 100%; }
.contact-links { display: flex; align-items: center; flex-wrap: wrap; max-width: 100%; }
.contact-links a { min-height: 24px; color: var(--dim); }
.contact-links a:hover { background: var(--hover); color: var(--ink); }
.contact-links a:focus { outline: none; }
.contact-links a:focus-visible { outline: 2px solid var(--edge); outline-offset: -2px; }
.seg { display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; min-height: 22px; border-radius: 4px; }
.seg + .seg { box-shadow: -1px 0 0 var(--line); }
.seg-pos { color: var(--dim); min-width: 5ch; justify-content: center; font-variant-numeric: tabular-nums; }
.seg-keys kbd { color: var(--dim); border: 1px solid var(--line2); border-radius: 3px; padding: 0 5px; font-size: 0.75rem; }
.motion-toggle { color: var(--faint); font-size: inherit; }
.motion-toggle:hover { color: var(--ink); background: var(--hover); }
.motion-toggle .icon { color: var(--green); }
.motion-toggle[aria-pressed="true"] .i-pause, .motion-toggle[aria-pressed="false"] .i-play { display: none; }
.motion-toggle[aria-pressed="true"] .icon { color: var(--amber); }

/* Pane */
.pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--pane-line); border-radius: 8px; background: var(--bg); overflow: hidden; }
.pane.is-active { border-color: #6e6e6e; }
.fill { height: 100%; }
.pane-head {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0;
  padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 0.875rem; font-weight: 600;
}
.pane-name { font-size: inherit; font-weight: 800; white-space: nowrap; }
.pane-path { color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-meta { margin-left: auto; color: var(--faint); white-space: nowrap; }
.pane-body { padding: 22px 26px; min-height: 0; }
.pane-body.flush { padding: 0; }
.scroll { flex: 1; overflow: auto; scroll-padding-top: 16px; outline: none; }
.scroll, .explorer, #search-results { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.scroll::-webkit-scrollbar, .explorer::-webkit-scrollbar, #search-results::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll::-webkit-scrollbar-thumb, .explorer::-webkit-scrollbar-thumb, #search-results::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-thumb:hover { background-color: var(--wire); }
.scroll::-webkit-scrollbar-track, .scroll::-webkit-scrollbar-corner { background: transparent; }
.text-link { color: var(--blue); }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.dash-list { margin: 12px 0 14px; }
.dash-list li { position: relative; padding-left: 1.4em; color: var(--dim); margin: 6px 0; }
.dash-list li::before { content: "-" / ""; position: absolute; left: 0; color: var(--idle); }

/* Home: README on the left, the two systems stacked on the right. */
.home { height: 100%; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); }
.home-col { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.home-col > .work-pane { flex: 1 1 0; }
.home-col > .work-pane.is-pending { flex: 0.7 1 0; min-height: 96px; }
.head-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 5px; border: 1px solid var(--line2); background: var(--raise); color: var(--dim); font-size: 0.8125rem; white-space: nowrap; }
a.head-link:hover { color: var(--ink); border-color: var(--edge); }
.head-link .icon { color: #8fa9c9; }
.head-link.is-muted { color: var(--faint); background: none; border-style: dashed; }
.work-pane .pane-head .pane-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* One-row diagram header: name, a dim subtitle, then the report link on the right. */
.work-pane .pane-head { container-type: inline-size; }
.work-pane .pane-head .pane-path::before { content: "// " / ""; color: var(--idle); }
/* Hide the subtitle only where it can't fit beside the name and link. */
@container (max-width: 440px) { .brand-guap .pane-head .pane-path { display: none; } }
@container (max-width: 530px) { .brand-loomantix .pane-head .pane-path { display: none; } }
@container (max-width: 470px) { .brand-oac .pane-head .pane-path { display: none; } }
.work-pane { border-color: color-mix(in srgb, var(--accent) 30%, var(--pane-line)); box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 10%, transparent); }
.work-pane.is-pending { border-color: var(--pane-line); box-shadow: none; }
.pending { display: grid; place-items: center; color: var(--faint); font-size: 0.875rem; }
.pending .prompt { margin-right: 6px; }
.cursor { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 4px; vertical-align: -0.2em; background: var(--loomantix); opacity: 0.7; }
.has-js .cursor { animation: blink 1.1s steps(1) infinite; }
.animation-paused .cursor { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.readme { flex: 1; }
.readme .pane-body { padding: 30px 32px; }
.hero { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 2.125rem; letter-spacing: -0.035em; line-height: 1.15; }
.tagline { color: var(--dim); font-size: 1.0625rem; margin-top: 6px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.stack-groups > div { display: grid; grid-template-columns: 11ch minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.stack-groups > div:last-child { border-bottom: 0; }
.stack-groups dt { color: var(--cyan); font-size: 0.8125rem; font-weight: 700; }
.stack-groups dd { margin: 0; }
.badges { gap: 6px 20px; }
.badges li { display: inline-flex; align-items: center; gap: 7px; font-size: 0.875rem; font-weight: 500; color: var(--dim); }
.badges .icon { color: color-mix(in srgb, var(--b) 70%, #ffffff); }
.md-h2 { font-size: 1rem; margin: 26px 0 12px; }
.md-h2::before { content: "## " / ""; color: var(--green); }
.work-list li {
  display: grid; align-items: baseline; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
  grid-template-columns: 8px max-content minmax(0, 1fr) max-content; font-size: 0.875rem;
}
.work-list li:first-child { border-top: 1px solid var(--line); }
.work-list strong { color: var(--ink); }
.work-list .role { color: var(--dim); min-width: 0; }
.work-list .term { color: var(--faint); white-space: nowrap; }
.work-list .signal { grid-column: 2 / -1; color: var(--faint); font-size: 0.8125rem; }
.work-list b { color: var(--accent); font-weight: 700; }
.work-list .upcoming strong, .work-list .upcoming .role { color: var(--faint); }
.state { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); white-space: nowrap; }
.sdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 16%, transparent); }
.state.is-published, .state.is-complete { --c: var(--green); }
.state.is-partial { --c: var(--amber); }
.state.is-upcoming { --c: var(--loomantix); }
.state.is-upcoming .sdot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.work-pane .pane-head { font-size: 0.875rem; }
.work-pane .pane-body { flex: 1; position: relative; padding: 0; }
.work-pane .flow-canvas { position: absolute; inset: 12px 16px; }

/* Keep the entire overview expanded, with space between its reading groups. */
.home, .home-col { gap: 12px; }
.home { height: auto; min-height: 100%; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
main:has(.home) { overflow-y: auto; }
.home-col { min-height: auto; }
.readme .scroll { flex: none; overflow: visible; }
.readme .pane-body { padding: 8px 20px; line-height: 1.5; }
.readme .hero { padding-bottom: 12px; }
.readme .md-h2 { margin: 32px 0 8px; }
.readme { --section-gap: 48px; }
.readme .work-list + .md-h2, .readme .stack-groups + .md-h2 { margin-top: var(--section-gap); }
.readme .work-list li { padding: 8px 0; row-gap: 2px; }
.readme .stack-groups > div { padding: 5px 0; grid-template-columns: 10ch minmax(0, 1fr); gap: 8px; }
.readme .badges { gap: 4px 10px; }
.readme .badges li { gap: 6px; }
.education-summary p { margin: 2px 0 0; }
.education-school { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; }
.education-dates { color: var(--faint); font-weight: 700; }
.readme .work-list li, .readme .badges li { font-size: 1rem; }
.readme .work-list .signal, .readme .stack-groups dt { font-size: .875rem; }
.home .dg-t { font-size: 15.5px; }
.home .dg-m { font-size: 13px; }
.home .dg-el { font-size: 12px; }


/* Diagrams: one system for home and reports.
   Stages fire in data-flow order; each node lights as data arrives. */
.flow-canvas { min-height: 0; display: grid; place-items: center; }
.flow-canvas .dg { width: 100%; height: 100%; }
.dg { display: block; width: 100%; height: auto; overflow: visible; --step: 1.1s; --period: calc(var(--step) * 4); }
.dg[data-steps="6"] { --step: 1s; --period: calc(var(--step) * 6); }
.dg text { font-family: var(--mono); }
.dg-shape { fill: var(--raise); stroke: var(--line2); stroke-width: 1; }
.is-core > .dg-shape { stroke: color-mix(in srgb, var(--accent) 45%, var(--line2)); }
.is-store > .dg-shape { fill: #2a2a2a; }
.is-hw > .dg-shape { fill: transparent; stroke-dasharray: 4 3; }
.is-group > .dg-shape { fill: color-mix(in srgb, var(--raise) 45%, transparent); }
.dg-junction { fill: var(--wire); stroke: none; }
.dg-t { fill: var(--ink); font-size: 13px; font-weight: 600; }
.dg-m { fill: var(--faint); font-size: 11.5px; }
.dg-li { fill: var(--dim); font-size: 12px; }
.dg-k { fill: var(--faint); font-size: 11px; letter-spacing: 0.06em; }
.dg-pill { fill: var(--faint); font-size: 11px; }
.dg-ic { stroke: var(--faint); }
.dg-ic.is-brand { fill: var(--dim); stroke: none; }
.dg-ic.c-accent { stroke: var(--accent); }
.dg-ic.c-ok { stroke: var(--green); }
.dg-ic.c-python { fill: #5a9fd4; }
.dg-ic.c-postgres { fill: #7a9be6; }
.dg-ic.c-ts { fill: #5b9be0; }
.dg-ic.c-jest { fill: #e35d71; }
.dg-ic.c-actions { fill: #5aa7ff; }
.dg-wire { fill: none; stroke: var(--wire); stroke-width: 1.25; stroke-linejoin: round; }
.is-dashed > .dg-wire { stroke-dasharray: 3 4; }
.dg-ah { fill: none; stroke: var(--wire); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.dg-el { fill: var(--faint); font-size: 11px; paint-order: stroke; stroke: var(--bg); stroke-width: 6px; stroke-linejoin: round; }
.dg-trail { fill: none; stroke: var(--accent); stroke-width: 1.75; stroke-linecap: round; stroke-dasharray: 0.22 2; stroke-dashoffset: 0.22; opacity: 0; }
.dg-pkt { fill: var(--accent); opacity: 0; offset-rotate: 0deg; filter: drop-shadow(0 0 4px var(--accent)); }
.has-js .dg-trail { animation: dg-trail-4 var(--period) infinite; animation-delay: calc(var(--s) * var(--step)); }
.has-js .dg-pkt { animation: dg-pkt-4 var(--period) infinite; animation-delay: calc(var(--s) * var(--step)); }
.has-js .hit > .dg-shape { animation: dg-hit-4 var(--period) infinite backwards; animation-delay: calc(var(--h) * var(--step)); }
.has-js .dg[data-steps="6"] .dg-trail { animation-name: dg-trail-6; }
.has-js .dg[data-steps="6"] .dg-pkt { animation-name: dg-pkt-6; }
.has-js .dg[data-steps="6"] .hit > .dg-shape { animation-name: dg-hit-6; }
.animation-paused .dg *, .dg.animation-offscreen * { animation-play-state: paused !important; }
@keyframes dg-trail-4 {
  0% { stroke-dashoffset: 0.22; opacity: 0; animation-timing-function: cubic-bezier(0.6, 0, 0.25, 1); }
  1.5% { opacity: 1; }
  25% { stroke-dashoffset: -0.78; opacity: 1; }
  32%, 100% { stroke-dashoffset: -0.78; opacity: 0; }
}
@keyframes dg-pkt-4 {
  0% { offset-distance: 0%; opacity: 0; animation-timing-function: cubic-bezier(0.6, 0, 0.25, 1); }
  1.5% { opacity: 1; }
  25% { offset-distance: 100%; opacity: 1; }
  28%, 100% { offset-distance: 100%; opacity: 0; }
}
@keyframes dg-hit-4 {
  0%, 100% { stroke: var(--line2); filter: none; }
  2% { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
  14% { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
  40% { stroke: var(--line2); filter: none; }
}
@keyframes dg-trail-6 {
  0% { stroke-dashoffset: 0.22; opacity: 0; animation-timing-function: cubic-bezier(0.6, 0, 0.25, 1); }
  1% { opacity: 1; }
  16.6% { stroke-dashoffset: -0.78; opacity: 1; }
  22%, 100% { stroke-dashoffset: -0.78; opacity: 0; }
}
@keyframes dg-pkt-6 {
  0% { offset-distance: 0%; opacity: 0; animation-timing-function: cubic-bezier(0.6, 0, 0.25, 1); }
  1% { opacity: 1; }
  16.6% { offset-distance: 100%; opacity: 1; }
  19%, 100% { offset-distance: 100%; opacity: 0; }
}
@keyframes dg-hit-6 {
  0%, 100% { stroke: var(--line2); filter: none; }
  1.5% { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
  10% { stroke: var(--accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 45%, transparent)); }
  28% { stroke: var(--line2); filter: none; }
}
/* Hover a node to trace everything upstream and downstream of it. */
.dg-n, .dg-e { transition: opacity 180ms ease; }
.dg.is-focus .dg-n:not(.is-lit), .dg.is-focus .dg-e:not(.is-lit) { opacity: 0.22; }
.dg.is-focus .dg-n.is-lit > .dg-shape { stroke: var(--edge); }
.dg.is-focus .dg-e.is-lit .dg-wire { stroke: var(--edge); }
.dg-figure .diagram-scroll { border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); padding: 20px; }
.dg-figure .dg { min-width: 640px; }

/* experience.md */
.md h1 { font-size: 1.5rem; margin-bottom: 8px; }
.md h1::before { content: "# " / ""; color: var(--green); }
.entry { max-width: 84ch; padding: 22px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry h2 { font-size: 1.125rem; display: flex; align-items: center; gap: 10px; }
.entry > .faint { margin-top: 4px; }

/* toml files: an editor gutter that runs the full pane height. */
.code {
  counter-reset: ln; padding: 14px 24px 20px 0; font-size: 1rem;
  background: linear-gradient(to right, var(--side) 4em, var(--line) 4em, var(--line) calc(4em + 1px), transparent calc(4em + 1px));
}
.code .line { counter-increment: ln; display: grid; grid-template-columns: 4em minmax(0, 1fr); column-gap: 1.25em; line-height: 2; font-size: inherit; font-weight: 400; }
.code .line::before { content: counter(ln) / ""; color: var(--idle); text-align: right; padding-right: 0.9em; }
.toml .line { grid-template-columns: 4em max-content minmax(0, 1fr); column-gap: 0; }
.toml dt { color: var(--blue); padding-left: 1.25em; }
.toml dt::after { content: " = " / ""; color: var(--faint); white-space: pre; }
.t-table { color: var(--amber); }
.t-str { color: var(--green); }
.t-str::before, .t-str::after { content: "\"" / ""; }
.t-array::before { content: "[" / ""; color: var(--faint); }
.t-array::after { content: "]" / ""; color: var(--faint); }
.t-array, .t-array li { display: inline; }
.t-array li:not(:last-child)::after { content: "\", " / ""; }

/* reports/ */
.ls { width: 100%; border-collapse: collapse; }
.ls th { text-align: left; font-weight: 400; color: var(--faint); font-size: 0.8125rem; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--side); position: sticky; top: 0; }
.ls td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--dim); vertical-align: top; }
.ls td:first-child { white-space: nowrap; }
.ls td:first-child a, .ls td:first-child { color: var(--ink); font-weight: 700; }
.ls td:first-child a { display: inline-flex; align-items: center; gap: 10px; }
.ls td:first-child > .dot { margin-right: 10px; }
.ls .num { text-align: right; }
.ls th, .ls .num, .ls td:nth-child(3) { white-space: nowrap; }
.ls tbody tr:not(.upcoming):hover td { background: var(--raise); }
.ls .upcoming td, .ls .upcoming td:first-child { color: var(--faint); font-weight: 400; }

/* Report */
.report-layout { height: 100%; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) 260px; }
.report-main .pane-body { padding: 16px clamp(20px, 4vw, 56px) 48px; }
.report-header { max-width: 80ch; padding-bottom: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.report-header h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
.report-header .faint { margin-top: 8px; }
.report-header .badges { margin-top: 14px; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.file-link { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line2); background: var(--raise); color: var(--dim); font-size: 0.8125rem; }
.file-link .icon { color: #8fa9c9; }
.file-link:hover { color: var(--ink); border-color: var(--edge); }
.prose h4 { font-size: 0.8125rem; font-weight: 500; color: var(--faint); letter-spacing: 0.04em; margin: 22px 0 -8px; }
.goal-meter { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 14px 0 4px; padding: 10px 14px; border: 1px solid var(--line2); border-radius: 6px; background: var(--side); font-size: 0.8125rem; }
.goal-n { color: var(--faint); }
.goal-bar { --c: var(--green); flex: 1; min-width: 120px; max-width: 280px; height: 10px;
  background: linear-gradient(to right, var(--c) calc(var(--p) * 1%), var(--line2) 0);
  -webkit-mask: repeating-linear-gradient(to right, #000 0 calc(5% - 2px), transparent 0 5%);
  mask: repeating-linear-gradient(to right, #000 0 calc(5% - 2px), transparent 0 5%); }
.goal-pct { color: var(--ink); font-weight: 700; min-width: 4ch; }
.is-partial .goal-bar { --c: var(--amber); }

.report-context .pane-body { padding: 10px 8px; }
.contents-list a { display: block; padding: 4px 10px; border-radius: 6px; color: var(--faint); font-size: 0.9375rem; }
.contents-list a:hover { color: var(--ink); background: var(--raise); }
.contents-list a[aria-current] { color: var(--ink); background: var(--hover); }
.mobile-contents { display: none; margin: 16px 0 4px; }
.mobile-contents summary { cursor: pointer; color: var(--faint); }
.mobile-contents nav { margin-top: 8px; }

.prose { font-size: 1rem; line-height: 1.75; max-width: 80ch; color: var(--dim); }
.prose p, .prose ul, .prose ol { margin: 16px 0; }
.prose ul { list-style: disc; padding-left: 1.4em; }
.prose ol { list-style: decimal; padding-left: 1.6em; }
.prose li { margin: 6px 0; }
.prose h2, .prose h3 { color: var(--ink); }
.prose h2 { font-size: 1.25rem; margin: 52px 0 14px; }
.report-main .prose > h2:first-child { margin-top: 24px; }
.prose h3 { font-size: 1.0625rem; margin: 34px 0 10px; }
.prose h2::before { content: "## " / ""; color: var(--green); }
.prose h3::before { content: "### " / ""; color: var(--idle); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; overflow-wrap: anywhere; }
.prose code { font-family: var(--mono); font-size: 0.9em; }
.prose :not(pre) > code { background: var(--raise); padding: 1px 5px; border-radius: 3px; }
.prose pre {
  margin: 22px 0; padding: 16px 18px; max-width: 100%; overflow: auto;
  font: 0.9rem/1.7 var(--mono) !important; tab-size: 4;
  background: var(--side) !important; border: 1px solid var(--line2); border-radius: 6px;
}
.prose pre code { font-size: inherit; }
.code-head {
  display: flex; align-items: center; gap: 10px; margin: 22px 0 0; padding: 9px 16px;
  background: var(--raise); border: 1px solid var(--line2); border-bottom-color: var(--line); border-radius: 6px 6px 0 0;
  font-size: 0.8125rem;
}
.code-head .icon { color: #5a9fd4; }
.code-file { color: var(--ink); font-weight: 600; }
.code-title { margin-left: auto; color: var(--faint); text-transform: lowercase; text-align: right; }
.code-head + pre { margin-top: 0 !important; border-top: 0; border-radius: 0 0 6px 6px; }
.giallo-l { display: inline-block; min-height: 1lh; width: 100%; }
.giallo span[style*="#6a737d"] { color: #9aa1a9 !important; }
.prose table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 0.9375rem; border: 1px solid var(--line2); }
.prose th, .prose td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; vertical-align: top; }
.prose th { color: var(--faint); font-weight: 400; background: var(--side); }
.prose td:first-child { color: var(--ink); white-space: nowrap; width: 1%; }
.prose tr:last-child td { border-bottom: 0; }
.report-figure { margin: 28px 0; }
.report-figure a { display: block; }
.report-figure img { display: block; margin: 0; width: 100%; height: auto; border: 1px solid var(--line2); border-radius: 6px; background: var(--side); }
.report-figure figcaption { font-size: 0.875rem; color: var(--faint); margin-top: 10px; line-height: 1.65; }
.report-figure figcaption::before { content: "// " / ""; color: var(--idle); }
.diagram-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line2); border-radius: 6px; }
.report-diagram img { min-width: 620px; max-height: none; width: 100%; border: 0; border-radius: 0; }

.focus-reading .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--bar) minmax(0, 1fr) minmax(var(--status), auto); grid-template-areas: "top" "main" "status"; }
.focus-reading .explorer, .focus-reading .report-context { display: none; }
.focus-reading .report-layout { grid-template-columns: minmax(0, 1fr); }
.focus-reading .report-main { border-color: transparent; background: none; }
.focus-reading .report-main > .pane-head { display: none; }
.focus-reading .report-main .pane-body { padding-top: 24px; }
.focus-reading .report-header, .focus-reading .prose, .focus-reading .mobile-contents { margin-inline: auto; max-width: 48rem; }
.focus-reading .prose { font-size: 1.0625rem; line-height: 1.8; }

/* Search: a command palette. */
dialog {
  width: min(680px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 80px));
  margin: 14vh auto auto; padding: 0; overflow: hidden;
  background: var(--side); color: var(--ink); border: 1px solid var(--edge); border-radius: 10px;
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.55);
}
dialog[open] { display: flex; flex-direction: column; animation: palette-in 140ms cubic-bezier(0.2, 0, 0, 1); }
@keyframes palette-in { from { opacity: 0; transform: translateY(-6px) scale(0.99); } }
dialog::backdrop { background: rgb(5 5 6 / 0.66); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-size: 1rem; color: var(--ink); }
.palette-input input::placeholder { color: var(--idle); }
.palette-input input::-webkit-search-cancel-button { display: none; }
.prompt { color: var(--green); font-weight: 700; }
.key, .dialog-keys kbd {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px;
  border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; background: var(--raise);
  color: var(--dim); font: inherit; font-size: 0.6875rem; line-height: 1;
}
.key:hover { color: var(--ink); border-color: var(--edge); }
.search-status { color: var(--faint); font-size: 0.75rem; padding: 12px 18px 6px; letter-spacing: 0.04em; }
#search-results { overflow-y: auto; min-height: 0; padding: 0 8px 8px; }
.search-result { position: relative; display: block; padding: 8px 12px 8px 14px; border-radius: 6px; }
.search-result:hover, .search-result:focus-visible { background: var(--hover); outline: none; }
.search-result:focus-visible { box-shadow: inset 2px 0 0 var(--green); }
.search-result:focus-visible::after { content: "↵" / ""; position: absolute; right: 12px; top: 8px; color: var(--green); }
.result-head { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.result-head strong { font-weight: 600; color: var(--ink); white-space: nowrap; }
.result-title { color: var(--faint); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-type { margin-left: auto; font-size: 0.6875rem; color: var(--faint); border: 1px solid var(--line2); border-radius: 3px; padding: 0 5px; }
.search-result:focus-visible .result-type { visibility: hidden; }
.result-type.t-md { color: #8fa9c9; }
.result-type.t-toml { color: var(--amber); }
.result-type.t-dir { color: #c9a35c; }
.search-result p { color: var(--faint); font-size: 0.8125rem; margin: 4px 0 0; line-height: 1.55; }
.search-result mark { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--ink); border-radius: 2px; padding: 0 1px; }
#search-retry { margin: 6px 16px 12px; align-self: flex-start; }
.dialog-keys { display: flex; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 10px 16px; color: var(--faint); font-size: 0.75rem; }
.dialog-keys span { display: inline-flex; align-items: center; gap: 4px; }
.dialog-keys kbd + kbd { margin-left: 0; }
.dialog-keys kbd:last-of-type { margin-right: 4px; }

/* Fit shorter laptops through spacing; enlarged text can still scroll. */
@media (min-width: 1280px) and (max-height: 800px) {
  .readme { --section-gap: 28px; }
  .readme .pane-body { padding: 6px 18px; line-height: 1.4; }
  .readme .md-h2 { margin: 16px 0 6px; }
  .readme .work-list li { padding: 5px 0; }
  .readme .stack-groups > div { padding: 4px 0; }
}
@media (min-width: 1280px) and (max-height: 740px) {
  .readme { --section-gap: 15px; }
  .readme .md-h2 { margin-top: 12px; }
  .readme .work-list li { padding: 3px 0; }
  .readme .stack-groups > div { padding: 2px 0; }
}
/* Below laptop width the Home panes stack in a scrolling workspace. */
@media (max-width: 1279px) {
  .home { height: auto; grid-template-columns: minmax(0, 1fr); }
  .home-col > .work-pane, .home-col > .work-pane.is-pending { flex: none; }
  .readme .scroll { overflow: visible; }
  .work-pane .pane-body { position: static; padding: 14px 18px; }
  .work-pane .flow-canvas { position: static; }
  .flow-canvas .dg { height: auto; max-width: 680px; margin: auto; }
  main { overflow-y: auto; }
}
@media (max-width: 1099px) {
  .report-layout { grid-template-columns: minmax(0, 1fr); }
  .report-context { display: none; }
  .mobile-contents { display: block; }
}
@media (max-width: 899px), (max-height: 559px) {
  .app { height: auto; min-height: 100vh; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; grid-template-areas: "top" "explorer" "main" "status"; }
  .topbar { min-height: var(--bar); }
  .tab-chip { display: none; }
  .explorer { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px 8px; }
  .root { display: none; }
  .explorer > .tree { display: flex; flex-wrap: wrap; }
  .explorer > .tree > li > a::before { content: none; }
  .explorer .tree .tree { display: none; }
  .fill, .home, .report-layout { height: auto; }
  .scroll { overflow: visible; }
  .home { grid-template-columns: minmax(0, 1fr); }
  .statusline { flex-wrap: wrap; padding: 6px 14px; }
}
@media (max-width: 599px) {
  .stack-groups > div, .readme .stack-groups > div { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .work-pane .pane-meta { display: none; }
  .work-pane .pane-head { flex-wrap: wrap; }
  .work-pane .pane-name { white-space: normal; }
  .work-pane .pane-head .pane-path { flex-basis: 100%; }
  .work-pane .head-link { margin-left: 0; max-width: 100%; }
  .work-pane .pane-body { overflow-x: auto; }
  .work-pane .flow-canvas .dg { min-width: 600px; }
  .work-list li { grid-template-columns: 8px max-content minmax(0, 1fr); }
  .work-list .term { display: none; }
  .seg-keys, .seg-lang { display: none; }
  main { padding: 8px; }
  .pane-body, .readme .pane-body { padding: 16px 14px; }
  .report-main .pane-body { padding: 12px 14px 28px; }
  .code { padding-right: 14px; background: none; }
  .code .line, .toml .line { grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 0.8em; }
  .code .line::before { padding-right: 0; }
  .toml dt { padding-left: 0; }
  .toml dd { grid-column: 2; padding-left: 1.2em; }
  .ls thead { display: none; }
  .ls, .ls tbody, .ls tr, .ls td { display: block; }
  .ls tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .ls td { padding: 0; border: 0; }
  .ls td:first-child { margin-bottom: 4px; white-space: normal; }
  .ls td:nth-child(2), .ls td:nth-child(3) { display: inline; color: var(--faint); }
  .ls td:nth-child(3)::before { content: " · " / ""; }
  .ls td.num { display: none; }
  .ls tbody tr:not(.upcoming):hover td { background: none; }
}
main, .statusline { overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; color: #111; }
  .explorer, .topbar, .report-context, .mobile-contents, .statusline, .skip-link, dialog { display: none !important; }
  .app, .report-layout { display: block; height: auto; }
  main { padding: 0; }
  .pane { border: 0; overflow: visible; }
  .fill, .scroll { height: auto; overflow: visible; }
  .pane-head { display: none; }
  .pane-body, .report-main .pane-body { padding: 0; }
  .prose { max-width: none; font-size: 10.5pt; color: #222; }
  .prose strong, .prose h2, .prose h3, .report-header h1 { color: #111; }
  .prose h2::before, .prose h3::before, .report-figure figcaption::before { content: none; }
  .prose pre { white-space: pre-wrap; background: #eee !important; color: #111 !important; border-color: #ccc; }
  .prose pre span { color: #111 !important; }
  .prose a { color: #111; }
  .prose th, .prose td { color: #111; border-color: #ccc; }
  .report-figure { break-inside: avoid; }
  .diagram-scroll { overflow: visible; }
  .report-diagram img { min-width: 0; }
}
