:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1c2330; --muted: #667085; --line: #e3e6eb;
  --accent: #2456d6; --accent-ink: #ffffff; --ok: #1a7f4b; --warn: #a15c00; --crit: #b42318;
  --ok-bg: #e6f4ec; --warn-bg: #fdf1dc; --crit-bg: #fde8e6; --owner: #e8eefc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b2029; --ink: #e6e9ef; --muted: #98a2b3; --line: #2c3340;
    --accent: #6f95f5; --accent-ink: #0d1220; --ok: #5fcf95; --warn: #f0b458; --crit: #f58a80;
    --ok-bg: #173326; --warn-bg: #3a2c12; --crit-bg: #3d1c19; --owner: #22304f;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 14px; margin: 24px 0 8px; color: var(--muted); font-weight: 600; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 13px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.center { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 100%; max-width: 380px; }
.card > * + * { margin-top: 14px; }
button { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
.card button { width: 100%; padding: 11px; }
input, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; }
.card input { width: 100%; margin-top: 8px; }
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details button { margin-top: 10px; }
.msg { color: var(--crit); font-size: 13px; min-height: 1.4em; margin: 8px 0 0; }
.msg.ok { color: var(--ok); }

header { position: sticky; top: 0; z-index: 2; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 16px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
nav { display: flex; gap: 2px; }
.tab { border: 0; background: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); position: relative; }
.tab.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.badge.OK { background: var(--ok-bg); color: var(--ok); } .badge.WARN { background: var(--warn-bg); color: var(--warn); } .badge.CRIT { background: var(--crit-bg); color: var(--crit); }
.badge.ghost { border: 1px solid var(--line); font-weight: 500; }
.dot { position: absolute; top: 6px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--crit); }
.count { margin-left: 5px; font-size: 11px; background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 1px 6px; }

main { max-width: 820px; margin: 0 auto; padding: 16px; }
.bar { border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.bar.warn { background: var(--warn-bg); color: var(--warn); }
.timeline { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.item { max-width: 88%; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 10px 13px; }
.item.owner { align-self: flex-end; background: var(--owner); border-color: transparent; }
.item.admin { align-self: flex-start; }
.item.admin.WARN { border-left: 4px solid var(--warn); } .item.admin.CRIT { border-left: 4px solid var(--crit); } .item.admin.INFO { border-left: 4px solid var(--accent); }
.item .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item .title { font-weight: 600; margin: 2px 0; }
.item .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.item .lvl { font-weight: 700; } .lvl.WARN { color: var(--warn); } .lvl.CRIT { color: var(--crit); } .lvl.INFO { color: var(--accent); }
.item.unread { box-shadow: 0 0 0 2px var(--accent) inset; }
.item button.link { border: 0; background: none; padding: 0; color: var(--accent); font-size: 12px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
.composer { position: sticky; bottom: 0; background: var(--bg); display: flex; gap: 8px; padding: 10px 0 6px; align-items: flex-end; }
.composer textarea { flex: 1; resize: vertical; min-height: 46px; max-height: 40vh; background: var(--panel); }
.hint { margin: 0 0 8px; }
.doc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0 0 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
@media (max-width: 560px) { .item { max-width: 96%; } header { padding: 8px 10px; } main { padding: 12px 10px; } }
