
:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #15181d;
  --muted: #5c6470;
  --border: #dde1e7;
  --accent: #2f6fde;
  --accent-text: #ffffff;
  --accent-soft: #e6eefc;
  --ok: #1d7a46;
  --ok-soft: #e3f4ea;
  --warn: #8a5a00;
  --danger: #b42318;
  --led: #8a5a00;
  --led-soft: #fbf0d9;
  --peer: #1f6f8b;
  --peer-soft: #dff1f7;
  --code-bg: #101418;
  --code-text: #e6e9ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161a21;
    --surface-2: #1d222b;
    --text: #e8ebf0;
    --muted: #98a1ae;
    --border: #2a303b;
    --accent: #6a9cf2;
    --accent-text: #0b1020;
    --accent-soft: #1b2a45;
    --ok: #5fcf8e;
    --ok-soft: #14301f;
    --warn: #e0b45a;
    --danger: #f2877d;
    --led: #e0b45a;
    --led-soft: #33280f;
    --peer: #6cc4e0;
    --peer-soft: #12303a;
    --code-bg: #0a0d11;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--border); background: var(--surface); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
.mark { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--peer)); }
.tag { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; }
.intro { padding: 40px 0 8px; }
.intro h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 8px; }
.intro p { margin: 0; color: var(--muted); max-width: 62ch; }
.desktop-panel h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
.desktop-panel > p { margin-bottom: 18px; }
#desktop-pair { margin: 18px 0 12px; }
#desktop-pair .muted { margin: 0 0 12px; font-size: 13px; }
#desktop-status:empty { display: none; }
#desktop-status { padding: 10px 12px; background: var(--surface-2); border-radius: 8px; }
#desktop-teams .option { padding-bottom: 12px; }
#desktop-teams button, #desktop-chats button { margin: 6px 8px 0 0; }
#desktop-chats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
#desktop-chats button { font-size: 13px; font-weight: 500; }
#desktop-chats h3 { flex-basis: 100%; margin: 4px 0; font-size: 14px; }
button:disabled { opacity: .6; cursor: progress; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.search { flex: 1; max-width: 360px; }
input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.status { color: var(--muted); margin: 8px 0; }
.status.error-state { color: var(--danger); }
.teams { list-style: none; padding: 0; margin: 0 0 48px; display: grid; gap: 12px; }
.team {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.team h2 { font-size: 16px; margin: 0; letter-spacing: -.01em; }
.team p { margin: 0; color: var(--muted); grid-column: 1; overflow-wrap: anywhere; }
.team .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; grid-column: 1; margin-top: 6px; font-size: 13px; color: var(--muted); }
.team .actions { grid-column: 2; grid-row: 1 / span 3; }
.team .roster { grid-column: 1 / -1; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.roster h3 { font-size: 13px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.member-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.member-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.member-role { color: var(--muted); }
.member-status { margin-left: auto; color: var(--muted); white-space: nowrap; }
.member-status.online { color: var(--ok); }
.badge { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 9px; }
.badge.leaderless { color: var(--peer); background: var(--peer-soft); }
.badge.led { color: var(--led); background: var(--led-soft); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 5px; vertical-align: 1px; }
.dot.on { background: var(--ok); }
button { font: inherit; cursor: pointer; border-radius: 8px; }
.primary { background: var(--accent); color: var(--accent-text); border: 0; padding: 9px 16px; font-weight: 600; }
.primary:disabled { opacity: .6; cursor: progress; }
.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 8px 14px; font-weight: 600; }
.icon-button { background: transparent; border: 0; color: var(--muted); font-size: 24px; line-height: 1; padding: 4px 8px; }
dialog { border: 0; padding: 0; background: transparent; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(8, 12, 18, .55); }
.sheet { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 20px; max-height: calc(100vh - 32px); overflow: auto; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.unlock { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 12.5px; }
.error { color: var(--danger); margin: 0; }
.success { color: var(--ok); background: var(--ok-soft); border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; }
.warn { color: var(--warn); font-size: 13px; margin: 8px 0 0; }
.option { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; }
.option h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 0 0 4px; }
.option p { margin: 4px 0 10px; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.code { position: relative; }
pre {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 12px 70px 12px 12px;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-x: auto;
  white-space: pre;
}
.copy { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .1); color: var(--code-text); border: 1px solid rgba(255, 255, 255, .18); font-size: 12px; padding: 3px 9px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
@media (max-width: 560px) {
  .intro h1 { font-size: 24px; }
  .team { grid-template-columns: 1fr; }
  .team .actions { grid-column: 1; grid-row: auto; margin-top: 10px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
}
