/* baremetal.jimsgarage.dev — zero-framework editorial stylesheet */

:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-alt: #f4f3ef;
  --ink: #161614;
  --ink-muted: #57534e;
  --hairline: #e7e5e4;
  --accent: #c2410c;
  --accent-hover: #9a3412;
  --green: #15803d;
  --amber: #b45309;
  --crimson: #b91c1c;
  --code-bg: #f4f3ef;
  --shadow: 0 1px 2px rgba(22, 22, 20, 0.05), 0 8px 24px rgba(22, 22, 20, 0.06);
  --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Iowan Old Style", "Charter", Georgia, serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0d1014;
  --surface: #151a21;
  --surface-alt: #1c222c;
  --ink: #e8eaed;
  --ink-muted: #9aa4b2;
  --hairline: #262f3d;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --green: #4ade80;
  --amber: #fbbf24;
  --crimson: #f87171;
  --code-bg: #1c222c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img, svg { max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -0.015em; margin: 0.3em 0 0.5em; }
h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); letter-spacing: -0.01em; margin: 0.3em 0 0.5em; }
h3 { font-size: 1.15rem; margin: 0 0 0.5em; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 1rem;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner {
  height: 60px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-left { display: flex; align-items: baseline; gap: 1rem; min-width: 0; }
.brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-dim { color: var(--ink-muted); font-weight: 400; }
.back-link {
  font-size: 0.82rem;
  color: var(--ink-muted);
  text-decoration: none;
  white-space: nowrap;
}
.back-link:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.ram-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--green) 35%, transparent);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.ram-pill:hover { background: color-mix(in srgb, var(--green) 18%, transparent); }
.ram-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
[data-theme="light"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
.menu-btn { display: none; }

.progress-track {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: transparent;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.08s linear;
}

/* ---------- Footprint popover ---------- */
.footprint-popover {
  position: fixed;
  top: 68px;
  right: 1rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  z-index: 150;
}
.footprint-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.footprint-head h2 { font-size: 1.05rem; margin: 0; }
.footprint-sub { font-size: 0.85rem; color: var(--ink-muted); margin: 0.35rem 0 0.75rem; }
.footprint-stats { margin: 0 0 0.75rem; display: grid; gap: 0.35rem; }
.footprint-stats > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem;
  padding: 0.4rem 0.6rem;
  background: var(--surface-alt);
  border-radius: 8px;
}
.footprint-stats dt { font-size: 0.82rem; color: var(--ink-muted); }
.footprint-stats dd { margin: 0; font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.fp-note { font-weight: 400; color: var(--ink-muted); font-size: 0.75rem; }
.fp-resources { display: grid; gap: 0.25rem; margin-bottom: 0.75rem; }
.fp-res {
  display: flex; justify-content: space-between; gap: 0.75rem;
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-bottom: 1px dashed var(--hairline);
}
.fp-res span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footprint-note { font-size: 0.82rem; color: var(--ink-muted); margin: 0; }

/* ---------- Drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 120;
}
.mobile-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(320px, 85vw);
  background: var(--surface);
  border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  z-index: 130;
  padding: 1rem 1.25rem;
  overflow-y: auto;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.drawer-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.drawer-list { list-style: none; margin: 0; padding: 0; }
.drawer-list a {
  display: block;
  padding: 0.7rem 0.5rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--hairline);
  font-size: 1rem;
}
.drawer-list a:hover { color: var(--accent); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 3rem;
}
.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  height: fit-content;
  padding: 0.5rem 0 2rem;
}
.toc-title {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}
.toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--hairline); }
.toc-link {
  display: block;
  padding: 0.4rem 0 0.4rem 0.9rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.88rem;
}
.toc-link:hover { color: var(--ink); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.content { min-width: 0; padding-bottom: 4rem; }
.chapter { padding: 2.75rem 0 1.5rem; border-bottom: 1px solid var(--hairline); scroll-margin-top: 76px; }
.chapter:last-of-type { border-bottom: none; }
.content > section > p { max-width: 68ch; }

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.25rem;
}
.lede { font-size: 1.14rem; color: var(--ink); }
.section-intro { color: var(--ink-muted); font-size: 1.03rem; }

/* ---------- Metric strip ---------- */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  max-width: 1040px;
}
.metric-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.metric-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.metric-label { font-size: 0.85rem; color: var(--ink-muted); line-height: 1.55; display: block; }

/* ---------- Callouts ---------- */
.callout {
  max-width: 68ch;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  border: 1px solid var(--hairline);
  border-left-width: 4px;
  background: var(--surface);
}
.callout-note { border-left-color: var(--accent); }
.callout-takeaway { border-left-color: var(--green); }
.callout-caveat { border-left-color: var(--amber); }

/* ---------- Tabs ---------- */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.5rem 0 1.25rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.75rem;
}
.cmp-tab, .kit-tab {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
}
.cmp-tab:hover, .kit-tab:hover { color: var(--ink); border-color: var(--ink-muted); }
.cmp-tab.active, .kit-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Comparator ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 1040px;
}
.compare-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-top: 4px solid var(--hairline);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}
.compare-old { border-top-color: var(--crimson); }
.compare-new { border-top-color: var(--green); }
.compare-card h3 { font-size: 1.02rem; }
.fact-list { margin: 0; padding-left: 1.15rem; font-size: 0.92rem; }
.fact-list li { margin-bottom: 0.6rem; }
.fact-list li::marker { color: var(--ink-muted); }

.bar-chart {
  max-width: 1040px;
  margin: 1.5rem 0 0.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}
.chart-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}
.chart-title:first-child { margin-top: 0; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) 1fr minmax(80px, auto);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}
.bar-label { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track {
  height: 14px;
  background: var(--surface-alt);
  border-radius: 7px;
  overflow: hidden;
}
.bar {
  height: 100%;
  width: var(--w);
  min-width: 3px;
  border-radius: 7px;
}
.bar-good { background: var(--green); }
.bar-bad { background: var(--crimson); opacity: 0.85; }
.bar-value { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 600; text-align: right; white-space: nowrap; }

/* ---------- Case study ---------- */
.ram-chart {
  max-width: 1040px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  display: grid;
  gap: 1.05rem;
}
.ram-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.ram-name { min-width: 0; }
.ram-val { font-family: var(--font-mono); font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.ram-zero { color: var(--green); }
.ram-track { height: 16px; background: var(--surface-alt); border-radius: 8px; overflow: hidden; }
.ram-bar {
  height: 100%;
  width: var(--w);
  min-width: 3px;
  border-radius: 8px;
  background: var(--ink-muted);
  opacity: 0.65;
}
.ram-bar-hero { background: var(--accent); opacity: 1; }
.ram-bar-zero { background: var(--green); opacity: 1; }
.ram-bar-bad { background: var(--crimson); opacity: 0.85; }
.ram-note { font-size: 0.82rem; color: var(--ink-muted); margin: 0.35rem 0 0; }
.ram-row-hero { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 10px; padding: 0.75rem; margin: -0.35rem -0.75rem; }

/* ---------- Pros & Cons ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.25rem 0 1.5rem; }
.filter-btn {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
}
.filter-btn:hover { color: var(--ink); }
.filter-btn.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  max-width: 1040px;
}
.pc-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  border-top: 4px solid var(--hairline);
}
.pc-card h3 { font-size: 1.02rem; margin-bottom: 0.4rem; }
.pc-card p { font-size: 0.9rem; color: var(--ink-muted); margin: 0; }
.pc-pro { border-top-color: var(--green); }
.pc-con { border-top-color: var(--crimson); }
.pc-myth { border-top-color: var(--amber); }
.pc-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}
.pc-pro .pc-tag { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.pc-con .pc-tag { color: var(--crimson); background: color-mix(in srgb, var(--crimson) 12%, transparent); }
.pc-myth .pc-tag { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.pc-card.pc-hidden { display: none; }

/* ---------- Scorecard ---------- */
.scorecard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  max-width: 1040px;
  align-items: start;
}
.sc-questions { display: grid; gap: 1rem; min-width: 0; }
.sc-question {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  padding: 1rem 1.15rem 1.15rem;
  margin: 0;
  min-width: 0;
}
.sc-question legend {
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0 0.4rem;
}
.sc-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  margin-right: 0.45rem;
}
.q-option {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  margin-top: 0.55rem;
  padding: 0.65rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--surface-alt);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.q-option:hover { border-color: var(--accent); }
.q-option.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 600;
}
.verdict-card {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.verdict-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0 0 0.25rem;
  font-weight: 700;
}
#verdict-title { font-size: 1.3rem; margin: 0 0 0.6rem; }
.verdict-card.verdict-go #verdict-title { color: var(--green); }
.verdict-card.verdict-hybrid #verdict-title { color: var(--amber); }
.verdict-card.verdict-stick #verdict-title { color: var(--crimson); }
#verdict-body { font-size: 0.9rem; color: var(--ink-muted); }
#verdict-body ul { padding-left: 1.1rem; margin: 0.5rem 0; }
#verdict-body li { margin-bottom: 0.35rem; }
.verdict-meter {
  height: 8px;
  background: var(--surface-alt);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0 0.35rem;
}
.verdict-meter-fill {
  height: 100%;
  width: var(--w);
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.25s ease;
}
.verdict-score { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-muted); margin: 0 0 0.9rem; }

.btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--hairline); color: var(--ink-muted); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-muted); }

/* ---------- Stepper ---------- */
.stepper {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0;
  max-width: 1040px;
  display: grid;
  gap: 1rem;
  counter-reset: step;
}
.step {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 1.15rem 1.35rem;
}
.step-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.step p { font-size: 0.93rem; color: var(--ink-muted); margin: 0; max-width: 68ch; }

/* ---------- Tables ---------- */
.table-heading { margin-top: 2.25rem; }
.table-sub { color: var(--ink-muted); font-size: 0.92rem; max-width: 68ch; }
.table-scroll { overflow-x: auto; max-width: 1040px; border: 1px solid var(--hairline); border-radius: 12px; }
.routing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
  background: var(--surface);
  min-width: 640px;
}
.routing-table th, .routing-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.routing-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  background: var(--surface-alt);
}
.routing-table tbody tr:last-child td { border-bottom: none; }
.dim { color: var(--ink-muted); font-weight: 400; }

/* ---------- Agent kit ---------- */
.download-card {
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow);
}
.download-main p { font-size: 0.92rem; color: var(--ink-muted); }
.download-links-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-muted);
  margin: 0 0 0.5rem;
}
.download-links ul { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.download-links li { padding: 0.3rem 0; border-bottom: 1px dashed var(--hairline); }
.download-links li:last-child { border-bottom: none; }
.download-links a { font-family: var(--font-mono); font-size: 0.82rem; overflow-wrap: anywhere; }

.kit-panel { max-width: 1040px; }
.kit-panel > p { max-width: 68ch; }
.mcp-steps { max-width: 68ch; font-size: 0.95rem; }
.mcp-steps li { margin-bottom: 0.45rem; }

.copy-block {
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
  background: var(--surface);
}
.copy-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--hairline);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.copy-block pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  background: var(--code-bg);
}
.copy-block pre code { background: none; padding: 0; font-size: inherit; }
.btn-copy {
  font-size: 0.78rem;
  padding: 0.3rem 0.85rem;
  border-radius: 7px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.btn-copy.copied { border-color: var(--green); color: var(--green); }

.rule-explain { max-width: 68ch; font-size: 0.92rem; color: var(--ink-muted); }
.rule-explain li { margin-bottom: 0.4rem; }

.prompt-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.prompt-pill {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
}
.prompt-pill:hover { color: var(--ink); }
.prompt-pill.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.prompt-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.prompt-view-head h3 { margin: 0.5rem 0; font-size: 1.05rem; }
.model-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
}
#prompt-text { max-height: 420px; overflow-y: auto; }

/* ---------- Footer / toast ---------- */
.site-footer {
  max-width: 68ch;
  padding: 2rem 0 1rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); gap: 2rem; }
}

@media (max-width: 1023px) {
  .toc { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .back-link { display: none; }
  .scorecard { grid-template-columns: minmax(0, 1fr); }
  .verdict-card { position: static; }
  .download-card { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .metric-strip { grid-template-columns: 1fr; }
  .compare-grid { grid-template-columns: 1fr; }
  .ram-pill { font-size: 0.7rem; padding: 0.25rem 0.6rem; }
  .brand-dim { display: none; }
  .bar-row { grid-template-columns: minmax(80px, 120px) 1fr; }
  .bar-value { grid-column: 2; text-align: left; margin-top: -2px; }
  .header-inner { padding: 0 1rem; }
  .layout { padding: 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ram-dot { animation: none; }
  .progress-bar, .verdict-meter-fill, .toast { transition: none; }
}
