/* Grace Shorts — интерфейс клиентки. Тёмная тема, мобайл-фёрст:
   заходить будут с того же телефона, с которого снимали. */

:root {
  --bg: #0c0c11;
  --surface: #14141c;
  --surface-2: #1c1c27;
  --line: #262633;
  --text: #f2f2f5;
  --dim: #9a9aac;
  --hero: #e8734a;
  --ok: #3ddc97;
  --bad: #ff6b6b;
  --radius: 16px;
}

* { box-sizing: border-box; }

/* Атрибут hidden прячет элемент через display:none в стилях браузера,
   но ЛЮБОЕ авторское правило display перебивает его по специфичности.
   Это ловилось трижды: плеер, крестики очистки файлов, блок прогресу.
   Одно правило закрывает все случаи разом. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.centered {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 64px;
  display: grid;
  gap: 20px;
}

/* ------------------------------------------------------------- шапка и типо */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 20px;
}
.logo span { color: var(--hero); }

h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 18px; letter-spacing: -0.01em; margin: 0 0 12px; }
.muted { color: var(--dim); }
.muted.empty { padding: 8px 0 4px; }

/* ---------------------------------------------------------------- контейнеры */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.card.login {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  text-align: center;
}
.card.login .logo { margin-bottom: 4px; }

/* --------------------------------------------------------------- поля, кнопки */

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  transition: border-color 0.18s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--hero);
}
textarea { resize: vertical; }

button, .btn {
  display: inline-block;
  background: var(--hero);
  color: #14100e;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: 600 15px/1 inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), filter 0.15s ease;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button:active, .btn:active { transform: scale(0.97); }

.ghost {
  color: var(--dim);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: color 0.15s ease;
}
.ghost:hover { color: var(--text); }

/* .ghost на <button> перебивался базовым правилом button — вторая
   оранжевая кнопка рядом с главной сбивала с толку. */
button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  font-weight: 500;
}
button.ghost:hover { filter: none; border-color: #3a3a4a; }

.alert {
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.32);
  color: #ffc9c9;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.alert.small { margin-top: 8px; font-size: 13px; }

/* -------------------------------------------------------------- зона загрузки */

.drop {
  margin-top: 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.drop:hover, .drop.over {
  border-color: var(--hero);
  background: #21202b;
}
.drop.over { transform: scale(1.01); }
.drop.busy { pointer-events: none; opacity: 0.6; }

.drop-inner { display: grid; gap: 6px; justify-items: center; }
.drop-inner strong { font-size: 17px; }

.drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--hero);
  position: relative;
  margin-bottom: 6px;
}
.drop-icon::before,
.drop-icon::after {
  content: "";
  position: absolute;
  background: var(--hero);
  border-radius: 2px;
}
.drop-icon::before { width: 2px; height: 20px; left: 19px; top: 10px; }
.drop-icon::after  { width: 20px; height: 2px; left: 10px; top: 19px; }

.options { margin-top: 16px; }
.options summary {
  cursor: pointer;
  color: var(--dim);
  font-size: 14px;
  padding: 6px 0;
}
.options label {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  font-size: 14px;
  color: var(--dim);
}
.options output { color: var(--text); font-size: 14px; }

input[type="range"] { accent-color: var(--hero); }

.upload-state { margin-top: 16px; display: grid; gap: 8px; }

/* ------------------------------------------------------------------- прогресс */

.bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--hero);
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.pill {
  display: inline-block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 13px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------- список работ */

.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.job {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.job-main { min-width: 0; flex: 1; }
.job-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.job-meta { font-size: 13px; color: var(--dim); margin-top: 2px; }
.job-meta .dot { margin: 0 6px; }
.job-side { display: grid; gap: 6px; justify-items: end; flex-shrink: 0; }

.job.status-done { border-color: rgba(61, 220, 151, 0.3); }
.job.status-failed { border-color: rgba(255, 107, 107, 0.3); }

/* ------------------------------------------------------------------- детали */

.preview {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background: #000;
  display: block;
  margin: 16px auto 12px;
}
#player { display: grid; justify-items: center; }

.segments { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.segments .tc {
  font-variant-numeric: tabular-nums;
  color: var(--hero);
  margin-right: 8px;
}
.seg-why { color: var(--dim); }

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ev { display: flex; gap: 10px; }
.ev-time { color: var(--dim); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ev.error .ev-msg { color: var(--bad); }
.ev.warn .ev-msg { color: #ffd479; }

@media (max-width: 520px) {
  .job { flex-direction: column; align-items: stretch; }
  .job-side { justify-items: stretch; }
}

/* ================================================================
   Настройки монтажа
   ================================================================ */

.group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 18px 0 0;
}
.group legend {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
}

.small { font-size: 13px; }
.lbl {
  display: block;
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 8px;
}

.field { display: block; margin: 14px 0; }
.field:first-of-type { margin-top: 0; }

.row { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.col { flex: 1 1 200px; }

select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

/* ------------------------------------------------- карточки выбора */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }

.pick-body {
  display: block;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  height: 100%;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.pick:hover .pick-body { border-color: #3a3a4a; }

/* Выбранная карточка держится на цвете и рамке, без «галочки»:
   на телефоне мелкий индикатор всё равно не читается. */
.pick input:checked + .pick-body {
  border-color: var(--hero);
  background: #241a16;
}

.pick-title { display: block; font-weight: 600; font-size: 15px; }
.pick-hint {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  margin-top: 3px;
  line-height: 1.35;
}

/* ------------------------------------------------ переключатель-лента */

.seg {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg label { flex: 1; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  text-align: center;
  padding: 9px 6px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--dim);
  transition: background 0.16s ease, color 0.16s ease;
}
.seg input:checked + span {
  background: var(--hero);
  color: #14100e;
  font-weight: 600;
}

/* ------------------------------------------------------- палитры */

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.swatch { cursor: pointer; text-align: center; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }

.swatch-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 74px;
  height: 46px;
  border-radius: 10px;
  border: 2px solid var(--line);
  transition: border-color 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.swatch-body i { width: 14px; height: 14px; border-radius: 50%; }
.swatch input:checked + .swatch-body {
  border-color: var(--text);
  transform: scale(1.06);
}
.swatch-label { display: block; font-size: 12px; color: var(--dim); margin-top: 5px; }

/* ------------------------------------------------------ выключатели */

.switches { display: grid; gap: 4px; margin-top: 16px; }

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0;
  font-size: 14.5px;
}
.switch input {
  appearance: none;
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background 0.18s ease;
}
.switch input:checked { background: var(--hero); border-color: var(--hero); }
.switch input:checked::after { transform: translateX(18px); background: #14100e; }

/* ------------------------------------------------- доп. файлы */

.extras { display: grid; gap: 8px; margin-top: 12px; }

.filepick {
  position: relative;
  display: grid;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 44px 12px 14px;
  cursor: pointer;
  transition: border-color 0.16s ease;
}
.filepick:hover { border-color: #3a3a4a; }
.filepick-title { font-weight: 600; font-size: 14.5px; }
.filepick-name { font-size: 13px; }
.filepick-hint { font-size: 12.5px; line-height: 1.35; }

.clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  background: var(--line);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
}

/* --------------------------------------------------------- прочее */

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.actions button[type="submit"] { flex: 1 1 220px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button:disabled:active { transform: none; }

/* Громкость видео имеет смысл только при отдельной начитке. */
.dim { opacity: 0.45; }

@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .group { padding: 14px 12px; }
}

/* Свёрнутые группы настроек */
.group summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.group summary::-webkit-details-marker { display: none; }
.group summary::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--dim);
  border-bottom: 2px solid var(--dim);
  transform: rotate(-45deg);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
.group[open] summary::before { transform: rotate(45deg); }
.group[open] summary { margin-bottom: 12px; }

/* ------------------------------------------- пакет роликов и режим звука */

.videolist {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.videoitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 44px 10px 12px;
  font-size: 14px;
}
.vi-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--dim);
  font-size: 12px;
  display: grid;
  place-items: center;
}
.vi-name {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vi-size { flex-shrink: 0; font-size: 13px; }

.voicemode { margin-top: 18px; }
.voicemode .seg { margin-bottom: 8px; }

.aivoice {
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.aivoice .field:first-child { margin-top: 0; }

/* Голосов много и подписи короткие — колонки уже, чем у кейсов монтажа. */
.voices { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }

/* ------------------------------------------------- удаление и место */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.section-head h2 { margin-bottom: 0; }

.usage { margin: 14px 0 18px; }
.usage-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
}
.usage .bar { margin-top: 8px; }
/* Когда места почти нет, полоса должна кричать, а не сливаться с интерфейсом. */
.usage.hot .bar-fill { background: var(--bad); }

button.ghost.danger { color: #ff9b9b; }
button.ghost.danger:hover {
  color: #fff;
  background: rgba(255, 107, 107, 0.16);
  border-color: rgba(255, 107, 107, 0.4);
}

.job-actions { margin-top: 14px; display: flex; justify-content: center; }

/* Начитка без пары: файлов больше, чем видео. */
.videoitem.extra { border-color: rgba(255, 107, 107, 0.4); }
.videoitem.extra .vi-size { color: #ff9b9b; }

/* ---------------------------------------------- живе прев'ю субтитрів */

/* Прев'ю і налаштування стоять в ОДНОМУ рядку сітки. Це навмисно:
   grid-область прев'ю тягнеться на всю висоту колонки з налаштуваннями,
   тому sticky тримає кадр на екрані, поки гортаєш стилі. Якби прев'ю
   стояло окремим рядком, воно відклеїлося б одразу після себе. */
.capgrid {
  display: grid;
  grid-template-columns: clamp(112px, 30%, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.stage { position: sticky; top: 10px; }

.stage-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}

.stage-video,
.stage-fill,
.stage-tint,
.stage-grade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.stage-video { object-fit: cover; }
.stage-tint { mix-blend-mode: soft-light; opacity: 0.14; }
.stage-grade {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.28),
    transparent 24%,
    transparent 62%,
    rgba(0, 0, 0, 0.45)
  );
}

/* Кадр малюється в справжніх 1080x1920 і масштабується цілком —
   так усі розміри збігаються з рендером до пікселя. */
.stage-scale {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1920px;
  transform-origin: top left;
  pointer-events: none;
}

.stage-caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 72px;
}

.stage-note {
  margin: 6px 0 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.3;
  word-break: break-word;
}

.cap-block {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  animation: capIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes capIn {
  from { opacity: 0; transform: translateY(46px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

.cap-w {
  position: relative;
  display: inline-block;
  white-space: pre;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
.cap-plate { position: absolute; border-radius: 14px; z-index: 0; }
/* Обводка окремим шаром під заливкою: центрована обводка з'їдає букву. */
.cap-stroke { position: absolute; left: 0; top: 0; color: transparent; }
.cap-fill { position: relative; z-index: 1; }
.cap-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 8px;
  border-radius: 4px;
  z-index: 1;
}

/* ------------------------------------------------------- вибір шрифту */

.fontpicks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.fontpick { position: relative; cursor: pointer; }
.fontpick input { position: absolute; opacity: 0; pointer-events: none; }

.fontpick-body {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 12px;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.fontpick:hover .fontpick-body { border-color: #3a3a4a; }
.fontpick input:checked + .fontpick-body {
  border-color: var(--hero);
  background: rgba(232, 115, 74, 0.09);
}

/* Зразок — самим шрифтом, підпис — інтерфейсним: назву рукописного
   семейства його ж накресленням не прочитати. */
.fontpick-sample {
  display: block;
  font-size: 25px;
  line-height: 1.15;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
}
.fontpick-name { display: block; font-size: 13px; font-weight: 600; }
.fontpick-hint { display: block; font-size: 11.5px; color: var(--dim); line-height: 1.3; }

/* Спокійні субтитри не з'являються рухом — прев'ю має показувати
   рівно те, що буде в ролику, включно з відсутністю анімації. */
.cap-block.cap-still { animation: none; }
.cap-still .cap-w { transition: none; }

/* ------------------------------------------------ довідка та перемонтаж */

.group.how { border-color: #2f2f3d; }
.group.how p { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: var(--dim); }
.group.how p:last-child { margin-bottom: 0; }
.group.how strong { color: var(--text); font-weight: 600; }
.group.how ul { margin: 0 0 10px; padding-left: 20px; }
.group.how li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--dim);
  margin-bottom: 6px;
}

.repeat {
  display: grid;
  gap: 8px;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.repeat-name { font-weight: 600; word-break: break-word; }

/* Кнопка-ссылка второго плана рядом с основной. */
.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.ghost-btn:hover { border-color: var(--hero); }

.job-actions { gap: 10px; flex-wrap: wrap; }

/* --------------------------------------------- ритм нарізки на картці */

/* Смужка показує, з яких за довжиною склейок збереться ролик.
   Ширини беруться з тих самих minCut/maxCut, якими ріже воркер. */
.rhythm {
  display: flex;
  gap: 3px;
  height: 10px;
  margin: 10px 0 8px;
}
.rhythm i {
  display: block;
  min-width: 4px;
  border-radius: 3px;
  background: #3a3a4a;
  transition: background 0.16s ease;
}
.rhythm i.punch { background: #5a4033; }

.pick input:checked + .pick-body .rhythm i { background: #4a4a5e; }
.pick input:checked + .pick-body .rhythm i.punch { background: var(--hero); }

.pick-facts {
  display: block;
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.pick-detail {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--dim);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.pick input:checked + .pick-body .pick-detail { color: #c2c2d0; }

/* ------------------------------------- прийоми утримання в прев'ю */

/* Розмита копія кадру під основним — так виглядає режим «ціле відео». */
.stage-blur {
  object-fit: cover;
  filter: blur(18px) brightness(0.82) saturate(0.9);
  transform: scale(1.1);
}

.stage-progress {
  position: absolute;
  left: 60px;
  right: 60px;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.stage-progress i { display: block; width: 62%; height: 100%; border-radius: 5px; }

.stage-counter {
  position: absolute;
  left: 60px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 14px 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  line-height: 1;
}
.stage-counter b { font-size: 54px; font-weight: 800; }
.stage-counter span { font-size: 38px; font-weight: 700; color: rgba(255, 255, 255, 0.65); }

/* Зони, які перекриває інтерфейс площадки. */
.stage-safe { position: absolute; inset: 0; pointer-events: none; }
.stage-safe i {
  position: absolute;
  left: 0;
  right: 0;
  display: block;
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 107, 107, 0.28) 0 10px,
    transparent 10px 20px
  );
  border-color: rgba(255, 107, 107, 0.55);
  border-style: solid;
  border-width: 0;
}
.stage-safe .safe-top { top: 0; border-bottom-width: 2px; }
.stage-safe .safe-bottom { bottom: 0; border-top-width: 2px; }

.stage-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--dim);
  cursor: pointer;
  line-height: 1.3;
}
.stage-toggle input { flex-shrink: 0; accent-color: var(--hero); }

/* Порядок відео задає, що буде на екрані під якою фразою начитки. */
.vi-move {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 13px;
  line-height: 1;
}
.vi-move:hover:not(:disabled) { color: var(--text); border-color: var(--hero); }
.vi-move:disabled { opacity: 0.3; cursor: default; }

.repeat-note { margin: 14px 0 0; text-align: center; }

/* ------------------------------------------------------- айфон */

/* Нижній край екрана в айфона перекриває смуга «додому».
   Без цього відступу остання кнопка ховається під нею. */
main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.topbar { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }

@media (max-width: 620px) {
  /* Форма довга, а кнопка монтажу — в самому низу. Тримаємо її на екрані:
     інакше з телефона до неї треба гортати повз усі налаштування. */
  .actions {
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 6;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  }

  /* Пальцем у дрібну ціль не влучиш. 44 px — мінімум, який Apple
     називає зручним для дотику. */
  .seg span { padding-top: 12px; padding-bottom: 12px; }
  .vi-move { width: 34px; height: 34px; }
  .clear { min-width: 34px; min-height: 34px; }
  input[type="range"] { height: 34px; }
}
