:root {
  color-scheme: light;
  --ink: #17363a;
  --muted: #536b6e;
  --teal: #096760;
  --teal-soft: #dcece8;
  --lime: #c8ed82;
  --sand: #d99b42;
  --surface: #ffffff;
  --canvas: #f4f7f4;
  --border: #d4e1da;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); }
button, select, input { font: inherit; }
a { color: var(--teal); }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0; }
.hero { background: linear-gradient(120deg, #17363a, #096760); color: white; border-radius: 22px; padding: 30px 34px; }
.hero h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 4.2rem); letter-spacing: -0.045em; }
.hero p { max-width: 760px; margin: 10px 0 0; color: #e5f2ee; font-size: 1.05rem; line-height: 1.6; }
.hero .eyebrow { margin: 0 0 5px; color: var(--lime); font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.notice { margin: 18px 0; padding: 14px 17px; border: 1px solid #a7cec5; border-radius: 12px; background: #e8f4f0; line-height: 1.5; }
.tabs { display: flex; gap: 6px; margin: 22px 0 18px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab { border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); padding: 12px 14px; white-space: nowrap; cursor: pointer; font-weight: 700; }
.tab:hover { color: var(--teal); }
.tab:focus-visible, .button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #7acdc2; outline-offset: 2px; }
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.panel { animation: reveal .18s ease-out; }
.panel h2 { margin: 6px 0 8px; font-size: 1.65rem; }
@keyframes reveal { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.metrics { display: grid; gap: 14px; margin: 18px 0 8px; }
.metrics.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metrics.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metrics.compact { margin-top: 14px; }
.metric { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 5px 18px rgb(23 54 58 / 5%); }
.metric span { display: block; color: var(--muted); font-size: .86rem; }
.metric strong { display: block; margin-top: 6px; font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.03em; overflow-wrap: anywhere; }
.caption { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.chart-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 18px; }
.chart { min-height: 390px; border: 1px solid var(--border); border-radius: 15px; overflow: hidden; background: white; }
.chart.wide { margin-top: 16px; min-height: 470px; }
.form-grid { display: grid; gap: 16px; align-items: start; margin-top: 18px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label, legend { color: var(--ink); font-size: .9rem; font-weight: 700; }
select, input[type="number"] { width: 100%; margin-top: 7px; border: 1px solid #b9c9c2; border-radius: 9px; background: white; color: var(--ink); padding: 10px 11px; }
select[multiple] { min-height: 116px; padding: 6px; }
select[multiple] option { padding: 5px 6px; border-radius: 5px; }
fieldset { min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 11px; }
.year-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.table-wrap { margin-top: 16px; max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 13px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { position: sticky; top: 0; z-index: 1; background: #e8f0ec; color: var(--ink); text-align: left; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e4ebe7; white-space: nowrap; }
tr:hover td { background: #f6faf8; }
.badge { display: inline-block; border-radius: 999px; padding: 3px 8px; font-weight: 800; }
.badge.resistant { color: #7b3513; background: #f8dfcf; }
.badge.susceptible { color: #07564f; background: #d9f0e9; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.button { border: 0; border-radius: 9px; padding: 10px 15px; background: var(--teal); color: white; font-weight: 800; cursor: pointer; }
.button:hover { background: #07534d; }
.button.secondary { margin-top: 12px; background: var(--ink); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.estimator-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; }
.checks { display: grid; gap: 11px; align-content: start; margin-top: 18px; padding: 18px; background: white; }
.checks label { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.checks input { width: 18px; height: 18px; accent-color: var(--teal); }
input[type="range"] { width: calc(100% - 42px); accent-color: var(--teal); }
output { display: inline-block; min-width: 34px; text-align: right; font-weight: 800; }
.risk-box { display: grid; gap: 4px; margin-top: 20px; padding: 23px; border-radius: 17px; background: var(--ink); color: white; }
.risk-box strong { color: var(--lime); font-size: 2.6rem; line-height: 1.1; }
.risk-box small { color: #d5e5e2; }
.prose { max-width: 900px; }
.prose p { line-height: 1.7; }
.research-question { padding: 15px 17px; border-left: 4px solid var(--teal); border-radius: 8px; background: white; }
details { margin-top: 20px; border: 1px solid var(--border); border-radius: 10px; background: white; }
summary { padding: 13px 15px; cursor: pointer; font-weight: 800; }
pre { margin: 0; padding: 15px; overflow: auto; border-top: 1px solid var(--border); font-size: .8rem; }
footer { margin-top: 28px; padding: 22px 0 6px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.loading { padding: 24px 0; color: var(--muted); }
.error { padding: 16px; border: 1px solid #e4a17e; border-radius: 10px; color: #762c12; background: #fff0e8; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  .metrics.four, .metrics.three, .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid, .estimator-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1180px); padding-top: 12px; }
  .hero { padding: 23px 20px; border-radius: 16px; }
  .metrics.four, .metrics.three, .form-grid.four, .form-grid.two { grid-template-columns: 1fr; }
  .actions { align-items: stretch; flex-direction: column; }
  .button { width: 100%; }
  .chart { min-height: 350px; }
}
