:root {
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --line: #D2D2D7;
  --text: #1D1D1F;
  --soft: #3A3A3C;
  --muted: #6E6E73;
  --blue: #0071E3;
  --blue-deep: #0058B0;
  --blue-deeper: #004A96;
  --blue-soft: #E8F2FC;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: 56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Catalog (index) */
.page {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: calc(28px + var(--safe-top)) 22px calc(56px + var(--safe-bottom));
  min-height: 100dvh;
}
@media (min-width: 720px) {
  .page {
    width: min(700px, 100%);
    padding: calc(64px + var(--safe-top)) 24px calc(80px + var(--safe-bottom));
  }
}

.logo {
  height: 28px;
  width: auto;
  display: block;
}
@media (min-width: 720px) {
  .logo { height: 32px; }
}

.site-back {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 88, 176, 0.16);
  background: var(--blue-soft);
  color: var(--blue-deep);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}
.site-back:hover,
.site-back:focus-visible {
  background: #D6E9F8;
  color: var(--blue-deeper);
  outline: none;
}

.catalog-header {
  display: grid;
  gap: 10px;
  margin-bottom: 28px;
}
.catalog-header .logo { margin-bottom: 4px; }
.catalog-header h1 {
  margin: 2px 0 0;
  font-size: clamp(28px, 6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.catalog-header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 46ch;
}

.form-list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.form-row:hover,
.form-row:active {
  color: var(--blue);
}
.form-row.is-soon {
  color: var(--text);
  cursor: default;
  opacity: 0.55;
}
.form-row.is-soon:hover,
.form-row.is-soon:active {
  color: var(--text);
}
.form-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.form-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.form-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.form-go {
  position: relative;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  color: var(--muted);
  transform: rotate(-90deg);
}
.form-row:hover .form-go { color: var(--blue); }
.form-go::before,
.form-go::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 7px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}
.form-go::before {
  left: 0;
  transform-origin: left center;
  transform: translateY(calc(-50% - 2.47px)) rotate(45deg);
}
.form-go::after {
  right: 0;
  transform-origin: right center;
  transform: translateY(calc(-50% - 2.47px)) rotate(-45deg);
}

/* Form app (phone-first, toolkit tool chrome) */
.app {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  position: relative;
}
@media (min-width: 480px) {
  body.form-body {
    display: grid;
    place-items: center;
    padding: 24px 16px;
    min-height: 100vh;
  }
  .app {
    max-height: min(844px, calc(100vh - 48px));
    min-height: min(844px, calc(100vh - 48px));
    border-radius: 28px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
  }
}

.chrome-top {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
}
.nav {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(var(--nav-h) + var(--safe-top));
  padding: calc(10px + var(--safe-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.nav-logo img {
  display: block;
  height: 24px;
  width: auto;
}

.progress {
  height: 3px;
  background: rgba(0, 0, 0, 0.06);
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--blue-deep);
  transition: width 220ms ease;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 18px;
}

.brand {
  text-align: left;
  padding: 6px 0 18px;
}
.eyebrow {
  margin: 0;
  color: var(--blue-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lede-title {
  margin: 8px 0 0;
  color: var(--text);
  font-size: clamp(26px, 7vw, 32px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.hero { padding: 0 0 16px; }
.support {
  margin: 0;
  color: var(--soft);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
}
.support + .support {
  margin-top: 10px;
  color: var(--muted);
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.card + .card { margin-top: 10px; }

.q-num {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.q-text {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.q-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.field-pair .field { margin-top: 0; }
.card > .field:first-child,
.card > .field-pair:first-child { margin-top: 0; }
.field { margin-top: 16px; }
.field label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(0, 113, 227, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}
.field textarea { min-height: 140px; }

.choice-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  -webkit-tap-highlight-color: transparent;
}
.choice:active { transform: scale(0.98); }
.choice.is-on {
  border-color: var(--blue-deep);
  background: var(--blue-soft);
  box-shadow: 0 0 0 2px rgba(0, 88, 176, 0.18);
}
.choice-letter {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 800;
}
.choice.is-on .choice-letter {
  background: var(--blue-deep);
  color: #fff;
}
.choice-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.review-item {
  width: 100%;
  display: block;
  text-align: left;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.review-item:hover { border-color: rgba(0, 113, 227, 0.35); }
.review-q {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}
.review-a {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.review-a.empty { color: var(--muted); font-style: normal; }
.review-edit {
  margin: 10px 0 0;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 700;
}
.review-next { margin-top: 12px; }

.done-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.done-copy {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 15px;
  line-height: 1.5;
}

.error {
  margin: 0 0 8px;
  color: #B42318;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  flex-shrink: 0;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.dock-split {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid rgba(0, 88, 176, 0.16);
  background: var(--blue-soft);
  color: var(--blue-deep);
  text-decoration: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pill:active { transform: scale(0.98); }
.pill:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.pill-primary {
  min-height: 32px;
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  font-weight: 800;
}
.pill-primary:hover:not(:disabled) { background: var(--blue-deeper); }
.pill-secondary {
  border: 0;
  background: var(--blue);
  color: #fff;
}
.pill-subtle {
  border: 1px solid rgba(0, 88, 176, 0.16);
  background: var(--blue-soft);
  color: var(--blue-deep);
}
.dock .pill {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}
.dock-split .pill { width: 100%; }

.hidden { display: none !important; }

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