:root {
  --ink: #0f1830;
  --panel: #17223d;
  --panel-2: #1e2c4d;
  --line: #2b3b60;
  --text: #eef2fa;
  --muted: #9aa8c7;
  --amber: #ffb547;
  --amber-ink: #2a1c00;
  --ok: #5fd4a0;
  --bad: #ff7a7a;
  --radius-lg: 18px;
  --radius-sm: 10px;
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; background: var(--ink); color: var(--text); }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 650; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--amber); }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.wrap { max-width: 640px; margin: 0 auto; padding: 20px 18px 48px; }
.wrap-wide { max-width: 1040px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 0 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; }
.brand-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(255,181,71,.18); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

label { display: block; font-size: 0.9rem; color: var(--muted); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 2px;
}

button, .btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 20px; background: var(--amber); color: var(--amber-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
button:disabled { opacity: .55; cursor: wait; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-small { padding: 7px 14px; font-size: 0.88rem; }
.btn-ok { background: var(--ok); color: #05261a; }
.btn-bad { background: transparent; color: var(--bad); border-color: rgba(255,122,122,.45); }
.btn-block { width: 100%; }

.tabs { display: flex; gap: 6px; background: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.tabs button { flex: 1; background: transparent; color: var(--muted); padding: 9px 12px; }
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }

.msg { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.92rem; }
.msg-bad { background: rgba(255,122,122,.12); color: #ffc2c2; }
.msg-ok { background: rgba(95,212,160,.12); color: #bff0d8; }
.hidden { display: none !important; }

/* ---------- Broadcast log (news feed) ---------- */
.feed { list-style: none; margin: 0; padding: 0; position: relative; }
.feed::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px;
  width: 2px; background: var(--line);
}
.feed li { position: relative; padding: 0 0 26px 30px; }
.feed li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--ink); border: 2px solid var(--line);
}
.feed li.latest::before { background: var(--amber); border-color: var(--amber); animation: onair 2.4s ease-out 1; }
@keyframes onair {
  0% { box-shadow: 0 0 0 0 rgba(255,181,71,.6); }
  100% { box-shadow: 0 0 0 16px rgba(255,181,71,0); }
}
.feed time { display: block; font-size: 0.84rem; color: var(--muted); margin-bottom: 4px; }
.feed h3 { margin-bottom: 6px; }
.feed .body { white-space: pre-wrap; overflow-wrap: anywhere; color: #d7deee; }

.status-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.expiry { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.expiry.soon { color: var(--amber); }
.expiry.past { color: var(--bad); }

/* ---------- Admin table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 820px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; background: var(--panel); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td input[type="date"] { padding: 7px 9px; min-width: 140px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.pill-pending { background: rgba(255,181,71,.15); color: var(--amber); }
.pill-approved { background: rgba(95,212,160,.15); color: var(--ok); }
.pill-blocked { background: rgba(255,122,122,.15); color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.stat b { display: block; font-family: var(--font-head); font-size: 1.6rem; }

.toast {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 999px;
  font-weight: 600; z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  .feed li.latest::before { animation: none; }
}
