:root {
  --bg: #f1f5f9; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --head: #0f172a; --head-text: #f8fafc; --accent: #2563eb;
  --critical: #dc2626; --high: #ea580c; --medium: #ca8a04; --info: #64748b;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1120; --card: #111827; --text: #e5e7eb; --muted: #94a3b8; --line: #1f2937; --head: #020617; --accent: #60a5fa; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif; font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  background: var(--head); color: var(--head-text); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.top h1 { font-size: 18px; margin: 0; }
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav a { color: #cbd5e1; text-decoration: none; padding: 6px 12px; border-radius: 8px; }
.top nav a.on { background: #1e293b; color: #fff; }
.pill { background: var(--critical); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px calc(40px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.card h2 { font-size: 17px; margin: 0 0 8px; }
.card h3 { font-size: 15px; margin: 14px 0 6px; }
.center { text-align: center; padding: 32px 16px; }
.muted { color: var(--muted); font-size: 14px; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 10px;
  padding: 9px 14px; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--critical); }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 14px; }
.chip.on { background: var(--text); color: var(--card); border-color: var(--text); }
.ev { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-left: 5px solid var(--info); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.ev.critical { border-left-color: var(--critical); } .ev.high { border-left-color: var(--high); }
.ev.medium { border-left-color: var(--medium); }
.ev .t { font-weight: 600; word-break: break-word; }
.ev.unread .t::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.ev.acked { opacity: .62; }
.ev .m { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.sev { font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 4px; color: #fff; background: var(--info); }
.sev.critical { background: var(--critical); } .sev.high { background: var(--high); } .sev.medium { background: var(--medium); }
.body { white-space: pre-wrap; word-break: break-word; font-size: 15px; background: var(--bg); border-radius: 8px; padding: 10px; margin: 10px 0; }
label.ck { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
label.ck:last-child { border-bottom: 0; }
label.ck input { width: 22px; height: 22px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.note { background: #fef3c7; color: #78350f; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .note { background: #422006; color: #fde68a; } }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: 90vw; }
.msg { max-width: 480px; margin: 60px auto; padding: 0 16px; text-align: center; }
.row.end { justify-content: flex-end; margin-bottom: 8px; }
.mt { margin-top: 10px; }
[hidden] { display: none !important; }
.chips { scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
td:nth-child(2) { white-space: nowrap; }
