/* ================================================================
   Muse field guide — night-shift field manual

   Self-contained: tokens, type, components and motion all live here,
   no dependency on the EveryAI site stylesheet. Dark is the designed
   experience; light is a clean day shift, not an afterthought.

   Motion values are deliberate:
     · press feedback 120ms, hover 150ms, panels 200ms
     · strong ease-out on entry, ease-in-out for on-screen movement
     · hover effects only where hover is real (pointer: fine)
     · reduced motion keeps opacity, drops movement
   ================================================================ */

/* ── Tokens ── */
:root {
  --bg0: #e7e9ec;
  --bg: #f1f2f4;
  --bg2: #ffffff;
  --bg3: #ffffff;
  --bg4: #e8eaee;
  --ink: #131519;
  --ink2: #3f444c;
  --mut: #6c7178;
  --line: #dfe2e7;
  --line2: #c6ccd4;

  --sig: #e04a10;
  --sig-hot: #c2430f;
  --sig-ink: #ffffff;
  --sig-soft: rgba(224, 74, 16, 0.1);

  --mint: #0b8455;
  --sky: #0b62c4;
  --amber: #8a5a00;
  --danger: #c62f3b;

  --term-bg: #0a0c0f;
  --term-bg2: #11151b;
  --term-ink: #ece7da;
  --term-mut: #97907f;
  --term-line: #232a34;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1200px;
  --nav-h: 68px;
  --r-sm: 5px;
  --r-md: 9px;

  --shadow-lift: 0 14px 30px -18px rgba(19, 21, 25, 0.35);
}

html.dark {
  --bg0: #07080a;
  --bg: #0b0d10;
  --bg2: #101318;
  --bg3: #141920;
  --bg4: #1c232c;
  --ink: #f3f0e8;
  --ink2: #c9c3b4;
  --mut: #8e887a;
  --line: #20262f;
  --line2: #323b47;

  --sig: #ff5c1f;
  --sig-hot: #ff7a45;
  --sig-ink: #170903;
  --sig-soft: rgba(255, 92, 31, 0.13);

  --mint: #45d99b;
  --sky: #6fb7ff;
  --amber: #ffb224;
  --danger: #ff6b6b;

  --shadow-lift: 0 16px 34px -18px rgba(0, 0, 0, 0.8);
}

/* ── Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

html.uc-theme-switching *,
html.uc-theme-switching *::before,
html.uc-theme-switching *::after {
  transition: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
ol,
ul,
pre,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

h1 em,
h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--sig);
}

a {
  color: inherit;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

::selection {
  background: var(--sig);
  color: var(--sig-ink);
}

:focus-visible {
  outline: 2px solid var(--sig);
  outline-offset: 2px;
  border-radius: 2px;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 28px;
}

.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 {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 200;
  background: var(--sig);
  color: var(--sig-ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: top 150ms var(--ease-out);
}

.skip:focus-visible {
  top: 12px;
  outline-color: var(--ink);
}

/* Chapter marker — the manual's running head */
.chapter {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 18px;
}

.chapter-num {
  display: inline-block;
  color: var(--sig);
  border: 1px solid var(--sig);
  border-radius: 3px;
  padding: 1px 7px;
  margin-right: 10px;
  letter-spacing: 0.08em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 13px 20px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms var(--ease-out), border-color 150ms var(--ease-out),
    color 150ms var(--ease-out), transform 120ms var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-primary {
  background: var(--sig);
  border-color: var(--sig);
  color: var(--sig-ink);
}

@media (pointer: fine) {
  .btn-primary:hover {
    background: var(--sig-hot);
    border-color: var(--sig-hot);
  }
}

.btn-primary[data-copied="true"] {
  background: var(--mint);
  border-color: var(--mint);
  color: #06130d;
}

html.dark .btn-primary[data-copied="true"] {
  color: #06130d;
}

.btn-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

@media (pointer: fine) {
  .btn-ink:hover {
    background: var(--ink2);
    border-color: var(--ink2);
  }
}

.btn-ghost {
  background: transparent;
  border-color: var(--line2);
  color: var(--ink);
}

@media (pointer: fine) {
  .btn-ghost:hover {
    border-color: var(--mut);
  }
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--mut);
  padding: 10px 12px;
}

@media (pointer: fine) {
  .btn-quiet:hover {
    color: var(--sig);
  }
}

.btn-sm {
  font-size: 12.5px;
  padding: 9px 14px;
}

.btn-lg {
  font-size: 15px;
  padding: 16px 28px;
}

/* ── Status strip ── */
.strip-status {
  background: var(--bg0);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mut);
}

.strip-status-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.ss-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ss-left span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mint) 18%, transparent);
}

.ss-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
}

.ss-right a {
  color: var(--mut);
  text-decoration: none;
}

@media (pointer: fine) {
  .ss-right a:hover {
    color: var(--sig);
  }
}

.ss-tag {
  color: var(--mut);
  opacity: 0.75;
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--sig);
  color: var(--sig-ink);
  font-family: var(--font-display);
  font-weight: 750;
  font-size: 20px;
  border-radius: 7px;
  line-height: 1;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-text em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--mut);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink2);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 150ms var(--ease-out), background 150ms var(--ease-out);
}

@media (pointer: fine) {
  .nav-links a:hover {
    color: var(--ink);
    background: var(--sig-soft);
  }
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.palette-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--mut);
  font-size: 15px;
  padding: 7px 9px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

@media (pointer: fine) {
  .palette-btn:hover {
    border-color: var(--sig);
    color: var(--sig);
  }
}

.palette-btn kbd,
.palette-foot kbd,
.palette-row kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg4);
  border: 1px solid var(--line2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink2);
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  color: var(--ink2);
  font-size: 15px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

@media (pointer: fine) {
  .theme-btn:hover {
    border-color: var(--sig);
    color: var(--sig);
  }
}

.theme-btn [data-theme-icon="dark"] {
  display: none;
}

html.dark .theme-btn [data-theme-icon="dark"] {
  display: inline;
}

html.dark .theme-btn [data-theme-icon="light"] {
  display: none;
}

.nav-cta {
  padding: 11px 18px;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line2);
  border-radius: 6px;
  cursor: pointer;
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 1px;
  transition: transform 200ms var(--ease-in-out);
}

.burger[aria-expanded="true"] span:first-child {
  transform: translateY(4px) rotate(45deg);
}

.burger[aria-expanded="true"] span:last-child {
  transform: translateY(-4px) rotate(-45deg);
}

.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 8px 28px 20px;
  background: var(--bg);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav a {
  display: block;
  font-size: 17px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.mobile-nav a:last-child {
  border-bottom: 0;
}

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(900px 320px at 12% -80px, var(--sig-soft), transparent 65%),
    var(--bg);
}

html.dark .hero {
  background:
    radial-gradient(900px 340px at 12% -80px, rgba(255, 92, 31, 0.14), transparent 65%),
    radial-gradient(700px 500px at 105% 120%, rgba(111, 183, 255, 0.06), transparent 60%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 72px;
  align-items: start;
}

.hero-main,
.manual-run {
  min-width: 0;
}

.hero-title {
  font-size: clamp(52px, 6.4vw, 84px);
  margin-bottom: 22px;
}

.hero-deck {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink2);
  max-width: 34rem;
  margin-bottom: 30px;
}

.hero-deck [data-count] {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 7px 7px 7px 16px;
  max-width: 34rem;
  box-shadow: var(--shadow-lift);
  transition: border-color 150ms var(--ease-out);
}

.hero-search:focus-within {
  border-color: var(--sig);
}

.hs-glyph {
  color: var(--mut);
  font-size: 18px;
  flex: none;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  padding: 10px 0;
}

.hero-search input::placeholder {
  color: var(--mut);
}

.hero-search input::-webkit-search-cancel-button {
  display: none;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.ht-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mut);
  margin-right: 4px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 36px;
  margin: 40px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.hero-stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
}

.hero-stats dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
  order: 2;
}

.hero-stats dd.stat-num {
  margin: 0;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  order: 1;
}

/* ── Handoff terminal ── */
.hero-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.terminal {
  background: var(--term-bg);
  border: 1px solid var(--term-line);
  border-radius: 12px;
  overflow: hidden;
  color: var(--term-ink);
  box-shadow: var(--shadow-lift);
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--term-line);
  background: var(--term-bg2);
}

.t-dots {
  display: flex;
  gap: 6px;
}

.t-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--term-line);
}

.t-dots i:first-child {
  background: var(--sig);
}

.t-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--term-mut);
}

.t-live {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mint);
  border: 1px solid color-mix(in srgb, var(--mint) 45%, transparent);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}

.terminal-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 16px 0;
}

.terminal-tabs button {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--term-mut);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 9px 12px;
  cursor: pointer;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

@media (pointer: fine) {
  .terminal-tabs button:hover {
    color: var(--term-ink);
  }
}

.terminal-tabs button.is-active {
  color: var(--term-ink);
  border-bottom-color: var(--sig);
}

.terminal-body {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--term-ink);
  background: transparent;
  padding: 16px;
  margin: 0;
  max-height: 230px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.terminal-body-sm {
  font-size: 12px;
  max-height: 190px;
  margin: 0 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--term-line);
  border-radius: 6px;
}

.terminal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--term-line);
  border-radius: 4px;
}

.terminal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
}

.terminal-actions .btn-ghost {
  border-color: var(--term-line);
  color: var(--term-ink);
}

@media (pointer: fine) {
  .terminal-actions .btn-ghost:hover {
    border-color: var(--term-mut);
  }
}

.terminal .btn-primary {
  background: var(--sig);
  border-color: var(--sig);
}

.t-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--term-mut);
  text-decoration: none;
}

a.t-link:hover {
  color: var(--term-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

span.t-link {
  font-family: var(--font-mono);
  font-size: 11px;
}

.terminal-knows {
  list-style: none;
  margin: 0;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--term-line);
  counter-reset: knows;
}

.terminal-knows li {
  position: relative;
  font-size: 13px;
  color: var(--term-mut);
  padding-left: 30px;
  margin-bottom: 8px;
  counter-increment: knows;
}

.terminal-knows li:last-child {
  margin-bottom: 0;
}

.terminal-knows li::before {
  content: counter(knows);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--sig);
  border: 1px solid var(--sig);
  border-radius: 50%;
}

/* MCP panel */
.mcp-lede {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--term-mut);
  padding: 16px 16px 0;
  margin-bottom: 14px;
}

.mcp-lede [data-count] {
  color: var(--term-ink);
  font-weight: 600;
}

.mcp-url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 16px 12px;
  padding: 10px 10px 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--term-line);
  border-radius: 6px;
}

.mcp-url-row code {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--term-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mcp-url-row .btn {
  flex: none;
}

.mcp-tools {
  list-style: none;
  margin: 0;
  padding: 4px 16px 18px;
}

.mcp-tools li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px dashed var(--term-line);
  font-size: 12.5px;
}

.mcp-tools li:first-child {
  border-top: 0;
}

.mcp-tools code {
  color: var(--sig-hot);
  font-size: 12px;
  white-space: nowrap;
}

.mcp-tools span {
  color: var(--term-mut);
  text-align: right;
}

/* ── Field feed ── */
.feed {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-lift);
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.feed-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sig);
}

.feed-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.feed-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  transition: opacity 200ms var(--ease-out);
}

.feed-title.is-swap {
  opacity: 0;
}

.feed-cat {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mut);
  margin-bottom: 14px;
}

.feed-bar {
  height: 3px;
  background: var(--bg4);
  border-radius: 2px;
  overflow: hidden;
}

.feed-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sig);
  border-radius: 2px;
}

.feed-bar span.is-run {
  transition: width 5s linear;
  width: 100%;
}

/* ── Marquee ── */
.strip {
  border-bottom: 1px solid var(--line);
  background: var(--bg0);
  overflow: hidden;
  padding: 11px 0;
}

.strip-track {
  display: flex;
  width: max-content;
  animation: strip-roll 46s linear infinite;
}

.strip-track span {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mut);
  padding-right: 12px;
  white-space: nowrap;
}

@keyframes strip-roll {
  to {
    transform: translateX(-50%);
  }
}

/* ── Sections ── */
.section {
  padding: 96px 0;
  scroll-margin-top: var(--nav-h);
}

.section-alt {
  background: var(--bg2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.sec-head {
  margin-bottom: 44px;
}

.sec-head h2 {
  font-size: clamp(36px, 4.4vw, 56px);
  max-width: 12em;
}

.sec-head-row {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: end;
}

.sec-deck {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink2);
  margin: 0;
  padding-bottom: 6px;
}

.sec-deck-left {
  margin-bottom: 32px;
  padding-bottom: 0;
}

/* ── Library console ── */
.lib-console {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 20px 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-lift);
}

.section-alt .lib-console {
  background: var(--bg);
}

.uc-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
  margin-bottom: 18px;
}

.uc-tab {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 14px 12px;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

@media (pointer: fine) {
  .uc-tab:hover {
    color: var(--ink);
  }
}

.uc-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--sig);
}

.uc-tab-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mut);
  background: var(--bg4);
  border-radius: 20px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

.uc-tab.is-active .uc-tab-count {
  color: var(--sig);
  background: var(--sig-soft);
}

.lib-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.lib-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 0 12px 0 14px;
  transition: border-color 150ms var(--ease-out);
}

.section-alt .lib-search {
  background: var(--bg2);
}

.lib-search:focus-within {
  border-color: var(--sig);
}

.lib-search .hs-glyph {
  font-size: 16px;
  margin-right: 10px;
}

.lib-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 0;
}

.lib-search input::placeholder {
  color: var(--mut);
}

.lib-search input::-webkit-search-cancel-button {
  display: none;
}

.uc-clear {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mut);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
}

.uc-clear[hidden] {
  display: none;
}

@media (pointer: fine) {
  .uc-clear:hover {
    color: var(--sig);
  }
}

.uc-select {
  flex: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
}

.section-alt .uc-select {
  background: var(--bg2);
}

.lib-filter-block {
  margin-bottom: 14px;
}

.lib-filter-block:last-of-type {
  margin-bottom: 6px;
}

.lib-filter-block[hidden] {
  display: none;
}

.lib-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mut);
  margin-bottom: 10px;
}

.uc-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.uc-chip {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink2);
  background: transparent;
  border: 1px solid var(--line2);
  border-radius: 20px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out),
    background 150ms var(--ease-out);
}

@media (pointer: fine) {
  .uc-chip:hover {
    border-color: var(--sig);
    color: var(--sig);
  }
}

.uc-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.uc-chip-count {
  opacity: 0.6;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  margin-left: 2px;
}

.lib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.uc-count {
  font-size: 13.5px;
  color: var(--mut);
  margin: 0;
}

.uc-count strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.lib-toolbar .btn-quiet[hidden] {
  display: none;
}

/* ── Case cards ── */
.uc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.uc-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  min-width: 0;
  animation: card-in 340ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 30ms);
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@media (pointer: fine) {
  .uc-card:hover {
    border-color: var(--line2);
    box-shadow: var(--shadow-lift);
  }
}

.uc-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.uc-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.uc-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.is-muse .uc-badge {
  color: var(--sig);
}

.is-muse .uc-badge-dot {
  background: var(--sig);
}

.is-bot .uc-badge {
  color: var(--sky);
}

.is-bot .uc-badge-dot {
  background: var(--sky);
}

.uc-cat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--mut);
  white-space: nowrap;
}

.uc-card-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.uc-story {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink2);
  margin-bottom: 14px;
}

.uc-integrations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.uc-int-chip {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink2);
  background: var(--bg4);
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 4px 9px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

@media (pointer: fine) {
  .uc-int-chip:hover {
    border-color: var(--sky);
    color: var(--sky);
  }
}

.uc-prompt-wrap {
  margin-bottom: 16px;
}

.uc-prompt {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.section-alt .uc-prompt {
  background: var(--bg2);
}

.uc-card.is-open .uc-prompt {
  display: block;
  max-height: 320px;
  overflow-y: auto;
}

.uc-prompt-toggle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--sig);
  background: transparent;
  border: 0;
  padding: 8px 0 0;
  cursor: pointer;
}

.uc-prompt-toggle:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.uc-noprompt {
  font-size: 13px;
  font-style: italic;
  color: var(--mut);
  margin-bottom: 16px;
}

.uc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.uc-card-footer .btn {
  font-size: 13px;
  padding: 10px 16px;
}

.uc-card-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  text-decoration: none;
  white-space: nowrap;
}

@media (pointer: fine) {
  .uc-card-link:hover {
    color: var(--sig);
  }
}

.uc-tag-noprompt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 4px;
  padding: 4px 9px;
}

.uc-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 24px;
  border: 1px dashed var(--line2);
  border-radius: 10px;
  color: var(--mut);
  font-size: 15px;
}

.uc-empty strong {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 8px;
}

.uc-skeleton {
  min-height: 300px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}

.uc-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--sig-soft) 50%, transparent 70%);
  animation: skeleton-sheen 1.4s var(--ease-in-out) infinite;
}

@keyframes skeleton-sheen {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

/* Pager */
.uc-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 36px;
}

.uc-pager-btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 7px;
  padding: 11px 22px;
  cursor: pointer;
  transition: border-color 150ms var(--ease-out);
}

.uc-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

@media (pointer: fine) {
  .uc-pager-btn:not(:disabled):hover {
    border-color: var(--sig);
    color: var(--sig);
  }
}

.uc-pager-info {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mut);
  font-variant-numeric: tabular-nums;
}

.uc-pager-info strong {
  color: var(--ink);
}

.uc-source-note {
  text-align: center;
  font-size: 14px;
  color: var(--mut);
  margin-top: 28px;
}

.uc-source-note[hidden] {
  display: none;
}

.uc-source-note a {
  color: var(--sig);
}

/* ── Chief of Staff ── */
.chief-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.chief-grid h2,
.submit-grid h2 {
  font-size: clamp(32px, 3.6vw, 46px);
  margin-bottom: 20px;
}

.chief-points {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.chief-points li {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.chief-points li:last-child {
  border-bottom: 1px solid var(--line);
}

.chief-points strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.chief-points span {
  font-size: 14.5px;
  color: var(--ink2);
  line-height: 1.6;
}

.fine {
  font-size: 14px;
  color: var(--mut);
  margin-top: 20px;
  margin-bottom: 0;
}

.fine a {
  color: var(--sig);
}

/* Panels */
.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}

.section-alt .panel {
  background: var(--bg);
}

.panel-tight {
  box-shadow: none;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sig);
}

.panel-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mut);
  text-align: right;
}

.panel-pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink2);
  padding: 20px;
  margin: 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.panel-pre-tall {
  max-height: 420px;
  min-height: 300px;
}

.panel-pre:empty::before {
  content: "Loading…";
  color: var(--mut);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
}

/* ── Field manual ── */
.manual-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 72px;
}

.manual-h {
  font-size: 26px;
  margin-bottom: 10px;
}

.manual-sub {
  font-size: 15px;
  color: var(--ink2);
  margin-bottom: 28px;
  max-width: 36rem;
}

.run-steps {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  counter-reset: run;
}

.run-steps li {
  position: relative;
  padding: 13px 0 13px 46px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink2);
  counter-increment: run;
}

.run-steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.run-steps li::before {
  content: counter(run, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 15px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--sig);
}

.run-steps strong {
  color: var(--ink);
}

.loop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 28px;
}

.uc-loop {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.uc-loop-index {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--sig);
}

.uc-loop strong {
  display: block;
  font-size: 15.5px;
  line-height: 1.35;
  margin: 6px 0 6px;
}

.uc-loop p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--mut);
  margin: 0;
}

.guard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 48px;
}

.uc-guard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.uc-guard strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 650;
}

.uc-guard strong::before {
  content: "» ";
  color: var(--amber);
}

.uc-guard p {
  font-size: 14.5px;
  color: var(--ink2);
  margin: 0;
  max-width: 34rem;
}

/* ── Submit ── */
.submit-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.form {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-lift);
}

.field {
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink2);
  margin-bottom: 8px;
}

.optional {
  color: var(--mut);
  font-weight: 400;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 7px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.field textarea {
  resize: vertical;
  min-height: 0;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--mut);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--sig);
  box-shadow: 0 0 0 3px var(--sig-soft);
}

.hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 6px;
}

.uc-form-status {
  font-size: 14px;
  color: var(--mut);
}

.uc-form-status:empty {
  display: none;
}

.uc-form-status.is-ok {
  color: var(--mint);
}

.uc-form-status.is-error {
  color: var(--danger);
}

/* ── Open source ── */
.oss-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.oss-card {
  display: flex;
  flex-direction: column;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  text-decoration: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

@media (pointer: fine) {
  .oss-card:hover {
    border-color: var(--line2);
    box-shadow: var(--shadow-lift);
  }
}

.oss-card .panel-label {
  margin-bottom: 12px;
}

.oss-card h3 {
  font-size: 20px;
  line-height: 1.25;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}

.oss-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink2);
  margin-bottom: 18px;
}

.oss-card p code {
  color: var(--sig);
}

.card-link {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

@media (pointer: fine) {
  .oss-card:hover .card-link {
    color: var(--sig);
  }
}

.terminal-wide {
  max-width: 100%;
}

.terminal-wide .terminal-body {
  max-height: none;
  font-size: 13px;
}

/* ── Sources ledger ── */
.ledger {
  border-top: 1px solid var(--line);
  margin-bottom: 24px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 150ms var(--ease-out);
}

a.ledger-row:hover {
  background: var(--sig-soft);
}

.ledger-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  border: 1px solid var(--line2);
  border-radius: 5px;
  padding: 6px 8px;
  white-space: nowrap;
}

.tag-muse {
  color: var(--sig);
  border-color: var(--sig);
}

.tag-crowd {
  color: var(--sky);
  border-color: var(--sky);
}

.tag-bot {
  color: var(--mint);
  border-color: var(--mint);
}

.tag-exa {
  color: var(--amber);
  border-color: var(--amber);
}

.ledger-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ledger-main strong {
  font-size: 16px;
}

.ledger-main span {
  font-size: 14px;
  color: var(--mut);
}

.ledger-count {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  min-width: 3ch;
  text-align: right;
}

.sync-line {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mut);
  margin-bottom: 28px;
}

.sync-line strong {
  color: var(--ink);
}

.disclaimer {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--mut);
  max-width: 62rem;
  margin: 0;
  padding-top: 24px;
  border-top: 1px dashed var(--line2);
}

/* ── Footer ── */
.footer {
  background: var(--bg0);
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-brand p {
  margin: 0;
  font-size: 14px;
  color: var(--mut);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand strong {
  color: var(--ink);
  font-size: 15px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-content: start;
}

.footer-nav a {
  font-size: 14px;
  color: var(--ink2);
  text-decoration: none;
}

@media (pointer: fine) {
  .footer-nav a:hover {
    color: var(--sig);
  }
}

.footer-fine {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--mut);
  margin: 8px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ── Command palette ── */
.palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 5, 7, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 20px 20px;
}

.palette[hidden] {
  display: none;
}

.palette-card {
  width: 100%;
  max-width: 620px;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 80px -24px rgba(0, 0, 0, 0.55);
  animation: palette-in 180ms var(--ease-out);
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.palette-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.palette-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
}

.palette-row input::placeholder {
  color: var(--mut);
}

.palette-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}

.palette-empty {
  font-size: 14px;
  color: var(--mut);
  text-align: center;
  padding: 28px 16px;
  margin: 0;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.palette-item.is-active {
  background: var(--sig-soft);
}

.palette-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid var(--line2);
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--mut);
}

.palette-item[data-source="muse"] .palette-badge {
  color: var(--sig);
  border-color: var(--sig);
}

.palette-item[data-source="bot"] .palette-badge {
  color: var(--sky);
  border-color: var(--sky);
}

.palette-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.palette-title {
  font-size: 14px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-cat {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--mut);
}

.palette-foot {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--mut);
}

.palette-foot span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.palette-count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* ── Toast ── */
.uc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 400;
  font-size: 14px;
  font-weight: 500;
  color: var(--term-ink);
  background: var(--term-bg2);
  border: 1px solid var(--term-line);
  border-radius: 8px;
  padding: 12px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out);
  max-width: calc(100vw - 40px);
  text-align: center;
}

.uc-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Reveal on scroll ── */
html.js .rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

html.js .rv.is-in {
  opacity: 1;
  transform: none;
}

/* ── Responsive ── */
@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-side {
    position: static;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
  }

  .sec-head-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .uc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chief-grid,
  .submit-grid,
  .manual-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .oss-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .nav-links,
  .nav-cta,
  .ss-tag {
    display: none;
  }

  .burger {
    display: flex;
  }

  .hero-side {
    grid-template-columns: 1fr;
  }

  .loop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guard-grid {
    grid-template-columns: 1fr;
  }

  .ledger-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ledger-tag {
    justify-self: start;
  }

  .ledger-count {
    text-align: left;
    font-size: 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 0 18px;
  }

  .section {
    padding: 64px 0;
  }

  .hero-grid {
    padding-top: 48px;
    padding-bottom: 56px;
  }

  .hero-title {
    font-size: 52px;
  }

  .hero-deck {
    font-size: 16.5px;
  }

  .hero-search {
    flex-wrap: wrap;
  }

  .hero-search .btn {
    width: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .uc-grid {
    grid-template-columns: 1fr;
  }

  .lib-search-row {
    flex-direction: column;
  }

  .uc-select {
    padding: 12px;
  }

  .loop-grid,
  .oss-grid {
    grid-template-columns: 1fr;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .form {
    padding: 20px;
  }

  .palette {
    padding: 8vh 12px 12px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .strip-track {
    animation: none;
  }

  html.js .rv {
    opacity: 1;
    transform: none;
  }

  .uc-card {
    animation: none;
  }
}
