:root {
  --green: #9FE870;
  --dark: #163300;
  --ink: #0e1a06;
  --muted: #5d6b55;
  --line: #e3e9dc;
  --bg: #f6f8f3;
  --card: #fff;
  --red: #b42318;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 0 0 8px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; font-weight: 700; }
p { line-height: 1.45; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.error { color: var(--red); font-weight: 600; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.narrow { max-width: 420px; margin: 8vh auto; }
.hero { background: var(--dark); color: #fff; border: none; }
.hero .muted { color: #c8d8bc; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0; }
input[type=password], input[type=search], input[type=text], select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit;
  border: 1px solid #cdd6c4; border-radius: 10px; background: #fff;
}
button, .btn {
  font: inherit; font-weight: 700; border-radius: 999px; padding: 9px 16px; cursor: pointer;
  border: 1px solid var(--dark); background: #fff; color: var(--dark); text-decoration: none; display: inline-block;
}
button.primary, .btn.primary { background: var(--green); border-color: var(--green); color: var(--dark); }
button.danger { border-color: var(--red); color: var(--red); }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.pill.ok { background: var(--green); color: var(--dark); }
.pill.bad { background: #fde7e5; color: var(--red); }
.pill.wait { background: #fff4d6; color: #7a5300; }
code.url { display: block; padding: 10px; background: #0b1a02; color: var(--green); border-radius: 10px; word-break: break-all; font-size: .85rem; margin: 8px 0; }
.tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.tabs button { padding: 7px 14px; font-size: .9rem; }
.tabs button.on { background: var(--dark); color: #fff; }
ul.chats { list-style: none; padding: 0; margin: 0; }
ul.chats li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
ul.chats li:last-child { border-bottom: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #e7f6dc; color: var(--dark); display: grid; place-items: center; font-weight: 800; flex: none; }
.avatar.group { background: var(--dark); color: var(--green); }
.chatinfo { flex: 1; min-width: 0; }
.chatinfo .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatinfo .meta { font-size: .8rem; color: var(--muted); }
.chatinfo .meta .until { color: #7a5300; font-weight: 600; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 30px; background: #cfd6c8; transition: .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--dark); }
.switch input:checked + span::before { transform: translateX(20px); background: var(--green); }
.activity { font-size: .85rem; margin: 0; padding-left: 18px; }
.activity li { margin: 4px 0; }
.empty { padding: 18px 4px; color: var(--muted); text-align: center; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--dark); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; display: none; }
.toast.show { display: block; }
button.ghost { background: transparent; color: #fff; border-color: #ffffff55; padding: 6px 12px; font-size: .85rem; }
.hero .row { margin-top: 10px; }
[hidden] { display: none !important; }
.settings { gap: 12px; }
.settings label { flex: 1; min-width: 150px; margin: 4px 0 8px; }
.chip { margin-top: 6px; padding: 3px 10px; font-size: .78rem; border-radius: 999px; border: 1px solid #cdd6c4; background: #fff; color: var(--muted); font-weight: 700; }
.chip.on { background: var(--green); border-color: var(--green); color: var(--dark); }
