:root {
  --bg: #0d0f12; --panel: #161a20; --panel-2: #1d222a; --line: #2a313b;
  --text: #e9edf2; --muted: #8b95a3; --accent: #c6ff3d; --accent-ink: #12160a;
  --yt: #ff3d3d; --twitch: #a970ff; --kick: #53fc18; --err: #ff6b6b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6;
  background-image: radial-gradient(circle at 20% -10%, #1d2a12 0, transparent 40%);
  background-repeat: no-repeat;
}
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { border-bottom: 1px solid var(--line); background: #0d0f12cc; backdrop-filter: blur(8px);
       position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.4rem;
        color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; align-items: center; }
.nav > a, .more summary { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px;
                          font-weight: 500; font-size: 15px; cursor: pointer; }
.nav > a:hover, .more summary:hover, .nav a[aria-current] { color: var(--text); background: var(--panel); }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: " ▾"; font-size: 12px; }
.menu { position: absolute; right: 0; top: 44px; background: var(--panel); border: 1px solid var(--line);
        border-radius: 12px; padding: 6px; min-width: 230px; display: grid; box-shadow: 0 10px 30px #0008; }
.menu a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.menu a:hover { background: var(--panel-2); }

/* hero + tool */
.hero { padding: 48px 0 24px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
h1 { font-family: "Space Grotesk", sans-serif; font-size: clamp(2rem, 6vw, 3.2rem);
     letter-spacing: -0.03em; margin: 0 0 8px; line-height: 1.05; }
h2 { font-family: "Space Grotesk", sans-serif; font-size: clamp(1.5rem, 4vw, 2rem); letter-spacing: -0.02em;
     margin: 0 0 20px; line-height: 1.15; }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 17px; }
.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
        border: 1px solid var(--line); color: var(--muted); transition: .2s; }
.chip i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.chip.on { color: var(--text); border-color: currentColor; }
.chip[data-p=youtube] i { background: var(--yt); } .chip[data-p=youtube].on { color: var(--yt); }
.chip[data-p=twitch] i { background: var(--twitch); } .chip[data-p=twitch].on { color: var(--twitch); }
.chip[data-p=kick] i { background: var(--kick); } .chip[data-p=kick].on { color: var(--kick); }

.notice { background: #2a2410; border: 1px solid #6b5a1a; color: #f3e3a6; border-radius: 12px; padding: 12px 16px;
          margin: 0 0 20px; font-size: 15px; line-height: 1.5; }
.notice strong { color: #ffe27a; }
.notice a { color: var(--accent); }
.chip.paused { opacity: .55; }
.chip em { font-style: normal; font-weight: 500; font-size: 11px; margin-left: 2px; }
form { display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--line);
       border-radius: 14px; padding: 6px; }
form:focus-within { border-color: var(--accent); }
input, select { background: transparent; border: 0; color: var(--text); font: inherit; outline: none; }
#url { flex: 1; min-width: 0; padding: 12px; }
button { font: inherit; font-weight: 600; border: 0; border-radius: 10px; cursor: pointer;
         padding: 12px 20px; background: var(--accent); color: var(--accent-ink); }
button:disabled { opacity: .5; cursor: progress; }
.msg { margin-top: 12px; color: var(--err); min-height: 1.2em; font-size: 14px; }

.card { margin-top: 12px; background: var(--panel); border: 1px solid var(--line);
        border-radius: 14px; overflow: hidden; display: none; }
.card.show { display: block; animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.meta { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 16px; }
.thumb { position: relative; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
             color: transparent; opacity: 0; transition: opacity .25s; }
.thumb img.loaded { opacity: 1; }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: "Space Grotesk", sans-serif;
             font-weight: 700; letter-spacing: .12em; font-size: 15px; color: #ffffff55;
             background: linear-gradient(135deg, #1d222a, #12161b); }
.thumb[data-p=kick] .ph   { color: #53fc18; background: radial-gradient(circle at 30% 20%, #53fc1826, transparent 60%), #10140f; }
.thumb[data-p=twitch] .ph { color: #a970ff; background: radial-gradient(circle at 30% 20%, #a970ff2e, transparent 60%), #13101a; }
.thumb[data-p=youtube] .ph{ color: #ff3d3d; background: radial-gradient(circle at 30% 20%, #ff3d3d26, transparent 60%), #1a1010; }
.thumb .dur { z-index: 1; }
.dur { position: absolute; right: 6px; bottom: 6px; background: #000c; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.title { font-weight: 600; line-height: 1.35; margin: 0 0 6px; }
.by { color: var(--muted); font-size: 13px; }
.opts { border-top: 1px solid var(--line); padding: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.q { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); padding: 8px 14px; }
.q.sel { border-color: var(--accent); color: var(--accent); }
.opts .go { margin-left: auto; }
.extra { padding: 0 16px 16px; display: grid; gap: 12px; }
.subs-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 14px; }
.subs-row label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.subs-row select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
                   padding: 8px 10px; color: var(--text); width: auto; min-width: 160px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.hint.bad { color: var(--err); }

/* full video / trim switch */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 7px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg button:not([aria-pressed="true"]):hover { color: var(--text); }

/* drag-to-trim timeline */
.trim-ui { margin-top: 14px; display: grid; gap: 12px; }
.tl { padding: 30px 24px 0; }                       /* room for the time bubbles + handle overhang */
.tl-track { position: relative; height: 6px; border-radius: 99px; background: #3a4350;
            cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.tl-track::before { content: ""; position: absolute; inset: -16px 0; }   /* taller hit area */
.tl-sel { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 99px; cursor: grab;
          box-shadow: 0 0 0 1px #c6ff3d33, 0 0 14px #c6ff3d40; }
.tl-sel::before { content: ""; position: absolute; inset: -16px 0; }
.tl.dragging .tl-sel, .tl.dragging .tl-track { cursor: grabbing; }
.tl-h { position: absolute; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
        display: grid; place-items: center; cursor: ew-resize; outline: none; z-index: 2; }
.tl-grip { width: 20px; height: 22px; background: var(--accent); filter: drop-shadow(0 2px 4px #000a);
           transition: transform .12s; }
.tl-start .tl-grip { clip-path: polygon(15% 0, 100% 50%, 15% 100%); }      /* ▶ */
.tl-end .tl-grip   { clip-path: polygon(85% 0, 0 50%, 85% 100%); }        /* ◀ */
/* tips point at the exact cut: ▶ sits just left of the start, ◀ just right of the end */
.tl-start { margin-left: -32px; }
.tl-end   { margin-left: -12px; }
.tl-start .tl-tip { left: calc(50% + 10px); }
.tl-end .tl-tip   { left: calc(50% - 10px); }
.tl-h:hover .tl-grip, .tl-h.active .tl-grip { transform: scale(1.18); }
.tl-h:focus-visible::after { content: ""; position: absolute; inset: 8px; border-radius: 8px; border: 2px solid var(--text); }
.tl-tip { position: absolute; bottom: 38px; left: 50%; transform: translateX(-50%); white-space: nowrap;
          background: var(--text); color: var(--bg); font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
          font-variant-numeric: tabular-nums; pointer-events: none; }
.tl-tip:empty { display: none; }
.tl-h.active { z-index: 3; }
.tl-scale { display: flex; justify-content: space-between; margin-top: 14px; color: var(--muted); font-size: 12px;
            font-variant-numeric: tabular-nums; }
.trim-fields { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.trim-fields label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.trim-fields input { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
                     width: 104px; color: var(--text); font-variant-numeric: tabular-nums; text-align: center; }
.trim-fields input:focus { border-color: var(--accent); }
.trim-fields input.bad { border-color: var(--err); }
.t-len { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.prog { border-top: 1px solid var(--line); padding: 16px; display: none; }
.prog.show { display: block; }
.bar { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; }
.bar div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.stats { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; margin-top: 8px; }
.save { display: none; margin-top: 12px; text-decoration: none; text-align: center;
        background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 12px; border-radius: 10px; }
.save.show { display: block; }

/* content sections */
.block { padding: 40px 0; border-top: 1px solid #1a1f26; }
.prose p { color: #c5ccd6; margin: 0 0 16px; }
.prose h2 { font-size: 1.3rem; margin: 28px 0 8px; }
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.features li { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.features p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tick { flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
        display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding: 16px 16px 16px 60px; background: var(--panel);
            border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
                    border: 1px solid var(--accent); color: var(--accent); display: grid; place-items: center;
                    font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 24px 14px 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; color: var(--accent); font-size: 20px; }
.faq details[open] summary::after { content: "−"; }
.faq h3 { display: inline; font-size: 16px; font-weight: 600; margin: 0; }
.faq p { margin: 0 0 16px; color: var(--muted); }
.related { display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.related a { display: flex; justify-content: space-between; padding: 14px 18px; color: var(--text); text-decoration: none;
             border-top: 1px solid var(--line); }
.related a:first-child { border-top: 0; }
.related a:hover { background: var(--panel-2); color: var(--accent); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 24px; margin-top: 24px; background: #0a0c0f; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; margin-bottom: 24px; }
.foot-cols a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; padding: 3px 0; }
.foot-cols a:hover { color: var(--text); }
.foot-h { font-weight: 600; margin: 0 0 8px; }
.fine { color: var(--muted); font-size: 12px; margin: 6px 0; }

@media (max-width: 600px) {
  .meta { grid-template-columns: 1fr; }
  form { flex-direction: column; }
  .opts .go { margin-left: 0; width: 100%; }
  .trim-fields input { width: 92px; }
  .t-len { order: 3; width: 100%; text-align: center; }
  .nav > a { display: none; }
  .hero { padding-top: 32px; }
}
