:root {
  --ink: #17191c; --quiet: #6a6e74; --line: #d7d4cb; --bg: #fbfaf7; --card: #fff;
  --accent: #2f6fd6; --tint: rgba(47,111,214,.12); --good: #1f8a4c; --bad: #c0392b;
  --r: 14px; --nav: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
header.top { display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 18px 6px; }
header.top h1 { font-size: 22px; margin: 0; font-weight: 650; }
.who { font-size: 13px; color: var(--quiet); }
main { flex: 1; padding: 8px 18px calc(var(--nav) + 28px + env(safe-area-inset-bottom)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.card .name { font-weight: 650; }
.card .body { color: var(--quiet); font-size: 14px; margin-top: 2px; }
.card.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--quiet); }
.dot.good { background: var(--good); } .dot.bad { background: var(--bad); }
.accent { border: 2px solid var(--accent); background: var(--tint); }
h2 { font-size: 15px; margin: 18px 2px 8px; font-weight: 650; }
.btn { appearance: none; font: inherit; font-weight: 650; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: var(--r); padding: 14px 12px; min-height: 52px; width: 100%; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { border: 2px solid var(--accent); background: var(--tint); }
.btn.talking { border: 2px solid var(--bad); background: rgba(192,57,43,.1); }
.btn.small { min-height: 38px; padding: 8px 12px; width: auto; font-size: 14px; }
.btn.link { border: 0; background: none; color: var(--quiet); font-weight: 500; text-decoration: underline; width: auto; min-height: 0; padding: 8px 2px; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.video { position: relative; background: #0d1117; border-radius: var(--r); overflow: hidden; aspect-ratio: 16/10; border: 1px solid var(--line); }
.video video, .video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video .status { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: #fff; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 99px; }
.video .status:empty { display: none; }
.video .sound { position: absolute; right: 8px; bottom: 6px; }
.banner { text-align: center; font-weight: 650; padding: 12px; border-radius: var(--r); margin: 10px 0; }
.list .item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.list .item:last-child { border-bottom: 0; }
.list .when { color: var(--quiet); white-space: nowrap; }
.empty { color: var(--quiet); font-size: 14px; padding: 6px 2px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; cursor: pointer; padding: 0; text-align: left; font: inherit; color: inherit; }
.tile .thumb { aspect-ratio: 4/3; background: #0d1117 center/cover no-repeat; }
.tile .cap { padding: 8px 10px; font-size: 14px; font-weight: 650; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .in { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
nav.tabs button { appearance: none; border: 0; background: none; font: inherit; font-size: 12px; color: var(--quiet);
  height: var(--nav); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; position: relative; }
nav.tabs button[aria-current="page"] { color: var(--accent); font-weight: 650; }
nav.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs .badge { position: absolute; top: 10px; right: calc(50% - 20px); width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.login { padding: 12vh 22px 22px; }
.login h1 { font-size: 26px; margin: 0 0 4px; } .login p { color: var(--quiet); margin: 0 0 22px; }
.login input { width: 100%; font: inherit; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; background: #fff; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; margin: 4px 2px 10px; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 20; display: flex; flex-direction: column; justify-content: center; padding: 14px; gap: 12px; }
.overlay .video { aspect-ratio: 16/10; }
#toast { position: fixed; left: 50%; bottom: calc(var(--nav) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #17191c; color: #fff; padding: 10px 16px; border-radius: 99px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 30; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.note { font-size: 13px; color: var(--quiet); margin: 6px 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
