:root {
  color-scheme: dark;
  --bg: var(--tg-theme-bg-color, #0b0d12);
  --card: var(--tg-theme-secondary-bg-color, #151820);
  --text: var(--tg-theme-text-color, #f5f7fb);
  --muted: var(--tg-theme-hint-color, #89909f);
  --accent: var(--tg-theme-button-color, #ff3b69);
  --accent2: #ff784b;
  --line: rgba(255,255,255,.09);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; }
button,input { font: inherit; }
.shell { width: min(100%, 620px); margin: auto; padding: 20px 16px calc(30px + env(safe-area-inset-bottom)); }
header { display:flex; align-items:center; gap:12px; margin: 4px 2px 22px; }
header h1 { font-size:21px; line-height:1; margin:0 0 5px; letter-spacing:-.4px; }
header p { margin:0; color:var(--muted); font-size:12px; }
.logo { width:42px; height:42px; display:grid; place-items:center; border-radius:14px; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 10px 30px rgba(255,59,105,.25); }
.logo span { transform:translateX(1px); }
.badge { margin-left:auto; border:1px solid rgba(255,80,112,.45); color:#ff6685; padding:4px 8px; border-radius:20px; font-size:9px; font-weight:800; letter-spacing:1px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:22px; padding:16px; margin-bottom:14px; box-shadow:0 12px 35px rgba(0,0,0,.12); }
.source-tabs { display:grid;grid-template-columns:1fr 1fr;gap:5px;background:rgba(0,0,0,.22);padding:4px;border-radius:13px;margin-bottom:14px; }
.source-tabs button { border:0;border-radius:10px;padding:10px;background:transparent;color:var(--muted);font-weight:650;font-size:13px; }
.source-tabs button.active { color:white;background:#323744;box-shadow:0 3px 10px rgba(0,0,0,.2); }
.dropzone { width:100%; min-height:154px; border:1.5px dashed rgba(255,255,255,.18); border-radius:17px; background:rgba(255,255,255,.015); color:var(--text); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; cursor:pointer; }
.dropzone:active { transform:scale(.99); }
.upload-icon { width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,var(--accent),var(--accent2));font-size:28px;font-weight:300;margin-bottom:3px; }
.dropzone strong { font-size:16px; }
.dropzone small,.file-info small { color:var(--muted); }
.file-info { display:flex;align-items:center;gap:12px; }
.thumb { width:56px;height:56px;border-radius:14px;background:linear-gradient(145deg,#303544,#1d2029);display:grid;place-items:center;color:#ff6685; }
.grow { flex:1; min-width:0; display:flex;flex-direction:column;gap:4px; }
.grow strong { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.icon-button { background:rgba(255,255,255,.07);color:var(--muted);border:0;width:32px;height:32px;border-radius:50%;font-size:22px; }
.youtube-source { padding:10px 2px 4px; }
.youtube-source label { margin-top:10px; }
.youtube-source small { display:block;color:var(--muted);font-size:11px;margin:9px 3px 1px; }
.youtube-mark { width:48px;height:34px;border-radius:10px;background:#ff244d;color:white;display:grid;place-items:center;margin:2px auto 14px;font-size:14px; }
.section-title { display:flex;justify-content:space-between;align-items:center;font-weight:750;font-size:16px;margin-bottom:22px; }
.section-title span:last-child { color:#ff6685;background:rgba(255,59,105,.1);padding:4px 9px;border-radius:9px;font-size:11px; }
label { display:flex;justify-content:space-between;margin:18px 1px 10px;font-size:13px;font-weight:650; }
output,.muted { color:var(--muted);font-weight:500; }
input[type=range] { width:100%;accent-color:var(--accent); }
.segments { display:grid;grid-template-columns:repeat(3,1fr);gap:5px;background:rgba(0,0,0,.2);padding:4px;border-radius:13px; }
.segments button { border:0;border-radius:10px;padding:10px 5px;background:transparent;color:var(--muted);font-size:12px; }
.segments button.active { background:#323744;color:white;box-shadow:0 3px 10px rgba(0,0,0,.2); }
.text-input { width:100%;border:1px solid var(--line);border-radius:13px;background:rgba(0,0,0,.18);color:var(--text);padding:13px 14px;outline:none; }
.text-input:focus { border-color:var(--accent); }
.check-row { display:flex;justify-content:flex-start;align-items:flex-start;gap:10px;font-weight:450;color:var(--muted);line-height:1.35; }
.check-row input { margin-top:3px;accent-color:var(--accent); }
.primary,.secondary { width:100%;border:0;border-radius:16px;padding:15px 18px;font-weight:750;color:white;cursor:pointer; }
.primary { background:linear-gradient(105deg,var(--accent),var(--accent2));box-shadow:0 10px 25px rgba(255,59,105,.22);display:flex;justify-content:center;gap:12px; }
.primary:disabled { opacity:.35;box-shadow:none; }
.secondary { background:var(--card);border:1px solid var(--line);margin-top:12px; }
.progress-card { text-align:center;padding:30px 20px; }
.spinner { width:48px;height:48px;border:4px solid rgba(255,255,255,.1);border-top-color:var(--accent);border-radius:50%;margin:0 auto 18px;animation:spin .9s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.progress-card h2 { margin:0 0 5px;font-size:18px; }.progress-card p { margin:0 0 20px;color:var(--muted);font-size:12px; }
.progress-track { height:7px;border-radius:10px;background:rgba(255,255,255,.08);overflow:hidden;margin-bottom:8px; }
.progress-track div { height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .25s; }
.progress-card strong { color:#ff6685;font-size:12px; }
.success { display:flex;gap:12px;align-items:center;margin:22px 4px 15px; }.success>span { width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#25c477;color:#07190f;font-weight:900; }
.success h2,.success p { margin:0; }.success h2 { font-size:18px; }.success p { color:var(--muted);font-size:12px;margin-top:3px; }
.parts { display:grid;gap:10px; }
.part { display:flex;align-items:center;gap:12px;background:var(--card);border:1px solid var(--line);border-radius:16px;padding:11px; }
.part-index { width:45px;height:55px;border-radius:10px;background:linear-gradient(145deg,#2f3441,#1b1e26);display:grid;place-items:center;color:#ff6685;font-weight:800; }
.part-info { flex:1; }.part-info strong,.part-info small { display:block; }.part-info small { color:var(--muted);margin-top:3px; }
.download { border:0;background:rgba(255,59,105,.12);color:#ff6685;border-radius:11px;padding:9px 11px;font-weight:700; }
.toast { position:fixed;left:16px;right:16px;bottom:calc(18px + env(safe-area-inset-bottom));max-width:588px;margin:auto;padding:13px 16px;border-radius:13px;background:#e14961;color:white;box-shadow:0 10px 30px rgba(0,0,0,.3);z-index:10; }
.hidden { display:none !important; }
