/* tdgen web — unified warm paper design system («Гостограф», no CDN, offline, CSP-safe). */
:root {
  --bg: #faf8f4;
  --bg-alt: #f2ece1;
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-warm: #fdfbf7;
  --ink: #1d1b18;
  --ink-secondary: #57524a;
  --muted: #787167;
  --ink-muted: #857e74;
  --line: #e4ded3;
  --border: rgba(29, 27, 24, 0.10);
  --border-strong: rgba(29, 27, 24, 0.18);
  --accent: #a63a12;
  --accent-dark: #8a2e0c;
  --accent-hover: #8a2e0c;
  --accent-soft: #faede7;
  --ok: #1b6b3a;
  --ok-soft: #e8f5ed;
  --danger: #b3261e;
  --danger-bg: #fbeae9;
  --warn-bg: #fff6e0;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-soft: 0 20px 50px rgba(29, 27, 24, 0.06), 0 2px 8px rgba(29, 27, 24, 0.03);
  --shadow-card: 0 12px 32px rgba(29, 27, 24, 0.05), 0 2px 6px rgba(29, 27, 24, 0.02);
  --shadow-sm: 0 4px 14px rgba(29, 27, 24, 0.08), 0 1px 4px rgba(29, 27, 24, 0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Consolas", "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HEADER — IDENTICAL TO LANDING.HTML (FROSTED WARM PAPER, BRAND ICON «Г»)
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--ink);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tagline {
  color: var(--ink-secondary);
  font-size: 0.84rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* ==========================================================================
   MAIN CONTAINER & CARDS
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1080px;
  margin: 32px auto 56px;
  padding: 0 24px;
  flex: 1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
}

.card h1 {
  margin: 0 0 10px;
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.card h2 {
  margin: 24px 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.card h2:first-child {
  margin-top: 0;
}

/* ==========================================================================
   HERO & START PAGE (GET /)
   ========================================================================== */
.hero {
  text-align: center;
  padding: 28px 0 36px;
  max-width: 860px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-alt);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid var(--border);
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 3.8vw, 2.85rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 750;
  color: var(--ink);
}

.hero p {
  color: var(--ink-secondary);
  font-size: 1.08rem;
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto 24px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
  padding: 18px 22px;
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.stat-num {
  display: block;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   COMPOSITION / TARIFF SELECTION CARDS (GET /)
   ========================================================================== */
.compositions {
  margin-bottom: 32px;
}

.section-header {
  margin-bottom: 18px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.section-header p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.96rem;
}

.composition-form {
  display: grid;
  gap: 20px;
}

.composition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.composition-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  cursor: pointer;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 0;
}

.composition-card:hover {
  border-color: var(--ink-muted);
  transform: translateY(-1px);
}

.composition-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--surface-warm);
  box-shadow: 0 18px 40px rgba(166, 58, 18, 0.10), 0 0 0 1px var(--accent);
}

.composition-card input[type="radio"] {
  margin-top: 5px;
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
}

.badge.badge-ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.price-pill {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-alt);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}

.card-title {
  font-weight: 750;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 6px;
}

.card-text {
  display: block;
  color: var(--ink-secondary);
  font-size: 0.94rem;
  line-height: 1.55;
}

.card-features {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 0.84rem;
  color: var(--ink-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.card-feature-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-feature-dot {
  color: var(--ok);
  font-weight: 700;
}

/* ==========================================================================
   HOW IT WORKS (4 APPLE-CLEAN CARDS ON GET /)
   ========================================================================== */
.how-it-works {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-card);
  margin-top: 28px;
}

.how-it-works h2 {
  margin: 0 0 16px;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.how-it-works ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-secondary);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
  font-size: 0.95rem;
}

.how-it-works li {
  padding-left: 4px;
  line-height: 1.5;
}

/* ==========================================================================
   WIZARD PROGRESS BAR & STEP CARDS (GET /wizard)
   ========================================================================== */
.wizard-progress {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.progress-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.progress-item.current {
  background: var(--ink);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(29, 27, 24, 0.16);
}

.progress-item.done {
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
}

.progress-item.done:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.progress-item.upcoming {
  opacity: 0.58;
}

.composition-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.composition-banner {
  font-size: 0.92rem;
  color: var(--ink-secondary);
  margin: 0;
}

.composition-banner strong {
  color: var(--ink);
}

.tariff-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

.tariff-tag.free {
  background: var(--ok-soft);
  color: var(--ok);
}

.tariff-tag.paid {
  background: var(--accent-soft);
  color: var(--accent);
}

.step-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}

.step-description {
  color: var(--ink-secondary);
  font-size: 0.98rem;
  margin: 0 0 24px;
  max-width: 48rem;
  line-height: 1.55;
}

/* ==========================================================================
   FORM INPUTS, SELECTS & BUTTONS (APPLE-LIKE TACTILE CONTROLS)
   ========================================================================== */
.form-field {
  margin-bottom: 18px;
  max-width: 42rem;
}

.form-field label {
  display: block;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.required {
  color: var(--danger);
  margin-left: 3px;
}

.form-field input[type="text"],
.form-field select,
.feedback-form textarea {
  width: 100%;
  padding: 12px 15px;
  font: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.form-field input[type="text"]:focus,
.form-field select:focus,
.feedback-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.form-field input:disabled {
  background: var(--bg-alt);
  color: var(--ink-secondary);
  border-color: var(--border);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--danger);
  background: #fffafa;
}

.field-error {
  color: var(--danger);
  margin: 6px 0 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.field-help {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  line-height: 1.25;
}

.btn.primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(166, 58, 18, 0.20);
}

.btn.primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn.secondary:hover {
  background: var(--bg-alt);
}

.btn.danger-outline {
  background: var(--surface);
  color: var(--danger);
  border-color: #ecc8c5;
}

.btn.danger-outline:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* ==========================================================================
   ALERTS & NOTICES
   ========================================================================== */
.alert {
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
  line-height: 1.5;
}

.alert.error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #ecc8c5;
}

.alert.warning {
  background: var(--warn-bg);
  color: #7a5b00;
  border: 1px solid #ecd9a0;
}

.alert.notice {
  background: var(--accent-soft);
  color: var(--ink);
  border: 1px solid rgba(166, 58, 18, 0.22);
}

.alert-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.alert-body {
  margin-top: 6px;
  white-space: pre-line;
}

.alert-hint {
  margin: 8px 0 0;
  font-size: 0.88rem;
}

.rule-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: baseline;
  white-space: nowrap;
}

.tech-report {
  margin: 12px 0;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.tech-report summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.tech-report code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  word-break: break-all;
}

/* ==========================================================================
   REVIEW TABLE & RESULT DOWNLOAD LIST
   ========================================================================== */
.summary-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  max-width: 48rem;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.summary-table th,
.summary-table td {
  border-bottom: 1px solid var(--border);
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
  font-size: 0.94rem;
}

.summary-table tr:last-child th,
.summary-table tr:last-child td {
  border-bottom: none;
}

.summary-table th {
  background: var(--bg-alt);
  color: var(--ink-secondary);
  font-weight: 600;
  width: 40%;
}

.summary-table td {
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
}

.doc-list {
  padding-left: 20px;
  color: var(--ink);
  font-weight: 500;
}

.doc-list li {
  margin-bottom: 6px;
}

.download-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  display: grid;
  gap: 12px;
  max-width: 44rem;
}

.download-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  background: var(--surface-warm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.download-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.download-label {
  font-weight: 650;
  color: var(--ink);
  font-size: 0.98rem;
}

.muted {
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

[data-anchor="generation"] {
  outline: 2px solid var(--danger);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   RESUME CARD, FEEDBACK EXPANDER & INLINE PAYMENT / QR BLOCK (IP POPOV V. N.)
   ========================================================================== */
.resume-card {
  border-color: var(--accent);
  background: var(--surface-warm);
}

.resume-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.resume-card .form-actions {
  margin-top: 14px;
  padding-top: 14px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.disclaimer-block {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--ink-secondary);
  font-size: 0.9rem;
}

.disclaimer-block strong {
  color: var(--ink);
}

.feedback-block {
  margin-top: 22px;
  max-width: 42rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
}

.feedback-block > summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
  font-size: 0.95rem;
}

.feedback-block > summary:hover {
  text-decoration: underline;
}

.feedback-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.feedback-form textarea {
  resize: vertical;
}

/* U-06: anti-bot honeypot of the feedback form — moved off-screen
   (never display:none, so naive bots still auto-fill it); a filled
   field makes the server silently drop the whole request. */
.feedback-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Payment & QR ST00012 panel (IP Popov V. N. — CSP-safe, zero inline styles) */
.payment-panel {
  margin-top: 20px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 20px 26px;
  box-shadow: var(--shadow-card);
}

.payment-panel > summary {
  cursor: pointer;
  font-weight: 750;
  font-size: 1.04rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.payment-summary-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--ok-soft);
  color: var(--ok);
}

.payment-grid {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.payment-option-card {
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.payment-qr-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  flex-shrink: 0;
}

.payment-qr-caption {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

.payment-option-info h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
  color: var(--ink);
}

.payment-option-info p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.payment-requisites-bar {
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.55;
}

.payment-requisites-bar code {
  font-family: var(--font-mono);
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   S-05: FAMILY DOMAIN TABS + LIVE SEARCH (STEP 2) & REVIEW PASSPORT (STEP 5)
   ========================================================================== */
.domain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}

.domain-chip {
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.domain-chip:hover {
  background: var(--bg-alt);
  border-color: var(--ink-muted);
}

.domain-chip.domain-chip-active,
.domain-chip[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.family-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.family-search-input {
  flex: 1 1 260px;
  max-width: 34rem;
  padding: 11px 15px;
  font: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.family-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.family-search-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* Step 5: order passport — documents block + ESTD note + route preview */
.review-passport {
  margin-top: 4px;
}

.review-passport-note {
  margin: 10px 0 0;
  padding: 12px 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
  max-width: 48rem;
}

.route-preview-box {
  margin: 16px 0 0;
  max-width: 48rem;
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 18px;
}

.route-preview-box > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--accent);
}

.route-preview-box > summary:hover {
  text-decoration: underline;
}

.route-preview-box[open] > summary {
  margin-bottom: 10px;
}

.route-preview-table {
  margin-bottom: 4px;
}

.route-preview-table th[scope="col"] {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ==========================================================================
   1-2-3 EXPRESS UX: VISUAL PART CARDS, PASSPORT BANNER & SHOP PARK SELECTOR
   ========================================================================== */
.fast-skip-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: var(--accent-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.fast-skip-text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink-secondary);
}

.fast-skip-text strong {
  color: var(--ink);
}

.org-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
  margin-bottom: 10px;
}

.org-fields-grid .form-field {
  margin-bottom: 4px;
}

.quick-pick-hint {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--ink-secondary);
}

.family-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow-y: auto;
  padding: 12px;
  margin-bottom: 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.family-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.family-card[hidden] {
  display: none;
}

.family-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.family-card-selected {
  border-color: var(--accent);
  background: var(--surface-warm);
}

.family-card-disabled {
  opacity: 0.62;
}

.family-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.family-card-domain {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.family-card-status {
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.family-card-title {
  font-size: 0.93rem;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
}

.family-card-dns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.dn-pill-btn {
  appearance: none;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-alt);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.dn-pill-btn:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

.dn-pill-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

.dn-pill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* U-01: collapsed fallback drawer around the classic family/DN dropdowns
   on Step 2 — the 1-click card grid above is the primary path, the plain
   <select> pair stays fully functional underneath. */
.classic-select-drawer {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.classic-select-drawer > summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--muted);
}

.classic-select-drawer > summary:hover {
  text-decoration: underline;
}

.classic-select-drawer[open] > summary {
  margin-bottom: 10px;
}

.part-passport-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.part-passport-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.part-passport-label {
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.part-passport-val {
  font-size: 0.92rem;
  color: var(--ink);
}

.form-field-readonly-compact {
  display: none;
}

.park-selector-block {
  margin: 20px 0 18px;
}

.park-selector-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.park-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.park-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.park-card:hover {
  border-color: var(--accent);
  background: var(--surface-warm);
}

.park-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
}

.park-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.park-card-title {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
}

.park-card-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-secondary);
}

.custom-overrides-drawer {
  margin: 14px 0 20px;
  padding: 14px 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.custom-overrides-drawer > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--accent);
}

.custom-overrides-drawer > summary:hover {
  text-decoration: underline;
}

.custom-overrides-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   FOOTER — UNIFIED LEGAL & GOST 3.1102-2011 FRAMEWORK
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink-secondary);
  font-size: 0.84rem;
  padding: 40px 0 48px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-disclaimer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 18px;
}

.site-footer .disclaimer {
  font-size: 0.84rem;
  color: var(--ink-secondary);
  margin: 0;
  line-height: 1.55;
}

.footer-legal-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.legal-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
}

.legal-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.85rem;
}

.legal-body {
  margin-top: 8px;
  font-size: 0.81rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.footer-meta-lines {
  max-width: 720px;
  line-height: 1.5;
}

.footer-operator-line {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.footer-session-form {
  margin: 0;
}

@media (max-width: 820px) {
  .composition-grid,
  .hero-stats,
  .how-it-works ol,
  .payment-grid,
  .org-fields-grid,
  .part-passport-banner,
  .park-cards-grid {
    grid-template-columns: 1fr;
  }
  .fast-skip-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .card {
    padding: 22px 20px;
  }
  .payment-option-card {
    flex-direction: column;
  }
}

/* ============================================================
   U-05: catalog 1-click quick-calc links + adaptive safety net
   (append-only block — do NOT reformat the rules above)
   ============================================================ */

.catalog-family-card {
  cursor: default;
}

.catalog-family-link {
  color: inherit;
  text-decoration: none;
}

.catalog-family-link:hover {
  color: var(--accent);
}

.catalog-dn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.catalog-dn-link {
  display: inline-block;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-alt);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.catalog-dn-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--surface);
}

.catalog-dn-link-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.catalog-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* U-05 adaptive safety net: the 1-2-3 express grids collapse to a single
   column on narrow screens. .part-passport-banner / .park-cards-grid /
   .org-fields-grid are repeated here intentionally so the whole invariant
   lives in one testable block (tests/test_u05_catalog_deeplink_and_viewport.py). */
@media (max-width: 820px) {
  .family-card-grid,
  .part-passport-banner,
  .park-cards-grid,
  .org-fields-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   FX-4 (V-wave basket 1): wide-table scroll wrapper + touch
   targets (append-only block — do NOT reformat the rules above)
   ============================================================ */

/* Wide 5-column route tables (.summary-table) cannot shrink below their
   min-content width (~566-733px), so on 375px screens the whole page used
   to scroll horizontally (V-02 P1-1). The .table-scroll wrapper receives
   the horizontal scroll instead of the document. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll .summary-table {
  margin-bottom: 0;
}

/* Touch targets: the funnel controls measured 29-37px tall in Chrome
   (V-02 P2-1) — below the 40px audit threshold. min-height keeps the
   visual pills compact while guaranteeing a >=40px hit area. */
.dn-pill-btn {
  min-height: 40px;
}

.domain-chip {
  min-height: 40px;
}

.btn-sm {
  min-height: 40px;
}

.catalog-dn-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}


/* ============================================================
   fxW (final web features): route-variant radio + material
   override warning (append-only block — do NOT reformat above)
   ============================================================ */

/* Step-3 «Вариант технологии изготовления»: reuses the park-card grid
   above the park cards; only the block spacing is added. */
.route-variant-block {
  margin: 0 0 18px;
}

.route-variant-block .park-cards-grid {
  margin-top: 8px;
}

/* Owner decision 1a: honest yellow warning under the material override
   select, shown only when a replacement grade is chosen. Palette follows
   the existing .alert.warning tokens. */
.material-override-warning {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #b07c1f;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}


/* ============================================================
   fxP (compliance passport): expandable «Нормативная база
   комплекта» block on /result (append-only block — do NOT
   reformat anything above)
   ============================================================ */

.compliance-block {
  margin: 16px 0 0;
  max-width: 48rem;
  background: var(--surface-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 18px;
}

.compliance-block > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--accent);
}

.compliance-block > summary:hover {
  text-decoration: underline;
}

.compliance-block[open] > summary {
  margin-bottom: 10px;
}

.compliance-block .compliance-note {
  margin: 0 0 10px;
  color: var(--ink-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* 3-column normative table: standard column narrow-ish, clauses column
   compact, coverage takes the rest (overrides .summary-table th 40%). */
.compliance-block .compliance-table {
  margin-bottom: 12px;
}

.compliance-block .compliance-table th[scope="col"] {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.compliance-block .compliance-table th[scope="col"]:nth-child(1),
.compliance-block .compliance-table td:nth-child(1) {
  width: 34%;
}

.compliance-block .compliance-table th[scope="col"]:nth-child(2),
.compliance-block .compliance-table td:nth-child(2) {
  width: 30%;
  font-size: 0.85rem;
}

.compliance-block .compliance-table td {
  font-size: 0.88rem;
}


/* ============================================================
   fxL (LIVE-2 fixes): char counter, park no-op warning, catalog
   search, payment SLA note (append-only block — do NOT reformat
   anything above)
   ============================================================ */

/* P1-1: live character counter under long org fields. */
.char-counter {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--ink-secondary, #6b7280);
  text-align: right;
}

.char-counter-warn {
  color: #b07c1f;
}

.char-counter-limit {
  color: #a33;
  font-weight: 600;
}

/* P2-6: honest yellow note when the chosen park profile substituted
   nothing for the family (same palette as .material-override-warning). */
.park-no-match-warning {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #b07c1f;
  border-radius: 4px;
  background: var(--bg-alt);
  color: var(--ink-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
}

/* P8: server-side search over the catalog family cards (GET ?q=). */
.catalog-search-bar {
  margin-top: 18px;
  max-width: 34rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.catalog-search-input {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  border: 1px solid var(--border-strong, #9ca3af);
  border-radius: var(--radius-md, 6px);
}

.catalog-search-result {
  margin: 12px 0 0;
  font-size: 0.95rem;
  color: var(--ink-secondary);
}

/* Owner decision 11.11: SLA note under the payment requisites bar. */
.payment-sla-note {
  margin: 10px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}


/* ============================================================
   fxM (LIVE-3 fixes): mobile download tiles, unlock banner,
   feedback tap target (append-only block — do NOT reformat
   anything above)
   ============================================================ */

/* A2 F-1: locked /result overflowed 375px by 63px — the nowrap tag
   «откроется после активации кода» and long labels refused to wrap. */
@media (max-width: 480px) {
  .download-item {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 12px;
  }

  .download-item .rule-tag,
  .download-item .download-label {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* A2 F-3: the unlock confirmation must be visible without opening
   the payment panel. */
.payment-unlocked-banner {
  margin: 0 0 12px;
}

/* A2 F-4: «Не нашли деталь?» toggle was a 24px tap target. */
.feedback-block summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}


/* fxN: 24-hour storage note above the download list + delivery banners. */
.storage-note {
  margin: 10px 0 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.alert.warning.payment-unlocked-banner {
  border-left: 3px solid #b07c1f;
}

/* fxN (LIVE-4 B8 P3): 16px inputs on mobile — iOS Safari otherwise zooms
   the page on every field focus (the unlock/code inputs measured 15.7px). */
@media (max-width: 480px) {
  input[type="text"],
  input[type="search"],
  select {
    font-size: 16px;
  }
}
