:root {
  --bg: #f8f9fa;
  --card: #ffffff;
  --panel: #f3f4f6;
  --ink: #1a1a1a;
  --muted: #8e8e93;
  --line: #ececee;
  --blue: #4a8ff7;
  --blue-soft: #eaf2fe;
  --green: #b9e866;
  --green-text: #5b8a14;
  --ok: #3d8c40;
  --wait: #c4892a;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  max-width: 100%;
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
}
a { color: var(--blue); }
.top {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  max-width: 100%;
  overflow-x: clip;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  background: var(--blue);
  color: white;
  font-size: 0.8rem;
}
.wrap {
  width: min(1180px, calc(100% - 2rem));
  max-width: 100%;
  margin: 1.5rem auto 3rem;
}
.hero { margin-bottom: 1.2rem; min-width: 0; }
.hero h1 { margin: 0.15rem 0 0.25rem; font-size: 1.55rem; overflow-wrap: anywhere; }
.hero .muted,
.hero .step {
  overflow-wrap: anywhere;
}
.step {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.muted { color: var(--muted); }
.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card h1 {
  margin: 0 0 0.85rem;
  font-size: 1.45rem;
  line-height: 1.25;
}
.card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.4rem;
}
.banner {
  padding: 0.8rem 1rem;
  border-radius: 0.8rem;
  margin-bottom: 1rem;
}
.banner.error { background: #fde8e8; color: #b42318; }
.banner.ok { background: #e8f6ea; color: var(--ok); }
.banner.info { background: #eef4ff; color: #1d4ed8; }

.fio-row {
  display: grid;
  gap: 0.85rem;
}
.fio-row label,
.fio-row .suggest {
  margin-bottom: 0;
}
.fio-extra {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.15rem;
}
.patronymic-opt {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.38rem 0.65rem 0.38rem 0.5rem;
  border: 1px solid #e3e3e8;
  border-radius: 999px;
  background: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  width: fit-content;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.patronymic-opt:hover {
  border-color: #cfdcf5;
  background: #fbfdff;
}
.patronymic-opt:has(input:checked) {
  border-color: #b8d4fb;
  background: var(--blue-soft);
  color: #3b7bd9;
  box-shadow: 0 0 0 1px rgba(74, 143, 247, 0.06);
}
.patronymic-opt input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.patronymic-check {
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid #c8c8cc;
  border-radius: 0.38rem;
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.patronymic-check::after {
  content: "";
  width: 0.34rem;
  height: 0.62rem;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) scale(0);
  margin-top: -0.1rem;
  transition: transform 0.12s ease;
}
.patronymic-opt input:checked + .patronymic-check {
  border-color: var(--blue);
  background: var(--blue);
}
.patronymic-opt input:checked + .patronymic-check::after {
  transform: rotate(45deg) scale(1);
}
.patronymic-opt input:focus-visible + .patronymic-check {
  outline: 2px solid rgba(74, 143, 247, 0.35);
  outline-offset: 2px;
}
.patronymic-check-text {
  line-height: 1;
}
.fio-patronymic-field.is-disabled input[type="text"] {
  opacity: 0.45;
  background: var(--panel);
}

.client-card .client-order-summary {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.client-form {
  display: grid;
  gap: 0;
}
.form-section {
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}
.form-section:first-child {
  padding-top: 0;
}
.form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0.25rem;
}
.form-section-title {
  margin: 0 0 0.95rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.form-section label:not(.consent-item):not(.patronymic-opt) {
  display: block;
}
.form-section .field-block {
  margin: 0;
}
.client-form > button[type="submit"] {
  margin-top: 1.25rem;
}
.client-footnote {
  margin: 1rem 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.consent-list {
  display: grid;
  gap: 0.55rem;
}
.consent-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: #fff;
  cursor: pointer;
}
.consent-item:hover {
  border-color: #dce7f8;
  background: #fbfdff;
}
.consent-item:has(input:checked) {
  border-color: #c5daf8;
  background: var(--blue-soft);
}
.consent-item input[type="checkbox"] {
  margin: 0.15rem 0 0;
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  accent-color: var(--blue);
}
.consent-text {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink);
}
.consent-text a {
  font-weight: 600;
  text-decoration: none;
}
.consent-text a:hover {
  text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0.85rem max(0.85rem, env(safe-area-inset-left)) calc(0.85rem + env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-right));
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cookie-banner-inner {
  pointer-events: auto;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 36px rgba(26, 26, 26, 0.12);
  backdrop-filter: blur(8px);
}
.cookie-banner-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
}
.cookie-banner-btn {
  flex-shrink: 0;
  min-width: 7.5rem;
  margin: 0;
}
.legal-doc h2 {
  font-size: 1.05rem;
  margin: 1.35rem 0 0.55rem;
}
.legal-doc p,
.legal-doc li {
  line-height: 1.55;
}
.legal-doc ul {
  padding-left: 1.2rem;
}
.legal-meta {
  margin-bottom: 1rem;
}
.site-footer {
  text-align: center;
  padding: 1rem 0.75rem calc(1rem + env(safe-area-inset-bottom));
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}
.site-footer a {
  color: var(--muted);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--accent);
}
.site-footer span {
  margin: 0 0.35rem;
}

.layout-two {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr);
  gap: 1.2rem;
  align-items: start;
  max-width: 100%;
  min-width: 0;
}
.catalog-tabs {
  display: flex;
  gap: 0;
  padding: 0.65rem 1rem 0;
  border-bottom: 1px solid var(--line);
}
.catalog-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.55rem 1rem 0.65rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  flex: 1 1 0;
  text-align: center;
}
.catalog-tab:hover {
  color: var(--text);
}
.catalog-tab.is-active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.check-complex {
  align-items: flex-start;
  gap: 0.7rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  overflow: hidden;
}
.check-complex input[type="checkbox"] {
  margin-top: 0.15rem;
}
.check-complex .check-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
}
.check-complex .check-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem 0.75rem;
  align-items: start;
}
.check-complex .check-name {
  min-width: 0;
}
.check-complex .check-price {
  margin: 0;
  padding: 0;
  font-size: 0.94rem;
  line-height: 1.2;
  text-align: right;
}
.complex-preview {
  list-style: none;
  margin: 0;
  padding: 0;
}
.complex-preview li {
  position: relative;
  padding-left: 0.75rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.complex-preview li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #c4c4c4;
}
.complex-preview-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.complex-more-toggle {
  appearance: none;
  border: 0;
  background: none;
  padding: 0.15rem 0 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.complex-more-toggle:active {
  opacity: 0.75;
}
.complex-details {
  margin-top: 0.35rem;
}
.complex-details > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
  touch-action: manipulation;
}
.complex-details > summary::-webkit-details-marker {
  display: none;
}
.complex-details > summary::after {
  content: "▾";
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}
.complex-details[open] > summary::after {
  transform: rotate(180deg);
}
.complex-compose-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.complex-compose {
  margin: 0.45rem 0 0;
  padding-left: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.complex-details .complex-compose {
  max-height: 12rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.badge-complex {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}
.lines .complex-compose {
  margin-top: 0.25rem;
}
.catalog-col,
.panel {
  min-width: 0;
}
.calc-col {
  min-width: 0;
}
.panel {
  background: #fff;
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--line);
}
.search-panel {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.9rem 1rem 0.4rem;
}
.filter-row { position: relative; flex: 0 0 auto; }
.filter-toggle {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 0.7rem;
  background: var(--panel);
  color: var(--blue);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.filter-toggle.is-on,
.filter-toggle[aria-expanded="true"] {
  background: var(--blue);
  color: #fff;
}
.filter-pop {
  position: absolute;
  left: 0;
  top: calc(100% + 0.4rem);
  z-index: 15;
  width: min(520px, 80vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}
.filter-title {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0 0 0.7rem;
  font-weight: 600;
}
.filter-title span { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.group-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  width: auto;
  border: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.chip.is-active {
  background: var(--blue);
  color: #fff;
}
.search { margin: 0; position: relative; flex: 1; min-width: 0; }
.search input,
.search input[type="search"] {
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.9rem 0.7rem 2.5rem;
  border: 0;
  border-radius: 0.8rem;
  font: inherit;
  background: var(--panel);
  outline: none;
}
.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  width: 0.85rem;
  height: 0.85rem;
  transform: translateY(-50%);
  border: 2px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}
.search-icon::after {
  content: "";
  position: absolute;
  width: 0.35rem;
  height: 2px;
  background: var(--muted);
  right: -0.32rem;
  bottom: -0.08rem;
  transform: rotate(45deg);
}
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  gap: 0.75rem;
  text-align: center;
}
.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(74, 143, 247, 0.2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.result-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0;
  padding: 0.2rem 1.1rem 0.5rem;
}
.catalog-scroll {
  height: calc(100vh - 300px);
  min-height: 360px;
  overflow: auto;
  overflow-x: hidden;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.catalog-virtual { position: relative; width: 100%; max-width: 100%; }
.catalog-slice {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
}
.group-title {
  margin: 0;
  height: 36px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 1.1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px solid var(--line);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.check {
  display: flex;
  width: 100%;
  height: auto;
  min-height: 72px;
  box-sizing: border-box;
  gap: 0.8rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.check:hover { background: #fafafa; }
.check.is-checked { background: var(--blue-soft); }
.check[hidden],
.group-block[hidden] { display: none !important; }
.check input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}
.check-name {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.check-name .name {
  font-size: 0.98rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.check-price {
  margin-left: auto;
  flex: 0 0 auto;
  font-weight: 600;
  white-space: nowrap;
  color: var(--green-text);
}
.check-name .code {
  color: var(--muted);
  font-size: 0.78rem;
}
.check-note {
  color: #b45309;
  font-size: 0.76rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.list-footer {
  margin: 0;
  padding: 0.85rem 1.1rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

body.sheet-open {
  overflow: hidden;
}
.complex-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
}
.complex-sheet[hidden] {
  display: none !important;
}
.complex-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(17, 24, 39, 0.42);
  cursor: pointer;
}
.complex-sheet-panel {
  position: relative;
  width: 100%;
  max-height: min(78dvh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1.1rem 1.1rem 0 0;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.16);
  padding: 0.35rem 1rem calc(1rem + env(safe-area-inset-bottom));
}
.complex-sheet-handle {
  width: 2.5rem;
  height: 0.28rem;
  margin: 0.35rem auto 0.75rem;
  border-radius: 999px;
  background: #d1d5db;
}
.complex-sheet-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.complex-sheet-titles {
  min-width: 0;
  flex: 1;
}
.complex-sheet-head h2 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.complex-sheet-code {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.complex-sheet-close {
  appearance: none;
  border: 0;
  background: var(--panel);
  color: var(--muted);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.complex-sheet-meta {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.complex-sheet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}
.complex-sheet-list li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.35;
}
.complex-sheet-list li:last-child {
  border-bottom: 0;
}
.complex-sheet-index {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
}
.complex-sheet-text {
  min-width: 0;
  overflow-wrap: anywhere;
}
.complex-sheet-empty {
  color: var(--muted);
}

.calc-panel {
  position: sticky;
  top: 1rem;
  background: var(--panel);
  border-radius: 1.1rem;
  padding: 1.15rem 1.2rem 1.2rem;
}
.calc-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}
.stat {
  display: block;
  width: 100%;
  margin-bottom: 0.7rem;
  color: var(--muted);
}
.stat-value,
.stat strong {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.stat.accent-green .stat-value,
.stat.accent-green strong,
.stat.discount .stat-value,
.stat.discount strong,
.stat.total .stat-value,
.stat.total strong { color: var(--green-text); }
.stat.total {
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}
.reward {
  margin: 1rem 0 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.7rem;
  background: var(--blue-soft);
  color: #2b6cb0;
  font-weight: 600;
}
.reward-pct {
  display: inline;
  font-weight: 600;
}
.services-block {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--line);
}
.services-list {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}
.services-list li {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  padding: 0.15rem 0;
  overflow-wrap: anywhere;
}
.services-code {
  color: var(--ink);
  font-weight: 600;
}
.services-note {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  line-height: 1.35;
}
.promo-field {
  display: block;
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.promo-field input {
  background: #fff;
}
.optional {
  font-weight: 400;
  font-size: 0.82em;
}
.share-link input { font-size: 0.95rem; }
button, .button {
  display: inline-block;
  width: 100%;
  border: 0;
  background: var(--blue);
  color: white;
  text-decoration: none;
  padding: 0.95rem 1.1rem;
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.button-lite {
  background: var(--blue-soft);
  color: var(--blue);
  margin-bottom: 0.9rem;
}
button:disabled,
.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.payment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}
.payment-form .button-lite {
  margin-bottom: 0;
  text-decoration: none;
}

@media (min-width: 640px) {
  .fio-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .fio-extra {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 639px) {
  .fio-extra {
    grid-template-columns: 1fr;
    margin-top: 0;
  }
  .patronymic-opt {
    grid-column: 1;
  }
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-banner-btn {
    width: 100%;
  }
}
.field-label {
  display: block;
  font-size: 0.95rem;
}
.date-picker {
  display: grid;
  grid-template-columns: 0.9fr 1.3fr 1fr;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.date-picker select {
  margin-top: 0;
}
.office-row.selected {
  background: var(--blue-soft);
}

label:not(.check):not(.search):not(.office-row):not(.consent-item):not(.patronymic-opt) {
  display: block;
  margin: 0 0 1rem;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="search"],
select {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.8rem 0.9rem;
  border: 0;
  border-radius: 0.7rem;
  font: inherit;
  font-size: 1rem;
  background: var(--panel);
  outline: none;
}
.inline-summary { margin-bottom: 1rem; }
.inline-summary .stat { margin-bottom: 0.35rem; }
.lines { padding: 0; list-style: none; }
.lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.lines li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.lines li > span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
}
.pill.paid { background: #e8f6ea; color: var(--ok); }
.pill.wait { background: var(--blue-soft); color: var(--blue); }
.copy { word-break: break-all; color: var(--muted); }
.actions {
  display: flex;
  gap: 0.7rem;
}
.actions .button { width: auto; flex: 1; }

.suggest { position: relative; }
.suggest-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.15rem);
  z-index: 20;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  max-height: 240px;
  overflow: auto;
}
.suggest-list button {
  width: 100%;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  font-weight: 500;
}
.suggest-list button:hover { background: var(--blue-soft); color: var(--blue); }
.suggest-city {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}
.office-tools .suggest { flex: 1; min-width: 0; }
.office-picker { margin: 0; }
.office-title {
  margin: 0 0 0.55rem;
  font-weight: 600;
}
.office-tools {
  padding: 0;
  margin-bottom: 0.4rem;
  align-items: stretch;
}
.office-near {
  width: auto;
  margin: 0;
  padding: 0.7rem 0.95rem;
  flex: 0 0 auto;
  white-space: nowrap;
}
.office-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
  gap: 0.8rem;
  align-items: stretch;
}
.office-map {
  height: min(42vh, 380px);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  overflow: hidden;
  background: var(--panel);
}
.office-scroll {
  height: min(42vh, 380px);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: #fff;
}
.office-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.office-row:last-child { border-bottom: 0; }
.office-row:has(input:checked) { background: var(--blue-soft); }
.office-text { min-width: 0; }
.office-text .name { display: block; font-weight: 500; }
.office-text .code {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.office-text .dist {
  display: block;
  margin-top: 0.15rem;
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 860px) {
  .wrap {
    width: 100%;
    max-width: 100%;
    margin: 0.75rem auto 2rem;
    padding-left: max(0.55rem, env(safe-area-inset-left));
    padding-right: max(0.55rem, env(safe-area-inset-right));
    box-sizing: border-box;
  }
  .top {
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .brand > span:last-child {
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .hero { margin-bottom: 0.75rem; }
  .hero h1 { font-size: 1.28rem; }
  .hero .muted { font-size: 0.9rem; line-height: 1.45; }
  .card {
    padding: 1rem 0.9rem calc(5.5rem + env(safe-area-inset-bottom));
    border-radius: 0.9rem;
  }
  .card h1 { font-size: 1.28rem; overflow-wrap: anywhere; }

  .layout-two {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(100dvh - 7.5rem);
    padding-bottom: 0;
  }
  .catalog-col {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding-bottom: 0;
  }
  .catalog-col .panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
  }
  .catalog-tabs {
    padding: 0.45rem 0.65rem 0;
  }
  .catalog-tab {
    padding: 0.7rem 0.35rem 0.75rem;
    font-size: 0.92rem;
  }
  .list-footer {
    margin-bottom: calc(10.5rem + env(safe-area-inset-bottom));
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    border-radius: 0 0 1.1rem 1.1rem;
  }
  .check-complex {
    padding: 0.85rem 1rem;
    gap: 0.65rem;
  }
  .check-complex .check-top {
    gap: 0.45rem 0.6rem;
  }
  .check-complex .check-name .name {
    -webkit-line-clamp: 2;
    font-size: 0.93rem;
  }
  .check-complex .check-price {
    font-size: 0.88rem;
    max-width: 34%;
  }
  .complex-preview li {
    font-size: 0.76rem;
  }
  .complex-more-toggle {
    font-size: 0.78rem;
    min-height: 1.75rem;
    padding-top: 0.25rem;
  }
  .complex-sheet-panel {
    max-height: min(82dvh, 680px);
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  .complex-sheet-list li {
    font-size: 0.9rem;
    padding: 0.75rem 0;
  }
  .check-price {
    font-size: 0.92rem;
    padding-top: 0.1rem;
  }
  .calc-col {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: auto;
    max-width: none;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    box-sizing: border-box;
  }
  .calc-panel {
    position: static;
    margin: 0;
    border-radius: 1.15rem 1.15rem 0 0;
    padding: 0.75rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.1);
    max-width: 100%;
  }
  .calc-panel h2 { margin-bottom: 0.5rem; font-size: 0.95rem; }
  .promo-field { margin-bottom: 0.45rem; font-size: 0.82rem; }
  .promo-field input { padding: 0.5rem 0.75rem; font-size: 0.88rem; }
  .stat { margin-bottom: 0.3rem; font-size: 0.88rem; }
  .stat.total { margin-top: 0.4rem; padding-top: 0.4rem; }
  .reward { margin: 0.45rem 0; padding: 0.5rem 0.7rem; font-size: 0.85rem; }
  .catalog-scroll {
    flex: 1 1 auto;
    min-height: 180px;
    height: auto;
    max-height: none;
  }
  .check {
    align-items: flex-start;
    padding: 0.9rem 1rem;
    gap: 0.7rem;
    max-width: 100%;
  }
  .check-name .name { font-size: 0.95rem; }
  .search-panel {
    position: relative;
    flex-wrap: wrap;
  }
  .filter-row {
    position: static;
  }
  .filter-pop {
    left: 0;
    right: 0;
    width: auto;
    max-height: min(70dvh, 420px);
    overflow: auto;
  }

  .office-layout {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-bottom: 0.5rem;
  }
  .office-map {
    order: -1;
    height: min(30dvh, 220px);
    min-height: 160px;
    border-radius: 0.8rem;
  }
  .office-scroll {
    height: min(26dvh, 200px);
    min-height: 130px;
    border-radius: 0.8rem;
  }
  .office-tools {
    flex-wrap: wrap;
    padding: 0;
  }
  .office-near {
    flex: 1 1 100%;
    width: 100%;
    min-height: 2.7rem;
  }
  .office-row {
    padding: 0.85rem 0.8rem;
    min-height: 3.1rem;
  }
  .search input {
    font-size: 1rem;
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }
  .client-form {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }
  .client-form > button[type="submit"] {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: calc(0.7rem + env(safe-area-inset-bottom));
    width: auto;
    z-index: 36;
    box-shadow: 0 10px 28px rgba(74, 143, 247, 0.35);
  }
  .inline-summary .stat { font-size: 0.9rem; }
  button, .button { min-height: 2.85rem; }
}

@media (min-width: 861px) {
  .office-map,
  .office-scroll {
    height: min(48vh, 420px);
  }
}
