:root {
  --bg: #0b1020;
  --panel: #141b33;
  --panel-2: #1b2444;
  --text: #eef1fb;
  --muted: #97a0c4;
  --accent: #f5c451;
  --green: #38d39f;
  --red: #ff6b6b;
  --line: #263159;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #16204a 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(11,16,32,.85); backdrop-filter: blur(8px);
}
.brand { font-weight: 700; letter-spacing: .3px; }
.bell { margin-right: 6px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-off { background: var(--muted); }
.dot-on { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot-err { background: var(--red); }

.view { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px; margin-top: 12vh;
}
.card h1 { margin: 0 0 6px; font-size: 22px; }
.muted { color: var(--muted); }
.center { text-align: center; }

form { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
input {
  flex: 1 1 200px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 15px;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.btn {
  padding: 12px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #201800; }
.btn-arm { background: var(--accent); color: #201800; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn:active { transform: translateY(1px); }

.error { color: var(--red); margin-top: 12px; font-size: 14px; }

.arm-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(90deg, #3a2f0c, #241c06);
  border: 1px solid #6b571a; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
}
.arm-banner.armed { display: none; }

.feed-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.feed-head h2 { margin: 0; font-size: 17px; }
.feed-actions { display: flex; gap: 8px; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feed-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  animation: pop .35s ease;
}
.feed-item.history { opacity: .72; }
.feed-item .emoji { font-size: 22px; }
.feed-item .meta { flex: 1; min-width: 0; }
.feed-item .source { font-weight: 700; }
.feed-item .type { color: var(--muted); font-size: 13px; }
.feed-item .time { color: var(--muted); font-size: 12px; white-space: nowrap; }

@keyframes pop {
  0% { transform: scale(.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(245,196,81,.5); }
  100% { box-shadow: 0 0 0 18px rgba(245,196,81,0); }
}
.feed-item.ring { animation: pop .35s ease, flash .7s ease; }
