:root { --bg:#f4f5f8; --card:#fff; --ink:#182038; --muted:#667; --line:#dde0e8; --accent:#2f5bea; --warn:#c2410c; --ok:#15803d; }
@media (prefers-color-scheme: dark) { :root { --bg:#10131f; --card:#1a2033; --ink:#eceef5; --muted:#99a; --line:#2c3450; --accent:#7c9cff; --warn:#fb923c; --ok:#4ade80; } }
* { box-sizing: border-box; }
body { margin:0; font:16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background:var(--bg); color:var(--ink); }
header { display:flex; align-items:center; gap:10px; padding:12px 16px; padding-top:max(12px, env(safe-area-inset-top)); background:#182038; color:#fff; position:sticky; top:0; z-index:1; }
header img { border-radius:6px; }
h1 { font-size:18px; margin:0; flex:1; }
h2 { font-size:17px; margin:0 0 12px; }
main { max-width:680px; margin:0 auto; padding:16px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; margin-bottom:12px; }
label { display:block; font-size:13px; color:var(--muted); margin-bottom:10px; }
input { display:block; width:100%; margin-top:4px; padding:10px; font:inherit; color:var(--ink); background:var(--bg); border:1px solid var(--line); border-radius:8px; }
button { font:inherit; padding:9px 14px; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--ink); cursor:pointer; }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; }
button.ghost { background:transparent; }
header button.ghost { color:#fff; border-color:#ffffff55; padding:5px 10px; font-size:14px; }
button:disabled { opacity:.5; cursor:default; }
.row { display:flex; flex-wrap:wrap; gap:8px; }
.hint { color:var(--muted); font-size:13px; }
#status { min-height:1.4em; font-size:14px; margin:10px 0 4px; }
.pill { font-size:12px; padding:2px 8px; border-radius:99px; background:#ffffff22; }
.pill.on { background:#15803d; }
.msg { border-left:4px solid var(--line); }
.msg.p4 { border-left-color:var(--warn); }
.msg.p5 { border-left-color:#dc2626; }
.msg.focus { outline:2px solid var(--accent); }
.msg .meta { display:flex; gap:8px; flex-wrap:wrap; font-size:12px; color:var(--muted); margin-bottom:4px; }
.msg .title { font-weight:600; margin-bottom:2px; overflow-wrap:anywhere; }
.msg .body { white-space:pre-wrap; overflow-wrap:anywhere; }
.msg .row { margin-top:10px; }
.msg .state { margin-top:8px; font-size:13px; color:var(--ok); }
.msg .state.pending { color:var(--warn); }
.msg a { color:var(--accent); overflow-wrap:anywhere; }
