:root {
  color-scheme: light;
  --paper: #ffffff;
  --paper-deep: #f4efe6;
  --ink: #28231e;
  --muted: #716a61;
  --faint: #a59c91;
  --line: #e4ddd2;
  --panel: #ffffff;
  --panel-2: #faf7f1;
  --blue: #346e9f;
  --teal: #0598a8;
  --green: #5e8d49;
  --coral: #c23b52;
  --amber: #c58b2b;
  --purple: #7f6bb2;
  --shadow: 0 10px 28px rgba(48, 40, 32, 0.08);
  --radius: 8px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.06;
  background-image:
    linear-gradient(90deg, rgba(45, 37, 29, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(45, 37, 29, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
}

a { color: inherit; }
code, pre { font-family: var(--mono); }

.site-shell {
  display: block;
  min-height: 100vh;
  background: #ffffff;
}

/* brianlovin.com-style sticky page topbar */
.page-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 56px;            /* h-14 */
  padding: 0 12px;
  background: #ffffff;
  font-family: var(--sans);
}

.page-topbar-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  color: #171717;
  text-decoration: none;
  transition: background-color 0.12s ease;
}

.page-topbar-back:hover {
  background: rgba(0, 0, 0, 0.06);
}

.page-topbar-name {
  margin-left: 4px;
  color: #171717;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.page-topbar-name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-topbar-sep {
  color: #d4d4d4;
  font-size: 1.125rem;
  font-weight: 300;
  margin: 0 4px;
  user-select: none;
}

.page-topbar-title {
  color: #171717;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.personal-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-height: 100vh;
  padding: 40px 28px;
  background: #ffffff;
  border-right: 1px solid #f3f4f6;
}

.site-name {
  color: #111827;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

.personal-sidebar nav {
  display: grid;
  gap: 12px;
}

.personal-sidebar nav p {
  margin: 12px 0 4px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.personal-sidebar nav a {
  width: fit-content;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.personal-sidebar nav a:hover,
.personal-sidebar nav a.active {
  color: #111827;
}

.personal-home {
  display: grid;
  align-content: center;
  width: min(720px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 80px 0;
}

.personal-home h1 {
  margin-top: 16px;
}

.personal-home p:not(.eyebrow) {
  max-width: 560px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.personal-profile {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 96px 0 120px;
}

.profile-intro {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 42px;
}

.profile-portrait {
  display: grid;
  place-items: center;
  width: 96px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--faint);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
}

.profile-intro h1 {
  max-width: 620px;
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
}

.profile-intro p {
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.profile-section {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.profile-section h2 {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.profile-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-list a {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(0, 1fr);
  gap: 20px;
  text-decoration: none;
}

.profile-list strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.profile-list span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.profile-list a:hover strong,
.profile-list a:hover span {
  color: var(--coral);
}

/* ---------- brianlovin.com-style home ---------- */
.home-body {
  background: #ffffff;
  color: #171717;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.home-main {
  position: relative;
  display: flex;
  min-height: 100svh;
  width: 100%;
  margin: 0 auto;
}

.home-column {
  display: flex;
  flex-direction: column;
  gap: 64px;
  width: 100%;
  max-width: 42rem; /* matches max-w-2xl */
  margin: 0 auto;
  padding: 64px 16px;
  line-height: 1.6;
}

@media (min-width: 640px) {
  .home-column { padding: 128px 16px; }
}

.home-intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-avatar {
  display: block;
  width: 60px;
  height: 60px;
  margin: 0 0 16px;
  border-radius: 50%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.home-name {
  margin: 0;
  color: #171717;
  font-family: var(--sans);
  font-size: 1.5rem;       /* text-2xl */
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

.home-tagline {
  margin: 0;
  color: #525252;          /* text-secondary */
  font-size: 1.5rem;       /* text-2xl */
  font-weight: 600;
  line-height: 1.6;
  text-wrap: pretty;
}

.home-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-section-label {
  color: #a3a3a3;          /* text-quaternary */
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  user-select: none;
}

.home-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .home-list { gap: 6px; }
}

.home-list li { display: flex; }

.home-list-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-size: 1.25rem;      /* text-xl */
  line-height: 1.6;
  color: inherit;
  text-decoration: none;
}

@media (min-width: 640px) {
  .home-list-item {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
}

.home-list-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.home-list-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}

.home-list-title {
  color: #171717;          /* text-primary */
  font-weight: 500;
  text-underline-offset: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-list-item:hover .home-list-title {
  text-decoration: underline;
}

.home-list-meta {
  flex: 1;
  color: #a3a3a3;          /* text-quaternary */
  font-weight: 400;
  line-height: 1.6;
}

.article-page {
  min-width: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid rgba(228, 221, 210, 0.9);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
}

.brand, .site-header nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--teal);
  border-radius: 50%;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-family: var(--serif);
  font-style: italic;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.site-header nav a:hover { color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(48px, 7vw, 78px);
  width: min(760px, calc(100% - 40px));
  min-height: auto;
  margin: 0 auto;
  padding: clamp(74px, 10vw, 118px) 0 clamp(54px, 7vw, 92px);
}

.eyebrow, .step-label, .stage-kicker, .stats-strip span {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin: 0; }

h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  max-width: 920px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

.hero .eyebrow {
  margin-bottom: 20px;
}

.hero .dek {
  max-width: 760px;
  margin-top: 12px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
  color: #5a524a;
  font-family: var(--serif);
  font-size: clamp(16px, 1.45vw, 20px);
  line-height: 1.34;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.hero-meta ul {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.hero-meta li {
  color: var(--coral);
  font-weight: 650;
  white-space: nowrap;
}

.hero-meta p {
  flex: 0 0 auto;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

.hero-intro {
  margin-top: 54px;
  color: #403a33;
  font-size: 18px;
  line-height: 1.85;
}

.hero-caveat {
  margin-top: 34px;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  color: var(--coral);
  font-size: 14px;
  font-weight: 650;
}

.button.primary { background: transparent; }
.button:hover { transform: translateY(-1px); }

.hero-art {
  position: relative;
  margin: 0;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  transform: none;
}

.hero-art::before { display: none; }

.hero-art img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  background: #fff;
}

.hero-art figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.article-width {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
}

.intro {
  padding: 16px 0 64px;
  color: #403a33;
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.85;
}

.intro p + p { margin-top: 22px; font-size: 0.68em; color: var(--muted); }
.intro code { font-size: 0.72em; }
.dropcap::first-letter {
  float: left;
  margin: 12px 10px 0 0;
  color: var(--ink);
  font-size: 5.2rem;
  font-weight: 700;
  line-height: 2.6rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 0;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto 84px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-strip article {
  min-height: auto;
  padding: 20px 22px;
  text-align: center;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.stats-strip article:last-child { border-right: 0; }

.stats-strip strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.stats-strip small { color: var(--muted); font-weight: 700; }

.story-flow {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  gap: clamp(32px, 5vw, 64px);
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto 80px;
}

.sticky-stage {
  position: sticky;
  top: 48px;
  height: calc(100vh - 96px);
  min-height: 0;
  align-self: start;
  display: flex;
  align-items: center;
}

.stage-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.stage-card::after { display: none; }

.stage-kicker,
.stage-card > h2,
#stageCaption {
  display: none;
}

.stage-card h2 {
  max-width: 260px;
  font-size: clamp(22px, 2.5vw, 34px);
  line-height: 1.08;
}

#stageCaption {
  max-width: 260px;
  margin-top: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2.4vw, 30px);
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms ease;
}

.visual.active {
  opacity: 1;
  visibility: visible;
}

.steps { padding-bottom: 26vh; }
.step {
  min-height: 75vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(60px, 10vh, 110px) 0;
  opacity: 0.55;
  transition: opacity 280ms ease, transform 280ms ease;
}

.step.active { opacity: 1; }
.step h2 {
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.12;
}
.step p:not(.step-label) {
  margin-top: 16px;
  color: #3c352d;
  font-size: 17px;
  line-height: 1.75;
}
.step code, .outro code {
  padding: 0.08em 0.3em;
  border-radius: 4px;
  background: rgba(52, 110, 159, 0.10);
  color: #184a70;
}

.recap-break {
  width: min(980px, calc(100% - 40px));
  margin: clamp(56px, 8vw, 110px) auto;
  padding: clamp(52px, 8vw, 92px) 0;
  text-align: center;
}

.recap-copy {
  max-width: 760px;
  margin: 0 auto;
}

.recap-copy h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
}

.recap-copy p:not(.step-label) {
  margin-top: 16px;
  color: #3c352d;
  font-size: 17px;
  line-height: 1.75;
}

.recap-card {
  width: 100%;
  margin: 34px auto 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.recap-card .recap-flow {
  width: 100%;
}

.results-break {
  width: min(1060px, calc(100% - 40px));
  margin: clamp(56px, 8vw, 112px) auto;
  padding: clamp(52px, 8vw, 92px) 0;
  text-align: center;
}

.results-copy {
  max-width: 820px;
  margin: 0 auto;
}

.results-copy h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
}

.results-copy p:not(.step-label) {
  margin-top: 16px;
  color: #3c352d;
  font-size: 17px;
  line-height: 1.75;
}

.results-copy code {
  padding: 0.08em 0.3em;
  border-radius: 4px;
  background: rgba(52, 110, 159, 0.10);
  color: #184a70;
}

.results-card {
  width: 100%;
  margin: 34px auto 0;
  padding: clamp(12px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.results-card .chart-box {
  width: 100%;
}

.loop-diagram {
  position: relative;
  width: min(460px, 100%);
  aspect-ratio: 1;
  display: block;
}

.loop-node {
  position: absolute;
  z-index: 2;
  width: 150px;
  min-height: 98px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.loop-node.propose {
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
}

.loop-node.evaluate {
  right: 0;
  bottom: 11%;
}

.loop-node.decide {
  left: 0;
  bottom: 11%;
}

.loop-node span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(5, 152, 168, 0.12);
  color: var(--teal);
  font-family: var(--serif);
  font-weight: 800;
}

.loop-node strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
}

.loop-node em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  line-height: 1.4;
}

.loop-path {
  position: absolute;
  inset: 13%;
  z-index: 1;
  border: 2px dashed rgba(165, 156, 145, 0.55);
  border-radius: 50%;
}

.loop-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(190px, 46%);
  padding: 10px 12px;
  border: 1px solid rgba(194, 59, 82, 0.24);
  border-radius: var(--radius);
  background: rgba(194, 59, 82, 0.07);
  text-align: center;
  transform: translate(-50%, -50%);
}

.loop-core strong {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 400;
}

.loop-core span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.split-diagram,
.scope-board,
.code-extract,
.golden-set,
.judge-diagram,
.score-card,
.decision-tree {
  width: min(680px, 100%);
}

.split-diagram {
  padding: 26px;
  border: 1px solid rgba(5, 152, 168, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(5, 152, 168, 0.07), rgba(255, 255, 255, 0.9)),
    #fff;
}

.split-source,
.scope-board article,
.plan-output,
.golden-folder,
.golden-tests span,
.judge-diagram article,
.judge-core,
.score-card > div,
.decision-tree article,
.decision-score,
.useful-panel,
.caveat-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
}

.split-source {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  text-align: center;
}

.split-source::after { display: none; }

.split-source span,
.split-branch span,
.scope-board span,
.golden-folder span,
.judge-diagram span,
.score-card span,
.decision-tree span,
.mini-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.split-source strong,
.split-branch strong,
.scope-board strong,
.golden-folder strong,
.judge-diagram strong,
.judge-core strong,
.score-card strong,
.decision-tree strong,
.useful-panel strong,
.caveat-panel strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.split-branch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin: 20px auto 0;
}

.split-branch article {
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.split-branch article:first-child {
  border-color: rgba(5, 152, 168, 0.30);
  background: rgba(5, 152, 168, 0.08);
}

.split-branch article:last-child {
  border-color: rgba(194, 59, 82, 0.24);
  background: rgba(194, 59, 82, 0.06);
}

.split-branch strong {
  font-size: 24px;
}

.split-branch em,
.loop-node em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
  line-height: 1.45;
}

.scope-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.scope-board article { padding: 18px; }
.scope-board p,
.useful-panel p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.scope-off { opacity: 0.72; }

.code-extract {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  width: min(680px, 100%);
  padding: 24px;
  border: 1px solid rgba(5, 152, 168, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(5, 152, 168, 0.07), rgba(255, 255, 255, 0.9)),
    #fff;
}

.code-parent-label {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.code-parent-label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.code-parent-label strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.code-extract pre {
  margin: 0;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #2d2823;
  border-radius: var(--radius);
  background: #211d18;
  color: #fff7e7;
  font-size: clamp(9px, 1vw, 12px);
  line-height: 1.65;
  white-space: pre-wrap;
}

.extract-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  align-content: center;
  min-width: 0;
}

.extract-list span {
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.extract-list span:nth-child(2) {
  border-left-color: var(--coral);
  background: rgba(194, 59, 82, 0.06);
}

.extract-list span:nth-child(3) {
  border-left-color: var(--green);
  background: rgba(94, 141, 73, 0.08);
}

.plan-output {
  width: min(560px, 100%);
  padding: 18px;
  border-color: rgba(5, 152, 168, 0.26);
  background:
    linear-gradient(180deg, rgba(5, 152, 168, 0.06), rgba(255, 255, 255, 0.9)),
    #fff;
}

.plan-output pre {
  overflow: hidden;
  margin: 12px 0 0;
  padding: 16px;
  border: 1px solid #2d2823;
  border-radius: var(--radius);
  background: #211d18;
  color: #fff7e7;
  font-size: clamp(9px, 1vw, 12px);
  line-height: 1.48;
  white-space: pre-wrap;
}

.plan-output code {
  font-family: var(--mono);
}

.golden-set {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 14px;
  align-items: stretch;
}

.golden-folder {
  display: grid;
  place-content: center;
  padding: 18px;
  background: rgba(197, 139, 43, 0.10);
  text-align: center;
}

.golden-tests {
  display: grid;
  gap: 8px;
}

.golden-tests span {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.judge-diagram {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(170px, 1fr);
  gap: 10px;
  width: min(700px, 100%);
  align-items: center;
}

.judge-backdrop {
  grid-column: 2;
  grid-row: 1;
  z-index: 1;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(194, 59, 82, 0.25);
  border-radius: var(--radius);
  background: rgba(194, 59, 82, 0.08);
  text-align: center;
}

.judge-backdrop strong {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  margin-top: 12px;
}

.judge-backdrop span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.judge-side {
  z-index: 3;
  min-height: 270px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.judge-side strong {
  margin-bottom: 12px;
}

.test-pill {
  margin-top: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #403a33;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.test-pill.miss {
  border-color: rgba(194, 59, 82, 0.32);
  background: rgba(194, 59, 82, 0.06);
}

.judge-lines {
  position: relative;
  z-index: 2;
  grid-column: 2;
  grid-row: 1;
  height: 220px;
}

.judge-lines svg {
  position: absolute;
  inset: 50px -86px 20px;
  width: calc(100% + 172px);
  height: 150px;
  overflow: visible;
}

.judge-lines path {
  fill: none;
  stroke: rgba(94, 141, 73, 0.70);
  stroke-width: 3;
  stroke-dasharray: 7 7;
}

.judge-lines path.bad {
  stroke: rgba(194, 59, 82, 0.65);
}

.mark {
  position: absolute;
  left: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1;
}

.mark.ok {
  border: 1px solid rgba(94, 141, 73, 0.35);
  color: var(--green);
}

.mark.bad {
  border: 1px solid rgba(194, 59, 82, 0.35);
  color: var(--coral);
}

.mark.one { top: 77px; }
.mark.two { top: 116px; }
.mark.three { top: 156px; }

.recap-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: min(700px, 100%);
  align-items: stretch;
}

.recap-flow article {
  position: relative;
  min-height: 172px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
}

.recap-flow article:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;
  z-index: 2;
  width: 8px;
  border-top: 2px solid rgba(165, 156, 145, 0.55);
}

.recap-flow span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(5, 152, 168, 0.12);
  color: var(--teal);
  font-family: var(--serif);
  font-weight: 800;
}

.recap-flow strong {
  display: block;
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
}

.recap-flow em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.recap-flow article:nth-child(2) {
  background: rgba(197, 139, 43, 0.08);
}

.recap-flow article:nth-child(4) {
  background: rgba(194, 59, 82, 0.07);
}

.recap-flow article:nth-child(5) {
  background: rgba(94, 141, 73, 0.08);
}

.score-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.score-card > div { padding: 16px; }
.score-card .score-main {
  grid-column: 1 / -1;
  text-align: center;
  border-color: rgba(94, 141, 73, 0.30);
  background: rgba(94, 141, 73, 0.09);
}

.score-main strong { font-size: 38px; }
.score-main em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.eval-run-diagram {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
}

.eval-run-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.eval-run-heading span,
.single-run > p,
.eval-flow span {
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eval-run-heading strong {
  color: var(--muted);
  font-size: 13px;
}

.run-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.run-chips span {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}

.run-chips .active {
  border-color: rgba(5, 152, 168, 0.34);
  background: rgba(5, 152, 168, 0.10);
  color: var(--teal);
}

.single-run {
  padding: 16px;
  border: 1px solid rgba(5, 152, 168, 0.24);
  border-radius: var(--radius);
  background: rgba(5, 152, 168, 0.05);
}

.single-run > p {
  margin-bottom: 12px;
  color: var(--teal);
}

.eval-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-items: stretch;
}

.eval-flow article {
  position: relative;
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  text-align: center;
}

.eval-flow article:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  z-index: 2;
  width: 9px;
  border-top: 2px solid rgba(165, 156, 145, 0.55);
}

.eval-flow strong {
  color: #403a33;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
}

.eval-flow article:last-child {
  border-color: rgba(194, 59, 82, 0.24);
  background: rgba(194, 59, 82, 0.07);
}

.decision-tree {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(210px, 0.8fr);
  gap: 58px;
  align-items: center;
}

.decision-path {
  display: grid;
  grid-template-columns: 1fr 18px 1fr 18px 1fr;
  align-items: center;
  gap: 8px;
}

.decision-path i {
  display: block;
  border-top: 2px solid rgba(165, 156, 145, 0.65);
}

.decision-score,
.decision-tree article {
  min-height: 118px;
  display: grid;
  align-content: center;
  padding: 14px;
  text-align: center;
}

.decision-score {
  border-color: rgba(194, 59, 82, 0.28);
  background: rgba(194, 59, 82, 0.07);
}

.decision-score strong {
  color: var(--coral);
}

.decision-tree em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.decision-branches {
  position: relative;
  display: grid;
  gap: 14px;
}

.decision-connectors {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -58px;
  width: 58px;
  height: 100%;
  overflow: visible;
}

.decision-connectors path {
  fill: none;
  stroke: rgba(94, 141, 73, 0.62);
  stroke-width: 2.5;
  stroke-dasharray: 7 7;
}

.decision-connectors path.bad {
  stroke: rgba(194, 59, 82, 0.58);
}

.decision-tree article {
  min-height: 120px;
}

.decision-tree .keep {
  border-color: rgba(94, 141, 73, 0.35);
  background: rgba(94, 141, 73, 0.09);
}

.decision-tree .keep span {
  color: var(--green);
}

.decision-tree .revert {
  border-color: rgba(194, 59, 82, 0.30);
  background: rgba(194, 59, 82, 0.07);
}

.decision-tree .revert span {
  color: var(--coral);
}

.repeat-stack {
  position: relative;
  width: min(560px, 100%);
  min-height: 310px;
}

.repeat-stack div {
  position: absolute;
  width: 70%;
  left: 50%;
  transform: translateX(-50%);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 700;
  text-align: center;
}

.repeat-stack div:nth-child(1) { top: 0; opacity: 0.45; }
.repeat-stack div:nth-child(2) { top: 52px; opacity: 0.58; }
.repeat-stack div:nth-child(3) { top: 104px; opacity: 0.72; }
.repeat-stack div:nth-child(4) { top: 156px; opacity: 0.86; }
.repeat-stack div:nth-child(5) { top: 208px; border-color: rgba(94, 141, 73, 0.36); color: var(--green); }

.useful-panel,
.caveat-panel {
  width: min(540px, 100%);
  padding: 24px;
  text-align: center;
}

.useful-panel {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 38px);
  border-color: rgba(5, 152, 168, 0.28);
  background:
    linear-gradient(145deg, rgba(5, 152, 168, 0.12), rgba(94, 141, 73, 0.10) 56%, rgba(255, 255, 255, 0.92)),
    #fff;
  box-shadow: 0 18px 46px rgba(48, 40, 32, 0.12);
}

.signal-head span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.signal-head strong {
  margin-top: 8px;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 0.98;
}

.signal-meter {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(5, 152, 168, 0.20);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
}

.signal-meter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.signal-meter i {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(165, 156, 145, 0.42), rgba(5, 152, 168, 0.85), rgba(94, 141, 73, 0.92));
}

.signal-meter i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-top: 3px solid rgba(94, 141, 73, 0.92);
  border-right: 3px solid rgba(94, 141, 73, 0.92);
  transform: translateY(-50%) rotate(45deg);
}

.signal-meter strong {
  margin: 0;
  color: var(--green);
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
}

.signal-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.signal-flow span {
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  color: #403a33;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.caveat-panel {
  text-align: left;
  border-color: rgba(194, 59, 82, 0.28);
  background: rgba(194, 59, 82, 0.06);
}

.caveat-panel ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.translation-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  width: 100%;
  max-width: 720px;
}
.translation-card {
  min-height: 106px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}
.translation-card.to { background: rgba(5, 152, 168, 0.08); }
.translation-card span, .lesson span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.translation-card strong { display: block; margin: 8px 0 6px; font-family: var(--mono); font-size: clamp(18px, 2vw, 26px); }
.translation-card em { color: var(--muted); font-size: 13px; font-style: normal; font-weight: 500; }
.arrow { display: grid; place-items: center; color: var(--faint); font-family: var(--serif); font-size: 28px; }

.pipeline {
  width: min(680px, 100%);
  margin: 0;
  padding: 0;
  list-style: none;
}
.pipeline li {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}
.pipeline li::after {
  content: "";
  position: absolute;
  left: 28px;
  top: calc(100% - 2px);
  width: 2px;
  height: 16px;
  background: var(--line);
}
.pipeline li:last-child::after { display: none; }
.pipeline span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(5, 152, 168, 0.12);
  color: var(--teal);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
}
.pipeline strong { font-size: 16px; }
.pipeline em { color: var(--muted); font-size: 13px; font-style: normal; }

.leakage-map {
  display: grid;
  grid-template-columns: 1fr 38px 1fr;
  gap: 10px;
  width: min(720px, 100%);
  align-items: center;
}
.leak-card {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}
.leak-card.danger { grid-column: 1 / -1; background: rgba(194, 59, 82, 0.08); }
.leak-card strong { display: block; margin-bottom: 6px; font-size: 16px; }
.leak-card span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--teal);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 800;
}
.seal.one { grid-column: 2; }
.seal.two { grid-column: 2; }
.seal.three { grid-column: 2; }

.chart-box {
  width: 100%;
  padding: 0;
}
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis, .chart-note { fill: var(--muted); font-family: var(--sans); font-size: 12px; font-weight: 600; }
.chart-title { fill: var(--ink); font-family: var(--serif); font-size: 23px; font-weight: 400; }

.keep-ladder {
  width: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 4px 6px 4px 0;
}
.keep-item {
  display: grid;
  grid-template-columns: 40px 1fr 58px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
}
.keep-item .num {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(94, 141, 73, 0.18);
  color: var(--green);
  font-family: var(--serif);
  font-weight: 900;
}
.keep-item strong { display: block; font-size: 13px; line-height: 1.25; }
.keep-item span:not(.num) { color: var(--muted); font-family: var(--mono); font-size: 12px; font-weight: 700; text-align: right; }

.lesson-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: min(660px, 100%);
}
.lesson {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
}
.lesson.good { border-color: rgba(94, 141, 73, 0.35); }
.lesson.bad { border-color: rgba(217, 109, 84, 0.38); }
.lesson.neutral { border-color: rgba(52, 110, 159, 0.34); }
.lesson strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 22px; font-weight: 400; line-height: 1.1; }
.lesson p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.prompt-diff-section {
  width: min(1180px, calc(100% - 40px));
  margin: clamp(48px, 8vw, 108px) auto clamp(72px, 10vw, 132px);
  scroll-margin-top: 84px;
}

.diff-copy {
  max-width: 760px;
  margin: 0 auto 30px;
  text-align: center;
}

.diff-copy h2 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
}

.diff-copy p:not(.step-label) {
  margin-top: 16px;
  color: #3c352d;
  font-size: 17px;
  line-height: 1.7;
}

.diff-explorer {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.round-list {
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  min-width: 0;
}

.round-list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.round-list-header strong {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
}

.round-list-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.round-list-items {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px;
}

.round-button {
  width: 100%;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px 10px;
  align-items: start;
  margin: 0;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.round-button:hover,
.round-button.active {
  border-color: var(--line);
  background: #fff;
}

.round-button.active {
  box-shadow: 0 8px 22px rgba(48, 40, 32, 0.08);
}

.round-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(5, 152, 168, 0.11);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.round-summary {
  min-width: 0;
}

.round-summary strong {
  display: block;
  overflow: hidden;
  color: #403a33;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-summary em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 650;
}

.round-state {
  grid-column: 2;
  width: max-content;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(165, 156, 145, 0.12);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.round-button.keep .round-number,
.round-button.keep .round-state {
  background: rgba(94, 141, 73, 0.14);
  color: var(--green);
}

.round-button.discard .round-number,
.round-button.discard .round-state {
  background: rgba(194, 59, 82, 0.10);
  color: var(--coral);
}

.round-button.crash .round-number,
.round-button.crash .round-state {
  background: rgba(197, 139, 43, 0.16);
  color: var(--amber);
}

.diff-detail {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 28px);
}

.diff-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.diff-toolbar p {
  color: var(--coral);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.diff-toolbar h3 {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 400;
  line-height: 1.05;
}

.diff-status-stack {
  display: grid;
  justify-items: end;
  gap: 8px;
  flex: 0 0 auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-pill.keep {
  border-color: rgba(94, 141, 73, 0.32);
  background: rgba(94, 141, 73, 0.10);
  color: var(--green);
}

.status-pill.discard {
  border-color: rgba(194, 59, 82, 0.30);
  background: rgba(194, 59, 82, 0.08);
  color: var(--coral);
}

.status-pill.crash {
  border-color: rgba(197, 139, 43, 0.35);
  background: rgba(197, 139, 43, 0.12);
  color: var(--amber);
}

.status-pill.base {
  border-color: rgba(52, 110, 159, 0.32);
  background: rgba(52, 110, 159, 0.10);
  color: var(--blue);
}

.diff-status-stack strong {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.diff-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.diff-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.removed-panel {
  border-color: rgba(194, 59, 82, 0.20);
}

.added-panel {
  border-color: rgba(94, 141, 73, 0.24);
}

.diff-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 247, 241, 0.82);
}

.diff-panel-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.diff-panel-head strong {
  color: #403a33;
  font-size: 13px;
}

.diff-lines {
  max-height: 680px;
  min-height: 620px;
  overflow: auto;
  padding: 10px 0;
  background: #fffdf9;
}

.diff-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 12px;
  border-left: 3px solid transparent;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
}

.diff-line span {
  color: var(--muted);
  font-weight: 650;
  text-align: right;
  user-select: none;
  opacity: 0.72;
}

.diff-line code {
  min-width: 0;
  color: #2f2a24;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.diff-line.remove {
  border-left-color: rgba(194, 59, 82, 0.52);
  background: rgba(194, 59, 82, 0.055);
}

.diff-line.remove span {
  color: var(--coral);
}

.diff-line.add {
  border-left-color: rgba(94, 141, 73, 0.55);
  background: rgba(94, 141, 73, 0.065);
}

.diff-line.add span {
  color: var(--green);
}

.diff-line.gap {
  background: rgba(165, 156, 145, 0.055);
}

.diff-line.gap code {
  color: transparent;
}

.diff-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.outro {
  padding: 40px 0 110px;
}
.outro h2 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
}
.outro pre {
  overflow: auto;
  margin: 28px 0 18px;
  padding: 22px;
  border: 1px solid #39332d;
  border-radius: var(--radius);
  background: #211d18;
  color: #fff7e7;
  box-shadow: none;
}
.outro p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}
.outro pre code { padding: 0; color: inherit; background: transparent; }

@media (max-width: 1200px) {
  .site-header { position: relative; flex-direction: column; align-items: flex-start; }
  .hero, .story-flow { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .diff-explorer {
    grid-template-columns: 1fr;
  }
  .round-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .round-list-items {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 270px);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sticky-stage {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    z-index: 5;
  }
  .stage-card { min-height: inherit; }
  .step { min-height: auto; padding: 48px 0; opacity: 1; }
}

@media (max-width: 640px) {
  .site-shell {
    grid-template-columns: 1fr;
  }
  .personal-sidebar {
    position: relative;
    min-height: 0;
    gap: 22px;
    padding: 24px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .site-name {
    font-size: 25px;
  }
  .personal-home {
    align-content: start;
    min-height: auto;
    padding: 64px 0;
  }
  .personal-profile {
    padding: 56px 0 80px;
  }
  .profile-intro,
  .profile-section,
  .profile-list a {
    grid-template-columns: 1fr;
  }
  .profile-intro {
    gap: 22px;
  }
  .profile-section,
  .profile-list a {
    gap: 10px;
  }
  .about-home {
    width: min(560px, calc(100% - 32px));
    padding: 72px 0 88px;
  }
  .about-avatar {
    margin-bottom: 34px;
  }
  .about-copy h1,
  .about-copy p {
    font-size: 21px;
  }
  .about-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .work-icon {
    display: none;
  }
  .about-item-meta {
    justify-self: start;
  }
  .site-header nav { flex-wrap: wrap; }
  .hero-meta { gap: 12px; overflow-x: auto; }
  .hero-intro { font-size: 17px; line-height: 1.75; }
  .stats-strip { grid-template-columns: 1fr; }
  .diff-toolbar,
  .diff-panel-head {
    display: grid;
    justify-items: start;
  }
  .diff-status-stack {
    justify-items: start;
  }
  .diff-panels {
    grid-template-columns: 1fr;
  }
  .diff-lines {
    min-height: 260px;
    max-height: 360px;
  }
  .stats-strip article { border-right: 0; border-bottom: 1px solid var(--line); }
  .stats-strip article:last-child { border-bottom: 0; }
  .sticky-stage { height: auto; min-height: 0; }
  .stage-card { aspect-ratio: 16 / 10; min-height: 0; }
  .loop-diagram { aspect-ratio: auto; display: grid; gap: 10px; }
  .loop-node,
  .loop-core {
    position: static;
    width: 100%;
    min-height: auto;
    transform: none;
  }
  .loop-path { display: none; }
  .split-source {
    padding-bottom: 18px;
  }
  .split-source::after { display: none; }
  .split-branch {
    width: 100%;
    margin: 10px auto 0;
  }
  .split-branch,
  .scope-board,
  .code-extract,
  .golden-set,
  .judge-diagram,
  .recap-flow,
  .eval-flow,
  .score-card,
  .decision-tree,
  .translation-grid,
  .leakage-map {
    grid-template-columns: 1fr;
  }
  .eval-run-heading {
    display: grid;
    gap: 4px;
  }
  .eval-flow article {
    min-height: auto;
  }
  .eval-flow article:not(:last-child)::after { display: none; }
  .decision-path,
  .decision-branches {
    grid-template-columns: 1fr;
  }
  .decision-tree {
    grid-template-columns: 1fr;
  }
  .decision-path i,
  .decision-connectors {
    display: none;
  }
  .judge-backdrop,
  .judge-side,
  .judge-lines {
    grid-column: auto;
    grid-row: auto;
    min-height: auto;
  }
  .judge-lines { display: none; }
  .recap-flow article { min-height: auto; }
  .recap-flow article:not(:last-child)::after { display: none; }
  .extract-list { grid-template-columns: 1fr; }
  .repeat-stack { min-height: 260px; }
  .repeat-stack div { width: 90%; }
  .arrow, .seal { transform: rotate(90deg); justify-self: center; }
  .seal.one, .seal.two, .seal.three { grid-column: auto; }
  .visual { inset: 0; padding: 16px; }
  .keep-item { grid-template-columns: 44px 1fr; }
  .keep-item span:not(.num) { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .button:hover,
  .step.active {
    transform: none;
  }
}
