:root {
  --bg: #131722;
  --panel: #1a2030;
  --panel-2: #20273a;
  --line: #283048;
  --line-2: #363f58;
  --text: #ececec;
  --muted: #a3a7af;
  --dim: #8b9098;
  --keep: #3d8bfd;
  --keep-ink: #0b1a33;
  --keep-row: #1d2635;
  --accent: #f6672d;
  --accent-ink: #ffffff;
  --accent-soft: #ff956a;
  --hatch: repeating-linear-gradient(135deg, #3b4560 0 6px, #232a3d 6px 12px);
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 "Segoe UI", Inter, system-ui, -apple-system, sans-serif; min-height: 100vh; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.accent { color: #8fc1ff; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd { font: 12px var(--mono); padding: 1px 6px; border-radius: 4px; border: 1px solid #5a3340; color: #ff956a; }

/* ---------- top bar ---------- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #171c28; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.file-meta { font-size: 14px; color: var(--muted); padding-left: 12px; border-left: 1px solid #2e364c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.file-meta:empty { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.save-state { font-size: 13px; color: var(--dim); }

.btn { height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 500; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.btn:hover:not(:disabled) { background: #272a30; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: #ff7a45; }
.btn-light { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.btn-light:hover:not(:disabled) { background: #ffffff; }
.btn-ghost { background: transparent; }
.btn-marker { background: transparent; border-color: var(--accent); color: var(--accent-soft); font-weight: 600; }
.btn-marker:hover { background: #2c1d2b !important; }
.btn[aria-pressed="true"] { background: var(--keep-row); border-color: var(--keep); color: #cfe3ff; }
.btn.big { height: 50px; padding: 0 28px; font-size: 15px; }
.icon-btn { width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn.play { border-radius: 50%; background: var(--text); color: var(--bg); border: none; }

.banner { margin: 16px 24px 0; padding: 12px 16px; border-radius: 10px; background: #3a1f22; color: #ffc9c9; border: 1px solid #5a2d31; }

/* ---------- library ---------- */
.library { max-width: 1040px; margin: 0 auto; padding: 36px 24px 60px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 24px; border: 2px dashed #3b4560; border-radius: 16px; background: var(--panel); color: var(--muted); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #1e1c1a; color: var(--accent-soft); }
.dz-title { font-size: 18px; font-weight: 600; color: var(--text); }
.dz-sub { font-size: 13px; }
.upload-progress { margin-top: 16px; padding: 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.up-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; }
.up-foot .btn { height: 38px; }
.up-label { margin-bottom: 8px; color: var(--muted); }
.lan-hint { margin: 16px 0 0; color: var(--muted); font-size: 14px; }
.lan-hint a { color: #8fc1ff; font-weight: 500; }
.section-title { font-size: 16px; font-weight: 600; margin: 36px 0 14px; }
.video-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.vcard-open { all: unset; cursor: pointer; display: block; }
.vcard-open:focus-visible { outline: 2px solid var(--accent); }
.vcard-thumb { aspect-ratio: 16 / 9; background: #0b0e16 center / cover no-repeat; }
.vcard-body { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vcard-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard-sub { font-size: 12px; color: var(--muted); }
.vcard-del { width: 36px; height: 36px; flex: none; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--dim); }
.vcard-del:hover { border-color: #5a2d31; color: #ffb3b3; }
.empty { color: var(--muted); }

/* ---------- editor ---------- */
.editor { display: flex; flex-wrap: wrap; gap: 22px; padding: 22px 24px 40px; align-items: flex-start; }
.ed-main { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ed-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.player { position: relative; width: 100%; height: min(56.25vw, 52vh); min-height: 220px; background: #0b0e16; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.player-badge { position: absolute; left: 14px; top: 14px; padding: 5px 10px; border-radius: 6px; background: rgba(0,0,0,.65); font-size: 13px; pointer-events: none; }
.player-badge.on { background: rgba(29,38,53,.92); color: #cfe3ff; }
.player-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(10,11,13,.92); color: var(--muted); }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #363f58; border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spacer { flex: 1 1 auto; }
.timecode { font: 15px var(--mono); padding: 0 6px; }

.bar { height: 8px; border-radius: 4px; background: #2a2c31; overflow: hidden; }
.bar.small { width: 220px; }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* timeline */
.timeline-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.tl-title { font-weight: 600; }
.zoom { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; flex-wrap: wrap; justify-content: flex-end; }
.zoom input { width: 200px; accent-color: var(--accent); }
.icon-btn.small { width: 36px; height: 36px; font-size: 18px; color: var(--text); }
.small-btn { height: 36px; padding: 0 12px; font-size: 13px; }
.zoom-label { min-width: 104px; font: 12px var(--mono); color: var(--muted); }
.tl-thumbs-wrap { position: relative; }
.tl-thumbs-hd { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: 6px; background: #1e2434; }
.tl-thumbs-hd img { position: absolute; top: 0; height: 100%; object-fit: cover; border-right: 1px solid #131722; background: #2b3248; }
.tl-scroll, .tl-inner, .timeline-card { touch-action: pan-x; }
.nudge { margin-top: 14px; padding: 12px; border-radius: 10px; background: #251b27; border: 1px solid #43263a; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.nudge b { color: var(--accent-soft); font-weight: 500; }
.nudge-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.nudge-btns .btn { height: 38px; padding: 0 12px; font-size: 13px; }
.nudge-btns #nudgeBack, .nudge-btns #nudgeFwd { flex: 1 1 0; justify-content: center; }
.nudge-btns #nudgeHere { flex: 1 1 100%; justify-content: center; }
.tl-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
.tl-inner { position: relative; width: 100%; min-width: 100%; padding-top: 24px; user-select: none; }
.tl-inner::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 20px; border-radius: 4px; background: #202227; }
.tl-ruler { position: relative; height: 24px; border-bottom: 1px solid #2e364c; }
.tick { position: absolute; bottom: 0; height: 6px; border-left: 1px solid #4a4e56; }
.tick.major { height: 10px; border-color: #6b7078; }
.tick span { position: absolute; bottom: 10px; left: 3px; font: 11px var(--mono); color: var(--dim); white-space: nowrap; }
.tl-thumbs-wrap { margin-top: 8px; }
.tl-thumbs { display: flex; height: 58px; border-radius: 6px; overflow: hidden; background: #2b3248; cursor: ew-resize; }
.tl-thumbs img { flex: 1 1 0; min-width: 0; height: 100%; object-fit: cover; pointer-events: none; opacity: .9; }
.tl-parts { position: relative; height: 40px; margin-top: 8px; border-radius: 6px; overflow: hidden; }
.part { position: absolute; top: 0; bottom: 0; border: none; border-right: 2px solid var(--panel); padding: 0 6px; font: 600 12px inherit; font-family: inherit; overflow: hidden; white-space: nowrap; text-overflow: clip; }
.part.keep { background: var(--keep); color: var(--keep-ink); }
.part.cut { background: var(--hatch); color: var(--muted); }
.part:hover { filter: brightness(1.15); }
.part.current { box-shadow: inset 0 0 0 2px #ffffff; }
.tl-markers { position: absolute; inset: 0; pointer-events: none; }
.marker { position: absolute; top: 2px; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); }
.marker-handle { touch-action: none; position: absolute; top: 0; left: -9px; width: 20px; height: 22px; pointer-events: auto; cursor: grab; border: none; background: transparent; padding: 0; }
.marker-handle::before { content: ""; position: absolute; left: 3px; top: 2px; width: 14px; height: 14px; background: var(--accent); border-radius: 3px 3px 7px 7px; }
.marker.sel { background: #ffffff; }
.marker.sel .marker-handle::before { background: #ffffff; }
.marker-handle:active { cursor: grabbing; }
.tl-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #ffffff; pointer-events: none; z-index: 2; }
.tl-playhead span { position: absolute; top: 0; left: -5px; width: 12px; height: 8px; background: #ffffff; clip-path: polygon(0 0, 100% 0, 50% 100%); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 14px; font-size: 13px; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; }
.sw-keep { background: var(--keep); }
.sw-cut { background: repeating-linear-gradient(135deg, #3b4560 0 3px, #232a3d 3px 6px); }
.sw-marker { width: 3px; background: var(--accent); border-radius: 0; }

/* side cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
.hint { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 8px; }
.input { flex: 1 1 0; min-width: 0; height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 15px; }
.input::placeholder { color: #7d828a; font-family: "Segoe UI", Inter, system-ui, sans-serif; }
.error { margin: 10px 0 0; font-size: 13px; color: #ff9d9d; min-height: 0; }
.error:empty { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 2px 0 10px; border-radius: 16px; background: #2c1d2b; color: var(--accent-soft); font: 500 13px var(--mono); }
.chip.sel { background: #43263a; box-shadow: inset 0 0 0 1px var(--accent); }
.chip-time { all: unset; cursor: pointer; }
.chip-x { width: 28px; height: 28px; border: none; border-radius: 14px; background: transparent; color: var(--accent-soft); font-size: 16px; line-height: 1; }
.chip-x:hover { background: #43263a; }

.parts-list { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow-y: auto; }
.prow { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border-radius: 8px; }
.prow.keep { background: var(--keep-row); }
.prow.current { box-shadow: inset 0 0 0 1px #4b5563; }
.prow-n { width: 20px; flex: none; font-size: 13px; color: var(--dim); }
.prow-range { all: unset; flex: 1 1 auto; min-width: 0; cursor: pointer; font: 500 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow.cut .prow-range { color: var(--dim); text-decoration: line-through; text-decoration-color: #555a62; }
.prow-len { font: 12px var(--mono); color: var(--dim); flex: none; }
.prow-toggle { flex: none; width: 62px; height: 36px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.prow.keep .prow-toggle { background: var(--keep); border: 1px solid var(--keep); color: var(--keep-ink); }
.prow.cut .prow-toggle { background: transparent; border: 1px solid #44474f; color: #c4c7cd; }
.total { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }

/* ---------- export dialog ---------- */
dialog.export { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px; border-radius: 16px; border: 1px solid var(--line-2); background: #171c28; color: var(--text); }
dialog.export::backdrop { background: rgba(0,0,0,.6); }
dialog.export h2 { margin: 0 0 4px; font-size: 22px; }
dialog.export h3 { margin: 22px 0 10px; font-size: 14px; font-weight: 600; color: #d6d8dc; }
.dlg-close-form { position: absolute; right: 18px; top: 18px; margin: 0; }
.close { color: var(--muted); }
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-top: 18px; }
.pcard { text-align: left; padding: 14px; border-radius: 12px; border: 2px solid var(--line-2); background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.pcard[aria-pressed="true"] { border-color: var(--keep); background: var(--keep-row); }
.pcard-shape { height: 64px; display: flex; align-items: center; justify-content: center; }
.pcard-shape i { display: block; height: 100%; border: 2px solid #5b5f67; border-radius: 3px; background: #23262c; }
.pcard[aria-pressed="true"] .pcard-shape i { border-color: #8fc1ff; }
.pcard-name { font-weight: 600; font-size: 14px; }
.pcard-spec { font: 12px var(--mono); color: var(--muted); }
.ex-row { display: flex; flex-wrap: wrap; gap: 0 28px; }
.ex-block { flex: 1 1 360px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: #c4c7cd; font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: #2c1d2b; color: var(--accent-soft); }
#mode button[aria-pressed="true"], #quality button[aria-pressed="true"] { border-color: var(--keep); background: var(--keep-row); color: #cfe3ff; }
.previews { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; min-height: 40px; }
.pv { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pv-frame { position: relative; height: 150px; border-radius: 6px; overflow: hidden; background: #000; border: 1px solid var(--line-2); }
.pv-frame img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pv-frame img.bg { object-fit: cover; filter: blur(10px) brightness(.85); transform: scale(1.15); }
.pv-frame img.fg { object-fit: contain; }
.pv-label { font-size: 12px; color: var(--muted); }
.ex-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.ex-summary { color: var(--muted); font-size: 14px; }
.ex-summary b { color: var(--text); }
.ex-progress { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.ex-progress .btn { align-self: flex-start; height: 38px; }
.ex-prog-row { display: flex; justify-content: space-between; font-size: 14px; }
.ex-files { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.ex-files:empty { display: none; }
.ex-file { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--panel); }
.ex-file .name { font: 13px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-file a { color: #8fc1ff; font-weight: 600; white-space: nowrap; }
.ex-files h3 { margin: 10px 0 4px; }

.toast { pointer-events: none; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: #2b3249; border: 1px solid #3b4560; color: var(--text); z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

@media (max-width: 700px) {
  .topbar { padding: 10px 14px; }
  .editor { padding: 14px; }
  .file-meta { display: none; }
  .legend .muted { display: none; }
}

/* ---------- login ---------- */
.auth { min-height: calc(100vh - 70px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 30px; display: flex; flex-direction: column; gap: 8px; }
.auth-card h1 { margin: 0; font-size: 22px; }
.auth-card .hint { margin-bottom: 8px; }
.auth-card label, .stack label, .add-user label { font-size: 13px; color: #c4c7cd; margin-top: 6px; display: block; margin-bottom: 6px; }
.auth-card .input { flex: none; width: 100%; }
.auth-card .btn.big { margin-top: 12px; justify-content: center; }
.auth-card .btn-ghost { justify-content: center; }
.user-btn { padding: 0 12px; }
.no-upload { padding: 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); margin: 0; }

/* ---------- account + users ---------- */
dialog.small-dlg { width: min(460px, calc(100vw - 32px)); }
.stack { display: flex; flex-direction: column; }
.stack .input { flex: none; width: 100%; }
.stack .btn { align-self: flex-start; margin-top: 12px; }
#accNameForm { padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.users-wrap { overflow-x: auto; margin-top: 10px; }
table.users { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
table.users th { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 6px; vertical-align: bottom; }
table.users th:first-child, table.users td:first-child { text-align: left; }
table.users td { border-top: 1px solid var(--line); padding: 10px 6px; text-align: center; }
table.users td.uname { font-weight: 600; }
table.users td.uname small { display: block; font-weight: 400; color: var(--dim); font-size: 12px; }
table.users input[type=checkbox], .au-rights input { width: 20px; height: 20px; accent-color: var(--keep); cursor: pointer; }
table.users input:disabled { cursor: not-allowed; opacity: .5; }
.u-actions { display: flex; gap: 6px; justify-content: flex-end; }
.u-actions .btn { height: 36px; padding: 0 10px; font-size: 13px; }
.btn-danger:hover:not(:disabled) { border-color: #5a2d31; color: #ffb3b3; background: #2a1a1c; }
.reset-row td { background: #1e2434; text-align: left !important; }
.reset-row .row { max-width: 560px; align-items: center; }
.add-user { margin-top: 24px; padding-top: 6px; border-top: 1px solid var(--line); }
.add-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.add-grid .input { width: 100%; }
.au-rights { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 16px 0 6px; }
.au-rights label { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
@media (max-width: 640px) { .add-grid { grid-template-columns: 1fr; } }

/* ---------- tool switch ---------- */
.tool-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.tool-switch button { height: 46px; border: none; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tool-switch button:hover { color: var(--text); }
.tool-switch button[aria-selected="true"] { background: #2b3249; color: #ffffff; box-shadow: inset 0 0 0 1px #3b4560; }
.brick-ico { position: relative; width: 18px; height: 11px; background: #e3342f; border-radius: 2px; margin-top: 3px; }
.brick-ico::before, .brick-ico::after { content: ""; position: absolute; top: -3px; width: 5px; height: 3px; background: #e3342f; border-radius: 1px 1px 0 0; }
.brick-ico::before { left: 3px; } .brick-ico::after { right: 3px; }

/* ---------- BrickCut panel ---------- */
.bc h2 { display: flex; align-items: center; gap: 8px; }
.bc-styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.bc-style { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.bc-style b { font-size: 14px; }
.bc-style span { font-size: 12px; color: var(--muted); }
.bc-style[aria-pressed="true"] { border-color: #f6c343; background: #2a2614; }
.bc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bc-actions .btn { flex: 1 1 auto; justify-content: center; }
#bcApply:not(:disabled) { border-color: var(--keep); background: var(--keep-row); color: #cfe3ff; }
.bc-bar { margin-top: 12px; }
.bc-msg { margin: 10px 0 0; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.bc-msg.ok { color: #9be3b5; } .bc-msg.err { color: #ff9d9d; }
.bc-inspect { margin-top: 12px; padding: 12px; border-radius: 10px; background: #1e2434; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.bc-sel { font: 13px var(--mono); color: #d6d8dc; }
.bc-sel .yes { color: #9be3b5; } .bc-sel .no { color: #ff9d9d; }
.bc-inspect-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.bc-inspect-btns .btn { height: 38px; padding: 0 12px; font-size: 13px; }
#bcMark { flex: 1 1 auto; justify-content: center; }
.bc-sec { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.bc-sec summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; list-style-position: inside; }
.bc-sec[open] summary { margin-bottom: 6px; }
.bc-slider { display: block; margin: 12px 0 0; font-size: 13px; color: #c4c7cd; }
.bc-slider .row-l { display: flex; justify-content: space-between; }
.bc-slider .row-l { align-items: center; gap: 8px; }
.bc-num-wrap { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.bc-slider .bc-num { width: 72px; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: #f6c343; font: 13px var(--mono); text-align: right; }
.bc-num:focus { border-color: #f6c343; outline: none; }
.bc-unit { min-width: 22px; font: 12px var(--mono); color: var(--muted); }
.bc-slider input[type=range] { width: 100%; accent-color: #f6c343; margin: 6px 0 2px; }
.bc-slider .hint { display: block; margin: 0; font-size: 12px; }
.bc-check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: #c4c7cd; margin-top: 6px; }
.bc-check input { width: 18px; height: 18px; accent-color: #f6c343; }
.bc-noise { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #c4c7cd; }
.bc-noise b { color: #f6c343; font: 12px var(--mono); }
.bc-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.bc-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 2px 0 10px; border-radius: 15px; background: #4da3ff22; border: 1px solid #4da3ff66; color: #9ccbff; font: 12px var(--mono); }
.bc-chip button { width: 26px; height: 26px; border: none; background: transparent; color: inherit; border-radius: 13px; font-size: 15px; }

/* clicks row on the timeline */
.tl-clicks { position: relative; height: 24px; margin-top: 6px; border-radius: 6px; background: #131722; cursor: pointer; }
.clk { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; background: #f6c343; pointer-events: none; }
.clk.rej { background: #5a5f69; top: 8px; bottom: 8px; }
.clk.ex { background: #4da3ff; top: 1px; bottom: 1px; width: 3px; }
.clk.sel { box-shadow: 0 0 0 2px #ffffff; }
.sw-click { width: 3px; background: #f6c343; border-radius: 0; }
.sw-click-rej { width: 3px; background: #5a5f69; border-radius: 0; margin-left: 10px; }
.sw-click-ex { width: 3px; background: #4da3ff; border-radius: 0; margin-left: 10px; }
#legendClicks { display: inline-flex; gap: 6px; }
.chips-summary { font-size: 13px; color: var(--muted); }

.part.thin { border-right: none; min-width: 2px; }
.part.keep.thin { background: #6aa8ff; }
.tl-markers.dense .marker { width: 1px; margin-left: 0; background: rgba(255,159,67,.55); }
.tl-markers.dense .marker-handle { display: none; }
.bc-saved { margin: -2px 0 12px; font-size: 12px; }
.link-btn { border: none; background: none; padding: 0; color: #8fc1ff; font-size: 12px; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: #bcd9ff; }

/* typing a part's times */
.prow.editing { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; background: #1e2434; box-shadow: inset 0 0 0 1px #4b5563; }
.pe-top { display: flex; align-items: flex-end; gap: 8px; }
.pe-field { display: flex; flex-direction: column; gap: 4px; flex: 1 1 0; min-width: 0; font-size: 12px; color: var(--muted); }
.pe-field .input { height: 38px; font-size: 14px; width: 100%; }
.pe-field .input:disabled { opacity: .5; }
.pe-arrow { padding-bottom: 9px; color: var(--muted); }
.pe-hint { margin: 0; font-size: 12px; }
.pe-err { margin: 0; }
.pe-btns { display: flex; gap: 6px; }
.pe-btns .btn { height: 36px; flex: 1 1 0; justify-content: center; font-size: 13px; }
.prow-range:hover { text-decoration: underline; text-decoration-color: #6b7078; }

.brand-home { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; border-radius: 8px; padding: 4px 6px; margin: -4px -6px; }
.brand-home:hover { background: #232a3d; }
.brand-home:hover .brand-name { color: #ffffff; }

/* effects between parts */
.fx-field { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 13px; color: #c4c7cd; }
.fx-field select.input { flex: 0 1 200px; height: 38px; font-size: 14px; padding: 0 8px; }
.fx-field[hidden] { display: none; }
.fx-field .fx-num { width: 64px; height: 34px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 13px var(--mono); text-align: right; }
.fx-field .fx-num:focus { border-color: var(--accent); outline: none; }
.fx-clear { margin-top: 12px; }
.pjoin { display: flex; align-items: center; gap: 6px; padding: 2px 6px 2px 14px; font-size: 12px; color: var(--muted); }
.pjoin-ico { color: #6b7078; }
.pjoin-sel { flex: 1 1 auto; min-width: 0; height: 30px; border-radius: 6px; border: 1px dashed #3b4560; background: transparent; color: #c4c7cd; font-size: 12px; padding: 0 4px; }
.pjoin.own .pjoin-sel { border-style: solid; border-color: #8a63d2; color: #e2d6ff; }
.pjoin-sec { width: 44px; height: 30px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 12px var(--mono); text-align: right; padding: 0 6px; }
.pjoin-unit { font: 12px var(--mono); }
.pjoin-prev { width: 34px; height: 30px; padding: 0; border-radius: 6px; border: 1px solid var(--line-2); background: transparent; color: #c4c7cd; font-size: 12px; white-space: nowrap; }
.pjoin-prev:hover:not(:disabled) { border-color: #8fc1ff; color: #cfe3ff; }
.fx-dlg video { width: 100%; border-radius: 8px; background: #000; margin-top: 12px; }

/* groups, plans, limits */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); margin: 12px 0 4px; }
.tabs button { height: 38px; padding: 0 16px; border: none; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: #2b3249; color: #fff; }
table.users { min-width: 980px; }
table.users td.u-usage { white-space: nowrap; font: 12px var(--mono); color: #c4c7cd; }
table.users td.u-usage .link-btn { margin-left: 8px; font-family: inherit; }
table.users td.via-group input { opacity: .55; }
.u-group { height: 32px; max-width: 140px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 13px; padding: 0 4px; }
.add-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 8px; }
.add-grid select.input { width: 100%; height: 44px; }
.groups-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.group-card { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; background: var(--panel); }
.group-card.new { border-style: dashed; margin-top: 16px; }
.g-head { display: flex; align-items: center; gap: 12px; }
.g-head .g-name { flex: 0 1 260px; height: 40px; font-weight: 600; }
.g-rights { margin: 12px 0 6px; }
.g-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.g-limit { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.g-limit .input { height: 38px; font-size: 14px; width: 100%; }
.g-btns { display: flex; gap: 8px; margin-top: 12px; }
.g-btns .btn { height: 38px; }
.quota { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; background: #1d2635; border: 1px solid #2c3d5a; color: #cfe3ff; font-size: 14px; }
.quota.empty { background: #2c1d2b; border-color: #5a3340; color: var(--accent-soft); }
.acc-plan { margin: 0 0 8px; padding: 10px 12px; border-radius: 8px; background: #1d2635; color: #cfe3ff; font-size: 13px; }
.fx-locked { margin: 4px 0 0; font-size: 13px; color: var(--accent-soft); }
#fxCard.locked > :not(h2):not(.fx-locked) { opacity: .45; pointer-events: none; }
.tool-switch button:disabled { opacity: .4; cursor: not-allowed; }
.demo-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.demo-hint .btn { height: 38px; }

#usersDlg { width: min(1260px, calc(100vw - 32px)); }
.g-limit .input, .pe-field .input, .stack .input, .auth-card .input { flex: none; }
table.users { min-width: 1060px; }
table.users td:last-child { white-space: nowrap; }

/* a tool that isn't in the user's plan: visible, but locked */
.tool-switch button { position: relative; white-space: nowrap; }
/* locked tool: a lock takes the place of the tool's icon */
.tool-switch button.locked > svg, .tool-switch button.locked > .brick-ico { display: none; }
.tool-switch button.locked::before { content: "🔒"; font-size: 13px; filter: grayscale(1); opacity: .8; }
#btnMarker:disabled { opacity: .4; cursor: not-allowed; }
.tool-switch button.locked:not([aria-selected="true"]) { opacity: .7; }
.tool-locked { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; background: rgba(255, 180, 80, .08); border: 1px solid rgba(255, 180, 80, .28); color: #f3c98b; font-size: 13px; line-height: 1.45; }
#handCard.locked > :not(.tool-locked), #bcCard.locked > :not(.tool-locked):not(h2) { opacity: .45; pointer-events: none; }

/* ---------- registering, forgot password, reset link ---------- */
.auth-card.wide { width: min(560px, 100%); }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--muted); }
.auth-links .link-btn { font-size: 13px; }
.plans { border: none; margin: 4px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.plan { position: relative; display: flex !important; flex-direction: column; gap: 4px; margin: 0 !important; padding: 14px 14px 12px; border-radius: 12px; border: 2px solid var(--line-2); background: var(--panel-2); cursor: pointer; color: var(--text) !important; }
.plan:has(input:checked) { border-color: var(--accent); background: #2c1d2b; }
.plan input { position: absolute; top: 12px; right: 12px; accent-color: var(--accent); }
.plan b { font-size: 15px; padding-right: 22px; }
.plan-price { font-size: 17px; font-weight: 700; color: var(--accent-soft); }
.plan ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--muted); line-height: 1.5; }
#msgCard .hint { font-size: 14px; line-height: 1.55; color: #c4c7cd; }

/* ---------- admin: approvals, password requests ---------- */
#btnUsers .badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #1a1208; font-size: 12px; font-weight: 700; }
.todo-box { margin: 12px 0 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255, 159, 67, .4); background: rgba(255, 159, 67, .06); }
.todo-box h3 { margin: 0 0 8px; font-size: 15px; }
.todo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.todo-row:first-child { border-top: none; }
.todo-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.todo-who small { color: var(--muted); font-size: 12px; }
.todo-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.todo-btns select.input { height: 44px; flex: none; width: auto; min-width: 140px; }
.link-box { display: flex; flex-direction: column; gap: 4px; flex: 1 1 360px; }
.link-box .input { width: 100%; height: 40px; font-size: 12px; }
tr.reset-row td > .row { margin-bottom: 8px; }
tr.reset-row td > .row .input[type=email] { flex: 0 1 300px; }

/* ---------- groups: price ---------- */
.g-price { display: grid; grid-template-columns: 160px 140px 1fr; gap: 10px; align-items: end; margin-top: 12px; }
.g-price .input { height: 44px; width: 100%; }
.g-price .g-limit { justify-content: flex-end; }
.g-price .g-open { align-self: center; margin-top: 18px; }
.g-price .input.missing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (max-width: 640px) { .g-price { grid-template-columns: 1fr 1fr; } .g-price .g-open { grid-column: 1 / -1; margin-top: 0; } }

/* ---------- settings ---------- */
.settings-form h3 { margin: 18px 0 8px; font-size: 15px; }
.settings-form h3:first-child { margin-top: 6px; }
.settings-form label { font-size: 13px; color: #c4c7cd; display: block; margin-bottom: 6px; }
.settings-form .bc-check { color: var(--text); font-size: 14px; }
.add-grid.st-grid { grid-template-columns: minmax(0, 2fr) minmax(0, .8fr) minmax(0, 1.4fr); margin-top: 8px; }
.add-grid.st-grid select.input { width: 100%; }
.st-mail-state { margin: 0 0 8px; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.st-mail-state.ok { background: rgba(80, 200, 120, .1); border: 1px solid rgba(80, 200, 120, .35); color: #9be3b4; }
.st-mail-state.off { background: rgba(255, 180, 80, .08); border: 1px solid rgba(255, 180, 80, .28); color: #f3c98b; }
.settings-form > .btn { margin-top: 14px; }
.st-test { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.st-test .input { flex: 0 1 320px; }
@media (max-width: 640px) { .add-grid.st-grid { grid-template-columns: 1fr; } }
.add-grid.st-site { grid-template-columns: 110px minmax(0, 1fr); }
.todo-box h3 { margin-top: 0 !important; }
#accEmailForm { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- mirror ---------- */
.mirror-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mir-btn { height: 46px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.mir-btn:hover { border-color: #4c5673; }
.mir-btn[aria-pressed="true"] { border-color: var(--accent); background: #2c1d2b; color: var(--accent-soft); }
#editor .player video, #editor .tl-thumbs img, #editor .tl-thumbs-hd img { transform: scale(var(--mx, 1), var(--my, 1)); }
#editor.mir-h { --mx: -1; }
#editor.mir-v { --my: -1; }

/* ---------- email: Google or SMTP ---------- */
.st-provider { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 12px; }
.st-prov { position: relative; display: flex !important; flex-direction: column; gap: 3px; margin: 0 !important; padding: 12px 14px 12px 40px; border-radius: 10px; border: 2px solid var(--line-2); background: var(--panel-2); cursor: pointer; color: var(--text) !important; }
.st-prov:has(input:checked) { border-color: var(--accent); background: #2c1d2b; }
.st-prov input { position: absolute; left: 14px; top: 14px; accent-color: var(--accent); }
.st-prov b { font-size: 14px; }
.st-prov span { font-size: 12px; color: var(--muted); }
.st-box { padding: 4px 0 0; }
.g-conn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); margin-bottom: 10px; font-size: 14px; }
.g-conn > span { flex: 1 1 200px; }
.g-btn { background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 600; }
.g-btn:hover { background: #f2f2f2 !important; }
.g-guide { margin: 0 0 10px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-2); }
.g-guide summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.g-guide ol { margin: 10px 0 6px; padding-left: 20px; font-size: 13px; line-height: 1.6; color: #c4c7cd; }
.g-guide li { margin-bottom: 6px; }
.g-redirect { display: flex; gap: 8px; margin: 6px 0; }
.g-redirect .input { flex: 1 1 auto; height: 40px; font-size: 12px; }
.g-redirect .btn { height: 40px; }
@media (max-width: 640px) { .st-provider { grid-template-columns: 1fr; } }

/* ---------- export: download all as ZIP ---------- */
.ex-file.ex-zip { background: #2c1d2b; border: 1px solid rgba(255, 159, 67, .45); }
.ex-file.ex-zip .name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--accent-soft); }
.btn.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.ex-more { margin: 2px 0 8px 12px; }
.ex-file.ex-zip a.btn { color: var(--accent-ink); text-decoration: none; }
.ex-file.ex-zip a.btn:hover { color: var(--accent-ink); }
.ex-file.ex-zip .name { font-family: inherit; }

/* ================================================================ admin page */
#adminView { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 69px); }
#adminView[hidden] { display: none; }
.admin-nav { position: sticky; top: 69px; align-self: start; height: calc(100vh - 69px); overflow-y: auto; padding: 22px 14px; border-right: 1px solid var(--line); background: #15161a; display: flex; flex-direction: column; gap: 2px; }
.admin-nav-title { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 0 12px 10px; }
.admin-nav button { display: flex; align-items: center; gap: 11px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 500; text-align: left; }
.admin-nav button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.admin-nav button:hover { background: #1f2536; color: var(--text); }
.admin-nav button[aria-current="true"] { background: #2c1d2b; color: var(--accent-soft); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.admin-main { padding: 28px 32px 60px; min-width: 0; }
.ap { max-width: 1120px; }
.ap-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.ap-head h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.ap-sub { margin: 4px 0 0; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 15px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel-head h2 { margin: 0; }
.ap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ap-cols > .panel { margin-bottom: 16px; }
.ap-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ap-toolbar .input { height: 42px; flex: 0 1 220px; }
.ap-toolbar input[type=search] { flex: 1 1 260px; }
.all-good { margin: 4px 0; color: #9be3b4; }
.empty-list { color: var(--muted); padding: 20px; text-align: center; }
.small-num { width: 70px; flex: none !important; text-align: center; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }

/* overview */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.stat:hover { border-color: var(--line-2); background: #1f2536; }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.stat-sub { font-size: 12px; color: var(--muted); }
.meter { display: block; height: 6px; border-radius: 3px; background: #2b3248; overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.big { height: 10px; border-radius: 5px; margin: 10px 0; }
.todo-item { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 11px 12px; margin-bottom: 6px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); text-align: left; }
.todo-item.warn { border-color: rgba(255, 180, 80, .35); }
.todo-item.bad { border-color: rgba(255, 99, 99, .4); }
.todo-item .go { color: var(--muted); }
.ov-plan { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ov-plan:first-child { border-top: 0; }
.ov-plan-n { margin-left: auto; color: var(--muted); font-size: 13px; }

/* chips */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font: 500 12px "Segoe UI", Inter, system-ui, sans-serif; background: #2b3248; color: #c9ccd2; white-space: nowrap; }
.tag.good { background: rgba(80, 200, 120, .14); color: #9be3b4; }
.tag.warn { background: rgba(255, 180, 80, .14); color: #f3c98b; }
.tag.bad { background: rgba(255, 99, 99, .15); color: #ff9c9c; }
.tag.admin { background: rgba(61, 139, 253, .16); color: #9cc3ff; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* activity */
.act-rows { display: flex; flex-direction: column; }
.act-row { display: grid; grid-template-columns: 90px 120px minmax(0, 1fr) 120px; gap: 12px; padding: 8px 4px; border-top: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.act-row:first-child { border-top: 0; }
.act-row.bad .act-what { color: #ffb0b0; }
.act-when { color: var(--muted); }
.act-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-what { overflow-wrap: anywhere; }
.act-ip { color: var(--dim); font-size: 12px; text-align: right; }
.act-list { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px; }

/* users list */
.u-list { display: flex; flex-direction: column; gap: 6px; }
.u-row { display: grid; grid-template-columns: 38px minmax(150px, 1.4fr) minmax(90px, .8fr) minmax(140px, 1.4fr) minmax(0, 1.2fr) 110px 14px; gap: 14px; align-items: center; width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left; }
.u-row:hover { border-color: var(--line-2); background: #1f2536; }
.u-row.dim { opacity: .65; }
.ud-avatar { width: 46px; height: 46px; border-radius: 50%; background: linear-gradient(135deg, #3a2a18, #2c1d2b); color: var(--accent-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none; }
.ud-avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.u-main { display: flex; flex-direction: column; min-width: 0; }
.u-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-email, .u-usage, .u-seen { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-plan { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-chips { display: flex; gap: 5px; flex-wrap: wrap; min-width: 0; }
.u-seen { text-align: right; }
.go { color: var(--dim); font-size: 18px; }

/* side panel */
.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #171c28; border-left: 1px solid var(--line-2); z-index: 41; display: flex; flex-direction: column; box-shadow: -20px 0 50px rgba(0, 0, 0, .4); animation: drawerIn .18s ease-out; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.ud-title { flex: 1; min-width: 0; }
.ud-title h2 { margin: 0 0 5px; font-size: 19px; overflow: hidden; text-overflow: ellipsis; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.ud-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ud-card h3 { margin: 0; font-size: 14px; }
.ud-card.attention { border-color: rgba(255, 159, 67, .5); background: #241a26; }
.ud-card.danger { border-color: rgba(255, 99, 99, .3); }
.ud-card .error:empty { display: none; }
.ud-card .row { display: flex; gap: 8px; align-items: center; }
.ud-card .row.wrap { flex-wrap: wrap; }
.ud-card .row .input { flex: 1 1 auto; min-width: 0; height: 42px; }
.ud-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #c4c7cd; }
.ud-field > .input, .ud-field > select, .ud-field > textarea { flex: none; width: 100%; height: 42px; }
.ud-field textarea.input { height: auto; min-height: 60px; resize: vertical; padding: 10px 12px; font: inherit; }
.ud-field small { color: var(--muted); font-size: 12px; }
.ud-meta { margin: 0; font-size: 12px; color: var(--muted); }
.ud-usage { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ud-limits { grid-template-columns: 1fr 1fr !important; }
.r-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.r-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 13px; cursor: pointer; color: var(--text) !important; margin: 0 !important; }
.r-box input { accent-color: var(--accent); margin: 0; }
.r-box.via { opacity: .6; cursor: default; }
.r-box:has(input:checked:not(:disabled)) { border-color: rgba(255, 159, 67, .55); }
.pay-state { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 9px; font-size: 13px; }
.pay-state span { color: var(--muted); font-size: 12px; }
.pay-state.good { background: rgba(80, 200, 120, .1); color: #9be3b4; }
.pay-state.warn { background: rgba(255, 180, 80, .1); color: #f3c98b; }
.pay-state.bad { background: rgba(255, 99, 99, .12); color: #ff9c9c; }

/* approvals */
#ap-approvals .todo-row { border-top: 1px solid var(--line); }
#ap-approvals .todo-row:first-child { border-top: 0; }
#ap-approvals .todo-btns select.input { height: 42px; min-width: 150px; }
#ap-approvals .error:empty { display: none; }

/* plans */
.plans-list { display: flex; flex-direction: column; gap: 14px; }
.plan-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-card.new { border-style: dashed; border-color: var(--accent); }
.plan-card h4 { margin: 10px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-head .g-name { flex: 0 1 260px; height: 42px; font-weight: 600; font-size: 15px; }
.plan-card .row { display: flex; gap: 8px; margin-top: 8px; }
.plan-card .error:empty { display: none; }
.plan-card .ud-field > .input { height: 42px; }

/* videos */
.storage-panel .st-line { font-size: 14px; }
.storage-panel .st-line b { font-size: 20px; }
.st-owners { display: flex; gap: 6px; flex-wrap: wrap; }
.v-table { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.v-row { display: grid; grid-template-columns: 84px minmax(0, 1.6fr) 170px 150px auto; gap: 14px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.v-row .error:empty { display: none; }
.v-row .error { grid-column: 1 / -1; margin: 0; }
.v-thumb { width: 84px; height: 48px; object-fit: cover; border-radius: 6px; background: #2b3248; display: block; }
.v-main, .v-size { display: flex; flex-direction: column; min-width: 0; }
.v-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-main small, .v-size small { color: var(--muted); font-size: 12px; }
.v-owner { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); margin: 0 !important; }
.v-owner .input { height: 36px; }
.v-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.cleanup .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* payments */
.steps { margin: 0 0 14px; padding-left: 20px; line-height: 1.65; color: #c4c7cd; }
.pay-plan { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 130px minmax(0, 1.6fr) 50px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pay-plan:first-child { border-top: 0; }
.pay-plan a { color: #8fc1ff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#payUsers { display: flex; flex-direction: column; gap: 6px; }

/* settings */
.settings-grid { display: flex; flex-direction: column; gap: 0; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); margin: 0 !important; color: var(--text) !important; }
.set-row:first-child { border-top: 0; }
.set-row > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.set-row small { color: var(--muted); font-size: 12px; font-weight: 400; }
.set-row .input { height: 42px; width: 100%; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit em { font-style: normal; color: var(--muted); }
.switch-row .switch { justify-self: end; }
.switch { appearance: none; width: 46px; height: 26px; border-radius: 13px; background: #3b4560; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(20px); }
.settings-grid > div { padding-top: 14px; }
#ap-email .panel > .settings-form h3:first-child { margin-top: 0; }

/* plan ended (user side) + Gumroad at sign-up */
.plan-ended { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; margin-bottom: 16px; border-radius: 14px; border: 1px solid rgba(255, 99, 99, .4); background: rgba(255, 99, 99, .07); }
.plan-ended h2 { margin: 0 0 4px; font-size: 17px; }
.plan-ended p { margin: 0; color: #c4c7cd; }
.plan-ended .row { display: flex; gap: 8px; flex-wrap: wrap; }
.plan-ended .input { flex: 1 1 260px; height: 44px; }
.plan-ended a.btn { text-decoration: none; color: var(--accent-ink); }
.rg-pay { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 159, 67, .4); background: #241a26; display: flex; flex-direction: column; gap: 8px; }
.rg-pay p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rg-pay a.btn { text-decoration: none; color: var(--accent-ink); }

/* admin on small screens: menu becomes a strip on top, rows stack */
@media (max-width: 900px) {
  #adminView { grid-template-columns: 1fr; }
  .admin-nav { position: sticky; top: 0; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 5; }
  .admin-nav-title { display: none; }
  .admin-nav button { width: auto; flex: none; white-space: nowrap; }
  .admin-main { padding: 18px 14px 50px; }
  .ap-cols { grid-template-columns: 1fr; }
  .u-row { grid-template-columns: 38px minmax(0, 1fr) auto 14px; }
  .u-row .u-plan, .u-row .u-usage, .u-row .u-seen { display: none; }
  .v-row { grid-template-columns: 84px minmax(0, 1fr); }
  .v-owner, .v-size, .v-btns { grid-column: 1 / -1; }
  .v-btns { justify-content: flex-start; }
  .act-row { grid-template-columns: 70px minmax(0, 1fr); }
  .act-row .act-who { grid-column: 2; grid-row: 1; }
  .act-row .act-what { grid-column: 1 / -1; }
  .act-row .act-ip { display: none; }
  .set-row { grid-template-columns: 1fr; gap: 8px; }
  .pay-plan { grid-template-columns: 1fr 1fr; }
  .ap-head { flex-direction: column; }
}
.plan-card .ud-field > .input { flex: none; }
.ud-card .row .input { flex: 1 1 auto; height: 42px; }
.v-owner .input { flex: none; height: 36px; width: 100%; }
.v-row { grid-template-columns: 84px minmax(0, 1.6fr) 170px 150px 260px; }
#payUsers .u-row { grid-template-columns: 38px minmax(140px, 1.4fr) minmax(90px, .8fr) minmax(0, 1.6fr) 130px 14px; }
@media (max-width: 900px) { .v-row { grid-template-columns: 84px minmax(0, 1fr); } #payUsers .u-row { grid-template-columns: 38px minmax(0, 1fr) auto 14px; } #payUsers .u-plan, #payUsers .u-seen { display: none; } }

/* free trial + upgrade */
.trial-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; border: 1px solid rgba(255, 159, 67, .4); background: #241a26; }
.trial-hint b { color: var(--accent-soft); }
.plan.trial { border-style: dashed; }
.upgrade { margin: 14px 0 6px; padding: 14px; border-radius: 12px; border: 1px solid rgba(255, 159, 67, .4); background: #1f1a14; }
.upgrade h3 { margin: 0 0 4px; font-size: 15px; }
.up-plans { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 10px 0; }
.up-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.up-steps .input { flex: 1 1 200px; height: 44px; }
.up-steps a.btn { text-decoration: none; color: var(--accent-ink); }
.upgrade .error:empty { display: none; }
.with-unit-sel { display: flex; gap: 6px; }
.with-unit-sel .input { flex: 1 1 auto; min-width: 0; }
.with-unit-sel select.unit { flex: none; width: 72px; padding: 0 8px; }
.ud-limits .with-unit-sel .input, .g-limits .with-unit-sel .input { height: 42px; }
.g-limit .with-unit-sel .input { flex: 1 1 auto; width: auto; }
.g-limit .with-unit-sel select.unit { flex: none; width: 72px; }

/* the side panel and its backdrop must stay hidden when [hidden] (they have their own display) */
.drawer[hidden], .drawer-back[hidden] { display: none; }

/* upgrade window */
.up-dlg { width: min(640px, 94vw); }
.up-dlg .upgrade { margin: 0; padding: 0; border: 0; background: none; }
.up-dlg h2 { margin: 0 0 4px; font-size: 20px; }
.up-reason { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; background: rgba(255, 159, 67, .1); border: 1px solid rgba(255, 159, 67, .35); color: #f3c98b; font-size: 13px; }
.plan-has { align-self: flex-start; margin-top: 6px; padding: 2px 8px; border-radius: 10px; background: rgba(80, 200, 120, .14); color: #9be3b4; font-size: 11px; font-weight: 600; }
.acc-upgrade { margin: 10px 0 4px; }
.up-reason { margin-right: 52px; }

/* ---------- library: mine / everyone's ---------- */
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 26px 0 12px; }
.lib-head .section-title { margin: 0; }
.lib-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.lib-tabs button { height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-weight: 600; }
.lib-tabs button[aria-selected="true"] { background: #2b3249; color: #fff; }
.others-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: rgba(61, 139, 253, .08); border: 1px solid rgba(61, 139, 253, .3); color: #b9d3ff; font-size: 13px; }

/* ---------- help & FAQ ---------- */
.help { max-width: 1120px; margin: 0 auto; padding: 22px 24px 70px; }
.help-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.help-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 34px; }
#faqPage { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
.help-toc { position: sticky; top: 90px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.help-toc a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; }
.help-toc a:hover { background: var(--panel); color: var(--text); }
.help-body { max-width: 760px; line-height: 1.65; color: #d6d8dc; }
.help-body h1 { margin: 0 0 8px; font-size: 28px; color: var(--text); letter-spacing: -.01em; }
.help-body h2 { margin: 34px 0 8px; font-size: 19px; color: var(--text); scroll-margin-top: 90px; }
.help-body .lead { font-size: 16px; color: var(--muted); margin: 0 0 6px; }
.help-body ul, .help-body ol { padding-left: 22px; }
.help-body li { margin-bottom: 6px; }
.help-body a { color: #8fc1ff; }
kbd { display: inline-block; min-width: 22px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--panel-2); font: 12px var(--mono); text-align: center; color: var(--text); }
table.keys { border-collapse: collapse; margin: 8px 0; }
table.keys td { padding: 7px 18px 7px 0; border-bottom: 1px solid var(--line); }
.help-more { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); }
.faq-search { width: 100%; height: 46px; margin: 14px 0 6px; flex: none; }
.faq-group { margin: 26px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-soft); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: #c4c7cd; }
.auth-help { margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-help a { color: #8fc1ff; }
#btnHelp { gap: 6px; }
@media (max-width: 760px) {
  .help { padding: 16px 14px 60px; }
  .help-page { grid-template-columns: 1fr; gap: 12px; }
  .help-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .help-toc a { padding: 5px 10px; background: var(--panel); font-size: 13px; }
  #btnHelp { padding: 0 10px; }
}

/* ---------- speed */
.speed-btns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.spd-btn { height: 38px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 600 13px var(--mono); }
.spd-btn:hover { border-color: #4c5673; }
.spd-btn[aria-pressed="true"] { border-color: var(--accent); background: #2c1d2b; color: var(--accent-soft); }
.speed-len { margin: 10px 0 0; font-size: 13px; color: var(--dim); min-height: 1em; }
.speed-len b { color: var(--text); font: 600 13px var(--mono); }
#speedClearParts { margin-top: 6px; }
.prow:has(.prow-speed, .prow-speed-gap) { gap: 6px; }
.prow:has(.prow-speed, .prow-speed-gap) .prow-toggle { width: 56px; }
.prow-speed { flex: none; width: 48px; height: 30px; border-radius: 6px; border: 1px dashed #3b4560; background: transparent; color: #c4c7cd; font: 12px var(--mono); padding: 0; text-align: center; text-align-last: center; appearance: none; -webkit-appearance: none; cursor: pointer; }
.prow-speed:hover { border-color: #6b7078; }
.prow-speed.own { border-style: solid; border-color: var(--accent); color: var(--accent-soft); }
.prow-speed option { background: #1e2434; color: var(--text); }
.prow-speed-gap { flex: none; width: 48px; }
.prow-range:has(.prow-times) { display: flex; flex-direction: column; gap: 1px; line-height: 1.25; }
.prow-times { overflow: hidden; text-overflow: ellipsis; }
.prow-sub { font: 11px var(--mono); color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.prow-sub.sped { color: var(--accent-soft); }
.prow.cut .prow-sub { text-decoration: none; }
#playerBadge .spd { margin-left: 6px; padding-left: 6px; border-left: 1px solid currentColor; color: var(--accent-soft); }

/* ---------- subtitles */
.subs-overlay { position: absolute; left: 0; right: 0; bottom: 7%; display: flex; justify-content: center; padding: 0 8%; pointer-events: none; text-align: center; }
.subs-overlay span { font-size: var(--subs-size, 20px); font-weight: 500; line-height: 1.25; color: #fff; white-space: pre-wrap;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 2px 3px rgba(0,0,0,.7); }
.subs-overlay.box span { text-shadow: none; background: rgba(0,0,0,.62); padding: .12em .45em; border-radius: 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.subs-overlay.big { bottom: 22%; }
.subs-overlay.big span { font-weight: 800; font-size: calc(var(--subs-size, 20px) * 1.55); text-shadow: -3px -3px 0 #000, 3px -3px 0 #000, -3px 3px 0 #000, 3px 3px 0 #000, 0 0 6px #000; }
.subs-make { width: 100%; margin-top: 4px; }
.subs-progress { margin-top: 10px; }
.subs-progress .progress { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.subs-progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.subs-prog-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.subs-prog-row .hint { margin: 0; }
.subs-opts { display: flex; flex-direction: column; gap: 8px; }
.subs-list { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin: 6px -4px 10px; padding: 0 4px; }
.sl-row { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 7px; }
.sl-row.current { background: #22252b; box-shadow: inset 0 0 0 1px #4b5563; }
.sl-row.out { opacity: .45; }
.sl-time { all: unset; flex: none; cursor: pointer; font: 12px var(--mono); color: var(--dim); width: 52px; }
.sl-time:hover, .sl-time:focus-visible { color: var(--accent-soft); text-decoration: underline; }
.sl-text { flex: 1 1 auto; min-width: 0; height: 32px; padding: 0 8px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text); font-size: 13px; }
.sl-text:hover { border-color: #3b4560; }
.sl-text:focus { border-color: var(--accent); background: var(--panel-2); outline: none; }
.sl-x { flex: none; width: 26px; height: 26px; border-radius: 6px; border: 0; background: transparent; color: var(--dim); font-size: 15px; }
.sl-x:hover { background: #3a2222; color: #ffb4b4; }
.subs-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.danger-text { color: #ffb4b4; }
#subsCard.locked #subsMakeBox, #subsCard.locked #subsEdit { opacity: .5; pointer-events: none; }
#exSubsBlock .bc-check { margin: 4px 0; }
.subs-problem { margin: 6px 0 10px; padding: 9px 11px; border-radius: 8px; background: #2c1d2b; color: var(--accent-soft); font-size: 13px; line-height: 1.4; }
.subs-overlay[hidden] { display: none; }

/* ---------- subtitle fonts (bundled, open licence: static/fonts/licenses) */
@font-face { font-family: "Poppins"; src: url("/static/fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/static/fonts/Lato-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lato"; src: url("/static/fonts/Lato-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Anton"; src: url("/static/fonts/Anton-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bebas Neue"; src: url("/static/fonts/BebasNeue-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Archivo Black"; src: url("/static/fonts/ArchivoBlack-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Luckiest Guy"; src: url("/static/fonts/LuckiestGuy-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Bangers"; src: url("/static/fonts/Bangers-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Permanent Marker"; src: url("/static/fonts/PermanentMarker-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pacifico"; src: url("/static/fonts/Pacifico-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Lobster"; src: url("/static/fonts/Lobster-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
.subs-overlay span { font-family: var(--subs-font, Arial, Helvetica, sans-serif); pointer-events: auto; cursor: grab; touch-action: none; user-select: none; outline: 1px dashed transparent; outline-offset: 4px; }
.subs-overlay span:hover { outline-color: rgba(255,255,255,.55); }
.subs-overlay.dragging span { cursor: grabbing; outline-color: var(--accent); }
.subs-overlay.no-bold span { font-weight: 400 !important; }
.subs-overlay.placed { transform: translate(-50%, -50%); padding: 0 !important; }
.subs-overlay.ghost span { opacity: .55; font-style: italic; }
.subs-size { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; }
.subs-size input { flex: 1 1 auto; accent-color: var(--accent); }
.subs-size output { font: 12px var(--mono); color: var(--dim); width: 40px; text-align: right; }
.subs-place { margin: 2px 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* ---------- fonts: favourites and uploads */
.subs-font-row { display: flex; gap: 6px; flex: 1 1 auto; min-width: 0; }
.subs-font-row select { flex: 1 1 auto; min-width: 0; }
.subs-font-row .icon-btn { flex: none; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font-size: 15px; }
.fav-btn[aria-pressed="true"] { color: #ffc24b; border-color: #6b5420; }
dialog.fonts-dlg { width: min(620px, calc(100vw - 32px)); }
.fonts-up { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 14px 0 4px; }
.fonts-up .hint { margin: 0; }
.fonts-up .hint.bad { color: #ffb4b4; }
.font-sample-in { width: 100%; margin: 6px 0 10px; }
.font-list h3 { margin: 16px 0 6px !important; }
.font-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; }
.font-row:hover { background: #1e2434; }
.font-row.current { border-color: var(--accent); background: #251b27; }
.font-row .fr-star { all: unset; cursor: pointer; font-size: 18px; width: 22px; text-align: center; color: #6b7078; }
.font-row .fr-star[aria-pressed="true"] { color: #ffc24b; }
.font-row .fr-star:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.fr-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-sample { font-size: 22px; line-height: 1.25; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-name { font-size: 12px; color: var(--dim); }
.font-row .btn { flex: none; }
.fr-del { all: unset; cursor: pointer; width: 28px; height: 28px; border-radius: 6px; text-align: center; line-height: 28px; color: var(--dim); }
.fr-del:hover { background: #3a2222; color: #ffb4b4; }

/* ================= Brand look (from the Video-Cutter logo) ================= */
:root {
  --brand-blue: #22b4f0; --brand-purple: #a63cf0; --brand-pink: #e2457c; --brand-orange: #f6672d;
  --brand-grad: linear-gradient(90deg, var(--brand-purple) 0%, var(--brand-pink) 50%, var(--brand-orange) 100%);
  --brand-grad-full: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-purple) 35%, var(--brand-pink) 68%, var(--brand-orange) 100%);
  --head: Poppins, "Segoe UI", Inter, system-ui, sans-serif;
}
/* headings and buttons in the logo's rounded geometric style (Poppins comes with the app) */
h1, h2, h3, .brand-name, .btn, .tool-switch button, .stat-value, .ap-head h1 { font-family: var(--head); }
h1, h2 { letter-spacing: -.01em; }
/* top bar: logo as the home button, with the logo's gradient line underneath */
.topbar { border-bottom: 0; box-shadow: 0 1px 0 var(--line); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--brand-grad-full); opacity: .85; pointer-events: none; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-icon { height: 34px; width: auto; display: none; }
.brand-home { padding: 6px 8px; margin: -6px -8px; }
.brand-home:hover { background: rgba(255,255,255,.05); }
.brand-home:hover .brand-logo, .brand-home:hover .brand-icon { filter: brightness(1.12); }
@media (max-width: 640px) { .brand-logo { display: none; } .brand-icon { display: block; } }
/* login */
.auth-logo { display: block; width: min(260px, 80%); height: auto; margin: 0 auto 18px; }
/* primary buttons: the logo gradient */
.btn-primary { background: var(--brand-grad); border: 0; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.18); }
.btn-primary:hover:not(:disabled) { background: var(--brand-grad); filter: brightness(1.1) saturate(1.05); }
.btn-primary:active:not(:disabled) { filter: brightness(.95); }
/* tool switch: "Cut by hand" gets the logo's scissors; BrickCut keeps its LEGO brick */
.hand-ico { width: 22px; height: auto; display: inline-block; }
.tool-switch button[aria-selected="true"] { box-shadow: inset 0 0 0 1px #3b4560, inset 0 -2px 0 0 var(--brand-orange); }
#toolHand[aria-selected="true"] { box-shadow: inset 0 0 0 1px #3b4560, inset 0 -2px 0 0 var(--brand-purple); }
.tool-switch button.locked > .hand-ico { display: none; }
/* progress bars and sliders in brand colours */
.subs-progress .bar, #exBar, .meter > span { background: var(--brand-grad); }
input[type="range"] { accent-color: var(--brand-orange); }
/* selected "pressed" choices */
.seg button[aria-pressed="true"] { border-color: var(--brand-orange); }
@font-face { font-family: "Fredoka One"; src: url("/static/fonts/FredokaOne-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .top-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .top-actions .btn { height: 38px; padding: 0 10px; font-size: 13px; }
}

/* ---------- movable cards (your own layout, saved per user) */
.card-zone { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.zone-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.zone-bottom:empty { display: none; }
body.dragging-card .zone-bottom:empty, body.dragging-card .zone-side:empty { display: block; min-height: 90px; border: 2px dashed #3b4560; border-radius: 12px; }
body.dragging-card .zone-bottom:empty::after, body.dragging-card .zone-side:empty::after { content: "Drop a card here"; display: block; padding: 32px; text-align: center; color: var(--dim); }
.card-zone > .card { position: relative; }
.card-grip { position: absolute; left: 3px; top: 14px; width: 14px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--dim); font-size: 13px; line-height: 24px; cursor: grab; opacity: .35; touch-action: none; }
.card:hover > .card-grip, .card-grip:focus-visible { opacity: 1; }
.card-grip:hover { color: var(--text); background: rgba(255,255,255,.06); }
.card.is-dragging { opacity: .4; }
.card.drop-before { box-shadow: 0 -3px 0 0 var(--brand-orange); }
.card.drop-after { box-shadow: 0 3px 0 0 var(--brand-orange); }
.layout-hint { margin: 0; font-size: 12px; color: var(--dim); text-align: center; }
@media (max-width: 900px) { .card-grip { display: none; } .layout-hint { display: none; } }

/* ---------- plans overview: tiles, editing happens in the side panel */
.plans-list { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.plan-tile { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); transition: border-color .12s, transform .12s; }
.plan-tile:hover { border-color: #4c5673; transform: translateY(-1px); }
.plan-tile:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.plan-tile.needs { border-color: #6b4a2a; }
.pt-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pt-name { font: 600 17px var(--head); color: #fff; }
.pt-users { font-size: 12px; color: var(--dim); white-space: nowrap; }
.pt-price { font: 600 22px var(--head); background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pt-price.warn { background: none; color: #f3c98b; font-size: 16px; }
.plan-tile .tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.plan-tile .tags:empty { display: none; }
.pt-tools { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: #c9ccd2; }
.pt-tool.off { color: #ff9d9d; }
.pt-limits { font-size: 12.5px; color: var(--dim); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 10px; }
.pt-edit { align-self: flex-end; font-size: 13px; color: var(--accent-soft); margin-top: auto; }
/* the plan form inside the side panel */
.plan-card.in-drawer { all: unset; display: flex; flex-direction: column; gap: 14px; }
.plan-card.in-drawer .g-name { flex: none; height: 44px; width: 100%; font-size: 16px; }
.plan-card.in-drawer .ud-card > .input, .plan-card.in-drawer .ud-field > .input { flex: none; }
.plan-card.in-drawer .g-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-card.in-drawer .g-price { grid-template-columns: 1fr 1fr; }
.plan-card.in-drawer .g-price .g-open { grid-column: 1 / -1; margin-top: 0; }
.plan-card.in-drawer .g-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-card.in-drawer .r-grid { grid-template-columns: 1fr 1fr; }
.plan-card.in-drawer .ud-field { margin-top: 8px; }
.plan-card.in-drawer > .row { display: flex; gap: 8px; position: sticky; bottom: -40px; padding: 12px 0 4px; background: #171c28; }

/* ---------- sound row under the timeline */
.tl-wave { position: relative; height: 56px; margin-top: 6px; border-radius: 6px; background: #131722; overflow: hidden; }
.tl-wave canvas { position: absolute; top: 0; left: 0; height: 56px; display: block; cursor: crosshair; touch-action: pan-x; }
.wave-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--dim); pointer-events: none; }
.sw-wave { background: #8b7cf6; }
.wave-pop { position: absolute; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-radius: 10px; background: #1e2434; border: 1px solid #3b4560; box-shadow: 0 10px 30px rgba(0,0,0,.45); max-width: 520px; }
.wave-pop .wp-t { font: 12px var(--mono); color: var(--dim); margin-right: 4px; }
.wave-pop .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.timeline-card, #tlScroll { position: relative; }
/* ---------- sound card */
.aud-fades { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aud-h { margin: 12px 0 6px; font-size: 13px; color: #d6d8dc; }
.aud-list { display: flex; flex-direction: column; gap: 6px; }
.aud-list .hint { margin: 0; }
.aud-row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 8px; align-items: center; padding: 8px; border-radius: 9px; background: #1e2434; border: 1px solid transparent; }
.aud-row.sel { border-color: var(--brand-pink); }
.aud-row select { height: 30px; border-radius: 6px; border: 1px solid #3b4560; background: #171c28; color: var(--text); font-size: 12px; }
.aud-row .aud-t { all: unset; cursor: pointer; font: 12px var(--mono); color: #c9ccd2; }
.aud-row .aud-t:hover { color: var(--accent-soft); text-decoration: underline; }
.aud-row .subs-size { grid-column: 1 / -1; }
.aud-music { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; background: #1e2434; margin-bottom: 8px; }
.aud-music-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ---------- sliders that look the same in every browser (Opera GX drew them as flat bars) */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand-orange) var(--p), #2e364c var(--p)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #2e364c; }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--brand-orange); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-orange); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--brand-orange); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(246,103,45,.35); }
input[type="range"]:disabled { opacity: .45; cursor: not-allowed; }
.bc-slider input[type=range] { --brand-orange: #f6c343; }
.aud-fades { gap: 14px; margin-top: 6px; }
.aud-fade { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.aud-fade input { width: 64px; height: 34px; border-radius: 7px; border: 1px solid var(--line-2); background: #131722; color: var(--text); font: 13px var(--mono); text-align: right; padding: 0 8px; }
.aud-fade input:focus { border-color: var(--brand-orange); outline: none; }
.aud-tip { margin: 4px 0 0; font-size: 12px; }

/* ================= Projects (several clips + sound rows) ================= */
.proj-lib { margin-bottom: 26px; }
.proj-lib-hint { margin: -6px 0 12px; }
.proj-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.proj-card { all: unset; box-sizing: border-box; cursor: pointer; position: relative; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.proj-card:hover { border-color: #4c5673; }
.proj-card .pc-thumb { height: 110px; background: #0b0e16 center / cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--dim); font-size: 26px; }
.proj-card .pc-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.proj-card .pc-name { font-weight: 600; }
.proj-card .pc-sub { font-size: 12px; color: var(--dim); }
.proj-card .pc-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 6px; border: 0; background: rgba(0,0,0,.55); color: #fff; }
.proj { padding: 14px 20px 30px; display: flex; flex-direction: column; gap: 10px; }
.pj-top { display: flex; align-items: center; gap: 10px; }
.pj-name { flex: 0 1 340px; height: 38px; font: 600 15px var(--head); }
.pj-top-sp { flex: 1; }
.pj-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; min-height: 0; }
.pj-preview { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pj-screen { position: relative; height: min(46vh, 520px); min-height: 200px; border-radius: 12px; background: #000; border: 1px solid var(--line); overflow: hidden; }
.pj-screen video { width: 100%; height: 100%; object-fit: contain; display: block; }
.pj-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #555c6b; font-size: 13px; background: #000; }
.pj-transport { display: flex; align-items: center; gap: 10px; }
.pj-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; min-height: 0; max-height: calc(min(46vh, 520px) + 52px); }
.pj-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.pj-tabs button[role=tab] { flex: 1; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-weight: 600; }
.pj-tabs button[aria-selected="true"] { background: #2b3249; color: #fff; }
.pj-sheet-close { display: none; border: 0; background: transparent; color: var(--muted); width: 34px; }
.pj-tab { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.pj-tab h3 { margin: 6px 0 0; font-size: 13px; color: #d6d8dc; }
.pj-media { display: flex; flex-direction: column; gap: 6px; }
.pj-mrow { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 9px; background: #1e2434; }
.pj-mrow .th { width: 64px; height: 40px; border-radius: 5px; background: #0b0e16 center / cover no-repeat; flex: none; display: flex; align-items: center; justify-content: center; color: var(--dim); }
.pj-mrow .nm { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-mrow .nm small { display: block; color: var(--dim); font-size: 11px; }
.pj-mrow .btn { height: 30px; padding: 0 10px; font-size: 12px; }
.pj-replace { margin: 0; padding: 8px 10px; border-radius: 8px; background: #2c1d2b; color: var(--accent-soft); font-size: 13px; }
.pj-edit-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }
.pj-edit-row input[type=text], .pj-edit-row select { width: 110px; height: 32px; border-radius: 7px; border: 1px solid var(--line-2); background: #131722; color: var(--text); padding: 0 8px; font: 13px var(--mono); }
.pj-edit-row input[type=range] { flex: 1; }
.pj-edit h4 { margin: 0; font: 600 15px var(--head); color: #fff; }
.pj-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.pj-toolbar .btn { height: 32px; padding: 0 10px; font-size: 13px; }
.pj-timeline { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-radius: 12px; background: #171c28; border: 1px solid var(--line); overflow: hidden; }
.pj-heads { display: flex; flex-direction: column; padding-top: 26px; border-right: 1px solid var(--line); background: #151a25; }
.pj-head { height: 54px; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; color: #c9ccd2; border-bottom: 1px solid #1f2536; }
.pj-head.video { height: 64px; }
.pj-head .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-head button { width: 24px; height: 24px; border: 0; border-radius: 5px; background: transparent; color: var(--dim); font-size: 13px; }
.pj-head button:hover { background: #232a3d; color: #fff; }
.pj-head button[aria-pressed="true"] { color: #ff9d9d; }
.pj-scroll { overflow-x: auto; overflow-y: hidden; }
.pj-inner { position: relative; min-width: 100%; }
.pj-ruler { position: relative; height: 26px; background: #131722; cursor: pointer; border-bottom: 1px solid var(--line); }
.pj-ruler span { position: absolute; top: 6px; font: 10px var(--mono); color: var(--dim); padding-left: 3px; border-left: 1px solid #2e364c; height: 20px; }
.pj-lane { position: relative; height: 54px; border-bottom: 1px solid #1f2536; }
.pj-lane.video { height: 64px; }
.pj-lane.drop { background: rgba(246,103,45,.08); }
.pj-clip { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; overflow: hidden; cursor: grab; border: 2px solid transparent; touch-action: none; user-select: none; }
.pj-clip.v { background: #1f6fcf; }
.pj-clip.a { background: #6f62d9; }
.pj-clip.a.file { background: #c9457a; }
.pj-clip.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(246,103,45,.6); }
.pj-clip .strip { position: absolute; inset: 0; display: flex; opacity: .55; pointer-events: none; }
.pj-clip .strip i { flex: 1 0 auto; height: 100%; background: center / cover no-repeat; border-right: 1px solid rgba(0,0,0,.35); }
.pj-clip canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; opacity: .75; }
.pj-clip .lb { position: absolute; left: 6px; top: 3px; right: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.pj-clip .h { position: absolute; top: 0; bottom: 0; width: 9px; cursor: ew-resize; background: rgba(255,255,255,.0); }
.pj-clip .h.l { left: 0; } .pj-clip .h.r { right: 0; }
.pj-clip.sel .h { background: rgba(255,255,255,.35); }
.pj-clip.muted-own .lb::after { content: "  🔇"; }
.pj-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--brand-orange); pointer-events: none; z-index: 3; }
.pj-playhead span { position: absolute; top: 0; left: -6px; border: 7px solid transparent; border-top: 8px solid var(--brand-orange); }
.pj-hint { margin: 0; font-size: 12px; color: var(--dim); }
.pj-mtools { display: none; }
.pj-ex-plats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.pj-ex-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
/* ----- phone layout (option C): big preview, compact timeline, big tools at the bottom */
.proj.layout-phone { padding: 8px 8px 96px; }
.proj.layout-phone .pj-top .btn:not(.btn-primary) { display: none; }
.proj.layout-phone .pj-main { grid-template-columns: 1fr; }
.proj.layout-phone .pj-screen { height: min(36vh, 420px); min-height: 180px; }
.proj.layout-phone #pjSave { display: none; }
.proj.layout-phone .pj-panel { display: none; position: fixed; left: 0; right: 0; bottom: 0; max-height: 62vh; z-index: 30; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); padding-bottom: 20px; }
.proj.layout-phone .pj-panel.open { display: flex; }
.proj.layout-phone .pj-sheet-close { display: block; }
.proj.layout-phone .pj-toolbar { display: none; }
.proj.layout-phone .pj-hint { display: none; }
.proj.layout-phone .pj-timeline { grid-template-columns: 44px minmax(0, 1fr); }
.proj.layout-phone .pj-head .nm { display: none; }
.proj.layout-phone .pj-lane, .proj.layout-phone .pj-head { height: 40px; }
.proj.layout-phone .pj-lane.video, .proj.layout-phone .pj-head.video { height: 56px; }
.proj.layout-phone .pj-clip.a { top: 9px; bottom: 9px; border-radius: 12px; }
.proj.layout-phone .pj-mtools { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; overflow-x: auto; gap: 2px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); background: #1a2030; border-top: 1px solid var(--line); }
.pj-mtools button { flex: 1 0 74px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 0; border-radius: 10px; background: transparent; color: #c9ccd2; font-size: 11px; }
.pj-mtools button span { font-size: 20px; color: #fff; }
.pj-mtools button:active { background: #2b3249; }
@media (max-width: 1100px) { .proj.layout-pc .pj-main { grid-template-columns: minmax(0, 1fr) 290px; } }

/* ================= Whole site on a phone (CapCut style) ================= */
.m-hero, .m-nav, .m-etools, .m-sheet, .m-back { display: none; }
body.m-phone { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
body.m-phone .topbar { padding: 8px 12px; flex-wrap: nowrap; }
body.m-phone .topbar .brand-logo { display: none; }
body.m-phone .topbar .brand-icon { display: block; height: 30px; }
body.m-phone .file-meta { font-size: 12px; max-width: 46vw; }
body.m-phone #btnHelp, body.m-phone #btnLibrary, body.m-phone #btnUsers, body.m-phone #btnAccount { display: none !important; }
body.m-phone .save-state { display: none; }
body.m-phone #btnExport { height: 36px; padding: 0 14px; border-radius: 18px; background: var(--brand-grad); border: 0; color: #fff; }
/* bottom menu */
body.m-phone .m-nav:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #171c28; border-top: 1px solid var(--line); }
.m-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--dim); font-size: 11px; padding: 4px 0; }
.m-nav button span { font-size: 20px; line-height: 1; color: #c9ccd2; }
.m-nav button.on, .m-nav button.on span { color: #fff; }
.m-nav button.on span { color: var(--brand-orange); }
.m-nav .m-add span { width: 46px; height: 34px; border-radius: 12px; background: var(--brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
/* sheets */
body.m-phone .m-back:not([hidden]) { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 38; }
body.m-phone .m-sheet:not([hidden]) { display: flex; flex-direction: column; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); background: #1a2030; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
.m-grip { width: 40px; height: 4px; border-radius: 2px; background: #3b4560; margin: 0 auto 6px; }
.m-sheet-btn { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #20273a; color: var(--text); }
.m-sheet-btn span { grid-row: 1 / 3; font-size: 26px; text-align: center; }
.m-sheet-btn small { color: var(--dim); }
/* home */
body.m-phone .library { padding: 14px 12px; }
body.m-phone .m-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-bottom: 18px; }
.m-hero button { height: 92px; border-radius: 16px; border: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px; padding: 12px 14px; font: 600 15px var(--head); color: #fff; }
.m-hero button span { font-size: 26px; line-height: 1; }
.m-hero-main { background: var(--brand-grad); }
.m-hero-up { background: #20273a; border: 1px solid var(--line-2) !important; }
body.m-phone .dropzone { display: none; }
body.m-phone .proj-list, body.m-phone .video-list { grid-template-columns: 1fr 1fr !important; gap: 10px; }
body.m-phone .proj-card .pc-thumb { height: 96px; }
body.m-phone .proj-lib-hint { display: none; }
body.m-phone .lib-head { gap: 8px; }
body.m-phone #btnNewProject { display: none; }
/* single-video editor: big preview, timeline, tool bar; each card is a sheet */
body.m-phone .editor { padding: 8px 8px calc(150px + env(safe-area-inset-bottom)); gap: 8px; }
body.m-phone .editor .player { height: min(34vh, 420px); min-height: 190px; border-radius: 10px; }
body.m-phone .editor .controls { gap: 6px; flex-wrap: wrap; }
body.m-phone .editor .controls .btn { height: 36px; padding: 0 10px; font-size: 13px; }
body.m-phone #btnMarker, body.m-phone #btnUndo { display: none; }
body.m-phone .legend { display: none; }
body.m-phone .tool-switch, body.m-phone .layout-hint, body.m-phone .card-grip { display: none !important; }
body.m-phone .ed-side { flex: 0 0 0; min-width: 0; gap: 0; }
body.m-phone .card-zone > .card:not(.m-open) { display: none !important; }
body.m-phone .card-zone > .card.m-open { display: flex !important; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; max-height: 68vh; overflow-y: auto; z-index: 40; border-radius: 18px 18px 0 0; margin: 0; box-shadow: 0 -10px 40px rgba(0,0,0,.55); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
body.m-phone .card-zone > .card.m-open::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #3b4560; margin: 0 auto 8px; }
body.m-phone .zone-bottom { display: block; }
body.m-phone .m-etools:not([hidden]) { display: flex; position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 34; overflow-x: auto; gap: 2px; padding: 8px 6px; background: #1a2030; border-top: 1px solid var(--line); scrollbar-width: none; }
.m-etools button { flex: 0 0 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px; border: 0; border-radius: 10px; background: transparent; color: #c9ccd2; font-size: 11px; white-space: nowrap; }
.m-etools button span { font-size: 20px; line-height: 22px; height: 22px; color: #fff; display: flex; align-items: center; }
.m-etools button.on { background: #2b3249; }
.m-etools button:disabled { opacity: .35; }
.m-etools .brick-ico { transform: scale(1.2); }
/* projects editor on a phone: its own tool bar sits above the bottom menu */
body.m-phone .proj.layout-phone .pj-mtools { bottom: calc(64px + env(safe-area-inset-bottom)); }
body.m-phone .proj.layout-phone { padding-bottom: 170px; }
body.m-phone .proj.layout-phone .pj-panel { bottom: 0; z-index: 41; }
/* admin, help on a phone */
body.m-phone .help, body.m-phone #adminView { padding-bottom: 20px; }
.m-etools button span.brick-ico { width: 20px; height: 12px; margin: 7px 0 3px; font-size: 0; display: block; }
body.m-phone .timeline-card { padding: 10px; }

/* ---------- voice-over recording, extracting, sound library */
.rec-btn { border-color: #6b2a3a; }
.rec-bar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; border-radius: 30px; background: #2a1520; border: 1px solid #7a2a3d; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.rec-bar[hidden], .rec-count[hidden] { display: none; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #ff4d5e; animation: recPulse 1s infinite; }
@keyframes recPulse { 50% { opacity: .3; } }
.rec-bar b { font: 600 15px var(--mono); }
.rec-bar span#recLabel { font-size: 13px; color: #ffb4bf; }
.rec-count { position: fixed; inset: 0; z-index: 61; display: flex; align-items: center; justify-content: center; font: 700 120px var(--head); color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.8); pointer-events: none; background: rgba(0,0,0,.25); }
.aud-ex { display: grid; grid-template-columns: 1fr 110px; gap: 6px; }
.aud-ex .input { height: 34px; font-size: 13px; }
.aud-ex-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.aud-lib-sel { height: 34px; font-size: 13px; margin-top: 6px; width: 100%; }
.snd-lib { margin-bottom: 26px; }
.snd-hint { margin: -6px 0 10px; }
.snd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.snd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.snd-row .pl { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand-grad); color: #fff; flex: none; }
.snd-row .nm { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snd-row .nm small { display: block; color: var(--dim); font-size: 11px; }
.snd-row a, .snd-row .sl-x { flex: none; }
.vo-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 6px 8px; align-items: center; padding: 8px; border-radius: 9px; background: #18302a; }
.vo-row .subs-size { grid-column: 1 / -1; }
.vo-row .aud-t { all: unset; cursor: pointer; font: 12px var(--mono); color: #9be3b4; }
body.m-phone .snd-list { grid-template-columns: 1fr; }
body.m-phone .rec-bar { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); }
.snd-row a { color: var(--muted, #9aa3b5); text-decoration: none; font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.snd-row a:hover { color: var(--text, #fff); background: rgba(255,255,255,.06); }

/* first visit on a phone: which look? */
dialog.lay-ask { width: min(460px, calc(100vw - 24px)); padding: 22px; }
dialog.lay-ask h2 { font-size: 20px; }
.lay-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.lay-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 14px; border: 1.5px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; text-align: center; font: inherit; }
.lay-opt:hover, .lay-opt:focus-visible { border-color: var(--accent); background: rgba(246,103,45,.08); }
.lay-t { font-weight: 700; font-size: 15px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.lay-t em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 1px 8px; }
.lay-d { font-size: 12.5px; color: var(--muted, #9aa3b5); line-height: 1.35; }
.lay-pic { position: relative; display: block; background: #0d1018; border: 1px solid var(--line-2); border-radius: 10px; }
.lay-pic i { position: absolute; display: block; border-radius: 3px; }
.lay-pic-phone { width: 62px; height: 112px; border-radius: 12px; }
.lay-pic-phone .v { left: 6px; right: 6px; top: 8px; height: 46px; background: linear-gradient(135deg,#7b5cff,#f6672d); }
.lay-pic-phone .tl { left: 6px; right: 6px; top: 60px; height: 9px; background: #f08bb0; opacity: .8; }
.lay-pic-phone .t2 { top: 73px; background: #5fd08a; width: 30px; }
.lay-pic-phone .bar { left: 4px; right: 4px; bottom: 6px; height: 14px; display: flex; justify-content: space-around; align-items: center; }
.lay-pic-phone .bar b { width: 7px; height: 7px; border-radius: 50%; background: #9aa3b5; }
.lay-pic-pc { width: 132px; height: 84px; margin: 14px 0; }
.lay-pic-pc .v { left: 6px; top: 6px; width: 84px; height: 46px; background: linear-gradient(135deg,#7b5cff,#f6672d); }
.lay-pic-pc .side { right: 6px; top: 6px; width: 32px; height: 46px; background: #2a3142; }
.lay-pic-pc .tl { left: 6px; right: 6px; bottom: 8px; height: 18px; background: #2a3142; }
@media (max-width: 360px) { .lay-opts { grid-template-columns: 1fr; } }

/* project editor: several blocks selected */
.pj-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 8px 12px; border-radius: 12px; background: rgba(246,103,45,.12); border: 1px solid rgba(246,103,45,.45); }
.pj-selbar span { font-weight: 700; margin-right: auto; }
.pj-mtools button.on { background: rgba(246,103,45,.22); color: #fff; }
.proj.layout-phone .pj-selbar { margin: 6px 0; padding: 6px 10px; }
.pj-selbar[hidden] { display: none; }
