:root {
  --bg: #0f1115; --card: #1a1d24; --card2: #232733; --line: #2c3140;
  --text: #e8eaf0; --muted: #9aa0ad; --accent: #ff4d4d; --accent2: #4d7cff;
  --ok: #3ecf8e; --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}
.topbar { padding: 16px 24px; border-bottom: 1px solid var(--line); }
.logo { color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.container { max-width: 820px; margin: 0 auto; padding: 28px 18px 60px; }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px; }

.hero { text-align: center; margin-bottom: 26px; }
.hero h1 { font-size: 30px; margin: 0 0 10px; }
.sub { color: var(--muted); max-width: 560px; margin: 0 auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; }
.card h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.block { margin-bottom: 8px; }
.block-title { display: block; font-weight: 600; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.center { text-align: center; }
.or { text-align: center; color: var(--muted); margin: 14px 0; position: relative; }

input[type=url], input[type=text] {
  width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 15px;
}
.filedrop { display: flex; align-items: center; justify-content: center; min-height: 90px;
  border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; color: var(--muted);
  transition: border-color .15s; padding: 12px; text-align: center; }
.filedrop:hover { border-color: var(--accent2); }
.filedrop input { display: none; }

.btn-primary { display: block; width: 100%; margin-top: 18px; padding: 15px;
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-secondary { color: var(--text); text-decoration: none; border: 1px solid var(--line);
  padding: 8px 14px; border-radius: 9px; font-size: 14px; }

/* status */
.status-card { padding: 48px 24px; }
.spinner { width: 44px; height: 44px; border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* result */
.result-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.result-head h1 { font-size: 24px; margin: 0; }
.tag { font-size: 12px; color: var(--muted); font-weight: 400; }
.note { background: #2a2310; border: 1px solid #5a4a1a; color: #f0d98a;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }

.copyrow { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.copyrow:last-child { border-bottom: none; }
.copytext { flex: 1; }
.js-copy { background: var(--card2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.js-copy:hover { border-color: var(--accent2); }
.js-copy.copied { color: var(--ok); border-color: var(--ok); }
.js-copy.right { margin-left: auto; }

.textbox { background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; white-space: pre-wrap; word-wrap: break-word; font-family: inherit;
  font-size: 14px; margin: 0; max-height: 420px; overflow: auto; }
.textbox.small { max-height: 160px; }
.transcript { max-height: 300px; color: var(--muted); font-size: 13px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.pill { display: inline-block; background: var(--card2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; margin: 4px 6px 4px 0; font-size: 14px; }
.kv { padding: 4px 0; color: var(--muted); }
.kv b { color: var(--text); }
.subtitle { color: var(--muted); font-size: 13px; margin: 14px 0 8px; }
.text-variants { display: flex; flex-wrap: wrap; }

.short { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.short:last-child { border-bottom: none; }
.short.teaser { background: rgba(77,124,255,.06); border-radius: 8px; padding: 12px; }
.short-time { min-width: 110px; color: var(--accent2); font-weight: 600; font-size: 14px; }
.short-title { font-weight: 600; }
.short-hook { color: var(--muted); font-size: 14px; margin: 3px 0; }
.short-tags { font-size: 13px; color: var(--accent2); }

.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.frame { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.frame img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.frame figcaption { display: flex; justify-content: space-between; padding: 8px 10px; font-size: 13px; color: var(--muted); }
.frame .dl { color: var(--accent2); text-decoration: none; }
.error-box { background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; white-space: pre-wrap; color: #ff9b9b; font-size: 13px; text-align: left; }
details summary { cursor: pointer; color: var(--muted); }
