:root {
  --bg: #0E0F13; --panel: #171920; --panel-2: #1F222B; --line: #2A2E39;
  --text: #ECEEF3; --muted: #9AA0AE; --accent: #FFD23F; --accent-2: #7C5CFF; --ok: #3DDC97; --warn: #FFB547; --bad: #FF5C7A;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #F4F5F8; --panel: #FFFFFF; --panel-2: #EEF0F4; --line: #DADDE4; --text: #15171C; --muted: #5D6474; --accent: #B88700; --accent-2: #5B3DF5; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand b { font-size: 18px; } .brand span { color: var(--muted); }
.status { color: var(--muted); font-size: 13px; }
.status.ok { color: var(--ok); } .status.bad { color: var(--bad); }
.account-bar { margin-inline-start: auto; display: flex; gap: 10px; align-items: center; }
.minutes { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.minutes.low { color: var(--warn); border-color: var(--warn); }
.account-btn { background: var(--panel); }
input, select { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; }
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
label input, label select { color: var(--text); font-size: 14px; }
.layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 28px; padding: 24px; align-items: start; }
.preview-col { position: sticky; top: 16px; }
.phone { position: relative; aspect-ratio: 9 / 16; width: 100%; background: #000; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); }
.phone video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.overlay { position: absolute; left: 0; top: 0; pointer-events: none; transform-origin: 0 0; }
.drop { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 22px; margin: 10px; }
.drop.over { border-color: var(--accent); color: var(--text); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.media-info { color: var(--muted); font-size: 12px; margin-top: 8px; }
.steps { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.step h2 { margin: 0; font-size: 16px; display: flex; gap: 10px; align-items: center; }
.step h2 span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #111; font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
button { font: inherit; cursor: pointer; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 9px 14px; }
button.primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 600; align-self: flex-start; }
button:disabled { opacity: .5; cursor: not-allowed; }
.progress { height: 26px; background: var(--panel-2); border-radius: 8px; position: relative; overflow: hidden; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent-2); transition: width .3s; }
.progress span { position: relative; padding: 0 10px; line-height: 26px; font-size: 12px; }
.warnings { margin: 0; padding-inline-start: 18px; color: var(--warn); font-size: 13px; }
.warnings:empty { display: none; }
.cues { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; padding-right: 4px; }
.cue { display: grid; grid-template-columns: 78px 1fr; gap: 8px; align-items: center; }
.cue time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; }
.cue input { width: 100%; }
.cue.on input { border-color: var(--accent); }
.styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 420px; overflow: auto; padding-right: 4px; }
.style-card { text-align: start; padding: 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.style-card b { font-size: 13px; } .style-card small { color: var(--muted); font-size: 11px; }
.style-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.formats label { flex-direction: row; gap: 10px; align-items: flex-start; background: var(--panel-2); padding: 10px; border-radius: 10px; color: var(--text); font-size: 13px; }
.formats label small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.formats label b { display: block; }
.downloads { display: flex; flex-direction: column; gap: 8px; }
.downloads a { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; display: flex; justify-content: space-between; gap: 10px; }
.downloads a span { color: var(--muted); font-size: 12px; }
.howto { background: var(--panel-2); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.howto ol { margin: 6px 0 0; padding-inline-start: 20px; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .preview-col { position: static; max-width: 360px; margin: 0 auto; width: 100%; }
  .top { padding: 12px 16px; }
}
.filebtn { position: relative; overflow: hidden; display: inline-block; align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 14px; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.batch { display: flex; flex-direction: column; gap: 8px; }
.batch-item { background: var(--panel-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.batch-item header { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.batch-item header span { color: var(--muted); }
.batch-item .links { display: flex; flex-wrap: wrap; gap: 6px; }
.batch-item .links a { font-size: 12px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; text-decoration: none; cursor: pointer; }

/* Account dialog */
.account-dlg { width: min(920px, 94vw); max-height: 92vh; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; }
.account-dlg::backdrop { background: rgba(0,0,0,.6); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.dlg-head h2 { margin: 0; font-size: 17px; }
.dlg-body { padding: 16px 18px 22px; display: flex; flex-direction: column; gap: 18px; }
.auth { max-width: 380px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.tabs2 { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tabs2 button { border: 0; border-radius: 0; background: var(--panel-2); }
.tabs2 button.on { background: var(--accent); color: #111; font-weight: 600; }
.form-error { color: var(--bad); font-size: 13px; min-height: 1em; }
.usage-box { background: var(--panel-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.usage-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meter { height: 10px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent-2); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.plan { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.plan.current { border-color: var(--accent); }
.plan h4 { margin: 0; font-size: 15px; }
.plan .price { font-size: 22px; font-weight: 700; }
.plan .price small { font-size: 12px; color: var(--muted); font-weight: 400; }
.plan ul { margin: 0; padding-inline-start: 18px; color: var(--muted); font-size: 12px; }
.plan button { margin-top: auto; }
.pay-box { background: var(--panel-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pay-box ol { margin: 0; padding-inline-start: 20px; }
.pay-box .ref { font: 700 18px ui-monospace, Menlo, monospace; letter-spacing: .05em; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; align-self: flex-start; }
.promo-row { display: flex; gap: 8px; }
.promo-row input { flex: 1; min-width: 0; }
#promoCode { text-transform: uppercase; }
.price-line { font-size: 18px; }
.price-line s { color: var(--muted); }
.price-line .off { background: #1f8f4e; color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
#promoMsg { color: #3ccf7c; }
#promoMsg.bad { color: #ff6b6b; }
.wa-btn { display: block; text-align: center; background: #25d366; color: #062; font-weight: 700; padding: 10px; border-radius: 10px; text-decoration: none; }
.methods { display: flex; gap: 8px; flex-wrap: wrap; }
.methods button.on { border-color: var(--accent); background: rgba(255,210,63,.12); }
.keys { display: flex; flex-direction: column; gap: 6px; }
.key-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.key-row code, .new-key code { font-family: ui-monospace, Menlo, monospace; }
.new-key { background: rgba(61,220,151,.12); border: 1px solid var(--ok); border-radius: 10px; padding: 10px 12px; font-size: 13px; word-break: break-all; }
.history { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.section-title { margin: 0; font-size: 14px; }
.upgrade-link { color: var(--accent); cursor: pointer; text-decoration: underline; }
