/* ==========================================================================
   tavern.xyz · The Guild Hall design system (docs/DESIGN.md is the spec)
   Order: tokens > reset/base > typography > layout > primitives > components
          > page sections (landing/docs) > utilities > media > motion/contrast
   No color literal may appear below the token + hljs blocks.
   ========================================================================== */

/* ---- 1. tokens ---------------------------------------------------------- */
:root { color-scheme: light dark; }
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"]  { color-scheme: dark; }
:root {
  --canvas: light-dark(oklch(0.975 0.009 85), oklch(0.185 0.012 60));
  --surface: light-dark(oklch(0.99 0.006 88), oklch(0.225 0.014 62));
  --surface-raised: light-dark(oklch(0.998 0.003 90), oklch(0.27 0.016 64));
  --fg: light-dark(oklch(0.245 0.02 60), oklch(0.93 0.012 78));
  --fg-muted: light-dark(oklch(0.46 0.022 65), oklch(0.72 0.022 72));
  --border: light-dark(oklch(0.885 0.016 80), oklch(0.31 0.015 62));
  --border-strong: light-dark(oklch(0.62 0.02 70), oklch(0.52 0.02 66));
  --accent: light-dark(oklch(0.50 0.12 60), oklch(0.78 0.135 75));
  --accent-fg: light-dark(oklch(0.99 0.008 90), oklch(0.215 0.05 70));
  --link: light-dark(oklch(0.47 0.12 55), oklch(0.80 0.125 78));
  --lantern: light-dark(oklch(0.60 0.15 70), oklch(0.83 0.15 82));
  --ember: light-dark(oklch(0.60 0.13 65 / 0.08), oklch(0.80 0.14 75 / 0.10));
  --copper: light-dark(oklch(0.55 0.11 45), oklch(0.70 0.115 48));
  --copper-text: light-dark(oklch(0.48 0.10 45), oklch(0.70 0.115 48));
  --copper-bg: light-dark(oklch(0.95 0.035 50), oklch(0.275 0.04 50));
  --success: light-dark(oklch(0.50 0.13 150), oklch(0.76 0.14 150));
  --success-bg: light-dark(oklch(0.95 0.035 150), oklch(0.28 0.045 150));
  --warn: light-dark(oklch(0.47 0.10 80), oklch(0.81 0.13 88));
  --warn-bg: light-dark(oklch(0.955 0.04 90), oklch(0.28 0.045 85));
  --danger: light-dark(oklch(0.50 0.19 27), oklch(0.70 0.17 25));
  --danger-bg: light-dark(oklch(0.95 0.03 25), oklch(0.27 0.05 25));
  --diff-add-bg: light-dark(oklch(0.955 0.04 150), oklch(0.255 0.04 150));
  --diff-del-bg: light-dark(oklch(0.95 0.032 25), oklch(0.25 0.04 25));
  --code-bg: light-dark(oklch(0.955 0.01 85), oklch(0.16 0.012 60));
  --header-bg: light-dark(oklch(0.23 0.02 58), oklch(0.15 0.014 58));
  --header-fg: oklch(0.93 0.012 78);
  --input-bg: light-dark(oklch(0.995 0.004 90), oklch(0.205 0.013 61));
  --checker: light-dark(oklch(0.93 0.012 85), oklch(0.24 0.014 62));
  --shadow: light-dark(oklch(0.2 0.02 60 / 0.14), oklch(0.05 0.01 60 / 0.5));
  --r-ctl: 6px;
  --r-box: 10px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: ui-sans-serif, system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-optical-sizing: auto;
}
/* non-color theme values use the one sanctioned non-color pattern (DESIGN §6.3) */
:root {
  --seal-l: 0.56;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2361564b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --seal-l: 0.72;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23ada396' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
}
html[data-theme="dark"], .night {
  --seal-l: 0.72;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23ada396' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* legacy token aliases: untouched view files still reference these during the
   transition; all resolve to system tokens (no literals). */
:root { --muted: var(--fg-muted); --bg: var(--surface); --green: var(--success); --header: var(--header-bg); }

/* ---- fonts --------------------------------------------------------------- */
@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/fraunces-opsz-var.woff2") format("woff2-variations");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-var.woff2") format("woff2-variations");
  font-weight: 100 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* ---- 2. reset / base ----------------------------------------------------- */
*, ::before, ::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 0.9375rem/1.55 var(--font-ui);
  color: var(--fg);
  background: var(--canvas);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd, samp { font-family: var(--font-mono); }
code { font-size: 0.875em; overflow-wrap: anywhere; }
img, video { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
:focus-visible { outline: 2px solid var(--lantern); outline-offset: 2px; }
summary { cursor: pointer; }
::placeholder { color: var(--fg-muted); opacity: 0.8; }
kbd {
  font: 500 0.6875rem/1 var(--font-mono);
  border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 2px 5px; color: var(--fg-muted); background: var(--surface);
}

/* ---- 3. typography ------------------------------------------------------- */
h1 { font: 550 1.5rem/1.25 var(--font-display); letter-spacing: -0.005em; margin: 0 0 14px; }
h2 { font: 560 1.1875rem/1.3 var(--font-display); margin: 0 0 12px; }
h3 { font: 650 0.9375rem/1.4 var(--font-ui); margin: 0 0 8px; }
h4, h5, h6 { font: 650 0.875rem/1.4 var(--font-ui); margin: 0 0 6px; }
p { margin: 0 0 12px; }
small { font-size: 0.8125rem; }
.muted { color: var(--fg-muted); }
.stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-label {
  font: 500 0.75rem/1.35 var(--font-ui); letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--fg-muted);
}
.stat-num {
  font: 500 2.25rem/1.05 var(--font-display); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; color: var(--fg);
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin: 14px 0; }

/* ---- 4. layout ----------------------------------------------------------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wrap-slim { max-width: 860px; margin: 0 auto; }
.spacer { flex: 1; }
main { padding: 28px 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- utilities ----------------------------------------------------------- */
.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: absolute; left: 10px; top: -48px; z-index: 100;
  background: var(--surface-raised); color: var(--fg); padding: 8px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl);
  transition: top 0.12s ease-out;
}
.skip-link:focus { top: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.oct { display: inline-block; vertical-align: text-bottom; flex: 0 0 auto; }
.grow { flex: 1; }
.form-row { display: flex; gap: 8px; align-items: flex-end; margin: 12px 0; flex-wrap: wrap; }
.form-row .grow { min-width: 200px; }
.form-row label { margin-top: 0; }
.cell-r { text-align: right; white-space: nowrap; }
.inline-form { display: inline-block; margin: 0; }
.login-card { max-width: 400px; margin: 0 auto; }
.t-hot { color: var(--link); }
.t-warm { color: var(--copper-text); }
.break { white-space: pre-wrap; word-break: break-all; }

/* ---- 7.1 header: THE RAFTERS -------------------------------------------- */
header.top { background: var(--header-bg); color: var(--header-fg); }
.head-row { display: flex; align-items: center; gap: 12px; min-height: 52px; }
header.top a { color: var(--header-fg); }
header.top a:hover { text-decoration: none; }
header.top nav.menu-pop a, header.top .menu-pop a { color: var(--fg); }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand > svg { color: var(--accent); }
.brand-name {
  font: 590 1.25rem/1 var(--font-display); letter-spacing: -0.01em;
  color: var(--header-fg); text-transform: lowercase;
}
.tagline { font-size: 0.8125rem; color: color-mix(in oklch, var(--header-fg) 62%, transparent); }
.cmdk-btn, .theme-toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 30px;
  padding: 0 8px; background: none; color: var(--header-fg);
  border: 1px solid color-mix(in oklch, var(--header-fg) 22%, transparent);
  border-radius: var(--r-ctl); font: 500 0.8125rem/1 var(--font-ui); cursor: pointer;
}
.cmdk-btn:hover, .theme-toggle:hover { background: var(--ember); }
.cmdk-btn kbd { border-color: color-mix(in oklch, var(--header-fg) 25%, transparent); color: inherit; background: none; }
header.top .newrepo { height: 28px; padding: 0 11px; font-size: 0.8125rem; white-space: nowrap; }
.head-row > a:not(.brand):not(.btn) { font-size: 0.8125rem; font-weight: 500; padding: 6px 6px; border-radius: var(--r-ctl); }
.head-row > a:not(.brand):not(.btn):hover { background: var(--ember); }
.usermenu { position: relative; }
.usermenu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 7px;
  color: var(--header-fg); padding: 4px 8px; border-radius: var(--r-ctl);
  font-weight: 500; font-size: 0.8125rem;
}
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover { background: var(--ember); }
.avatar {
  width: 24px; height: 24px; border-radius: 50%; vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 0.6875rem/1 var(--font-ui); overflow: hidden; object-fit: cover;
  background: oklch(var(--seal-l) 0.14 var(--seal-h, 70)); color: var(--accent-fg);
}
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 216px;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--r-box); padding: 6px;
  box-shadow: 0 8px 24px var(--shadow), 0 1px 2px var(--shadow); z-index: 40;
}
.menu-pop a, .menu-pop button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0;
  border-radius: var(--r-ctl); background: none; color: var(--fg);
  font: 500 0.8125rem/1.3 var(--font-ui); cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--ember); text-decoration: none; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---- 7.3 buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; background: var(--surface); color: var(--fg);
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl);
  font: 500 0.8125rem/1 var(--font-ui); letter-spacing: 0.01em; cursor: pointer;
  white-space: nowrap; text-decoration: none;
  transition: background 0.12s ease-out, border-color 0.12s ease-out, color 0.12s ease-out;
}
.btn:hover { background: var(--surface-raised); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.btn.primary:hover { background: color-mix(in oklch, var(--accent) 92%, var(--fg)); }
.btn.danger { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 45%, var(--border-strong)); background: var(--surface); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.block { display: flex; width: 100%; margin: 8px 0; }
.btn.lg { height: 42px; padding: 0 22px; font-size: 0.9375rem; }
.btn-sm { height: 26px; padding: 2px 10px; font-size: 0.75rem; }
.btn-ghost { border-color: transparent; background: none; color: var(--fg-muted); }
.btn-ghost:hover { color: var(--fg); background: var(--ember); }
.btn[disabled], .btn.disabled { opacity: 0.55; pointer-events: none; }
.btn + .btn { margin-left: 6px; }
.copy-btn { flex: 0 0 auto; }

/* ---- 7.4 badges, pills, topics ------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 0.75rem/1.5 var(--font-ui); border-radius: var(--r-ctl);
  padding: 2px 8px; border: 1px solid transparent;
}
.badge .oct { width: 12px; height: 12px; }
.badge.green, .badge-ok { background: var(--success-bg); color: var(--success); border-color: color-mix(in oklch, var(--success) 25%, transparent); }
.badge.red, .badge-danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in oklch, var(--danger) 25%, transparent); }
.badge.yellow, .badge-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in oklch, var(--warn) 30%, transparent); }
.badge.gray, .badge-neutral { background: var(--surface); color: var(--fg-muted); border-color: var(--border); }
.badge.purple, .badge-merged { background: var(--copper-bg); color: var(--copper-text); border-color: color-mix(in oklch, var(--copper) 30%, transparent); }
.pill {
  display: inline-block; font-size: 0.75rem; border: 1px solid var(--border);
  border-radius: 2em; padding: 1px 9px; color: var(--fg-muted);
  background: var(--surface); white-space: nowrap;
}
.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.topic {
  display: inline-flex; align-items: center; gap: 4px; font: 500 0.75rem/1.5 var(--font-ui);
  background: var(--surface); color: var(--link); border: 1px solid var(--border);
  border-radius: 2em; padding: 1px 10px;
}
a.topic:hover { background: var(--ember); text-decoration: none; }
.topic-x { background: none; border: 0; color: inherit; cursor: pointer; font-size: 0.8125rem; line-height: 1; padding: 0; margin: 0; }
.topic-x:hover { color: var(--danger); }

/* ---- 7.9 forms ------------------------------------------------------------ */
label { display: block; font: 500 0.8125rem/1.2 var(--font-ui); letter-spacing: 0.01em; margin: 12px 0 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="search"], input[type="number"], textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl); font: inherit; background: var(--input-bg); color: var(--fg);
}
textarea { resize: vertical; }
select {
  appearance: none; -webkit-appearance: none;
  padding: 6px 28px 6px 10px; height: 36px; border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl); font: inherit; background: var(--input-bg) var(--chev) no-repeat right 8px center;
  color: var(--fg); cursor: pointer;
}
.field { margin: 0 0 14px; }
.field-hint { display: block; font-size: 0.8125rem; color: var(--fg-muted); margin-top: 5px; }
.field-error { display: block; font-size: 0.8125rem; color: var(--danger); margin-top: 5px; }
.input-affix {
  display: flex; align-items: center; gap: 2px; padding-left: 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--input-bg);
}
.input-affix > span { color: var(--fg-muted); white-space: nowrap; }
.input-affix input { border: 0; background: none; flex: 1; min-width: 0; }
.input-affix input:focus-visible { outline: none; }
.input-affix:focus-within { outline: 2px solid var(--lantern); outline-offset: 2px; }
.check-card {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--r-box);
  padding: 14px 16px; background: var(--surface);
}
.check-card .oct { color: var(--warn); margin-top: 2px; }
.check-card b { display: block; font-size: 0.9375rem; }
.check-card p { margin: 2px 0 0; color: var(--fg-muted); font-size: 0.8125rem; }
.check-card input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; margin: 4px 0 0 auto;
  width: 28px; height: 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface) radial-gradient(circle 5px at 8px 50%, var(--fg-muted) 97%, transparent);
  transition: background 0.12s ease-out, border-color 0.12s ease-out;
}
.check-card input[type="checkbox"]:checked {
  border-color: transparent;
  background: var(--accent) radial-gradient(circle 5px at 20px 50%, var(--accent-fg) 97%, transparent);
}
pre.clone {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--r-ctl); padding: 12px; overflow: auto;
  font: 400 0.8125rem/1.6 var(--font-mono);
}
.clone-wrap { position: relative; }
.clone-wrap > .copy-btn { position: absolute; top: 6px; right: 6px; }
.clone-wrap > pre.clone { padding-right: 64px; }

/* ---- 7.10 dropdowns -------------------------------------------------------- */
.dd { position: relative; display: inline-block; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd .caret { display: inline-flex; opacity: 0.8; }
.dd-title { font-size: 0.75rem; font-weight: 600; color: var(--fg-muted); padding: 2px 4px 6px; }
.branch-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.branch-pop { left: 0; right: auto; min-width: 240px; max-height: 60vh; overflow: auto; }
.branch-pop a { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: var(--r-ctl); color: var(--fg); }
.branch-pop a:hover { background: var(--ember); text-decoration: none; }
.dd-filter { margin: 2px 0 8px; }
.code-btn { display: inline-flex; align-items: center; gap: 7px; }
.clone-pop { right: 0; left: auto; min-width: 330px; max-width: calc(100vw - 24px); }
.clone-row { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.clone-row input { flex: 1 1 auto; min-width: 0; font: 400 0.75rem/1.4 var(--font-mono); padding: 5px 8px; }
.clone-row .btn { width: auto; flex: 0 0 auto; padding: 5px 9px; height: 30px; }

/* ---- 7.11 flash ------------------------------------------------------------ */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--border); border-left: 3px solid var(--fg-muted);
  border-radius: var(--r-ctl); padding: 10px 14px; margin-bottom: 16px;
  background: var(--surface); color: var(--fg);
  animation: flash-in 0.16s ease-out;
}
.flash.ok { background: var(--success-bg); border-left-color: var(--success); animation: flash-in 0.16s ease-out, flash-out 0.5s ease-in 6s forwards; }
.flash.err { background: var(--danger-bg); border-left-color: var(--danger); }
.flash.warn { background: var(--warn-bg); border-left-color: var(--warn); }
.flash .oct { margin-top: 2px; }
.flash.ok .oct { color: var(--success); }
.flash.err .oct { color: var(--danger); }
.flash.warn .oct { color: var(--warn); }
.flash-x {
  margin-left: auto; background: none; border: 0; color: var(--fg-muted);
  font-size: 1rem; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: var(--r-ctl);
}
.flash-x:hover { color: var(--fg); background: var(--ember); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes flash-out { to { opacity: 0; visibility: hidden; } }

/* ---- 7.12 cards ------------------------------------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-box); padding: 20px; margin-bottom: 16px;
}
.card h2 { margin: 0 0 12px; }
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.card-head h2 { margin: 0; }
.card-head > .btn, .card-head > form { margin-left: auto; }
.danger-zone { background: var(--danger-bg); border-color: color-mix(in oklch, var(--danger) 45%, var(--border)); }
.danger-zone h2 { color: var(--danger); }
.repo-row { display: flex; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.repo-row:last-child { border-bottom: 0; }
.repo-name { font-size: 0.9375rem; font-weight: 600; }
.repo-row .sz { margin-left: auto; text-align: right; color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.repo-disc {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: oklch(var(--seal-l) 0.14 var(--seal-h, 70));
}
.empty-state { text-align: center; color: var(--fg-muted); padding: 28px 16px; }
.empty-state strong { display: block; color: var(--fg); font-size: 0.9375rem; margin-bottom: 4px; }

/* ---- 6.5 notice board ------------------------------------------------------ */
.notice {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-box); outline: 1px solid var(--border); outline-offset: 3px;
  padding: 28px; margin: 18px auto; max-width: 560px; text-align: center;
}
.notice > .oct { width: 20px; height: 20px; color: var(--fg-muted); }
.notice h3 { font: 560 1.1875rem/1.3 var(--font-display); margin: 10px 0 6px; }
.notice p { margin: 0 0 12px; color: var(--fg-muted); }
.notice pre.clone, .notice .clone-wrap { text-align: left; }
.notice .clone-wrap { margin: 14px 0 4px; }
.notice-art { display: block; max-width: 220px; margin: 0 auto 10px; }
.notice-warn { background: var(--warn-bg); border-color: var(--warn); outline-color: color-mix(in oklch, var(--warn) 45%, transparent); }
.notice-warn > .oct { color: var(--warn); }

/* ---- 7.8 data tables -------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: left; border-bottom: 1px solid var(--border-strong); padding: 6px 10px;
  font: 500 0.75rem/1.35 var(--font-ui); letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--fg-muted);
}
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--ember); }

/* ---- 7.8b virtualized dataset table (jsonl/csv/tsv, viewer.js mountDataset) -- */
.asset-view.dataset .dataset-scroll { max-height: 70vh; overflow: auto; } /* bounded viewport = the virtualization */
table.dataset-table thead th {
  position: sticky; top: 0; z-index: 1; background: var(--canvas); white-space: nowrap;
}
table.dataset-table td {
  font: 400 0.8125rem/1.5 var(--font-mono); vertical-align: top;
  max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
table.dataset-table tbody tr[data-idx] { cursor: pointer; }
table.dataset-table td.ds-num, table.dataset-table th.ds-num {
  color: var(--fg-muted); text-align: right; width: 1%; white-space: nowrap;
  font-variant-numeric: tabular-nums; user-select: none;
}
table.dataset-table tr.ds-bad td { background: var(--warn-bg); }
table.dataset-table tr.ds-detail td { background: var(--code-bg); }
table.dataset-table tr.ds-detail pre {
  margin: 0; padding: 8px 2px; font: 400 0.8125rem/1.55 var(--font-mono);
  white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow: auto;
}
.dataset-meta .dataset-nav { display: flex; align-items: center; gap: 8px; }
.dataset-slider { width: clamp(120px, 22vw, 260px); accent-color: var(--lantern); }

/* ---- 7.2 + 6.2 repo chrome, lantern tabs ------------------------------------ */
.repo-head { margin-bottom: 16px; }
.repo-title {
  font-size: 1.05rem; font-weight: 400; display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap; margin: 0 0 12px;
}
.repo-title .oct { color: var(--fg-muted); }
.repo-title a { font-weight: 600; color: var(--fg); }
.repo-title a:hover { color: var(--link); }
.repo-title > a:nth-of-type(2) { font: 550 1.375rem/1.25 var(--font-display); letter-spacing: -0.005em; }
.repo-title .pill { font-weight: 400; }
nav.repo-tabs, .repo-tabs {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 2px; overflow-x: auto; background: var(--canvas);
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.repo-tabs::-webkit-scrollbar { display: none; }
.repo-tabs.stuck { box-shadow: 0 8px 16px -12px var(--lantern); }
.rt {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-top: 2px solid transparent; color: var(--fg); white-space: nowrap;
  font: 500 0.8125rem/1.2 var(--font-ui); letter-spacing: 0.01em;
}
.rt:hover { background: var(--ember); text-decoration: none; }
.rt .oct { color: var(--fg-muted); }
.rt.active, .rt[aria-current="page"] {
  border-top: 2px solid var(--lantern);
  background: linear-gradient(180deg, var(--ember), transparent 70%);
  font-weight: 600;
}
.rt.active .oct { color: var(--fg); }
.rt-n { font: 500 0.75rem/1 var(--font-mono); color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* ---- 6.3 seals --------------------------------------------------------------- */
.seal {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 0.75rem/1 var(--font-mono); padding: 2px 7px;
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  color: var(--fg-muted); background: var(--surface);
  font-variant-numeric: tabular-nums;
}
a.seal:hover { border-color: var(--border-strong); color: var(--fg); text-decoration: none; }
.seal-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: oklch(var(--seal-l) 0.14 var(--seal-h, 70)); }
/* large seal variant: revision meta header (views-history) */
.card-head .seal { font-size: 0.875rem; padding: 5px 11px; }
.card-head .seal .seal-dot { width: 9px; height: 9px; }
.ref-badge { display: inline-flex; align-items: center; gap: 5px; }

/* ---- 7.5 file table (the Ledger) --------------------------------------------- */
.filebox { border: 1px solid var(--border); border-radius: var(--r-box); overflow: hidden; background: var(--surface); }
.commit-bar {
  display: flex; align-items: center; gap: 10px; padding: 9px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); font-size: 0.8125rem;
}
.commit-bar .who { font-weight: 600; color: var(--fg); }
.commit-bar .msg { color: var(--fg-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commit-bar .msg a { color: var(--fg-muted); }
.commit-bar .right { margin-left: auto; display: flex; align-items: center; gap: 12px; white-space: nowrap; color: var(--fg-muted); }
.commit-bar .sha { font: 500 0.75rem/1 var(--font-mono); }
.file-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.file-table thead th {
  text-align: left; padding: 6px 12px; font: 500 0.75rem/1.35 var(--font-ui);
  color: var(--fg-muted); border-bottom: 1px solid var(--border-strong);
}
.file-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; }
.file-table tr:last-child td { border-bottom: 0; }
.file-table tbody tr:hover td, .file-table tr:hover td { background: var(--ember); }
.file-table .nm { width: 42%; }
.file-table .nm .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-table .nm a { color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-table .nm a:hover { color: var(--link); text-decoration: underline; }
.file-table .oct.folder { color: color-mix(in oklch, var(--accent) 80%, var(--fg-muted)); }
.file-table .oct.file { color: var(--fg-muted); }
.file-table .cm { color: var(--fg-muted); width: 43%; }
.file-table .cm a { color: var(--fg-muted); display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.file-table .ag { color: var(--fg-muted); text-align: right; white-space: nowrap; font-size: 0.75rem; width: 15%; }
.file-table .sz { text-align: right; white-space: nowrap; color: var(--fg-muted); font-size: 0.75rem; width: 10%; }
.file-table .nm .extra { display: inline-flex; gap: 10px; align-items: center; flex: 0 0 auto; margin-left: auto; }

/* ---- 7.6 + 6.3 commits: the route log ----------------------------------------- */
.commits-day {
  font: 500 0.75rem/1.35 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-muted); margin: 20px 0 6px;
}
.commits-list { position: relative; border: 1px solid var(--border); border-radius: var(--r-box); overflow: hidden; background: var(--surface); }
.commits-list::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; border-left: 1px solid var(--border-strong); }
.commit-card { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 12px 30px; border-bottom: 1px solid var(--border); }
.commit-card::before {
  content: ""; position: absolute; left: 11px; top: 19px; width: 7px; height: 7px;
  border-radius: 50%; background: oklch(var(--seal-l) 0.14 var(--seal-h, 70));
  box-shadow: 0 0 0 3px var(--surface); z-index: 1;
}
.commit-card:last-child { border-bottom: 0; }
.commit-card:hover { background: var(--ember); }
.ident {
  width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: oklch(var(--seal-l) 0.14 var(--seal-h, 70)); color: var(--accent-fg);
  font: 600 0.75rem/1 var(--font-ui); overflow: hidden;
}
.ident img { width: 100%; height: 100%; object-fit: cover; }
.commit-main { flex: 1; min-width: 0; }
.commit-main .ttl { font-weight: 600; color: var(--fg); display: inline-block; }
.commit-main .ttl:hover { color: var(--link); }
.commit-main .sub { color: var(--fg-muted); font-size: 0.75rem; margin-top: 2px; }
.commit-side { display: flex; align-items: center; gap: 6px; white-space: nowrap; flex: 0 0 auto; }
.commit-side .sha, .sha { font: 500 0.75rem/1.4 var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- 7.7 diffs ------------------------------------------------------------------ */
.diff { border: 1px solid var(--border); border-radius: var(--r-box); overflow: hidden; margin: 12px 0; background: var(--surface); }
.diff pre { margin: 0; font: 400 0.8125rem/1.6 var(--font-mono); overflow-x: auto; }
.diff .file {
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 7px 12px;
  font: 600 0.75rem/1.5 var(--font-mono);
}
.diff .line { display: block; padding: 0 12px 0 8px; white-space: pre-wrap; word-break: break-all; border-left: 2px solid transparent; }
.diff .line.add { background: var(--diff-add-bg); border-left-color: var(--success); }
.diff .line.del { background: var(--diff-del-bg); border-left-color: var(--danger); }
.diff .line.hunk { background: var(--ember); color: var(--fg-muted); }
.diff .line.ctx { color: var(--fg); }
.diff .empty { padding: 10px 12px; color: var(--fg-muted); }
details.diff > summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  background: var(--surface); padding: 8px 12px; position: sticky; top: 38px; z-index: 2;
  font: 600 0.75rem/1.5 var(--font-mono);
}
details.diff > summary::-webkit-details-marker { display: none; }
details.diff > summary .caret { color: var(--fg-muted); display: inline-flex; transition: transform 0.12s ease-out; }
details.diff[open] > summary { border-bottom: 1px solid var(--border); }
details.diff[open] > summary .caret { transform: rotate(90deg); }
details.diff > summary .stat { margin-left: auto; font-weight: 600; flex-direction: row; gap: 8px; }
.diff-summary { font-size: 0.875rem; margin: 16px 0 8px; color: var(--fg-muted); }
.diff-summary b { color: var(--fg); }
.add-n, .diff-summary .add-n, details.diff > summary .stat .add-n { color: var(--success); font-weight: 600; }
.del-n, .diff-summary .del-n, details.diff > summary .stat .del-n { color: var(--danger); font-weight: 600; }
.diff-tools { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.diff-files {
  border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface);
  padding: 8px 12px; margin: 10px 0; font: 400 0.75rem/1.7 var(--font-mono);
}
.diff-files a { display: block; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diff-files a:hover { color: var(--link); }
.diff-gutter, .ln {
  user-select: none; -webkit-user-select: none; color: var(--fg-muted);
  font: 400 0.75rem/1.6 var(--font-mono); text-align: right;
}
.diff-binary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: var(--fg-muted); font-size: 0.8125rem; }
.diff-binary img { max-height: 120px; border: 1px solid var(--border); border-radius: var(--r-ctl); }

/* ---- 7.14 code view (the cellar) -------------------------------------------------- */
.codeview {
  display: flex; border: 1px solid var(--border); border-radius: var(--r-box);
  max-height: 80vh; overflow: auto; background: var(--code-bg);
  font-size: 0.8125rem; line-height: 1.6;
}
.codeview .gutter {
  margin: 0; padding: 14px 8px; text-align: right; color: var(--fg-muted);
  background: var(--code-bg); border-right: 1px solid var(--border);
  user-select: none; -webkit-user-select: none; white-space: pre; flex: 0 0 auto;
  font: 400 0.75rem/1.733 var(--font-mono);
}
.codeview .gutter a { display: block; color: var(--fg-muted); text-decoration: none; min-width: 2ch; }
.codeview .gutter a:hover { color: var(--link); }
.codeview .gutter a:target { color: var(--lantern); background: var(--ember); font-weight: 700; }
.codeview .code { margin: 0; flex: 1; min-width: 0; overflow-x: auto; }
.codeview .code code { display: block; padding: 14px 16px; white-space: pre; background: var(--code-bg); font-family: var(--font-mono); }
.codeview .code code.hljs { padding: 14px 16px; background: var(--code-bg); overflow: visible; }

/* ---- 7.15 syntax palette (grouped literals sanctioned here only) ------------------- */
.hljs { background: transparent; color: var(--fg); }
.hljs-keyword, .hljs-selector-tag, .hljs-section { color: light-dark(oklch(0.46 0.13 60), oklch(0.80 0.12 70)); }
.hljs-string, .hljs-regexp, .hljs-addition { color: light-dark(oklch(0.47 0.11 140), oklch(0.78 0.10 140)); }
.hljs-number, .hljs-literal, .hljs-symbol, .hljs-bullet { color: light-dark(oklch(0.46 0.11 45), oklch(0.76 0.11 50)); }
.hljs-comment, .hljs-quote { color: light-dark(oklch(0.50 0.02 70), oklch(0.62 0.02 70)); }
.hljs-title, .hljs-name { color: light-dark(oklch(0.42 0.10 80), oklch(0.85 0.09 90)); }
.hljs-type, .hljs-class .hljs-title { color: light-dark(oklch(0.45 0.08 180), oklch(0.78 0.08 180)); }
.hljs-attr, .hljs-attribute, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-pseudo { color: light-dark(oklch(0.44 0.10 110), oklch(0.79 0.10 110)); }
.hljs-built_in, .hljs-deletion { color: light-dark(oklch(0.46 0.12 30), oklch(0.75 0.11 35)); }
.hljs-meta, .hljs-doctag, .hljs-template-tag { color: light-dark(oklch(0.48 0.04 250), oklch(0.70 0.04 250)); }
.hljs-variable, .hljs-params, .hljs-template-variable { color: var(--fg); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-addition { background: var(--diff-add-bg); }
.hljs-deletion { background: var(--diff-del-bg); }

/* ---- 7.13 terminal ------------------------------------------------------------------ */
.terminal { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-box); overflow: hidden; text-align: left; }
.terminal-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  border-bottom: 1px solid var(--border); color: var(--fg-muted);
  font: 400 0.75rem/1 var(--font-mono);
}
.term-dots { position: relative; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; border: 1px solid currentColor; opacity: 0.55; margin-right: 24px; }
.term-dots::before, .term-dots::after { content: ""; position: absolute; top: -1px; width: 7px; height: 7px; border-radius: 50%; border: 1px solid currentColor; }
.term-dots::before { left: 10px; }
.term-dots::after { left: 21px; }
.terminal pre { margin: 0; padding: 16px 18px; color: var(--fg); font: 400 0.8125rem/1.75 var(--font-mono); overflow-x: auto; }
.t-prompt { color: var(--accent); }
.t-out { color: var(--fg-muted); }
.t-hi { color: var(--accent); }
.t-line { display: block; }
.hero-demo .t-line {
  white-space: pre; overflow: hidden; max-width: calc(var(--ch, 80) * 1ch);
  animation: t-type 1.1s steps(var(--ch, 40), end) both; animation-delay: var(--d, 0s);
}
.hero-demo .t-line:last-child::after {
  content: ""; display: inline-block; width: 0.55ch; height: 1em; vertical-align: -0.15em;
  background: var(--accent); animation: t-caret 1.1s steps(1) infinite;
}
@keyframes t-type { from { max-width: 0; } }
@keyframes t-caret { 50% { opacity: 0; } }

/* ---- 7.16 meters, stats, keg gauge --------------------------------------------------- */
.bar { height: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin: 8px 0; }
.bar > span { display: block; height: 100%; background: var(--accent); width: var(--w, auto); }
.bar.warn > span { background: var(--warn); }
.bar.danger > span { background: var(--danger); }
.keg { margin: 8px 0; }
.keg-row { margin: 0 0 12px; }
.keg-label { display: block; font-size: 0.8125rem; color: var(--fg-muted); margin-bottom: 5px; }
.keg-label b { color: var(--fg); font-variant-numeric: tabular-nums; }
.keg-bar {
  position: relative; height: 10px; border-radius: 5px; overflow: hidden;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
}
.keg-bar::before {
  content: ""; position: absolute; inset: 0; width: var(--w, 0%); min-width: 2px;
  border-radius: 5px; background: var(--accent); animation: keg-fill 0.6s ease-out;
}
.keg-bar.k2::before { background: var(--copper); }
.keg-bar.k3::before { background: var(--copper-text); }
.keg-save { margin: 14px 0 0; color: var(--fg-muted); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
@keyframes keg-fill { from { width: 0; } }
.contrib-list { list-style: none; margin: 0; padding: 0; }
.contrib-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.contrib-row:last-child { border-bottom: 0; }
.contrib-rank { color: var(--fg-muted); font-size: 0.75rem; width: 22px; text-align: right; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.contrib-main { flex: 1; min-width: 0; }
.contrib-name { font-weight: 600; }
.contrib-bar { height: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; margin-top: 5px; max-width: 340px; }
.contrib-bar > span { display: block; height: 100%; background: var(--copper); width: var(--w, auto); }
.contrib-count { color: var(--fg-muted); font-size: 0.8125rem; white-space: nowrap; flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* ---- 7.17 asset viewer chrome --------------------------------------------------------- */
.file-view .breadcrumb { font-size: 1.05rem; margin: 0 0 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumb .sep { color: var(--fg-muted); font-weight: 400; }
.breadcrumb .leaf { font-weight: 600; }
.file-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-box) var(--r-box) 0 0;
  background: var(--surface); flex-wrap: wrap;
}
.file-toolbar .finfo { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-toolbar .name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-toolbar .size { color: var(--fg-muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.file-toolbar .acts { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.file-toolbar .acts .btn { height: 26px; padding: 2px 10px; font-size: 0.75rem; }
.file-toolbar + .codeview,
.file-toolbar + .asset-view { border-top-left-radius: 0; border-top-right-radius: 0; }
.file-note { border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--r-box) var(--r-box); padding: 16px; color: var(--fg-muted); background: var(--surface); }
.asset-view { border: 1px solid var(--border); border-radius: var(--r-box); overflow: hidden; }
.asset-view .file-toolbar { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.asset-stage { display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--code-bg); }
.asset-img { max-width: 100%; max-height: 70vh; object-fit: contain; }
.asset-video { max-width: 100%; max-height: 70vh; }
.asset-audio { width: min(560px, 100%); }
.asset-pdf { width: 100%; height: 75vh; border: 0; }
.asset-model { width: 100%; height: 60vh; background: var(--code-bg); }
.asset-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  color: var(--fg-muted); font-size: 0.8125rem; padding: 8px 14px;
  border-top: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.checker { background: repeating-conic-gradient(var(--checker) 0% 25%, var(--code-bg) 0% 50%) 0 0 / 16px 16px; }
.hexview { font: 400 0.8125rem/1.7 var(--font-mono); background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-box); padding: 12px 14px; overflow-x: auto; }
.hexview .ln { margin-right: 12px; }

/* ---- 7.20 misc kept components ---------------------------------------------------------- */
.tabs { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 2px; margin: 0 0 16px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 4px; border-top: 2px solid transparent; color: var(--fg); font: 500 0.8125rem/1.4 var(--font-ui); }
.tab:hover { background: var(--ember); text-decoration: none; }
.tab.active { background: var(--surface-raised); border-top-color: var(--lantern); font-weight: 600; }
.tab .count { font: 500 0.75rem/1 var(--font-mono); color: var(--fg-muted); font-variant-numeric: tabular-nums; }
.review { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }
.review.approved { color: var(--success); }
.review.changes_requested { color: var(--danger); }
.review.commented { color: var(--fg-muted); }
.cav {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; object-fit: cover;
  background: oklch(var(--seal-l) 0.14 var(--seal-h, 70)); border: 1px solid var(--border);
  color: var(--accent-fg); font: 600 0.8125rem/1 var(--font-ui); overflow: hidden; vertical-align: middle;
}
/* the box spans its column (matches .filebox); only prose measure is capped */
.markdown-body { line-height: 1.6; }
.markdown-body p, .markdown-body li { max-width: 72ch; }
.markdown-body h1 { font-size: 1.375rem; margin: 0 0 10px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.markdown-body h2 { font-size: 1.1875rem; margin: 22px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.markdown-body h3 { font-size: 1rem; margin: 18px 0 6px; }
.markdown-body p { margin: 0 0 12px; }
.markdown-body ul, .markdown-body ol { margin: 0 0 12px; padding-left: 28px; }
.markdown-body li { margin: 4px 0; }
.markdown-body code { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.1em 0.35em; }
.markdown-body pre.clone code, .markdown-body pre code { background: none; border: 0; padding: 0; }
.markdown-body blockquote { margin: 0 0 12px; padding: 0 14px; color: var(--fg-muted); border-left: 3px solid var(--border); }
.markdown-body img { max-width: 100%; }
.readme-name { font-size: 0.75rem; font-weight: 600; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 12px; color: var(--fg-muted); }
ul.activity { list-style: none; margin: 0; padding: 0; }
.activity-item { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-text { flex: 1; min-width: 0; }
.activity-when { white-space: nowrap; font-size: 0.75rem; font-variant-numeric: tabular-nums; }

/* about sidebar */
.repo-body { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 24px; align-items: start; }
.repo-main { min-width: 0; }
.repo-side { min-width: 0; }
.code-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.code-toolbar .grow { flex: 1; }
.about { position: relative; }
.about h3 { font-size: 1rem; margin: 0 0 8px; }
.about-edit > summary { position: absolute; top: -3px; right: 0; list-style: none; color: var(--fg-muted); padding: 3px 5px; border-radius: var(--r-ctl); line-height: 1; }
.about-edit > summary::-webkit-details-marker { display: none; }
.about-edit > summary:hover { color: var(--link); background: var(--ember); }
.about-form { margin: 6px 0 14px; }
.about-form label { font-size: 0.75rem; margin: 8px 0 4px; }
.about-form .btn { height: 28px; padding: 0 12px; }
.about .desc { margin: 0 0 14px; color: var(--fg); }
.about .desc.none { color: var(--fg-muted); font-style: italic; }
.about .meta { list-style: none; margin: 14px 0 0; padding: 14px 0 0; border-top: 1px solid var(--border); }
.about .meta li { display: flex; align-items: center; gap: 8px; padding: 5px 0; color: var(--fg-muted); font-size: 0.8125rem; }
.about .meta li .oct { color: var(--fg-muted); }
.about .meta a { color: var(--fg); }
.about .meta a:hover { color: var(--link); }
.about .topics { margin: 0 0 4px; }
.about-contrib { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; }
.about-contrib h3 { font-size: 1rem; margin: 0 0 10px; }
.about-contrib h3 a { color: var(--fg); }
.contrib-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.contrib-grid a, .contrib-grid > span { display: inline-block; line-height: 0; }

/* ---- 8.1 command palette ------------------------------------------------------------------ */
dialog.palette {
  border: 1px solid var(--border); border-radius: var(--r-box); padding: 0;
  width: min(560px, 92vw); margin: 12vh auto auto;
  background: var(--surface-raised); color: var(--fg);
  box-shadow: 0 8px 24px var(--shadow), 0 1px 2px var(--shadow);
  animation: pal-in 0.14s ease-out;
}
dialog.palette::backdrop { background: color-mix(in oklch, var(--header-bg) 45%, transparent); }
@keyframes pal-in { from { opacity: 0; transform: translateY(-10px) scale(0.98); } }
.pal-input {
  width: 100%; height: 44px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: var(--fg); caret-color: var(--lantern);
  font: inherit; padding: 0 16px; border-radius: var(--r-box) var(--r-box) 0 0;
}
.pal-input:focus-visible { outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 46vh; overflow-y: auto; }
.pal-group { font: 500 0.6875rem/1.4 var(--font-ui); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); padding: 8px 10px 3px; }
.pal-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px;
  border-radius: var(--r-ctl); border-left: 2px solid transparent; color: var(--fg); cursor: pointer;
}
.pal-item .oct { color: var(--fg-muted); }
.pal-item kbd { margin-left: auto; }
.pal-item[aria-selected="true"] { background: var(--ember); border-left-color: var(--lantern); }
.pal-empty { padding: 16px; color: var(--fg-muted); text-align: center; }
.pal-foot { border-top: 1px solid var(--border); padding: 8px 14px; color: var(--fg-muted); font: 400 0.6875rem/1.4 var(--font-mono); }

/* ---- 7.18 docs ------------------------------------------------------------------------------ */
.docs-layout { display: flex; gap: 28px; align-items: flex-start; }
.docs-nav { flex: 0 0 220px; position: sticky; top: 20px; padding: 8px 0; }
.docs-nav a { display: block; padding: 7px 12px; border-left: 2px solid transparent; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; color: var(--fg); font-size: 0.875rem; }
.docs-nav a:hover { background: var(--ember); text-decoration: none; }
.docs-nav a.active, .docs-nav a[aria-current="page"] { background: var(--ember); border-left-color: var(--lantern); font-weight: 600; }
.docs-nav .nav-title { font: 500 0.75rem/1.35 var(--font-ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-muted); padding: 8px 12px 4px; }
.docs-body { flex: 1; min-width: 0; max-width: 720px; }
.docs-body h1 { font: 550 1.5rem/1.25 var(--font-display); margin: 0 0 8px; }
.docs-body h2 { font: 560 1.1875rem/1.3 var(--font-display); margin: 26px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.docs-body h2 .anchor { color: var(--fg-muted); opacity: 0; margin-left: 6px; }
.docs-body h2:hover .anchor { opacity: 1; }
.docs-body li { margin: 6px 0; }
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: var(--r-ctl); padding: 12px 14px; margin: 16px 0; font-size: 0.875rem;
}
.callout.tip { border-left-color: var(--success); }
.callout .lbl { font-weight: 700; margin-right: 4px; }
.doc-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; border-top: 1px solid var(--border); padding-top: 16px; }
.doc-pager .nxt { margin-left: auto; text-align: right; }
.doc-pager small { display: block; color: var(--fg-muted); font: 500 0.6875rem/1.6 var(--font-ui); text-transform: uppercase; letter-spacing: 0.06em; }
.docs-body table.doc { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.docs-body table.doc td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs-body table.doc td:first-child { white-space: nowrap; font: 400 0.75rem/1.6 var(--font-mono); }

/* ---- 7.19 footer + 6.7 statusline ------------------------------------------------------------ */
footer { color: var(--fg-muted); text-align: center; padding: 0 0 34px; font-size: 0.8125rem; margin-top: 40px; border-top: 1px solid var(--border); }
footer a { margin: 0 3px; color: var(--fg-muted); }
footer a:hover { color: var(--link); }
.statusline {
  min-height: 28px; display: flex; align-items: center; justify-content: center; gap: 6px;
  font: 400 0.75rem/1 var(--font-mono); color: var(--fg-muted);
  font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); margin-bottom: 24px;
  flex-wrap: wrap; padding: 6px 0;
}
.foot-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--fg); margin-bottom: 8px; }
.foot-brand svg { color: var(--fg-muted); }
.foot-glow { background: radial-gradient(60% 120px at 50% 100%, var(--ember), transparent); }

/* ---- 9.1 landing ------------------------------------------------------------------------------ */
.night { color-scheme: dark; background: var(--canvas); color: var(--fg); }
.land-hero { position: relative; display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: center; padding: 56px 0 44px; }
.land-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(75% 55% at 50% 108%, var(--ember), transparent 60%); pointer-events: none; }
.land-hero > * { position: relative; }
.land-hero > h1, .land-hero > .lead, .land-hero > .cta { flex: 1 1 100%; }
.land-hero.night { padding: 56px 32px 44px; border-radius: var(--r-box); }
.hero-copy { flex: 1 1 400px; min-width: 0; }
.land-hero .hero-demo { flex: 1 1 420px; min-width: 0; margin: 0; position: relative; }
/* §9.5 hero backdrop: very low opacity behind the terminal; page is complete
   without it (img ships `hidden`; this display overrides UA [hidden]). */
.land-hero .hero-art {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0.32; pointer-events: none; border-radius: var(--r-box);
}
.land-hero .hero-demo .terminal { position: relative; }
.land-hero h1 {
  font: 560 clamp(2.125rem, 5.5vw, 3.25rem)/1.08 var(--font-display);
  letter-spacing: -0.015em; margin: 0.2em 0; color: var(--fg);
}
.eyebrow { display: block; color: var(--accent); font: 600 0.75rem/1.4 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
.lead { font-size: 1.125rem; color: var(--fg-muted); max-width: 620px; margin: 14px 0 24px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-demo { max-width: 660px; margin: 30px auto 0; }
.proof { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-box); padding: 24px; margin: 40px 0; }
.proof .stat-num, .land-hero .stat-num { font-size: 2.75rem; }
.section-title { text-align: center; font: 560 1.75rem/1.15 var(--font-display); letter-spacing: -0.01em; margin: 52px 0 6px; }
.section-sub { text-align: center; color: var(--fg-muted); margin: 0 auto 14px; max-width: 560px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr)); gap: 16px; margin: 18px 0; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-box); padding: 18px;
  transition: border-color 0.15s ease-out, background 0.15s ease-out, transform 0.15s ease-out;
}
.feature:hover { border-color: var(--border-strong); background: color-mix(in oklch, var(--surface) 92%, var(--accent)); transform: translateY(-2px); }
.feature .oct { color: var(--accent); width: 18px; height: 18px; margin-bottom: 8px; }
.feature h3 { margin: 0 0 6px; }
.feature p { margin: 0; color: var(--fg-muted); font-size: 0.875rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 18px 0; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-box); padding: 18px; }
.step .step-head { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 8px; }
.step p { margin: 0; color: var(--fg-muted); font-size: 0.875rem; }
.step pre.clone { font-size: 0.75rem; margin: 8px 0 0; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent);
  color: var(--accent-fg); font: 700 0.8125rem/1 var(--font-ui); margin-right: 8px;
  vertical-align: middle; flex: 0 0 auto;
}
.cta-band {
  position: relative; overflow: hidden; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-box);
  padding: 40px 20px; margin: 46px 0 8px;
}
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 130px at 50% 100%, var(--ember), transparent); pointer-events: none; }
.cta-band > * { position: relative; }
.cta-band .cta { justify-content: center; }
.cta-band h2 { font: 560 1.75rem/1.15 var(--font-display); letter-spacing: -0.01em; margin: 0 0 6px; }
.cta-band.night, .night .cta-band { background: var(--canvas); }
.shot { border: 1px solid var(--border); border-radius: var(--r-box); overflow: hidden; margin: 24px 0; }
.shot-bar { display: flex; align-items: center; gap: 8px; background: var(--header-bg); color: var(--header-fg); min-height: 30px; padding: 0 12px; font: 400 0.75rem/1 var(--font-mono); }
.shot img { display: block; width: 100%; }
.hero { text-align: center; padding: 40px 0 8px; }
.hero > svg { color: var(--accent); }
.hero h1 { font: 560 1.75rem/1.2 var(--font-display); margin: 0.4em 0 0.2em; }

/* ---- 10. observability (admin) ----------------------------------------------------------------- */
.obs-head {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 8px 16px; margin-bottom: 8px;
}
.obs-head h1 { margin: 0; }
.obs-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 0 8px; font-size: 0.8125rem; }
.obs-controls label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font: inherit; }
.obs-controls select { height: 28px; padding: 2px 26px 2px 8px; font-size: 0.8125rem; }
.obs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.obs-grid > .card { margin-bottom: 0; }
.obs-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start; }
table.data.obs-feed td { font: 400 0.75rem/1.5 var(--font-mono); padding: 5px 10px; }
@media (max-width: 860px) {
  .obs-grid, .obs-grid3 { grid-template-columns: 1fr; }
}

/* ---- media queries (kept 720/420 + 860 tagline + 900 hero) ------------------------------------ */
@media (max-width: 860px) {
  header .tagline, header.top .tagline { display: none; }
}
@media (max-width: 720px) {
  main { padding: 18px 0; }
  .wrap { padding: 0 14px; }
  .head-row { flex-wrap: wrap; gap: 8px 10px; padding: 8px 0; }
  .cmdk-btn kbd { display: none; }
  .usermenu > summary > span:not(.avatar) { display: none; }
  header.top .newrepo { padding: 0 10px; }
  .card { padding: 16px; }
  .repo-body { grid-template-columns: minmax(0, 1fr); }
  .repo-side { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 16px; }
  .file-view .breadcrumb { font-size: 1rem; }
  .file-table .cm, .file-table .ag, .file-table .sz { display: none; }
  .file-table .nm { width: auto; }
  .commit-bar .msg { display: none; }
  .repo-row { flex-wrap: wrap; }
  .tabs { overflow-x: auto; max-width: 100%; }
  table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .btn { min-height: 32px; }
  .btn.lg { padding: 0 18px; font-size: 0.875rem; }
  input[type="text"], input[type="email"], input[type="password"], input[type="url"],
  input[type="search"], textarea, select { font-size: 16px; }
  .menu-pop { max-width: calc(100vw - 24px); }
  code { overflow-wrap: anywhere; }
  .land-hero { padding: 36px 0 24px; }
  .land-hero.night { padding: 36px 18px 24px; }
  .hero-demo { margin-top: 22px; }
  .section-title { font-size: 1.375rem; margin: 38px 0 4px; }
  .cta-band { padding: 28px 16px; margin: 36px 0 8px; }
  .cta { gap: 10px; }
  .cta .btn, .cta-band .btn { flex: 1 1 auto; text-align: center; }
  .docs-layout { display: block; }
  .docs-nav { position: static; flex-basis: auto; width: 100%; margin-bottom: 14px; }
  .docs-body table.doc td:first-child { white-space: normal; word-break: break-word; }
  .doc-pager { flex-direction: column; gap: 10px; }
  .doc-pager .nxt { margin-left: 0; text-align: left; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .stat-num { font-size: 1.75rem; }
}
@media (max-width: 420px) {
  .brand-name { font-size: 1.125rem; }
  header.top .newrepo { padding: 0 9px; font-size: 0.75rem; }
  .land-hero h1 { font-size: 1.625rem; }
  .lead { font-size: 1rem; }
  .section-title { font-size: 1.25rem; }
  .cta-band h2 { font-size: 1.3125rem; }
  .notice { padding: 20px 14px; }
}

/* ---- motion + contrast --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation: none !important; transition: none !important; }
  .hero-demo .t-line { max-width: none !important; }
  .feature:hover { transform: none; }
  .flash.ok { opacity: 1; visibility: visible; }
}
@media (forced-colors: active) {
  .rt.active, .rt[aria-current="page"] { border-top-color: Highlight; }
  .seal-dot, .bar > span, .keg-bar::before, .step-num, .repo-disc { background: CanvasText; }
  .btn, .badge, .pill, .seal { border: 1px solid ButtonText; }
  .diff .line.add, .diff .line.del { border-left-width: 3px; }
  .tagline { color: CanvasText; }
}

/* ==================================================================================================
   viewer · client-side asset viewers (viewer.js runtime; DESIGN §7.17)
   Roots are [data-viewer="model|audio|tga|font"]; viewer.js enhances, pages stay
   functional JS-off. Contract doc: VIEWER-CONTRACTS.md (foundation handoff).
   Tokens only — no color literals.
   ================================================================================================== */

/* -- fallback notice: hidden until viewer.js reveals it (or shown by the page JS-off) ------------- */
.stage-fallback { padding: 18px 20px; color: var(--fg-muted); font-size: 0.8125rem; text-align: center; }
.stage-fallback[hidden] { display: none !important; }

/* -- 3D stage: checkerboard well the page's <model-viewer> fills ---------------------------------- */
.asset-stage.stage-3d {
  position: relative; padding: 0; min-height: 420px; display: block;
  background: repeating-conic-gradient(var(--checker) 0% 25%, var(--code-bg) 0% 50%) 0 0 / 16px 16px;
}
.stage-3d model-viewer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; background: transparent;
}
.asset-stage:fullscreen { background: var(--code-bg); }

/* load progress: lantern fill along the stage's top edge (viewer.js sets --w) */
.stage-progress {
  position: absolute; top: 0; left: 0; height: 3px; width: var(--w, 0%);
  background: var(--lantern); z-index: 2; pointer-events: none;
  transition: width 160ms ease-out, opacity 400ms ease-out;
}
.stage-progress.done { opacity: 0; }

/* stage toolbar: fullscreen / autorotate as .btn.btn-sm, pinned top-right */
.stage-toolbar { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; z-index: 2; }
.stage-toolbar .btn { background: var(--surface); }
.stage-toolbar .btn[aria-pressed="true"] { border-color: var(--lantern); background: var(--ember); }

/* -- audio waveform: canvas block under the native <audio controls> ------------------------------- */
.wave {
  display: block; width: 100%; height: 140px;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--r-box);
  cursor: pointer; touch-action: none;
}
.wave[hidden] { display: none !important; }

/* -- font specimen: contenteditable sample paragraphs + fixed size rows --------------------------- */
.specimen { padding: 20px; background: var(--surface); }
.specimen-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.specimen-row:last-child { border-bottom: 0; }
.specimen-size {
  flex: 0 0 44px; text-align: right;
  font: 500 0.75rem/1 var(--font-mono); color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.specimen [contenteditable] { flex: 1; min-width: 0; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
/* size ladder for specimen rows (classes instead of inline styles — §11.6) */
.specimen .s-12 { font-size: 12px; }
.specimen .s-16 { font-size: 16px; }
.specimen .s-20 { font-size: 20px; }
.specimen .s-28 { font-size: 28px; }
.specimen .s-40 { font-size: 40px; }
.specimen .s-64 { font-size: 64px; }

/* -- landing "open a real world" band ------------------------------------------------------------- */
.try-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin: 18px 0;
}
.try-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-box);
  color: var(--fg);
  transition: border-color 120ms ease-out, background 120ms ease-out, transform 120ms ease-out;
}
.try-card:hover {
  border-color: var(--border-strong);
  background: color-mix(in oklch, var(--surface) 92%, var(--accent));
  transform: translateY(-2px); text-decoration: none;
}
.try-card .oct { color: var(--accent); width: 18px; height: 18px; flex: 0 0 auto; }
.try-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.try-size { margin-left: auto; font: 500 0.75rem/1 var(--font-mono); color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.try-kind {
  flex: 0 0 auto; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font: 500 0.6875rem/1.4 var(--font-ui); color: var(--fg-muted); letter-spacing: 0.02em;
}

/* -- size-cap / skipped-enhancement note (e.g. "waveform skipped over 25 MB") --------------------- */
.data-cap {
  display: flex; align-items: center; gap: 8px; margin: 8px 0 0;
  color: var(--fg-muted); font-size: 0.8125rem;
}
.data-cap .oct { flex: 0 0 auto; }

/* -- viewer mobile + motion ----------------------------------------------------------------------- */
@media (max-width: 720px) {
  .asset-stage.stage-3d { min-height: 300px; }
  .wave { height: 110px; }
  .specimen { padding: 14px; }
  .specimen .s-64 { font-size: 44px; }
  .specimen .s-40 { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  /* global rule above already kills transitions; belt-and-braces on transforms */
  .try-card:hover { transform: none; }
  .stage-progress { transition: none; }
}

/* ---- CI check list (api.ts ciStatusList; replaces its former inline styles) - */
.ci-list { padding: 0; }
.ci-list .review { padding: 10px 14px; }
.ci-ctx { margin: 0 8px; }

/* stage download-progress note (injected by viewer.js under .stage-progress) */
.asset-stage { position: relative; }
.stage-note {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  margin: 0; font: 500 0.75rem/1 var(--font-mono); color: var(--fg-muted);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
/* reserve stage height while a client decoder works (prevents layout jump) */
.asset-stage:has(> canvas[hidden]) { min-height: 280px; }

/* ---- stars: repo-header control + count (segmented Star | N) ----------------- */
.repo-actions { margin-left: auto; display: inline-flex; align-items: stretch; }
.repo-actions .star-form { display: inline-flex; }
.btn-star { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-star.on { background: var(--ember); }
.btn-star.on .oct { color: var(--accent); }        /* filled star = status icon */
.repo-actions .star-count {
  display: inline-flex; align-items: center; padding: 0 10px;
  border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  font: 500 0.75rem/1 var(--font-mono); color: var(--fg-muted);
  background: var(--surface); font-variant-numeric: tabular-nums;
}
.repo-actions .star-count:hover { color: var(--fg); background: var(--surface-raised); text-decoration: none; }

/* ---- profile (GitHub-style: sidebar + tabbed main, Guild Hall) --------------- */
.profile { display: grid; grid-template-columns: 296px 1fr; gap: 28px; align-items: start; }
/* min-width:0 lets the main column shrink below its content so the wide heatmap
   scrolls inside .contrib-scroll instead of forcing page-level horizontal scroll. */
.profile-main { min-width: 0; }
.profile-side { display: flex; flex-direction: column; gap: 10px; }
.profile-avatar {
  width: 220px; max-width: 100%; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--border); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font: 500 4rem/1 var(--font-display); color: var(--accent-fg);
  background: oklch(var(--seal-l) 0.14 var(--seal-h, 70));
}
.profile-id { margin-top: 4px; }
.profile-name { font: 550 1.5rem/1.2 var(--font-display); letter-spacing: -0.005em; margin: 0; }
.profile-login { font-size: 1.125rem; color: var(--fg-muted); font-weight: 400; margin: 2px 0 0; }
.profile-bio { font-size: 0.9375rem; margin: 4px 0; }
.profile-meta { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.profile-meta li { display: flex; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--fg-muted); }
.profile-meta .oct { color: var(--fg-muted); flex: 0 0 auto; }
.profile-meta a { color: var(--link); }
.profile-side .btn.block { margin: 4px 0; }

.profile-tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin-bottom: 18px; overflow-x: auto; scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.pt {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px;
  border-top: 2px solid transparent; color: var(--fg); white-space: nowrap;
  font: 500 0.8125rem/1.2 var(--font-ui); letter-spacing: 0.01em;
}
.pt:hover { background: var(--ember); text-decoration: none; }
.pt .oct { color: var(--fg-muted); }
.pt.active, .pt[aria-current="page"] {
  border-top: 2px solid var(--lantern);
  background: linear-gradient(180deg, var(--ember), transparent 70%); font-weight: 600;
}
.pt.active .oct { color: var(--fg); }

.profile-sec { display: flex; align-items: center; gap: 8px; font: 560 1.1875rem/1.3 var(--font-display); margin: 0 0 12px; }
.profile-sec .oct { width: 18px; height: 18px; color: var(--fg-muted); }

/* pinned repos */
.pins { margin-bottom: 24px; }
.pin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pin-card {
  border: 1px solid var(--border); border-radius: var(--r-box);
  background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 6px;
}
.pin-head { display: flex; align-items: center; gap: 7px; font-size: 0.875rem; }
.pin-head .oct { color: var(--fg-muted); flex: 0 0 auto; }
.pin-head a { font-weight: 600; color: var(--link); }
.pin-head .pill { margin-left: auto; }
.pin-desc { font-size: 0.8125rem; color: var(--fg-muted); margin: 0;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pin-desc.none { font-style: italic; opacity: 0.7; }
.pin-foot { display: flex; align-items: center; gap: 14px; margin-top: auto; font-size: 0.75rem; color: var(--fg-muted); }

/* profile repo list */
.prepo-list { list-style: none; margin: 0; padding: 0; }
.prepo { padding: 16px 2px; border-bottom: 1px solid var(--border); }
.prepo:first-child { border-top: 1px solid var(--border); }
.prepo-top { display: flex; align-items: center; gap: 8px; }
.prepo-name { font-size: 1rem; font-weight: 400; color: var(--link); }
.prepo-name b { font-weight: 600; }
.prepo-name .sep { color: var(--fg-muted); margin: 0 2px; }
.prepo-desc { font-size: 0.8125rem; color: var(--fg-muted); margin: 6px 0 0; }
.prepo-meta { display: flex; align-items: center; gap: 16px; margin-top: 8px; font-size: 0.75rem; color: var(--fg-muted); }
.prepo-meta .oct, .pin-foot .oct { width: 14px; height: 14px; }
.meta-stars { color: var(--fg-muted); display: inline-flex; align-items: center; gap: 4px; }
.meta-stars:hover { color: var(--link); }
.meta-size { display: inline-flex; align-items: center; gap: 4px; }

/* contribution heatmap (from the activity feed) */
.contrib { margin-bottom: 24px; }
.contrib-scroll { overflow-x: auto; max-width: 100%; }
.contrib-cal { display: inline-block; }
.contrib-months { display: flex; gap: 3px; margin-bottom: 4px; }
.contrib-months span { flex: 0 0 12px; font-size: 0.625rem; color: var(--fg-muted); white-space: nowrap; }
.contrib-weeks { display: flex; gap: 3px; }
.cweek { display: flex; flex-direction: column; gap: 3px; }
.cday { width: 12px; height: 12px; border-radius: 2px; background: var(--surface); border: 1px solid var(--border); }
.cday[data-lvl="1"] { background: color-mix(in oklch, var(--accent) 28%, var(--surface)); border-color: transparent; }
.cday[data-lvl="2"] { background: color-mix(in oklch, var(--accent) 50%, var(--surface)); border-color: transparent; }
.cday[data-lvl="3"] { background: color-mix(in oklch, var(--accent) 74%, var(--surface)); border-color: transparent; }
.cday[data-lvl="4"] { background: var(--accent); border-color: transparent; }
.cday.cempty { background: transparent; border-color: transparent; }
.contrib-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 8px; font-size: 0.6875rem; color: var(--fg-muted); }
.contrib-legend .cday { width: 11px; height: 11px; }

/* settings: pinned-repo picker */
.pin-picker { display: flex; flex-direction: column; gap: 2px; margin: 10px 0; }
.pin-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); cursor: pointer; }
.pin-opt:hover { background: var(--ember); }
.pin-opt input { width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; }
.pin-opt-name { font-weight: 500; }
.pin-opt .pill { margin-left: auto; }

/* stargazers list */
.stargazers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.stargazer a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-box); color: var(--fg); }
.stargazer a:hover { background: var(--ember); text-decoration: none; }
.sg-id { display: flex; flex-direction: column; min-width: 0; }
.sg-id b { font-size: 0.875rem; }
.sg-id small { font-size: 0.75rem; }

@media (max-width: 820px) {
  .profile { grid-template-columns: 1fr; gap: 18px; }
  .profile-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
  .profile-avatar { width: 84px; font-size: 1.75rem; }
  .profile-id { flex: 1 1 auto; }
  .profile-bio, .profile-meta, .profile-side .btn.block { flex-basis: 100%; }
  .profile-meta { flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
  .pin-grid { grid-template-columns: 1fr; }
}
