/* ==========================================================
   Reference Interval Studio — Design System
   Editorial / scientific-journal aesthetic
   ========================================================== */

:root {
  /* Palette */
  --ink: #0F1419;
  --ink-2: #1C2128;
  --ink-soft: #3D434B;
  --ink-mute: #6B7280;
  --ink-faint: #9AA0A6;
  --line: #E6E2D7;
  --line-soft: #EFEBE0;
  --surface: #FAF7EE;
  --surface-2: #F4F0E3;
  --paper: #FDFBF5;
  --white: #FFFFFF;

  /* Accents */
  --accent: #0F766E;           /* muted teal */
  --accent-hover: #0B5C55;
  --accent-soft: #D4E9E5;
  --accent-warm: #B45309;      /* amber for warnings/emphasis */
  --accent-warm-soft: #FBE8D1;
  --danger: #9F1239;
  --danger-soft: #FADDE2;
  --ok: #166534;
  --ok-soft: #D6EBDA;

  /* Type */
  --serif: 'Fraunces', 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Space */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(15,20,25,0.04), 0 1px 3px rgba(15,20,25,0.03);
  --shadow-2: 0 4px 14px rgba(15,20,25,0.06), 0 2px 6px rgba(15,20,25,0.04);
  --shadow-3: 0 20px 40px -12px rgba(15,20,25,0.12), 0 8px 16px rgba(15,20,25,0.06);

  /* Motion */
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1100px 700px at 85% -20%, rgba(15,118,110,0.05), transparent 60%),
    radial-gradient(900px 600px at -10% 20%, rgba(180,83,9,0.04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.05; font-weight: 500; }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.25rem); line-height: 1.15; }
h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.005em; }

p { margin: 0; }

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-2);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin: 0 0 20px 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 238, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 9px;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}
.site-nav { display: flex; gap: 28px; }
.nav-link {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: color .2s var(--ease);
}
.nav-link:hover { color: var(--accent); }

/* ===== Hero ===== */
.hero {
  padding: 100px 0 80px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}
.hero-title { margin-top: 6px; }
.hero-desc {
  font-size: 1.07rem;
  color: var(--ink-soft);
  max-width: 560px;
  margin: 32px 0 40px;
  line-height: 1.65;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.stat-divider {
  width: 1px;
  height: 30px;
  background: var(--line);
}
.stat-num {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-num span {
  font-size: 1.2rem;
  color: var(--accent);
  margin-left: 2px;
}
.stat-label {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-aside { display: grid; gap: 20px; }
.aside-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.aside-card-accent {
  background: linear-gradient(180deg, var(--paper), var(--surface-2));
  border-color: var(--line-soft);
}
.aside-caption {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.aside-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
  padding: 0;
  border: 0;
}
.aside-text {
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.6;
}
.aside-cite {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--ink-mute);
  letter-spacing: 0.01em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 22px;
  border-radius: 23px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 0.93rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all .18s var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover {
  border-color: var(--ink);
  background: var(--paper);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-lg { height: 54px; padding: 0 30px; font-size: 1rem; border-radius: 27px; }

/* ===== Workflow sections ===== */
.workflow { padding: 20px 0 120px; }

.step {
  padding: 64px 0 0;
  margin-top: 48px;
  border-top: 1px solid var(--line);
}
.step:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 24px;
}

.step-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: baseline;
  margin-bottom: 36px;
}
.step-number {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
}
.step-title { font-size: 1.75rem; }
.step-subtitle {
  margin-top: 8px;
  color: var(--ink-mute);
  font-size: 0.95rem;
}

/* ===== Method cards ===== */
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.method-card {
  position: relative;
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  cursor: pointer;
  transition: all .22s var(--ease);
}
.method-card input { position: absolute; opacity: 0; pointer-events: none; }
.method-card:hover {
  border-color: var(--ink-faint);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.method-card:has(input:checked) {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 2px var(--ink), var(--shadow-2);
}
.method-card:has(input:checked) .method-tag {
  background: var(--ink);
  color: var(--paper);
}
.method-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 12px;
  color: var(--ink);
  margin-bottom: 24px;
  transition: all .2s var(--ease);
}
.method-card:has(input:checked) .method-icon {
  background: var(--accent-soft);
  color: var(--accent);
}
.method-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--surface-2);
  padding: 4px 10px;
  border-radius: 10px;
  margin-bottom: 14px;
}
.method-title {
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.method-desc {
  color: var(--ink-soft);
  font-size: 0.93rem;
  line-height: 1.6;
  margin-bottom: 20px;
}
.method-meta {
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}
.method-meta li {
  font-size: 0.82rem;
  color: var(--ink-mute);
  padding-left: 16px;
  position: relative;
}
.method-meta li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
  margin-bottom: 24px;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 0;
  background: transparent;
  color: var(--ink-mute);
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 9px;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.tab:hover { color: var(--ink-2); }
.tab.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

.tab-panels { position: relative; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .3s var(--ease); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Upload ===== */
.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 56px 40px;
  background: var(--paper);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all .22s var(--ease);
  text-align: center;
}
.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.upload-icon {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-radius: 18px;
  color: var(--ink-soft);
}
.upload-zone:hover .upload-icon,
.upload-zone.drag .upload-icon {
  background: var(--paper);
  color: var(--accent);
}
.upload-primary {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
}
.upload-primary u {
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}
.upload-secondary {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-top: 6px;
  font-family: var(--mono);
}

.file-info {
  margin-top: 20px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--ink);
}
.chip-remove {
  width: 22px;
  height: 22px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink-mute);
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.chip-remove:hover { background: var(--ink); color: var(--paper); }

.column-mapper {
  margin-top: 24px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.mapper-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}
.mapper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.mapper-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mapper-field span {
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}
.mapper-field span em {
  color: var(--danger);
  font-style: normal;
  font-family: var(--sans);
}
.mapper-field select {
  height: 42px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s var(--ease);
}
.mapper-field select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== Manual entry ===== */
.manual-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.manual-label {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.manual-help {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-bottom: 16px;
}
#manualInput {
  width: 100%;
  min-height: 200px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s var(--ease);
}
#manualInput:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}
.manual-meta {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-mute);
  font-family: var(--mono);
}

/* ===== Sample cards ===== */
.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.sample-card {
  text-align: left;
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s var(--ease);
  font-family: var(--sans);
}
.sample-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.sample-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.sample-desc {
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.sample-range {
  margin-top: 10px;
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 4px;
}

/* ===== Config cards ===== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.config-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
}
.config-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.config-input,
.config-input-sm {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 0.94rem;
  color: var(--ink);
  transition: border-color .15s var(--ease);
}
.config-input:focus,
.config-input-sm:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--paper);
}
.config-input-sm { width: 90px; }
.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.inline-field span {
  font-size: 0.85rem;
  color: var(--ink-mute);
  min-width: 32px;
}
.range-inputs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.config-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--ink-mute);
  line-height: 1.5;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 8px;
}
.segmented label {
  position: relative;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented span {
  display: block;
  padding: 7px 10px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-mute);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.segmented span:hover { color: var(--ink); }
.segmented input:checked + span {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}

/* Toggle */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 6px;
}
.toggle input { display: none; }
.toggle-slider {
  width: 40px;
  height: 22px;
  background: var(--line);
  border-radius: 12px;
  position: relative;
  transition: background .2s var(--ease);
}
.toggle-slider::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform .22s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: var(--accent); }
.toggle input:checked + .toggle-slider::after { transform: translateX(18px); }
.toggle-text {
  font-size: 0.88rem;
  color: var(--ink);
}

/* Action bar */
.action-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding-top: 12px;
}

/* ===== Results ===== */
.step-results .step-header {
  grid-template-columns: auto 1fr auto;
}

.result-headline {
  margin-bottom: 32px;
  padding: 36px 40px;
  background: linear-gradient(140deg, var(--ink) 0%, #1F2937 100%);
  color: var(--paper);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.result-headline::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(15,118,110,0.4), transparent 70%);
  pointer-events: none;
}
.headline-analyte {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(250,247,238,0.6);
  margin-bottom: 10px;
}
.headline-title {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 400;
  color: rgba(250,247,238,0.9);
  margin-bottom: 18px;
}
.headline-range {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--serif);
  font-weight: 500;
}
.headline-lower,
.headline-upper {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--paper);
}
.headline-dash {
  font-size: 2rem;
  color: rgba(250,247,238,0.4);
}
.headline-unit {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(250,247,238,0.6);
  margin-left: 6px;
}
.headline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(250,247,238,0.12);
}
.headline-meta-item {
  font-size: 0.86rem;
}
.headline-meta-label {
  color: rgba(250,247,238,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  margin-bottom: 4px;
}
.headline-meta-val {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--paper);
}

/* Result grid */
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}
.result-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.result-block-wide { grid-column: 1 / -1; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}
.block-title { font-size: 1.05rem; font-weight: 600; }
.block-note {
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-family: var(--mono);
}

/* Chart wrapper */
.chart-wrap {
  position: relative;
  height: 320px;
  width: 100%;
}

/* Summary list */
.summary-list {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 18px;
  margin: 0;
}
.summary-list dt {
  font-size: 0.85rem;
  color: var(--ink-mute);
  align-self: center;
}
.summary-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
}

/* Outlier list */
.outlier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed var(--line-soft);
}
.outlier-row:last-child { border-bottom: 0; }
.outlier-val {
  font-family: var(--mono);
  color: var(--ink);
  font-weight: 500;
}
.outlier-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}
.outlier-tag-hi {
  background: var(--danger-soft);
  color: var(--danger);
}
.outlier-tag-lo {
  background: var(--accent-soft);
  color: var(--accent);
}
.outlier-empty {
  font-size: 0.88rem;
  color: var(--ink-mute);
  padding: 8px 0;
}

/* Partition */
.partition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.partition-table th,
.partition-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.partition-table th {
  font-weight: 600;
  color: var(--ink-mute);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.partition-table td.mono {
  font-family: var(--mono);
  color: var(--ink);
}
.partition-verdict {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.partition-verdict.split {
  background: var(--accent-warm-soft);
  color: var(--accent-warm);
  border: 1px solid rgba(180,83,9,0.18);
}
.partition-verdict.keep {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid rgba(22,101,52,0.16);
}

/* Verify */
.verify-judgment {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}
.verify-judgment.pass {
  background: var(--ok-soft);
  border: 1px solid rgba(22,101,52,0.2);
}
.verify-judgment.caution {
  background: var(--accent-warm-soft);
  border: 1px solid rgba(180,83,9,0.24);
}
.verify-judgment.fail {
  background: var(--danger-soft);
  border: 1px solid rgba(159,18,57,0.22);
}
.verify-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--ink);
}
.verify-text-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.verify-text-body {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.verify-detail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.verify-detail-item {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.verify-detail-label {
  font-size: 0.72rem;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.verify-detail-val {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
  font-weight: 500;
}

/* Method notes */
.method-notes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 32px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.note-item strong {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

/* ===== About ===== */
.about {
  padding: 100px 0 120px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: start;
}
.about-title { margin-bottom: 18px; }
.about-desc {
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 520px;
}
.refs-title {
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 600;
}
.refs-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.refs-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ===== Footer ===== */
.site-footer {
  padding: 36px 0;
  background: var(--ink);
  color: rgba(250,247,238,0.7);
  font-size: 0.82rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-meta {
  font-family: var(--mono);
  color: rgba(250,247,238,0.4);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  padding: 14px 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-3);
  opacity: 0;
  transition: all .3s var(--ease);
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { background: var(--danger); }
.toast.warn { background: var(--accent-warm); }

/* ===== Responsive ===== */
@media (max-width: 1080px) {
  .method-grid,
  .config-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 56px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
}
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .hero { padding: 56px 0 48px; }
  .method-grid,
  .config-grid,
  .sample-grid,
  .mapper-grid,
  .result-grid,
  .verify-detail,
  .method-notes { grid-template-columns: 1fr; }
  .step-header { grid-template-columns: 1fr; gap: 12px; }
  .step-number { font-size: 1.8rem; }
  .hero-stats { flex-wrap: wrap; gap: 20px; }
  .stat-divider { display: none; }
  .header-inner { height: 60px; }
  .brand-sub { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Print */
@media print {
  .site-header, .site-footer, .step:not(.step-results), .hero, .about { display: none; }
  body { background: white; }
  .result-block { break-inside: avoid; }
}
