/* Ральф: рабочее место исполнителя.
   26.09.2026, ночь: новый вид кабинета. На телефоне боковая панель — выезжающий ящик по кнопке
   «Заказы» в верхней полосе. Разбор — docs/НОЧЬ_2026-09-26/03_ДИЗАЙН_И_ТЕЛЕФОН.md.
   27.09.2026, владелец выбрал новый вид (холст «Ральф — новый дизайн»): почти чёрный с фиолетовым
   отливом фон, главная кнопка — градиент коралл -> малина, фиолетовый — выбранное и ссылки,
   бирюза — «в работе» и подсказки, лайм — «готово», красный — ошибка. Знак — чёрный кот на
   «сиянии» (favicon.svg), название латиницей «ralf», заголовки шрифтом Unbounded. */
:root {
  --bg: #0C0B10;
  --bg2: #110F17;
  --panel: #16141D;
  --panel2: #201D2A;
  --panel3: #2A2636;
  --line: #2C2839;
  --line2: #3A3549;
  --ink: #F3EFF8;
  --ink2: #C9C2D8;
  --muted: #9A93AD;
  --accent: #8B6CFF;
  --accent2: #B7A6FF;
  --accent-ink: #0F0A1F;
  --accent-bg: rgba(139, 108, 255, .14);
  --accent-line: rgba(139, 108, 255, .5);
  --brand: #FF6A3D;
  --brand-2: #FF3D8B;
  /* 27.09, владелец: белые буквы на главной кнопке. Градиент на тон глубже бренда, иначе белый
     на светлом коралле не читается (контраст был бы 2.9, стал около 4) */
  --cta: linear-gradient(100deg, #F0582F, #E8307A);
  --cta-ink: #FFFFFF;
  --aurora: linear-gradient(135deg, #FF6A3D, #8B6CFF 50%, #2DD4E8);
  --ok: #C8F545;
  --ok-bg: rgba(200, 245, 69, .11);
  --warn: #FFC53D;
  --warn-bg: rgba(255, 197, 61, .12);
  --bad: #FF6F87;
  --bad-bg: rgba(255, 77, 106, .12);
  --info: #2DD4E8;
  --info-bg: rgba(45, 212, 232, .12);
  --fg: var(--ink);
  --display: "Unbounded", "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --radius-s: 9px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px -12px rgba(0,0,0,.6);
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --font: "Golos Text", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --btn-h: 34px;
  --btn-h-s: 28px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px;
  line-height: 1.55; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 0; }
::selection { background: rgba(139, 108, 255, .35); color: var(--ink); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
h1 { font-size: 20px; line-height: 1.3; }
h2 { font-size: 17px; line-height: 1.35; }
h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
p { margin: 0 0 8px; }
a { color: var(--accent2); }
.muted { color: var(--muted); } .tiny { font-size: 12.5px; } .small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.err { color: var(--bad); min-height: 1em; margin: 6px 0 0; font-size: 13px; }
.err:empty { margin: 0; }
.spacer { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink2); margin-bottom: 14px; font-weight: 500; }

/* полосы прокрутки: тонкие, в цвет темы */
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ── поля ввода ─────────────────────────────────────────────────────────── */
input, select, textarea {
  font: inherit; font-weight: 400; color: var(--ink); background: var(--bg2); border: 1px solid var(--line2);
  border-radius: var(--radius-s); padding: 8px 11px; outline: none; width: 100%;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: #6E6784; }
input:hover, select:hover, textarea:hover { border-color: #3F3A52; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139, 108, 255, .18); background: var(--bg); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
textarea { resize: vertical; line-height: 1.5; }
select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input[type="file"] { padding: 6px; font-size: 13px; }

/* ── кнопки ─────────────────────────────────────────────────────────────── */
.btn {
  font: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2; color: var(--ink);
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-s); padding: 0 14px; min-height: var(--btn-h); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center;
  text-decoration: none; white-space: normal;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .06s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { background: var(--panel3); border-color: #464060; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .tab:focus-visible, .stage:focus-visible, .mood:focus-visible, .style-card:focus-visible,
.welcome-card:focus-visible, .order-item:focus-visible, .order-del:focus-visible, .lb-btn:focus-visible,
.chip button:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--ring); }
/* главная: одна на экран, градиент коралл -> малина, тёмный текст (контраст выше белого) */
.btn.primary { background: var(--cta); border-color: transparent; text-shadow: 0 1px 2px rgba(80, 10, 30, .35);
  color: var(--cta-ink); font-weight: 700; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 22px -10px rgba(255, 61, 139, .75); }
.btn.primary:hover { background: var(--cta); border-color: transparent; filter: brightness(1.08) saturate(1.05); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 12px 28px -10px rgba(255, 61, 139, .9); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.ghost:hover { background: var(--panel2); color: var(--ink); }
.btn.small { padding: 0 10px; font-size: 12.5px; min-height: var(--btn-h-s); }
.btn.wide { width: 100%; display: flex; }
.btn[disabled], .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
label.btn { flex-direction: row; margin: 0; color: var(--ink2); }
label.btn:hover { color: var(--ink); }
.ico { width: 16px; height: 16px; flex: none; display: block; }

/* ── бренд ──────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 4px 14px; }
/* знак — чёрный кот на «сиянии», тот же файл, что значок вкладки */
.brand::before { content: ""; width: 30px; height: 30px; flex: none; margin: -3px -2px -3px -3px;
  background: url("favicon.svg") center / contain no-repeat; filter: drop-shadow(0 4px 10px rgba(139, 108, 255, .35)); }
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; font-size: 17px; line-height: 1; color: var(--ink); }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; }
.brand.big { justify-content: center; flex-direction: column; gap: 8px; padding: 6px 0 8px; }
.brand.big::before { width: 56px; height: 56px; margin: 0; }
.brand.big .brand-name { font-size: 28px; }

/* ── вход ───────────────────────────────────────────────────────────────── */
/* 27.09: «северное сияние» — три медленных пятна цветов бренда за карточкой. Клиенту, который
   пришёл сам, слева крупно: «Увидьте себя героем мультика» и фото -> два стиля (#loginHero). */
.login { position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center; gap: 64px; flex-wrap: wrap;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg); }
.login::before { content: ""; position: absolute; inset: -20%; z-index: -1; pointer-events: none; filter: blur(60px); opacity: .55;
  background:
    radial-gradient(34% 30% at 22% 18%, rgba(255, 106, 61, .55), transparent 70%),
    radial-gradient(38% 34% at 78% 26%, rgba(139, 108, 255, .6), transparent 70%),
    radial-gradient(40% 30% at 55% 92%, rgba(45, 212, 232, .38), transparent 70%);
  animation: aurora 26s ease-in-out infinite alternate; }
@keyframes aurora { 0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) rotate(8deg) scale(1.06); } 100% { transform: translate3d(-2%, 3%, 0) rotate(-6deg) scale(1.02); } }
.login-hero { max-width: 520px; display: flex; flex-direction: column; gap: 18px; }
.hero-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ok); background: var(--ok-bg); border: 1px solid rgba(200, 245, 69, .25); }
.hero-pill .ico { width: 16px; height: 16px; }
.hero-title { font-family: var(--display); font-weight: 800; font-size: clamp(30px, 4.6vw, 52px); line-height: 1.06; letter-spacing: -0.02em; margin: 0; }
.hero-title em { font-style: normal; display: block; background: linear-gradient(95deg, #FF8A5C, #FF3D8B 45%, #8B6CFF 80%, #2DD4E8);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-strip { display: grid; grid-template-columns: 1fr auto 1fr 1fr; align-items: center; gap: 12px; margin-top: 6px; }
.hero-strip figure { margin: 0; position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4;
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); background: var(--panel2); }
.hero-strip figure.hero-was { transform: rotate(-3deg); }
.hero-strip figure:nth-of-type(3) { transform: rotate(2.5deg) translateY(6px); }
.hero-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-strip figcaption { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; font-weight: 600; color: #fff;
  background: rgba(12, 11, 16, .7); border-radius: 7px; padding: 2px 8px; }
.hero-arrow { width: 26px; height: 26px; color: var(--accent2); }
.login-card { width: 100%; max-width: 410px; background: rgba(22,20,29,.82); border: 1px solid var(--line2);
  border-radius: 22px; padding: 28px 28px 20px; box-shadow: 0 40px 90px -30px rgba(0,0,0,.85), 0 1px 0 rgba(255,255,255,.05) inset;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
@media (max-width: 960px) {
  .login { flex-direction: column; gap: 22px; justify-content: flex-start; }
  .login-hero { align-items: center; text-align: center; max-width: 440px; gap: 12px; }
  .hero-pill { align-self: center; }
  .hero-strip { max-width: 360px; width: 100%; gap: 8px; }
}
/* телефон: заголовок и картинки компактнее, чтобы поле почты и кнопка были видны без прокрутки */
@media (max-width: 480px) {
  .login { gap: 14px; padding-top: calc(14px + env(safe-area-inset-top)); }
  .login-hero { gap: 10px; }
  .hero-pill { font-size: 12px; padding: 4px 12px 4px 9px; }
  .hero-title { font-size: 25px; }
  .hero-strip { max-width: 250px; }
  .hero-strip figure { border-radius: 12px; }
  .hero-strip figcaption { font-size: 10.5px; left: 5px; bottom: 5px; }
  .hero-arrow { width: 18px; height: 18px; }
  .login-card .brand.big { flex-direction: row; gap: 10px; padding: 0 0 4px; }
  .login-card .brand.big::before { width: 36px; height: 36px; }
  .login-card .brand.big .brand-name { font-size: 22px; }
  .login-card > .muted { font-size: 13.5px; margin: 2px 0 14px; }
}
@media (prefers-reduced-motion: reduce) { .login::before { animation: none; } }
.login-card > .muted { text-align: center; margin: 4px 0 18px; }
.login-card .tiny.muted { font-size: 12px; line-height: 1.5; }
.login-card > p.tiny:last-child { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); text-align: center; }
.login-card label { margin-bottom: 12px; }
.login-card .btn.wide { min-height: 42px; margin-bottom: 10px; }
.login-card input { min-height: 42px; }
#loginKeyInput { font-family: var(--mono); letter-spacing: .01em; }
.login-tabs { display: flex; gap: 4px; margin: 0 0 18px; padding: 3px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; }
.login-tabs .tab { flex: 1; border: none; border-radius: 7px; margin: 0; padding: 7px 10px; }
.login-tabs .tab.active { background: var(--panel3); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.4); }
/* 28.09: согласие при вводе кода, кнопка Google, подпись «или почтой» */
label.consent { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 12.5px; line-height: 1.45; color: var(--ink2); }
label.consent input { width: 18px; height: 18px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
label.consent a { color: var(--accent2); }
.google-btn { display: flex; justify-content: center; min-height: 40px; margin-bottom: 8px; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; text-align: center; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#signupNote { text-align: center; margin: -2px 0 10px; }
/* 28.09: окно пополнения */
.topup-card { max-width: 520px; }
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 16px; }
.pack { font: inherit; color: var(--ink); background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius); padding: 14px 10px; cursor: pointer; text-align: center;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .06s; }
.pack:hover { border-color: var(--accent-line); background: var(--panel3); }
.pack:active { transform: translateY(1px); }
.pack b { display: block; font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pack span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.custom-row { align-items: flex-end; flex-wrap: nowrap; }
.custom-row label { margin-bottom: 0; }
.custom-row .grow { flex: 1; min-width: 0; }
.custom-row .btn { min-height: 38px; flex: none; }
.promo { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.promo summary { cursor: pointer; color: var(--ink2); font-size: 13px; }
.promo .custom-row { margin-top: 10px; }
/* 27.09, рефералы: «Пригласите друга» в окне пополнения. Второй цвет кнопки (бирюза) — чтобы
   необязательное действие не спорило с оранжевой «Оплатить». */
.btn.accent { background: var(--info-bg); border-color: transparent; color: var(--info); }
.btn.accent:hover { background: rgba(45, 212, 232, .22); color: var(--ink); }
.invite { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.invite h3 { margin: 0 0 6px; color: var(--info); }
.invite input[readonly] { font-family: "JetBrains Mono", monospace; font-size: 12.5px; }
.invite .custom-row { margin-top: 8px; }
.side-foot #topupBtn { grid-column: 1 / -1; }
@media (max-width: 480px) { .packs { grid-template-columns: 1fr; } }

/* ── оболочка ───────────────────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.m-bar, .side-backdrop, .m-dock { display: none; }
/* поле выбора фото нижней панели: не display: none (старый Safari не открывает такое), а невидимое */
.m-dock-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.side { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px 12px; gap: 8px; min-height: 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-close { display: none; }
/* 🔴 24.09: номер кабинета. Стоит под названием в боковой панели и на экране входа —
   человек должен видеть, В ЧЬЁМ кабинете он сидит, не читая мелкую почту внизу. */
.cabinet-badge { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: -4px 4px 8px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--panel); color: var(--ink2);
  font-size: 12px; font-weight: 500; letter-spacing: 0.03em; }
.cabinet-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.login .cabinet-badge { display: flex; justify-content: center; margin: 0 auto 14px; width: fit-content; }
.side #newOrderBtn { min-height: 38px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 14px 8px 4px; font-weight: 600; }
.orders { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.order-item { flex: none; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 9px 30px 9px 12px; border-radius: 8px;
  cursor: pointer; border: 1px solid transparent; background: none; font: inherit; color: inherit; text-align: left; width: 100%;
  transition: background .12s var(--ease), border-color .12s var(--ease); }
.order-item::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: transparent; transition: background .15s; }
.order-item:hover { background: var(--panel); }
.order-item.active { background: var(--panel2); border-color: var(--line2); }
.order-item.active::before { background: var(--accent); }
/* Крестик «убрать» появляется на наведении: в спокойном списке он не мозолит глаза,
   а случайно попасть по нему мимо заказа трудно — он в своём углу и требует подтверждения. */
.order-del { position: absolute; top: 6px; right: 5px; width: 24px; height: 24px; line-height: 1;
  border: none; border-radius: 6px; background: none; color: var(--muted); font-size: 16px; font-family: var(--font);
  cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; display: grid; place-items: center; }
.order-item:hover .order-del, .order-del:focus-visible, .order-item.active .order-del { opacity: 1; }
.order-del:hover { background: var(--panel3); color: var(--ink); }
.order-del:disabled { opacity: .4; cursor: default; }
.order-item .oid { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.order-item .ometa { grid-column: 1 / -1; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* своё имя заказа вместо номера, номер уходит во вторую строку */
.order-item .oname { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-item .ometa .oid { font-size: 11.5px; color: var(--muted); }
/* состояние заказа словами: на компьютере его говорит точка с подсказкой, на телефоне
   подсказки не бывает — там строка видна (см. блок телефона) */
.order-item .ostatus { display: none; grid-column: 1 / -1; font-size: 12px; color: var(--ink2); }
.order-item .ostatus.working { color: var(--warn); }
.order-item .ostatus.review { color: var(--info); }
.order-item .ostatus.ready { color: var(--ok); }
.order-item .ostatus.failed { color: var(--bad); }
.order-item.dragging { opacity: .45; }
.orders.over { outline: 1px dashed var(--line2); border-radius: 8px; }
.orders .btn.wide { margin-top: 6px; }
/* имя заказа в шапке: заголовок превращается в поле */
.title-row { align-items: center; gap: 8px; }
.title-row h1 { margin: 0; cursor: text; }
input.rename-order { font-size: 19px; font-weight: 600; min-width: 320px; padding: 4px 8px; }
/* папка заказа в шапке: видно, куда всё ложится */
.folder-line { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.folder-line #folderPath { max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); }
.folder-line #folderPath.muted { background: none; border-color: transparent; padding-left: 0; }
input.folder-input { font-family: var(--mono); font-size: 12px; min-width: 380px; padding: 4px 8px; }
#folderNote { max-width: 640px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; background: var(--line2); }
.dot.working { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); animation: pulse 1.4s infinite; }
.dot.review { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); }
.dot.ready { background: var(--ok); }
.dot.failed { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--warn-bg); } 50% { box-shadow: 0 0 0 5px var(--warn-bg); } }
.side-foot { border-top: 1px solid var(--line); padding: 10px 4px 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; }
.side-foot #userEmail { grid-column: 1 / -1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.side-foot #helpBtn { grid-column: 1 / -1; justify-content: flex-start; }
.side-foot #helpBtn::before { content: ""; width: 15px; height: 15px; flex: none; background: currentColor; opacity: .8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5V5a2 2 0 0 1 2-2h13v16H6.5A2.5 2.5 0 0 0 4 21.5v-2z'/%3E%3Cpath d='M8 7h7M8 11h5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5V5a2 2 0 0 1 2-2h13v16H6.5A2.5 2.5 0 0 0 4 21.5v-2z'/%3E%3Cpath d='M8 7h7M8 11h5'/%3E%3C/svg%3E") center / contain no-repeat; }
/* 28.09, владелец: «сделай порядок» — «Вопросы и поддержка» в одну линию с «Памяткой», со значком */
.side-foot #supportBtn { grid-column: 1 / -1; justify-content: flex-start; }
.side-foot #supportBtn::before { content: ""; width: 15px; height: 15px; flex: none; background: currentColor; opacity: .8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.6A8 8 0 1 1 21 12z'/%3E%3Cpath d='M9 10h6M9 14h4'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20.5l1.4-4.6A8 8 0 1 1 21 12z'/%3E%3Cpath d='M9 10h6M9 14h4'/%3E%3C/svg%3E") center / contain no-repeat; }
.side-foot #userEmail { padding-left: 10px; }
.balance { font-size: 13px; color: var(--ink2); padding-left: 10px; }
.balance b { color: var(--ink); font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); font-size: 13px; padding: 14px 10px; border: 1px dashed var(--line2); border-radius: 8px; text-align: center; }

/* ── рабочая зона ───────────────────────────────────────────────────────── */
.work { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; height: 100vh; height: 100dvh; }
.work-head { display: flex; align-items: flex-start; gap: 18px; padding: 18px 28px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent); }
.work-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
#workMeta { font-size: 12px; letter-spacing: .01em; }
.phases { display: flex; gap: 6px; margin-left: 8px; }
.phase { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line2); color: var(--muted); }
.phase.done { color: var(--ok); border-color: transparent; background: var(--ok-bg); }
.phase.now { color: var(--accent2); border-color: transparent; background: var(--accent-bg); }
.pill { margin-left: auto; margin-top: 2px; display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 4px 11px 4px 10px; border-radius: 999px;
  background: var(--panel2); color: var(--ink2); border: 1px solid var(--line2); white-space: nowrap; flex: none; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.working { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.working::before { animation: blink 1.2s ease-in-out infinite; }
.pill.review { color: var(--info); background: var(--info-bg); border-color: transparent; }
.pill.ready { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.failed { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
@keyframes blink { 50% { opacity: .25; } }

/* галочки этапов: пройдено, идёт, ждёт решения, ошибка. Полоса этапов — это навигация по заказу */
.tabs { display: flex; gap: 2px; padding: 0 28px; border-bottom: 1px solid var(--line); align-items: center; position: relative; }
.tabs-gap { width: 28px; }
.stages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin: 6px 0 0 8px; }
.tabs .stages { margin: 0; padding: 9px 0; }
.stage { font: inherit; font-size: 12.5px; font-weight: 500; padding: 0 12px; min-height: 30px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--muted); background: none; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; transition: background .15s, border-color .15s, color .15s; }
.stage.принят { color: var(--ok); border-color: transparent; background: var(--ok-bg); }
.stage.идёт { color: var(--warn); border-color: transparent; background: var(--warn-bg); }
.stage.ждёт { color: var(--info); border-color: transparent; background: var(--info-bg); }
.stage.ошибка { color: var(--bad); border-color: transparent; background: var(--bad-bg); }
/* Этап, которого у этого заказа нет по устройству (звук у ролика под песню): не долг,
   а пустое место в дороге. Отличается от «ещё не начинали» зачёркнутым именем. */
.stage.нет-нужды { text-decoration: line-through; opacity: .4; }
.stage:disabled { cursor: default; opacity: .5; }
.stage:not(:disabled):hover { filter: brightness(1.2); border-color: var(--line2); }
.stage.open { box-shadow: 0 0 0 1px var(--accent) inset; color: var(--ink); }
.stage.open.принят, .stage.open.ждёт, .stage.open.идёт, .stage.open.ошибка { box-shadow: 0 0 0 1px currentColor inset; }
.stage-where { font-size: 12px; color: var(--muted); margin-left: 8px; }
.tab { font: inherit; font-size: 13px; font-weight: 500; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted);
  padding: 10px 12px; cursor: pointer; margin-bottom: -1px; transition: color .12s, border-color .12s; }
.tab:hover { color: var(--ink2); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

.work-body { overflow-y: auto; min-height: 0; padding: 24px 28px 32px; scroll-padding-top: 16px; }
.pane { max-width: 1240px; }
.pane-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* экран материалов пройденной стадии */
.stage-view { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 18px; background: var(--panel); }
.stage-view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.stage-view-head h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.stage-view-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.stage-file { border: 1px solid var(--line); background: var(--bg2); border-radius: 9px; padding: 8px; overflow: hidden; }
.stage-file-name { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; word-break: break-all; font-family: var(--mono); }
.stage-file img { width: 100%; border-radius: 6px; cursor: zoom-in; display: block; }
.stage-file video, .stage-file audio { width: 100%; display: block; border-radius: 6px; }
.stage-text { max-height: 360px; overflow: auto; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; margin: 0; font-family: var(--font); color: var(--ink2); }
/* Длинный текст сценария читать удобнее во всю ширину, а не в колонке. */
.stage-view-body .stage-file:has(.stage-text) { grid-column: 1 / -1; }

/* шапка экрана этапа */
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.stage-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.stage-head .stage-head-text { max-width: 760px; }
.stage-head .row select { width: auto; max-width: 240px; padding: 5px 30px 5px 9px; font-size: 12.5px; }
.stage-head .inline { display: flex; flex-direction: row; align-items: center; gap: 6px; margin: 0; }
#stageHint { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.stage-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; flex-wrap: wrap; }
.stage-title-row h2 { margin: 0 4px 0 0; }
.touch-note { display: none; }
/* подсказка этапа. Примеры — кнопки: нажатие кладёт фразу в окно диалога */
.stage-help { padding: 18px 20px; max-width: 880px; margin: 0 0 20px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage-help .form-head { margin-bottom: 4px; }
.stage-help h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.stage-help > p { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; }
.help-row { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.help-example { font-family: var(--mono); font-size: 12px; white-space: normal; text-align: left; max-width: 440px;
  background: var(--bg2); border-style: dashed; justify-content: flex-start; }
.help-example:hover { border-color: var(--accent-line); color: var(--accent2); }
.stage-help #stageHelpNote { margin-top: 14px; }
/* пустой экран и «идёт работа» */
#stageEmpty { padding: 28px 24px; font-size: 14px; line-height: 1.6; color: var(--ink2); max-width: 760px;
  border: 1px dashed var(--line2); border-radius: var(--radius); background: var(--bg2); }
#stageEmpty.working { border-style: solid; border-color: var(--line); display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; align-items: start; }
#stageEmpty.working::before { content: ""; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%;
  border: 2px solid var(--warn-bg); border-top-color: var(--warn); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#heroesAccepted { margin-bottom: 18px; }
.script-start input.sec { width: 96px; }
/* дорога вперёд (прежняя разметка): держим стили, если вернётся */
.next-steps { display: flex; gap: 6px; align-items: center; }
.next-steps .step { font: inherit; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line2); background: none; color: var(--muted); cursor: default; }
.next-steps .step.ready { color: var(--bg); background: var(--accent); border-color: var(--accent); cursor: pointer; font-weight: 600; }
.next-steps .step.now { color: var(--accent2); border-color: var(--accent2); }
.next-steps .step.done { color: var(--ok); opacity: .75; }
.next-steps .step.later { opacity: .5; }
/* бриф сценария */
.script-start { padding: 22px 24px; max-width: 820px; margin-bottom: 20px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow); }
.script-start h2 { margin: 0 0 6px; font-size: 19px; }
.script-start > p.muted { margin-bottom: 16px; }
.script-start textarea { width: 100%; margin-top: 2px; }
.script-start-row { margin-top: 14px; align-items: flex-end; gap: 12px 14px; }
.script-start .inline { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0; font-size: 12.5px; color: var(--muted); }
.script-start .inline select, .script-start .inline input { width: auto; min-width: 140px; }
#scriptVoiceWhoBox { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
#scriptVoiceWhoBox > :first-child { flex-basis: 100%; }
.script-start .inline input.sec { min-width: 0; }
/* ящик правки: нажал «Правка» — пишешь здесь, не уходя вниз */
.fix-box { margin: 0 0 18px; max-width: 820px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--accent-line);
  border-radius: var(--radius); box-shadow: 0 0 0 4px var(--accent-bg); }
.fix-box label { margin-bottom: 6px; color: var(--ink); font-weight: 600; }
.fix-box textarea { width: 100%; margin-top: 4px; min-height: 76px; font-weight: 400; }
.fix-box .row { margin-top: 12px; align-items: center; gap: 8px; }
.fix-box #fixErr { color: var(--bad); }

/* ── приветствие и форма нового заказа ─────────────────────────────────── */
.welcome { max-width: 760px; padding-top: 8px; }
.welcome h2 { font-size: 26px; letter-spacing: -0.025em; margin-bottom: 8px; }
.welcome > p { font-size: 14.5px; max-width: 620px; }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 22px; }
.welcome-card { position: relative; background: linear-gradient(160deg, rgba(139, 108, 255, .10), transparent 55%), var(--panel);
  border: 1px solid var(--line2); border-radius: 14px; padding: 20px 20px 18px 20px; cursor: pointer;
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease); }
.welcome-card::after { content: ""; position: absolute; right: 18px; top: 20px; width: 18px; height: 18px; background: var(--accent2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .15s var(--ease); }
.welcome-card:hover { border-color: var(--accent-line); transform: translateY(-1px); box-shadow: 0 14px 30px -18px rgba(139, 108, 255, .5); }
.welcome-card:hover::after { transform: translateX(3px); }
.wc-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.new-form { max-width: 820px; }
.form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.new-form .form-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.field { margin-bottom: 16px; }
.field-label { font-size: 13px; color: var(--ink2); margin-bottom: 8px; font-weight: 500; }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.style-card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; cursor: pointer;
  transition: border-color .12s, background .12s; }
.style-card:hover { border-color: #464060; background: var(--panel2); }
.style-card.active { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent) inset; }
.style-card.active:focus-visible, .btn.primary:focus-visible, .stage.open:focus-visible { box-shadow: var(--ring); }
.style-card .mark { float: right; font-family: var(--mono); font-size: 10.5px; color: var(--accent2); display: none; text-transform: uppercase; letter-spacing: .06em; }
.style-card.active .mark { display: inline; }
.style-card .num { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.style-card .name { font-weight: 600; font-size: 13.5px; margin-top: 2px; }
.style-card .desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
/* имя сессии и папка заказа: первое, что заполняет исполнитель (11.09) */
.grid2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.new-head .row { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.new-head .row input { flex: 1; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-foot .btn.primary { min-height: 40px; padding: 0 22px; }
.cost { font-size: 14px; }
.cost b { color: var(--accent2); font-variant-numeric: tabular-nums; }
.cost .tiny { display: block; margin-top: 4px; max-width: 520px; line-height: 1.5; }

/* ── заказ ──────────────────────────────────────────────────────────────── */
.draft { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.draft h3 { margin-bottom: 8px; }
.photo-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.photo-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 240px auto; gap: 14px; align-items: center; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px 8px 8px; }
.photo-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: #000; cursor: zoom-in; }
.photo-row .pname { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.photo-row .pmsg { font-size: 12.5px; color: var(--warn); margin-top: 2px; }
.photo-row .pmsg.bad { color: var(--bad); }
.photo-row input { padding: 7px 10px; font-size: 13px; }
.photo-row .other { grid-column: 2 / -1; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.photo-row .pbtn { display: flex; gap: 6px; }
/* приметы человека на фото: усы, очки, возраст — слово исполнителя сильнее зрения (21.09) */
.ptraits { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink2); }
.ptraits label { display: flex; flex-direction: row; gap: 6px; align-items: center; margin: 0; font-size: 12.5px; font-weight: 400; }
.ptraits select, .ptraits input { padding: 3px 26px 3px 8px; font-size: 12.5px; width: auto; }
.ptraits input { width: 64px; padding-right: 8px; }
.ptraits > .muted { flex-basis: 100%; }
.results > .ptraits, .results > .ptraits-box { grid-column: 1 / -1; }
.ptraits-box { margin-top: 6px; }
.ptraits-line { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.ptraits-line .muted { flex: 1 1 220px; min-width: 0; }
.ptraits[hidden] { display: none !important; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.result-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.result-card:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.result-card.wide { grid-column: 1 / -1; }
.result-card .hint { padding: 0 12px 12px; font-size: 12.5px; color: var(--ink2); }
.result-card.text .cap { border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.result-card img, .result-card video { width: 100%; display: block; background: #08070B; }
.result-card img { cursor: zoom-in; }
/* Плеер голоса: слушают на месте, в лупу его не открывают, поэтому без чёрного фона и без zoom. */
.result-card audio { width: 100%; display: block; padding: 10px; box-sizing: border-box; }
.result-card .cap { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink2); font-weight: 500; }
.result-card .cap .row { gap: 6px; }
.person-head { grid-column: 1 / -1; font-weight: 600; font-size: 16px; margin-top: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; letter-spacing: -0.01em; }
.person-head:first-child { margin-top: 0; }
.person-head .row { font-weight: 500; }
/* переименование героя на месте: поле встаёт вместо заголовка */
.person-head input.rename { font-weight: 600; font-size: 14px; min-width: 260px; padding: 4px 8px; }
.model-panel { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg2); max-width: 820px; }
.model-panel select { width: auto; max-width: 420px; padding-top: 5px; padding-bottom: 5px; }
.script-text { margin: 0; padding: 16px 18px; white-space: pre-wrap; font: inherit; font-size: 14px; line-height: 1.7; color: var(--ink); max-height: 520px; overflow: auto; max-width: 78ch; }

/* панели решений: остановка, ошибка, готово */
.review-panel { margin-top: 20px; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line2); border-left: 3px solid var(--info);
  border-radius: var(--radius); max-width: 980px; box-shadow: var(--shadow); }
.review-panel p { color: var(--ink2); font-size: 13.5px; }
.review-panel .row { margin-top: 10px; }
/* вопросы к сценарию (26.09): по карточке на человека, выбор одной галочкой */
.questions { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.question { padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--bg); }
.question .q-title { font-weight: 600; font-size: 13.5px; }
.question .q-sub { color: var(--ink2); font-size: 12.5px; margin: 2px 0 6px; }
/* общий label — колонка (подпись над полем); здесь строка: кружок и текст рядом */
.question label.q-opt { display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; font-size: 13.5px;
  font-weight: 400; color: var(--ink); padding: 6px 0; cursor: pointer; min-height: 32px; }
.question input[type="radio"] { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; flex: 0 0 auto;
  accent-color: var(--accent, #8B6CFF); }
.question textarea { width: 100%; margin-top: 6px; }
.question .q-photo { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.question .q-ok { color: var(--ok, #C8F545); }
.review-panel .row .btn { min-height: 38px; }
#failPanel { border-left-color: var(--bad); background: linear-gradient(90deg, var(--bad-bg), transparent 60%), var(--panel); }
#failPanel .err { font-size: 14px; font-weight: 500; }
.done-panel { margin-top: 20px; padding: 16px 18px; background: linear-gradient(90deg, var(--ok-bg), transparent 60%), var(--panel);
  border: 1px solid var(--line2); border-left: 3px solid var(--ok); border-radius: var(--radius); max-width: 980px; }
.done-panel .row .btn { min-height: 38px; }
#downloadBtn { background: var(--ok); border-color: var(--ok); color: #151C04; font-weight: 600; }
#downloadBtn:hover { filter: brightness(1.08); }

/* ── файлы ──────────────────────────────────────────────────────────────── */
.files { display: flex; flex-direction: column; gap: 18px; max-width: 980px; }
.fgroup-title { font-family: var(--mono); font-size: 12px; color: var(--accent2); margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.frow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 7px 10px; border-radius: 6px; font-size: 13px; }
.frow:hover { background: var(--panel); }
.frow .fname { font-family: var(--mono); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fsize { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.frow a { color: var(--accent2); text-decoration: none; font-size: 12.5px; font-weight: 500; }
.frow a:hover { text-decoration: underline; }

/* ── ход работы ─────────────────────────────────────────────────────────── */
.events { display: flex; flex-direction: column; gap: 0; max-width: 760px; }
.ev { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: baseline; font-size: 13.5px; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); margin-top: 6px; }
.ev.last .ev-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.ev-time { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

/* ── диалог ─────────────────────────────────────────────────────────────── */
.chat { border-top: 1px solid var(--line); background: var(--bg2); display: flex; flex-direction: column; min-width: 0; }
.chat-log { overflow-y: auto; padding: 12px 28px 4px; display: flex; flex-direction: column; gap: 8px; max-height: 22vh; }
.chat-log:empty { padding: 0; }
.msg { max-width: min(72%, 760px); padding: 8px 12px; border-radius: 12px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.5; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent-bg); border: 1px solid rgba(139, 108, 255, .22); color: var(--ink); border-bottom-right-radius: 4px; }
.msg.ralph { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; color: var(--muted); font-size: 12.5px; background: none; text-align: center; }
.composer { margin: 8px 28px 14px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px 8px 12px;
  transition: border-color .15s, background .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-bg); }
.composer.drag { border-color: var(--accent); background: var(--accent-bg); }
.composer textarea { background: transparent; border: none; padding: 4px 2px; box-shadow: none; min-height: 40px; }
.composer textarea:focus { box-shadow: none; background: transparent; }
.composer-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.composer-row #sendBtn, .composer-row #confirmBtn { min-height: 32px; }
/* черновик: главное действие — «Запустить», а не «Отправить». Пока запуск виден, он и горит */
#confirmBtn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
#confirmBtn:hover { background: var(--accent2); border-color: var(--accent2); }
.composer-row:has(#confirmBtn:not([hidden])) #sendBtn { background: var(--panel2); border-color: var(--line2); color: var(--ink); box-shadow: none; font-weight: 500; }
.attach { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.attach:empty { display: none; }
.chip { display: flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--line2); border-radius: 8px; padding: 4px 4px 4px 6px; font-size: 12px; }
.chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 5px; }
.msg-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.msg-imgs img { max-width: 160px; max-height: 120px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); }
.chip .cname { font-family: var(--mono); font-size: 11.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip input { width: 140px; padding: 4px 7px; font-size: 12.5px; }
.chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 2px 6px; border-radius: 5px; font-family: var(--font); }
.chip button:hover { color: var(--bad); background: var(--panel2); }
/* «Обрезать» на прикреплённом фото: не удаление, поэтому рамка и другой цвет наведения */
.chip .ccrop { border: 1px solid var(--line2); border-radius: 5px; font-size: 11.5px; padding: 3px 8px; color: var(--ink2); }
.chip .ccrop:hover { color: var(--accent2); border-color: var(--accent2); background: none; }

/* стиль по образцу */
.custom-style { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 12px 14px; background: var(--panel); border: 1px dashed var(--line2); border-radius: 9px; }
.custom-style img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: #000; }
.custom-style label { margin: 0; }

/* опции заказа */
.checks { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.check { flex-direction: row; align-items: flex-start; gap: 9px; margin: 0; cursor: pointer; font-weight: 400; }
.check input { width: 16px; height: 16px; margin: 3px 0 0; padding: 0; accent-color: var(--accent); flex: none; }
.check b { color: var(--accent2); font-weight: 500; }

/* ── лупа ───────────────────────────────────────────────────────────────── */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8, 7, 12, .94); display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .15s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-height: 100vh; max-height: 100dvh; padding: 18px 0; min-width: 0; }
.lb-figure img { max-width: calc(100vw - 160px); max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); object-fit: contain; border-radius: 8px; background: #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.6); touch-action: pan-y pinch-zoom; }
.lb-cap { display: flex; align-items: center; gap: 12px; color: var(--ink2); font-size: 13px; }
.lb-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: var(--ink2); cursor: pointer; width: 46px; height: 46px; padding: 0;
  justify-self: center; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.lb-btn:hover { color: var(--ink); background: rgba(255,255,255,.14); }
.lb-close { position: fixed; top: 14px; right: 16px; }
.lb-btn[disabled] { opacity: .2; cursor: default; }
.lb-hint { display: none; }

/* ── окна ───────────────────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(5,4,8,.66); display: grid; place-items: center; z-index: 50; padding: 20px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .15s var(--ease); }
.modal-card { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; max-width: 760px; width: 100%; max-height: 86vh; max-height: 86dvh;
  overflow-y: auto; padding: 24px 28px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.85); overscroll-behavior: contain; }
.modal-card h2 { margin-bottom: 0; font-size: 19px; }
.modal-card .form-head { position: sticky; top: -24px; background: var(--panel); padding: 4px 0 10px; margin: -4px 0 8px; z-index: 1; border-bottom: 1px solid var(--line); }
.modal-card h3 { margin: 20px 0 8px; }
.modal-card ol, .modal-card ul { margin: 0 0 8px; padding-left: 20px; }
.modal-card li { margin-bottom: 5px; line-height: 1.55; }
.crop-card { max-width: 880px; }
/* 26.10, «Сериал»: окно героев прошлого заказа. На 375px карточки идут в две колонки, длинные
   имена и номера переносятся, ничего не вылезает за край листа. */
.series-card { max-width: 640px; }
.series-sources { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.series-source { justify-content: flex-start; text-align: left; white-space: normal; overflow-wrap: anywhere; height: auto; min-height: var(--btn-h); padding-top: 6px; padding-bottom: 6px; }
.series-source.active { border-color: var(--accent); background: var(--accent-bg); }
.series-heroes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 14px; }
label.series-hero { flex-direction: column; gap: 6px; margin: 0; padding: 8px; min-width: 0; cursor: pointer;
  border: 1px solid var(--line2); border-radius: var(--radius-s); background: var(--bg2); }
.series-hero img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 7px; background: var(--bg); }
.series-name { display: flex; gap: 8px; align-items: flex-start; overflow-wrap: anywhere; min-width: 0; }
.series-name input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.series-foot { flex-wrap: wrap; gap: 8px; }
.series-mark { display: inline-block; margin-left: 8px; font-weight: 400; }
.series-link-row { margin: 0 0 12px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent2); text-decoration: underline; cursor: pointer; font: inherit; text-align: left; }
@media (max-width: 480px) {
  .series-heroes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-foot .btn { flex: 1 1 100%; }
}
.crop-stage { display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line2); border-radius: 9px; padding: 8px; }
#cropCanvas { max-width: 100%; cursor: crosshair; touch-action: none; }
.crop-foot { margin-top: 12px; }

/* Полоса «Ральф обновился» — 16.09. Висит поверх всего, но не закрывает работу. */
.update-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60;
  display: flex; gap: 12px; align-items: center;
  background: var(--panel2); color: var(--ink);
  border: 1px solid var(--accent-line); border-radius: 12px;
  padding: 10px 12px 10px 16px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  font-size: 13px; max-width: min(92vw, 620px);
}

/* 27.09: в мастере плашка лежала поверх шкалы и кнопки «Написать сценарий» — даём ей место снизу */
body:has(#updateBar) .lead-body { padding-bottom: 150px; }

/* ── звук: слева озвучка, справа мелодия (24.09) ────────────────────────── */
.sound-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; margin: 4px 0 16px; overflow: hidden; }
.sound-col { padding: 18px 20px; min-width: 0; }
.sound-col + .sound-col { border-left: 1px solid var(--line); }
.song-panel { grid-template-columns: 1fr; }
.sound-col h3 { margin: 0 0 10px; font-size: 15px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.sound-col > p { margin: 4px 0 10px; }
.sound-tools { align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sound-tools .inline { flex-direction: column; gap: 6px; margin: 0; font-size: 12.5px; color: var(--muted); }
.sound-tools select { width: auto; min-width: 180px; }
.sound-col audio { width: 100%; max-width: 360px; }
.moods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mood { font: inherit; border: 1px solid var(--line2); background: transparent; color: var(--ink2); border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s; }
.mood:hover:not(:disabled) { border-color: var(--accent-line); color: var(--ink); }
.mood.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.mood:disabled { opacity: .5; cursor: default; }
.takes { display: flex; flex-direction: column; gap: 8px; }
.take { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg2);
  transition: border-color .12s; }
.take:has(input:checked) { border-color: var(--accent-line); background: var(--accent-bg); }
.take input[type="radio"] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); margin: 0; }
.take-name { font-size: 13px; }
.take audio { grid-column: 1 / -1; width: 100%; max-width: none; }
/* 02.10: третья колонка «Своя мелодия или песня» и выбор «с озвучкой / только мелодия» */
#soundPanel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.narration { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 6px; }
.narration .inline { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px;
  margin: 0; font-size: 13px; text-align: left; cursor: pointer; }
.narration input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
@media (max-width: 1100px) {
  #soundPanel { grid-template-columns: 1fr 1fr; }
  #soundPanel .sound-own { grid-column: 1 / -1; border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  #soundPanel { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .work-head, .work-body { padding-left: 22px; padding-right: 22px; }
  .tabs { padding: 0 22px; }
  .chat-log { padding-left: 22px; padding-right: 22px; }
  .composer { margin-left: 22px; margin-right: 22px; }
  .photo-row { grid-template-columns: 64px minmax(0, 1fr) 200px auto; }
}
@media (max-width: 860px) {
  .grid3 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .sound-panel { grid-template-columns: 1fr; }
  .sound-col + .sound-col { border-left: none; border-top: 1px solid var(--line); }
}

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

/* ── Телефон и узкое окно ─────────────────────────────────────────────────
   25.09 (v91): страница прокручивается целиком, всё в одну колонку, цели не меньше 44 px.
   26.09 (v92): боковая панель — выезжающий ящик по кнопке «Заказы» в закреплённой верхней
   полосе (в ней же «Новый»); полоса этапов одной строкой с прокруткой вбок, открытый этап
   сам встаёт в середину; решение стадии («Принять», «Поправить») прилипает к низу экрана,
   пока листаешь ленту кадров; подсказки, которые на компьютере живут в title, видны текстом. */
@media (max-width: 860px) {
  html, body { height: auto; }
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); overflow-x: hidden; }
  body.drawer-open { overflow: hidden; }

  .shell { display: block; height: auto; min-height: 100vh; min-height: 100dvh; }
  .work { display: block; height: auto; min-width: 0; }
  .work-body { overflow: visible; padding: 16px 16px 20px; }

  /* верхняя полоса: «Заказы», имя открытого, «Новый» */
  .m-bar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 30;
    padding: calc(6px + env(safe-area-inset-top)) 10px 6px 8px; min-height: calc(56px + env(safe-area-inset-top));
    background: rgba(17, 15, 23, .92); border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); }
  .m-bar .m-menu { padding: 0 12px 0 10px; gap: 8px; color: var(--ink); font-weight: 600; flex: none; }
  .m-bar .m-title { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); text-align: center; }
  .m-bar #mNewBtn { flex: none; padding: 0 14px; }

  /* ящик: вся боковая панель компьютера целиком — заказы, «Новый заказ», баланс, «Памятка», «Выйти» */
  .side { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(88vw, 360px);
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    transform: translateX(-102%); transition: transform .24s var(--ease); visibility: hidden;
    box-shadow: 20px 0 60px -20px rgba(0,0,0,.8); overflow: hidden; }
  .side.open { transform: none; visibility: visible; }
  .side-close { display: inline-flex; }
  .side-head .brand { padding-bottom: 8px; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-backdrop.open { opacity: 1; pointer-events: auto; }
  .orders { margin: 0 -4px; overscroll-behavior: contain; }
  .order-item { min-height: 58px; padding: 10px 50px 10px 14px; align-content: center; }
  .order-item .ostatus { display: block; }
  .order-del { width: 44px; height: 44px; top: 50%; right: 3px; transform: translateY(-50%); opacity: 1; font-size: 18px; }
  .side-foot { gap: 4px 8px; }
  .side-foot .btn { min-height: 44px; }

  /* шапка заказа: коротко, без пустых строк */
  .work-head { flex-wrap: wrap; gap: 6px 12px; padding: 14px 16px 12px; }
  .work-title { flex: 1 1 100%; }
  .work-title h1 { overflow-wrap: anywhere; font-size: 19px; }
  .pill { margin: 0; white-space: normal; }
  .folder-line { gap: 4px 6px; }
  .folder-line #folderPath { max-width: 100%; min-width: 0; flex: 1 1 100%; }
  .folder-line .btn { flex: 1 1 auto; }
  input.rename-order, input.folder-input, .person-head input.rename { min-width: 0; width: 100%; }

  /* полоса этапов одной строкой, прокрутка вбок внутри полосы; «Файлы · Ход» в конце */
  .tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 0 12px; gap: 4px; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 20;
    background: rgba(12, 11, 16, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .stages { flex: none; flex-wrap: nowrap; gap: 6px; padding: 8px 0; }
  .tabs .stage { scroll-snap-align: center; }
  .tabs .spacer { display: none; }
  .tabs .tab { flex: none; white-space: nowrap; }
  .tabs .stages + .spacer + .tab { margin-left: 8px; border-left: 1px solid var(--line); }
  .stage-where { flex: none; white-space: nowrap; margin: 0 4px 0 6px; }

  /* заголовок раздела и его инструменты */
  .stage-head { gap: 10px; margin-bottom: 14px; }
  .stage-head h2 { font-size: 20px; }
  .stage-head .stage-head-text { max-width: 100%; }
  .stage-title-row { gap: 6px; }
  .stage-title-row h2 { flex: 1 1 100%; margin: 0 0 4px; }
  .stage-title-row .btn { flex: 1 1 0; }
  .stage-head .row, #heroesTools, #scriptTools { flex-wrap: wrap; width: 100%; }
  #heroesTools > .btn, #scriptTools > .btn { flex: 1 1 auto; }
  #heroesTools .inline { flex: 1 1 100%; flex-direction: row; justify-content: space-between; }
  .stage-head .row select { max-width: 100%; flex: 1; }
  .touch-note { display: block; flex: 1 1 100%; margin: 2px 0 0; }
  #deleteScriptBtn[hidden] ~ .touch-note { display: none; }
  .stage-help { padding: 14px; }
  .help-example { max-width: 100%; width: 100%; }

  /* формы в одну колонку */
  .welcome h2 { font-size: 22px; }
  .form-foot { flex-wrap: wrap; gap: 10px; }
  .form-foot .cost { flex: 1 1 100%; }
  .form-foot .btn { flex: 1 1 100%; }
  .styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-start { padding: 16px; }
  .script-start-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .script-start-row .spacer { display: none; }
  .script-start-row > * { min-width: 0; max-width: 100%; }
  .script-start .inline { flex-direction: column; align-items: stretch; gap: 6px; }
  .script-start .inline select, .script-start .inline input { flex: 0 0 auto; width: 100%; min-width: 0; }
  #scriptVoiceWhoBox { flex-direction: column; align-items: stretch; }
  .script-start input.sec { width: 100%; }
  select { max-width: 100%; }
  .model-panel { flex-wrap: wrap; }
  .model-panel select { max-width: 100%; flex: 1 1 100%; }
  .review-panel .row .btn, .fix-box .row .btn, #failPanel .row .btn, .done-panel .row .btn { flex: 1 1 auto; }
  .fix-box { padding: 14px; }
  .stage-view { padding: 12px; }

  /* 26.09 (v93): решение стадии («Принять», «Поправить») живёт в нижней панели действий
     (.m-dock ниже), она всегда на экране. Здесь, в ленте, остаётся подсказка остановки целиком:
     прилипшая панель с подсказкой в две строки съедала четверть экрана и спорила с панелью. */
  #reviewPanel { margin: 18px 0 0; padding: 14px 16px; }
  #reviewHint { margin-bottom: 0; font-size: 14px; line-height: 1.55; }
  #reviewActions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
  #reviewActions:not(:has(> :not([hidden]):not(.m-proxied))) { display: none; }
  #reviewActions .btn { flex: none; }
  #reviewActions .openFolderBtn { grid-column: 1 / -1; }
  /* инструменты героев не спорят с «Принять»: главная кнопка на экране одна */
  #heroesTools .btn.primary { background: var(--panel2); border-color: var(--line2); color: var(--ink); box-shadow: none; font-weight: 500; }

  /* фото заказа: картинка и подпись в первой строке, поле и кнопки под ними */
  .photo-row { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 10px; align-items: start; }
  .photo-row > input, .photo-row .pbtn, .photo-row .other { grid-column: 1 / -1; }
  .photo-row .pbtn .btn { flex: 1 1 0; }
  .photo-row .pname { overflow-wrap: anywhere; }
  /* приметы (усы, очки, возраст, волосы, длина) — по две в строку */
  .ptraits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .photo-row .ptraits { grid-template-columns: minmax(0, 1fr); }
  .ptraits label { flex-direction: column; align-items: stretch; gap: 4px; font-size: 12.5px; color: var(--muted); }
  .ptraits select, .ptraits input { width: 100%; min-width: 0; }
  .ptraits > .muted { grid-column: 1 / -1; }

  /* выдача стадии: кадры и клипы сеткой в две колонки, широкие карточки во всю строку */
  .results, .stage-view-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .result-card.choice { grid-column: 1 / -1; }
  .result-card .cap { flex-direction: column; align-items: stretch; padding: 8px; gap: 6px; }
  .result-card .cap .row { gap: 6px; }
  .result-card .cap .row .btn { flex: 1 1 auto; }
  .person-head { font-size: 17px; }
  .person-head .row { width: 100%; }
  .person-head .row .btn { flex: 1 1 auto; }
  .script-text { max-height: none; overflow-x: hidden; overflow-wrap: anywhere; padding: 14px; font-size: 15px; }
  .stage-text { overflow-wrap: anywhere; max-height: none; }

  /* звук: плееры во всю ширину колонки */
  .sound-col { padding: 14px; }
  .sound-col audio { max-width: none; }
  .sound-tools .inline { flex: 1 1 100%; }
  .sound-tools select { width: 100%; }
  .sound-tools .btn { flex: 1 1 auto; }

  /* файлы и ход */
  .frow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 4px 6px; }
  .pane-head { gap: 10px; }
  .ev { grid-template-columns: 14px minmax(0, 1fr); }
  .ev-time { grid-column: 2; }

  /* диалог: в конце страницы, а не прибит к низу экрана */
  .chat { padding-bottom: env(safe-area-inset-bottom); }
  /* 28.09, владелец: на телефоне чат спрятан, пока его не открыли кнопкой «Чат» внизу
     (app.js, чатТелефона); ответ Ральфа открывает его сам */
  body.dock-on .chat { display: none; }
  body.dock-on.chat-open .chat { display: flex; }
  .chat-log { padding: 10px 16px 2px; max-height: none; }
  .msg { max-width: 90%; }
  .composer { margin: 8px 12px 12px; padding: 8px 10px; }
  .composer textarea { min-height: 48px; }
  .composer-row { flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .composer-row > .tiny.muted { display: none; }
  .composer-row .spacer { display: none; }
  .composer-row label.btn { flex: 1 1 auto; }
  .composer-row #chatToggle { flex: 1 1 auto; }
  .composer-row #confirmBtn, .composer-row #sendBtn { flex: 1 1 100%; }
  .composer-row #confirmBtn:not([hidden]) { order: -1; }
  .chip { flex-wrap: wrap; width: 100%; }
  .chip input { flex: 1 1 120px; width: auto; }

  /* окна поверх экрана: снизу, как лист */
  .modal { padding: 0; place-items: end stretch; }
  .modal-card { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 24px - env(safe-area-inset-top));
    border-radius: 18px 18px 0 0; border-bottom: none; animation: sheet .22s var(--ease); }
  .modal-card .form-head { top: -16px; }
  .crop-foot { flex-wrap: wrap; }
  .crop-foot .btn { flex: 1 1 auto; }
  .update-bar { bottom: calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; width: calc(100vw - 24px); }

  /* лупа: картинка во весь экран, стрелки и «Закрыть» по краям и всегда на экране */
  .lightbox { grid-template-columns: minmax(0, 1fr); }
  .lb-figure { padding: calc(64px + env(safe-area-inset-top)) 8px calc(84px + env(safe-area-inset-bottom)); }
  .lb-figure img { max-width: calc(100vw - 16px); max-height: calc(100dvh - 210px); }
  .lb-cap { flex-wrap: wrap; justify-content: center; padding: 0 8px; text-align: center; }
  .lb-close { top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); }
  .lb-prev, .lb-next { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); width: 52px; height: 52px; }
  .lb-prev { left: calc(16px + env(safe-area-inset-left)); }
  .lb-next { right: calc(16px + env(safe-area-inset-right)); }
  .lb-hint { position: fixed; left: 80px; right: 80px; bottom: calc(30px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--muted); }
}
@keyframes sheet { from { transform: translateY(24px); opacity: .4; } }

/* Цели под палец: не меньше 44 px (рекомендация Apple и Google). Только на узком экране или
   сенсорном вводе — на компьютере мышью плотная раскладка удобнее. */
@media (max-width: 860px), (pointer: coarse) {
  /* !important: на компьютере у кнопок решений и «Отправить» своя высота по id, палец важнее */
  .btn, .btn.small, a.btn, label.btn { min-height: 44px !important; }
  .login-card input { min-height: 46px; }
  .btn.small { padding: 0 12px; font-size: 13.5px; }
  .tab { min-height: 44px; }
  .stage, .tabs .stage { min-height: 44px; padding: 0 14px; font-size: 13.5px; }
  .mood { min-height: 44px; padding: 8px 15px; }
  .lb-btn { min-width: 46px; min-height: 46px; }
  .chip button { min-width: 44px; min-height: 44px; }
  .chip .ccrop { min-height: 44px; }
  .frow a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
  .order-del { min-width: 44px; min-height: 44px; }
  /* 16 px — меньше Safari на iPhone увеличивает страницу при вводе и не возвращает обратно */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .ptraits select, .ptraits input, .stage-head .row select, .model-panel select, .sound-tools select { font-size: 16px; min-height: 44px; padding: 8px 30px 8px 10px; }
  .ptraits input { padding-right: 10px; }
  .photo-row input { font-size: 16px; }
  .chip input { font-size: 16px; }
  .check { min-height: 44px; align-items: center; }
  .check input { width: 22px; height: 22px; min-height: 0; margin: 0; }
  .take { padding: 4px 12px 10px 4px; }
  .take input[type="radio"] { width: 44px; height: 44px; min-height: 0; margin: 0; }
  input[type="file"] { min-height: 0; }
  .style-card { min-height: 56px; }
}

/* на пальце «наведение» залипает после нажатия: кнопка остаётся подсвеченной. Возвращаем обычный вид */
@media (hover: none) {
  .btn:hover { background: var(--panel2); border-color: var(--line2); }
  .btn.primary:hover, #confirmBtn:hover { background: var(--accent); border-color: var(--accent); }
  .btn.ghost:hover { background: transparent; border-color: transparent; color: var(--ink2); }
  .welcome-card:hover { transform: none; box-shadow: none; border-color: var(--line2); }
  .result-card:hover { box-shadow: none; border-color: var(--line); }
  .order-item:hover { background: none; }
  .order-item.active:hover { background: var(--panel2); }
}

/* подсказки для мыши и для пальца: «перетащите» верно только там, где есть мышь */
.touch-only { display: none; }
@media (max-width: 860px), (hover: none) and (pointer: coarse) {
  .desk-only { display: none !important; }
  .touch-only { display: revert; }
  span.touch-only { display: inline; }
}
/* только настоящий сенсорный экран: папка на компьютере здесь смысла не имеет, а жесты лупы есть */
@media (hover: none) and (pointer: coarse) {
  .touch-hide { display: none !important; }
  /* папка «на компьютере» у телефона не бывает: остаётся только «Скачать всё архивом» */
  .folder-line > .tiny.muted:first-child, #folderPath, #folderPickBtn, #folderOpenBtn, #folderNote { display: none !important; }
}
@media (hover: none) and (pointer: coarse) and (max-width: 860px) {
  .lb-hint { display: block; }
}

/* ── Большой палец (v93, 26.09) ──────────────────────────────────────────────
   Владелец: «чтобы всё было удобно для большого пальца: раз, два, три — и всё работает».
   Главное действие экрана — в нижней панели, в зоне большого пальца одной руки (и правой, и
   левой: кнопка во всю ширину, её середина под любым пальцем), 56 px, одна на экран. Всё
   второстепенное — выше по странице или в ящике «Заказы», который тоже открывается снизу. */
.btn, .m-dock-orders, .stage, .tab, .order-item, .mood, .style-card, .lb-btn { touch-action: manipulation; }
@media (max-width: 860px) {
  /* сверху закреплены полоса «Заказы» и полоса этапов, снизу панель: прокрутка к элементу
     ставит его между ними, а не под ними */
  html { scroll-padding-bottom: calc(var(--dock-h, 88px) + 12px); scroll-padding-top: calc(124px + env(safe-area-inset-top)); }
  /* выбор А / Б внизу: лист «лицо, А, Б» первым в выдаче, прямо под заголовком */
  body.dock-choice .results .result-card.choice { order: -1; }
  .m-dock .btn.long { font-size: 14px; line-height: 1.18; padding-left: 8px; padding-right: 8px; }
  .m-dock-row:has(.m-dock-main.long) .m-dock-alt { padding: 6px 10px !important; font-size: 14px; }
  body.dock-on .shell { padding-bottom: var(--dock-h, 88px); }

  .m-dock:not([hidden]) { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 10px calc(12px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    background: rgba(17, 15, 23, .96); border-top: 1px solid var(--line2);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    box-shadow: 0 -14px 34px -14px rgba(0,0,0,.8);
    /* клавиатура открыта — панель встаёт над ней (app.js ставит --kb по visualViewport) */
    transform: translateY(calc(-1 * var(--kb, 0px))); transition: transform .18s var(--ease); }
  .m-dock-row { display: flex; align-items: stretch; gap: 8px; }
  .m-dock-orders { flex: none; width: 60px; min-height: 56px; padding: 6px 0 5px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink2); cursor: pointer;
    background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px; -webkit-tap-highlight-color: transparent;
    transition: background .12s var(--ease), transform .08s var(--ease); }
  .m-dock-orders .ico { width: 20px; height: 20px; }
  .m-dock-orders[aria-expanded="true"] { color: var(--accent2); border-color: var(--accent-line); }
  .m-dock .btn { min-height: 56px !important; border-radius: 14px; font-size: 15px; line-height: 1.22; padding: 6px 14px; }
  .m-dock-main { flex: 1 1 auto; min-width: 0; font-weight: 600; }
  .m-dock-alt { flex: 0 1 auto; max-width: 34%; font-weight: 500; padding: 6px 12px !important; }
  /* «Скачать видео» — зелёная, как на экране выдачи */
  .m-dock.done .m-dock-main { background: var(--ok); border-color: var(--ok); color: #151C04; box-shadow: 0 6px 16px -8px rgba(200,245,69,.7); }
  /* выбор клиента: две равные крупные плитки, А слева, Б справа — одно нажатие */
  .m-dock.choice .m-dock-main, .m-dock.choice .m-dock-alt { flex: 1 1 0; max-width: none; order: 1; font-weight: 600;
    background: var(--accent-bg); border: 1.5px solid var(--accent); color: var(--ink); box-shadow: none; }
  .m-dock.choice .m-dock-alt { order: 2; }
  /* идёт работа: вместо кнопки строка состояния с крутилкой */
  .m-dock-note { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; align-items: center; gap: 10px; padding: 0 4px 0 6px;
    font-size: 13.5px; line-height: 1.35; color: var(--ink2); }
  .m-dock.work .m-dock-note::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
  .m-dock-err { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; line-height: 1.4;
    color: var(--bad); background: var(--bad-bg); }
  /* нажатие: кнопка сразу отвечает, пока идёт запрос — крутилка и второе нажатие не проходит */
  .m-dock .btn.is-busy { opacity: 1; cursor: progress; }
  .m-dock .btn.is-busy::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
  .m-dock .btn:active:not(:disabled), .m-dock-orders:active { transform: scale(.97); filter: brightness(.92); }

  /* кнопка экрана, которую взяла на себя панель, здесь не повторяется: главное не двоится */
  .m-proxied { display: none !important; }
  /* главная на экране одна — та, что в панели. Остальные «главные» становятся обычными */
  body.dock-main :is(.work, .m-bar) .btn.primary:not(.m-proxied) { background: var(--panel2); border-color: var(--line2); color: var(--ink);
    box-shadow: none; font-weight: 500; }
  /* «Новый» в верхнем правом углу — самое дальнее место для большого пальца. Там он запасной,
     без главного цвета; на пустом кабинете «Новый заказ» стоит в нижней панели */
  .m-bar #mNewBtn { background: transparent; border-color: var(--line2); color: var(--ink); box-shadow: none; font-weight: 600; }

  /* выбор клиента на листе (несколько стилей — буквы остаются на своих листах): крупно, пополам */
  .result-card.choice .cap .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-card.choice .cap .row .btn { min-height: 52px !important; font-size: 15px; }
  body .work .result-card.choice .cap .row .btn.primary { background: var(--accent-bg); border: 1.5px solid var(--accent); color: var(--ink); box-shadow: none; font-weight: 600; }
  .result-card.choice .cap .row a.btn { grid-column: 1 / -1; min-height: 44px !important; }

  /* полосы «Ральф обновился» и сообщения не закрывают главную кнопку */
  body.dock-on .update-bar { bottom: calc(var(--dock-h, 88px) + 10px); }

  /* вход: карточка ниже середины, «Войти» под большим пальцем (27.09: .login стал flex-колонкой,
     сверху крупный заголовок для клиента — он и опускает карточку) */
  .login { align-items: center; justify-content: flex-end; }
  .login:has(#loginHero:not([hidden])) { justify-content: flex-start; }
  .login-card { padding: 22px 20px 16px; }
  .login-card .btn.wide { min-height: 52px !important; font-size: 15.5px; }
}
/* отклик на нажатие пальцем везде, не только в панели */
@media (hover: none) {
  .btn:active:not(:disabled) { transform: scale(.98); filter: brightness(.9); }
  .order-item:active, .stage:active, .style-card:active { filter: brightness(1.15); }
}

/* ── вовлечение (28.09): первый заказ клиента по шагам, один шаг на экран ───────────────
   Клиент, который пришёл сам, до первой оплаты видит этот экран вместо кабинета (lead.js).
   Кнопки этапов сверху появляются по одной. */
.lead { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 500px at 50% -10%, rgba(139, 108, 255, .10), transparent 60%), var(--bg); }
.lead-top { display: flex; align-items: center; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line);
  background: var(--bg2); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.lead-top .brand { padding: 0; }
.lead-stages { display: flex; gap: 6px; align-items: center; }
.lead-me { display: flex; gap: 8px; align-items: center; }
.lead-body { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 34px 24px 60px; }
.lead-num { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent2); font-weight: 600; margin-bottom: 8px; }
.lead-title { font-size: 30px; line-height: 1.2; letter-spacing: -0.025em; margin-bottom: 10px; }
.lead-sub { font-size: 15.5px; max-width: 720px; margin-bottom: 26px; color: var(--ink2); }
.lead-wait { margin-top: 14px; }
.lead-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.lead-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 260px; border: 2px dashed var(--line2); border-radius: 18px; background: var(--panel); cursor: pointer;
  text-align: center; padding: 28px; margin: 0; transition: border-color .15s var(--ease), background .15s var(--ease); }
.lead-drop b { font-size: 18px; color: var(--accent-ink); background: var(--accent); border-radius: 12px; padding: 13px 30px; font-weight: 600; }
.lead-drop:hover, .lead-drop.over { border-color: var(--accent); background: var(--accent-bg); }
.lead-drop.busy { opacity: .55; pointer-events: none; }
.lead-example { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.lead-arrow { font-size: 14px; }
.lead-styles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.lead-variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; align-items: start; }
.lead-tile { font: inherit; color: var(--ink); margin: 0; padding: 8px; border: 1px solid var(--line2); border-radius: 14px;
  background: var(--panel); display: flex; flex-direction: column; gap: 8px; text-align: center; overflow: hidden; }
button.lead-tile { cursor: pointer; transition: transform .15s var(--ease), border-color .15s var(--ease); }
button.lead-tile:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
button.lead-tile:disabled { opacity: .45; cursor: default; }
button.lead-tile.picked { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.lead-tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 9px; display: block; background: var(--panel2); }
.lead-variants .lead-tile img { aspect-ratio: 3 / 4; cursor: zoom-in; }
.lead-tile.was { width: 150px; flex: none; }
.lead-variants .lead-tile.was { width: auto; }
.lead-tile.was img { cursor: default; }
.lead-tile figcaption, .lead-tile-name { font-size: 14px; font-weight: 600; padding-bottom: 4px; }
.lead-tile.was figcaption { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.lead-tile .btn { min-height: 44px; font-size: 15px; }
.lead-spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--line2); border-top-color: var(--accent);
  animation: lead-spin 1s linear infinite; margin: 30px 0 10px; }
@keyframes lead-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .lead-spinner { animation-duration: 3s; } }
.lead-step > label { font-size: 14px; max-width: 760px; }
.lead-step > label input, .lead-step > label textarea, .lead-step > label select { font-size: 15.5px; }
.lead-sample { max-width: 760px; border-left: 3px solid var(--accent-line); background: var(--accent-bg); border-radius: 0 10px 10px 0;
  padding: 12px 16px; margin: 0 0 20px; }
.lead-sample b { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent2); }
.lead-sample p { margin: 4px 0 0; color: var(--ink2); }
.lead-choice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.lead-choice-label { font-size: 14px; color: var(--ink2); font-weight: 500; }
.lead-pill { font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 999px; padding: 9px 20px; cursor: pointer; }
.lead-pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.lead-step > label.lead-lang { max-width: 240px; }
.lead-go { min-height: 50px; font-size: 16px; padding: 0 30px; }
.lead-script-head { color: var(--ink2); font-size: 14px; margin-bottom: 16px; }
.lead-scene { border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.lead-scene-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lead-scene-top b { font-size: 15.5px; }
.lead-scene-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.lead-scene-col h3 { margin-bottom: 6px; }
.lead-voice { font-size: 15px; line-height: 1.6; color: var(--ink); margin: 0; }
.lead-frame { font-size: 13.5px; line-height: 1.55; color: var(--ink2); margin: 0 0 8px; }
.lead-frame-n { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--info); background: var(--info-bg);
  border-radius: 6px; padding: 1px 7px; margin-right: 8px; }
.lead-fix { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.lead-fix-all { margin: 22px 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.lead-fix-all textarea { width: 100%; }
.lead-reply { border: 1px solid var(--info); background: var(--info-bg); border-radius: 10px; padding: 12px 16px; color: var(--ink); white-space: pre-wrap; }
.lead-next { border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: 16px; padding: 22px 24px; margin-top: 26px; }
.lead-mine { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; padding: 14px;
  border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: 16px; }
.lead-mine .lead-tile.was { width: 170px; border-color: var(--accent); }
.lead-mine .lead-tile.was figcaption { color: var(--ink); font-weight: 600; }
.lead-mine-text { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lead-mine-text b { font-size: 17px; }
.lead-mine-text p { margin: 0 0 6px; }
.lead-sample-box { border-top: 1px solid var(--line); padding-top: 4px; }
.lead-sample-box .lead-part { margin-top: 18px; }
.lead-tile { position: relative; }
.lead-badge { position: absolute; top: 14px; left: 14px; z-index: 1; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, .62); border-radius: 6px; padding: 3px 8px; pointer-events: none; }
.lead-part { font-size: 20px; margin: 28px 0 4px; letter-spacing: -0.01em; }
.lead-part-sub { margin: 0 0 14px; font-size: 14px; }
.lead-scene .lead-frame { font-size: 14.5px; color: var(--ink); }
.lead-scene .lead-frame:last-of-type { margin-bottom: 0; }
.lead-again { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 22px; }
/* 28.09: вариант не похож на фото и после перерисовки — пометка на нём и совет про фото */
.lead-badge.unlike { right: 14px; text-transform: none; letter-spacing: 0; line-height: 1.3; font-size: 12px;
  color: #1A1204; background: var(--warn); }
.lead-tile.unlike img { outline: 2px solid var(--warn); outline-offset: -2px; }
.lead-unlike { display: flex; gap: 16px; align-items: flex-start; margin: 0 0 22px; padding: 16px; border-radius: 14px;
  background: var(--warn-bg); border: 1px solid rgba(255, 197, 61, .45); max-width: 760px; }
.lead-unlike figure { margin: 0; flex: none; text-align: center; }
.lead-unlike img { display: block; width: 84px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; }
.lead-unlike figcaption { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.lead-unlike b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.lead-unlike p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--ink2); }
@media (max-width: 480px) { .lead-unlike { flex-direction: column; } }
.result-card .hint.unlike { color: #1A1204; background: var(--warn); border-radius: 6px; padding: 6px 8px; }
.lead-voices { max-width: 760px; }
.lead-lang-note { margin: -8px 0 16px; min-height: 0; }
.lead-voice-head { margin: 6px 0 10px; }
.lead-voice-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.lead-voices .lead-voice-row { display: flex; flex-direction: row; align-items: center; gap: 12px; margin: 0;
  border: 1px solid var(--line2); background: var(--panel); border-radius: 12px; padding: 10px 14px;
  cursor: pointer; min-height: 56px; font-size: 15px; color: var(--ink); }
.lead-voices .lead-voice-row.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.lead-voices .lead-voice-row input { width: 18px; height: 18px; margin: 0; padding: 0; flex: none; accent-color: var(--accent); }
.lead-voices .lead-voice-row .btn { width: auto; flex: none; }
.lead-voice-name { font-size: 15px; font-weight: 500; }
.lead-voice-row .spacer { flex: 1; }
.lead-listen { min-width: 110px; min-height: 40px; }
.lead-next h2 { font-size: 19px; margin-bottom: 6px; }
.lead-next p { max-width: 640px; margin-bottom: 16px; }
@media (max-width: 760px) {
  .lead-top { padding: 10px 14px; gap: 8px; }
  .lead-top .brand-sub { display: none; }
  .lead-body { padding: 22px 14px 48px; }
  .lead-title { font-size: 24px; }
  .lead-mine { flex-wrap: nowrap; align-items: flex-start; gap: 12px; padding: 10px; margin-bottom: 18px; }
  .lead-mine .lead-tile.was { width: 118px; padding: 6px; }
  .lead-mine .lead-tile.was figcaption { font-size: 11.5px; }
  .lead-mine-text { min-width: 0; }
  .lead-mine-text b { font-size: 15.5px; }
  .lead-mine-text p { font-size: 13.5px; }
  .lead-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lead-variants { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lead-variants .lead-tile.was { grid-column: 1 / -1; width: 130px; }
  .lead-scene-cols { grid-template-columns: 1fr; gap: 12px; }
  .lead-go, .lead-tile .btn { width: 100%; min-height: 52px; }
}
/* ── мастер, 27.09: язык приложения, экран фото, стиль по центру, шкала рисования ──────── */
.lead-ico { width: 20px; height: 20px; flex: none; }
.lead-lang-btn { min-width: 0; }

/* язык на экране входа: маленький выбор в углу карточки */
.login-card { position: relative; }
.login-lang { position: absolute; top: 12px; right: 12px; width: auto; min-height: 32px; padding: 4px 26px 4px 10px; font-size: 12.5px;
  border-radius: 999px; background-color: var(--panel2); color: var(--ink2); border: 1px solid var(--line2); }
@media (max-width: 480px) { .login-lang { position: static; display: block; margin: 0 0 10px auto; } }
/* выбор языка: рамка по центру */
.lead-langbox { max-width: 620px; margin: 4vh auto 0; text-align: center; border: 1px solid var(--accent-line);
  background: var(--panel); border-radius: 22px; padding: 34px 30px 30px; box-shadow: 0 24px 60px rgba(0, 0, 0, .28); }
.lead-langbox .lead-sub { margin-left: auto; margin-right: auto; }
.lead-langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lead-langpick { font: inherit; color: var(--ink); background: var(--panel2); border: 1px solid var(--line2); border-radius: 14px;
  min-height: 60px; padding: 10px 18px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  transition: border-color .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); }
.lead-langpick b { font-size: 17px; font-weight: 600; }
.lead-langpick:hover { border-color: var(--accent); background: var(--accent-bg); transform: translateY(-1px); }
.lead-langpick.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* шаг 1: пример фото, три требования, две кнопки */
.lead-photo { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 30px; align-items: center;
  border: 1px solid var(--line2); background: var(--panel); border-radius: 22px; padding: 22px;
  transition: border-color .15s var(--ease), background .15s var(--ease); }
.lead-photo.over { border-color: var(--accent); background: var(--accent-bg); }
.lead-photo.busy .lead-photo-actions, .lead-photo.busy .lead-photo-hint { opacity: .45; pointer-events: none; }
.lead-photo-sample { position: relative; margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--accent-line); background: var(--panel2); }
.lead-photo-sample img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 22%; transform: scale(1.18); transform-origin: 50% 30%; }
.lead-photo-sample figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px; font-size: 13px; font-weight: 600; color: #fff;
  text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); }
.lead-photo-sample .lead-badge { top: 12px; left: 12px; }
.lead-photo-head { font-size: 18px; margin: 0 0 14px; }
.lead-reqs { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.lead-reqs li { display: flex; align-items: flex-start; gap: 12px; }
.lead-reqs li div { display: flex; flex-direction: column; gap: 1px; }
.lead-reqs b { font-size: 15.5px; font-weight: 600; }
.lead-reqs .muted { font-size: 13.5px; }
.lead-req-ok { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-ink); background: var(--accent); margin-top: 1px; }
.lead-req-ok .lead-ico { width: 17px; height: 17px; }
.lead-photo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lead-photo-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px;
  padding: 0 24px; font-size: 16px; font-weight: 600; cursor: pointer; margin: 0; flex: 1 1 190px; width: auto; }
.lead-photo-hint { margin: 10px 0 0; }
.lead-upload { margin-top: 16px; }
.lead-upload p { margin: 8px 0 0; font-size: 14px; }

/* полоса: общая для проверки фото и для шкалы рисования */
.lead-bar { height: 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); overflow: hidden; }
.lead-bar i { display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .3s linear; }
.lead-bar.indet i { width: 40%; animation: lead-indet 1.3s ease-in-out infinite; }
@keyframes lead-indet { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }

/* окно веб-камеры на компьютере */
.lead-cam { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .78); display: flex; align-items: center; justify-content: center; padding: 18px; }
.lead-cam-box { width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line2); border-radius: 20px; padding: 22px; }
.lead-cam-box h2 { font-size: 20px; margin: 0 0 4px; }
.lead-cam-box p { margin: 0 0 14px; }
.lead-cam-box video { display: block; width: 100%; border-radius: 14px; background: #000; transform: scaleX(-1); margin-bottom: 16px; }

/* шаг 2: всё по центру — фото клиента, заголовок, образец, стили */
.lead-step > .lead-num { text-align: center; }
.lead-mine { flex-direction: column; align-items: center; text-align: center; gap: 12px; max-width: 420px; margin: 0 auto 30px; padding: 18px; flex-wrap: nowrap; }
.lead-mine .lead-tile.was { width: 210px; }
.lead-mine .lead-tile.was img { aspect-ratio: 4 / 5; }
.lead-mine .lead-tile.was figcaption { font-size: 15px; letter-spacing: .02em; }
.lead-mine-text { align-items: center; min-width: 0; flex: none; }
.lead-badge.mine { background: var(--accent); color: var(--accent-ink); }
.lead-sample-box { border-top: 1px solid var(--line); padding-top: 28px; text-align: center; }
.lead-sample-box .lead-sub { margin-left: auto; margin-right: auto; }
.lead-example { flex-direction: column; justify-content: center; gap: 12px; margin-bottom: 20px; }
.lead-example .lead-tile.was { width: 210px; }
.lead-example .lead-tile.was img { aspect-ratio: 4 / 5; }
.lead-example .lead-tile.was figcaption { color: var(--ink); font-weight: 600; font-size: 14px; }
.lead-arrow { font-size: 15px; max-width: 520px; }

/* шаг 3: шкала рисования с четырьмя лёгкими анимациями */
.lead-prog { max-width: 460px; margin: 0 auto; text-align: center; }
.lead-prog-view { position: relative; width: 240px; max-width: 70vw; aspect-ratio: 4 / 5; margin: 6px auto 22px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--accent-line); background: var(--panel2); perspective: 700px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.lead-prog-view.empty { display: none; }
.lead-prog-img, .lead-prog-px { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-prog-px { image-rendering: pixelated; opacity: 0; transition: opacity .5s var(--ease); }
.lead-prog-grid, .lead-prog-scan, .lead-prog-dots, .lead-prog-paint { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
/* 1. качество: фото проявляется из крупных пикселей */
.ph1 .lead-prog-px { opacity: 1; }
/* пока пиксели не загрузились, резкое фото не мелькает (замечание тестовой сессии 27.09) */
.ph1 .lead-prog-img { opacity: 0; }
/* 2. 3D-проекция: лицо поворачивается справа налево под сеткой */
.ph2 .lead-prog-img { animation: lead-turn 3.2s ease-in-out infinite alternate; }
.ph2 .lead-prog-grid { opacity: .55; animation: lead-turn 3.2s ease-in-out infinite alternate;
  background-image: linear-gradient(rgba(255, 255, 255, .28) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .28) 1px, transparent 1px);
  background-size: 24px 24px; border-radius: 50%; transform-origin: 50% 50%; }
@keyframes lead-turn { from { transform: rotateY(-32deg) scale(1.04); } to { transform: rotateY(32deg) scale(1.04); } }
/* 3. отпечаток внешности: бегущая линия и точки замера */
.ph3 .lead-prog-scan { opacity: 1; background: linear-gradient(transparent 0, rgba(139, 108, 255, .0) 42%, rgba(139, 108, 255, .55) 50%, rgba(139, 108, 255, .0) 58%, transparent 100%);
  background-size: 100% 60%; background-repeat: no-repeat; animation: lead-scan 2.2s ease-in-out infinite alternate; }
@keyframes lead-scan { from { background-position: 0 -40%; } to { background-position: 0 140%; } }
.ph3 .lead-prog-dots { opacity: 1; }
.lead-prog-dots i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(139, 108, 255, .55);
  opacity: 0; }
.ph3 .lead-prog-dots i { animation: lead-dot 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .16s); }
@keyframes lead-dot { 0%, 100% { opacity: 0; transform: scale(.4); } 40%, 70% { opacity: 1; transform: scale(1); } }
/* 4. стиль: по фото проходит кисть, краски становятся ярче */
.ph4 .lead-prog-img { animation: lead-tone 3.4s ease-in-out infinite alternate; }
@keyframes lead-tone { from { filter: saturate(1) contrast(1); } to { filter: saturate(1.9) contrast(1.12) brightness(1.06); } }
.ph4 .lead-prog-paint { opacity: 1; background: linear-gradient(115deg, transparent 30%, rgba(255, 170, 210, .5) 47%, rgba(139, 108, 255, .35) 53%, transparent 70%);
  background-size: 260% 100%; mix-blend-mode: soft-light; animation: lead-paint 2.6s linear infinite; }
@keyframes lead-paint { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.lead-prog-label { font-size: 18px; font-weight: 600; margin: 0 0 12px; min-height: 1.4em; }
.lead-prog-pct { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 16px; font-variant-numeric: tabular-nums; }
.lead-prog-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.lead-prog-steps li { position: relative; padding: 7px 12px 7px 34px; border-radius: 10px; font-size: 14px; color: var(--muted); }
.lead-prog-steps li::before { content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  border: 2px solid var(--line2); box-sizing: border-box; }
.lead-prog-steps li.now { color: var(--ink); background: var(--accent-bg); font-weight: 600; }
.lead-prog-steps li.now::before { border-color: var(--accent); background: var(--accent); animation: lead-pulse 1.2s ease-in-out infinite; }
.lead-prog-steps li.done { color: var(--ink2); }
.lead-prog-steps li.done::before { border-color: var(--accent); background: var(--accent); }
@keyframes lead-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(139, 108, 255, .55); } 50% { box-shadow: 0 0 0 6px rgba(139, 108, 255, 0); } }
@media (prefers-reduced-motion: reduce) {
  .ph2 .lead-prog-img, .ph2 .lead-prog-grid, .ph3 .lead-prog-scan, .ph3 .lead-prog-dots i, .ph4 .lead-prog-img, .ph4 .lead-prog-paint,
  .lead-bar.indet i, .lead-prog-steps li.now::before { animation: none; }
  .ph3 .lead-prog-dots i { opacity: 1; }
}
@media (max-width: 760px) {
  .lead-langbox { padding: 24px 16px 18px; margin-top: 0; border-radius: 18px; }
  .lead-langs { grid-template-columns: 1fr; }
  .lead-photo { grid-template-columns: 1fr; gap: 18px; padding: 14px; text-align: left; }
  .lead-photo-sample { max-width: 200px; margin: 0 auto; }
  .lead-photo-head { text-align: center; }
  .lead-photo-btn { flex: 1 1 100%; min-height: 56px; }
  .lead-photo-hint { display: none; }
  .lead-mine { flex-direction: column; align-items: center; flex-wrap: nowrap; padding: 14px; }
  .lead-mine .lead-tile.was { width: 180px; padding: 8px; }
  .lead-mine .lead-tile.was figcaption { font-size: 14px; }
  .lead-mine-text p { font-size: 14px; }
  .lead-example .lead-tile.was { width: 180px; }
  .lead-me { gap: 6px; }
  .lead-me #leadBalance { display: none; }
  /* 20.10: «Пополнить / промокод» видна с первого шага; в узкой шапке она выталкивала «Выйти» за
     край экрана. Ряд переносится, а пополнение идёт своей строкой во всю ширину. */
  .lead-me { flex-wrap: wrap; width: 100%; }
  .lead-me .lead-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .lead-me #leadTopup { order: 10; flex: 1 1 100%; min-height: 40px; }
}
/* клиент после оплаты: кабинет тот же, но без того, что нужно только исполнителю */
body.путь-клиент #folderLine, body.путь-клиент #folderNote, body.путь-клиент .new-head label.touch-hide,
body.путь-клиент #fFolderNote { display: none !important; }
/* 28.09: в браузере папки на диске нет — остаётся только «Скачать всё архивом» */
body.в-браузере #folderLine > span, body.в-браузере #folderPickBtn, body.в-браузере #folderOpenBtn,
body.в-браузере #folderNote, body.в-браузере .new-head label.touch-hide,
body.в-браузере #fFolderNote { display: none !important; }

/* ── новый дизайн 27.09: крупные заголовки, цвета шагов, живые карточки, живая рамка ────── */
.lead-title, .welcome h2, .lead-part, .lead-next h2, .lead-photo-head, .lead-cam-box h2, .lead-prog-pct, .pack b,
.lead-langbox .lead-title { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; }
.lead-title { font-size: 28px; line-height: 1.18; }
.lead-part { font-size: 18px; }
.lead-photo-head, .lead-next h2 { font-size: 17px; }
.lead { background: radial-gradient(900px 420px at 15% -8%, rgba(255, 106, 61, .10), transparent 60%),
  radial-gradient(900px 460px at 90% -10%, rgba(139, 108, 255, .14), transparent 60%), var(--bg); }
.lead-top { background: rgba(17, 15, 23, .82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
/* метка шага: у каждого свой цвет */
/* без заглавных: «КРОК 1 З 5» читалось как «1 3 5» */
.lead-num { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px;
  text-transform: none; letter-spacing: .01em;
  --c: var(--accent2); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.lead-num::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.lead-num.n1 { --c: #FF8A5C; } .lead-num.n2 { --c: #B7A6FF; } .lead-num.n3 { --c: #2DD4E8; }
.lead-num.n4 { --c: #C8F545; } .lead-num.n5 { --c: #FF6F9A; }
.lead-step > .lead-num { display: flex; width: fit-content; margin: 0 0 12px; }
/* шаг стиля и шкала рисования стоят по центру — метка тоже */
.lead-step:has(.lead-mine, .lead-prog, .lead-langbox) > .lead-num { margin: 0 auto 14px; }
/* карточки стилей оживают под пальцем и курсором */
button.lead-tile { transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease); }
button.lead-tile:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--accent-line);
  box-shadow: 0 18px 40px -18px rgba(139, 108, 255, .65); }
button.lead-tile img { transition: transform .5s var(--ease); }
button.lead-tile:hover:not(:disabled) img { transform: scale(1.04); }
.lead-tile { border-radius: 16px; background: var(--panel); }
.lead-tile img { border-radius: 11px; }
.lead-req-ok { background: var(--ok); color: #151C04; }
.lead-bar i { background: linear-gradient(90deg, #FF6A3D, #8B6CFF, #2DD4E8); }
.lead-drop b, .lead-pill.on { background: var(--cta); border-color: transparent; color: var(--cta-ink); }
.lead-badge.mine { background: var(--cta); color: var(--cta-ink); }
.lead-langbox, .lead-photo { border-radius: 24px; }
.welcome-card { background: linear-gradient(160deg, rgba(255, 106, 61, .09), rgba(139, 108, 255, .07) 45%, transparent 70%), var(--panel); border-radius: 16px; }
.welcome-card:hover { box-shadow: 0 16px 36px -18px rgba(139, 108, 255, .6); }
a:hover { color: #D6CCFF; }
.hero-pill .ico, .lead-num { flex: none; }
/* живая рамка: только у главной кнопки шага и входа — одна на экран */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.lead-go, .login-card .btn.primary.wide {
  border: 2px solid transparent;
  background: var(--cta) padding-box,
    conic-gradient(from var(--a), #FF6A3D, #FFC53D, #FF3D8B, #8B6CFF, #2DD4E8, #FF6A3D) border-box;
  animation: cta-ring 4s linear infinite; }
.lead-go:hover, .login-card .btn.primary.wide:hover {
  background: var(--cta) padding-box, conic-gradient(from var(--a), #FF6A3D, #FFC53D, #FF3D8B, #8B6CFF, #2DD4E8, #FF6A3D) border-box; }
@keyframes cta-ring { to { --a: 360deg; } }
.btn.primary, .lead-go { border-radius: 12px; }
/* в боковой панели главная — «Новый заказ»; «Пополнить» вторая: фиолетовая рамка, как в образце */
.side-foot #topupBtn { background: var(--panel2); border: 1px solid var(--accent-line); color: var(--ink); box-shadow: none; font-weight: 600; filter: none; }
.side-foot #topupBtn:hover { background: var(--accent-bg); }
@media (prefers-reduced-motion: reduce) {
  .lead-go, .login-card .btn.primary.wide { animation: none; }
  button.lead-tile:hover:not(:disabled), button.lead-tile:hover:not(:disabled) img { transform: none; }
}
@media (max-width: 760px) {
  .lead-title { font-size: 22px; }
  .brand-name { font-size: 16px; }
}

/* 27.09: галочка согласия наверху экрана входа; подсветка, когда вход ждёт только её */
#loginMail > label.consent { margin-bottom: 14px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 12px; text-align: left; }
label.consent.нужно { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-line); }
/* 27.09, владелец: сначала галочка, потом вход. Нажали вход без неё — рамка дёргается,
   в квадрате мигает галочка. Накладка лежит поверх кнопки Google, пока галочки нет. */
.consent-box { position: relative; flex: none; display: inline-flex; width: 18px; height: 18px; margin: 1px 0 0; }
label.consent .consent-box input { margin: 0; }
.consent-hint { position: absolute; inset: 0; width: 18px; height: 18px; color: var(--accent); opacity: 0; pointer-events: none; }
label.consent.нужно .consent-hint { animation: consent-blink 1s ease-in-out infinite; }
label.consent.нужно input { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
label.consent.тряска { animation: consent-shake .45s ease-in-out; }
@keyframes consent-blink { 0%, 100% { opacity: 0; } 50% { opacity: 1; } }
@keyframes consent-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.google-wrap { position: relative; }
.google-guard { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { label.consent.тряска { animation: none; } }
.inapp-note { color: var(--ink); border-left: 3px solid var(--accent); padding: 6px 10px; margin: 0 0 12px; text-align: left; }

/* ── плашка оплаты (14.10): платёж на проверке, ждёт банк, не прошёл, получен ── */
.pay-note { position: fixed; left: 50%; transform: translateX(-50%); top: calc(76px + env(safe-area-inset-top)); z-index: 70;
  width: min(640px, calc(100% - 32px)); padding: 12px 16px; font-size: 14px; line-height: 1.45; color: var(--ink);
  background: var(--panel2); border: 1px solid var(--accent-line); border-left: 4px solid var(--accent); border-radius: 12px;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .8); }
.pay-note[data-state="held"], .pay-note[data-state="ok"] { border-left-color: #4ade80; }
.pay-note[data-state="failed"] { border-left-color: #f87171; }

/* ── поддержка: вопросы и ответы, чат (27.09) ── */
.sup-fab { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 60;
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px 0 13px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); background: var(--panel2); border: 1px solid var(--accent-line); border-radius: 999px; cursor: pointer;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .8); -webkit-tap-highlight-color: transparent; }
.sup-fab:hover { background: var(--panel3); border-color: var(--accent); }
.sup-fab .ico { width: 20px; height: 20px; color: var(--accent2); }
/* в рабочем кабинете внизу поле переписки: плавающую кнопку заменяет кнопка в меню */
body:has(#shell:not([hidden])) .sup-fab { display: none; }
body:has(.modal:not([hidden])) .sup-fab { display: none; }
/* на экране входа поддержка — кнопка в карточке: плавающая закрывала бы «Получить код» */
body:has(#login:not([hidden])) .sup-fab { display: none; }
.login-card .login-support { margin: 4px 0 0; gap: 8px; }
.login-card .login-support .ico { width: 18px; height: 18px; color: var(--accent2); }
.login-card > p.tiny:last-child { border-top: 0; padding-top: 0; margin-top: 12px; }
.sup-panel { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 70;
  width: 390px; max-width: calc(100vw - 32px); height: 600px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .85); }
.sup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.sup-title { font-weight: 700; font-size: 15px; }
.sup-close { min-height: 36px; width: 36px; padding: 0; justify-content: center; }
.sup-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.sup-tab { flex: 1; font: inherit; font-size: 13.5px; font-weight: 600; min-height: 38px; color: var(--muted); background: none; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.sup-tab.active { color: var(--ink); background: var(--panel3); border-color: var(--line2); }
.sup-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 16px; -webkit-overflow-scrolling: touch; }
.sup-q { border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); margin-bottom: 8px; }
.sup-q summary { cursor: pointer; padding: 12px 14px; font-weight: 600; font-size: 14px; line-height: 1.4; list-style-position: inside; }
.sup-q summary::marker { color: var(--accent2); }
.sup-q[open] { border-color: var(--accent-line); }
.sup-q p { margin: 0; padding: 0 14px 14px; font-size: 13.5px; line-height: 1.6; color: var(--ink2); }
.sup-more { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 14px; }
.sup-more a { font-size: 13px; }
.sup-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sup-chat[hidden] { display: none; }
.sup-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.sup-msg { max-width: 86%; margin: 0; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.sup-msg.me { align-self: flex-end; background: var(--accent-bg); border: 1px solid rgba(139, 108, 255, .22); border-bottom-right-radius: 4px; }
.sup-msg.us { align-self: flex-start; background: var(--bg2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.sup-msg.admin { border-color: rgba(139, 108, 255, .45); }
.sup-from { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--accent2); }
.sup-typing { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.sup-typing span { margin-right: 4px; }
.sup-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent2); animation: sup-dot 1.2s ease-in-out infinite; }
.sup-typing i:nth-child(3) { animation-delay: .2s; }
.sup-typing i:nth-child(4) { animation-delay: .4s; }
@keyframes sup-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.sup-form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg2); }
.sup-form input { flex: 1; min-width: 0; min-height: 44px; font-size: 16px; }
.sup-form .btn { min-height: 44px; white-space: nowrap; }
.sup-err { margin: 0; padding: 0 14px 8px; background: var(--bg2); }
.sup-err:empty { display: none; }
@media (max-width: 600px) {
  .sup-panel { right: 0; bottom: 0; left: 0; top: 0; width: auto; max-width: none; height: auto; max-height: none; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); }
  /* в мастере на телефоне — круглая кнопка без подписи, и место под неё внизу страницы */
  .sup-fab { width: 48px; min-height: 48px; padding: 0; justify-content: center; }
  .sup-fab span { display: none; }
  .lead-body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .sup-typing i { animation: none; opacity: .7; } }
