/* =========================================================
   Личный кабинет — редактор приглашения.
   Цвета, шрифты и кнопки берутся из css/style.css сайта;
   здесь — раскладка редактора, поля формы и предпросмотр.
   ========================================================= */

:root {
  --header-h: 72px;
  --line: rgba(184, 149, 94, .26);
  --field-border: rgba(184, 149, 94, .38);
  --error: #B0604E;
  --ok: #6E9A6A;
}

.cab-body { background: var(--bg); }
/* общий css сайта задаёт картинкам display: block — скрытые элементы должны оставаться скрытыми */
.cab-body [hidden] { display: none !important; }

/* тонкие линейные иконки разделов и ссылок */
.cab-tab svg, .link-btn svg, .seg svg, .cab-preview__close svg, .cab-dialog__close svg,
.answers-empty svg, .sched svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Шапка ---------- */

.cab-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
  padding: 0 28px;
  background: rgba(251, 247, 241, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cab-logo .logo__mark { width: 40px; height: 40px; }
.cab-logo .logo__text b { font-size: 21px; }
.cab-logo .logo__text small { font-size: 8.5px; letter-spacing: .5em; margin-top: 4px; }
.cab-crumbs {
  display: flex;
  gap: 10px;
  margin-left: 14px;
  padding-left: 28px;
  border-left: 1px solid var(--line);
  font-size: 14px;
  color: var(--taupe-2);
}
.cab-crumbs b { font-weight: 400; color: var(--taupe); }

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13.5px;
  color: var(--taupe-2);
  white-space: nowrap;
}
.save-state i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(110, 154, 106, .15); transition: background .3s, box-shadow .3s; }
.save-state[data-state="dirty"] i { background: var(--gold); box-shadow: 0 0 0 4px rgba(184, 149, 94, .18); }
.save-state[data-state="error"] i { background: var(--error); box-shadow: 0 0 0 4px rgba(176, 96, 78, .15); }
/* сохранено только в браузере — золотая точка: стоит войти */
.save-state[data-state="local"] i { background: var(--gold); box-shadow: 0 0 0 4px rgba(184, 149, 94, .18); }
.save-state[data-state="saving"] i { background: var(--gold); animation: save-pulse 1s ease-in-out infinite alternate; }
@keyframes save-pulse { from { box-shadow: 0 0 0 2px rgba(184, 149, 94, .1); } to { box-shadow: 0 0 0 6px rgba(184, 149, 94, .28); } }

/* аккаунт в шапке: «Войти» или почта пары */
.cab-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 42px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--field-border);
  border-radius: 999px;
  background: rgba(255, 253, 249, .7);
  font: inherit;
  font-size: 13.5px;
  color: var(--taupe);
  cursor: pointer;
  transition: border-color .3s, background-color .3s;
}
.cab-account:hover { border-color: var(--gold); background: #FFFDF9; }
.cab-account svg { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; }
.cab-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-account.is-in svg { fill: rgba(184, 149, 94, .14); }
.cab-header .btn { min-height: 42px; padding: 0 22px; }
.cab-header .btn .icon { width: 18px; height: 18px; }

/* ---------- Раскладка: разделы · форма · предпросмотр ---------- */

.cab {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) minmax(380px, 34vw);
  min-height: calc(100vh - var(--header-h));
}

.cab-side {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  padding: 30px 18px 24px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.cab-side__title { padding: 0 14px 14px; font-family: var(--serif); font-size: 23px; font-weight: 500; color: var(--taupe); }

.cab-tabs { display: flex; flex-direction: column; gap: 4px; }
.cab-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--taupe-2);
  text-align: left;
  cursor: pointer;
  transition: background .3s, color .3s;
}
.cab-tab svg { width: 22px; height: 22px; color: var(--gold); }
.cab-tab:hover { color: var(--taupe); background: rgba(234, 215, 174, .2); }
.cab-tab[aria-selected="true"] { color: var(--taupe); background: rgba(234, 215, 174, .42); }
/* в разделе есть ошибка */
.cab-tab.has-error::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--error);
}

.cab-template {
  margin-top: auto;
  padding: 22px 14px 0;
  border-top: 1px solid var(--line);
  text-align: center;
}
.cab-template__img { overflow: hidden; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.cab-template__img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 52%; }
.cab-template__name { margin-top: 12px; font-family: var(--serif); font-size: 20px; font-weight: 500; color: var(--taupe); }
.cab-template__soon { font-size: 12.5px; color: var(--taupe-2); }

.cab-main { padding: 40px clamp(24px, 4vw, 56px) 60px; }
.cab-form { max-width: 640px; }

/* ---------- Разделы формы ---------- */

.pane__title { font-size: clamp(30px, 3vw, 40px); font-weight: 500; }
.pane__lead { margin-top: 6px; font-size: 15px; color: var(--taupe-2); }
.group { margin: 28px 0 0; padding: 0; border: 0; }
.group__label { display: block; margin: 26px 0 0; padding: 0; font-size: 16px; font-weight: 400; color: var(--taupe); }
.group .group__label { margin-top: 0; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { position: relative; display: block; margin-top: 14px; }
.row .field { margin-top: 14px; }
.field__label {
  position: absolute;
  left: 15px;
  top: 9px;
  z-index: 1;
  font-size: 12px;
  color: var(--taupe-2);
  pointer-events: none;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 27px 14px 9px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--pearl);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--taupe);
  transition: border-color .25s, box-shadow .25s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { resize: vertical; padding-bottom: 24px; }
.field input::placeholder, .field textarea::placeholder { color: rgba(138, 118, 106, .55); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 149, 94, .16); }
/* значок календаря и часов — золотой */
.field input::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; filter: sepia(1) saturate(2) hue-rotate(-12deg); }
.field__count { position: absolute; right: 12px; bottom: 7px; font-size: 11px; color: var(--taupe-2); pointer-events: none; }
.field__count.is-near { color: var(--gold-3); }
.field__error { display: block; font-size: 12.5px; color: var(--error); }
.field__error:empty { display: none; }
.field .field__error { margin-top: 5px; }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--error); box-shadow: 0 0 0 3px rgba(176, 96, 78, .1); }
.field-note { margin-top: 8px; font-size: 13px; color: var(--taupe-2); }

/* переключатель */
.toggle { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 15px; color: var(--taupe); cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle__ui {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #E9DFD1;
  box-shadow: inset 0 1px 2px rgba(122, 92, 52, .2);
  transition: background .3s;
}
.toggle__ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(122, 92, 52, .3);
  transition: transform .35s var(--ease);
}
.toggle input:checked + .toggle__ui { background: var(--gold-grad); }
.toggle input:checked + .toggle__ui::after { transform: translateX(20px); }
.toggle input:focus-visible + .toggle__ui { outline: 2px solid var(--gold); outline-offset: 3px; }
.toggle__ar { font-family: "Amiri", serif; color: var(--gold-3); margin-left: 4px; }

/* цветовая гамма */
.swatches { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 14px; }
.swatch { display: grid; justify-items: center; gap: 8px; font-size: 12.5px; color: var(--taupe-2); cursor: pointer; }
.swatch input, .font-opt input { position: absolute; opacity: 0; pointer-events: none; }
.swatch__dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: 0 0 0 1px var(--line), inset 0 2px 6px rgba(255, 255, 255, .6);
  transition: box-shadow .3s, transform .4s var(--ease);
}
.swatch:hover .swatch__dot { transform: translateY(-2px); }
.swatch input:checked + .swatch__dot { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--gold), inset 0 2px 6px rgba(255, 255, 255, .6); }
.swatch input:checked ~ span:last-child { color: var(--taupe); }
.swatch input:focus-visible + .swatch__dot { outline: 2px solid var(--gold); outline-offset: 8px; }

/* выбор шаблона */
.tpls { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 16px; margin-top: 14px; }
.tpl { position: relative; display: grid; gap: 2px; padding: 10px 10px 14px; border: 1px solid var(--field-border); border-radius: 14px; background: var(--pearl); cursor: pointer; transition: border-color .3s, box-shadow .3s, transform .4s var(--ease); }
.tpl input { position: absolute; opacity: 0; pointer-events: none; }
.tpl:hover { transform: translateY(-2px); }
.tpl__img { display: block; overflow: hidden; margin-bottom: 8px; border-radius: 9px; aspect-ratio: 4 / 3; }
.tpl__img img, .tpl__img svg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; }
.tpl__name { font-family: var(--serif); font-size: 19px; font-weight: 500; color: var(--taupe); }
.tpl__desc { font-size: 12.5px; color: var(--taupe-2); }
.tpl:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, var(--shadow); }
.tpl:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }
.cab-template__img svg { width: 100%; aspect-ratio: 4 / 3; }

/* шрифт имён */
.fonts { display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); gap: 14px; margin-top: 14px; }
.font-opt {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 14px 10px 12px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--pearl);
  font-size: 12.5px;
  color: var(--taupe-2);
  cursor: pointer;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.font-opt__sample { font-size: 30px; line-height: 1.1; color: var(--taupe); }
.font-opt__sample--elegant { font-family: var(--serif); font-style: italic; font-weight: 500; }
.font-opt__sample--script { font-family: var(--script); }
.font-opt:has(input:checked) { border-color: var(--gold); background: rgba(234, 215, 174, .28); box-shadow: 0 0 0 1px var(--gold) inset; }
.font-opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 3px; }

/* программа дня */
.sched { display: grid; gap: 10px; margin-top: 22px; }
.sched__row { display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.sched__row .field { margin-top: 0; }
.sched__tools { display: flex; gap: 2px; padding-top: 10px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--taupe-2);
  cursor: pointer;
  transition: background .25s, color .25s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover:not(:disabled) { background: rgba(234, 215, 174, .35); color: var(--taupe); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn--danger:hover:not(:disabled) { color: var(--error); background: rgba(176, 96, 78, .08); }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--taupe);
  text-decoration: underline;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 5px;
  cursor: pointer;
  transition: text-decoration-color .3s, color .3s;
}
.link-btn svg { width: 20px; height: 20px; color: var(--gold); }
.link-btn:hover { text-decoration-color: var(--gold); }
.link-btn:disabled { opacity: .45; cursor: default; }

/* фото */
.photo { display: flex; gap: 28px; align-items: flex-start; margin-top: 24px; }
.photo__frame {
  --arch: 50% 50% 12px 12px / 37% 37% 12px 12px;
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 720 / 964;
  padding: 6px;
  border-radius: var(--arch);
  background: linear-gradient(180deg, #FFFDF8, #F8F0E3);
  box-shadow: var(--shadow);
}
.photo__frame::after { content: ""; position: absolute; inset: 3px; border: 1px solid var(--gold-line); border-radius: var(--arch); pointer-events: none; }
.photo__frame img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--arch); }
.photo__empty { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--taupe-2); }
.photo__actions { display: flex; flex-direction: column; align-items: flex-start; }
.photo__actions .link-btn { margin-top: 10px; }
.photo__upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo__upload:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.music-opt { margin-top: 30px; padding-top: 8px; border-top: 1px solid var(--line); }
.music-opt .link-btn { margin-left: 60px; margin-top: 6px; }

/* ответы гостей */
.answers-empty {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 30px;
  padding: 22px 24px;
  border: 1px dashed var(--field-border);
  border-radius: 16px;
  background: rgba(255, 253, 250, .6);
  font-size: 14px;
  color: var(--taupe-2);
}
.answers-empty svg { width: 34px; height: 34px; color: var(--gold); }
.answers-empty b { display: block; font-weight: 400; font-size: 15.5px; color: var(--taupe); }

.cab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.cab-actions .btn { min-height: 52px; }
.cab-actions .btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.cab-actions .btn--ghost:disabled::before { display: none; }
.cab-actions .btn--ghost:disabled:hover { color: var(--taupe); border-color: var(--gold-line); }

/* ---------- Предпросмотр ---------- */

.cab-preview {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--header-h));
  padding: 22px 28px 18px;
  background: var(--bg-2);
  border-left: 1px solid var(--line);
}
.cab-preview__head { display: flex; align-items: center; gap: 14px; }
.cab-preview__title { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--taupe); margin-right: auto; }
.cab-preview__close { display: none; }

.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: rgba(255, 253, 250, .7); border: 1px solid var(--line); }
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--taupe-2);
  cursor: pointer;
  transition: background .3s, color .3s, box-shadow .3s;
}
.seg button svg { width: 18px; height: 18px; }
.seg button[aria-pressed="true"] { background: var(--pearl); color: var(--taupe); box-shadow: 0 0 0 1px var(--gold-line), 0 6px 14px -8px rgba(122, 92, 52, .35); }

/* сцена: устройство масштабируется скриптом под свободное место (--s) */
.stage { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; margin-top: 16px; }
.device { position: relative; }
.device__screen { display: block; border: 0; background: var(--bg); transform-origin: 0 0; }

.device--phone {
  padding: 11px;
  border-radius: calc(54px * var(--s, 1));
  background: linear-gradient(145deg, #3A3532, #1E1B19 40%, #2C2826);
  box-shadow: 0 0 0 1.5px #5B534D, 0 40px 70px -30px rgba(60, 40, 20, .55);
}
/* «островок» камеры */
.device--phone::before {
  content: "";
  position: absolute;
  top: calc(11px + 12px * var(--s, 1));
  left: 50%;
  z-index: 2;
  width: calc(110px * var(--s, 1));
  height: calc(30px * var(--s, 1));
  translate: -50% 0;
  border-radius: 999px;
  background: #121010;
}
.device--desktop {
  padding: 30px 0 0;
  border-radius: 12px;
  background: #EFE6D9;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -30px rgba(60, 40, 20, .45);
  overflow: hidden;
}
/* три точки окна браузера */
.device--desktop::before {
  content: "";
  position: absolute;
  top: 11px;
  left: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D9C9B4;
  box-shadow: 14px 0 0 #D9C9B4, 28px 0 0 #D9C9B4;
}
.device__clip { overflow: hidden; }
.device--phone .device__clip { border-radius: calc(44px * var(--s, 1)); }

.cab-preview__replay { align-self: center; margin-top: 14px; font-size: 14px; }

/* ---------- Плавающая кнопка, уведомление, окно публикации ---------- */

.cab-fab { display: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 13px 22px;
  translate: -50% 0;
  border-radius: 999px;
  background: #5E4B40;
  color: #FFF8EC;
  font-size: 14px;
  box-shadow: 0 18px 40px -16px rgba(60, 40, 20, .55);
  animation: toast-in .5s var(--ease);
}
.toast.is-error { background: #9A4F40; }
@keyframes toast-in { from { opacity: 0; translate: -50% 14px; } }

.cab-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 40px 36px 30px;
  border: 0;
  border-radius: 24px;
  background: var(--pearl);
  color: var(--text);
  text-align: center;
  box-shadow: 0 50px 100px -40px rgba(60, 40, 20, .6);
}
.cab-dialog::backdrop { background: rgba(70, 55, 45, .4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* двойная золотая рамка, как у карточек приглашения */
.cab-dialog::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--gold-line); border-radius: 16px; pointer-events: none; }
.cab-dialog__close { position: absolute; top: 18px; right: 18px; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--taupe-2); cursor: pointer; }
.cab-dialog__close svg { width: 22px; height: 22px; }
.cab-dialog__eyebrow { font-family: var(--serif); font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.cab-dialog__title { margin-top: 6px; font-size: 32px; }
.cab-dialog__text { margin-top: 14px; font-size: 15px; }
.share { display: flex; gap: 10px; margin-top: 12px; }
.share__link {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--bg);
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--taupe);
}
.share .btn { min-height: 44px; }
.cab-dialog .link-btn { margin-top: 18px; }
.cab-dialog__note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.6; color: var(--taupe-2); }
.cab-dialog__note a, .cab-dialog__text a { color: var(--gold-3); }

/* вход и регистрация */
.auth { text-align: left; }
.auth .cab-dialog__eyebrow, .auth .cab-dialog__title, .auth .cab-dialog__text, .auth .cab-dialog__note { text-align: center; }
.auth__switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px auto 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.auth__switch button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--taupe-2);
  cursor: pointer;
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.auth__switch button[aria-pressed="true"] { background: #FFFDF9; color: var(--taupe); box-shadow: 0 4px 12px -6px rgba(120, 88, 40, .35); }
.auth__consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--taupe-2); cursor: pointer; }
.auth__consent input { flex: none; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gold); }
.auth__error { margin-top: 12px; font-size: 13px; color: var(--error); text-align: center; }
.auth__error:empty { display: none; }
.auth__submit { width: 100%; min-height: 50px; margin-top: 18px; }
.auth__submit:disabled, .cab-header .btn:disabled { opacity: .6; cursor: progress; }
.account__email { font-weight: 500; color: var(--taupe); word-break: break-all; }
.account__out { min-height: 46px; margin-top: 20px; padding: 0 34px; }

/* ---------- Ноутбук и планшет: предпросмотр открывается кнопкой ---------- */

@media (max-width: 1179px) {
  .cab { grid-template-columns: 230px minmax(0, 1fr); }
  .cab-preview {
    position: fixed;
    inset: 0;
    z-index: 60;
    height: auto;
    align-self: auto; /* иначе окно сжимается по содержимому, а не на весь экран */
    padding: 18px 18px 16px;
    border: 0;
    visibility: hidden;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .4s var(--ease), transform .5s var(--ease), visibility 0s .5s;
  }
  .cab-preview.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .4s var(--ease), transform .5s var(--ease); }
  .cab-preview__close { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 253, 250, .8); color: var(--taupe); cursor: pointer; }
  .cab-preview__close svg { width: 22px; height: 22px; }
  .cab-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 50;
    display: inline-flex;
    min-height: 52px;
    padding: 0 26px;
  }
  .cab-header__preview { display: none; }
  .cab-main { padding-bottom: 110px; }
}

/* ---------- Телефон: разделы — лентой сверху ---------- */

@media (max-width: 860px) {
  :root { --header-h: 62px; }
  .cab-header { gap: 10px; padding: 0 16px; }
  .cab-crumbs { display: none; }
  .cab-logo .logo__text small { display: none; }
  .cab { display: block; }
  .cab-side {
    position: sticky;
    top: var(--header-h);
    z-index: 30;
    height: auto;
    padding: 10px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(251, 247, 241, .95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    overflow: visible;
  }
  .cab-side__title, .cab-template { display: none; }
  .cab-tabs {
    flex-direction: row;
    gap: 6px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .cab-tabs::-webkit-scrollbar { display: none; }
  .cab-tab { flex: none; width: auto; gap: 8px; padding: 9px 14px; font-size: 14px; white-space: nowrap; scroll-snap-align: start; }
  .cab-tab svg { width: 18px; height: 18px; }
  .cab-tab.has-error::after { right: 4px; top: 8px; margin-top: 0; }
  .cab-main { padding: 26px 16px 110px; }
  .cab-fab { left: 50%; right: auto; translate: -50% 0; }
}

@media (max-width: 560px) {
  .cab-logo .logo__text { display: none; }
  /* статус переносится на две строки, а кнопка «Опубликовать» всегда видна целиком */
  .save-state { min-width: 0; }
  .save-state span { font-size: 12px; line-height: 1.3; white-space: normal; }
  .cab-header .btn { flex: none; padding: 0 16px; font-size: 13px; }
  /* у кнопки аккаунта — только значок */
  .cab-account { flex: none; width: 42px; padding: 0; justify-content: center; }
  .cab-account span { display: none; }
  .row { grid-template-columns: 1fr; gap: 0; }
  .sched__row { grid-template-columns: 96px minmax(0, 1fr); }
  .sched__tools { grid-column: 1 / -1; justify-content: flex-end; padding-top: 0; margin-top: -4px; }
  .photo { flex-direction: column; align-items: center; text-align: center; }
  .photo__actions { align-items: center; }
  .music-opt .link-btn { margin-left: 0; }
  .share { flex-direction: column; }
  .cab-dialog { padding: 36px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .001s !important; }
}
