:root {
  --bg: #0a0a0b; --surface: #121214; --surface2: #19191c; --line: #26262a; --line2: #34343a;
  --text: #f1f1ee; --dim: #9a9a94; --muted: #6b6b66;
  --accent: #ffe500; --live: #ff2b2b; --ok: #3ddc84; --warn: #ffb020;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif; --mono: "Space Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 30px; font-weight: 900; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
h2 { font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--dim); font-weight: 700; margin: 0 0 14px; }
.eyebrow { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin: 0; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.small { font-size: 13px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid var(--line2); background: var(--surface2); cursor: pointer; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #ff7a7a; }
.btn.danger:hover { border-color: #ff7a7a; }
.btn.small { height: 30px; padding: 0 10px; font-size: 11px; }
.btn:disabled { opacity: .45; cursor: default; }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; color: var(--dim); font: 400 12px var(--mono); text-decoration: underline; text-underline-offset: 3px; }
.linklike:hover { color: var(--text); }
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
  width: 100%; height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--line2); color: var(--text); outline: none;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 110px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: grid; gap: 6px; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); }
label > input, label > select, label > textarea { font: 15px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); }
.hint { font: 400 12px var(--font); color: var(--muted); text-transform: none; letter-spacing: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.error { color: #ff7a7a; min-height: 1.2em; margin: 0; font-size: 14px; }

/* switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line2); border-radius: 11px; cursor: pointer; transition: background .15s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at top, #1a1a1d, var(--bg) 60%); }
.login-box { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-logo { width: 190px; margin-bottom: 4px; }

/* shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); }
.side-logo { padding: 22px 20px 18px; display: block; }
.side-logo img { width: 150px; display: block; }
.side-nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 2px; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; color: var(--dim); font-weight: 600; font-size: 15px; border-left: 2px solid transparent; }
.side-nav a:hover { color: var(--text); background: var(--surface2); }
.side-nav a.on { color: var(--text); background: var(--surface2); border-left-color: var(--accent); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 8px var(--live); }
.side-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font: 400 12px var(--mono); color: var(--dim); }
.main { padding: 32px clamp(18px, 3vw, 44px) 80px; min-width: 0; max-width: 1280px; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.head .spacer { min-width: 10px; }

.card { background: var(--surface); border: 1px solid var(--line); padding: 20px; }
.cards { display: grid; gap: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* live */
.onair { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 22px; align-items: center; }
.onair-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #000; display: block; }
.onair-artist { font-size: 28px; font-weight: 900; line-height: 1.1; letter-spacing: -.01em; }
.onair-title { font-size: 20px; color: #d6d6d2; margin-top: 2px; }
.bar { height: 4px; background: var(--line2); margin: 16px 0 6px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); padding: 16px 18px; }
.kpi b { display: block; font-size: 32px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
.kpi span { font: 400 11px var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .1em; }
.banner { padding: 12px 16px; border: 1px solid var(--warn); color: var(--warn); background: rgba(255,176,32,.06); font-size: 14px; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.t { font: 700 13px var(--mono); color: var(--dim); }
.a { font-weight: 700; }
.b { color: #cfcfcb; font-size: 14px; }
.tag { display: inline-block; padding: 2px 6px; margin-left: 6px; font: 700 9.5px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line2); color: var(--dim); vertical-align: 2px; }
.tag.film { color: #8fd3ff; border-color: #2f5a73; }
.tag.jingle { color: #c9a8ff; border-color: #4b3a6e; }
.tag.pin { color: var(--accent); border-color: #6e6300; }
.tag.off { color: #ff9a9a; border-color: #6e2f2f; }

/* library */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { max-width: 280px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 32px; padding: 0 11px; border: 1px solid var(--line2); background: none; cursor: pointer; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.chips button.on { background: var(--text); color: #000; border-color: var(--text); }
.vtable { width: 100%; border-collapse: collapse; }
.vtable th { text-align: left; font: 700 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; padding: 0 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vtable td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.vtable tr:hover td { background: var(--surface); }
.vtable tr.inactive td:not(:last-child) { opacity: .5; }
.thumb { width: 96px; aspect-ratio: 16/9; object-fit: cover; background: var(--surface2); display: grid; place-items: center; color: var(--muted); font: 800 16px var(--font); }
.num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.vtable select { height: 30px; width: auto; padding: 0 6px; font-size: 13px; }

/* upload */
.drop { border: 2px dashed var(--line2); padding: 48px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: rgba(255,229,0,.03); }
.drop b { display: block; font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.uploads { display: grid; gap: 14px; margin-top: 18px; }
.up { display: grid; grid-template-columns: 200px 1fr; gap: 18px; }
.up video { width: 100%; aspect-ratio: 16/9; background: #000; }
.up-progress { height: 6px; background: var(--line2); margin: 8px 0 4px; }
.up-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.up.done .up-progress i { background: var(--ok); }
.up.fail .up-progress i { background: var(--live); }
.check { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font: 400 14px var(--font); color: var(--dim); }
.check input { margin-top: 3px; }

/* schedule */
.sched { list-style: none; margin: 0; padding: 0; }
.sched li { display: grid; grid-template-columns: 70px 72px 1fr auto; gap: 14px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.sched li.jingle { padding-top: 4px; padding-bottom: 4px; }
.sched li.jingle .a { font-weight: 400; color: var(--muted); font-size: 13px; }
.sched li.now { background: rgba(255,43,43,.07); border-left: 3px solid var(--live); }
.sched li.pinned { background: rgba(255,229,0,.05); }
.sched .hourmark { display: block; padding: 18px 10px 6px; border: 0; font: 700 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.sched img, .sched .ph { width: 72px; aspect-ratio: 16/9; object-fit: cover; background: var(--surface2); display: block; }

/* chat moderation */
.chatlog { list-style: none; margin: 0; padding: 0; }
.chatlog li { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; padding: 9px 4px; border-top: 1px solid var(--line); align-items: start; }
.chatlog li.deleted { opacity: .35; text-decoration: line-through; }
.chatlog li.host .n { color: var(--accent); }
.chatlog .n { font-weight: 700; margin-right: 6px; }
.chatlog .banned { color: #ff9a9a; font: 400 11px var(--mono); }

/* stats chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 240px; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text, .chart .xl { fill: var(--muted); font: 400 10.5px var(--mono); }
.chart rect.bar-new { fill: var(--accent); }
.chart rect.bar-old { fill: #6f6a4a; }
.chart rect.hit { fill: transparent; }
.chart rect.hit:hover + rect, .chart g.col:hover rect.v { filter: brightness(1.25); }
.tip { position: absolute; pointer-events: none; background: #000; border: 1px solid var(--line2); padding: 8px 10px; font: 400 12px var(--mono); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); z-index: 5; }
.legend { display: flex; gap: 16px; font: 400 12px var(--mono); color: var(--dim); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.stable { width: 100%; border-collapse: collapse; font-size: 14px; }
.stable td, .stable th { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; }
.stable th { font: 700 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .1em; border-top: 0; }
.stable td.r, .stable th.r { text-align: right; font-family: var(--mono); }

/* modal & toast */
.modal { border: 1px solid var(--line2); background: var(--surface); color: var(--text); padding: 0; width: min(640px, calc(100% - 24px)); max-height: calc(100vh - 40px); }
.modal::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(3px); }
.modal-inner { padding: 24px; display: grid; gap: 16px; }
.modal-inner h3 { margin: 0; font-size: 22px; font-weight: 900; }
.modal video { width: 100%; aspect-ratio: 16/9; background: #000; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: #000; padding: 12px 18px; font: 700 13px var(--mono); z-index: 100; box-shadow: 6px 6px 0 #000; max-width: calc(100% - 32px); }
.toast.err { background: #ff6b6b; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 20; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-logo { padding: 10px 14px; } .side-logo img { width: 92px; }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 0 6px; scrollbar-width: none; }
  .side-nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; padding: 16px 10px; font-size: 14px; }
  .side-nav a.on { border-bottom-color: var(--accent); background: none; }
  .side-foot { display: none; }
  .cols, .onair, .up, .grid2, .grid3 { grid-template-columns: 1fr; }
  .vtable .hide-m { display: none; }
  .main { padding-top: 22px; }
  h1 { font-size: 24px; }
}
@media (max-width: 900px) {
  .vtable th:first-child, .vtable td:first-child { width: 72px !important; padding-right: 0; }
  .vtable .thumb { width: 64px; }
  .vtable td { padding: 10px 6px; }
  .vtable [data-act=next], .vtable [data-act=pin] { display: none; }
  .toolbar input[type=search] { max-width: none; }
  .chips { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; }
  .sched li { grid-template-columns: 48px 1fr auto; }
  .sched li > img, .sched li > .ph, .sched li > span:nth-child(2):empty { display: none; }
  .chatlog li { grid-template-columns: 1fr; }
  .chatlog li .t { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { overflow-x: hidden; }
  .vtable { table-layout: auto; }
  .vtable td:nth-child(2) { word-break: break-word; }
}

.tag.ad { color: #000; background: var(--accent); border-color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.live i { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.status.planned i { background: #8fd3ff; }
.status.ended i, .status.paused i { background: var(--muted); }
.links-edit { display: grid; gap: 8px; }
.links-edit .row { flex-wrap: nowrap; }
.links-edit input[name=lurl] { flex: 2; } .links-edit input[name=llabel] { flex: 1; }
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.acard { background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; padding: 0; color: inherit; font: inherit; }
.acard:hover { border-color: var(--dim); }
.acard .img { aspect-ratio: 16/10; background: var(--surface2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font: 900 28px var(--font); }
.acard .body { padding: 12px 14px; }
.acard .name { font-weight: 800; font-size: 16px; }
.img-edit { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: center; }
.img-edit .img { aspect-ratio: 16/10; background: var(--surface2) center/cover no-repeat; border: 1px solid var(--line); }
.explain { color: var(--dim); max-width: 760px; margin: -10px 0 20px; }
@media (max-width: 900px) { .img-edit { grid-template-columns: 1fr; } }

.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #000; font: 700 11px/20px var(--mono); text-align: center; }
.review { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.review video { width: 100%; aspect-ratio: 16/9; background: #000; }
.review .meta { font: 400 12px var(--mono); color: var(--dim); line-height: 1.7; }
.review .meta b { color: var(--text); font-weight: 700; }
.reqcard { display: grid; gap: 10px; }
.reqcard .msg { white-space: pre-wrap; color: #d6d6d2; font-size: 14px; border-left: 3px solid var(--line2); padding-left: 12px; }
.copyrow { display: flex; gap: 8px; } .copyrow input { font-family: var(--mono) !important; font-size: 13px !important; }
.section-h { margin: 34px 0 14px; display: flex; align-items: baseline; gap: 12px; }
.section-h h2 { margin: 0; }
@media (max-width: 900px) { .review { grid-template-columns: 1fr; } }
