:root {
  --bg: #fff8ef;
  --bg-soft: #fffdf8;
  --milk: #fffaf2;
  --cream: #f7e7d0;
  --caramel: #c58b5c;
  --caramel-soft: #e8c6a6;
  --choco: #3a2418;
  --muted: #8e6d58;
  --pink: #ffd6df;
  --accent: #ff9f68;
  --accent-dark: #e9783f;
  --line: rgba(58, 36, 24, 0.11);
  --shadow: 0 28px 80px rgba(107, 65, 35, 0.15);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --max: 1180px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overflow-x: hidden;
  max-width: 100vw;
  overflow-wrap: break-word;
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--choco);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 214, 223, 0.65), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(255, 159, 104, 0.28), transparent 26%),
    linear-gradient(180deg, #fff8ef 0%, #fffdf8 42%, #fff8ef 100%);
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

a, button, .btn, .cabinet-nav a, .cabinet-nav button {
  -webkit-tap-highlight-color: transparent;
}
button, .btn, .cabinet-nav a, .cabinet-nav button {
  touch-action: manipulation;
}

a { color: var(--caramel); text-decoration: none; font-weight: 700; }
a:hover { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }

.page-shell { position: relative; overflow-x: hidden; min-width: 0; }
.panel, .cabinet-panel, #app, #public-main, .card, .hero-copy, .section-heading {
  min-width: 0;
  max-width: 100%;
}
img, video { max-width: 100%; height: auto; }
.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.55;
  pointer-events: none;
}
.page-shell::before {
  width: 300px; height: 300px;
  left: -120px; top: 220px;
  background: rgba(255, 214, 223, 0.65);
}
.page-shell::after {
  width: 240px; height: 240px;
  right: -90px; bottom: 120px;
  background: rgba(255, 179, 125, 0.45);
}

/* --- Header (cabinet only) --- */
.site-header {
  width: min(calc(100% - 32px), var(--max));
  margin: 18px auto 0;
  min-height: 76px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid rgba(255,255,255,0.78);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: 0 16px 45px rgba(58, 36, 24, 0.08);
  position: sticky;
  top: calc(12px + env(safe-area-inset-top, 0px));
  z-index: 20;
}
.site-header[hidden] { display: none !important; }
#public-header[hidden],
#app-header[hidden] { display: none !important; }
body.portal-logged-in #public-header { display: none !important; }
body.portal-logged-out #app-header,
body.portal-logged-out #cabinet-subbar,
body.portal-logged-out #cabinet-nav-secondary { display: none !important; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
  cursor: pointer;
}
.brand img { height: 44px; width: auto; max-width: 180px; flex-shrink: 0; display: block; }
.brand-badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--choco);
  color: var(--bg);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.brand-badge-lg { font-size: 12px; padding: 5px 12px; }

.cabinet-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* Шапка кабинета — логотип слева, разделы и выход справа */
#app-header.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 14px;
}
#app-header .brand { flex-shrink: 0; }
#app-header .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  max-width: min(100%, 720px);
}
#app-header .cabinet-nav-top {
  margin-left: 0;
  justify-content: flex-end;
  flex-shrink: 0;
}
#app-header .header-actions {
  flex-shrink: 0;
}

.cabinet-nav-top {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: nowrap;
}
.cabinet-nav-top button,
.cabinet-nav-top a,
.cabinet-nav-secondary button,
.cabinet-nav-secondary a {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 9px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 13.5px;
  white-space: nowrap;
  transition: color .2s, background .2s;
  text-decoration: none;
}
.cabinet-nav-secondary a[aria-current="page"] {
  color: var(--choco);
  background: #fff;
  box-shadow: 0 4px 14px rgba(58, 36, 24, 0.08);
}

@media (hover: hover) and (pointer: fine) {
  .cabinet-nav-top button:hover,
  .cabinet-nav-top a:hover,
  .cabinet-nav-secondary button:hover,
  .cabinet-nav-secondary a:hover,
  .cabinet-nav button:hover,
  .cabinet-nav a:hover,
  .nav-cabinet-link:hover {
    color: var(--choco);
    background: #fff;
  }
  .btn:hover { transform: translateY(-2px); }
  .btn-primary:hover { box-shadow: 0 24px 52px rgba(233, 120, 63, 0.34); }
}
@media (pointer: coarse) {
  .cabinet-nav-top a:not([aria-current="page"]):hover,
  .cabinet-nav-secondary a:not([aria-current="page"]):hover,
  .cabinet-nav a:not([aria-current="page"]):hover,
  .cabinet-nav a:not(.btn-primary):focus:not(:focus-visible),
  .nav-cabinet-link:hover,
  .btn-ghost:hover {
    color: inherit;
    background: transparent;
    transform: none;
    box-shadow: none;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Вторая полоска — настройки */
.cabinet-nav-secondary {
  width: min(calc(100% - 32px), var(--max));
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(255, 248, 239, 0.72);
  border: 1px solid var(--line);
}
.cabinet-nav-secondary[hidden] { display: none !important; }

.cabinet-nav button,
.cabinet-nav a {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--choco);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  transition: background .15s, border-color .15s;
  text-decoration: none;
}
.cabinet-nav button:hover,
.cabinet-nav a:hover {
  background: rgba(255,255,255,.8);
  border-color: var(--caramel-soft);
}
.cabinet-nav a.btn {
  border: none;
}
.cabinet-nav a.btn-primary {
  color: var(--choco);
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
  box-shadow: 0 18px 42px rgba(233, 120, 63, 0.28);
}
.cabinet-nav a.btn-primary:hover {
  color: var(--choco);
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
}
.header-user-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-cabinet-link {
  color: var(--muted);
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav-cabinet-link:hover {
  color: var(--choco);
  background: rgba(255, 255, 255, 0.8);
}
.nav-logout {
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-admin {
  background: rgba(255, 214, 223, 0.45) !important;
  border-color: var(--accent) !important;
}

.cabinet-subbar {
  width: min(calc(100% - 32px), var(--max));
  margin: 10px auto 0;
  display: flex;
}
.cabinet-subbar[hidden] { display: none !important; }

.btn-support-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 20px;
  border: 1px dashed var(--caramel-soft);
  background: rgba(255, 255, 255, 0.72);
  color: var(--choco);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn-support-bar:hover {
  background: rgba(255, 214, 223, 0.4);
  border-color: var(--accent);
}
.btn-support-bar.is-active {
  background: rgba(255, 214, 223, 0.55);
  border-style: solid;
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(58, 36, 24, 0.08);
}
.btn-support-bar-icon { font-size: 18px; line-height: 1; }

.admin-locations { display: flex; flex-direction: column; gap: 12px; }
.admin-loc-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.admin-loc-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-loc-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.admin-user-link {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.admin-user-link:hover { opacity: .85; }

.admin-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-users-search {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font: inherit;
}
.admin-users-table { width: 100%; min-width: 560px; }
.admin-users-table tbody tr { cursor: pointer; }
.admin-users-table tbody tr:hover { background: rgba(255,248,239,.7); }
.admin-users-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(58,36,24,.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow: auto;
}
.admin-modal-overlay:not([hidden]) { display: flex; }
.admin-modal-card {
  background: #fff;
  border-radius: 20px;
  max-width: 960px;
  width: 100%;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(58,36,24,.28);
  margin-bottom: 40px;
}
.admin-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.admin-modal-head h2 { margin: 0 0 4px; font-size: 22px; }
.admin-user-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.admin-user-card {
  background: #fff8ef;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
}
.admin-user-card strong { display: block; font-size: 18px; }
.admin-user-card span { color: var(--muted); font-size: 12px; }
.admin-loc-detail {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(255,248,239,.35);
}
.admin-loc-detail-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.admin-loc-detail-head h3 { margin: 0; font-size: 17px; }
.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 14px;
  font-size: 13px;
  margin: 10px 0;
}
.admin-settings-grid dt { color: var(--muted); font-weight: 700; }
.admin-settings-grid dd { margin: 0 0 6px; word-break: break-word; }
.admin-preset-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.admin-preset-chip {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}
.admin-preset-chip.is-off { opacity: .55; text-decoration: line-through; }
.admin-device-row {
  font-size: 13px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.admin-device-row:first-child { border-top: 0; }
.admin-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255,214,223,.45);
  color: var(--choco);
}
.admin-tag.green { background: rgba(31,157,85,.15); color: #1f9d55; }
.admin-tag.red { background: rgba(214,69,69,.12); color: #d64545; }
.admin-tag.gray { background: rgba(58,36,24,.08); color: var(--muted); }

/* --- Layout --- */
.section-pad {
  width: min(calc(100% - 32px), var(--max));
  margin-inline: auto;
  padding: 48px 0;
}

.landing-logo {
  width: min(calc(100% - 32px), var(--max));
  margin: 28px auto 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-top {
  padding-top: 8px;
}
@media (min-width: 900px) {
  .hero-top {
    padding-top: 16px;
  }
}

/* --- Hero --- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
  padding-top: 16px;
  padding-bottom: 24px;
}
.hero-copy,
.hero-visual {
  min-width: 0;
}
@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 32px;
    padding-top: 24px;
    padding-bottom: 32px;
  }
}
.eyebrow, .kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--caramel);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
}
.eyebrow > span:first-child,
.kicker > span:first-child {
  width: 10px; height: 10px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 8px rgba(255, 159, 104, .17);
  flex-shrink: 0;
}
.hero-eyebrow { text-transform: none; letter-spacing: 0; }
.hero-eyebrow-brand {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 900;
  color: var(--caramel);
}
.hero h1 {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12em;
  margin: 16px 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -.06em;
  max-width: 680px;
  text-wrap: balance;
}
.hero-h1-main {
  display: block;
}
.hero-h1-free {
  display: block;
  color: var(--accent-dark);
  white-space: nowrap;
}
.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.65;
  max-width: 580px;
  font-weight: 600;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 22px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
  color: var(--choco);
  box-shadow: 0 18px 42px rgba(233, 120, 63, 0.28);
}
.btn-ghost {
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  color: var(--choco);
}
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 14px; }

.trust-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trust-row span {
  padding: 9px 13px;
  background: rgba(255,255,255,.6);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hero-visual {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}
@media (min-width: 900px) {
  .hero-visual { min-height: 500px; }
}
.hero-visual img {
  width: 100%;
  max-width: min(100%, 520px);
  height: auto;
  display: block;
  margin-inline: auto;
  animation: hero-float 6s ease-in-out infinite;
}
@media (min-width: 900px) {
  .hero-visual img { max-width: 720px; }
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-visual { animation: none; }
}

/* --- Sections --- */
.section-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 32px;
}
.section-heading.compact { max-width: 640px; }
.section-heading h2 {
  margin: 10px 0 12px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.05em;
}
.section-heading p:not(.kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.features-intro {
  margin: 12px 0 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.55;
}
.feature-card {
  padding: 24px;
  border-radius: 30px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: 0 18px 55px rgba(58, 36, 24, .08);
}
.feature-icon {
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--milk);
  font-size: 26px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.feature-card h3 {
  margin: 16px 0 8px;
  font-size: 20px;
  letter-spacing: -.02em;
}
.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-weight: 600;
  font-size: 15px;
}

.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.compare-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
}
.compare-table th,
.compare-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.compare-table th {
  font-weight: 900;
  color: var(--choco);
  background: rgba(255,250,242,.8);
}
.compare-table td:first-child { color: var(--muted); }
.compare-highlight {
  background: rgba(255, 214, 223, 0.25);
  color: var(--choco);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.steps article {
  padding: 28px;
  border-radius: 30px;
  min-height: 180px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: 0 18px 55px rgba(58, 36, 24, .08);
}
.steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 18px;
  background: var(--choco);
  color: var(--bg);
  font-weight: 950;
}
.steps h3 { margin: 16px 0 8px; font-size: 20px; }
.steps p { margin: 0; color: var(--muted); line-height: 1.6; font-weight: 600; font-size: 15px; }

.final-cta { padding-bottom: 24px; }
.final-card {
  text-align: center;
  padding: 40px 28px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.final-card h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -.04em;
}
.final-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-weight: 600;
  font-size: 17px;
}

.landing-footer {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto 40px;
  padding: 20px 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --- Auth --- */
.auth-panel {
  min-height: calc(100vh - 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 48px;
}
.auth-card {
  width: min(100%, 440px);
  padding: 32px 28px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.84);
  box-shadow: var(--shadow);
}
.auth-back {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
}
.auth-logo { margin-bottom: 12px; }
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: -.03em;
}
.auth-lead { margin-bottom: 20px; }
.auth-switch {
  margin-top: 20px;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}
.captcha-field {
  margin: 12px 0 4px;
}
.captcha-field > div {
  min-height: 102px;
}

/* --- Cabinet --- */
#app {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 8px 0 48px;
}
#app[hidden], #public-shell[hidden] { display: none !important; }

.cabinet-panel h1 {
  margin: 8px 0 20px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.04em;
}

label {
  display: block;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--choco);
}
.checkbox-label input { width: auto; margin-top: 3px; }

.combo-preset-checks {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}
.combo-preset-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.combo-preset-checks input { width: auto; margin: 0; }

.billing-balance { font-size: 1.25rem; font-weight: 900; margin: 0 0 8px; }
.price-section-title { margin: 20px 0 10px; font-size: 1.05rem; }
.billing-price-table { margin: 8px 0 16px; font-size: 14px; }
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.package-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s, box-shadow .15s;
}
.package-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(58,36,24,.1); }
.package-card.is-starter { border-color: var(--accent); background: rgba(255,214,223,.35); }
.package-card strong { font-size: 1.05rem; }
.package-card span { color: var(--muted); font-size: .9rem; }
.package-card small { color: var(--caramel); font-size: .75rem; }
.package-card .pkg-tag { color: var(--accent-dark); font-weight: 900; }
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--choco);
  font-weight: 600;
  resize: vertical;
  min-height: 84px;
}

input, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--choco);
  font-weight: 600;
}
input[type="color"] { height: 44px; padding: 4px; }

.card {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 18px 55px rgba(58, 36, 24, .06);
}
.card h2 { margin: 0 0 12px; font-size: 20px; }

.device-errors {
  margin: 8px 0 12px;
  padding-left: 18px;
  color: #b42318;
  font-size: 13px;
  line-height: 1.45;
}
.device-errors li { margin: 2px 0; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.tile {
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(58, 36, 24, .06);
}
.tile strong { display: block; font-size: 26px; letter-spacing: -.02em; }
.tile span { color: var(--muted); font-size: 13px; font-weight: 700; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.archive-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.archive-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.stats-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 8px;
}
.stats-period-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stats-period-btn {
  border: 1px solid rgba(255,255,255,.84);
  background: rgba(255,255,255,.55);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.stats-period-btn:hover { background: rgba(255,255,255,.82); }
.stats-period-btn.is-active {
  background: linear-gradient(135deg, #fff8ef, #ffe8cc);
  box-shadow: 0 8px 20px rgba(196, 92, 38, .12);
  border-color: rgba(196, 92, 38, .25);
}

.stats-focus-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 4px 0 12px;
}

.stats-infographic {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 16px 0 20px;
}
.stats-metric-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.84);
  background: rgba(255,255,255,.66);
  box-shadow: 0 10px 28px rgba(58, 36, 24, .06);
  cursor: pointer;
  text-align: left;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stats-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(58, 36, 24, .1);
}
.stats-metric-card.is-active {
  border-color: rgba(196, 92, 38, .35);
  box-shadow: 0 14px 34px rgba(196, 92, 38, .14);
}
.stats-metric-card img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}
.stats-metric-card strong {
  display: block;
  font-size: 26px;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.stats-metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.stats-metric-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.stats-locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.stats-location-card {
  border: 1px solid rgba(255,255,255,.84);
  border-radius: 20px;
  padding: 16px;
  background: rgba(255,255,255,.58);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.stats-location-card:hover,
.stats-location-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(196, 92, 38, .3);
  box-shadow: 0 12px 28px rgba(58, 36, 24, .08);
}
.stats-location-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.stats-location-card .stats-loc-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 10px;
}
.stats-loc-bars { display: grid; gap: 8px; }
.stats-loc-bar {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.stats-loc-bar i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(196, 92, 38, .12);
  overflow: hidden;
}
.stats-loc-bar i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8a66a, #c45c26);
}

.stats-chart-card { margin-top: 8px; }
.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-height: 180px;
  padding: 12px 4px 0;
  overflow-x: auto;
}
.stats-chart-col {
  flex: 1 0 18px;
  max-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stats-chart-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #f0b87a, #c45c26);
  transition: opacity .15s;
}
.stats-chart-col.is-dim .stats-chart-bar { opacity: .22; }
.stats-chart-col.is-highlight .stats-chart-bar {
  box-shadow: 0 0 0 2px rgba(196, 92, 38, .25);
}
.stats-chart-label {
  font-size: 9px;
  color: var(--muted);
  font-weight: 700;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 52px;
  overflow: hidden;
}

.compare-table .stats-row-clickable { cursor: pointer; }
.compare-table .stats-row-clickable:hover { background: rgba(255,248,239,.7); }
.compare-table .is-muted-metric { opacity: .45; }

.field-inline { max-width: 360px; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}
.inline-form label { flex: 1; min-width: 200px; margin: 0; }

.preset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.preset-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.preset-item-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.6);
}
.preset-item-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.preset-item button {
  flex-shrink: 0;
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--choco);
}
.preset-item button.btn-danger {
  color: #a33;
  border-color: rgba(170, 51, 51, 0.25);
}
.preset-clone-card { margin: 16px 0; }

.hint { color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.5; }
.big-code {
  display: block;
  font-size: 28px;
  letter-spacing: 3px;
  padding: 16px;
  background: var(--milk);
  border-radius: 14px;
  text-align: center;
  font-weight: 900;
  color: var(--choco);
  border: 1px dashed var(--caramel-soft);
}

.claim-opt summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--caramel);
}
.dash-quick ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.7;
}
.device-steps { margin-bottom: 16px; }
.device-platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.device-platform h2 { margin-top: 0; }
.device-soon {
  pointer-events: none;
  opacity: .72;
  cursor: default;
}

#toast {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  left: max(16px, env(safe-area-inset-left, 0px));
  margin-left: auto;
  width: fit-content;
  max-width: calc(100vw - 32px);
  background: var(--choco);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  z-index: 100;
  box-shadow: 0 12px 32px rgba(58, 36, 24, .25);
  overflow-wrap: anywhere;
}
#toast[hidden] { display: none !important; }

/* --- Chips / preset form --- */
.preset-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0 40px;
}
.preset-form fieldset.preset-section {
  border: 1px solid rgba(58, 36, 24, 0.1);
  border-radius: 22px;
  margin: 0;
  padding: 18px 20px 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(58, 36, 24, 0.06);
}
.preset-section legend {
  display: block;
  width: 100%;
  padding: 0 0 12px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -.02em;
  color: var(--choco);
}
.preset-section-hint {
  margin: 0 0 14px;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  background: rgba(255, 248, 239, 0.95);
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.preset-templates-wrap {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px dashed var(--caramel-soft);
}
.preset-templates-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.chip-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chip-templates { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip-templates button {
  background: #fff;
  border: 1px solid rgba(58, 36, 24, 0.12);
  color: var(--choco);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(58, 36, 24, 0.05);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.chip-templates button:hover {
  border-color: var(--caramel-soft);
  background: #fff8ef;
  box-shadow: 0 6px 16px rgba(58, 36, 24, 0.08);
}
.face-swap-templates-wrap {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.9);
  border: 1px dashed var(--caramel-soft);
}
.face-swap-templates {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.face-swap-template {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  border: 2px solid rgba(58, 36, 24, 0.12);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: 0 4px 12px rgba(58, 36, 24, 0.05);
}
.face-swap-template:hover {
  border-color: var(--caramel-soft);
  box-shadow: 0 6px 16px rgba(58, 36, 24, 0.1);
  transform: translateY(-1px);
}
.face-swap-template.selected {
  border-color: var(--accent, #ff9f68);
  box-shadow: 0 0 0 3px rgba(255, 159, 104, 0.25);
}
.face-swap-template img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: rgba(58, 36, 24, 0.06);
}
.face-swap-template span {
  font-size: 12px;
  font-weight: 800;
  color: var(--choco);
  text-align: center;
  line-height: 1.2;
}
.chip-group {
  margin: 0;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(255, 248, 239, 0.72);
  border: 1px solid rgba(58, 36, 24, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.chip-group-title {
  font-weight: 850;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.chip-group-hint {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1.45;
}
.prompt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.prompt-chips button {
  background: #fff;
  border: 1px solid rgba(58, 36, 24, 0.12);
  color: var(--choco);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(58, 36, 24, 0.04);
  transition: border-color .15s, background .15s, transform .12s;
}
.prompt-chips button:hover {
  border-color: var(--caramel);
  background: #fff8ef;
  transform: translateY(-1px);
}
.prompt-chips button.preset-active {
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
  border-color: transparent;
  color: var(--choco);
  box-shadow: 0 6px 18px rgba(255, 159, 104, 0.28);
}
.preset-form .prompt-preview {
  background: rgba(255, 248, 239, 0.8);
  border: 1px solid rgba(58, 36, 24, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0 0;
  font-size: 13px;
}
.preset-form-actions {
  margin-top: 4px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(58, 36, 24, 0.1);
  box-shadow: 0 12px 34px rgba(58, 36, 24, 0.06);
}
.preset-form-actions .btn {
  margin: 0;
  padding: 14px 28px;
  box-shadow: 0 10px 28px rgba(233, 120, 63, 0.22);
}
#prompt-preview-text { color: var(--choco); margin: 8px 0 0; white-space: pre-wrap; font-weight: 600; }

/* --- Branding / print forms --- */
.branding-form,
.print-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 40px;
}
.branding-form fieldset,
.branding-form .branding-section,
.print-form fieldset.branding-section {
  border: 1px solid rgba(58, 36, 24, 0.1);
  border-radius: 22px;
  margin: 0;
  padding: 18px 20px 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(58, 36, 24, 0.06);
}
.branding-section legend {
  display: block;
  width: 100%;
  padding: 0 0 12px;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -.02em;
  color: var(--choco);
}
.branding-section-hint {
  margin: 0 0 14px;
  padding: 10px 12px 10px 14px;
  border-radius: 12px;
  background: rgba(255, 248, 239, 0.95);
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.branding-section-en {
  background: linear-gradient(160deg, rgba(250, 248, 255, 0.98), rgba(255, 255, 255, 0.96));
  border-color: rgba(92, 79, 184, 0.16);
}
.branding-section-en legend {
  color: #5c4fb8;
  border-bottom-color: rgba(92, 79, 184, 0.14);
}
.branding-section-en .branding-section-hint {
  background: rgba(242, 240, 255, 0.9);
  border-left-color: #8b7fd4;
}
.branding-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .branding-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }
}
.branding-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 248, 239, 0.65);
  border: 1px solid rgba(58, 36, 24, 0.07);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  min-width: 0;
}
.branding-grid .checkbox-label {
  flex-direction: row;
  align-items: flex-start;
  color: var(--choco);
  background: rgba(255, 255, 255, 0.85);
}
.branding-grid input,
.branding-grid select {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  background: #fff;
  border-color: rgba(58, 36, 24, 0.14);
  box-shadow: inset 0 1px 2px rgba(58, 36, 24, 0.04);
}
.branding-grid input:focus,
.branding-grid select:focus {
  outline: none;
  border-color: var(--caramel);
  box-shadow: 0 0 0 3px rgba(255, 159, 104, 0.18);
}
.branding-grid input[type="color"] {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}
.branding-save-btn {
  align-self: flex-start;
  margin-top: 8px;
  padding: 14px 28px;
  box-shadow: 0 10px 28px rgba(233, 120, 63, 0.22);
}

.branding-form.is-branding-locked .branding-text-fields,
.branding-form.is-branding-locked .branding-logo-lockable,
.branding-form.is-branding-locked .branding-logo-section {
  opacity: 0.72;
}

.molochko-branding-offer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(233, 120, 63, 0.35);
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.95), rgba(255, 214, 223, 0.45));
}

.molochko-branding-offer h2 {
  margin: 4px 0 8px;
  font-size: 1.15rem;
}

.molochko-branding-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--caramel);
}

.molochko-branding-locked {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(58, 36, 24, 0.12);
  background: rgba(255, 255, 255, 0.75);
  color: var(--choco);
}

.molochko-branding-locked-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
}

.molochko-branding-locked span {
  color: var(--muted);
  font-size: 13px;
}

.billing-price-old {
  color: var(--muted);
  margin-right: 6px;
}

.print-form-actions {
  margin-top: 4px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(58, 36, 24, 0.1);
  box-shadow: 0 12px 34px rgba(58, 36, 24, 0.06);
  position: relative;
  z-index: 2;
  clear: both;
}
.print-form-actions .btn {
  margin: 0;
  padding: 14px 28px;
  box-shadow: 0 10px 28px rgba(233, 120, 63, 0.22);
}
.print-overlay-section,
.print-guest-frames-section {
  overflow: visible;
}
.print-guest-frames-section .guest-frame-grid {
  margin: 12px 0 14px;
}
.print-guest-frames-section #btn-add-current-frame {
  margin-top: 4px;
}
.print-layout-block {
  margin-top: 16px;
  padding-top: 4px;
}
.print-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.print-layout-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.print-layout-card:hover {
  border-color: var(--caramel-soft);
}
.print-layout-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(255, 159, 104, .25);
}
.print-layout-preview {
  display: grid;
  gap: 3px;
  aspect-ratio: 2/3;
  background: linear-gradient(165deg, #ffffff, #f7f4ff 55%, #fff8f3);
  border: 1px solid rgba(58, 36, 24, 0.08);
  border-radius: 8px;
  padding: 6px;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.print-layout-cell {
  display: block;
  border-radius: 4px;
  background: linear-gradient(145deg, #ffffff, #eef6ff);
  border: 1px solid rgba(147, 197, 253, 0.35);
  box-shadow: 0 1px 3px rgba(58, 36, 24, 0.06);
  min-height: 0;
}
.print-layout-cell.is-dup {
  background: linear-gradient(145deg, #ffffff, #fff0f5);
  border-color: rgba(255, 182, 193, 0.55);
}
.print-layout-preview .print-layout-cell:nth-child(4n+2) {
  background: linear-gradient(145deg, #ffffff, #f3f0ff);
  border-color: rgba(196, 181, 253, 0.4);
}
.print-layout-preview .print-layout-cell:nth-child(4n+3) {
  background: linear-gradient(145deg, #ffffff, #f0fff8);
  border-color: rgba(134, 239, 172, 0.4);
}
.print-layout-card strong {
  display: block;
  font-size: 12px;
  color: var(--choco);
  margin-bottom: 2px;
}
.print-layout-card span {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}
#view-branding > .hint {
  max-width: 72ch;
  margin-bottom: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}
.frame-editor-wrap { margin: 12px 0; }
#frame-editor-canvas {
  max-width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  cursor: crosshair;
  background: linear-gradient(165deg, #ffffff, #f7f4ff 55%, #fff8f3);
}

.frame-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.frame-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: var(--muted);
}
.frame-tab.is-active {
  color: var(--choco);
  border-color: var(--caramel-soft);
  background: #fff;
  box-shadow: 0 4px 12px rgba(58,36,24,.06);
}
.frame-panel { margin-bottom: 12px; }

.frame-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 4px;
}
.frame-template-card {
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, box-shadow .15s;
}
.frame-template-card:hover {
  border-color: var(--caramel-soft);
}
.frame-template-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(255, 159, 104, .25);
}
.frame-template-card.is-guest-on {
  outline: 2px solid var(--caramel);
  outline-offset: 2px;
}
.frame-template-card canvas {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin-bottom: 6px;
}
.frame-template-card strong {
  display: block;
  font-size: 12px;
  color: var(--choco);
}
.frame-template-card span {
  font-size: 11px;
  color: var(--muted);
}
.mono-textarea {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.preset-filter-row { margin-bottom: 16px; }
.archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.archive-item img { width: 100%; border-radius: 8px; aspect-ratio: 2/3; object-fit: cover; }

/* --- Benefits page --- */
.benefits-panel {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 8px 0 56px;
}
.benefits-wrap {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.benefits-hero {
  padding: 28px 28px 32px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 239, 0.92));
}
.benefits-hero h1 {
  margin: 12px 0 16px;
  font-size: clamp(30px, 4.5vw, 44px);
  letter-spacing: -.04em;
  line-height: 1.08;
}
.benefits-hero h1 em {
  font-style: normal;
  color: var(--accent-dark);
}
.benefits-lead {
  margin: 0 0 22px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.65;
}
.benefits-free-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}
.benefits-free-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  text-align: center;
}
.benefits-free-item strong {
  display: block;
  font-size: 22px;
  letter-spacing: -.02em;
  color: var(--choco);
}
.benefits-free-item span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.benefits-free-accent {
  background: linear-gradient(135deg, rgba(255, 214, 223, 0.45), rgba(255, 248, 239, 0.9));
  border-color: rgba(255, 159, 104, 0.35);
}
.benefits-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.benefits-setup-block {
  padding: 24px 26px 26px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 239, 0.88));
  border: 1px solid rgba(233, 120, 63, 0.2);
}
.benefits-setup-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: setup;
}
.benefits-setup-steps li {
  counter-increment: setup;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}
.benefits-setup-steps li strong {
  display: inline-block;
  margin-right: 8px;
  font-size: 13px;
  font-weight: 900;
  color: var(--accent-dark);
  letter-spacing: 0.02em;
}
.benefits-setup-steps li span {
  font-weight: 800;
  font-size: 15px;
  color: var(--choco);
}
.benefits-setup-steps li p {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.5;
}
.benefits-setup-foot {
  margin: 16px 0 0;
  max-width: 58ch;
}
.benefits-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
  max-width: 58ch;
}
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.benefits-card {
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 40px rgba(58, 36, 24, 0.06);
}
.benefits-card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--milk);
  font-size: 24px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.benefits-card h3 {
  margin: 14px 0 8px;
  font-size: 18px;
  letter-spacing: -.02em;
}
.benefits-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.58;
}
.benefits-pay-card h2 {
  margin: 0 0 18px;
}
.benefits-pay-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 700px) {
  .benefits-pay-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.benefits-pay-col h3 {
  margin: 0 0 12px;
  font-size: 17px;
}
.benefits-pay-free ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.75;
}
.benefits-pay-coins p {
  margin: 0 0 10px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
}
.benefits-cta {
  text-align: center;
  padding: 28px;
  background: linear-gradient(160deg, rgba(255, 248, 239, 0.95), rgba(255, 255, 255, 0.9));
}
.benefits-cta h2 {
  margin: 0 0 12px;
}
.benefits-cta p {
  margin: 0 auto 20px;
  max-width: 52ch;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
}

/* --- FAQ / Instruction --- */
.faq-panel {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
  padding: 8px 0 56px;
}
.faq-wrap h1 {
  margin: 8px 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -.04em;
}
.faq-lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 72ch;
}
.faq-toc h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.faq-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 8px;
}
.faq-toc a {
  font-weight: 700;
  color: var(--caramel);
}
.faq-section {
  margin-top: 16px;
}
.faq-section h2 {
  margin: 0 0 14px;
  font-size: 22px;
  letter-spacing: -.02em;
}
.faq-section h3 {
  margin: 18px 0 8px;
  font-size: 16px;
}
.faq-section ul,
.faq-section ol {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  line-height: 1.6;
}
.faq-section li { margin: 6px 0; }
.faq-steps { counter-reset: none; }
.faq-callout {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 214, 223, 0.35);
  border: 1px solid rgba(255, 159, 104, 0.35);
  line-height: 1.55;
}
.faq-item {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  overflow: hidden;
}
.faq-item summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.7);
}
.faq-item p {
  margin: 0;
  padding: 12px 14px 14px;
  color: var(--muted);
  line-height: 1.55;
}
.faq-footer {
  margin-top: 28px;
  text-align: center;
}
.faq-section code,
.faq-item code {
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(58, 36, 24, 0.06);
  font-size: 0.92em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.faq-item summary { overflow-wrap: anywhere; }
.faq-section kbd {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.8);
  font-size: 0.85em;
}
.public-nav .btn-primary,
.public-nav a.btn-primary {
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}
.public-nav a {
  text-decoration: none;
}
#public-header .public-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
#public-header .public-nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
#public-header .public-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.nav-cta-label-short { display: none; }
.public-nav .nav-register-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
  color: var(--choco);
  border: none;
  box-shadow: 0 18px 42px rgba(233, 120, 63, 0.28);
}
.public-nav .nav-register-cta:hover {
  color: var(--choco);
  background: linear-gradient(135deg, var(--accent), #ffbd8c);
}

/* --- Support --- */
.support-lead { margin: -8px 0 20px; max-width: 62ch; }
.support-suggest { margin-bottom: 16px; }
.support-suggest-hint { margin: -4px 0 16px; max-width: 62ch; }
.support-suggest-groups { display: flex; flex-direction: column; gap: 14px; }
.support-suggest-group-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.support-suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.support-suggest-chips button {
  background: #fff;
  border: 1px solid rgba(58, 36, 24, 0.12);
  color: var(--choco);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(58, 36, 24, 0.04);
  transition: border-color .15s, background .15s, transform .12s;
}
.support-suggest-chips button:hover {
  border-color: var(--caramel);
  background: #fff8ef;
  transform: translateY(-1px);
}
.support-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 120px;
}
.support-list { display: flex; flex-direction: column; gap: 12px; }
.support-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,255,255,.65);
}
.support-item-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.support-item-head strong { font-size: 15px; }
.support-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.support-msg {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.support-reply {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(31, 157, 85, 0.08);
  border-radius: 12px;
}
.support-reply-lbl {
  font-weight: 800;
  font-size: 13px;
  color: #1f9d55;
  margin-bottom: 4px;
}
.support-reply-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
}
.tag {
  font-size: 12px;
  font-weight: 900;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 214, 223, 0.55);
  color: var(--caramel);
  flex-shrink: 0;
}
.tag.green { background: #e3f6e8; color: #1f7a45; }
.tag.gray { background: #eee; color: #555; }

/* --- Responsive (iOS / Android, как molochko.club) --- */
@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 32px;
  }
  .hero-visual { order: -1; min-height: 280px; }
  .hero-visual img { max-width: 100%; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefits-compare-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .page-shell {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }
  .site-header {
    width: min(calc(100% - 20px), var(--max));
    margin-top: calc(10px + env(safe-area-inset-top, 0px));
    min-height: 64px;
    padding: 8px 10px 8px 12px;
    border-radius: 22px;
    top: env(safe-area-inset-top, 0px);
  }
  .brand img { height: 36px; max-width: 150px; }
  .brand-badge { font-size: 10px; padding: 3px 8px; }

  /* Публичная шапка: лого + кнопки в строке, меню ниже */
  #public-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand actions"
      "menu menu";
    align-items: center;
    gap: 8px 10px;
  }
  #public-header .brand {
    grid-area: brand;
    align-self: center;
    min-width: 0;
  }
  #public-header .public-header-right {
    display: contents;
  }
  #public-header .public-header-actions {
    grid-area: actions;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-self: end;
    flex-shrink: 0;
  }
  #public-header .public-header-actions .btn {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    line-height: 1.2;
  }
  #public-header .public-header-actions .nav-register-cta {
    padding: 8px 14px;
    box-shadow: 0 12px 28px rgba(233, 120, 63, 0.28);
  }
  #public-header .public-nav-menu {
    grid-area: menu;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    padding: 6px;
    border-radius: 18px;
    background: linear-gradient(165deg, rgba(255,255,255,.96), rgba(255,250,244,.94));
    border: 1px solid rgba(255, 159, 104, .22);
    box-shadow: 0 10px 28px rgba(58, 36, 24, .07);
  }
  #public-header .public-nav-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 6px 8px;
    border: none;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
    color: var(--muted);
    background: transparent;
  }
  #public-header .public-nav-menu a[aria-current="page"] {
    background: #fff;
    box-shadow: 0 4px 12px rgba(58, 36, 24, 0.08);
    color: var(--choco);
  }
  .nav-cta-label-full { display: none; }
  .nav-cta-label-short { display: inline; }

  /* Кабинет — компактная шапка + сетка навигации (без горизонтального скролла) */
  #app-header.site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand logout"
      "topnav topnav";
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
  }
  #app-header .brand {
    grid-area: brand;
    align-self: center;
    min-width: 0;
  }
  #app-header .header-right {
    display: contents;
  }
  #app-header .header-actions {
    grid-area: logout;
    justify-self: end;
    align-self: center;
    gap: 6px;
  }
  #app-header .header-user-email,
  #app-header .header-actions .nav-cabinet-link,
  #app-header .header-actions .role-badge {
    display: none !important;
  }
  #app-header .cabinet-nav-top {
    grid-area: topnav;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    width: 100%;
    margin: 0;
    overflow: visible;
    flex-wrap: wrap;
    padding: 6px;
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(255,255,255,.96), rgba(255,250,244,.94));
    border: 1px solid rgba(255, 159, 104, .18);
    box-shadow: 0 8px 22px rgba(58, 36, 24, .06);
    mask-image: none;
    -webkit-mask-image: none;
  }
  #app-header .cabinet-nav-top a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 6px 4px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
    flex-shrink: 1;
    border-radius: 12px;
  }
  #app-header .cabinet-nav-top a[aria-current="page"] {
    background: #fff;
    box-shadow: 0 4px 12px rgba(58, 36, 24, 0.08);
    color: var(--choco);
  }
  #app-header .cabinet-nav-top:has(#nav-admin[hidden]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #app-header .nav-logout {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 12px;
  }
  .cabinet-nav-secondary {
    width: min(calc(100% - 20px), var(--max));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    flex-wrap: wrap;
    overflow: visible;
    justify-content: stretch;
    padding: 6px;
    mask-image: none;
    -webkit-mask-image: none;
  }
  .cabinet-nav-secondary a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 6px 4px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
    flex-shrink: 1;
    border-radius: 12px;
  }
  .cabinet-nav-secondary a[aria-current="page"] {
    background: #fff;
    box-shadow: 0 4px 12px rgba(58, 36, 24, 0.08);
    color: var(--choco);
  }
  .cabinet-subbar {
    width: min(calc(100% - 20px), var(--max));
    margin-top: 8px;
  }
  .btn-support-bar { min-height: 48px; }

  .section-pad,
  .benefits-panel,
  .faq-panel,
  #app,
  #public-main,
  .landing-footer {
    width: min(calc(100% - 20px), var(--max));
  }
  .section-pad { padding-top: 28px; padding-bottom: 28px; }
  .hero h1 { font-size: clamp(28px, 8.5vw, 40px); letter-spacing: -.04em; }
  .hero-h1-free { white-space: normal; }
  .hero-text { font-size: 16px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; min-height: 48px; }
  .trust-row { gap: 6px; }
  .trust-row span { font-size: 11px; padding: 6px 10px; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }

  /* Лендинг: сравнение — карточки вместо широкой таблицы */
  #compare .compare-table-wrap {
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }
  #compare .compare-table {
    min-width: 0;
    display: block;
    font-size: 14px;
  }
  #compare .compare-table thead { display: none; }
  #compare .compare-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  #compare .compare-table tr {
    display: block;
    border-radius: 22px;
    background: rgba(255,255,255,.66);
    border: 1px solid rgba(255,255,255,.84);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  #compare .compare-table td {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  #compare .compare-table td:first-child {
    font-weight: 900;
    font-size: 13px;
    color: var(--choco);
    background: rgba(255,250,242,.8);
    border-bottom: 1px solid var(--line);
  }
  #compare .compare-table td:nth-child(2)::before {
    content: "Обычные решения";
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
  }
  #compare .compare-table td:nth-child(3)::before {
    content: "Molochko Booth";
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent);
  }
  #compare .compare-table td:last-child {
    border-bottom: none;
  }
  #compare .compare-table .compare-highlight {
    background: rgba(255, 214, 223, 0.2);
  }

  .compare-table th, .compare-table td { padding: 12px 14px; font-size: 13px; }
  .auth-card { padding: 24px 18px; width: min(calc(100% - 20px), var(--max)); }
  .auth-card h1 { font-size: 26px; }
  input, select, textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .btn { min-height: 48px; }
  .btn-sm { min-height: 44px; }
  .cabinet-panel { padding: 0 0 24px; }
  .card { padding: 16px; border-radius: 22px; }
  .preset-item { flex-direction: column; align-items: stretch; }
  .preset-item-main { align-items: flex-start; }
  .preset-item-main span { min-width: 0; overflow-wrap: anywhere; }
  .preset-item-actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }
  .preset-item-actions button { flex: 1 1 calc(50% - 4px); min-width: 0; text-align: center; }
  .preset-form fieldset.preset-section,
  .branding-form fieldset,
  .branding-form .branding-section,
  .print-form fieldset.branding-section {
    padding: 14px 14px 16px;
    border-radius: 18px;
  }
  .preset-form-actions,
  .print-form-actions {
    padding: 14px;
  }
  .preset-form-actions .btn,
  .print-form-actions .btn,
  .branding-save-btn {
    width: 100%;
  }
  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-form label { min-width: 0; width: 100%; flex: none; }
  .inline-form .btn { width: 100%; }
  .admin-users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-users-search { min-width: 0; width: 100%; }
  .admin-users-pager {
    flex-wrap: wrap;
    justify-content: center;
  }
  .admin-modal-overlay {
    padding: 12px 10px;
    align-items: flex-start;
  }
  .admin-modal-card {
    width: min(calc(100% - 20px), var(--max));
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px);
    overflow: auto;
    padding: 16px 14px;
  }
  .admin-modal-head {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-user-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .stats-period-tabs { justify-content: flex-start; }
  .stats-infographic { grid-template-columns: 1fr; }
  .stats-locations-grid { grid-template-columns: 1fr; }
  .molochko-branding-offer {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .molochko-branding-offer .btn { width: 100%; }
  .molochko-branding-locked {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .device-platforms { grid-template-columns: 1fr; }
  .benefits-hero { padding: 22px 18px 24px; }
  .benefits-hero h1 { font-size: clamp(26px, 7vw, 34px); }
  .benefits-lead { font-size: 15px; }
  .benefits-hero-actions { flex-direction: column; }
  .benefits-hero-actions .btn { width: 100%; }
  .benefits-setup-block { padding: 18px 16px 20px; }
  .benefits-cta { padding: 22px 16px; }
  .benefits-cta .btn { width: 100%; }
  .faq-section h2 { font-size: 20px; }
  .faq-wrap h1 { font-size: 28px; }
  .support-date { margin-left: 0; flex-basis: 100%; }
  .support-item-head strong { min-width: 0; overflow-wrap: anywhere; }
  .btn-support-bar-text {
    text-align: center;
    line-height: 1.35;
    font-size: 14px;
  }
  .final-card { padding: 28px 18px; }
  .final-card .btn { width: 100%; }
  .packages-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .face-swap-templates { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .print-layout-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .frame-template-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .big-code {
    font-size: 24px;
    letter-spacing: 2px;
    word-break: break-all;
  }
}

@media (max-width: 899px) {
  .hero-visual { order: -1; }
  .site-header { position: sticky; }
}

@media (max-width: 520px) {
  .admin-user-cards { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .packages-grid { grid-template-columns: 1fr; }
  .benefits-free-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-cabinet-link { display: none; }
  .preset-item-actions button { flex: 1 1 100%; }
  .stats-loc-bar {
    grid-template-columns: 52px 1fr 28px;
    gap: 4px;
    font-size: 11px;
  }
  .stats-metric-card strong { font-size: 22px; }
  .tile strong { font-size: 22px; }
  .dash-stats .tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 6px);
  }
  .btn-support-bar-text { font-size: 13px; }
  .big-code { font-size: 20px; letter-spacing: 1px; }
  .brand-badge { display: none; }
}

@media (max-width: 380px) {
  .site-header {
    width: min(calc(100% - 16px), var(--max));
  }
  .section-pad,
  .benefits-panel,
  .faq-panel,
  #app,
  #public-main,
  .landing-footer,
  .cabinet-nav-secondary,
  .cabinet-subbar,
  .auth-card {
    width: min(calc(100% - 16px), var(--max));
  }
  #public-header .public-nav-menu a {
    font-size: 11px;
    padding: 6px 4px;
  }
  #app-header .cabinet-nav-top a,
  .cabinet-nav-secondary a {
    font-size: 9px;
    padding: 6px 2px;
    min-height: 42px;
  }
  .hero h1 { font-size: clamp(24px, 7.5vw, 32px); }
  .trust-row span { font-size: 10px; padding: 5px 8px; }
  .archive-grid { grid-template-columns: 1fr; }
  .benefits-free-strip { grid-template-columns: 1fr; }
  .face-swap-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.gp-fields label { margin-top: 10px; }

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  margin-right: auto;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 159, 104, 0.15);
  color: var(--ink);
}

.tile-warn {
  border-color: #e8a045;
  background: rgba(232, 160, 69, 0.08);
}

body.role-viewer .requires-write,
body.role-viewer [data-delete-preset],
body.role-viewer [data-delete-rule],
body.role-viewer [data-delete-promo],
body.role-viewer #form-preset,
body.role-viewer #form-schedule,
body.role-viewer #form-promo,
body.role-viewer #form-add-manager,
body.role-viewer #btn-pairing-code,
body.role-viewer [data-revoke] {
  display: none !important;
}

body.role-operator #billing-promo,
body.role-operator #form-promo {
  display: none !important;
}

.cabinet-subbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
