:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #1f2430; --muted: #6b7280; --line: #e5e7eb;
  --accent: #10b981; --bad: #ef4444; --warn-bg: #fff7ed; --warn-ink: #9a3412;
  --bubble-in: #e5e7eb; --bubble-out: #10b981; --bubble-out-ink: #ffffff;
  --radius: 14px; --shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 20px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11141b; --card: #1a1f2b; --ink: #e8eaf0; --muted: #9aa3b2; --line: #2a3140;
    --warn-bg: #3a2414; --warn-ink: #fdba74; --bubble-in: #2a3140; --shadow: none; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--card);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header.top h1 { font-size: 18px; margin: 0; }
header.top .spacer { flex: 1; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 360px 1fr; }
.cols-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .cols-2, .cols-even { grid-template-columns: 1fr; } }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, .btn { border: 0; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select { font: inherit; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--bg); border: 1px solid var(--line); }
.pill.on { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.pill.off { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }

/* team cards */
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bot { border-radius: 12px; padding: 12px; border: 2px solid var(--line); background: var(--card); transition: all .25s; }
.bot .face { font-size: 26px; }
.bot .name { font-weight: 700; }
.bot .role { font-size: 12px; color: var(--muted); }
.bot .state { font-size: 12px; font-weight: 700; margin-top: 6px; color: var(--muted); }
.bot.working { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); transform: translateY(-2px); }
.bot.working .state { color: var(--c); }
.bot.working .face { animation: bob .8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }

/* who-to-whom feed */
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow-y: auto; }
.event { border-left: 4px solid var(--c); background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.event .who { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
.chip { padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--c); }
.arrow { color: var(--muted); }
.event .body { white-space: pre-wrap; font-size: 14px; margin-top: 3px; overflow-wrap: anywhere; }
.event .time { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: auto; }

/* pretend phone */
.phone { border: 10px solid #1f2430; border-radius: 34px; background: var(--card); height: 600px;
  display: flex; flex-direction: column; overflow: hidden; }
.phone .bar { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; text-align: center; }
.phone .chat { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 82%; padding: 8px 12px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.bubble.out { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 4px; }
.bubble.in { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-ink); border-bottom-right-radius: 4px; }
.bubble.system { align-self: center; background: transparent; color: var(--muted); font-size: 12px; text-align: center; }
.phone form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.phone form input { flex: 1; }
.typing { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 2px 6px; }

/* lists and tables */
ul.clean { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
ul.clean li { display: flex; gap: 8px; align-items: center; justify-content: space-between; background: var(--bg);
  border-radius: 8px; padding: 7px 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.table-wrap { overflow-x: auto; }
code { background: var(--bg); padding: 1px 6px; border-radius: 6px; }

/* sign-in page */
.hero { max-width: 560px; margin: 40px auto; text-align: center; }
.hero h1 { font-size: 32px; margin: 0 0 6px; }
.hero .team { margin: 24px 0; text-align: left; }
.signin { max-width: 380px; margin: 0 auto; text-align: left; }
.signin input { width: 100%; margin: 6px 0 10px; }
.signin button { width: 100%; }
.msg { margin-top: 10px; font-size: 14px; }
.msg.err { color: var(--bad); }
.mb { margin-bottom: 12px; }
.mt { margin-top: 8px; }
.mt2 { margin-top: 20px; }
.narrow { width: 90px; }
.phone.short { height: 520px; }
.grid > * { min-width: 0; }
.hero .team { grid-template-columns: repeat(2, 1fr); }
.hero .bot .state { display: none; }
header.top a.small { margin-left: 10px; }
a.plain { color: inherit; text-decoration: none; }
main.legal { max-width: 760px; }
main.legal h1 { font-size: 26px; }
main.legal h2 { font-size: 18px; margin-top: 26px; }
main.legal li { margin: 6px 0; }
.consent { margin: 18px 0; }
.shot { max-width: 100%; width: 360px; border-radius: 14px; border: 1px solid var(--line); display: block; }
