:root {
  --bg: #0a3f85;
  --bg-soft: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #111827;
  --muted: #526070;
  --line: #c7d3e3;
  --brand: #0b5de6;
  --brand-dark: #073b7a;
  --brand-bright: #0b5de6;
  --accent: #f7941d;
  --accent-soft: #fff0d8;
  --danger: #b42318;
  --ok: #1f9d67;
  --ok-soft: #e1f8ec;
  --warning-soft: #fff4d2;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: none;
  --container: 1540px;
}

* {
  box-sizing: border-box;
}

html {
  zoom: 0.75;
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI Variable Display", "Segoe UI", Arial, sans-serif;
  background: var(--bg-soft);
}

body.auth-locked {
  overflow: hidden;
}

body.auth-unlocked {
  overflow-x: hidden;
}

body.auth-unlocked .auth-gate,
body.auth-locked .page-shell {
  display: none;
}

body.mobile-menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
}

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

.page-shell {
  width: min(var(--container), calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 0 34px;
}

.app-main {
  min-width: 0;
  padding: 0;
}

.section-block {
  margin-block: 18px;
}

.eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 760px;
  display: grid;
  gap: 10px;
}

.section-heading h2,
.hero h1 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.02;
}

.section-heading p,
.hero-copy,
.field-hint,
.panel-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.62;
}

.primary-button,
.ghost-button,
.topbar-link,
.topbar-nav a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.primary-button {
  color: #111827;
  border: 2px solid var(--accent);
  background: var(--accent);
  box-shadow: none;
}

.ghost-button,
.topbar-link,
.topbar-nav a {
  color: var(--brand-dark);
  border: 2px solid var(--brand-dark);
  background: #ffffff;
}

.topbar-link.primary {
  color: #111827;
  border-color: var(--accent);
  background: var(--accent);
}

.primary-button:hover,
.ghost-button:hover,
.topbar-link:hover,
.topbar-nav a:hover {
  color: #111827;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.primary-button:disabled,
.ghost-button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

.ghost-button.danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.2);
  background: rgba(180, 35, 24, 0.06);
}

.compact-button {
  min-height: 38px;
  padding: 8px 12px;
}

.full-width-button {
  width: 100%;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px 14px;
  overflow-y: auto;
  background: var(--bg-soft);
}

.auth-gate-card {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
  align-items: stretch;
}

.auth-gate-brand,
.auth-gate-panel,
.auth-dropdown-card,
.panel,
.module-card,
.story-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-gate-brand {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 28px;
}

.auth-brand-logo {
  width: min(210px, 58%);
}

.auth-gate-brand h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.auth-gate-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.auth-gate-panel {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 20px;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h3 {
  margin: 0;
  font-size: 1.02rem;
}

.auth-eyebrow {
  margin-bottom: 0;
}

.auth-status-message,
.auth-guest-note,
.auth-email-help,
.model-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.auth-status-message,
.auth-guest-note,
.auth-email-help-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.auth-status-message,
.auth-guest-note,
.auth-email-help {
  padding: 12px;
}

.auth-status-message[data-tone="info"] {
  color: var(--brand);
  background: #e9f7ff;
}

.auth-status-message[data-tone="success"] {
  color: #17603a;
  background: var(--ok-soft);
}

.auth-status-message[data-tone="warning"] {
  color: #8a6500;
  background: var(--warning-soft);
}

.auth-grid,
.field-grid,
.selection-grid,
.results-grid,
.scenario-grid,
.story-grid,
.hero-module-grid,
.profile-editor-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.auth-grid label,
.field-grid label,
.selection-grid label,
.model-section > label,
.material-composition-row label {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.auth-checkbox {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #eef8ff;
}

.auth-checkbox input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
}

.auth-checkbox span {
  line-height: 1.5;
}

.auth-actions,
.model-actions,
.hero-actions,
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-session {
  display: grid;
  gap: 10px;
}

.auth-email-help {
  display: grid;
  gap: 10px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 10px 12px;
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: none;
}

.topbar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  color: inherit;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.topbar-logo {
  width: 58px;
  flex: 0 0 auto;
}

.topbar-brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.topbar-name {
  overflow: hidden;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-tag {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.topbar-nav,
.topbar-actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-nav a,
.topbar-link {
  width: auto;
  justify-content: center;
  color: var(--brand-dark);
  background: #ffffff;
  box-shadow: none;
}

.auth-menu {
  display: inline-flex;
}

.auth-avatar-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
}

.auth-avatar-image,
.account-avatar-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-avatar-label,
.account-avatar-fallback {
  color: var(--brand);
  font-weight: 900;
  letter-spacing: 0.08em;
}

.auth-dropdown {
  position: fixed;
  top: 88px;
  right: max(16px, calc((100vw - var(--container)) / 2));
  z-index: 55;
  width: min(420px, calc(100vw - 32px));
  padding: 0;
}

.auth-dropdown-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.account-profile-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.account-profile-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #e7f5ff;
}

.account-profile-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.account-profile-meta strong,
.account-profile-meta p {
  overflow-wrap: anywhere;
}

.account-profile-meta p {
  margin: 0;
  color: var(--muted);
}

.mobile-menu-button,
.mobile-menu-backdrop {
  display: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}

.hero-copy-block {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 260px;
  padding: 24px;
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-copy-block .eyebrow,
.hero-copy-block .hero-copy {
  color: var(--muted);
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(1.7rem, 3.4vw, 3.2rem);
}

.hero-copy {
  max-width: 720px;
}

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

.module-card,
.story-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

.module-card h2,
.story-card h3 {
  margin: 0;
  font-size: 1rem;
}

.module-card p,
.story-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.module-index,
.story-index {
  width: max-content;
  padding: 5px 9px;
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: #ffffff;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.story-section {
  display: grid;
  gap: 16px;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
}

.form-panel,
.results-panel {
  display: grid;
  gap: 14px;
}

.form-panel {
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.results-panel {
  position: sticky;
  top: 96px;
  padding: 14px;
  border: 3px solid var(--brand-dark);
  background: #ffffff;
}

.panel-head {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.form-panel > .panel-head {
  padding: 12px 14px;
  border: 3px solid var(--brand-dark);
  border-radius: var(--radius);
  background: #ffffff;
}

.panel-head h2 {
  margin: 3px 0 0;
  font-size: 1.26rem;
  line-height: 1.15;
}

.panel-copy {
  max-width: 260px;
  font-size: 0.86rem;
  text-align: right;
}

.pricing-menu {
  display: flex;
  align-items: end;
  gap: 4px;
  min-width: 0;
  margin-top: 14px;
  padding: 0 0 0 6px;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pricing-menu-button {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 128px;
  min-height: 44px;
  padding: 10px 14px;
  border: 3px solid var(--brand-dark);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  color: var(--brand-dark);
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.pricing-menu-button.active {
  color: #111827;
  border-color: var(--brand-dark);
  background: var(--accent);
}

.pricing-menu-button-label {
  display: block;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.menu-panel {
  display: none;
  min-height: 640px;
  padding: 16px;
  border: 3px solid var(--brand-dark);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  background: #ffffff;
}

.menu-panel.active {
  display: grid;
  gap: 14px;
}

.form-section,
.model-section,
.profile-editor-block,
.profile-material-composition,
.scenario-card,
.metric-card {
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.model-section {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.subsection-head h3,
.subsection-head h4,
.profile-block-head h4 {
  margin: 0;
}

.profile-block-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.86rem;
}

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

.selection-grid label,
.form-section,
.model-summary {
  padding: 12px;
}

.selection-grid label,
.form-section {
  background: var(--surface-soft);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
}

.model-summary {
  min-width: 0;
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.model-summary.empty {
  color: var(--muted);
}

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

.pricing-form .full-width-button,
.pricing-form .error-message {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 12px;
  align-content: start;
}

.subsection-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.subsection-head.simple {
  align-items: flex-start;
}

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

.compact-grid {
  gap: 10px;
}

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

label span,
.auth-checkbox span {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: none;
}

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

.profile-editor-block,
.profile-material-composition {
  display: grid;
  gap: 12px;
  padding: 12px;
  align-content: start;
  background: var(--surface-soft);
}

.profile-block-head {
  display: grid;
  gap: 5px;
}

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

.material-composition-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
}

.material-composition-row .ghost-button {
  width: max-content;
}

.field-hint {
  font-size: 0.84rem;
}

.error-message {
  margin: 0;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  line-height: 1.5;
  font-weight: 700;
}

.panel-error-message {
  margin: 10px 0;
  scroll-margin-top: 100px;
}

.status-tag {
  max-width: 220px;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.3;
  text-align: right;
  overflow-wrap: anywhere;
}

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

.metric-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.metric-card.highlight {
  background: #f3fbff;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.metric-card strong {
  color: var(--ink);
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

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

.scenario-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.scenario-card.accent {
  border-color: rgba(255, 181, 21, 0.5);
  background: #fff9e8;
}

.scenario-head {
  display: grid;
  gap: 6px;
}

.scenario-head h3 {
  margin: 0;
  font-size: 1rem;
}

.scenario-head strong {
  color: var(--brand);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.scenario-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.scenario-card dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.scenario-card dt,
.scenario-card dd {
  min-width: 0;
  margin: 0;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.scenario-card dt {
  color: var(--muted);
}

.scenario-card dd {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.site-footer-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer-logo {
  width: 58px;
  flex: 0 0 auto;
}

.site-footer-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.site-footer-links a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.back-to-top-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid var(--brand-dark);
  border-radius: var(--radius-sm);
  color: var(--brand-dark);
  background: #ffffff;
  box-shadow: none;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.back-to-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.reveal-on-scroll {
  opacity: 1;
  transform: none;
  transition: none;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

.results-panel.is-updated .metric-card,
.results-panel.is-updated .scenario-card {
  animation: none;
}

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

  .results-panel {
    position: static;
  }

  .hero-copy-block {
    min-height: 0;
  }

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

  .profile-editor-layout,
  .pricing-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: calc(100% - 20px);
    display: block;
    padding: 10px 0 24px;
  }

  .app-main {
    padding: 0;
  }

  .auth-dropdown {
    padding: 0;
  }

  .auth-gate-card,
  .auth-grid,
  .selection-grid,
  .field-grid,
  .results-grid,
  .story-grid,
  .hero-module-grid {
    grid-template-columns: 1fr;
  }

  .auth-gate-brand,
  .hero-copy-block {
    padding: 22px;
  }

  .auth-gate {
    align-items: start;
  }

  .auth-gate-brand {
    display: none;
  }

  .topbar {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) 42px;
    margin: 0 0 10px;
    border: 2px solid var(--brand-dark);
    border-radius: var(--radius);
  }

  .mobile-menu-button {
    width: 42px;
    height: 42px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    justify-self: end;
    border: 2px solid var(--brand-dark);
    border-radius: var(--radius-sm);
    background: #ffffff;
    cursor: pointer;
  }

  .mobile-menu-button span {
    width: 18px;
    height: 2px;
    display: block;
    border-radius: var(--radius-sm);
    background: var(--brand);
    transition: transform 160ms ease, opacity 160ms ease;
  }

  body.mobile-menu-open .mobile-menu-button {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 120;
  }

  body.mobile-menu-open .mobile-menu-button span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.mobile-menu-open .mobile-menu-button span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-menu-open .mobile-menu-button span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: block;
    background: rgba(5, 18, 48, 0.48);
    cursor: pointer;
  }

  .mobile-menu-backdrop[hidden] {
    display: none !important;
  }

  .mobile-menu-panel {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    align-content: start;
    gap: 14px;
    padding: 78px 18px 22px;
    overflow-y: auto;
    background: var(--bg-soft);
    transform: translateY(-105%);
    transition: transform 200ms ease;
  }

  body.mobile-menu-open .mobile-menu-panel,
  body.auth-unlocked.mobile-menu-open .mobile-menu-panel {
    transform: none;
  }

  .topbar-nav,
  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .topbar-nav a,
  .topbar-link {
    width: 100%;
  }

  .auth-dropdown {
    top: 76px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .panel-head,
  .site-footer,
  .site-footer-brand {
    display: grid;
    justify-content: stretch;
  }

  .panel-copy,
  .status-tag,
  .scenario-card dd {
    text-align: left;
  }

  .subsection-head {
    display: grid;
    justify-content: stretch;
  }

  .material-composition-row {
    grid-template-columns: 1fr;
  }

  .material-composition-row .ghost-button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: calc(100% - 12px);
  }

  .auth-gate {
    padding: 6px;
  }

  .auth-gate-brand,
  .auth-gate-panel,
  .hero-copy-block,
  .results-panel {
    padding: 10px;
  }

  .form-panel {
    padding: 0;
  }

  .auth-gate-panel {
    gap: 10px;
  }

  .auth-gate-panel .primary-button,
  .auth-gate-panel .ghost-button {
    min-height: 38px;
    padding: 8px 11px;
  }

  .topbar-logo {
    width: 44px;
  }

  .topbar-tag {
    display: none;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 12vw, 3rem);
  }

  .pricing-menu {
    padding-left: 4px;
  }

  .pricing-menu-button {
    min-width: 112px;
    padding: 9px 10px;
  }

  .scenario-card dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
