:root {
  --bg: #f5f6fa; --card: #ffffff; --text: #1b1f2a; --muted: #667085; --line: #e4e7ec;
  --brand: #3d5afe; --brand-ink: #ffffff; --ok: #12b76a; --warn: #f79009; --bad: #f04438;
  --blocked-bg: #fef3f2; --allowed-bg: #ecfdf3;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --card: #181c25; --text: #eef0f5; --muted: #98a2b3; --line: #2a3040;
    --blocked-bg: #2b1715; --allowed-bg: #10261b;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
#app { max-width: 640px; margin: 0 auto; padding: 0 16px 96px; }
h1 { font-size: 22px; margin: 20px 0 4px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
.sub { color: var(--muted); font-size: 14px; }
.bar { display: flex; align-items: center; gap: 8px; padding: 14px 0 6px; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.bar h1 { margin: 0; flex: 1; font-size: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.name { font-weight: 650; overflow-wrap: anywhere; }
.pkg { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
button { font: inherit; border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
button.danger { color: var(--bad); }
button.ghost { border-color: transparent; background: transparent; color: var(--brand); }
button:disabled { opacity: .45; cursor: not-allowed; }
input, select { font: inherit; width: 100%; padding: 11px 12px; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 3px 9px; border-radius: 99px; }
.pill.on { background: var(--blocked-bg); color: var(--bad); }
.pill.off { background: var(--allowed-bg); color: var(--ok); }
.pill.warn { background: #fff4e0; color: #b54708; }
.pill.gray { background: var(--line); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--ok); } .dot.late { background: var(--warn); } .dot.off { background: var(--bad); }
.app { display: flex; gap: 10px; align-items: center; }
.app.blocked { border-left: 4px solid var(--bad); }
.app.allowed { border-left: 4px solid var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips button { padding: 8px 12px; min-height: 40px; }
.chips button.sel { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.tabs { display: flex; gap: 6px; margin: 12px 0; }
.tabs button { flex: 1; }
.tabs button.sel { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.event { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.event:last-child { border-bottom: 0; }
.event time { color: var(--muted); font-size: 12px; display: block; }
.notice { padding: 12px 14px; border-radius: 12px; background: #fff4e0; color: #7a2e0e; font-size: 14px; margin: 10px 0; }
.code { font-size: 40px; letter-spacing: 8px; font-weight: 750; text-align: center; padding: 14px 0; font-variant-numeric: tabular-nums; }
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 20, .55); display: flex; align-items: flex-end;
  justify-content: center; z-index: 20; }
.sheet { background: var(--card); width: 100%; max-width: 640px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow: auto; }
.sheet h2 { margin-top: 0; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions button { flex: 1; }
.list button.item { width: 100%; text-align: left; margin: 4px 0; }
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #1b1f2a; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .2s; max-width: 90vw; z-index: 30; font-size: 14px; }
#toast.show { opacity: 1; }
.login { max-width: 380px; margin: 14vh auto 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 0; }
