/* Editors Haven — тёмная тема в стиле Edits : Helper, как у EH : Events Hub. Цвета темы Telegram намеренно не используются. */
:root {
  --bg: #000;
  --surface: #0b0b0b;
  --surface-2: #0d0d0d;
  --tile: #141414;

  --line: #1a1a1a;
  --line-row: #1c1c1c;
  --line-strip: #1f1f1f;
  --line-btn: #262626;
  --line-chip: #2a2a2a;
  --line-strong: #333;

  --text: #fff;
  --text-2: #bfbfbf;
  --muted: #8f8f8f;
  --faint: #8a8a8a;
  --index: #5a5a5a;

  --green: #4ade80;
  --green-text: #6ff59c;
  --green-glow: 0 0 10px rgba(74, 222, 128, .6);
  --red: #ff3b30;
  --red-text: #ff5a50;

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: 16px;
  --gap: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { background: var(--bg); color: var(--text); }
body {
  font: 400 15px/1.4 var(--f-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button, input, textarea { font: inherit; color: inherit; background: none; border: 0; outline: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ic--chevron { width: 18px; height: 18px; color: var(--index); }

/* ---------- каркас ---------- */
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
.screen {
  display: flex; flex-direction: column; gap: var(--gap);
  padding: 12px var(--pad) calc(40px + env(safe-area-inset-bottom));
}
/* Уходящий экран на время анимации перехода: остаётся на месте поверх, пока уезжает (см. showScreen) */
.screen.is-leaving {
  position: fixed; left: 0; right: 0; z-index: 5; width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--bg); pointer-events: none;
}

.block { display: flex; flex-direction: column; gap: 12px; }
.list { display: flex; flex-direction: column; gap: 8px; }

/* ---------- шапки ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.topbar--back { justify-content: flex-start; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; background: #fff; color: #000;
}
.brand__mark .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.brand__name { font: 600 16px var(--f-display); letter-spacing: -.01em; }

.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  border: 1px solid var(--line-btn);
  display: grid; place-items: center;
}
.icon-btn:active { background: var(--surface); border-color: var(--line-strong); }

.kicker { font: 500 12px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

.section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 24px; font: 500 15px var(--f-display);
}

.mono-meta {
  font: 500 11px/1.5 var(--f-mono); color: var(--faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- заголовок экрана ---------- */
.v-head { display: flex; flex-direction: column; gap: 10px; }
.v-title { font: 700 28px/1.06 var(--f-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.v-text { color: var(--text-2); font-size: 14px; line-height: 1.55; }

.chip-mono {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-chip);
  font: 500 11px var(--f-mono); color: var(--text-2);
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); box-shadow: var(--green-glow);
  animation: pulse 2.4s ease-in-out infinite;
}
.live-dot.is-off { background: #5a5a5a; box-shadow: none; animation: none; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- строки ---------- */
.row {
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line-row);
  text-align: left; width: 100%;
  transition: background .15s, border-color .15s;
}
.row:active { background: var(--surface-2); border-color: var(--line-strong); }
.row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font: 500 15px/1.3 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  background: #fff; color: #000; display: grid; place-items: center;
}
.thumb .ic { width: 20px; height: 20px; stroke-width: 2.2; }

/* ---------- панели, поля и кнопки ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line-row); border-radius: 16px;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field__input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px;
  background: #000; border: 1px solid var(--line-row); font-size: 16px; transition: border-color .15s;
}
.field__input:focus { border-color: var(--line-strong); }
.field__input::placeholder { color: #6f6f6f; }

/* Добавленная ссылка: белый значок слева, как строка на карточке, справа — убрать */
.link-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 6px 8px 8px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line-row);
}
.link-row__icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: #fff; color: #000; display: grid; place-items: center;
}
.link-row__icon .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.link-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.link-row__remove {
  width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; color: var(--index);
}
.link-row__remove .ic { width: 18px; height: 18px; }
.link-row__remove:active { background: var(--surface-2); color: var(--red-text); }

/* Порядок ссылок: ручка слева; перетаскиваемая строка приподнята над остальными, соседние плавно расступаются.
   touch-action: none — иначе палец на ручке прокручивал бы страницу вместо перетаскивания */
.link-row:has(.link-row__grip) { padding-left: 2px; }
.link-row__grip {
  width: 28px; height: 40px; flex: none; margin-right: -6px; border-radius: 10px;
  display: grid; place-items: center; color: var(--index); touch-action: none; cursor: grab;
}
.link-row__grip .ic { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.link-row__grip:active, .link-row.is-dragging .link-row__grip { color: var(--text); }
.link-row.is-dragging {
  position: relative; z-index: 2; cursor: grabbing;
  background: var(--surface-2); border-color: var(--line-strong); box-shadow: 0 12px 32px rgba(0, 0, 0, .65);
}
.is-sorting { user-select: none; -webkit-user-select: none; }
.is-sorting .link-row:not(.is-dragging) { transition: transform .2s cubic-bezier(.3, .7, .2, 1); }

/* Разделитель в списке: вместо подписей — поле для текста */
.link-row__input {
  width: 100%; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px;
  background: #000; border: 1px solid var(--line-row); font-size: 16px; transition: border-color .15s;
}
.link-row__input:focus { border-color: var(--line-strong); }
.link-row__input::placeholder { color: #5f5f5f; }
.link-row.is-divider .link-row__icon { background: transparent; color: var(--text-2); border: 1px dashed var(--line-strong); }
/* Разделитель в превью — как на сайте: подпись по центру, по бокам линии */
.cp__divider {
  display: flex; align-items: center; gap: 10px; padding: 6px 4px 2px;
  font: 500 10px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
}
.cp__divider::before, .cp__divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .16); }
.cp__divider span { max-width: 75%; text-align: center; overflow-wrap: anywhere; }
.cp__divider.is-placeholder { color: var(--index); }

/* Поле новой ссылки — появляется по «+» */
.link-add {
  display: flex; align-items: center; gap: 10px;
  height: 60px; padding: 0 8px 0 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line-strong); transition: border-color .15s;
}
.link-add.is-error { border-color: rgba(255, 59, 48, .55); }
/* 16px — меньше iOS при фокусе приближает страницу и сдвигает её вбок */
.link-add input { flex: 1; min-width: 0; height: 100%; font-size: 16px; }
.link-add input::placeholder { color: #6f6f6f; }
.round-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  border: 1px solid var(--line-strong); display: grid; place-items: center;
  transition: opacity .15s, transform .12s;
}
.round-btn .ic { width: 20px; height: 20px; }
.round-btn--solid { background: #fff; color: #000; border-color: #fff; }
.round-btn--solid .ic { stroke-width: 2.4; }
.round-btn:active { transform: scale(.94); }
.round-btn:disabled { opacity: .4; cursor: default; }
.round-btn.is-busy { opacity: .6; cursor: progress; }

/* «+» — пунктиром, как пустой список */
.add-btn {
  height: 56px; width: 100%; border-radius: 16px; border: 1px dashed var(--line-strong);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--f-body); color: var(--text-2); transition: transform .12s, background .15s, color .15s;
}
.add-btn .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.add-btn:active { transform: scale(.98); background: var(--surface); color: var(--text); }
.add-btn:disabled { opacity: .4; cursor: default; }

/* Фото страницы: кружок с превью и кнопки */
.photo-edit { display: flex; align-items: center; gap: 16px; }
.photo-edit__preview {
  width: 72px; height: 72px; flex: none; border-radius: 50%; overflow: hidden;
  border: 1px dashed var(--line-strong); display: grid; place-items: center; color: var(--index);
}
.photo-edit__preview.has-photo { border-style: solid; }
.photo-edit__preview.is-busy { opacity: .5; }
.photo-edit__preview .ic { width: 28px; height: 28px; }
.photo-edit__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-edit__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.photo-edit__actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip-btn {
  position: relative; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--f-body); cursor: pointer;
  transition: transform .12s, background .15s;
}
.chip-btn .ic { width: 16px; height: 16px; }
.chip-btn:active { transform: scale(.96); background: var(--surface-2); }
.chip-btn:focus-within { outline: 2px solid #fff; outline-offset: 2px; }
.chip-btn--danger { color: var(--red-text); border-color: rgba(255, 59, 48, .4); }

/* Поле имени в ссылке: адрес сайта — неизменяемой подписью перед полем */
.link-input {
  display: flex; align-items: center;
  height: 60px; padding: 0 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line-row);
  transition: border-color .15s;
}
.link-input:focus-within { border-color: var(--line-strong); }
.link-input.is-error { border-color: rgba(255, 59, 48, .55); }
.link-input.is-ok { border-color: rgba(74, 222, 128, .45); }
.link-input__prefix { font: 500 14px var(--f-mono); color: var(--muted); white-space: nowrap; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.link-input input { flex: 1; min-width: 0; height: 100%; font: 500 16px var(--f-mono); }
.link-input input::placeholder { color: #5f5f5f; }

.hint { font: 500 11px/1.5 var(--f-mono); color: #7a7a7a; padding: 0 4px; letter-spacing: .02em; }
.hint.is-error { color: var(--red-text); }
.hint.is-ok { color: var(--green-text); }

/* Галочка согласия */
.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  width: 24px; height: 24px; flex: none; margin-top: 1px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: #000; color: transparent;
  display: grid; place-items: center; transition: background .15s, border-color .15s, color .15s;
}
.check__box .ic { width: 16px; height: 16px; stroke-width: 3; }
.check input:checked + .check__box { background: #fff; border-color: #fff; color: #000; }
.check input:focus-visible + .check__box { outline: 2px solid #fff; outline-offset: 2px; }
.check__text { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.check__text b { color: var(--text); font-weight: 500; }

.btn-primary {
  height: 56px; width: 100%; border-radius: 16px; background: #fff; color: #000;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--f-body); transition: transform .12s, opacity .15s;
}
.btn-primary .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: default; }
.btn-primary.is-busy { opacity: .6; cursor: progress; }

.btn-ghost {
  height: 52px; width: 100%; border-radius: 16px; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--f-body); transition: transform .12s, background .15s;
}
.btn-ghost .ic { width: 20px; height: 20px; }
.btn-ghost:active { transform: scale(.98); background: var(--surface-2); }
.btn-ghost:disabled { opacity: .5; cursor: progress; }
.btn-ghost--danger { color: var(--red-text); border-color: rgba(255, 59, 48, .4); }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* ---------- карточка Creator Page (вариант B «Карточка-профиль») — та же, что на сайте ---------- */
.cp {
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 16px 16px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-row);
}
.cp__who { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-bottom: 4px; text-align: center; min-width: 0; }
.cp__ring {
  width: 76px; height: 76px; border-radius: 50%; padding: 3px; margin-bottom: 2px;
  background: conic-gradient(from 210deg, #fff, #3a3a3a, #fff); box-shadow: 0 0 24px rgba(255, 255, 255, .12);
}
.cp__avatar {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #000;
  display: grid; place-items: center; color: var(--muted);
}
.cp__avatar .ic { width: 30px; height: 30px; }
.cp__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp__name { font: 700 18px/1.2 var(--f-display); letter-spacing: -.01em; overflow-wrap: anywhere; max-width: 100%; }
.cp__name.is-placeholder { color: var(--index); }
.cp__url { font: 500 11px var(--f-mono); color: var(--faint); overflow-wrap: anywhere; max-width: 100%; }
.cp__links { display: flex; flex-direction: column; gap: 6px; }
.cp__link {
  display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 6px 14px 6px 8px;
  border-radius: 14px; background: #000; border: 1px solid var(--line-strip);
}
.cp__icon { width: 34px; height: 34px; flex: none; border-radius: 10px; background: #fff; color: #000; display: grid; place-items: center; }
.cp__icon .ic { width: 16px; height: 16px; stroke-width: 2.2; }
.cp__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.cp__label { font: 600 14px var(--f-body); }
.cp__handle { font: 500 10px var(--f-mono); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp__arrow { width: 16px; height: 16px; color: var(--index); }
.cp__empty {
  padding: 16px; text-align: center; color: var(--faint); font-size: 13px;
  border: 1px dashed var(--line-btn); border-radius: 14px;
}

/* Сцена превью: как страница на сайте — фон эдитора за карточкой (--bg-image задаёт renderPreview) */
.cp-stage {
  padding: 22px 14px; border-radius: 22px; border: 1px solid var(--line-row);
  background: radial-gradient(ellipse 70% 40% at 50% 20%, rgba(255, 255, 255, .06), transparent 70%) no-repeat, #000;
}
/* Стекло (только с фоном), как на сайте (app/api/templates/creator_page.html): полупрозрачная, фон размыт */
.cp.is-glass {
  position: relative;
  background: rgba(14, 14, 14, .42); border-color: rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 40px rgba(0, 0, 0, .45);
}
.cp.is-glass .cp__link { background: rgba(0, 0, 0, .35); border-color: rgba(255, 255, 255, .08); }
.cp-stage.has-bg :is(.cp__url, .cp__handle) { color: var(--text-2); }
/* Рамка в цветах фона: ::before, вырезанный маской по краю, — середина карточки остаётся стеклянной */
.cp.has-accent {
  border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 14px 40px rgba(0, 0, 0, .45), 0 0 30px -8px var(--accent-2);
}
/* Кольцо аватарки — тот же градиент, что и рамка карточки */
.cp.has-accent .cp__ring {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 24px -4px var(--accent-2);
}
.cp.has-accent::before {
  content: ""; position: absolute; inset: -1px; padding: 2px; border-radius: 23px; pointer-events: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

/* Панель в превью — стекло или цвет, как на сайте (.is-glass / .is-color в creator_page.html) */
.cp.is-color { position: relative; background: var(--panel, var(--surface)); }
.cp.is-color .cp__link { background: rgba(0, 0, 0, .35); border-color: rgba(255, 255, 255, .08); }
/* Размытие фона в превью: фон — отдельным слоем, чтобы размывался только он, а не карточка */
.cp-stage { position: relative; overflow: hidden; isolation: isolate; }
.cp-stage.has-bg { background: #000; }
.cp-stage.has-bg::before {
  content: ""; position: absolute; inset: calc(var(--bg-blur, 0px) * -2); z-index: -1;
  background: var(--bg-image) center / cover no-repeat, #000;
  filter: blur(var(--bg-blur, 0px));
}

/* Ползунок размытия */
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { flex: 1; min-width: 0; height: 28px; accent-color: #fff; }
.range-row__value { width: 40px; text-align: right; font: 500 12px var(--f-mono); color: var(--text-2); }

/* Переключатель «Стекло / Цвет»: белая капсула под выбранным, как в EH : Events Hub */
.seg {
  position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px;
  background: #000; border: 1px solid var(--line-chip); border-radius: 12px;
}
.seg button {
  position: relative; z-index: 1; height: 38px; border-radius: 9px;
  font: 500 12px var(--f-mono); color: var(--muted); transition: color .25s .1s;
}
.seg button[aria-checked="true"] { color: #000; font-weight: 600; }
.seg button:disabled { opacity: .4; cursor: default; }
.seg__pill {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 2);
  border-radius: 9px; background: #fff; box-shadow: 0 0 18px rgba(255, 255, 255, .22);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .35s cubic-bezier(.3, .7, .2, 1);
  pointer-events: none;
}

/* Цвета панели: кружки и свой цвет */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2); display: grid; place-items: center;
}
.swatch[aria-checked="true"] { outline: 2px solid #fff; outline-offset: 3px; }
.swatch--custom { background: conic-gradient(#f43f5e, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #f43f5e); cursor: pointer; }
.swatch--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch--custom .ic { width: 16px; height: 16px; color: #fff; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8)); }

/* Фон страницы в редакторе: миниатюра и три цвета рамки */
.bg-edit { display: flex; align-items: center; gap: 16px; }
.bg-edit__preview {
  width: 72px; height: 96px; flex: none; border-radius: 14px; overflow: hidden;
  border: 1px dashed var(--line-strong); display: grid; place-items: center; text-align: center;
  background: #000 center / cover no-repeat;
}
.bg-edit__preview .mono-meta { white-space: normal; padding: 0 6px; }
.bg-edit__preview.has-bg { border-style: solid; }
.bg-edit__preview.has-bg .mono-meta { display: none; }
.bg-edit__preview.is-busy { opacity: .5; }
.accent-dots { display: flex; gap: 6px; margin-top: 6px; }
.accent-dots span { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); }

/* Опубликованная ссылка */
.published-link {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 14px; border-radius: 14px;
  background: #000; border: 1px solid rgba(74, 222, 128, .35);
  font: 500 13px var(--f-mono); color: var(--text); overflow-wrap: anywhere;
}
.published-link .live-dot { flex: none; }

/* ---------- карточка поверх экрана ---------- */
/* Затемнённый фон с размытием и карточка снизу, как в EH : Events Hub; .is-open включает появление (showSheet в app.js) */
.sheet {
  position: fixed; inset: 0; z-index: 30;
  display: flex; align-items: flex-end; justify-content: center;
  padding: var(--pad) var(--pad) calc(var(--pad) + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .25s;
}
.sheet.is-open { opacity: 1; }
.sheet__card {
  position: relative; width: 100%; max-width: calc(480px - 2 * var(--pad));
  max-height: calc(100vh - 2 * var(--pad) - env(safe-area-inset-bottom)); overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 24px 20px 20px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--line-chip);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .6);
  transform: translateY(24px) scale(.98); transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
.sheet__card > * { flex-shrink: 0; }
.sheet.is-open .sheet__card { transform: none; }
.sheet__close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; color: var(--muted);
}
.sheet__close .ic { width: 20px; height: 20px; }
.sheet__title { font: 700 22px/1.15 var(--f-display); letter-spacing: -.02em; }
.sheet__text { color: var(--text-2); font-size: 14px; line-height: 1.5; }
.sheet__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sheet__actions .btn-primary { height: 52px; }

/* ---------- обрезка фото ---------- */
/* Квадрат с картинкой; всё, что за кругом, затемнено — так видно, что попадёт на страницу */
.crop {
  position: relative; width: 100%; max-width: 320px; aspect-ratio: 1; margin: 0 auto;
  border-radius: 20px; overflow: hidden; background: #000;
  touch-action: none; user-select: none; cursor: grab;
}
.crop.is-dragging { cursor: grabbing; }
.crop__img {
  position: absolute; left: 50%; top: 50%; max-width: none; transform-origin: center;
  pointer-events: none; -webkit-user-drag: none;
}
.crop__ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .6); border: 1px solid rgba(255, 255, 255, .5);
}
.crop__zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.crop__zoom .ic { width: 18px; height: 18px; }
.crop__zoom input { flex: 1; min-width: 0; accent-color: #fff; height: 28px; }

/* ---------- тост ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 12px; background: #fff; color: #000; font: 500 13px var(--f-body);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
