:root {
  --bg: #f4f4f2; --panel: #ffffff; --line: #d9d9d4; --text: #1d1d1b; --muted: #6b6b66;
  --accent: #1f4e5f; --accent-text: #ffffff; --ok: #2b7a3d; --warn: #9a6400; --bad: #a33a2a; --soft: #eceeea;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.4;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 6px 12px; border-radius: 3px; }
button:hover { border-color: #a8a8a2; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.danger { color: var(--bad); }
button.link { border: none; background: none; color: var(--accent); padding: 0; }
button.small { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: #fff; color: var(--text); width: 100%; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
label input, label select, label textarea { margin-top: 3px; }
label.inline { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); }
label.inline input { width: auto; margin: 0; }

header.top { display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 48px; background: var(--panel); border-bottom: 1px solid var(--line); }
.wordmark { font-weight: 600; letter-spacing: .02em; color: var(--text); }
header nav a { color: var(--muted); margin-right: 16px; padding: 14px 0; display: inline-block; border-bottom: 2px solid transparent; }
header nav a.active { color: var(--text); border-color: var(--accent); }
.spacer { flex: 1; }
main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 16px; }
h2 { font-size: 15px; font-weight: 600; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; text-align: right; }
.art { width: 36px; height: 36px; border-radius: 3px; background: var(--soft); object-fit: cover; display: block; }
.art.big { width: 96px; height: 96px; }
.badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.on { color: var(--ok); border-color: var(--ok); }
.badge.ready { color: var(--ok); border-color: #b9d8bf; }
.badge.queued, .badge.fetching { color: var(--warn); border-color: #e4d2a6; }
.badge.failed { color: var(--bad); border-color: #e0bdb6; }
.err { color: var(--bad); min-height: 1.2em; margin-top: 8px; }
.ok { color: var(--ok); }

.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 16px; display: grid; grid-template-columns: 64px 1fr; gap: 14px; }
.card .logo { width: 64px; height: 64px; border-radius: 4px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 20px; object-fit: cover; }
.card h3 { margin: 0 0 2px; font-size: 16px; font-weight: 600; }
.card .np { display: flex; gap: 8px; align-items: center; margin: 8px 0; min-height: 36px; }
.card .np .t { font-size: 13px; line-height: 1.25; }
.card .foot { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 20px 0 16px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--text); border-color: var(--accent); }
.urls { display: grid; grid-template-columns: max-content 1fr auto; gap: 6px 12px; align-items: center; font-size: 13px; }
.urls code { font-size: 12px; background: var(--soft); padding: 2px 6px; border-radius: 3px; overflow-wrap: anywhere; }
.station-head { display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: start; }
.station-head .logo { width: 96px; height: 96px; border-radius: 4px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 28px; object-fit: cover; }
.station-head .np { display: flex; gap: 10px; align-items: center; margin-top: 10px; }

.drop { border: 2px dashed var(--line); border-radius: 4px; padding: 32px; text-align: center; color: var(--muted); background: var(--panel); }
.drop.over { border-color: var(--accent); color: var(--text); }
.progress { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 8px 14px; border-radius: 4px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }

body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 28px; width: 340px; }
.login .wordmark { font-size: 18px; margin-bottom: 20px; }
.login button { width: 100%; background: var(--accent); color: #fff; border-color: var(--accent); margin-top: 4px; }
pre.log { background: #1d1d1b; color: #d9d9d4; font-size: 12px; padding: 12px; border-radius: 4px; max-height: 420px; overflow: auto; white-space: pre-wrap; }
