:root {
  --ink: #132238;
  --muted: #5f6f82;
  --paper: #f5f8fb;
  --surface: #ffffff;
  --line: #dce4ec;
  --navy: #153b5b;
  --teal: #157a78;
  --teal-light: #dff3f1;
  --coral: #e87861;
  --danger: #a83838;
  --shadow: 0 18px 45px rgba(31, 55, 79, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(21, 122, 120, 0.09), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 16px clamp(20px, 5vw, 72px);
  color: white;
  background: var(--navy);
  border-bottom: 4px solid var(--teal);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 14px;
  color: var(--navy);
  background: #9fe1da;
  font-size: 1.35rem;
  font-weight: 800;
}

.topbar h1 { margin: 1px 0 0; font-size: 1.12rem; }
.eyebrow { margin: 0; color: #b9d3e5; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.status { margin-left: auto; padding: 8px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.status-ready { color: #aaf1d0; background: rgba(35, 183, 125, 0.16); }
.status-error { color: #ffd2cb; background: rgba(232, 120, 97, 0.18); }

.page-shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 64px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr); gap: clamp(28px, 5vw, 76px); align-items: center; }
.hero-copy { max-width: 760px; }
.kicker { margin: 0 0 8px; color: var(--teal); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.hero h2, .results-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; color: var(--navy); font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: -0.035em; }
.hero-copy > p:not(.kicker) { max-width: 680px; color: var(--muted); font-size: 1.05rem; line-height: 1.75; }

.upload-card { padding: clamp(22px, 4vw, 38px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.drop-zone { display: grid; place-items: center; min-height: 235px; padding: 28px; text-align: center; cursor: pointer; border: 2px dashed #89aaa8; border-radius: 18px; background: #f6fbfb; transition: 160ms ease; }
.drop-zone:hover, .drop-zone:focus-within { border-color: var(--teal); background: var(--teal-light); transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone span { margin-top: 8px; color: var(--muted); font-size: 0.86rem; }
.upload-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 0 16px !important; border-radius: 50%; color: white !important; background: var(--teal); font-size: 1.8rem !important; }
.primary-button, .download-button { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 0 22px; color: white; background: var(--teal); border: 0; border-radius: 12px; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.primary-button { width: 100%; margin-top: 16px; }
.primary-button:hover, .download-button:hover { background: #0f6664; }
.template-link { display: block; margin-top: 16px; color: var(--navy); text-align: center; font-weight: 700; }

.message { display: flex; gap: 12px; margin: 30px 0 0; padding: 16px 18px; border-radius: 14px; }
.message-error { color: var(--danger); background: #fff0f0; border: 1px solid #f1c2c2; }

.results-section { margin-top: 56px; padding: clamp(22px, 4vw, 42px); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.results-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.results-heading h2 { font-size: clamp(2rem, 4vw, 3rem); }
.results-heading p { color: var(--muted); }
.table-note { color: var(--muted); font-size: 0.9rem; }
.table-wrap { overflow: auto; max-height: 610px; margin-top: 24px; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; padding: 13px 14px; color: white; background: var(--navy); text-align: left; }
td { padding: 12px 14px; border-bottom: 1px solid #e8edf2; }
tbody tr:nth-child(even) { background: #f8fafc; }
.prediction-cell { color: var(--teal); font-weight: 800; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
.info-grid article { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.info-grid h3 { margin: 14px 0 7px; color: var(--navy); }
.info-grid p { margin: 0; color: var(--muted); line-height: 1.6; }
.step { color: var(--coral); font-weight: 900; letter-spacing: 0.1em; }
.clinical-note { display: flex; gap: 18px; margin-top: 24px; padding: 18px 22px; color: #4c5663; background: #eaf0f5; border-radius: 14px; }
.clinical-note p { margin: 0; line-height: 1.55; }
.unavailable { padding: 28px; color: var(--danger); background: #fff4f2; border-radius: 14px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .results-heading { align-items: stretch; flex-direction: column; }
  .download-button { align-self: flex-start; }
}

@media (max-width: 560px) {
  .topbar { padding-inline: 16px; }
  .status { display: none; }
  .page-shell { width: min(100% - 20px, 1480px); padding-top: 32px; }
  .hero h2 { font-size: 2.35rem; }
  .clinical-note { flex-direction: column; gap: 6px; }
}
