:root { --bg:#f6f4fb; --fg:#1d1733; --muted:#6c6585; --card:#fff; --line:#e3def0; --accent:#5b2fd6;
  --critical:#e5383b; --high:#f48c06; --normal:#e9c400; --low:#2fbf71; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#120d22; --fg:#eeeaf8; --muted:#a39cbc; --card:#1d1733; --line:#2f2750; --accent:#9b7bff; }
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  padding-bottom:env(safe-area-inset-bottom); }
header { display:flex; align-items:center; gap:10px; padding:calc(10px + env(safe-area-inset-top)) 16px 10px;
  background:#24124f; color:#fff; position:sticky; top:0; z-index:1; }
header h1 { font-size:19px; margin:0; flex:1; }
header img { border-radius:8px; }
main { max-width:640px; margin:0 auto; padding:12px; }
button { font:inherit; border:0; border-radius:10px; padding:10px 14px; background:var(--accent); color:#fff; cursor:pointer; }
button.ghost { background:transparent; color:inherit; border:1px solid var(--line); }
header button.ghost { border-color:#ffffff40; font-size:20px; padding:4px 10px; }
input, textarea { font:inherit; width:100%; padding:10px; border-radius:10px; border:1px solid var(--line);
  background:var(--card); color:var(--fg); }
form, section { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:14px; margin-bottom:12px;
  display:grid; gap:10px; }
h2 { font-size:15px; margin:4px 0 0; color:var(--muted); }
.row { display:flex; gap:8px; flex-wrap:wrap; }
.hint { color:var(--muted); font-size:14px; }
.error { color:var(--critical); min-height:1em; margin:0; }
ul { list-style:none; margin:0; padding:0; }
#devices li { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:6px 0;
  border-bottom:1px solid var(--line); font-size:14px; }
#alerts li { background:var(--card); border:1px solid var(--line); border-left:6px solid var(--normal);
  border-radius:12px; padding:10px 12px; margin-bottom:8px; }
#alerts li.low { border-left-color:var(--low); }
#alerts li.high { border-left-color:var(--high); }
#alerts li.critical { border-left-color:var(--critical); }
#alerts li.unread .title { font-weight:700; }
#alerts li.focus { outline:2px solid var(--accent); }
.title { font-size:16px; }
.body { white-space:pre-wrap; margin:4px 0; font-size:15px; overflow-wrap:anywhere; }
.meta { color:var(--muted); font-size:13px; }
.meta a { color:var(--accent); }
.ask { display:flex; gap:8px; margin-top:8px; }
.ask input { flex:1; }
.answered { margin-top:6px; font-size:14px; }
.answered b { color:var(--accent); }
.banner { border-width:2px; }
.banner.off { background:#fff4c2; border-color:#e9b400; color:#3a2d00; }
.banner.on { background:#dcf7e7; border-color:#2fbf71; color:#0d3b22; }
.banner strong { font-size:17px; }
.banner p { margin:0; }
.banner button { font-size:17px; padding:12px 16px; }
