@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); }

:root {
  --bg: #05070c;
  --bg2: #0a0f1a;
  --panel: rgba(17, 24, 39, 0.72);
  --panel-solid: #0f1626;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --text: #f2f5fb;
  --muted: #8f9bb4;
  --accent: #3d7bff;
  --accent2: #7a5cff;
  --grad: linear-gradient(120deg, var(--accent), var(--accent2));
  --danger: #f05252;
  --ok: #22c55e;
  --radius: 1rem;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 400 15px/1.5 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(60rem 30rem at 90% -10%, rgba(61, 123, 255, 0.22), transparent 70%),
    radial-gradient(40rem 28rem at -10% 110%, rgba(122, 92, 255, 0.16), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
svg { width: 1.2rem; height: 1.2rem; flex: none; }
.card-head svg { width: 1.35rem; height: 1.35rem; color: #8fb3ff; }
button { cursor: pointer; }
a { color: #8fb3ff; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.boot img { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.94); } }

/* ---- layout */
.wrap { width: min(60rem, 100%); margin: 0 auto; padding: 1rem 1rem 4rem; }
.top { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0 1.2rem; }
.brand { display: flex; align-items: center; gap: 0.55rem; font-size: 1.25rem; font-weight: 300; text-decoration: none; color: var(--text); }
.brand b { font-weight: 800; }
.brand img { width: 2.1rem; height: 2.1rem; }
.spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 1.2rem; padding: 1.25rem; box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.card-head h2 { font-size: 1.15rem; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* ---- buttons / inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 2.6rem; padding: 0.5rem 1rem; border-radius: 0.75rem; border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.05); font-weight: 600; white-space: nowrap; transition: background 0.15s, transform 0.1s; }
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0.6rem 1.6rem rgba(61, 123, 255, 0.35); }
.btn.danger { color: #ffb4b4; border-color: rgba(240, 82, 82, 0.4); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.icon { padding: 0.4rem; min-width: 2.4rem; min-height: 2.4rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 1.15rem; height: 1.15rem; }
label.field { display: block; margin: 0.85rem 0; }
.field span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.input { width: 100%; min-height: 2.9rem; padding: 0.6rem 0.85rem; border-radius: 0.75rem; border: 1px solid var(--line2); background: rgba(0, 0, 0, 0.3); outline: none; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61, 123, 255, 0.25); }
.input.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.08em; font-size: 1.05rem; }
.pw { position: relative; }
.pw .btn { position: absolute; right: 0.3rem; top: 0.25rem; }
.error { background: rgba(240, 82, 82, 0.14); border: 1px solid rgba(240, 82, 82, 0.5); color: #ffd0d0; padding: 0.6rem 0.8rem; border-radius: 0.7rem; margin: 0.6rem 0; }
.notice { background: rgba(61, 123, 255, 0.12); border: 1px solid rgba(61, 123, 255, 0.4); padding: 0.6rem 0.8rem; border-radius: 0.7rem; margin: 0.6rem 0; }
details.adv { margin-top: 0.6rem; }
details.adv summary { cursor: pointer; color: var(--muted); font-weight: 600; }

/* ---- login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.login .card { width: min(26rem, 100%); }
.login h1 { font-size: 1.6rem; margin: 0.2rem 0 0.3rem; }
.login .brand { justify-content: center; margin-bottom: 1.2rem; font-size: 1.5rem; }
.login .brand img { width: 2.6rem; height: 2.6rem; }
.steps { margin: 1rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; color: var(--muted); font-size: 0.88rem; }
.steps li { display: flex; gap: 0.6rem; align-items: flex-start; }
.steps > li > b:first-child { display: inline-flex; flex: none; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: rgba(61, 123, 255, 0.2); color: #b9ccff; align-items: center; justify-content: center; font-size: 0.75rem; }
.lang { display: flex; gap: 0.3rem; }
.lang button { background: none; border: 1px solid transparent; border-radius: 0.5rem; padding: 0.2rem 0.5rem; color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.lang button.on { border-color: var(--line2); color: var(--text); }

/* ---- device */
.dev { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.8rem 1.2rem; }
.kv span { display: block; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.kv b { font-weight: 600; word-break: break-word; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.04em; }
.badge { display: inline-flex; align-items: center; padding: 0.1rem 0.55rem; border-radius: 99rem; font-size: 0.75rem; font-weight: 700; background: rgba(34, 197, 94, 0.16); color: #86efac; }
.dev-name { display: flex; gap: 0.5rem; align-items: center; }
.dev-name .input { max-width: 18rem; min-height: 2.4rem; }

/* ---- playlists */
.pl-list { display: flex; flex-direction: column; gap: 0.55rem; }
.pl { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0.85rem; border-radius: 0.9rem; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.pl-ic { width: 2.6rem; height: 2.6rem; border-radius: 0.75rem; display: flex; align-items: center; justify-content: center; flex: none; background: rgba(61, 123, 255, 0.16); color: #9bb8ff; }
.pl-ic.xtream { background: rgba(122, 92, 255, 0.18); color: #c4b5fd; }
.pl-ic.stalker { background: rgba(13, 148, 136, 0.2); color: #5eead4; }
.pl-ic svg { width: 1.3rem; height: 1.3rem; }
.pl-text { flex: 1; min-width: 0; }
.pl-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-detail { color: var(--muted); font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-actions { display: flex; gap: 0.25rem; flex: none; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty svg { width: 3rem; height: 3rem; opacity: 0.5; }
.hint-line { margin-top: 0.9rem; color: var(--muted); font-size: 0.85rem; display: flex; gap: 0.45rem; align-items: center; }
.hint-line svg { width: 1rem; height: 1rem; flex: none; }

/* ---- modal */
.modal-bg { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(3, 5, 10, 0.72); display: flex; align-items: flex-end; justify-content: center; z-index: 10; animation: fade 0.15s; }
.modal { width: min(34rem, 100%); max-height: 92vh; overflow-y: auto; background: var(--panel-solid); border: 1px solid var(--line2); border-radius: 1.2rem 1.2rem 0 0; padding: 1.25rem; animation: up 0.2s ease-out; }
.modal h2 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.modal-actions { display: flex; gap: 0.6rem; justify-content: flex-end; margin-top: 1.1rem; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; margin: 0.4rem 0 0.2rem; }
.seg button { border: 1px solid var(--line2); background: rgba(255, 255, 255, 0.03); border-radius: 0.75rem; padding: 0.6rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; justify-content: center; }
.seg button.on { border-color: var(--accent); background: rgba(61, 123, 255, 0.16); }
.seg svg { width: 1.1rem; height: 1.1rem; }
.file-pick { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem; border: 1px dashed var(--line2); border-radius: 0.8rem; }
.file-pick input { display: none; }
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--panel-solid); border: 1px solid var(--line2); padding: 0.65rem 1rem; border-radius: 0.8rem; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.5); z-index: 20; animation: toast-up 0.2s ease-out; }
@keyframes toast-up { from { opacity: 0; transform: translate(-50%, 1rem); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(1rem); } }

@media (min-width: 640px) {
  .wrap { padding: 1.5rem 1.5rem 4rem; }
  .modal-bg { align-items: center; }
  .modal { border-radius: 1.2rem; }
  .seg { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 480px) {
  .pl { flex-wrap: wrap; }
  .pl-actions { width: 100%; justify-content: flex-end; }
  .top .who { display: none; }
}

/* ---- site header / footer (every page) */
.site-top { display: flex; align-items: center; gap: 1rem; width: min(66rem, 100%); margin: 0 auto; padding: 1rem; flex-wrap: wrap; }
.site-nav { display: flex; gap: 0.2rem; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 0.45rem 0.75rem; border-radius: 0.6rem; }
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.site-nav a.on { color: var(--text); background: rgba(61, 123, 255, 0.16); }
.top .site-nav { margin-left: 0.5rem; }
.site-foot { width: min(66rem, 100%); margin: 2rem auto 0; padding: 1.5rem 1rem 3rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.9rem; }
.site-foot a { color: #9bb8ff; text-decoration: none; }
.login { min-height: auto; padding-top: 2rem; }

/* ---- public pages */
.doc { width: min(66rem, 100%); }
.hero { text-align: center; padding: 2.5rem 0 2rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; background: linear-gradient(120deg, #fff 30%, #9bb8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.1rem; max-width: 44rem; margin: 0.8rem auto 0; }
.hero-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }
.btn.big { min-height: 3.1rem; padding: 0.6rem 1.4rem; font-size: 1.05rem; text-decoration: none; }
a.btn { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.8rem; margin: 1rem 0; }
.feat { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem; border-radius: 1rem; background: var(--panel); border: 1px solid var(--line); }
.feat svg { color: #9bb8ff; width: 1.6rem; height: 1.6rem; }
.page-title { font-size: 2rem; margin: 1rem 0 0.3rem; }
.doc .lead { margin-left: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0; }
.chip { display: inline-flex; align-items: center; padding: 0.35rem 0.8rem; border-radius: 99rem; border: 1px solid var(--line2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.88rem; background: rgba(255, 255, 255, 0.03); }
.chip.on, .chip:hover { border-color: var(--accent); background: rgba(61, 123, 255, 0.16); }
.steps.big { font-size: 0.98rem; color: var(--text); gap: 0.8rem; }
.steps.big > li > b:first-child { width: 1.7rem; height: 1.7rem; font-size: 0.85rem; }
.steps code, .para code { background: rgba(255, 255, 255, 0.08); padding: 0.1rem 0.4rem; border-radius: 0.35rem; font-size: 0.9em; }
.guide { scroll-margin-top: 1rem; }
.card h2 { margin-bottom: 0.5rem; }
.para { margin: 0.5rem 0; line-height: 1.6; }
.para table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.para th, .para td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); }
.dls { display: flex; flex-direction: column; gap: 0.6rem; }
.dl { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem; border-radius: 0.9rem; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); flex-wrap: wrap; }
.dl-ic { width: 2.8rem; height: 2.8rem; border-radius: 0.8rem; display: flex; align-items: center; justify-content: center; background: rgba(61, 123, 255, 0.16); color: #9bb8ff; flex: none; }
.dl-text { flex: 1; min-width: 12rem; display: flex; flex-direction: column; }
.dl-actions { display: flex; gap: 0.4rem; }
.lic.active { color: #86efac; }
.lic.expired, .lic.disabled { color: #fca5a5; }

/* ---- admin */
.adm-top { display: flex; align-items: center; gap: 0.7rem; margin: 0.5rem 0 1rem; }
.adm-top h1 { display: flex; align-items: center; gap: 0.5rem; font-size: 1.5rem; }
.adm-tabs { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.adm-tab { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.9rem; border-radius: 0.7rem; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-weight: 600; }
.adm-tab.on { border-color: var(--accent); background: rgba(61, 123, 255, 0.18); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.7rem; margin-bottom: 1rem; }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; padding: 1rem; border-radius: 1rem; border: 1px solid var(--line); background: var(--panel); text-align: left; }
.stat b { font-size: 1.8rem; font-weight: 800; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.two .card + .card { margin-top: 0; }
.bars { display: flex; flex-direction: column; gap: 0.5rem; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr 3rem; gap: 0.6rem; align-items: center; font-size: 0.9rem; }
.bar { height: 0.55rem; border-radius: 99rem; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 99rem; }
.bar-row b { text-align: right; }
.toolbar { display: flex; gap: 0.7rem; flex-wrap: wrap; align-items: center; }
.toolbar .input { max-width: 22rem; }
.toolbar .chips { margin: 0; }
button.chip { cursor: pointer; }
.table-wrap { overflow-x: auto; margin-top: 0.8rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover, .tbl tbody tr:focus { background: rgba(61, 123, 255, 0.08); outline: none; }
.state { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 99rem; font-size: 0.75rem; font-weight: 700; }
.state.active { background: rgba(34, 197, 94, 0.16); color: #86efac; }
.state.expired { background: rgba(251, 191, 36, 0.16); color: #fcd34d; }
.state.disabled { background: rgba(240, 82, 82, 0.16); color: #fca5a5; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1rem 0; }
.modal.wide { width: min(46rem, 100%); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); column-gap: 1rem; }
.grid2 .field { margin: 0.5rem 0; }
.check { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.4rem; color: var(--muted); font-size: 0.85rem; }
textarea.input { min-height: auto; resize: vertical; }
select.input { appearance: auto; }
.mini-list { margin: 0.3rem 0 0.8rem; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.25rem; }
.modal h3 { font-size: 0.95rem; margin-top: 0.6rem; }
.modal-actions .spacer { flex: 1; }
@media (max-width: 640px) {
  .site-top { gap: 0.5rem; }
  .site-nav a { padding: 0.35rem 0.5rem; font-size: 0.9rem; }
  .tbl th:nth-child(3), .tbl td:nth-child(3), .tbl th:nth-child(6), .tbl td:nth-child(6) { display: none; }
}
