:root {
  --bg: #061327;
  --bg-deep: #040d1d;
  --ink: #f8fbff;
  --muted: #b7c3d6;
  --line: #243a5b;
  --card: #0c1b33d9;
  --accent: #49b8ff;
  --accent-deep: #2f9be2;
  --shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Jost", sans-serif;
  background: radial-gradient(1000px 650px at 10% -30%, #11305e 0%, transparent 64%),
    radial-gradient(900px 680px at 105% -10%, #0a4462 0%, transparent 66%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

.backdrop-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background: none;
}

.wrap {
  width: min(1100px, 94vw);
  margin-inline: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 26px 0;
}

.brand {
  color: #ffffff;
  text-decoration: none;
  font-family: "Jost", sans-serif;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.88;
  transition: opacity 120ms ease;
}

nav a:hover {
  opacity: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 24px;
}

.panel-sheen {
  position: relative;
  overflow: hidden;
}

.panel-sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

.hero-copy,
.hero-profile,
.card,
.cta-band {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.hero-copy {
  padding: 48px;
}

.hero-profile {
  padding: 30px;
}

.portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin-bottom: 12px;
  border: 1px solid #264162;
  background:
    radial-gradient(circle at 50% 35%, #f8ede5 0 22%, #d2bfab 22% 36%, transparent 36%),
    radial-gradient(circle at 50% 63%, #273f59 0 34%, #1a2f46 34% 61%, transparent 61%),
    linear-gradient(160deg, #cfdbe8, #a5b9ce);
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8fd3ff;
  font-weight: 500;
}

h1,
h2,
h3 {
  font-family: "Jost", sans-serif;
  margin-top: 0;
  letter-spacing: 0.005em;
}

h4 {
  margin: 12px 0 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #d8e8fb;
}

h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.02;
  margin: 14px 0 18px;
  font-weight: 500;
}

h2 {
  font-size: clamp(1.7rem, 2.5vw, 2.3rem);
  margin-bottom: 14px;
  font-weight: 500;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  font-weight: 500;
}

.lede {
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.lede.compact {
  max-width: none;
}

.ask-lede {
  max-width: none;
}

.hero-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--accent-deep);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 100ms ease, filter 120ms ease, background-color 120ms ease;
}

.btn:hover {
  filter: brightness(1.04);
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  border-color: #3a4f6d;
  background: #0a172a;
  color: #dce7f6;
}

.micro {
  margin-top: 11px;
  font-size: 0.9rem;
  color: var(--muted);
}

.quote {
  margin: 4px 0 12px;
  padding-left: 12px;
  border-left: 2px solid #7cc9ff;
  color: #cce4ff;
  font-style: italic;
}

.stamp {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  border: 1px solid #3b4f6c;
  color: #d6e1f0;
  background: #0d1b2f;
  border-radius: 999px;
  padding: 6px 10px;
}

.section {
  margin-top: 62px;
}

.cards {
  display: grid;
  gap: 24px;
}

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

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

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

.card {
  padding: 30px;
}

.workflow-guide {
  margin-bottom: 24px;
}

.workflow-guide ol {
  margin: 8px 0 0;
  padding-left: 18px;
  line-height: 1.75;
  color: #d5e4f6;
}

.step-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 24px;
  border-radius: 999px;
  margin-right: 8px;
  font-size: 0.78rem;
  border: 1px solid #3e5978;
  background: #0f223b;
  color: #dceaf9;
}

.step-indicator.is-done {
  border-color: #5ea8dd;
  color: #dbf2ff;
}

.card ul,
.card ol {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #d2e0f1;
  line-height: 1.65;
}

.narrative-panel {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: start;
}

.cta-band {
  text-align: center;
  padding: 38px;
}

.footer {
  color: var(--muted);
  padding: 26px 0 38px;
}

.footer a {
  color: #c7e5ff;
  text-decoration: underline;
}

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

#report-pref-form {
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 500;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  line-height: 1.45;
  color: #cfe0f4;
}

.consent-check input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
  padding: 0;
}

.consent-check a {
  color: #bfe3ff;
  text-decoration: underline;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #355475;
  background: #091a31;
  color: #f3f8ff;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #5f88b3;
  box-shadow: 0 0 0 3px rgba(73, 184, 255, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: #91a6c4;
}

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

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.chat-composer {
  display: block;
  margin-bottom: 14px;
}

.chat-input-wrap {
  position: relative;
}

.chat-composer input {
  width: 100%;
  min-height: 44px;
  padding-right: 58px;
}

.icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  font-size: 1.45rem;
  line-height: 1;
}

.icon-btn.thinking {
  font-size: 1.05rem;
}

.chat-thread {
  border: 1px solid #335172;
  background: #08172c;
  border-radius: 10px;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.onboarding-shell {
  max-width: 900px;
  margin-inline: auto;
  padding: 24px;
}

.onboarding-intro {
  max-width: 900px;
  margin-inline: auto;
  margin-bottom: 18px;
}

.onboarding-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.onboarding-head .micro {
  margin: 0;
}

.onboarding-thread {
  min-height: 350px;
  max-height: 520px;
  gap: 6px;
  font-size: 1.08rem;
}

.onboarding-thread .chat-row.assistant + .chat-row.assistant {
  margin-top: -2px;
}

.onboarding-choices {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 6px;
}

.onboarding-choices.show {
  display: flex;
}

.choice-pill {
  border: 1px solid #3f5f84;
  background: #0d203a;
  color: #deebfa;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, transform 100ms ease;
}

.choice-pill:hover {
  border-color: #66a6de;
}

.choice-pill:active {
  transform: translateY(1px);
}

.onboarding-composer {
  margin-top: 6px;
}

.onboarding-input-wrap input {
  min-height: 52px;
  font-size: 1rem;
  border-radius: 12px;
  padding-inline: 14px 64px;
}

.onboarding-actions {
  margin: 10px 0 0;
}

.chat-row {
  display: flex;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(84%, 680px);
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
}

.chat-bubble.user {
  background: #183658;
  color: #edf5ff;
  border: 1px solid #3f6086;
}

.chat-bubble.user.editable-response {
  cursor: pointer;
}

.chat-bubble.user.editable-response:hover {
  border-color: #66a6de;
}

.chat-bubble.user.editable-response.is-editing {
  border-color: #8bc8ff;
  box-shadow: 0 0 0 2px rgba(88, 180, 255, 0.2);
}

.chat-bubble.assistant {
  background: transparent;
  color: #d8e9fb;
  border: none;
  padding: 0;
  max-width: 100%;
}

.chat-placeholder {
  color: #8ca3be;
  font-size: 0.95rem;
}

.upsell-note {
  margin-top: 10px;
  color: #9fb3cb;
  font-size: 0.9rem;
}

.upsell-note a {
  color: #cfe7ff;
  text-decoration: underline;
}

.briefings-list {
  display: grid;
  gap: 10px;
}

.briefing-item {
  display: block;
  border: 1px solid #335172;
  background: #08172c;
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  color: #dbe9fa;
}

.briefing-item:hover {
  border-color: #4a6b90;
}

.briefing-meta {
  font-size: 0.78rem;
  color: #9cb0c9;
  margin-bottom: 4px;
}

.briefing-subject {
  font-size: 0.96rem;
  font-weight: 500;
  margin-bottom: 4px;
}

.briefing-snippet {
  font-size: 0.86rem;
  color: #bdd0e5;
  line-height: 1.45;
}

.briefing-empty {
  border: 1px solid #335172;
  background: #08172c;
  border-radius: 8px;
  padding: 10px;
  color: #9fb3cb;
  font-size: 0.9rem;
}

.subhead {
  margin-top: 14px;
}

.console {
  margin-top: 10px;
  min-height: 90px;
  max-height: 270px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: 8px;
  border: 1px solid #335172;
  background: #08172c;
  color: #d3e8ff;
  padding: 10px;
  font-size: 12px;
  line-height: 1.35;
}

.console.tall {
  min-height: 280px;
}

.status-banner {
  display: none;
  margin: 12px 0 18px;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #406183;
  background: #10243d;
  color: #e0edfa;
  font-size: 0.92rem;
}

.status-banner.show {
  display: block;
}

.status-banner.error {
  border-color: #7c4a5a;
  background: #2d1522;
  color: #ffd8e1;
}

@media (max-width: 960px) {
  .hero,
  .cards.two,
  .cards.three,
  .cards.four {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 3.1rem);
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  nav {
    flex-wrap: wrap;
  }

  .narrative-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .wrap {
    width: min(1040px, 95vw);
  }

  .hero-copy {
    padding: 42px;
  }
}

@media (max-width: 1024px) {
  .cards.two,
  .cards.three,
  .cards.four {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px;
  }

  nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .card {
    padding: 24px;
  }

  .section {
    margin-top: 52px;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: 94vw;
  }

  .topbar {
    padding: 18px 0;
  }

  .brand {
    font-size: 1.45rem;
  }

  h1 {
    margin: 10px 0 14px;
  }

  .lede {
    font-size: 1.03rem;
    line-height: 1.65;
  }

  .section {
    margin-top: 38px;
  }

  .cards {
    gap: 16px;
  }

  .card {
    padding: 18px;
  }

  .hero-copy,
  .hero-profile,
  .cta-band {
    padding: 20px;
  }

  .chat-thread {
    min-height: 180px;
    max-height: 340px;
  }

  .onboarding-shell {
    padding: 16px;
  }

  .onboarding-thread {
    min-height: 280px;
  }

  .onboarding-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .inline-actions .btn {
    width: 100%;
  }
}
