:root {
  --bg: #f4f6f9; --card: #fff; --ink: #14202b; --mute: #5b6b7a; --line: #e2e8ef;
  --top: #0f2a3a; --top-ink: #cfe0ea; --accent: #0e7490; --accent-ink: #fff;
  --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --info: #1d4ed8;
  --radius: 12px; --shadow: 0 1px 2px rgba(15, 42, 58, .06), 0 4px 14px rgba(15, 42, 58, .05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d141b; --card: #151f29; --ink: #e7eef5; --mute: #93a4b4; --line: #26323f;
    --top: #0a1118; --accent: #22a6c6; --accent-ink: #04202a; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171; --info: #7aa7ff; --shadow: none; }
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5;
  font-family: system-ui, "Segoe UI", "Nirmala UI", "Noto Sans Tamil", "Noto Sans Arabic", sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
a { color: var(--accent); }
.muted, small { color: var(--mute); }
.err { color: var(--bad); min-height: 1.3em; margin: 0; font-size: .9rem; }

.logo { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--accent);
  color: var(--accent-ink); font-weight: 800; letter-spacing: .5px; }
.logo.sm { width: 38px; height: 38px; border-radius: 10px; font-size: .8rem; }

#login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 28px; display: grid; gap: 12px; }
.login-card h1 { font-size: 1.4rem; margin-top: 4px; }
.login-card p { margin: 0; }
label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--mute); }
input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn[disabled] { opacity: .55; cursor: wait; }

.top { background: var(--top); color: var(--top-ink); display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; padding: 12px clamp(16px, 3vw, 40px); }
.top .brand { display: flex; gap: 10px; align-items: center; }
.top b { color: #fff; display: block; }
.top small { color: var(--top-ink); opacity: .75; }
.top .who { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.top .btn { background: transparent; color: var(--top-ink); border-color: rgba(255, 255, 255, .25); }

main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1240px; margin: 0 auto; outline: none; }
.page-head { margin-bottom: 18px; }
.page-head h2 { font-size: 1.5rem; }
.page-head p { margin: 2px 0 0; }
section { margin-bottom: 26px; }
section > h3 { font-size: 1.05rem; margin-bottom: 10px; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px; }
.card.live { border-top: 4px solid var(--accent); }
.card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card h3 { font-size: 1.05rem; }
.card .note { margin: 0; font-size: .88rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat .v { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .78rem; color: var(--mute); font-weight: 600; }
.card .foot { margin-top: auto; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.warnline { color: var(--warn); font-size: .88rem; margin: 0; }

.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .75rem; font-weight: 700; border: 1px solid currentColor; white-space: nowrap; }
.pill.live { color: var(--ok); } .pill.planned { color: var(--mute); } .pill.planning { color: var(--info); }
.cur { font-size: .78rem; color: var(--mute); font-weight: 600; }

.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.list .item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .tamil { white-space: pre-wrap; }
.empty { color: var(--mute); padding: 18px; text-align: center; }
.rule { color: var(--mute); font-size: .85rem; margin-top: 8px; }

.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; }
dialog::backdrop { background: rgba(8, 15, 22, .55); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 9; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); color: #fff; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
