:root {
  --ink: #182023;
  --muted: #607073;
  --line: #d9e0de;
  --paper: #fafafa;
  --surface: #ffffff;
  --teal: #2f6f73;
  --red: #a5403d;
  --gold: #b9852e;
  --shadow: 0 16px 40px rgba(24, 32, 35, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--teal);
  color: white;
  padding: 0 14px;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--teal);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 250, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 230px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--red);
  color: white;
  font-weight: 800;
}

.brand small,
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.nav {
  display: flex;
  flex: 1;
  gap: 6px;
  overflow-x: auto;
}

.nav a {
  border-radius: 6px;
  padding: 8px 10px;
  color: #344347;
  white-space: nowrap;
}

.nav a.active {
  background: #e6efee;
  color: var(--teal);
}

.session {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  position: relative;
  min-height: min(66vh, 640px);
  overflow: hidden;
  border-radius: 8px;
  background: #172224;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 18, 20, 0.78), rgba(10, 18, 20, 0.28) 56%, rgba(10, 18, 20, 0.05));
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 650px;
  padding: clamp(28px, 7vw, 88px);
  color: white;
}

.hero-copy h1 {
  margin: 10px 0 18px;
  font-size: clamp(42px, 8vw, 82px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 560px;
  color: #e5eceb;
  font-size: 18px;
}

.band {
  padding: 18px 0;
}

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

.metrics div,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metrics div {
  padding: 18px;
}

.metrics strong {
  display: block;
  color: var(--red);
  font-size: 24px;
}

.metrics span,
.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  padding: 20px;
}

.panel h2,
.section-head h1 {
  margin: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0 22px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: #334246;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cbd6d4;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 9px 10px;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
}

.segmented button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: var(--teal);
  color: white;
}

.list,
.stack {
  display: grid;
  gap: 10px;
}

.list.compact {
  max-height: 380px;
  overflow: auto;
}

.row,
.table-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.row-head,
.table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e8efec;
  color: #2b5559;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.pill.warn {
  background: #f9ead6;
  color: #82570c;
}

.scorebar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ecea;
}

.scorebar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.checks,
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.checks input {
  width: auto;
}

.wide {
  max-width: 840px;
}

pre {
  overflow: auto;
  min-height: 180px;
  margin: 0;
  white-space: pre-wrap;
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(440px, calc(100vw - 40px));
  border-radius: 8px;
  background: #152224;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

@media (max-width: 840px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px;
  }

  .brand,
  .session {
    min-width: 0;
  }

  main {
    padding: 14px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-copy {
    padding: 28px;
  }

  .grid.two,
  .metrics,
  .checks,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .row-head,
  .table-row {
    align-items: stretch;
    flex-direction: column;
  }
}

