:root {
  --ink: #182230;
  --muted: #64748b;
  --line: #d8e1ea;
  --field: #f8fafc;
  --accent: #0f766e;
  --blue: #1d4ed8;
  --high: #b91c1c;
  --low: #15803d;
  --high-bg: #fef2f2;
  --high-line: #fecaca;
  --low-bg: #f0fdf4;
  --low-line: #bbf7d0;
  --warn-bg: #fff8e6;
  --warn-border: #e5b94b;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --shadow: 0 14px 36px rgba(15, 23, 42, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #f5f7fa;
}

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--blue));
  font-size: 15px; font-weight: 900;
}
.brand strong { display: block; font-size: 20px; font-weight: 900; line-height: 1.12; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.2; }
nav { display: flex; align-items: center; gap: 16px; }
nav a { color: #334155; text-decoration: none; font-size: 14px; font-weight: 700; }
nav a:hover { color: var(--blue); }
.language-link { border: 1px solid #cbd5e1; border-radius: 999px; padding: 7px 12px; background: #fff; }

.hero {
  margin-top: 26px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: center; gap: 18px;
}
.eyebrow { font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 4px 0; font-size: 20px; line-height: 1.25; font-weight: 800; }
.hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; max-width: 720px; }
.research-badge {
  border: 1px solid #cbd5e1; border-radius: 999px; padding: 7px 14px;
  background: #fff; color: #334155; font-size: 12px; font-weight: 700; white-space: nowrap;
}

.calculator-grid {
  margin: 22px 0 26px; display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, .9fr); gap: 24px; align-items: start;
}
.card {
  border: 1px solid var(--line); border-radius: 8px; padding: 24px;
  background: #fff; box-shadow: var(--shadow);
}
.card-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.card-heading h2 { margin: 0 0 4px; font-size: 17px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.step-number {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 800;
  display: grid; place-items: center;
}
.field-group { margin-bottom: 14px; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.numeric-input {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--field); padding: 9px 10px; font-size: 15px; font-family: inherit;
}
.numeric-input:focus { outline: 2px solid rgba(29, 78, 216, .16); border-color: var(--blue); background: #fff; }
.numeric-input.initial-value { color: var(--muted); }
.numeric-input.initial-value:focus { color: var(--ink); }
.field-error { color: #9f1239; font-size: 13px; margin: 6px 0 0; }
.demo-note { color: var(--muted); font-size: 12px; margin: 10px 0 0; }
button {
  margin-top: 16px; border: 0; border-radius: 6px; background: var(--blue);
  color: #fff; min-height: 42px; width: 100%; padding: 0 18px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
button:hover { background: #1e40af; }

.result-card { position: sticky; top: 16px; }
.result-placeholder { text-align: center; padding: 18px 0 6px; color: var(--muted); }
.placeholder-ring {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%;
  border: 10px solid #e2e8f0; border-top-color: var(--blue); opacity: .5;
}
.probability-block { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fbfdff; }
.probability-block > span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.probability-block > strong { display: block; font-size: 42px; line-height: 1; font-weight: 800; margin: 10px 0 8px; }
.probability-block > strong.high { color: var(--high); }
.probability-block > strong.low { color: var(--low); }
.probability-block > small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.result-metrics { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0; }
.result-metrics > div > span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.result-metrics > div > strong { display: block; margin-top: 2px; font-size: 16px; }
.risk-pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px;
  border-radius: 6px; font-size: 14px; font-weight: 700;
}
.risk-pill.high { color: #7f1d1d; background: var(--high-bg); border: 1px solid var(--high-line); }
.risk-pill.low { color: #14532d; background: var(--low-bg); border: 1px solid var(--low-line); }
.interpretation { font-size: 13px; line-height: 1.5; margin: 12px 0 0; }

.notice {
  margin-top: 14px; border-left: 4px solid var(--warn-border);
  background: var(--warn-bg); padding: 10px 12px; font-size: 13px; line-height: 1.45;
}
.notice p { margin: 6px 0 0; }
.notice.error { border-left-color: var(--error-border); background: var(--error-bg); }
.notice.warning { border-left-color: var(--warn-border); background: var(--warn-bg); }

.boundary-strip {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 14px 16px; margin-bottom: 26px; display: flex; gap: 10px;
  font-size: 13px; line-height: 1.5; color: var(--muted);
}
.boundary-strip strong { color: var(--ink); white-space: nowrap; }

.page-heading { margin-top: 26px; }
.about-grid { margin: 18px 0 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.about-grid .model-card { grid-column: 1 / -1; }
dl { margin: 0; }
dl > div { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
dl > div:last-child { border-bottom: 0; }
dt { flex: 0 0 160px; font-weight: 700; color: var(--muted); font-size: 13px; }
dd { margin: 0; font-size: 13px; line-height: 1.6; word-break: break-word; }
code { background: var(--field); border: 1px solid var(--line); border-radius: 4px; padding: 2px 6px; font-size: 12px; }

.site-footer { border-top: 1px solid var(--line); padding: 14px 0 28px; color: var(--muted); font-size: 12px; }
.site-footer p { margin: 4px 0; line-height: 1.5; }

@media (max-width: 820px) {
  .hero, .calculator-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
  .header-inner { flex-wrap: wrap; padding: 12px 0; }
}
