:root {
  --bg: #0d0f14;
  --panel: #151922;
  --panel-2: #1c2130;
  --border: #262c3d;
  --text: #e8ebf2;
  --muted: #8b93a7;
  --accent: #ff5a36;
  --accent-2: #ff8a3d;
  --ok: #2ecc71;
  --warn: #f5b041;
  --err: #ff5470;
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
pre { background: #0a0c10; border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; max-height: 420px; white-space: pre-wrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: #3a4259; text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn.danger { color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea { width: 100%; background: #0f1219; border: 1px solid var(--border); color: var(--text); border-radius: 8px;
  padding: 9px 11px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=checkbox] { width: auto; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 14px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h3 { margin-bottom: 12px; }
.stat .v { font-size: 1.8rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 500; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #171b26; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--panel-2); border: 1px solid var(--border); }
.badge.ok { color: var(--ok); border-color: #1d5a37; background: #0f2a1c; }
.badge.warn { color: var(--warn); border-color: #5c4718; background: #2a210c; }
.badge.err { color: var(--err); border-color: #5c1e2a; background: #2a0f15; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px #2ecc7133; }

/* App shell */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--border); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { font-weight: 800; font-size: 1.2rem; padding: 4px 10px 16px; display: flex; align-items: center; gap: 8px; color: var(--text); }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; color: #fff; font-size: 15px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--muted); }
.side a.nav:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.side a.nav.active { background: var(--panel-2); color: var(--text); }
.side .section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 14px 10px 4px; }
.main { padding: 28px 32px; max-width: 1200px; width: 100%; min-width: 0; }
.card { min-width: 0; overflow-x: auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }

.np { display: flex; gap: 16px; align-items: center; }
.np .art { width: 72px; height: 72px; border-radius: 10px; background: linear-gradient(135deg, #2a1f4d, #4d1f2f); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.np .title { font-weight: 600; font-size: 1.1rem; }
.play { width: 48px; height: 48px; border-radius: 50%; border: none; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; cursor: pointer; font-size: 18px; flex-shrink: 0; }

.copy { display: flex; gap: 6px; }
.copy input { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }

.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--muted); cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--accent); color: var(--text); background: #1a1410; }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .2s; }

.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--panel-2); border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px; z-index: 60; box-shadow: 0 10px 30px #0008; }
.toast.err { border-color: var(--err); }

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth { width: 100%; max-width: 400px; }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label { display: flex; align-items: center; gap: 4px; background: var(--panel-2); padding: 4px 8px; border-radius: 6px; color: var(--text); margin: 0; cursor: pointer; }
.chart { width: 100%; height: 200px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side .section { display: none; }
  .main { padding: 20px 16px; }
}

/* Landing */
.land-nav { display: flex; align-items: center; padding: 18px 32px; gap: 16px; max-width: 1200px; margin: 0 auto; }
.hero { text-align: center; padding: 80px 20px 60px; max-width: 820px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.02em; }
.hero p { font-size: 1.15rem; color: var(--muted); }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px; }
.feature .icon { font-size: 26px; margin-bottom: 8px; }
.price { font-size: 2.2rem; font-weight: 800; }
.plan ul { padding-left: 18px; color: var(--muted); }
.plan.featured { border-color: var(--accent); }
footer { text-align: center; color: var(--muted); padding: 40px; font-size: .85rem; }
.play:disabled { opacity: .4; cursor: default; }

/* Customizer */
.cz { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 16px; align-items: start; }
.cz-ctl .card { margin-bottom: 12px; }
.cz-prev { position: sticky; top: 16px; }
.cz-logo, .cz-bg { width: 72px; height: 72px; border-radius: 14px; background: var(--panel-2) center / cover; display: grid; place-items: center; font-size: 28px; font-weight: 800; flex-shrink: 0; overflow: hidden; border: 1px solid var(--border); }
.cz-bg { width: 110px; }
.cz-logo img { width: 100%; height: 100%; object-fit: cover; }
.cz-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cz-preset { background: var(--panel-2); border: 2px solid var(--border); border-radius: 10px; padding: 6px; color: var(--text); font: inherit; font-size: 12px; cursor: pointer; text-transform: capitalize; }
.cz-preset span { display: block; height: 34px; border-radius: 6px; margin-bottom: 4px; position: relative; }
.cz-preset span i { position: absolute; right: 6px; bottom: 6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #0006; }
.cz-preset .cz-custom { background: repeating-linear-gradient(45deg, #2a3042, #2a3042 6px, #1c2130 6px, #1c2130 12px); display: grid; place-items: center; font-size: 16px; }
.cz-preset.on { border-color: var(--accent); }
.cz-colors { display: grid; gap: 6px; }
.cz-color { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); font-size: .9rem; }
.cz-color input { width: 40px; height: 30px; padding: 2px; border-radius: 6px; cursor: pointer; flex-shrink: 0; }
.cz-color span { flex: 1; }
.cz-color code { color: var(--muted); font-size: .8rem; }
.cz-secs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.cz-secs label { color: var(--text); font-size: .85rem; margin: 0; display: flex; gap: 6px; align-items: center; }
.cz-save { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 10px; z-index: 2; }
.cz-frame-wrap { background: #0a0c10; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; display: flex; justify-content: center; }
.cz-frame-wrap iframe { border: 0; width: 100%; height: 72vh; background: #0b0910; transition: width .2s; }
.cz-frame-wrap[data-dev=mobile] iframe { width: 390px; }
.cz-frame-wrap[data-view=embed] iframe { height: 110px; margin: 40px 16px; max-width: 560px; background: transparent; color-scheme: normal; } /* no opaque backdrop */
@media (max-width: 1100px) { .cz { grid-template-columns: 1fr; } .cz-prev { position: static; } }

/* ---- Toggle switches & radio options (playlist editor) ---- */
.tg { display: flex; gap: 10px; align-items: flex-start; color: var(--text); margin: 6px 0; cursor: pointer; font-size: .92rem; }
.tg input { display: none; }
.tg .sw { width: 36px; height: 20px; border-radius: 999px; background: #2a3042; position: relative; flex-shrink: 0; transition: background .15s; margin-top: 1px; }
.tg .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #8b93a7; transition: all .15s; }
.tg input:checked + .sw { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.tg input:checked + .sw::after { left: 19px; background: #fff; }
.tg > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.tg.mini { margin: 0; }
.rd { display: flex; gap: 10px; align-items: flex-start; color: var(--text); margin: 6px 0; cursor: pointer; font-size: .92rem; }
.rd input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.rd > span { display: flex; flex-direction: column; gap: 1px; }
.modal.wide { max-width: 820px; padding: 0; }
.ple-head { display: flex; align-items: center; padding: 16px 22px; background: linear-gradient(90deg, #0d2a5e, #123b7a); border-bottom: 2px solid var(--accent); border-radius: var(--radius) var(--radius) 0 0; }
.ple-head h2 { margin: 0; flex: 1; }
.mtabs { display: flex; gap: 6px; padding: 10px 22px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.mtabs button { border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 999px; padding: 6px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.mtabs button.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
#plf { padding: 18px 22px 0; }
.ple-box { border: 1px solid var(--border); border-radius: 14px; margin: 16px 0; padding: 0 18px 16px; overflow: hidden; }
.ple-box > h3 { margin: 0 -18px 14px; padding: 12px 18px; background: linear-gradient(90deg, #0d2a5e, #123b7a); border-bottom: 2px solid var(--accent); }
.ple-sub h3 { border-bottom: 1px dashed var(--border); padding-bottom: 6px; margin-top: 14px; }
.ple-foot { display: flex; gap: 8px; padding: 14px 0 18px; border-top: 1px solid var(--border); margin-top: 10px; position: sticky; bottom: 0; background: var(--panel); }
.slot { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: var(--panel-2); }
.checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; max-height: 50vh; overflow: auto; }
.checklist label { color: var(--text); display: flex; gap: 8px; align-items: center; margin: 0; }

/* ---- Music file manager ---- */
.fm { padding: 0; overflow: hidden; }
.fm > * { margin-left: 18px; margin-right: 18px; }
.fm-head { display: flex; align-items: center; gap: 16px; margin: 0; padding: 16px 18px; background: linear-gradient(90deg, #0d2a5e, #123b7a); border-bottom: 2px solid var(--accent); flex-wrap: wrap; }
.fm-usage { text-align: right; min-width: 260px; }
.fm-bar { height: 16px; border-radius: 999px; background: #ffffff1c; overflow: hidden; margin-bottom: 4px; }
.fm-bar > div { height: 100%; min-width: 34px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: #fff; }
.fm-crumbs { margin-top: 14px; margin-bottom: 10px; color: var(--muted); }
.fm-crumbs a { color: var(--accent-2); }
.fm-crumbs span { color: var(--text); }
.fm-tools { margin-top: 14px; }
.fm-search { margin-top: 10px; margin-bottom: 10px; }
.fm-search input { flex: 1; min-width: 200px; }
.fm-table { margin-bottom: 18px; }
.fm-table td { vertical-align: middle; }
.fm-dir td { background: #12161f; }
.fm-name { color: var(--accent-2); font-weight: 600; }
a.fm-name:hover { text-decoration: underline; }
.fm-file { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-play { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: #0d0f14; cursor: pointer; flex-shrink: 0; font-size: 11px; }
.fm-cover { width: 40px; height: 40px; border-radius: 6px; background: linear-gradient(135deg, #3b2c6b, #ff5a36); flex-shrink: 0; overflow: hidden; display: block; }
.fm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pl-link { color: var(--accent-2); }
.btn.danger { color: var(--err); }
