/* ==========================================================================
   Перезагрузка — общий стиль сайта
   Цвета (по макету заказчика): фон — розовый #FBC0D4; название и текст — бордовый #3D1E28;
   кнопки, сертификат, выбранные элементы, значки — тиффани #90CFC6
   ========================================================================== */

:root {
  --bg: #fbc0d4;
  --bg-deep: #f5a9c3;
  --surface: #ffffff;
  --surface-soft: #fff6f9;
  --wine: #3d1e28;
  --wine-strong: #5a2d3c;
  --wine-deep: #2a1219;
  /* Тиффани: заливки и значки. Для мелкого текста на светлом фоне не подходит (мало контраста),
     для значков на светлом фоне — --tiffany-ink */
  --tiffany: #8cc8c0;
  --tiffany-soft: #d6eeea; /* непрозрачный: полупрозрачный тиффани на розовом сереет */
  --tiffany-ink: #34796f;
  /* Заливки: кнопки, выбранные чипы и галочки. Надпись на кнопках белая, как в макете,
     на мелких выбранных элементах — бордовая (белый на тиффани мелким шрифтом не читается) */
  --fill: #90cfc6;
  --fill-strong: #7fc4ba;
  --fill-ink: var(--wine);
  --fill-shadow: rgba(47, 127, 118, 0.42);
  --line: rgba(61, 30, 40, 0.13);
  --line-strong: rgba(61, 30, 40, 0.24);
  --glass: rgba(255, 255, 255, 0.62);

  --accent: var(--wine);
  --accent-strong: var(--wine-strong);
  --accent-ink: #ffffff;

  /* Контраст текста на розовом фоне — не ниже 4.5:1 */
  --text: #3d1e28;
  --muted: #6b4452;
  --faint: #744d5b;

  --danger: #b3261e;
  --success: #1f7a4a;

  --radius: 20px;
  --radius-lg: 26px;
  --shadow: 0 30px 80px -30px rgba(61, 30, 40, 0.32);

  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", "Georgia", serif;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html:has(dialog[open]),
html.no-scroll {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(55vw 45vw at 88% -8%, rgba(255, 255, 255, 0.26), transparent 62%),
    radial-gradient(60vw 40vw at 50% 115%, rgba(255, 255, 255, 0.14), transparent 70%);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

::selection {
  background: rgba(140, 200, 192, 0.55);
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.muted {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: 96px;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.8em 1.5em;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.btn-primary {
  background: var(--fill);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(31, 95, 88, 0.45);
  box-shadow: 0 12px 30px -12px var(--fill-shadow);
}

.btn-primary:hover {
  background: var(--fill-strong);
  transform: translateY(-1px);
  box-shadow: 0 16px 38px -12px var(--fill-shadow);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  border-color: var(--line-strong);
  color: var(--accent);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--accent);
}

.btn-quiet {
  background: transparent;
  color: var(--muted);
  padding-left: 0.6em;
  padding-right: 0.6em;
}

.btn-quiet:hover {
  color: var(--accent);
}

.btn-lg {
  font-size: 1.08rem;
  padding: 1.05em 2.3em;
}

.btn-sm {
  font-size: 0.86rem;
  padding: 0.6em 1.1em;
}

.btn-block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

.icon-btn {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.8);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Верхняя панель ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.topbar.is-solid {
  background: rgba(251, 192, 212, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.topbar-brand .icon {
  height: 40px;
  filter: drop-shadow(0 1px 1.5px rgba(61, 30, 40, 0.3));
  width: auto;
}

.topbar-brand .word {
  height: 21px;
  width: auto;
}

.topbar[data-hide-brand]:not(.is-solid) .topbar-brand {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.code-chip {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  font-variant-numeric: tabular-nums;
}

/* ---------- Главная: первый экран ---------- */

.hero {
  position: relative;
  padding: 108px 0 76px;
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-lockup {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.4vw, 16px);
}

.brand-icon {
  width: clamp(220px, 30vw, 360px);
  height: auto;
  /* Серебряная коробка на розовом бледная: тонкая тень проявляет её контур */
  filter: drop-shadow(0 1px 2px rgba(61, 30, 40, 0.28)) drop-shadow(0 18px 30px rgba(61, 30, 40, 0.2));
  animation: float 7s ease-in-out infinite;
}

.brand-word {
  width: clamp(280px, 50vw, 600px);
  height: auto;
}

.brand-tagline {
  width: clamp(280px, 38vw, 460px);
  height: auto;
  margin-top: clamp(2px, 0.6vw, 6px);
}

.hero-lead {
  max-width: 650px;
  margin: 30px auto 0;
  font-size: clamp(1.05rem, 1.55vw, 1.22rem);
  color: var(--muted);
}

.hero-lead strong {
  color: var(--text);
  font-weight: 600;
}

.hero-actions {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-note {
  margin: 16px 0 0;
  font-size: 0.88rem;
  color: var(--faint);
}

.reveal {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--d, 0s);
}

.brand-icon.reveal {
  animation:
    rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) var(--d, 0s) both,
    float 7s ease-in-out 1.2s infinite;
}

/* ---------- Секции главной ---------- */

.section {
  padding: 76px 0;
}

.section-head {
  max-width: 660px;
  margin: 0 auto 42px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.08;
}

.section-head p:not(.eyebrow) {
  margin: 14px 0 0;
  color: var(--muted);
}

.divider {
  width: min(1100px, calc(100% - 48px));
  height: 1px;
  margin: 0 auto;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 30px 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5));
}

.step-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.step h3 {
  margin: 16px 0 8px;
  font-size: 1.12rem;
  font-weight: 700;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.cat-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 880px;
  margin: 0 auto;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  font-size: 0.97rem;
}

.cat-pill svg {
  width: 19px;
  height: 19px;
  color: var(--tiffany-ink);
}

.cta-band {
  position: relative;
  overflow: hidden;
  padding: 56px 32px;
  border-radius: 30px;
  --text: var(--wine);
  --muted: rgba(61, 30, 40, 0.86);
  --accent: var(--wine);
  --fill: #ffffff;
  --fill-strong: #fff4f8;
  --fill-shadow: rgba(47, 127, 118, 0.5);
  --line-strong: rgba(61, 30, 40, 0.16);
  border: 1px solid var(--line-strong);
  text-align: center;
  color: var(--text);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 255, 255, 0.4), transparent 55%),
    linear-gradient(135deg, #a8d9d2 0%, var(--tiffany) 55%, #7dbdb4 100%);
  box-shadow: var(--shadow);
}

.cta-band::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 260px;
  height: 205px;
  background: url("/img/logo-mark.png") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.cta-band .btn-primary {
  color: var(--wine);
  text-shadow: none;
}

.cta-band p {
  max-width: 520px;
  margin: 14px auto 28px;
  color: var(--muted);
}

.footer {
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand img {
  height: 30px;
  width: auto;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--accent);
}

/* ---------- Модальное окно и формы ---------- */

.modal {
  width: min(660px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: linear-gradient(180deg, #fff1f6, #ffffff 34%);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal::backdrop {
  background: rgba(42, 18, 25, 0.45);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px 0;
}

.modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.95rem;
  font-weight: 600;
  line-height: 1.1;
}

.modal-body {
  padding: 18px 26px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cert {
  position: relative;
  overflow: hidden;
  margin-bottom: 26px;
  padding: 22px 24px;
  border-radius: 20px;
  --text: var(--wine);
  --muted: rgba(61, 30, 40, 0.86);
  --faint: rgba(61, 30, 40, 0.84);
  --accent: var(--wine);
  --line-strong: rgba(61, 30, 40, 0.16);
  border: 1px solid var(--line-strong);
  color: var(--text);
  background:
    radial-gradient(90% 130% at 100% 0%, rgba(255, 255, 255, 0.4), transparent 55%),
    linear-gradient(135deg, #a8d9d2 0%, var(--tiffany) 55%, #7dbdb4 100%);
}

.cert::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 190px;
  height: 150px;
  background: url("/img/logo-mark.png") center / contain no-repeat;
  opacity: 0.14;
  pointer-events: none;
}

.cert-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.cert-to {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.65rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cert-amount {
  margin-top: 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--accent);
}

.cert-from {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

fieldset {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  min-width: 0;
}

legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
}

legend .legend-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tiffany);
  color: var(--wine);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.input::placeholder {
  color: var(--faint);
  opacity: 0.85;
}

.input:hover {
  border-color: var(--line-strong);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(140, 200, 192, 0.6);
  background: var(--surface);
}

.input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14);
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 48px;
}

.input-wrap .icon-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
}

.input-amount {
  font-weight: 700;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.field-error {
  font-size: 0.82rem;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--faint);
}

.amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.chip-toggle {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chip-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.chip-toggle[aria-pressed="true"] {
  background: var(--fill);
  border-color: var(--fill);
  color: var(--fill-ink);
}

.form-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid rgba(179, 38, 30, 0.32);
  background: rgba(179, 38, 30, 0.06);
  color: var(--danger);
  font-size: 0.92rem;
}

.form-note {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--faint);
  text-align: center;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.success {
  padding: 18px 4px 6px;
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--tiffany-soft);
  color: var(--accent);
}

.success-icon svg {
  width: 34px;
  height: 34px;
}

.success h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
}

.success p {
  max-width: 440px;
  margin: 12px auto 0;
  color: var(--muted);
}

.success-code {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px dashed var(--line-strong);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

/* ---------- Страница входа (обналичить) ---------- */

.topbar-centered {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
}

.topbar-centered > :first-child {
  justify-self: start;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 84px 16px 32px;
}

.auth-card {
  width: min(450px, 100%);
  padding: 28px 32px 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.78));
  box-shadow: var(--shadow);
}

/* Значок над заголовком — только на высоких экранах, чтобы карточка помещалась целиком */
.auth-emblem {
  display: none;
  place-items: center;
  width: 132px;
  height: 84px;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 20%, #c6e7e2, var(--tiffany));
  border: 1px solid var(--line);
}

.auth-emblem img {
  width: 108px;
  height: auto;
}

@media (min-height: 860px) {
  .auth-emblem {
    display: grid;
  }
}

.auth-card h1 {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
}

.auth-card .form-stack {
  gap: 14px;
}

.auth-card .lead {
  margin: 8px 0 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.96rem;
}

.auth-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 0.86rem;
  color: var(--faint);
}

.auth-foot a {
  color: var(--accent);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.back-link:hover {
  color: var(--accent);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* ---------- Личный кабинет ---------- */

.cabinet {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  padding-top: 100px;
  padding-bottom: 80px;
}

.filters {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.filters-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
}

.filter-group {
  margin-top: 22px;
}

.filter-title {
  margin: 0 0 10px;
  padding: 0 4px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--faint);
}

.search {
  position: relative;
  margin-top: 16px;
}

.search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.search .input {
  padding-left: 40px;
}

.check-list {
  display: grid;
  gap: 2px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 600;
  transition: background-color 0.15s, opacity 0.2s;
}

.check-row:hover {
  background: rgba(61, 30, 40, 0.05);
}

.check-row .cat-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--tiffany-ink);
}

.check-row .count {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.check-row.is-empty {
  opacity: 0.45;
}

.check {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: none;
  width: 19px;
  height: 19px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.check:checked {
  background: var(--fill);
  border-color: var(--fill);
}

.check:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid var(--fill-ink);
  border-top: 0;
  border-right: 0;
  transform: translate(0, -1px) rotate(-45deg);
}

.pill-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.pill-toggle:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.pill-toggle[aria-pressed="true"] {
  background: var(--fill);
  border-color: var(--fill);
  color: var(--fill-ink);
}

.pill-toggle .count {
  font-size: 0.76rem;
  opacity: 0.75;
}

.filters-foot {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.cabinet-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  min-width: 0;
  container-type: inline-size;
}

@container (max-width: 760px) {
  .cabinet-main .balance {
    flex-direction: column;
    align-items: flex-start;
  }

  .cabinet-main .balance-amount {
    text-align: left;
  }
}

.balance {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 34px 32px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  --text: var(--wine);
  --muted: rgba(61, 30, 40, 0.86);
  --faint: rgba(61, 30, 40, 0.84);
  --accent: var(--wine);
  --line-strong: rgba(61, 30, 40, 0.16);
  color: var(--text);
  background:
    radial-gradient(70% 140% at 100% 0%, rgba(255, 255, 255, 0.4), transparent 55%),
    linear-gradient(135deg, #a8d9d2 0%, var(--tiffany) 55%, #7dbdb4 100%);
  box-shadow: var(--shadow);
}

.balance::after {
  content: "";
  position: absolute;
  left: 46%;
  top: -40px;
  width: 260px;
  height: 205px;
  background: url("/img/logo-mark.png") center / contain no-repeat;
  opacity: 0.07;
  pointer-events: none;
}

.balance > * {
  position: relative;
  z-index: 1;
}

.balance-hello {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.7rem);
  font-weight: 600;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.balance-amount {
  text-align: right;
}

.balance-amount .label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance-amount strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}

.balance-amount .sub {
  display: block;
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--faint);
}

.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.block-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 600;
  line-height: 1.1;
}

.block-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.block-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--tiffany-soft);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.active-chip svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.active-chip:hover svg {
  color: var(--accent);
}

/* Боксы компании */

.boxes-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(236px, 1fr);
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.boxes-grid > .box {
  scroll-snap-align: start;
}

.box {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  transition: border-color 0.2s, transform 0.2s;
}

.box:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.box-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 112px;
  background: var(--art, radial-gradient(120% 100% at 50% 0%, #fde0ea 0%, #fbc0d4 58%, #f6adc6 100%));
}

.box-art img {
  height: 64px;
  width: auto;
  filter: drop-shadow(0 10px 18px rgba(61, 30, 40, 0.22));
}

.box-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--fill-ink);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.box-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 18px;
}

.box h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.15;
}

.box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.box-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.box-items li {
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(61, 30, 40, 0.07);
  color: var(--muted);
  font-size: 0.78rem;
}

.box-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.box-price {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

.box-fits {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
}

.box-fits svg {
  width: 14px;
  height: 14px;
}

/* Места */

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

.place {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.64));
  transition: border-color 0.2s, transform 0.2s;
  animation: fade-in 0.35s ease both;
}

.place:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.place-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  background: var(--tiffany-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.cat-badge svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.price-level {
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: rgba(61, 30, 40, 0.28);
}

.price-level b {
  color: var(--accent);
  font-weight: 800;
}

.place h3 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.12;
}

.place-loc {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.place-loc svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 3px;
  color: var(--faint);
}

.place-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.tag {
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.place-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.place-link:hover {
  text-decoration: underline;
}

.place-link svg {
  width: 15px;
  height: 15px;
}

.empty {
  padding: 48px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
  text-align: center;
  color: var(--muted);
}

.empty h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
}

.empty p {
  margin: 0 0 18px;
}

.skeleton {
  height: 220px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.3) 30%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.3) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.only-mobile {
  display: none;
}

.filters-backdrop {
  display: none;
}

/* ---------- Уведомления ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border-radius: 16px;
  --accent: var(--tiffany);
  --danger: #ffb4ab;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(61, 30, 40, 0.96);
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--accent);
}

.toast.is-error svg {
  color: var(--danger);
}

/* ---------- Анимации ---------- */

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

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

/* ---------- Адаптив ---------- */

@media (max-width: 960px) {
  .cabinet {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 92px;
  }

  .filters {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(340px, 88vw);
    max-height: none;
    border-radius: 0 24px 24px 0;
    background: var(--surface-soft);
    transform: translateX(-105%);
    transition: transform 0.3s ease;
  }

  .filters.is-open {
    transform: none;
    box-shadow: var(--shadow);
  }

  .filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 89;
    background: rgba(42, 18, 25, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .filters-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .only-mobile {
    display: inline-flex;
  }

  .balance-amount {
    text-align: left;
  }
}

@media (max-width: 820px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar-inner {
    height: 64px;
  }

  .topbar-brand .icon {
    height: 30px;
  }

  .topbar-brand .word {
    height: 15px;
  }

  .hide-sm {
    display: none;
  }

  .hero {
    padding: 92px 0 56px;
  }

  .section {
    padding: 56px 0;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .modal-head {
    padding: 18px 18px 0;
  }

  .modal-body {
    padding: 16px 18px 22px;
  }

  .modal-title {
    font-size: 1.65rem;
  }

  .auth-card {
    padding: 28px 20px 22px;
  }

  .back-btn {
    width: 44px;
    height: 44px;
    padding: 0;
  }

  .balance {
    padding: 26px 22px;
  }

  .cta-band {
    padding: 42px 20px;
  }

  .btn-lg {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .topbar-brand .word {
    display: none;
  }

  .topbar-centered .topbar-brand .word {
    display: block;
  }
}

/* ==========================================================================
   Телефоны: удобные касания, читаемый текст, нижние панели
   ========================================================================== */

a,
button,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

/* На сенсорных экранах «наведение» залипает после касания — убираем сдвиги */
@media (hover: none) {
  .btn-primary:hover,
  .place:hover,
  .box:hover {
    transform: none;
  }
}

/* Цели для пальца — не меньше 44px */
@media (pointer: coarse) {
  .btn-sm {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
    height: 44px;
  }

  .input-wrap .icon-btn {
    width: 40px;
    height: 40px;
  }

  .pill-toggle,
  .chip-toggle,
  .active-chip {
    min-height: 44px;
  }

  .pill-toggle {
    padding: 10px 15px;
  }

  .check-row {
    min-height: 46px;
  }

  .check {
    width: 22px;
    height: 22px;
  }

  .footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .topbar-brand {
    min-height: 44px;
  }

  /* Ссылка в тексте: увеличиваем область нажатия, не сдвигая строку */
  .auth-foot a {
    display: inline-block;
    padding: 12px 4px;
    margin: -12px -4px;
  }
}

/* Кнопка «Фильтры», которая всегда под рукой при просмотре мест (только телефоны и планшеты) */
.filters-fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 86;
  min-height: 48px;
  box-shadow:
    0 16px 34px -10px rgba(42, 18, 25, 0.35),
    0 10px 30px -12px var(--fill-shadow);
  animation: fade-in 0.25s ease both;
}

@media (min-width: 961px) {
  .filters-fab {
    display: none !important;
  }
}

@media (max-width: 960px) {
  /* Панель фильтров: кнопки «Показать» и «Сбросить» прилипают к низу */
  .filters {
    padding-bottom: 0;
  }

  .filters-foot {
    position: sticky;
    bottom: 0;
    margin: 24px -18px 0;
    padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255, 246, 249, 0), var(--surface-soft) 26%);
  }

  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  /* Мелкие подписи — не меньше 13px */
  .eyebrow,
  .filter-title,
  .balance-amount .label,
  .cert-label {
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
  }

  .check-row .count,
  .pill-toggle .count,
  .tag,
  .box-items li,
  .box-badge,
  .cat-badge,
  .field-hint,
  .form-note,
  .box-fits,
  .code-chip,
  legend .legend-num {
    font-size: 0.8125rem;
  }

  /* Окно покупки — выезжающая снизу панель на всю ширину */
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 12px);
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
    border-bottom: 0;
  }

  .modal[open] {
    animation: sheet-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .modal-head {
    position: relative;
    padding-top: 26px;
  }

  .modal-head::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    width: 40px;
    height: 4px;
    margin-left: -20px;
    border-radius: 4px;
    background: var(--line-strong);
  }

  .modal-body {
    padding-bottom: 0;
  }

  /* Кнопка «Отправить заявку» всегда видна внизу окна */
  .form-submit {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -18px;
    padding: 16px 18px calc(14px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--surface) 24%);
  }

  .form-submit .form-note {
    margin-top: 10px;
  }

  .success {
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  }

  .cert {
    margin-bottom: 20px;
    padding: 18px 20px;
  }

  .cert-amount {
    font-size: 2.1rem;
  }

  /* Боксы: карточка почти на всю ширину, следующая выглядывает сбоку */
  .boxes-grid {
    grid-auto-columns: 84%;
    margin: 0 -16px;
    padding: 0 16px 6px;
    scroll-padding-left: 16px;
  }

  .box-art {
    height: 96px;
  }

  .box-art img {
    height: 56px;
  }

  .balance-hello {
    font-size: 1.9rem;
  }

  .cabinet-main {
    gap: 32px;
  }

  .place {
    padding: 18px;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0.4;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Замена окна <dialog> для старых браузеров (см. ensureDialog в common.js) ---------- */
.modal.dialog-fallback {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  margin: 0;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax rgba(42, 18, 25, 0.5), var(--shadow);
}

.modal.dialog-fallback:not([open]) {
  display: none;
}

.modal.dialog-fallback[open] {
  -webkit-animation: none;
  animation: none;
}

@media (max-width: 600px) {
  .modal.dialog-fallback {
    top: auto;
    bottom: 0;
    left: 0;
    -webkit-transform: none;
    transform: none;
  }
}

/* ---------- Окно оплаты ----------
 * Тестовый режим: платёжный сервис пока не подключён, деньги не списываются,
 * поля карты не настоящие (в них нельзя ничего ввести). Выбор «Картой / СБП» работает на CSS.
 */
.pay-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.pay-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 4px 0 18px;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(135deg, #d6eeea, #f2faf8);
}
.pay-summary .eyebrow {
  margin: 0 0 6px;
}
.pay-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}
.pay-total {
  text-align: right;
}
.pay-total > span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}
.pay-total strong {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
  white-space: nowrap;
}
.pay-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.pay-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: background-color 0.15s, color 0.15s;
}
.pay-method svg {
  width: 20px;
  height: 20px;
}
#pay-card:checked ~ .pay-methods label[for="pay-card"],
#pay-sbp:checked ~ .pay-methods label[for="pay-sbp"] {
  background: var(--fill);
  color: var(--fill-ink);
}
.pay-panel-sbp,
#pay-sbp:checked ~ .pay-panel-card {
  display: none;
}
#pay-sbp:checked ~ .pay-panel-sbp {
  display: block;
}
.pay-cardface {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  max-width: 340px;
  min-height: 190px;
  margin: 0 auto 18px;
  padding: 20px 22px;
  --muted: rgba(61, 30, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  color: var(--wine);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 255, 255, 0.4), transparent 60%),
    linear-gradient(135deg, #a8d9d2 0%, var(--tiffany) 55%, #7dbdb4 100%);
  box-shadow: var(--shadow);
}
.pay-chip {
  position: absolute;
  top: 22px;
  left: 22px;
  width: 42px;
  height: 31px;
  border-radius: 7px;
  background: linear-gradient(135deg, #f0dfb4, #b8995a);
}
.pay-number {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pay-cardrow {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.pay-fields {
  display: grid;
  gap: 12px;
}
.pay-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pay-label {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}
.pay-fake {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--faint);
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
.pay-qr {
  width: 210px;
  max-width: 72%;
  margin: 2px auto 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}
.pay-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.pay-panel-sbp p {
  max-width: 300px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
}
.pay-demo {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 0.8125rem;
  color: var(--faint);
}
.pay-demo svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
.pay-actions {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.pay-step-done .success {
  padding-top: 26px;
}
@media (max-width: 600px) {
  .pay-summary {
    display: block;
  }
  .pay-total {
    margin-top: 12px;
    text-align: left;
  }
  .pay-total strong {
    font-size: 1.8rem;
  }
  .pay-cardface {
    min-height: 172px;
  }
}

/* ---------- Админка ---------- */

.admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding-top: 100px;
  padding-bottom: 80px;
}

.admin-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.admin-lead {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.admin-retry {
  margin-top: 16px;
}

/* Вкладки «Места» / «Боксы» — переключатель в стиле выбора способа оплаты */
.admin-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 1fr);
  gap: 6px;
  justify-self: start;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
}

.admin-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.admin-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.admin-tab[aria-selected="true"] {
  background: var(--fill);
  color: var(--fill-ink);
}

.admin-tab svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.admin-tab-count {
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(61, 30, 40, 0.08);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.admin-tab-count:empty {
  display: none;
}

.admin-panel-head {
  margin-bottom: 22px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
}

/* Группы мест по направлениям */
.admin-group + .admin-group {
  margin-top: 32px;
}

.admin-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
}

.admin-group-title .cat-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tiffany-soft);
  color: var(--tiffany-ink);
}

.admin-group-title .cat-icon svg {
  width: 18px;
  height: 18px;
}

.admin-group-count {
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* Карточки мест и боксов */
.admin-card h4 {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.admin-card h3 {
  overflow-wrap: anywhere;
}

.admin-card .tags {
  margin-top: 0;
}

.admin-card .place-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.admin-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
  margin-left: auto;
}

.admin-card .admin-meta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-hidden-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--wine);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.admin-hidden-badge svg {
  width: 14px;
  height: 14px;
  flex: none;
}

.box-art .admin-hidden-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.admin-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-card-actions .btn {
  padding-left: 0.95em;
  padding-right: 0.95em;
}

.place.admin-card .admin-card-actions .btn {
  flex: 1 1 auto;
}

.place.admin-card .admin-card-actions {
  margin-top: auto;
  padding-top: 6px;
}

.admin-btn-delete {
  color: var(--danger);
}

.admin-btn-delete:hover {
  border-color: var(--danger);
  background: rgba(179, 38, 30, 0.06);
}

/* Скрытые: пунктирная рамка и приглушённое содержимое */
.admin-card.is-inactive {
  border-style: dashed;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.42);
}

.admin-card.is-inactive :is(h3, h4, .price-level, .place-loc, .place-desc, .tags, .place-link, .box-body > p, .box-items, .box-price, .box-art img, .box-badge) {
  opacity: 0.7;
}

/* Формы в окнах */
.field .req {
  color: var(--danger);
}

textarea.input {
  min-height: 92px;
  line-height: 1.5;
  resize: vertical;
}

select.input {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  cursor: pointer;
}

select.input,
select.input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b4452' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

.admin-toggle {
  display: grid;
  gap: 2px;
  padding: 10px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.admin-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  font-weight: 700;
  cursor: pointer;
}

.admin-toggle .field-hint {
  padding-left: 29px;
}

.admin-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Подтверждение удаления */
.btn-danger {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 12px 30px -12px rgba(179, 38, 30, 0.5);
}

.btn-danger:hover {
  background: #96201a;
  transform: translateY(-1px);
}

.admin-confirm-text {
  margin: 0 0 14px;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.admin-confirm-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--tiffany-soft);
  font-size: 0.9rem;
}

.admin-confirm-hint svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--tiffany-ink);
}

@media (min-width: 601px) {
  .modal.admin-confirm {
    width: min(480px, calc(100% - 24px));
  }
}

@media (hover: none) {
  .btn-danger:hover {
    transform: none;
  }
}

@media (pointer: coarse) {
  .admin-toggle-row {
    min-height: 44px;
  }

  .admin-toggle .field-hint {
    padding-left: 32px;
  }
}

@media (max-width: 600px) {
  .admin {
    gap: 22px;
    padding-top: 84px;
    padding-bottom: 56px;
  }

  .admin-tabs {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    justify-self: stretch;
  }

  .admin-tab {
    padding: 8px 12px;
  }

  .admin-panel-head > .btn {
    width: 100%;
  }

  .admin-group-title {
    font-size: 1.35rem;
  }

  .admin-card .admin-meta,
  .admin-hidden-badge,
  .admin-tab-count,
  .admin-group-count {
    font-size: 0.8125rem;
  }

  /* Кнопки в окне — поровну на всю ширину */
  .admin-dialog-actions .btn {
    flex: 1 1 0;
  }
}
