:root {
  color-scheme: light;
  --color-brand-navy: #17324d;
  --color-brand-navy-dark: #102438;
  --color-action: #087f73;
  --color-action-hover: #06685f;
  --color-accent: #d99b2b;
  --color-background: #ffffff;
  --color-background-soft: #f5f7f8;
  --color-surface: #ffffff;
  --color-header-surface: rgb(255 255 255 / 94%);
  --color-input-surface: #ffffff;
  --color-alert-surface: #fff8e8;
  --color-alert-error-surface: #fff1ef;
  --color-text: #18232c;
  --color-text-muted: #5b6873;
  --color-border: #d8dee3;
  --color-success: #16794a;
  --color-warning: #9a6700;
  --color-error: #b42318;
  --color-focus: #2457c5;
  --shadow-soft: 0 14px 34px rgb(16 36 56 / 10%);
  --radius: 8px;
  font-family: Inter, "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-brand-navy: #d8e8f6;
  --color-brand-navy-dark: #07121d;
  --color-action: #2bb8a9;
  --color-action-hover: #45d1c2;
  --color-accent: #f3bd55;
  --color-background: #09131d;
  --color-background-soft: #101d29;
  --color-surface: #132231;
  --color-header-surface: rgb(9 19 29 / 94%);
  --color-input-surface: #0d1a26;
  --color-alert-surface: #332612;
  --color-alert-error-surface: #351915;
  --color-text: #edf4fa;
  --color-text-muted: #b6c3cf;
  --color-border: #304254;
  --color-success: #50d18c;
  --color-warning: #f3bd55;
  --color-error: #ff8d82;
  --color-focus: #8db7ff;
  --shadow-soft: 0 18px 38px rgb(0 0 0 / 36%);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--color-text);
  background: var(--color-background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: var(--color-action);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

img {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  background: var(--color-brand-navy-dark);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--color-header-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
}

.header-inner,
.section-inner,
.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-direction: row;
  gap: 0.7rem;
  color: var(--color-brand-navy);
  text-decoration: none;
  line-height: 1.1;
  font-weight: 800;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  object-fit: contain;
  padding: 4px;
}

.brand-text {
  display: inline-flex;
  flex-direction: column;
}

.brand small {
  margin-top: 0.18rem;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-links a {
  color: var(--color-brand-navy);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  color: var(--color-action);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-brand-navy);
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 0.72rem 1rem;
  font: inherit;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--color-action);
  color: #fff;
}

.button.primary:hover {
  background: var(--color-action-hover);
}

.button.secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-brand-navy);
}

.button.text {
  min-height: 44px;
  padding-inline: 0;
  color: var(--color-action);
}

.menu-toggle {
  display: none;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-brand-navy);
  min-width: 48px;
  min-height: 48px;
  font-size: 1.5rem;
  font-weight: 800;
}

.hero {
  position: relative;
  min-height: clamp(620px, 82vh, 790px);
  color: #fff;
  background: var(--color-brand-navy-dark);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(16 36 56 / 92%) 0%, rgb(16 36 56 / 76%) 39%, rgb(16 36 56 / 18%) 72%),
    url("reportpsr-hero.png") center / cover no-repeat;
}

.hero .section-inner {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(620px, 82vh, 790px);
  padding: 5rem 0 7rem;
}

.hero-content {
  width: min(720px, 100%);
}

.eyebrow {
  color: var(--color-accent);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--color-brand-navy);
  line-height: 1.08;
  margin: 0 0 1rem;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.35rem, 6vw, 4rem);
  max-width: 660px;
}

.page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.25rem);
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.lead {
  max-width: 760px;
  color: var(--color-text-muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.hero .lead {
  color: rgb(255 255 255 / 90%);
  font-size: clamp(1.12rem, 2vw, 1.35rem);
}

.hero-actions,
.section-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.6rem;
}

.hero-actions a:not(.button) {
  color: #fff;
  font-weight: 800;
}

.section {
  padding: clamp(3.2rem, 7vw, 5.5rem) 0;
}

.section.soft,
.page-hero {
  background: var(--color-background-soft);
}

.page-hero {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.narrow {
  max-width: 760px;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

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

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: 1.25rem;
}

.card strong,
.card h3 {
  color: var(--color-brand-navy);
}

.icon-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.7rem;
  border-radius: 50%;
  background: rgb(8 127 115 / 10%);
  color: var(--color-action);
  font-weight: 900;
}

.report-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.widget {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 560px;
}

.widget-progress {
  background: var(--color-brand-navy);
  color: #fff;
  padding: 1.25rem;
}

.widget-progress ol {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
}

.widget-progress li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 46px;
  color: rgb(255 255 255 / 78%);
  font-weight: 700;
}

.widget-progress li::before {
  content: attr(data-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
}

.widget-progress li.active {
  color: #fff;
}

.widget-progress li.active::before {
  background: var(--color-action);
  border-color: var(--color-action);
}

.widget-body {
  padding: clamp(1.25rem, 4vw, 2rem);
}

.widget-panel {
  display: none;
}

.widget-panel.active {
  display: block;
}

label {
  display: block;
  margin: 1rem 0 0.35rem;
  color: var(--color-brand-navy);
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--color-input-surface);
  color: var(--color-text);
  font: inherit;
}

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

.field-help,
.muted {
  color: var(--color-text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.alert {
  border-left: 5px solid var(--color-accent);
  background: var(--color-alert-surface);
  color: var(--color-text);
  padding: 1rem;
  border-radius: var(--radius);
}

.alert.error {
  border-color: var(--color-error);
  background: var(--color-alert-error-surface);
}

.voice-test-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.35fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.voice-control-panel,
.voice-transcript,
.voice-location-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  padding: clamp(1rem, 3vw, 1.4rem);
}

.voice-control-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.voice-meter {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--color-background-soft);
}

.voice-meter span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--color-action);
  transition: transform 80ms linear;
}

.voice-actions {
  display: grid;
  gap: 0.7rem;
}

.voice-meta {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.voice-meta div {
  display: grid;
  gap: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--color-border);
}

.voice-meta dt {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.voice-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--color-brand-navy);
  font-weight: 800;
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.transcript-header h2 {
  margin-bottom: 0;
}

.transcript-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--color-background-soft);
  color: var(--color-brand-navy);
  font-weight: 850;
}

.transcript-list {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-height: 340px;
  max-height: 58vh;
  margin-top: 1rem;
  overflow: auto;
}

.transcript-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.8rem;
  background: var(--color-background-soft);
}

.transcript-item strong {
  display: block;
  color: var(--color-brand-navy);
}

.transcript-item p {
  margin: 0.25rem 0 0;
}

.transcript-item.user {
  border-left: 5px solid var(--color-action);
}

.transcript-item.assistant {
  border-left: 5px solid var(--color-accent);
}

.transcript-item.error {
  border-left: 5px solid var(--color-error);
}

.voice-location-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.85rem;
}

.voice-location-panel[hidden] {
  display: none;
}

.location-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.location-header h2 {
  margin-bottom: 0;
}

.voice-map {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-background-soft);
}

.map-marker-controls,
.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.map-marker-controls[hidden] {
  display: none;
}

.location-actions {
  justify-content: flex-end;
}

.reassurance-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.reassurance-row span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-weight: 800;
}

.search-results {
  margin-top: 1rem;
}

.faq-list details {
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
}

.faq-list summary {
  color: var(--color-brand-navy);
  cursor: pointer;
  font-weight: 850;
}

.cta-band {
  background: var(--color-brand-navy);
  color: #fff;
}

.cta-band h2,
.cta-band h3 {
  color: #fff;
}

.cta-band .lead,
.cta-band .muted {
  color: rgb(255 255 255 / 82%);
}

.site-footer {
  background: var(--color-brand-navy-dark);
  color: #fff;
  padding: 3rem 0 1.5rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr 1.1fr;
  gap: 1.5rem;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 1rem;
}

.site-footer a {
  color: #fff;
}

.footer-links {
  display: grid;
  gap: 0.4rem;
}

.copyright {
  grid-column: 1 / -1;
  margin-top: 1rem;
  color: rgb(255 255 255 / 70%);
  font-size: 0.92rem;
}

.sticky-mobile-cta {
  display: none;
}

@media (max-width: 899px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .theme-toggle {
    min-width: 48px;
    min-height: 48px;
    padding-inline: 0.7rem;
  }

  .theme-toggle [data-theme-label] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .nav-links {
    position: fixed;
    inset: 76px 0 auto 0;
    display: none;
    grid-template-columns: 1fr;
    padding: 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-soft);
  }

  .nav-links.open {
    display: grid;
  }

  .nav-links a,
  .nav-links .button {
    width: 100%;
    justify-content: flex-start;
    min-height: 52px;
  }

  .hero::before {
    background:
      linear-gradient(180deg, rgb(16 36 56 / 90%) 0%, rgb(16 36 56 / 75%) 54%, rgb(16 36 56 / 35%) 100%),
      url("reportpsr-hero.png") center right 28% / cover no-repeat;
  }

  .hero,
  .hero .section-inner {
    min-height: calc(100dvh - 124px);
  }

  .grid.three,
  .grid.two,
  .grid.four,
  .footer-inner,
  .widget,
  .voice-test-shell,
  .form-row,
  .reassurance-row {
    grid-template-columns: 1fr;
  }

  .widget {
    min-height: auto;
  }

  .widget-progress ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.2rem;
  }

  .sticky-mobile-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 7;
    display: block;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    background: var(--color-header-surface);
    border-top: 1px solid var(--color-border);
  }

  .sticky-mobile-cta .button {
    width: 100%;
  }

  body {
    padding-bottom: 84px;
  }
}

@media (max-width: 480px) {
  .header-inner,
  .section-inner,
  .footer-inner {
    width: min(100% - 28px, 1200px);
  }

  .hero .section-inner {
    padding-top: 4rem;
  }

  .button {
    width: 100%;
  }

  .widget-progress ol {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
