:root {
  --bg: #0f1226;
  --bg-soft: #171a35;
  --card: #ffffff;
  --ink: #1d2138;
  --muted: #6b7090;
  --line: #e6e8f2;
  --brand: #5b6cff;
  --brand-dark: #4453e0;
  --great: #16a34a;
  --low: #2563eb;
  --medium: #d97706;
  --high: #dc2626;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 24, 60, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: #f5f6fb;
  line-height: 1.5;
}

.container { width: min(1080px, 92vw); margin: 0 auto; }

/* Top bar */
.topbar {
  background: var(--bg);
  color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #8a7bff);
  font-size: 14px; letter-spacing: .5px;
}
.brand__text { font-size: 18px; }
.nav a { color: #c7cbe8; text-decoration: none; margin-left: 22px; font-weight: 500; }
.nav a:hover { color: #fff; }

/* Hero */
.hero { padding: 34px 0 10px; }
.hero h1 { margin: 0 0 8px; font-size: 30px; }
.hero__sub { margin: 0; color: var(--muted); max-width: 70ch; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 22px;
  align-items: start;
  padding: 18px 0 40px;
}
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.card__title { margin: 0 0 16px; font-size: 18px; }

/* Form grid */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 14px;
  background: #fbfbfe;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 108, 255, .15);
}

/* Actions */
.form__actions { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  border: none; border-radius: 10px; padding: 11px 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: transform .05s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(91,108,255,.35); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn--ghost { background: #eef0fa; color: var(--ink); }
.btn--ghost:hover { background: #e3e6f6; }
.form__error { color: var(--high); font-size: 13.5px; margin: 14px 0 0; }

/* Result panel */
.result { position: sticky; top: 84px; min-height: 240px; }
.result__empty { color: var(--muted); padding: 18px 0; }
.result__body { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.gauge { text-align: center; }
.gauge__value { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.gauge__label { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.badge {
  padding: 7px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: #fff;
}
.badge--great { background: var(--great); }
.badge--low { background: var(--low); }
.badge--medium { background: var(--medium); }
.badge--high { background: var(--high); }
.result__hint { text-align: center; color: var(--muted); font-size: 13.5px; margin: 4px 0 0; max-width: 32ch; }

/* Subtle top accent matching the predicted risk */
.result--great { border-top: 4px solid var(--great); }
.result--low { border-top: 4px solid var(--low); }
.result--medium { border-top: 4px solid var(--medium); }
.result--high { border-top: 4px solid var(--high); }

/* Prose / about */
.prose { margin: 18px 0 40px; }
.prose h2 { font-size: 17px; margin: 22px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: #3a3f5c; }
.prose__note { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 22px; }
.spec { border-collapse: collapse; width: 100%; margin: 6px 0; }
.spec th, .spec td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec th { color: var(--muted); font-weight: 600; width: 220px; }

/* Footer */
.footer { background: var(--bg-soft); color: #aab0d8; padding: 18px 0; font-size: 13px; }
.footer p { margin: 0; }
