/* Video Grabber — minimal, calm, one accent colour. */
:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --glow: rgba(48, 87, 245, .09);
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --line: #e8e6e1;
  --line-strong: #d6d3cc;
  --text: #191917;
  --muted: #6f6c66;
  --faint: #a8a59e;
  --accent: #3057f5;
  --accent-soft: rgba(48, 87, 245, .12);
  --ink: #191917;
  --ink-text: #ffffff;
  --ok: #148a4c;
  --ok-soft: rgba(20, 138, 76, .11);
  --warn: #a8610a;
  --warn-soft: rgba(217, 119, 6, .12);
  --err: #c9283f;
  --err-soft: rgba(201, 40, 63, .09);
  --dim: rgba(18, 18, 22, .56);
  --shadow: 0 1px 2px rgba(25, 25, 23, .04), 0 18px 40px -18px rgba(25, 25, 23, .16);
  --radius: 22px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --glow: rgba(124, 147, 255, .11);
    --surface: #141417;
    --surface-2: #1b1b20;
    --line: #26262c;
    --line-strong: #34343c;
    --text: #f2f2f3;
    --muted: #9b9ba5;
    --faint: #63636d;
    --accent: #8ea2ff;
    --accent-soft: rgba(142, 162, 255, .16);
    --ink: #f2f2f3;
    --ink-text: #0b0b0d;
    --ok: #46d494;
    --ok-soft: rgba(70, 212, 148, .13);
    --warn: #f0a94b;
    --warn-soft: rgba(240, 169, 75, .13);
    --err: #ff7387;
    --err-soft: rgba(255, 115, 135, .11);
    --shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 24px 48px -24px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  display: flex; flex-direction: column;
}
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(70% 45% at 50% -8%, var(--glow), transparent 72%); }
[hidden] { display: none !important; }
.boot #form, .boot #platforms { visibility: hidden; }   /* until we know whether a password is needed */
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; box-shadow: 0 0 0 1.5px var(--accent); }
svg { display: block; }
.ico { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.fill { fill: currentColor; stroke: none; }

/* ---------- layout ---------- */
.top { display: flex; align-items: center; justify-content: space-between; width: min(100%, 760px);
  margin: 0 auto; padding: 22px 20px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.02em; font-size: 17px; text-decoration: none; color: inherit; }
.brand svg { width: 30px; height: 30px; }
.badge-mode { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; }
main { width: min(100%, 760px); margin: 0 auto; padding: 0 20px 48px; flex: 1; }

.hero { text-align: center; padding: clamp(28px, 7vh, 64px) 0 26px; }
.hero h1 { margin: 0; font-size: clamp(32px, 7vw, 52px); line-height: 1.04; letter-spacing: -.04em; font-weight: 680; }
.hero h1 span { color: var(--muted); font-weight: 600; }
.hero p { margin: 14px auto 0; max-width: 34em; color: var(--muted); font-size: clamp(15px, 2.4vw, 17px); }

.search { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 7px 7px 7px 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.search .ico { color: var(--faint); width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 12px 6px; }
.search input::placeholder { color: var(--faint); }
.search input:focus-visible { outline: 0; box-shadow: none; }
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 16px 0 0; color: var(--faint); font-size: 13px; }
.platforms span::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); margin-right: 7px; vertical-align: 1px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent;
  border-radius: 14px; padding: 12px 18px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  transition: transform .12s, background .15s, box-shadow .15s, opacity .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--ink); color: var(--ink-text); }
.btn.primary:hover { box-shadow: 0 8px 22px -8px rgba(0, 0, 0, .45); transform: translateY(-1px); }
.btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.big { width: 100%; padding: 16px 20px; font-size: 16px; border-radius: 16px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.link { background: none; border: 0; padding: 4px 2px; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }
.icon-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; flex: none; transition: background .15s, transform .12s; }
.icon-btn:hover { background: var(--accent-soft); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .ico { width: 18px; height: 18px; }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }
.mini { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.mini:hover { background: var(--accent-soft); color: var(--accent); }
.mini .ico { width: 16px; height: 16px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-top: 22px; animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 13px 15px; border-radius: 14px;
  background: var(--err-soft); color: var(--err); font-size: 14.5px; line-height: 1.45; }
.notice .ico { margin-top: 2px; }
.notice.soft { background: var(--surface-2); color: var(--muted); }

/* ---------- stage (preview) ---------- */
.stage-wrap { display: flex; justify-content: center; }
.stage { --arn: 1.7778; position: relative; width: min(100%, calc(50vh * var(--arn))); aspect-ratio: var(--arn);
  background: #000; border-radius: 16px; overflow: hidden; isolation: isolate; cursor: pointer; }
.stage img, .stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .tag { position: absolute; left: 10px; top: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 10px 5px 8px; border-radius: 999px; }
.stage .tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #fff); }
.bigplay { position: absolute; z-index: 2; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; border: 0; color: #fff;
  background: rgba(0, 0, 0, .46); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); display: grid; place-items: center;
  transition: transform .15s, opacity .2s, background .15s; }
.bigplay:hover { transform: scale(1.06); background: rgba(0, 0, 0, .6); }
.bigplay .ico { width: 26px; height: 26px; margin-left: 3px; }
.stage.playing .bigplay { opacity: 0; pointer-events: none; }
.mute { position: absolute; right: 10px; bottom: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0; color: #fff;
  background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: grid; place-items: center; }
.mute .ico { width: 16px; height: 16px; }
.stage-msg { position: absolute; z-index: 3; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-size: 13px; padding: 8px 14px;
  border-radius: 999px; white-space: nowrap; max-width: calc(100% - 24px); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.head { margin: 18px 2px 0; }
.head h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; font-weight: 620;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 14px; scrollbar-width: none; }
.tabs button { flex: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: var(--ink-text); border-color: transparent; }

/* ---------- timeline ---------- */
.clip { margin-top: 22px; }
.transport { display: flex; align-items: center; gap: 14px; }
.tl-wrap { flex: 1; min-width: 0; padding: 0 16px; }
.timeline { position: relative; height: 58px; border-radius: 12px; background: var(--surface-2); touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.timeline.off { opacity: .5; pointer-events: none; }
.strip { position: absolute; inset: 0; border-radius: 12px; background-size: 100% 100%; background-repeat: no-repeat; overflow: hidden; }
.strip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 60%, rgba(0, 0, 0, .18)); }
.dim { position: absolute; top: 0; bottom: 0; background: var(--dim); }
.dim.l { left: 0; border-radius: 12px 0 0 12px; }
.dim.r { right: 0; border-radius: 0 12px 12px 0; }
.sel { position: absolute; top: -3px; bottom: -3px; border-top: 3px solid var(--accent); border-bottom: 3px solid var(--accent); pointer-events: none; }
.handle { position: absolute; top: -3px; bottom: -3px; width: 16px; background: var(--accent); display: grid; place-items: center; cursor: ew-resize;
  touch-action: none; transition: filter .15s; }
.handle.a { transform: translateX(-100%); border-radius: 10px 0 0 10px; }
.handle.b { border-radius: 0 10px 10px 0; }
.handle::after { content: ""; width: 3px; height: 20px; border-radius: 2px; background: rgba(255, 255, 255, .92); }
.handle::before { content: ""; position: absolute; inset: -6px -8px; }
.handle:hover, .handle.drag { filter: brightness(1.12); }
.handle:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.playhead { position: absolute; top: -7px; bottom: -7px; width: 2px; margin-left: -1px; background: #fff; border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; z-index: 2; }
.playhead::before { content: ""; position: absolute; top: -2px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }

.times { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin-top: 14px; }
.tf { display: flex; flex-direction: column; gap: 4px; }
.tf.r { align-items: flex-end; }
.tf > span { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding-left: 2px; }
.tf .row { display: flex; align-items: center; gap: 2px; }
.tf.r .row { flex-direction: row-reverse; }
.tf input { width: 104px; text-align: center; font-weight: 620; font-size: 15px; font-variant-numeric: tabular-nums; background: var(--surface-2);
  border: 1px solid transparent; border-radius: 10px; padding: 8px 8px; outline: 0; transition: border-color .15s, background .15s; }
.tf input:focus { border-color: var(--accent); background: var(--surface); }
.pill { justify-self: center; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 13px; padding: 7px 13px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.keys { margin: 12px 0 0; text-align: center; color: var(--faint); font-size: 12.5px; }
kbd { font: 600 11px var(--font); background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--muted); }

/* ---------- options ---------- */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 22px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); font-weight: 600; padding-left: 2px; }
.select { position: relative; }
.select select { width: 100%; appearance: none; -webkit-appearance: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 36px 11px 13px; font-weight: 560; font-size: 14.5px; outline: 0; text-overflow: ellipsis; cursor: pointer; }
.select select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 8px 14px; font-weight: 620; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.hint { display: flex; gap: 9px; align-items: flex-start; margin: 14px 2px 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; min-height: 20px; }
.hint i { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; background: var(--faint); }
.hint.ok i { background: var(--ok); } .hint.warn i { background: var(--warn); }

.cta { margin-top: 18px; }

/* ---------- progress ---------- */
.progress { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.p-top, .p-bot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.p-top { font-weight: 620; font-size: 15px; }
.p-top b { font-variant-numeric: tabular-nums; color: var(--accent); }
.bar { height: 8px; border-radius: 99px; background: var(--line); margin: 12px 0; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width .35s ease; }
.bar.ind i { width: 38% !important; animation: slide 1.25s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-110%); } 100% { transform: translateX(290%); } }
.p-bot { font-size: 13px; color: var(--muted); min-height: 24px; font-variant-numeric: tabular-nums; }

/* ---------- result ---------- */
.result { margin-top: 18px; padding: 18px; border-radius: 16px; background: var(--ok-soft); animation: rise .3s both; }
.r-head { display: flex; align-items: center; gap: 12px; }
.check { width: 36px; height: 36px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; flex: none; }
.check .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.r-head b { display: block; font-size: 16px; }
.r-head small { display: block; color: var(--muted); font-size: 13.5px; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.chips span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 560; font-variant-numeric: tabular-nums; }
.r-how { margin: 0 0 14px; font-size: 13.5px; color: var(--muted); }
.r-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- skeleton & lock ---------- */
.sk { background: linear-gradient(100deg, var(--surface-2) 30%, var(--line) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: shimmer 1.4s linear infinite; border-radius: 14px; }
@keyframes shimmer { to { background-position: -150% 0; } }
.lock { max-width: 420px; margin-inline: auto; text-align: center; }
.lock h2 { margin: 6px 0 4px; font-size: 20px; letter-spacing: -.02em; }
.lock p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; }
.lock form { display: flex; gap: 8px; }
.lock input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; outline: 0; }
.lock input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

footer { text-align: center; color: var(--faint); font-size: 12.5px; padding: 0 20px 28px; }

/* ---------- small screens ---------- */
@media (max-width: 560px) {
  .top { padding: 16px 16px 0; } main { padding: 0 14px 40px; }
  .card { padding: 14px; border-radius: 20px; }
  .search { flex-wrap: wrap; padding: 8px; border-radius: 18px; }
  .search input { flex-basis: calc(100% - 36px); padding: 10px 4px; }
  .search .btn { flex: 1; }
  .transport { gap: 8px; } .tl-wrap { padding: 0 14px 0 12px; }
  .times { grid-template-columns: 1fr 1fr; } .pill { grid-column: 1 / -1; order: -1; }
  .stage { width: min(100%, calc(46vh * var(--arn))); }
  .keys { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition: none !important; } }
