:root {
  --ink: #172026;
  --muted: #5e6d76;
  --panel: #ffffff;
  --panel-soft: #f5f8f7;
  --line: #d8e2df;
  --water: #136f8f;
  --water-dark: #0c4d63;
  --reed: #587245;
  --sun: #e8a838;
  --alert: #b44732;
  --good: #247a53;
  --shadow: 0 18px 50px rgba(21, 48, 55, 0.16);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef4f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  border: 0;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid rgba(216, 226, 223, 0.88);
  background: rgba(245, 248, 247, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--water-dark);
  color: #fff;
  font-size: 0.82rem;
}

.state-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.state-pill {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
}

.state-pill.active {
  border-color: var(--water);
  background: #e2f4f7;
  color: var(--water-dark);
  font-weight: 800;
}

.state-pill:disabled {
  opacity: 0.55;
}

.hero-band {
  position: relative;
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  align-items: end;
  gap: 24px;
  padding: 56px 28px 32px;
  overflow: hidden;
  background: var(--water-dark);
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 35, 42, 0.82) 0%, rgba(10, 35, 42, 0.58) 38%, rgba(10, 35, 42, 0.12) 78%),
    url("assets/water-operator-hero.png") center / cover no-repeat;
}

.hero-content,
.metric-strip {
  position: relative;
  z-index: 1;
}

.hero-content {
  width: min(780px, 100%);
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--sun);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(2.25rem, 3.4rem, 3.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.65rem;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 650px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.06rem;
  line-height: 1.55;
}

.prep-controls {
  display: grid;
  width: min(920px, 100%);
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(170px, auto);
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(9, 32, 38, 0.74);
  box-shadow: var(--shadow);
}

.control-group {
  min-width: 0;
}

.control-label {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.segment-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  cursor: pointer;
}

.segment-btn.active {
  background: #fff;
  color: var(--water-dark);
}

select {
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.primary-action,
.secondary-action {
  min-height: 52px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  background: var(--sun);
  color: #22180a;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--water-dark);
}

.metric-strip {
  display: grid;
  gap: 10px;
  align-self: stretch;
  align-content: end;
}

.metric-strip > div {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
}

.metric-value {
  display: block;
  color: var(--water-dark);
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  width: min(1180px, calc(100% - 40px));
  margin: -34px auto 0;
  position: relative;
  z-index: 5;
}

.quiz-surface,
.results-surface,
.state-card,
.source-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.quiz-surface,
.results-surface {
  min-height: 430px;
  padding: 24px;
}

.surface-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e5f2ec;
  color: var(--reed);
  font-size: 0.78rem;
  font-weight: 850;
}

.quiz-title {
  margin: 0 0 10px;
  font-size: 1.55rem;
}

.question-stem {
  margin-bottom: 16px;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.38;
}

.answer-grid {
  display: grid;
  gap: 10px;
}

.answer-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.answer-option:hover,
.answer-option:focus-visible {
  border-color: var(--water);
  outline: 0;
}

.answer-option.selected {
  border-color: var(--water);
  background: #e8f7fa;
}

.answer-option.correct {
  border-color: #83bd9d;
  background: #edf8f1;
}

.answer-option.wrong {
  border-color: #d79a8d;
  background: #fff1ee;
}

.answer-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--panel-soft);
  color: var(--water-dark);
  font-weight: 900;
}

.feedback-box {
  margin-top: 16px;
  padding: 14px;
  border-left: 4px solid var(--water);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--panel-soft);
  color: #334047;
  line-height: 1.5;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ece9;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--reed), var(--sun));
  transition: width 180ms ease;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 360px;
}

.empty-state p {
  max-width: 640px;
  color: var(--muted);
  line-height: 1.55;
}

.category-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.category-row {
  display: grid;
  gap: 8px;
}

.row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.row-top strong {
  min-width: 0;
}

.row-top span {
  color: var(--muted);
  font-weight: 850;
  white-space: nowrap;
}

.mini-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ece9;
}

.mini-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--water);
}

.mini-fill.good {
  background: var(--good);
}

.mini-fill.warn {
  background: var(--sun);
}

.mini-fill.bad {
  background: var(--alert);
}

.score-hero {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.score-ring {
  display: grid;
  width: 128px;
  height: 128px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--good) 0deg, var(--good) var(--score-angle), #e4ece9 var(--score-angle), #e4ece9 360deg);
}

.score-ring span {
  font-size: 1.7rem;
  font-weight: 950;
}

.readiness-text {
  color: var(--muted);
  line-height: 1.48;
}

.focus-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.focus-list li {
  padding: 10px 12px;
  border-left: 4px solid var(--sun);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: #fff8e9;
  color: #493813;
  font-weight: 750;
}

.module-band,
.roadmap-band,
.source-band {
  width: min(1180px, calc(100% - 40px));
  margin: 48px auto 0;
}

.source-band {
  margin-bottom: 60px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  color: var(--ink);
}

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

.module-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.module-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--water-dark);
  font-size: 1.05rem;
}

.module-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.state-card {
  min-height: 150px;
  padding: 18px;
}

.state-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.priority-meter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin: 16px 0 12px;
}

.priority-dot {
  height: 8px;
  border-radius: 999px;
  background: #d7e1dd;
}

.priority-dot.filled {
  background: var(--sun);
}

.state-status {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
}

.source-list a {
  display: flex;
  min-height: 74px;
  align-items: center;
  padding: 14px;
  border-right: 1px solid var(--line);
  color: var(--water-dark);
  font-weight: 800;
  line-height: 1.35;
  text-decoration: none;
}

.source-list a:last-child {
  border-right: 0;
}

.source-list a:hover,
.source-list a:focus-visible {
  background: #e8f7fa;
  outline: 0;
}

@media (max-width: 1020px) {
  .hero-band,
  .workbench {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .state-grid,
  .module-grid,
  .source-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-list a {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .source-list a:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .state-nav {
    width: 100%;
  }

  .hero-band {
    min-height: auto;
    padding: 36px 16px 30px;
  }

  h1 {
    font-size: 2.35rem;
  }

  .prep-controls {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .workbench,
  .module-band,
  .roadmap-band,
  .source-band {
    width: calc(100% - 24px);
  }

  .quiz-surface,
  .results-surface {
    padding: 18px;
  }

  .score-hero {
    grid-template-columns: 1fr;
  }

  .state-grid,
  .module-grid,
  .source-list {
    grid-template-columns: 1fr;
  }
}
