/* Layout: top bar + single content column (max 1100px); cards for brands, sections stacked for a session. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --fg: #16181d;
  --muted: #5d6573;
  --line: #e2e5ea;
  --accent: #e0245e;      /* live-red, used sparingly */
  --c1: #2f6fde;          /* series: penonton */
  --c2: #8a5cd6;          /* series: kata host */
  --c3: #1f9e8f;          /* series: komentar */
  --shade: #2f6fde;
  --ok: #1d8a4f;
  --warn: #b7791f;
  --bad: #c9372c;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-rounded, -apple-system, "SF Pro Rounded", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115; --panel: #171a21; --fg: #e8eaee; --muted: #9aa3b2; --line: #2a2f39;
    --accent: #ff4f81; --c1: #6b9cff; --c2: #b18cf0; --c3: #4cc9b8; --shade: #6b9cff;
    --ok: #4cc38a; --warn: #e0a548; --bad: #ff6b5e;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 5; background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1100px; margin: 0 auto; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.01em; text-decoration: none; }
.logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.crumbs { display: flex; gap: 6px; color: var(--muted); font-size: 14px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--fg); }
.spacer { flex: 1; }
.btn-ghost { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.btn-ghost:hover { color: var(--fg); }

main { max-width: 1100px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 64px max(16px, env(safe-area-inset-left)); display: grid; gap: 28px; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
h2 { font-size: 17px; margin: 0; letter-spacing: -.01em; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lead { font-size: 18px; line-height: 1.45; margin: 0; max-width: 64ch; text-wrap: pretty; }
.lead b { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.head { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--panel); }
.chip.live { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

.sec { display: grid; gap: 12px; min-width: 0; }
.sec > p { margin: 0; color: var(--muted); max-width: 72ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 10px; text-decoration: none; min-width: 0; }
a.card:hover { border-color: color-mix(in srgb, var(--c1) 50%, var(--line)); }
.card-title { font-weight: 650; font-size: 17px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.tile-label { font-size: 13px; color: var(--muted); }
.big { font-family: var(--font-num); font-size: 30px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.big small { font-size: 16px; color: var(--muted); font-weight: 500; }
.sub { font-size: 13px; color: var(--muted); }
.bad { color: var(--bad); font-weight: 600; }
.okc { color: var(--ok); font-weight: 600; }

.chart { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 340px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg text { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.chart svg .lbl { fill: var(--fg); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.14); border-radius: 8px; padding: 8px 10px; font-size: 13px; display: grid; gap: 2px; min-width: 160px; font-variant-numeric: tabular-nums; z-index: 3; }
.tip span { color: var(--muted); }

.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tablewrap.scroll { max-height: 380px; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.dim { color: var(--muted); }
tr.click { cursor: pointer; }
tr.click:hover td { background: color-mix(in srgb, var(--c1) 6%, transparent); }
tr.music td { color: var(--muted); font-style: italic; }
.findings td:nth-child(3), .findings td:nth-child(4) { min-width: 220px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; white-space: nowrap; border: 1px solid currentColor; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); } .pill.mut { color: var(--muted); }

.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.frames figure { margin: 0; display: grid; gap: 4px; }
.frames img { width: 100%; max-width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--line); }
.frames figcaption { font-size: 12px; color: var(--muted); }

details.notes { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
details.notes summary { cursor: pointer; font-weight: 600; }
details.notes ul { margin: 10px 0 0; padding-left: 1.2em; color: var(--muted); display: grid; gap: 4px; max-width: 78ch; }
details.notes .tablewrap { margin-top: 10px; }

.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; color: var(--muted); text-align: center; }
.err { color: var(--bad); }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.login { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 14px; }
.login label { font-size: 13px; color: var(--muted); display: grid; gap: 6px; }
.login input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.login button { font: inherit; font-weight: 600; padding: 10px; border-radius: 8px; border: 0; background: var(--fg); color: var(--bg); cursor: pointer; }
.m0 { margin: 0; }
.legend i.sw1 { background: var(--c1); } .legend i.sw2 { background: var(--c2); } .legend i.sw3 { background: var(--c3); }
