/* kadroom pages. Tokens and primitives live in tokens.css. */

/* ---- layout ---- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 80px max(16px, env(safe-area-inset-left)); }
.narrow { max-width: 420px; margin: 0 auto; padding: 72px 16px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 22px; }
.nav a:not(.logo) { color: var(--dim); text-decoration: none; font-size: 14px; }
.nav a:not(.logo):hover { color: var(--fg); }
.nav a.btn-blue, .nav a.btn-blue:hover { color: #fff; }

.nav-links { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; justify-content: flex-end; white-space: nowrap; }
.site-links { display: none; gap: 14px; }
@media (min-width: 720px) { .site-links { display: flex; } .nav-links { gap: 16px; } }
@media (max-width: 719px) { .nav a:not(.logo), .linklike { font-size: 13px; } .nav .btn-sm { min-height: 34px; padding: 0 10px; } }
.linklike { background: none; border: 0; padding: 0; color: var(--dim); font: inherit; font-size: 14px; cursor: pointer; }
.linklike:hover { color: var(--fg); }
header.wrap { padding-bottom: 0; }

/* ---- landing ---- */
.hero { padding-top: 8px; }
.hero-grid { display: grid; gap: 20px; grid-template-areas: "text" "wave" "upload"; }
.hero-text { grid-area: text; } .hero-grid .wave-card { grid-area: wave; margin: 0; } .hero-grid .upload-col { grid-area: upload; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; grid-template-areas: "text wave" "text upload"; gap: 20px 40px; align-items: start; }
  .hero { padding-top: 32px; padding-bottom: 40px; }
}
h1.hero { font: 800 clamp(34px, 7.2vw, 72px)/1.0 var(--display); letter-spacing: -.025em; margin: 8px 0 18px; overflow-wrap: anywhere; }
h1.hero em { font-style: normal; color: var(--blue); }
.lede { color: var(--muted); font-size: clamp(16px, 2vw, 19px); margin: 0 0 18px; max-width: 46ch; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.pill { font: 500 12px var(--mono); padding: 9px 12px; border-radius: 999px; border: 1px solid var(--rule); background: #fff; }
.pill-blue { color: var(--blue); border-color: #4f3bff55; }
.section { padding: 40px 16px; }
@media (min-width: 900px) { .section { padding: 64px 16px; } }
.section-head { max-width: 640px; margin-bottom: 24px; }
.h2 { font: 700 clamp(24px, 3.6vw, 36px)/1.1 var(--display); letter-spacing: -.02em; margin: 8px 0 12px; }
.cards3, .steps3 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards3, .steps3 { grid-template-columns: repeat(3, 1fr); } }
.cards3 .card h3, .step h3 { font: 600 17px var(--body); margin: 8px 0 8px; }
.cards3 .card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.cards3 .card li + li { margin-top: 6px; }
.tag { font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--blue); }
.step { background: #fff; border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.step-n { font: 600 12px var(--mono); color: var(--blue); }
.price { display: grid; gap: 20px; padding: 24px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (min-width: 900px) { .price { grid-template-columns: 1.2fr 1fr; align-items: center; padding: 32px; } }
.price .eyebrow { color: var(--muted-d); }
.price-num { font: 700 clamp(22px, 3vw, 32px)/1.15 var(--display); letter-spacing: -.02em; margin-top: 10px; }
.price-sub { color: var(--muted-d); margin: 10px 0 0; }
.price-was { color: var(--muted-d); text-decoration: line-through; font-size: .6em; font-weight: 500; margin-right: .3em; vertical-align: .12em; white-space: nowrap; }
.price-note { color: var(--muted-d); font-size: 13px; margin: 8px 0 0; }
/* ---- page heading + status tiles ---- */
.page-h1 { font: 700 clamp(22px, 3.4vw, 30px)/1.1 var(--display); letter-spacing: -.02em; margin: 4px 0 6px; }
.page-lede { color: var(--muted); margin: 0 0 20px; max-width: 46ch; }
.narrow-page { max-width: 640px; }
.statusbar { display: grid; gap: 10px; margin: 0 0 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .statusbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile b { font-size: 14px; font-weight: 600; }
.tile span { font-size: 13px; color: var(--muted); }
.tile-ok { border-color: #3fbf7f55; background: #3fbf7f0f; }
.tile-ok b { color: #2e9c64; }
.tile-warn { border-color: #ff4d3d55; background: #ff4d3d0d; }
.tile-warn b { color: var(--cut); }
.tile-act { margin-left: auto; flex: none; align-self: center; font: 500 13px var(--body); color: var(--blue); background: none; border: 0; padding: 8px 0 8px 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.tile-act:hover { text-decoration: underline; }

/* ---- the upload page's Telegram pitch ---- */
.tg-pitch { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.tg-copy { flex: 1 1 260px; min-width: 0; }
.tg-pitch h3 { margin: 0 0 4px; font: 600 16px var(--body); }
.tg-pitch p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { padding-left: 26px; position: relative; line-height: 1.45; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--violet); font-weight: 700; }
.card .checks li::before { color: var(--blue); }
.faq details { border-top: 1px solid var(--rule); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--muted); font: 500 18px var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.foot { display: flex; justify-content: space-between; padding: 24px 16px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--rule); }
.foot a { color: var(--muted); text-decoration: none; }
.sub-hero { max-width: 520px; margin: 0 auto; padding: 24px 0 60px; display: flex; flex-direction: column; gap: 12px; }
.sub-card { display: flex; flex-direction: column; gap: 18px; padding: 22px; }

.wave-card { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 28px); margin: 0 0 18px; position: relative; overflow: hidden; }
.wave-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.wave-card .eyebrow { color: var(--muted-d); }
.wave-clock { font: 600 clamp(22px, 3.4vw, 28px) var(--mono); font-variant-numeric: tabular-nums; margin-top: 4px; }
.wave-clock .to { opacity: .35; margin-inline: 8px; font-weight: 400; }
.wave-clock .out { color: var(--violet); }
.wave { display: flex; align-items: center; gap: 2px; height: 80px; margin-bottom: 16px; overflow: hidden; }
@media (min-width: 900px) { .wave { height: 96px; } }
.wave .bar {
  flex: 0 0 auto; width: 4px; height: 8px; border-radius: 2px; background: #5F5A72;
  transition: height .45s var(--ease), width .55s cubic-bezier(.6, 0, .2, 1), margin .55s cubic-bezier(.6, 0, .2, 1), background-color .3s, opacity .35s;
}
.wave .bar.keep { background: var(--violet); }
.wave .bar.dead { background: var(--cut); }
.wave .bar.gone { width: 0; margin-inline: -1px; opacity: 0; }
.wave-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.wave-note { font-size: 14px; opacity: .6; max-width: 38ch; margin: 0; }
.replay { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; background: none; border: 1px solid rgba(251, 250, 247, .28); color: var(--paper); border-radius: 999px; padding: 10px 14px; min-height: 40px; cursor: pointer; }
.replay:hover { border-color: var(--paper); }

.drop { border: 1.5px dashed #C9C5BB; border-radius: var(--r-lg); padding: 30px 16px; text-align: center; background: #fff; transition: border-color .15s, background .15s; }
.drop.over { border-color: var(--blue); background: #f6f5ff; }
.drop .t { font: 600 17px var(--body); margin: 0 0 6px; }
.drop .fine { margin: 0 0 16px; }
.fine { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0 0; }
.upload-col { display: flex; flex-direction: column; gap: 14px; }

/* ---- job card (landing upload, waiting page) ---- */
.jobcard { display: flex; flex-direction: column; gap: 4px; }
.job { display: flex; gap: 14px; align-items: flex-start; }
.thumb { width: 64px; height: 112px; border-radius: 12px; background: linear-gradient(160deg, #3d3a56, #141218); flex: none; object-fit: cover; display: block; }
.job h3 { margin: 0 0 2px; font: 600 15px var(--body); overflow-wrap: anywhere; }
.job .meta { font: 500 12px var(--mono); color: var(--muted-d); }
.job .bar { margin: 10px 0 6px; }
.job .phase { font-size: 13px; color: var(--muted-d); }
.job .jc-cancel { margin-top: 6px; font-size: 13px; }
.tg-cta { margin: 10px 0 0; font-size: 14px; color: var(--dim); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.job .phase.ok { color: var(--ok); }
.stages { list-style: none; padding: 0; margin: 14px 0 0; }
.stages li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--rule-d); color: var(--muted-d); }
.stages li .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--rule-d); display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.stages li.done { color: var(--paper); }
.stages li.done .dot { background: var(--violet); border-color: var(--violet); color: var(--ink); font-weight: 700; }
.stages li.cur { color: var(--paper); font-weight: 500; }
.stages li.cur .dot { border-color: var(--violet); border-top-color: transparent; animation: spin 1s linear infinite; }
.stages li .eta { margin-left: auto; flex: none; white-space: nowrap; font: 500 12px var(--mono); color: var(--muted-d); font-variant-numeric: tabular-nums; }
.ready-at { color: var(--muted); font-size: 14px; margin: 14px 2px; }
.ready-at b { color: var(--fg); font-family: var(--mono); }
#login-card { text-align: center; }
#login-card .btn { width: 100%; }
#status-error { margin: 12px 0 0; }

/* ---- editor ---- */
body.ink .editor { display: block; }
.editor .left { display: flex; flex-direction: column; gap: 14px; }
.editor .right { position: relative; }
.stick { position: sticky; top: 0; z-index: 4; background: var(--ink); padding: 8px 0 10px; border-bottom: 1px solid var(--rule-d); margin: 0 -16px; padding-inline: 16px; display: flex; flex-direction: column; gap: 10px; }
.player { background: #000; border-radius: 16px; position: relative; overflow: hidden; }
.player video { width: 100%; display: block; max-height: 42vh; background: #000; }
.player .time { position: absolute; left: 12px; top: 10px; font: 600 12px var(--mono); color: #fff; text-shadow: 0 1px 2px #000; pointer-events: none; }
.map { background: var(--ink-2); border: 1px solid var(--rule-d); border-radius: 14px; padding: 8px 10px 6px; }
.map-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tog { display: flex; gap: 2px; background: var(--ink-3); border-radius: 8px; padding: 2px; }
.tog button { font: 500 11px var(--mono); padding: 5px 9px; min-height: 28px; border-radius: 6px; color: var(--muted-d); background: none; border: 0; cursor: pointer; }
.tog button.on { background: var(--ink); color: var(--paper); }
canvas.tl { width: 100%; height: 34px; display: block; cursor: pointer; touch-action: none; }
.legend { display: none; gap: 14px; margin-top: 6px; font: 500 11px var(--mono); color: var(--muted-d); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.summary { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.summary b { font: 600 18px var(--mono); font-variant-numeric: tabular-nums; }
.summary .arrow { opacity: .4; }
.summary .to { color: var(--violet); }
.summary .spacer { margin-left: auto; }
.btn-settings { background: var(--surface-2); border-color: transparent; color: var(--fg); }
.styles { display: none; flex-direction: column; gap: 14px; }
/* Превью шаблона субтитров: полоски = слова карточки, средняя — то, что шаблон делает с активным. */
.seg .pv { height: 36px; border-radius: 8px; background: #000; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 3px; }
.seg .pv i { display: inline-block; background: #fff; border-radius: 2px; width: 13px; height: 8px; }
.seg .pv.cards i:nth-child(2), .seg .pv.pop i:nth-child(2) { background: #ffd400; }
.seg .pv.pop i:nth-child(2) { transform: scale(1.3); }
.seg .pv.pill i:nth-child(2) { background: var(--violet); width: 19px; height: 12px; border-radius: 6px; }
.seg .pv.glow i:nth-child(2) { box-shadow: 0 0 7px 2px #00e5ff; }
.seg .pv { position: relative; }
.seg .pv.none::after { content: "—"; color: var(--dim); font-size: 15px; }
.seg .pv.contour i { height: 11px; width: 15px; box-shadow: 0 0 0 2px var(--violet), 2px 3px 0 2px #000; }
/* Новые (v2) стили: те же полоски, средняя — акцент крупнее остальных; у каждого семейства свой оттенок. */
.seg .pv.v2 i:nth-child(2) { width: 19px; height: 12px; background: #ffd400; }
.seg .pv.v2.handwriting i:nth-child(2) { background: #ff7ab8; transform: rotate(-6deg); }
.seg .pv.v2.slam i:nth-child(2) { transform: scale(1.4); }
.seg .pv.v2.wave i:nth-child(1) { transform: translateY(2px); }
.seg .pv.v2.wave i:nth-child(3) { transform: translateY(-2px); }
.seg .pv.v2.editorial i:nth-child(2) { background: #fff; box-shadow: 0 2px 0 0 var(--violet); }
.seg .pv.v2.kinetic i:nth-child(2) { background: var(--violet); transform: scale(1.3); }
.seg .pv.v2.clean i:nth-child(2) { background: #fff; box-shadow: 0 0 0 2px #ffd400; }
/* `rows`, а не `wrap`: класс `.wrap` уже занят контейнером страницы, и плитки молча получали
   его отступы — 16 px по бокам и 110 px снизу, отчего в панели зияли пустоты. */
.seg.rows { flex-wrap: wrap; align-content: flex-start; }
.seg.rows .seg-item { flex: 1 0 84px; }
.warn { color: var(--muted-d); font-size: 13px; margin: 0 0 10px; }
.warn:empty { display: none; }

@media (min-width: 900px) {
  body.ink .editor { display: grid; grid-template-columns: 440px 1fr; min-height: 100vh; min-height: 100dvh; }
  .editor .left { padding: 16px 20px; border-right: 1px solid var(--rule-d); position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; }
  .editor .right { padding: 18px 28px 120px; }
  .stick { position: static; margin: 0; padding: 0; border: 0; background: none; }
  .player video { max-height: 46vh; }
  canvas.tl { height: 56px; }
  .legend { display: flex; }
  .styles { display: flex; }
  .summary b { font-size: 22px; }
  #btn-style { display: none; }
}
@media (max-width: 899px) {
  body.ink .wrap { padding-bottom: 110px; }
  .editor .right { padding-top: 10px; }
}

/* ---- script ---- */
.script { max-width: 640px; font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
@media (min-width: 900px) { .script { font-size: 17px; } }
.script p { margin: 0; position: relative; }  /* one continuous flow: only the take blocks interrupt it */
.script .w { display: inline-block; padding: 2px 5px; margin: 0 -1px; border-radius: 7px; cursor: pointer; transition: background .12s, color .12s; color: var(--paper); }
.script .w:hover { background: var(--ink-3); }
.script .w.ahead { color: #C4BFD6; }
.script .w.now { background: var(--violet); color: var(--ink); font-weight: 600; }
.script .w.sel { background: #4f3bff66; color: var(--paper); }
.script .w.hov { box-shadow: 0 0 0 1.5px var(--blue); }
.script .w.shaky { text-decoration: underline dotted; text-underline-offset: 3px; }
.script .w.cutw { color: var(--muted-d); text-decoration: line-through; }
.script .w.nosub { color: var(--muted-d); font-style: italic; }
.script .w.anchor { box-shadow: 0 0 0 1.5px var(--blue); }
.script .cutmark { display: inline-block; line-height: 1; font: 500 12px var(--mono); color: var(--cut); background: #ff4d3d14; border: 1px solid #ff4d3d55; padding: 6px 9px; border-radius: 999px; vertical-align: baseline; cursor: pointer; margin: 0 3px; }
.script .cutmark.open { color: var(--muted-d); background: transparent; border-style: dashed; border-color: var(--rule-d); }
.script .hes { display: inline-block; width: 14px; height: 14px; margin: 0 2px; vertical-align: middle; cursor: pointer; position: relative; }
.script .hes::after { content: ""; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: #ff4d3d99; }
.script .hes:hover::after { background: var(--cut); }
.script .take { border: 1px solid #ff4d3d44; background: #ff4d3d0d; border-radius: 14px; padding: 10px 14px; margin: .6em 0; color: var(--muted-d); font-size: 14px; line-height: 1.5; display: flex; align-items: center; gap: 12px; cursor: pointer; flex-wrap: wrap; }
.script .take > span:nth-child(2) { flex: 1 1 200px; min-width: 0; }
.script .take-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.script .take-actions button { min-height: 32px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--rule-d); background: transparent; color: var(--muted-d); font: 500 13px var(--body); cursor: pointer; }
.script .take-actions .take-restore { color: var(--violet); border-color: #8e7dff55; }
.script .take-actions button:hover { color: var(--paper); border-color: var(--paper); }
.script .take b { color: var(--paper); font-weight: 600; }
.script .take .tri { transition: transform .2s var(--ease); }
.script .take.open .tri { transform: rotate(90deg); }
.script .take-words { margin: -.3em 0 .6em; padding: 0 14px; }
.script .joinbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 28px; padding: 0 6px; margin: 0 2px; border-radius: 8px; background: var(--ink-3); border: 1px solid var(--rule-d); color: var(--paper); font-size: 12px; vertical-align: middle; cursor: pointer; }
.script .edit-input { font: inherit; font-size: 16px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--blue); background: var(--ink-2); color: var(--paper); min-width: 60px; max-width: 240px; }
.script .notice { display: block; color: var(--cut); font-size: 13px; margin: -6px 0 6px; line-height: 1.4; }
.script .range-hint { font: 500 12px var(--mono); color: var(--blue); margin: 0 0 12px; }

/* ---- popover ---- */
.pop { position: absolute; display: flex; gap: 2px; background: var(--paper); color: var(--ink); border-radius: 12px; padding: 4px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); z-index: 30; }
.pop button { min-height: 40px; padding: 0 12px; border-radius: 9px; border: 0; background: none; font: 500 13px var(--body); cursor: pointer; white-space: nowrap; }
.pop button:hover { background: var(--paper-2); }
.pop button.danger { color: var(--cut); }
.pop::after { content: ""; position: absolute; left: var(--arrow-x, 24px); bottom: -6px; width: 10px; height: 10px; background: var(--paper); transform: rotate(45deg); }
.pop.below::after { bottom: auto; top: -6px; }

/* ---- dock ---- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--ink) 30%); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
@media (min-width: 900px) { .dock { left: 441px; padding: 12px 28px 16px; } }
.dock .cnt { margin-right: auto; color: var(--muted-d); font-size: 13px; flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock .cnt b { color: var(--paper); }
.dock .links { display: flex; gap: 8px; }
.dock .btn { padding: 0 14px; }
.dock .short { display: none; }
@media (max-width: 899px) {
  .dock { flex-wrap: wrap; }
  .dock .cnt { flex-basis: 100%; margin-right: 0; white-space: normal; }  /* the status gets its own line: «Превью акт…» told nobody anything */
  .dock .btn { min-height: 44px; font-size: 14px; padding: 0 12px; } .dock .full { display: none; } .dock .short { display: inline; }
}
/* the final build: a card in the middle of the screen, nobody has to guess what the button did */
.building { position: fixed; inset: 0; z-index: 27; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 18, 26, .72); }
.building .card { width: min(92vw, 420px); background: var(--ink-2); color: var(--paper); border-radius: 18px; padding: 22px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.building .spin { width: 40px; height: 40px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid var(--rule-d); border-top-color: var(--violet); animation: spin 1s linear infinite; }
.building h3 { margin: 0 0 6px; font: 600 17px var(--display); }
.building p { margin: 0; color: var(--muted-d); font-size: 14px; line-height: 1.45; }
.building .stage { margin-top: 10px; color: var(--paper); font: 500 13px var(--mono); }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 26; max-width: min(92vw, 560px); background: var(--paper); color: var(--ink); padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.4; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ask { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 27; width: min(92vw, 440px); background: var(--paper); color: var(--ink); padding: 20px; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.ask p { margin: 0 0 16px; line-height: 1.45; }
.ask-btns { display: flex; flex-direction: column; gap: 8px; }
/* these sit on a light card inside the dark editor, where --fg is near-white: without an explicit
   colour the ghost button's label was white on white and looked like an empty box */
.ask .btn-ghost, .toast .btn-ghost, .building .btn-ghost { color: var(--ink); border-color: var(--rule); }
.building .btn-ghost { color: var(--paper); border-color: var(--rule-d); }
.done-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.done-actions .subs { display: flex; gap: 8px; justify-content: center; }
.building h3 .tick { color: var(--ok); }

/* ---- sheet (mobile style picker) ---- */
/* Лист прижат к низу и растёт вверх по содержимому: на телефоне он вылезал за верх экрана вместе
   с первым блоком — субтитрами, — и достать его было нечем, потому что прокрутки у него не было.
   Теперь высота ограничена, лист прокручивается, а шапка с «Готово» прилипает к верху. */
.sheet { position: fixed; inset: auto 0 0 0; z-index: 25; background: var(--ink-2); border-radius: 20px 20px 0 0; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .3s var(--ease); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 -12px 30px rgba(0, 0, 0, .4); max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain; }
.sheet .map-head { position: sticky; top: 0; z-index: 1; background: var(--ink-2); padding: 14px 0 10px; margin-bottom: 0; }
.sheet .map-head .eyebrow { font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--fg); }
.sheet.open { transform: none; }
.sheet .styles { display: flex; }
.scrim { position: fixed; inset: 0; z-index: 24; background: #0008; }

/* ---- videos ---- */
.vgrid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .vgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .vgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.vcard { position: relative; display: flex; gap: 14px; padding: 12px; text-decoration: none; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.vcard:hover { border-color: #C9C5BB; box-shadow: 0 6px 18px rgba(20, 18, 26, .06); }
.vcard.faded { opacity: .62; }
.vthumb { width: 68px; flex: none; aspect-ratio: 9 / 16; border-radius: 10px; object-fit: cover; display: block; background: var(--surface-2); }
/* nothing to show is still information: the state in words beats a dark rectangle */
.vthumb-empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; background: var(--surface-2); border: 1px dashed var(--line); }
.vthumb-empty b { font: 600 12px/1.3 var(--body); color: var(--muted); }
.vcard .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.vcard h3 { margin: 0; font: 600 15px var(--body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard .nums { font: 500 13px var(--mono); color: var(--muted); }
.vcard .nums .to { color: var(--blue); }
/* not «.foot»: that name belongs to the page footer, whose border and padding leaked in here */
.vcard .vmeta { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-right: 22px; }
.vcard .expires { font-size: 12px; color: var(--muted); white-space: nowrap; }
/* delete is a quiet × in the corner: it should not share the line with the state */
.vcard .del { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: none; color: var(--muted); font: 400 20px/1 var(--body); cursor: pointer; opacity: .55; transition: opacity .15s, color .15s, background .15s; }
.vcard .del:hover { opacity: 1; color: var(--cut); background: #ff4d3d14; }
#empty { text-align: center; }

/* ---- admin ---- */
table.small { border-collapse: collapse; font-size: 13px; width: 100%; }
table.small th, table.small td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll { overflow-x: auto; }
pre { white-space: pre-wrap; }
