:root {
  color-scheme: dark;
  --bg: #07070b;
  --bg2: #0d0d14;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --border: rgba(255, 255, 255, 0.09);
  --border-2: rgba(255, 255, 255, 0.18);
  --text: #f5f5fa;
  --muted: #9b9bb2;
  --faint: #6c6c82;
  --a1: #7c5cff;
  --a2: #ff5c93;
  --a3: #ffb35c;
  --ok: #3ddc97;
  --err: #ff6b7a;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a3));
  --r: 18px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
u { text-decoration-color: var(--border-2); text-underline-offset: 3px; }

/* ── background ── */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.32; will-change: transform;
}
.aurora i:nth-child(1) { background: var(--a1); top: -30vmax; left: -15vmax; animation: drift1 22s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { background: var(--a2); top: -10vmax; right: -25vmax; opacity: 0.22; animation: drift2 26s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { background: var(--a3); bottom: -38vmax; left: 20vw; opacity: 0.14; animation: drift1 30s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-9vmax, 10vmax, 0) scale(0.9); } }

/* ── layout ── */
.top, main, .foot { position: relative; z-index: 1; width: min(1180px, 100% - 32px); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 22px 0 6px; }
.top .ai-pill + .ai-pill { margin-left: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 19px; color: var(--text); text-decoration: none; }
.mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: 0 6px 22px rgba(124, 92, 255, 0.45); }
.mark svg { width: 18px; height: 18px; }

.ai-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}
.ai-pill:hover { background: var(--surface-2); border-color: var(--border-2); }
.ai-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.ai-pill.on .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.18); }

main { padding-bottom: 40px; }
.view { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.hero { text-align: center; padding: 54px 0 36px; max-width: 760px; margin-inline: auto; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
h1 { font-size: clamp(34px, 6.2vw, 62px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 20px 0 16px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: 16px; }
.hero .sub { max-width: 560px; margin-inline: auto; }

.grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; align-items: start; }
.col { display: grid; gap: 20px; }
@media (max-width: 880px) { .grid { grid-template-columns: 1fr; } }

/* ── cards ── */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--r); padding: 22px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.card-h { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-h h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card-h .meta { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }
.num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
  background: var(--grad); color: #fff;
}

/* ── drop zone ── */
.drop {
  border: 1.5px dashed var(--border-2); border-radius: 14px; padding: 34px 16px; text-align: center; outline: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s; cursor: pointer;
}
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--a1); background: rgba(124, 92, 255, 0.09); }
.drop.over { transform: scale(1.01); }
.drop-ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.drop-ico svg { width: 22px; height: 22px; }
.drop-t { font-weight: 700; font-size: 16px; }
.drop-s { color: var(--muted); font-size: 13px; margin-top: 4px; }

.clips { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.clips:empty { display: none; }
.clip {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 8px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  animation: rise 0.35s ease both;
}
.clip video { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; background: #000; pointer-events: none; }
.clip .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip .sz { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.x { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.x:hover { background: var(--surface-2); color: var(--text); }

/* ── form bits ── */
.field { display: grid; gap: 8px; margin-top: 18px; }
.seg + .field { margin-top: 22px; }
.card-h + .field { margin-top: 0; }
.field > span, .field .row { font-size: 13px; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; font-weight: 500; color: var(--faint); margin-left: 6px; }
.row { display: flex; justify-content: space-between; }
.row output { color: var(--text); font-family: var(--mono); }
textarea, input[type="text"], input[type="password"] {
  width: 100%; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; resize: vertical;
}
textarea:focus, input[type="text"]:focus, input[type="password"]:focus {
  border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}
::placeholder { color: var(--faint); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--surface-2); outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(124, 92, 255, 0.4); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 13px; transition: all 0.2s;
}
.chips button:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.seg.two { grid-template-columns: 1fr 1fr; margin-bottom: 4px; }
.seg button {
  display: grid; justify-items: center; gap: 4px; padding: 12px 6px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); transition: all 0.2s; text-align: center;
}
.seg button b { font-size: 14px; }
.seg button small { font-size: 11px; color: var(--muted); }
.seg button:hover { border-color: var(--border-2); }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { border-color: var(--a1); background: rgba(124, 92, 255, 0.14); box-shadow: inset 0 0 0 1px var(--a1); }
.ar { display: block; border: 2px solid currentColor; border-radius: 3px; opacity: 0.8; }
.a916 { width: 14px; height: 24px; } .a11 { width: 20px; height: 20px; } .a45 { width: 17px; height: 21px; } .a169 { width: 26px; height: 15px; }

.file {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px dashed var(--border-2); color: var(--muted); font-size: 14px; transition: all 0.2s;
}
.file:hover { border-color: var(--a1); color: var(--text); }
.file span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.has { border-style: solid; color: var(--text); }

/* ── buttons ── */
.go {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 17px 22px; border: 0;
  border-radius: 16px; font-size: 17px; font-weight: 700; color: #fff; background: var(--grad);
  box-shadow: 0 12px 40px rgba(255, 92, 147, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s, opacity 0.2s;
}
.go svg { width: 20px; height: 20px; transition: transform 0.2s; }
.go:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 48px rgba(255, 92, 147, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.go:hover:not(:disabled) svg { transform: translateX(4px); }
.go:disabled { opacity: 0.4; cursor: not-allowed; filter: saturate(0.5); box-shadow: none; }
.fine { color: var(--faint); font-size: 12.5px; margin-top: 10px; }
.go + .fine { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 11px 18px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: 14px; text-decoration: none; color: var(--text);
  transition: all 0.2s;
}
.btn:hover { border-color: var(--border-2); background: rgba(255, 255, 255, 0.11); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 22px rgba(255, 92, 147, 0.28); }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── working view ── */
.work { max-width: 560px; margin: 48px auto; text-align: center; padding: 38px 28px; }
.work h2 { font-size: 24px; letter-spacing: -0.02em; margin-top: 18px; }
.ring { position: relative; width: 128px; height: 128px; margin-inline: auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring .trk { stroke: var(--surface-2); }
.ring .bar { stroke: var(--a2); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset 0.5s ease; filter: drop-shadow(0 0 8px rgba(255, 92, 147, 0.6)); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 26px; font-family: var(--mono); }
.steps { list-style: none; padding: 0; margin: 26px auto 0; display: grid; gap: 10px; text-align: left; max-width: 300px; }
.steps li { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 14px; transition: color 0.3s; }
.steps i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); position: relative; flex: none; transition: all 0.3s; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active i { border-color: var(--a2); border-top-color: transparent; animation: spin 0.8s linear infinite; }
.steps li.done { color: var(--muted); }
.steps li.done i { background: var(--ok); border-color: var(--ok); }
.steps li.done i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #04170e; border-width: 0 2px 2px 0; transform: rotate(45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── result ── */
.result { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 24px; padding-top: 34px; align-items: start; }
@media (max-width: 880px) { .result { grid-template-columns: 1fr; } .player-col { max-width: 420px; margin-inline: auto; width: 100%; } }
.player-col { position: sticky; top: 16px; }
.player {
  position: relative; border-radius: 22px; overflow: hidden; background: #000; border: 1px solid var(--border-2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04); max-height: 78vh; display: grid;
}
.player video { width: 100%; height: 100%; max-height: 78vh; display: block; background: #000; object-fit: contain; }
.busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgba(7, 7, 11, 0.78); backdrop-filter: blur(6px); }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: var(--a2); animation: spin 0.8s linear infinite; }
.side-col { display: grid; gap: 18px; }
.actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.revise { display: flex; gap: 10px; }
.revise input { flex: 1; }
.timeline { display: flex; height: 46px; border-radius: 12px; overflow: hidden; gap: 3px; }
.seg-cut { position: relative; min-width: 6px; border-radius: 6px; transition: filter 0.2s, transform 0.2s; }
.seg-cut:hover { filter: brightness(1.25); transform: scaleY(1.08); }
.seg-cut.has-cap::after { content: "Aa"; position: absolute; left: 4px; bottom: 2px; font-size: 9px; font-weight: 800; opacity: 0.85; }
.seg-cut.has-fx::before { content: ""; position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0.9; }
.legend { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); margin-right: 6px; }

/* ── dialog ── */
dialog {
  width: min(480px, calc(100% - 32px)); padding: 26px; border-radius: 22px; color: var(--text);
  background: linear-gradient(180deg, #17172a, #101019); border: 1px solid var(--border-2); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7);
}
dialog::backdrop { background: rgba(4, 4, 8, 0.7); backdrop-filter: blur(6px); }
dialog h2 { font-size: 21px; letter-spacing: -0.02em; margin-bottom: 8px; }
dialog .sub { font-size: 14px; margin-bottom: 18px; }
.dlg-x { position: absolute; top: 14px; right: 14px; margin: 0; }
.dlg-x button { width: 32px; height: 32px; border-radius: 10px; border: 0; background: var(--surface-2); font-size: 20px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.err { color: var(--err); font-size: 13.5px; margin-top: 10px; }
#keyHelp a { color: var(--text); }

/* ── misc ── */
.toasts { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 10px; width: min(440px, calc(100% - 32px)); }
.toast {
  padding: 13px 16px; border-radius: 14px; background: #1a1a2b; border: 1px solid var(--border-2);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55); font-size: 14px; animation: rise 0.3s ease;
}
.toast.err { border-color: rgba(255, 107, 122, 0.55); }
.toast.ok { border-color: rgba(61, 220, 151, 0.5); }
.foot { padding: 10px 0 40px; text-align: center; color: var(--faint); font-size: 12.5px; }

:focus-visible { outline: 2px solid var(--a1); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 520px) {
  .hero { padding-top: 34px; }
  .card { padding: 18px; }
  .seg { grid-template-columns: repeat(2, 1fr); }
}

.banner {
  position: relative; z-index: 1; width: min(1180px, 100% - 32px); margin: 14px auto 0; padding: 12px 16px;
  border-radius: 14px; font-size: 14px; color: #ffe2b0; background: rgba(255, 179, 92, 0.1); border: 1px solid rgba(255, 179, 92, 0.35);
}
.banner b { color: #fff; }

.tabs { margin-bottom: 16px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 12px 0; text-transform: uppercase; letter-spacing: 0.1em; }
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: var(--border); }
#refBlock .fine { margin: 10px 0 4px; }
#refBlock em { font-style: normal; color: var(--muted); }
input[type="url"] {
  width: 100%; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="url"]:focus { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18); }
.speed { margin-top: 6px; min-height: 20px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.notes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.notes:empty { display: none; }
.notes li { font-size: 13px; color: #ffe2b0; background: rgba(255, 179, 92, 0.1); border: 1px solid rgba(255, 179, 92, 0.3); border-radius: 10px; padding: 8px 12px; }

.recent { margin: -8px 0 22px; }
.recent h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.recent ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.recent button {
  display: grid; gap: 2px; text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); min-width: 150px; transition: all 0.2s;
}
.recent button:hover:not(:disabled) { border-color: var(--a1); background: rgba(124, 92, 255, 0.1); }
.recent button:disabled { opacity: 0.5; cursor: default; }
.recent b { font-size: 14px; }
.recent small { color: var(--muted); font-size: 12px; }
.revise .btn { white-space: nowrap; }

.tips { margin: 0 0 4px; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 6px; }
.tips b { color: var(--text); }

.update-pill { margin-left: auto; border-color: rgba(255, 179, 92, 0.5); background: rgba(255, 179, 92, 0.1); color: #ffe2b0; }
.update-pill .dot { background: var(--a3); box-shadow: 0 0 0 4px rgba(255, 179, 92, 0.2); }
.update-pill + .ai-pill { margin-left: 0; }
.ver { color: var(--faint); font-family: var(--mono); font-size: 12px; }

/* ═════════ navigation + account ═════════ */
.nav { display: flex; gap: 4px; margin-left: 24px; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; transition: all 0.2s; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.on { color: var(--text); background: var(--surface-2); }
.top { flex-wrap: wrap; }
.top .nav { margin-right: auto; }
.update-pill { margin-left: 0; }
.acct { max-width: 220px; }
.acct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) { .nav { order: 5; width: 100%; margin: 6px 0 0; } }

/* ═════════ sign in ═════════ */
.auth { max-width: 460px; margin: 56px auto; padding: 32px; }
.auth-h { font-size: 30px; margin: 0 0 8px; }
.auth .sub { margin-bottom: 20px; font-size: 15px; }
.auth form { display: grid; gap: 0; }
.auth .go { margin-top: 18px; }
.err { color: var(--err); font-size: 13.5px; margin: 12px 0 0; }

/* ═════════ page header + grids ═════════ */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 38px 0 22px; flex-wrap: wrap; }
.page-h.tight { padding: 22px 0 16px; align-items: center; }
.page-title { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.03em; font-weight: 800; margin: 0 0 4px; }
.btn.big { padding: 13px 22px; font-size: 15px; border-radius: 14px; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card-item {
  position: relative; display: grid; gap: 4px; border: 1px solid var(--border); border-radius: 16px; padding: 10px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); transition: border-color 0.2s, transform 0.2s;
}
.card-item:hover { border-color: var(--border-2); transform: translateY(-2px); }
.card-open { all: unset; display: grid; gap: 4px; cursor: pointer; }
.card-open:focus-visible { outline: 2px solid var(--a1); outline-offset: 4px; border-radius: 10px; }
.cover { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: #0b0b12; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; opacity: 0.5; }
.cover .chip { position: absolute; left: 8px; top: 8px; }
.card-name { font-weight: 700; font-size: 15px; padding: 6px 4px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--muted); font-size: 12.5px; padding: 0 4px 4px; }
.card-item .del { position: absolute; right: 14px; top: 14px; background: rgba(7, 7, 11, 0.7); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.2s; }
.card-item:hover .del, .card-item .del:focus-visible { opacity: 1; }
.empty { text-align: center; padding: 70px 20px; border: 1.5px dashed var(--border-2); border-radius: 22px; }
.empty-ico { font-size: 40px; margin-bottom: 8px; }
.empty h2 { font-size: 22px; margin: 0 0 6px; }
.empty .btn { margin-top: 18px; }

.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  background: rgba(20, 20, 30, 0.8); border: 1px solid var(--border-2); color: var(--muted); backdrop-filter: blur(6px); }
.chip.done { color: #c9f5df; border-color: rgba(61, 220, 151, 0.5); }
.chip.running, .chip.queued { color: #ffe2b0; border-color: rgba(255, 179, 92, 0.5); }
.chip.error { color: #ffc4cb; border-color: rgba(255, 107, 122, 0.55); }

/* ═════════ project workspace ═════════ */
.crumbs { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-width: 0; }
.link { all: unset; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.link:hover { color: var(--text); }
.name-input {
  background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 6px 10px; font-size: 22px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--text); outline: none; min-width: 220px; max-width: 100%;
}
.name-input:hover { border-color: var(--border); }
.name-input:focus { border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18); }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 20px; align-items: start; padding-bottom: 30px; }
.work-grid .col { display: grid; gap: 20px; }
.sticky { position: sticky; top: 16px; }
@media (max-width: 900px) { .work-grid { grid-template-columns: 1fr; } .sticky { position: static; } }
.drop.slim { padding: 18px 14px; }
.drop.slim .drop-t { font-size: 15px; }
.drop.slim .drop-s { display: inline; margin-left: 6px; }
.drop.slim .drop-s + .drop-s, .drop.slim p.drop-s { display: block; margin: 4px 0 0; }
#pickLibrary { margin-top: 12px; width: 100%; }
.upload-card { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 8px; background: var(--grad); transition: width 0.35s ease; }
.up-line { margin: 10px 0 0; font-size: 14px; }
.up-line span { color: var(--muted); margin-left: 6px; font-family: var(--mono); font-size: 12.5px; }
.preview-card { display: grid; gap: 14px; }
.player.empty-player { aspect-ratio: 9 / 16; max-height: 62vh; margin-inline: auto; width: min(100%, 360px); background: #08080d; }
.placeholder { display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--muted); text-align: center; padding: 20px; }
.placeholder p { margin: 0; font-size: 14px; }
.progress-block { padding: 2px 2px 0; }
.preview-card .go { margin-top: 2px; }
.preview-card .fine { margin: 0; text-align: center; }
#resultMeta { text-align: left; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ═════════ dialogs ═════════ */
.pw { margin: 12px 0 4px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.pw summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.pw .btn { margin-top: 14px; }
.pick-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.pick { display: grid; grid-template-columns: auto 64px 1fr; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.pick:hover { border-color: var(--border-2); }
.pick img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; background: #000; }
.pick b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick small { color: var(--muted); font-size: 12px; }
.clip img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; background: #000; }
.clips { margin-top: 12px; }

/* ═════════ install page ═════════ */
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 820px) { .install-grid { grid-template-columns: 1fr; } }
main > .card { margin-bottom: 20px; }
.primary-dl { display: grid; gap: 14px; align-content: center; justify-items: start; }
.primary-dl .btn.big { font-size: 17px; padding: 16px 26px; }
.primary-dl .btn[aria-disabled="true"] { opacity: 0.6; pointer-events: none; }
.code { margin: 14px 0; padding: 14px 16px; border-radius: 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--border);
  font-family: var(--mono); font-size: 13px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.dl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dl-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.dl-list b { display: block; }
.dl-list small { color: var(--muted); font-size: 12.5px; }
.steps-doc { margin: 0; padding-left: 20px; display: grid; gap: 12px; color: var(--muted); }
.steps-doc b { color: var(--text); }
.steps-doc code, .fine code, .banner code { font-family: var(--mono); font-size: 12.5px; background: rgba(0,0,0,0.35); padding: 2px 6px; border-radius: 6px; color: var(--text); }
.foot a { color: var(--muted); }
.foot .link { display: inline; font-size: inherit; color: var(--muted); text-decoration: underline; }
.install-pill { border-color: rgba(124, 92, 255, 0.55); background: rgba(124, 92, 255, 0.12); }

/* ═════════ editable timeline ═════════ */
.timeline.editable { height: 58px; gap: 4px; padding: 4px; overflow-x: auto; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); border-radius: 14px; }
.timeline.editable .seg-cut {
  min-width: 36px; display: flex; align-items: flex-end; padding: 4px 6px; font-size: 10.5px; font-weight: 700; color: rgba(0, 0, 0, 0.75);
  cursor: pointer; user-select: none; border: 2px solid transparent; overflow: hidden; white-space: nowrap;
}
.timeline.editable .seg-cut.sel { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18); }
.timeline.editable .seg-cut.dragover { outline: 2px dashed #fff; outline-offset: 2px; }
.timeline.editable .seg-cut.dragging { opacity: 0.45; }
.tl-hint { margin: -4px 0 10px; text-align: left; }
.tl-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.danger { color: #ffc4cb; border-color: rgba(255, 107, 122, 0.45); }
.inspector { margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(0, 0, 0, 0.2); }
.insp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; margin-bottom: 12px; }
.insp-grid .field { margin-top: 0; }
.inspector .field input[type="number"], .inspector select, .inspector input[type="text"] {
  width: 100%; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; outline: none; color: var(--text);
}
.inspector select { appearance: none; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.pending {
  position: sticky; bottom: 12px; margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; background: #1c1730; border: 1px solid rgba(124, 92, 255, 0.6); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.pending-actions { display: flex; gap: 8px; }
