:root {
  --paper: rgba(255, 252, 246, 0.92);
  --ink: #1f2330;
  --muted: #5d6474;
  --line: rgba(31, 35, 48, 0.12);
  --teal: #246a73;
  --coral: #dd6e42;
  --sage: #7c9885;
  --gold: #b88a19;
  --rose: #b33951;
  --shadow: 0 18px 50px rgba(65, 42, 12, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(221, 110, 66, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(36, 106, 115, 0.16), transparent 24%),
    radial-gradient(circle at 50% 120%, rgba(124, 152, 133, 0.18), transparent 34%),
    linear-gradient(155deg, #f7f2e8 0%, #ebe2d3 45%, #d8ccb2 100%);
}

.shell {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  margin: 0 0 10px 8px;
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
}

.hero {
  padding: 10px 8px 20px;
  max-width: 960px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--coral);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 0.95;
}

.lede {
  margin: 16px 0 0;
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.65;
}

.hero-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-chip,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-chip {
  background: rgba(255, 252, 245, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 20px rgba(82, 57, 20, 0.08);
}

.badge {
  background: rgba(36, 106, 115, 0.12);
}

.badge[data-confidence="high"] {
  background: rgba(47, 122, 68, 0.13);
  color: #2f7a44;
}

.badge[data-confidence="moderate"] {
  background: rgba(184, 138, 25, 0.14);
  color: #8d6b18;
}

.badge[data-confidence="low"] {
  background: rgba(179, 57, 81, 0.13);
  color: var(--rose);
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.sidebar,
.main-stack,
.support-grid,
.plot-grid {
  display: grid;
  gap: 18px;
}

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

.card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.outcome-card {
  background:
    radial-gradient(circle at top right, rgba(36, 106, 115, 0.12), transparent 36%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(249, 243, 234, 0.92));
}

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

.card-head h2 {
  margin: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.field label,
.metric-label {
  font-size: 0.92rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  gap: 10px;
  align-items: center;
}

.time-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

input[type="number"],
select,
button {
  font: inherit;
}

input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

input:disabled,
select:disabled {
  opacity: 0.62;
}

.unit,
.helper-text {
  color: var(--muted);
}

.helper-text {
  margin: 0;
  line-height: 1.55;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.support-card,
.comparison-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(31, 35, 48, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.62), transparent 38%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(247, 241, 231, 0.76));
}

.highlight-card {
  border-color: rgba(36, 106, 115, 0.22);
  box-shadow: inset 0 0 0 1px rgba(36, 106, 115, 0.08);
}

.metric-label {
  display: block;
  color: var(--muted);
}

.metric-value,
.support-value {
  display: block;
  margin-top: 8px;
  line-height: 1.08;
}

.metric-value {
  font-size: 1.34rem;
}

.support-value {
  font-size: 1.7rem;
}

.plot-wrap {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(31, 35, 48, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.62), transparent 38%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(247, 241, 231, 0.76));
}

.plot-wrap canvas {
  display: block;
  width: 100%;
  height: 320px;
}

.plot-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.plot-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.plot-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.outer-dot {
  background: var(--teal);
}

.inner-dot {
  background: var(--coral);
}

.symmetry-dot {
  background: var(--sage);
}

.asymmetry-dot {
  background: var(--rose);
}

.plot-line-key {
  display: inline-block;
  width: 20px;
  height: 0;
  border-top: 2px dashed var(--gold);
}

.notes-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.notes-list li + li {
  margin-top: 8px;
}

.compact-notes li + li {
  margin-top: 6px;
}

.stat-list {
  display: grid;
  gap: 10px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.reference-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.reference-list li + li {
  margin-top: 10px;
}

.reference-list a,
.site-footer a {
  color: var(--teal);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: none;
  border-radius: 999px;
  background: var(--teal);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.site-footer {
  width: min(1500px, calc(100vw - 28px));
  margin: 0 auto 24px;
  padding-bottom: 10px;
  color: rgba(31, 35, 48, 0.75);
  font-size: 0.92rem;
  line-height: 1.6;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 4px;
}

@media (max-width: 1120px) {
  .app-layout,
  .support-grid,
  .plot-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell,
  .site-footer {
    width: min(100vw - 18px, 100%);
  }

  .card {
    border-radius: 20px;
    padding: 16px;
  }

  .input-row,
  .time-row {
    grid-template-columns: 1fr;
  }
}
