:root {
  --bg: #070D24; --text: #F3F6FF; --muted: #A9B6D9; --muted2: #8392BE;
  --gold1: #FFD66B; --gold2: #F59E0B; --gold3: #EA580C; --ink: #2A1500;
  --glass: rgba(255,255,255,0.05); --line: rgba(255,255,255,0.09);
  --red: #FDA4AF; --green: #6EE7B7; --blue: #A8C2FF;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Kantumruy Pro', 'Inter', system-ui, sans-serif; font-size: 14px; line-height: 1.45;
  background: radial-gradient(420px 320px at 110% -60px, rgba(139,92,246,.38), transparent 70%),
              radial-gradient(420px 360px at -100px 700px, rgba(14,165,233,.22), transparent 70%),
              radial-gradient(420px 360px at 120% 1200px, rgba(234,88,12,.18), transparent 70%), var(--bg);
  min-height: 100vh;
}
button { font: inherit; color: inherit; }
.app { max-width: 480px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }

.top { display: flex; align-items: center; gap: 10px; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--gold1), var(--gold3)); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(245,158,11,.4); flex-shrink: 0; }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.credit { position: relative; overflow: hidden; border-radius: 20px; padding: 14px 16px; background: linear-gradient(135deg, var(--gold1) 0%, var(--gold2) 50%, var(--gold3) 100%); color: var(--ink); box-shadow: 0 12px 28px rgba(245,158,11,.35); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.credit-glow { position: absolute; width: 150px; height: 150px; border-radius: 999px; background: rgba(255,255,255,.18); right: -40px; top: -70px; }
.credit-info { position: relative; display: flex; flex-direction: column; min-width: 0; }
.credit-label { font-size: 12px; font-weight: 600; }
.credit-num { font-family: 'Inter', sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.credit-meta { font-size: 12px; font-weight: 500; }
.buy { position: relative; border: 0; cursor: pointer; min-height: 44px; background: var(--ink); color: var(--gold1); border-radius: 14px; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; flex-shrink: 0; }

.card { background: var(--glass); border: 1px solid var(--line); border-radius: 20px; padding: 12px; }
.yt { display: flex; flex-direction: column; gap: 8px; }
.yt-head { display: flex; align-items: center; gap: 8px; }
.yt-title { font-size: 14px; font-weight: 700; }
.yt-limit { margin-left: auto; font-size: 11px; color: var(--muted); }
.yt-row { display: flex; gap: 8px; margin: 0; }
.yt-input { flex: 1; min-width: 0; min-height: 44px; border-radius: 12px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; padding: 0 12px; gap: 8px; color: #6F7EAA; }
.yt-input input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.yt-input input::placeholder { color: #6F7EAA; }
.yt-btn { border: 0; cursor: pointer; min-height: 44px; padding: 0 14px; border-radius: 12px; background: linear-gradient(135deg, #FF3B5C, #E11D48); color: #fff; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; box-shadow: 0 6px 16px rgba(225,29,72,.4); flex-shrink: 0; }
.yt-btn:disabled { opacity: .6; }

.upload { cursor: pointer; width: 100%; border: 1.5px dashed rgba(127,166,255,.6); border-radius: 20px; background: linear-gradient(160deg, rgba(59,130,246,.18), rgba(139,92,246,.14)); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.upload-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px; background: linear-gradient(135deg, #3B82F6, #8B5CF6); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(99,102,241,.45); }
.upload-text { display: flex; flex-direction: column; gap: 2px; }
.upload-title { font-size: 15px; font-weight: 700; }
.upload-sub { font-size: 12px; color: #B9C5EA; }

.list-sec { display: flex; flex-direction: column; gap: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sec-title { font-size: 16px; font-weight: 700; }
.done-title { display: flex; align-items: center; gap: 8px; }
.ok-dot { width: 22px; height: 22px; border-radius: 999px; background: linear-gradient(135deg, #34D399, #059669); display: flex; align-items: center; justify-content: center; }
.pill { font-size: 12px; color: #7FA6FF; background: rgba(59,130,246,.15); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.muted-small { font-size: 12px; color: var(--muted); }
.hint { font-size: 11px; color: var(--muted2); text-align: center; }
.sub-title { font-size: 14px; font-weight: 600; margin-top: 4px; }
.warn { font-size: 12px; color: #FCD34D; text-align: center; }

.vbox { border-radius: 18px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(245,192,74,.6) transparent; }
.vbox.scroll { max-height: 232px; }
.vbox.done.scroll { max-height: 216px; }
.vbox::-webkit-scrollbar { width: 4px; }
.vbox::-webkit-scrollbar-thumb { background: rgba(245,192,74,.6); border-radius: 4px; }
.empty { font-size: 12px; color: var(--muted2); text-align: center; padding: 14px 8px; }

.row { border-radius: 14px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--glass); border: 1px solid var(--line); flex-shrink: 0; }
.row.hot { background: linear-gradient(170deg, rgba(245,192,74,.16), rgba(234,88,12,.08)); border-color: rgba(245,192,74,.5); }
.row.ok { background: rgba(52,211,153,.07); border-color: rgba(52,211,153,.3); }
.row.bad { background: rgba(244,63,94,.08); border-color: rgba(251,113,133,.35); }
.row-main { display: flex; gap: 10px; align-items: center; }
.thumb { position: relative; width: 76px; height: 44px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 0; padding: 0; cursor: pointer; background-size: cover; background-position: center; }
.thumb .play { width: 20px; height: 20px; border-radius: 999px; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; }
.tag { position: absolute; left: 3px; top: 3px; font-size: 8px; font-weight: 700; line-height: 13px; border-radius: 3px; padding: 0 3px; color: #fff; }
.tag.youtube { background: #FF0033; } .tag.upload { background: #3B82F6; } .tag.bot { background: #0EA5E9; } .tag.kh { background: #059669; }
.dur { position: absolute; right: 3px; bottom: 3px; font-family: 'Inter', sans-serif; font-size: 9px; font-weight: 600; line-height: 13px; background: rgba(0,0,0,.6); border-radius: 3px; padding: 0 3px; color: #fff; }
.info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st.gold { color: var(--gold1); } .st.blue { color: var(--blue); } .st.green { color: var(--green); } .st.red { color: var(--red); } .st.plain { color: #C9D3F0; }
.cost { font-size: 11px; color: #F5C04A; }
.ibtn { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center; border: 1px solid; cursor: pointer; padding: 0; }
.ibtn.del { background: rgba(244,63,94,.12); border-color: rgba(251,113,133,.35); }
.ibtn.dl { background: linear-gradient(135deg, var(--gold1), var(--gold2) 60%, var(--gold3)); border-color: rgba(245,192,74,.6); }
.ibtn.retry { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); }
.ibtn.lock { background: rgba(255,255,255,.05); border-color: transparent; cursor: default; }
.prog { display: flex; align-items: center; gap: 8px; }
.bar { position: relative; flex: 1; height: 6px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar > i { position: absolute; left: 0; top: 0; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--gold1), var(--gold3)); transition: width .6s ease; }
.bar.shimmer > i { width: 40%; background: linear-gradient(90deg, transparent, var(--gold1), var(--gold3), transparent); animation: shim 1.4s linear infinite; }
.bar.blue > i { background: linear-gradient(90deg, #3B82F6, #8B5CF6); }
@keyframes shim { 0% { left: -40%; } 100% { left: 100%; } }
.timer { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--gold1); }
.pct { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 700; min-width: 28px; text-align: right; }

.voices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.voice { position: relative; cursor: pointer; border-radius: 16px; background: var(--glass); border: 2px solid var(--line); padding: 9px 10px; display: flex; align-items: center; gap: 10px; text-align: left; }
.voice.sel { border-color: #F5C04A; background: linear-gradient(160deg, rgba(236,72,153,.22), rgba(139,92,246,.18)); }
.voice[data-voice="male"].sel { background: linear-gradient(160deg, rgba(6,182,212,.2), rgba(59,130,246,.18)); }
.avatar { width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.avatar.f { background: linear-gradient(135deg, #EC4899, #8B5CF6); } .avatar.m { background: linear-gradient(135deg, #06B6D4, #3B82F6); }
.voice-text { display: flex; flex-direction: column; min-width: 0; }
.voice-name { font-size: 15px; font-weight: 700; }
.voice-sub { font-size: 11px; color: var(--muted); }
.listen { color: var(--gold1); font-weight: 600; font-size: 11px; padding: 2px 0; white-space: nowrap; }
.voice-sub { white-space: nowrap; }
.check { display: none; position: absolute; top: -8px; right: -6px; width: 22px; height: 22px; border-radius: 999px; background: #F5C04A; align-items: center; justify-content: center; }
.voice.sel .check { display: flex; }

.cta { border: 0; cursor: pointer; margin-top: 2px; min-height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--gold1), var(--gold2) 55%, var(--gold3)); color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; font-weight: 700; box-shadow: 0 10px 28px rgba(245,158,11,.45); }
.cta:disabled { opacity: .45; box-shadow: none; cursor: default; }
.cta-pill { font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 700; background: rgba(42,21,0,.16); border-radius: 999px; padding: 3px 10px; }

.foot { margin-top: 6px; text-align: center; font-size: 11px; color: #6F7EAA; }

.modal { position: fixed; inset: 0; background: rgba(3,6,20,.86); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-inner { position: relative; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 8px; }
.modal video { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
.modal-close { position: absolute; top: -44px; right: 0; width: 40px; height: 40px; border-radius: 999px; border: 0; background: rgba(255,255,255,.12); font-size: 18px; cursor: pointer; }
.modal-name { font-size: 13px; color: var(--muted); text-align: center; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); max-width: 448px; margin: 0 auto; background: #1B254D; border: 1px solid rgba(255,255,255,.14); color: var(--text); border-radius: 14px; padding: 12px 14px; font-size: 13px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.toast.err { border-color: rgba(251,113,133,.5); }
.toast[hidden] { display: none; }
@media (max-width: 360px) { .credit-num { font-size: 26px; } .buy { padding: 0 10px; } }
