:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bad: #dc2626;
  --bad-bg: #fef2f2;
  --ok: #059669;
  --head: #0f172a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top {
  background: var(--head);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 2;
}
.title { flex: 1; min-width: 0; }
.brand { font-weight: 700; font-size: 18px; }
.name { font-size: 13px; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bell {
  position: relative;
  background: transparent;
  border: 0;
  padding: 6px;
  color: #fff;
  cursor: pointer;
}
.bell svg { width: 28px; height: 28px; fill: currentColor; }
.count {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--bad);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.banner {
  background: #fef3c7;
  color: #92400e;
  padding: 8px 16px;
  font-size: 14px;
}

main { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 12px; max-width: 720px; width: 100%; margin: 0 auto; }

.allok {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  color: var(--ok);
  font-size: 18px;
  font-weight: 600;
}
.allok small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 6px; }

.box {
  background: var(--card);
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 12px 14px;
}
.box h3 { margin: 0 0 6px; font-size: 16px; }
.fault { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-top: 1px solid var(--line); font-size: 14px; }
.fault:first-of-type { border-top: 0; }
.fault .what { color: var(--bad); font-weight: 600; flex: 1; }
.fault .since { color: var(--muted); font-size: 12px; white-space: nowrap; }

.sheet {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 5;
  overflow: auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; max-width: 720px; margin: 0 auto 8px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
#alerts-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.alert { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.alert .body { flex: 1; min-width: 0; }
.alert .t { font-weight: 600; font-size: 14px; }
.alert .d { color: var(--muted); font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.alert .w { color: var(--muted); font-size: 12px; margin-top: 2px; }
.del { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--muted); cursor: pointer; font-size: 13px; }

.link { background: transparent; border: 0; color: #2563eb; font-size: 15px; cursor: pointer; padding: 6px; }

.foot { padding: 12px 16px 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.notify { background: var(--head); color: #fff; border: 0; border-radius: 10px; padding: 10px 18px; font-size: 15px; cursor: pointer; }
.notify.on { background: #e2e8f0; color: var(--ink); }
.notify.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.banner.demo { background: #ede9fe; color: #5b21b6; }
.hint { font-size: 13px; color: #92400e; background: #fef3c7; border-radius: 8px; padding: 8px 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
