:root {
  --bg: #f4f5f7; --card: #fff; --ink: #1d2330; --muted: #6b7280; --line: #e3e6eb; --accent: #1f5fd1;
  --red: #c40000; --green: #0a7d2c; --amber: #b26a00; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --card: #1d2128; --ink: #e8eaee; --muted: #9aa3b1; --line: #2c323b; --accent: #5b8ff0; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--card); border-bottom: 1px solid var(--line);
         position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-size: 17px; }
.grow { flex: 1; }
nav button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font: inherit; color: var(--muted); cursor: pointer; }
nav button.on { background: var(--bg); color: var(--ink); font-weight: 600; }
main { max-width: 1100px; margin: 0 auto; padding: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 17px; }
button { font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 12px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { background: var(--red); color: #fff; border-color: var(--red); }
button.ghost { border-color: transparent; background: none; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
textarea { width: 100%; min-height: 70px; }
.f { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.f > span { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--red); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line); }
.badge.red { background: var(--red); color: #fff; }
.badge.green { background: var(--green); color: #fff; }
.badge.amber { background: var(--amber); color: #fff; }
.login { max-width: 360px; margin: 12vh auto; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); color: var(--accent); }
.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: 34px 64px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item.off { opacity: .55; }
.thumb { width: 64px; height: 114px; object-fit: cover; background: #000; border-radius: 6px; }
.item .name { font-weight: 600; word-break: break-word; }
.item .ctl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ord { display: flex; flex-direction: column; gap: 4px; }
.ord button { padding: 2px 6px; }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; width: 160px; }
.progress i { display: block; height: 100%; background: var(--accent); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; border-top: 0; }
.onair { display: flex; gap: 14px; align-items: center; }
.onair .now { font-size: 18px; font-weight: 600; }
.bigbtn { font-size: 18px; padding: 14px 22px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg);
         padding: 10px 16px; border-radius: 8px; z-index: 50; max-width: 90vw; }
@media (max-width: 640px) {
  .item { grid-template-columns: 28px 48px 1fr; }
  .item .ctl { grid-column: 1 / -1; justify-content: flex-start; }
  .thumb { width: 48px; height: 86px; }
}
