html{scrollbar-gutter:stable}
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --navy:   #1a1a2e;
      --blue:   #2E7DDA;
      --blue-h: #1a6abf;
      --bg:     #F5F6F8;
      --card:   #FFFFFF;
      --border: #E2E5EA;
      --text:   #1C2B3A;
      --muted:  #6B7A8D;
      --red:    #D94040;
      --green:  #1A8A4A;
      --radius: 8px;
    }

    body {
      font-family: 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
    }

    /* ── Navbar ── */
    nav {
      background: var(--navy);
      padding: 0 40px;
      height: 60px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .nav-logo { color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .nav-logo-mark { width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; }
    .nav-logo span { color: #7BAED6; }
    .nav-right { display: flex; align-items: center; gap: 20px; }
    .nav-right a { color: rgba(255,255,255,.75); text-decoration: none; font-size: 14px; }
    .nav-right a:hover { color: #fff; }
    @media(max-width:700px){
      nav { padding: 0 16px; }
      .nav-right a:not(.nav-cabinet):not(.nav-cta) { display: none; }
      .nav-right { gap: 8px; }
      .nav-cabinet { font-size: 13px; padding: 6px 12px; }
    }
    .nav-cabinet {
      background: rgba(255,255,255,.12);
      padding: 6px 16px;
      border-radius: 6px;
      color: #fff !important;
      font-weight: 500;
    }
    .nav-cabinet:hover { background: rgba(255,255,255,.22) !important; }
    .nav-cta { background: var(--blue); color: #fff !important; padding: 7px 18px; border-radius: 6px; font-weight: 600; font-size: 14px; text-decoration: none; }
    .nav-cta:hover { background: var(--blue-h) !important; }

    /* ── Page layout ── */
    .page-wrap {
      max-width: 1200px;
      margin: 0 auto;
      padding: 36px 24px 80px;
    }
    .order-layout {
      display: grid;
      grid-template-columns: minmax(0, 680px) 1fr;
      gap: 32px;
      align-items: start;
    }
    .order-sidebar {
      position: sticky;
      top: 84px;
    }
    .sidebar-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 24px;
      margin-bottom: 16px;
    }
    .sidebar-card h3 {
      font-size: 15px;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 14px;
      padding-bottom: 10px;
      border-bottom: 1px solid var(--border);
    }
    /* ── Sidebar: dynamic order summary ── */
    .sb-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
    .sb-header h3 { margin: 0; padding-bottom: 0; border-bottom: none; }
    .sb-price { font-size: 22px; font-weight: 800; color: var(--blue); line-height: 1; }
    .sb-name { font-size: 15px; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
    .sb-features { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
    .sb-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #374151; line-height: 1.4; }
    .sb-features li::before { content: "✓"; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
    .sb-tip { background: #F0FFF4; border-radius: 8px; padding: 10px 12px; font-size: 12px; color: #166534; line-height: 1.5; }

    /* ── Sidebar: FAQ ── */
    .sidebar-faq { display: flex; flex-direction: column; gap: 0; }
    .sfaq-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
    .sfaq-item:last-child { border-bottom: none; padding-bottom: 0; }
    .sfaq-q { font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 4px; cursor: pointer; }
    .sfaq-a { font-size: 12px; color: var(--muted); line-height: 1.55; }

    @media(max-width: 900px) { .order-layout { grid-template-columns: 1fr; } .order-sidebar { position: static; } }

    .page-title {
      font-size: 26px;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 6px;
    }
    .page-sub {
      color: var(--muted);
      font-size: 15px;
      margin-bottom: 36px;
    }

    /* ── Steps breadcrumb ── */
    .steps {
      display: flex;
      align-items: center;
      gap: 0;
      margin-bottom: 16px;
    }
    .step {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--muted);
    }
    .step.active { color: var(--navy); font-weight: 600; }
    .step.done   { color: var(--green); }
    .step-num {
      width: 24px; height: 24px;
      border-radius: 50%;
      background: var(--border);
      color: var(--muted);
      display: flex; align-items: center; justify-content: center;
      font-size: 12px; font-weight: 600;
      flex-shrink: 0;
    }
    .step.active .step-num { background: var(--navy); color: #fff; }
    .step.done   .step-num { background: var(--green); color: #fff; }
    .step-sep { width: 32px; height: 1px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

    /* ── Form progress bar ── */
    .form-progress-wrap {
      margin-bottom: 28px;
    }
    .form-progress-label {
      display: flex; justify-content: space-between;
      font-size: 12px; color: var(--muted); margin-bottom: 6px;
    }
    .form-progress-bar {
      height: 4px; background: var(--border); border-radius: 4px; overflow: hidden;
    }
    .form-progress-fill {
      height: 100%; background: linear-gradient(90deg, var(--blue), #34c977);
      border-radius: 4px;
      transition: width .4s ease;
      width: 10%; /* стартовое значение — обновляется JS */
    }

    /* ── Card ── */
    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 32px;
      margin-bottom: 20px;
    }
    .card-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--navy);
      margin-bottom: 24px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--border);
    }

    /* ── Extract type selector ── */
    .extract-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-bottom: 4px;
    }
    @media(max-width:600px) { .extract-grid { grid-template-columns: 1fr; } }

    .extract-option { display: none; }
    /* Wrapper: flex column so label fills the full grid-cell height */
    .extract-grid > div {
      display: flex;
      flex-direction: column;
      position: relative;    /* anchor for the floating badge */
      padding-top: 14px;     /* space for badge sitting on the border */
    }
    .extract-label {
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex: 1;               /* stretch to fill wrapper height */
      border: 2px solid var(--border);
      border-radius: 12px;
      padding: 14px 14px 14px;
      cursor: pointer;
      transition: border-color .22s cubic-bezier(.25,.46,.45,.94), background .22s cubic-bezier(.25,.46,.45,.94), box-shadow .22s cubic-bezier(.25,.46,.45,.94);
    }
    .extract-option:checked + .extract-label {
      border-color: var(--blue);
      background: #EFF6FF;
      box-shadow: 0 0 0 3px rgba(46,125,218,.12);
    }
    /* Особая стилизация для "Полной выписки" */
    #et-full + .extract-label {
      border-color: #C0D8F5;
      background: #F8FBFF;
    }
    #et-full:checked + .extract-label {
      border-color: var(--blue);
      background: #EFF6FF;
      box-shadow: 0 0 0 3px rgba(46,125,218,.15);
    }
    .extract-label-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--navy);
    }
    .extract-label-desc {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.4;
      flex: 1;            /* описание тянется, цена всегда внизу */
    }
    .extract-label-price {
      font-size: 15px;
      font-weight: 700;
      color: var(--blue);
      margin-top: 8px;
    }
    /* Бейджи плавают поверх верхней рамки карточки */
    .badge-group {
      position: absolute;
      top: 3px; left: 12px;
      display: flex; gap: 4px;
      z-index: 1;
    }
    .badge-tag {
      background: #F0A500; color: #fff;
      font-size: 10px; font-weight: 700;
      padding: 2px 8px; border-radius: 20px;
      text-transform: uppercase; letter-spacing: .5px;
    }

    /* ── Search mode tabs (адрес / кад. номер) ── */
    .search-mode-tabs {
      display: flex; background: var(--bg); border-radius: var(--radius);
      padding: 3px; gap: 3px; margin-bottom: 20px;
    }
    .smt-tab {
      flex: 1; font-size: 13px; font-weight: 600; padding: 9px 12px;
      border-radius: 6px; color: var(--muted); text-align: center;
      background: none; border: none; cursor: pointer; font-family: inherit;
      transition: all .15s;
    }
    .smt-tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(28,33,48,.08); }
    .smt-tab:hover:not(.active) { color: var(--text); }

    /* Подтверждение кад. номера */
    .cadastral-confirmed {
      display: none; margin-top: 12px;
      background: #EFF6FF; border: 1px solid var(--blue);
      border-radius: var(--radius); padding: 12px 16px;
      font-size: 14px; color: var(--navy);
      align-items: center; gap: 10px;
    }
    .cadastral-confirmed.show { display: flex; }

    /* ── Address autocomplete ── */
    .address-block { position: relative; }
    .address-selected {
      display: none;
      background: #EFF6FF;
      border: 1px solid var(--blue);
      border-radius: var(--radius);
      padding: 12px 16px;
      margin-bottom: 8px;
      font-size: 14px;
      color: var(--navy);
      position: relative;
    }
    .address-selected.show { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .address-selected-icon { color: var(--blue); font-size: 18px; flex-shrink: 0; margin-top: 1px; }
    .address-selected-text { flex: 1; }
    .address-selected-addr { font-weight: 600; }
    .address-selected-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
    .address-clear-btn {
      background: none; border: 1px solid var(--border); cursor: pointer;
      color: var(--blue); font-size: 12px; font-weight: 500; flex-shrink: 0;
      line-height: 1; padding: 5px 10px; border-radius: 5px;
      white-space: nowrap; font-family: inherit;
    }
    .address-clear-btn:hover { background: #EFF6FF; border-color: var(--blue); }

    .autocomplete-container { position: relative; }
    .autocomplete-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      left: 0; right: 0;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: 0 8px 24px rgba(0,0,0,.10);
      z-index: 200;
      overflow: hidden;
      display: none;
      max-height: 300px;
      overflow-y: auto;
    }
    .autocomplete-dropdown.open { display: block; }
    .autocomplete-item {
      padding: 11px 16px;
      cursor: pointer;
      font-size: 13px;
      border-bottom: 1px solid #f0f2f5;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
    .autocomplete-item:last-child { border-bottom: none; }
    .autocomplete-item:hover, .autocomplete-item.focused { background: var(--bg); }
    .autocomplete-item-main { color: var(--text); }
    .autocomplete-item-sub  { color: var(--muted); font-size: 11px; }
    .autocomplete-item-kn   { color: var(--blue); font-size: 11px; font-weight: 500; }
    .autocomplete-spinner {
      padding: 16px; text-align: center;
      color: var(--muted); font-size: 13px;
    }
    .autocomplete-empty {
      padding: 14px 16px; color: var(--muted); font-size: 13px; font-style: italic;
    }

    /* ── Form fields ── */
    .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    @media(max-width:600px) { .field-row { grid-template-columns: 1fr; } }

    .field { display: flex; flex-direction: column; gap: 6px; }
    .field + .field { margin-top: 0; }
    .fields-stack { display: flex; flex-direction: column; gap: 16px; }

    label {
      font-size: 13px;
      font-weight: 500;
      color: var(--navy);
    }
    label .req { color: var(--red); margin-left: 2px; }

    input[type="text"], input[type="email"], input[type="tel"] {
      width: 100%;
      padding: 11px 14px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      font-family: inherit;
      font-size: 14px;
      color: var(--text);
      background: #fff;
      outline: none;
      transition: border-color .15s;
    }
    input:focus { border-color: var(--blue); }
    input.error  { border-color: var(--red); }
    input.valid  { border-color: var(--green); }

    .field-hint { font-size: 12px; color: var(--muted); }
    .field-error { font-size: 12px; color: var(--red); display: none; }
    .field-error.show { display: block; }

    /* Погашенное поле квартиры при чекбоксе «целое здание» */
    input:disabled {
      background: #F0F2F5;
      color: var(--muted);
      cursor: not-allowed;
      border-color: var(--border);
    }
    .field.dimmed label,
    .field.dimmed .field-hint { opacity: 0.4; }
    .field.dimmed { transition: opacity .2s; }

    /* Phone prefix */
    .phone-wrap { position: relative; }
    .phone-prefix {
      position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
      font-size: 14px; color: var(--navy); font-weight: 500; pointer-events: none;
      user-select: none;
    }
    .phone-wrap input { padding-left: 38px; }

    /* ── Order summary ── */
    .summary-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px 0;
      border-bottom: 1px solid var(--border);
      font-size: 14px;
    }
    .summary-row:last-child { border-bottom: none; }
    .summary-label { color: var(--muted); }
    .summary-value { color: var(--navy); font-weight: 600; }
    .summary-total .summary-label { color: var(--navy); font-weight: 600; font-size: 15px; }
    .summary-total .summary-value { font-size: 28px; font-weight: 700; color: var(--blue); letter-spacing: -.5px; }

    /* ── Object search button ── */
    .btn-find-obj {
      display: inline-flex; align-items: center; gap: 8px;
      background: var(--navy); color: #fff;
      border: none; border-radius: var(--radius);
      padding: 11px 22px; font-size: 14px; font-weight: 600;
      cursor: pointer; transition: background .15s; font-family: inherit;
    }
    .btn-find-obj:hover { background: #122a44; }
    .btn-find-obj:disabled { background: #8a94a6; cursor: default; }
    .btn-find-obj.loading { background: #8a94a6; cursor: default; }

    /* ── Object results panel ── */
    .obj-results-title {
      font-size: 13px; font-weight: 700; color: var(--text);
      text-transform: uppercase; letter-spacing: .04em;
      margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
    }
    .obj-results-count {
      background: var(--blue); color: #fff;
      font-size: 11px; font-weight: 700; border-radius: 20px;
      padding: 1px 8px; letter-spacing: 0;
    }
    .obj-results-list {
      border: 1.5px solid var(--border); border-radius: 10px;
      max-height: 270px; overflow-y: auto;
      background: #fff;
    }
    .obj-item {
      display: flex; align-items: center; gap: 14px;
      padding: 13px 16px; border-bottom: 1px solid var(--border);
      transition: background .12s;
    }
    .obj-item:last-child { border-bottom: none; }
    .obj-item:hover { background: #F8FAFD; }
    .obj-item-info { flex: 1; min-width: 0; }
    .obj-item-addr {
      font-size: 14px; font-weight: 600; color: var(--text);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .obj-item-kn { font-size: 12px; color: var(--muted); margin-top: 3px; }
    .obj-item-kn-val { color: var(--blue); font-weight: 500; }
    .btn-obj-select {
      flex-shrink: 0;
      background: var(--blue); color: #fff;
      border: none; border-radius: 6px;
      padding: 7px 14px; font-size: 13px; font-weight: 600;
      cursor: pointer; transition: background .12s; font-family: inherit;
      white-space: nowrap;
    }
    .btn-obj-select:hover { background: var(--blue-h); }
    .obj-results-state {
      display: flex; align-items: center; gap: 10px;
      font-size: 13px; color: var(--muted); padding: 14px 0;
    }

    /* ── Submit button ── */
    .btn-submit {
      width: 100%;
      padding: 16px;
      background: var(--blue);
      color: #fff;
      border: none;
      border-radius: var(--radius);
      font-family: inherit;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: background .15s;
      margin-top: 8px;
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .btn-submit:hover { background: var(--blue-h); }
    .btn-submit:disabled { background: #aac4e8; cursor: default; }

    .secure-note {
      display: flex; align-items: center; gap: 6px;
      justify-content: center;
      font-size: 12px; color: var(--muted); margin-top: 12px;
    }

    /* ── Success state ── */
    #success-screen {
      display: none;
      text-align: center;
      padding: 48px 32px;
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: var(--radius);
    }
    #success-screen.show { display: block; }
    .success-icon { font-size: 56px; margin-bottom: 16px; }
    .success-title { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
    .success-sub { font-size: 15px; color: var(--muted); margin-bottom: 28px; line-height: 1.6; }
    .success-order-num { font-size: 13px; color: var(--muted); margin-top: 16px; }
    .btn-outline {
      display: inline-flex; align-items: center; gap: 6px;
      padding: 12px 24px;
      border: 2px solid var(--navy);
      color: var(--navy);
      border-radius: var(--radius);
      font-family: inherit; font-size: 14px; font-weight: 600;
      cursor: pointer; background: transparent;
      text-decoration: none;
    }
    .btn-outline:hover { background: var(--bg); }

    #order-form.hidden { display: none; }

    /* ── Error toast ── */
    #toast {
      position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
      background: #2D2D2D; color: #fff;
      padding: 12px 24px; border-radius: 8px;
      font-size: 14px; max-width: 400px;
      opacity: 0; pointer-events: none;
      transition: opacity .3s;
      z-index: 999;
    }
    #toast.show { opacity: 1; }
    /* ── Login Modal ── */
    .lm-overlay{position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.5);display:none;align-items:center;justify-content:center;}
    .lm-overlay.open{display:flex;}
    .lm-box{background:#fff;border-radius:12px;padding:32px 28px;width:360px;max-width:92vw;position:relative;box-shadow:0 20px 60px rgba(0,0,0,.2);}
    .lm-close{position:absolute;top:12px;right:14px;background:none;border:none;font-size:18px;cursor:pointer;color:#5A6478;line-height:1;}
    .lm-icon{font-size:32px;text-align:center;margin-bottom:12px;}
    .lm-title{font-size:18px;font-weight:700;color:#1C2130;text-align:center;margin-bottom:6px;}
    .lm-sub{font-size:13px;color:#5A6478;text-align:center;margin-bottom:16px;line-height:1.5;}
    .lm-err{font-size:13px;color:#C0392B;min-height:16px;margin-bottom:8px;text-align:center;}
    .lm-input{width:100%;padding:10px 14px;border:1.5px solid #DDE1E9;border-radius:8px;font-size:15px;font-family:inherit;outline:none;margin-bottom:10px;box-sizing:border-box;}
    .lm-input:focus{border-color:#2E7DDA;}
    .lm-btn{width:100%;padding:11px;background:#2E7DDA;color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;margin-bottom:8px;}
    .lm-btn:hover{background:#1D67C1;}
    .lm-btn:disabled{background:#9BB8D8;cursor:not-allowed;}
    .lm-cancel-btn{width:100%;padding:9px;background:none;border:1.5px solid #DDE1E9;border-radius:8px;font-size:14px;color:#5A6478;cursor:pointer;font-family:inherit;}
    .lm-cancel-btn:hover{border-color:#1C2130;color:#1C2130;}
    .lm-otp-row{display:flex;gap:8px;justify-content:center;margin:12px 0 16px;}
    .lm-otp-digit{width:42px;height:50px;text-align:center;border:1.5px solid #DDE1E9;border-radius:8px;font-size:20px;font-weight:700;font-family:inherit;outline:none;}
    .lm-otp-digit:focus{border-color:#2E7DDA;}
    .lm-back-btn{background:none;border:none;color:#2E7DDA;font-size:13px;cursor:pointer;font-family:inherit;padding:0;margin-top:4px;}
    .lm-hint-sm{font-size:12px;color:#8A94A6;text-align:center;margin-top:8px;line-height:1.5;}

    /* ── SEO sections ── */
    .seo-section { margin-top: 64px; }
    .seo-section h2 { font-size: 22px; font-weight: 700; color: var(--navy); margin-bottom: 24px; }
    .seo-section h3 { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 8px; margin-top: 0; }
    .seo-section p { font-size: 15px; color: #4a5568; line-height: 1.7; margin-bottom: 12px; }

    .how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 4px; }
    @media(max-width:640px){ .how-grid { grid-template-columns: 1fr; } }
    .how-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
    .how-num { width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
    .how-card h3 { font-size: 14px; margin-bottom: 6px; }
    .how-card p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

    .price-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
    .price-table th { background: var(--navy); color: #fff; padding: 12px 16px; text-align: left; font-size: 14px; font-weight: 600; }
    .price-table td { padding: 12px 16px; font-size: 14px; color: #4a5568; border-bottom: 1px solid var(--border); }
    .price-table tr:last-child td { border-bottom: none; }
    .price-table tr:nth-child(even) td { background: #f9fafb; }
    .price-table .price-val { font-weight: 700; color: var(--blue); white-space: nowrap; }
    .price-table .price-best { background: #f0fdf4 !important; }
    .price-table .price-best td:first-child::before { content: "⭐ "; }

    .faq-seo { margin-top: 4px; }
    .faq-seo-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
    .faq-seo-q { width: 100%; background: none; border: none; padding: 16px 20px; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .faq-seo-q:hover { background: #fafbfc; }
    .faq-seo-a { display: none; padding: 0 20px 16px; font-size: 14px; color: #4a5568; line-height: 1.7; }
    .faq-seo-a a { color: var(--blue); }

    .seo-text { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; margin-top: 4px; font-size: 14px; color: #4a5568; line-height: 1.8; }
    .seo-text strong { color: var(--navy); }
