:root {
  --bg: #0d1522;
  --bg-2: #111c2d;
  --panel: rgba(17, 28, 45, 0.92);
  --panel-strong: #152235;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f5f7fb;
  --muted: #b8c2d6;
  --muted-2: #8996ad;
  --accent: #daa357;
  --accent-2: #f1c272;
  --go: #46d39a;
  --caution: #f5c85b;
  --nogo: #ff6b6b;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius: 24px;
  --radius-sm: 16px;
  --focus: 0 0 0 4px rgba(218, 163, 87, 0.22);
  --max: 1180px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(218, 163, 87, 0.18), transparent 36rem),
    radial-gradient(circle at 88% 12%, rgba(82, 146, 255, 0.12), transparent 28rem),
    linear-gradient(135deg, #0a111c 0%, var(--bg) 52%, #101b2c 100%);
}

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

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: rgba(218, 163, 87, 0.72);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  transform: translateY(-180%);
  background: var(--accent);
  color: #10141d;
  padding: .7rem 1rem;
  border-radius: 999px;
  font-weight: 800;
  z-index: 30;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.4rem) 0 3rem;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(420px, 1.18fr) minmax(300px, .72fr);
  gap: 1rem;
  align-items: start;
}

.hero-card,
.app-card,
.side-panel > * {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21, 34, 53, 0.96), rgba(13, 21, 34, 0.94));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  position: sticky;
  top: 1rem;
  padding: clamp(1.05rem, 2.5vw, 1.45rem);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .24), transparent 32%),
    linear-gradient(135deg, var(--accent), #b9782f);
  box-shadow: 0 16px 36px rgba(218, 163, 87, .2);
  flex: 0 0 auto;
}

.brand-mark span {
  width: 25px;
  height: 25px;
  border: 3px solid #111927;
  border-radius: 50%;
  position: relative;
}

.brand-mark span::before,
.brand-mark span::after {
  content: "";
  position: absolute;
  background: #111927;
  border-radius: 999px;
}

.brand-mark span::before {
  width: 43px;
  height: 3px;
  top: 8px;
  left: -12px;
}

.brand-mark span::after {
  width: 3px;
  height: 43px;
  top: -12px;
  left: 8px;
}

.eyebrow {
  margin: 0 0 .2rem;
  color: var(--accent-2);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .105em;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1;
  letter-spacing: -.055em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  line-height: 1.1;
  letter-spacing: -.035em;
}

h3 {
  margin-bottom: .7rem;
  font-size: 1rem;
}

.hero-copy {
  margin: 1.2rem 0 1.1rem;
  color: var(--muted);
  font-size: 1rem;
}

.tiny-note {
  margin: 1rem 0 0;
  color: var(--muted-2);
  font-size: .82rem;
}

.hero-actions,
.nav-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  align-items: center;
}

.button {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  min-height: 44px;
  padding: .72rem 1rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.095);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  color: #111927;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-color: transparent;
}

.button.danger {
  color: #fff;
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.34);
}

.button[disabled] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.app-card {
  min-height: 680px;
  padding: clamp(1rem, 3vw, 1.35rem);
}

.topbar,
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.status-pill,
.decision-badge {
  border-radius: 999px;
  padding: .45rem .72rem;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: rgba(255, 255, 255, .06);
}

.status-pill[data-status="go"],
.decision-badge[data-status="go"] {
  color: #062316;
  background: var(--go);
  border-color: transparent;
}

.status-pill[data-status="caution"],
.decision-badge[data-status="caution"] {
  color: #231804;
  background: var(--caution);
  border-color: transparent;
}

.status-pill[data-status="no-go"],
.decision-badge[data-status="no-go"] {
  color: #2a0707;
  background: var(--nogo);
  border-color: transparent;
}

.progress {
  margin: 1rem 0 1.2rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--go));
  transition: width .24s ease;
}

.progress p {
  margin: .45rem 0 0;
  color: var(--muted-2);
  font-size: .82rem;
  font-weight: 700;
}

.step-grid {
  display: grid;
  gap: .95rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem;
}

.field {
  display: grid;
  gap: .35rem;
}

.field.full {
  grid-column: 1 / -1;
}

label,
.legend {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .74rem .82rem;
}

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

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem;
  align-items: center;
}

.input-row span {
  color: var(--muted-2);
  font-size: .84rem;
  font-weight: 800;
}

.choice-group {
  display: grid;
  gap: .5rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .42rem;
}

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

.segmented.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  display: grid;
  place-items: center;
  text-align: center;
  padding: .56rem .5rem;
  font-size: .8rem;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.segmented label:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.25);
}

.segmented input:checked + label {
  color: #111927;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
}

.segmented input:focus-visible + label {
  box-shadow: var(--focus);
}

.check-list {
  display: grid;
  gap: .55rem;
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .65rem;
  align-items: center;
  padding: .7rem .78rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  border-radius: 14px;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.check-row span {
  color: var(--muted);
  font-weight: 800;
  font-size: .88rem;
}

.nav-row {
  margin-top: 1.1rem;
  justify-content: space-between;
}

.side-panel {
  display: grid;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

.decision-card,
.info-card {
  padding: 1.05rem;
}

.summary-list {
  margin: 1rem 0 0;
  display: grid;
  gap: .58rem;
}

.summary-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: .75rem;
  padding-bottom: .55rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.summary-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-row span:first-child {
  color: var(--muted-2);
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.summary-row span:last-child {
  color: var(--text);
  font-weight: 750;
}

.reason-box {
  margin-top: 1rem;
  padding: .85rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
}

.reason-box h3 {
  margin: 0 0 .45rem;
  font-size: .92rem;
}

.reason-box ul,
.info-card ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.reason-box li,
.info-card li {
  margin: .25rem 0;
}

.info-card p {
  color: var(--muted);
}

.disclaimer {
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--muted-2);
  font-size: .78rem;
}

.final-card {
  display: grid;
  gap: .85rem;
}

.large-status {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .8rem;
  align-items: center;
  padding: .95rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  border-radius: 20px;
}

.status-dot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 1px solid var(--line-strong);
}

.status-dot[data-status="go"] { background: var(--go); }
.status-dot[data-status="caution"] { background: var(--caution); }
.status-dot[data-status="no-go"] { background: var(--nogo); }

.large-status strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.05;
}

.large-status span {
  color: var(--muted);
  font-size: .9rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(160%);
  opacity: 0;
  z-index: 60;
  color: #10141d;
  background: var(--accent-2);
  border-radius: 999px;
  padding: .78rem 1.05rem;
  font-weight: 900;
  box-shadow: 0 20px 46px rgba(0, 0, 0, .35);
  transition: transform .22s ease, opacity .22s ease;
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
  }

  .hero-card {
    grid-column: 1 / -1;
    position: static;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 1rem, var(--max));
    grid-template-columns: 1fr;
    padding-top: .5rem;
  }

  .app-card {
    min-height: auto;
  }

  .topbar,
  .card-head {
    align-items: flex-start;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .segmented,
  .segmented.four {
    grid-template-columns: 1fr 1fr;
  }

  .summary-row {
    grid-template-columns: 96px 1fr;
  }

  .hero-actions .button,
  .nav-row .button,
  .action-row .button {
    flex: 1 1 auto;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: min(100% - .65rem, var(--max));
  }

  .hero-card,
  .app-card,
  .side-panel > * {
    border-radius: 18px;
  }

  .segmented,
  .segmented.two,
  .segmented.four {
    grid-template-columns: 1fr;
  }

  .brand-mark {
    width: 48px;
    height: 48px;
  }
}


/* Sequential app flow: intro card -> question card -> final flight card */
[hidden] {
  display: none !important;
}

.app-shell[data-view="intro"],
.app-shell[data-view="questions"],
.app-shell[data-view="result"] {
  min-height: 100vh;
  justify-content: center;
}

.app-shell[data-view="intro"] {
  grid-template-columns: minmax(0, 620px);
  align-items: center;
}

.app-shell[data-view="questions"] {
  grid-template-columns: minmax(0, 760px);
  align-items: start;
}

.app-shell[data-view="result"] {
  grid-template-columns: minmax(0, 760px);
  align-items: start;
}

.app-shell[data-view="intro"] .hero-card,
.app-shell[data-view="questions"] .app-card,
.app-shell[data-view="result"] .side-panel {
  position: static;
  width: 100%;
}

.app-shell[data-view="result"] .side-panel {
  display: block;
}

.result-actions {
  margin-top: 1rem;
}

.result-actions .button {
  flex: 1 1 auto;
}

/* Native dropdown fix for browsers that open a light option menu */
select {
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.06);
  color-scheme: dark;
}

select option,
select optgroup {
  background-color: #ffffff;
  color: #111927;
}

select option:checked {
  background-color: #9ecbff;
  color: #111927;
}

@media print {
  html,
  body {
    background: #fff !important;
    color: #111 !important;
  }

  body * {
    visibility: hidden !important;
  }

  #live-card,
  #live-card * {
    visibility: visible !important;
  }

  #live-card {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    box-shadow: none !important;
    border: 1px solid #222 !important;
    background: #fff !important;
    color: #111 !important;
    border-radius: 0 !important;
  }

  #live-card .eyebrow,
  #live-card .summary-row span:first-child,
  #live-card .disclaimer,
  #live-card .reason-box ul,
  #live-card .reason-box li,
  #live-card .large-status span,
  #live-card .info-card li {
    color: #333 !important;
  }

  #live-card .summary-row,
  #live-card .reason-box,
  #live-card .disclaimer {
    border-color: #ddd !important;
  }

  #live-card .decision-badge,
  #live-card .status-dot {
    border: 1px solid #222 !important;
  }

  .action-row {
    display: none !important;
  }
}
.side-panel #live-summary {
  margin-top: 1.1rem;
}