:root {
  --ink: #111827;
  --muted: #526173;
  --line: #cfd9e5;
  --panel: #ffffff;
  --soft: #edf7ff;
  --brand: #1689d5;
  --brand-dark: #0b4871;
  --black: #05070a;
  --blue-glow: #39a9ff;
  --accent: #21a67a;
  --warning: #a56b11;
  --danger: #a53b3b;
  --shadow: 0 18px 55px rgba(5, 7, 10, 0.14);
}

body.public-intake .demo-toolbar,
body.public-intake .case-strip,
body.public-intake .result-card {
  display: none;
}

body.public-intake .workspace {
  grid-template-columns: 1fr;
}

body.public-intake .form-card {
  max-width: 860px;
  margin: 0 auto;
}

body.public-intake .shell {
  padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
}

.sticky-mobile-cta {
  position: fixed;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  left: 10px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(5, 7, 10, 0.94);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.26);
}

.sticky-mobile-cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  background: #fff;
  color: var(--black);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.sticky-mobile-cta a:nth-child(2) {
  background: var(--brand);
  color: #fff;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 112px, #06111c 112px, #06111c 420px, #eef3f7 420px),
    #eef3f7;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 112px;
  padding: 18px clamp(18px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid #edf0f4;
}

.site-nav,
.header-call {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #05070a;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-nav a,
.header-call {
  color: inherit;
  text-decoration: none;
}

.site-nav a:first-child {
  border-bottom: 2px solid #05070a;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(360px, 42vw);
}

.brand-link img {
  display: block;
  width: 100%;
  max-height: 102px;
  object-fit: contain;
}

.header-call {
  justify-content: flex-end;
  letter-spacing: 0.04em;
}

.shell {
  width: calc(100% - 48px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 0 56px;
}

.hero {
  display: grid;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: clamp(22px, 5vw, 52px);
  border: 1px solid rgba(57, 169, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(105deg, rgba(0, 0, 0, 0.9), rgba(7, 29, 49, 0.96) 58%, rgba(15, 94, 148, 0.92)),
    radial-gradient(circle at 85% 20%, rgba(57, 169, 255, 0.36), transparent 34%);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.hero > *,
.workspace > *,
.demo-toolbar > *,
.case-strip > * {
  min-width: 0;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  color: #ffffff;
  font-size: 2rem;
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-glow);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subhead {
  max-width: 760px;
  margin: 14px 0 0;
  color: #dceeff;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.hero-note {
  max-width: 760px;
  margin: 10px 0 0;
  color: #b9c9d8;
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.trust-panel {
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 0;
  padding: 16px;
  border: 1px solid rgba(13, 77, 124, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(57, 169, 255, 0.18)),
    rgba(3, 9, 15, 0.56);
  box-shadow: none;
  width: 100%;
  max-width: calc(100vw - 48px);
}

.trust-panel span {
  display: block;
  padding-left: 14px;
  border-left: 4px solid var(--brand);
  color: #ffffff;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 699px) {
  .trust-panel,
  .demo-toolbar,
  .case-strip,
  .form-card,
  .result-card {
    max-width: 320px;
  }

  .subhead,
  .hero-note {
    max-width: 300px;
  }

  .trust-panel span,
  .toolbar-copy {
    max-width: 260px;
  }
}

.demo-toolbar,
.case-strip {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
  width: 100%;
  max-width: calc(100vw - 48px);
}

.toolbar-title,
.toolbar-copy {
  margin: 0;
}

.toolbar-title {
  font-weight: 800;
}

.toolbar-copy {
  color: var(--muted);
  font-size: 0.92rem;
}

.toggle-row,
.price-control,
.consent-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row input,
.consent-row input {
  width: 20px;
  min-height: 20px;
  flex: 0 0 auto;
}

.price-control input {
  max-width: 110px;
}

.case-strip {
  grid-template-columns: 1fr;
}

.case-button {
  width: 100%;
  min-height: 42px;
  background: var(--black);
  border: 1px solid rgba(57, 169, 255, 0.28);
}

.case-button:hover {
  background: #0d3f66;
}

.workspace {
  display: grid;
  gap: 16px;
  align-items: start;
}

.form-card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: calc(100vw - 48px);
}

.form-card {
  padding: 16px;
}

.result-card {
  padding: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
  padding-top: 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: 1fr;
}

label,
legend {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c8d3df;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(21, 115, 184, 0.22);
  border-color: var(--brand);
}

.conditional {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(21, 115, 184, 0.24);
  border-radius: 8px;
  background: var(--soft);
}

.conditional legend {
  padding: 0 8px;
  color: var(--brand-dark);
}

.actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.hidden-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.form-status.success {
  color: #0f654b;
}

.form-status.error {
  color: var(--danger);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--black);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 10px 16px;
  white-space: normal;
}

button:hover {
  background: #0d3f66;
}

button.secondary,
button.copy {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-dark);
}

button.secondary:hover,
button.copy:hover {
  background: var(--soft);
}

.output-block {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.status-pill {
  display: block;
  margin-bottom: 16px;
  border: 1px solid rgba(33, 166, 122, 0.28);
  border-radius: 8px;
  background: rgba(33, 166, 122, 0.1);
  color: #0f654b;
  font-size: 0.88rem;
  font-weight: 800;
  padding: 10px 12px;
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

pre {
  min-height: 92px;
  max-height: 360px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #182233;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 12px;
}

@media (min-width: 700px) {
  .shell {
    width: calc(100% - 32px);
    max-width: 1180px;
    padding-top: 32px;
  }

  .hero h1 {
    font-size: clamp(3rem, 5vw, 4.7rem);
  }

  .demo-toolbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .case-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .actions {
    display: flex;
    flex-wrap: wrap;
  }
}

@media (min-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    margin-bottom: 20px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 24px;
  }

  .form-card {
    padding: 22px;
  }

  .result-card {
    position: sticky;
    top: 16px;
    padding: 20px;
  }

  .sticky-mobile-cta {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, #ffffff 0, #ffffff 166px, #06111c 166px, #06111c 470px, #eef3f7 470px),
      #eef3f7;
  }

  .site-header {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    padding: 14px 18px 18px;
  }

  .site-nav {
    order: 2;
    justify-content: center;
    gap: 22px;
  }

  .brand-link {
    order: 1;
    width: min(310px, 86vw);
  }

  .header-call {
    order: 3;
    justify-content: center;
    font-size: 0.78rem;
  }
}
