:root {
  color-scheme: dark;
  --ground: #070707;
  --panel: #111111;
  --raised: #181818;
  --line: #1f1f1f;
  --line-strong: #2e2e2e;
  --text: #f2f2f2;
  --text-2: #a3a3a3;
  --text-3: #8a8a8a;
  --accent: #4fa3ff;
  --accent-fill: #1570d6;
  --selected: #12232f;
  --ok: #2fc534;
  --ok-fill: #0f2a12;
  --dev: #ffcc00;
  --dev-fill: #2a2300;
  --bad: #ff6b61;
  --bad-fill: #1a0f0e;
  --info-fill: #0d1b2a;
  --info-line: #17324f;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--ground); color: var(--text); font-family: var(--font); font-size: 14px; }
a { color: var(--accent); }
a:hover { color: #8cc4ff; }
button, input { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 32px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.signin-card h1 { margin: 0; font-size: 24px; font-weight: 600; }
.signin-card p { margin: 0; color: var(--text-2); line-height: 1.5; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 4px; padding: 20px 12px 16px; background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 24px; }
.brand img { width: 30px; height: 30px; }
.brand-name { display: flex; flex-direction: column; gap: 1px; }
.brand-name strong { font-size: 15px; font-weight: 600; }
.brand-name span { font-size: 12px; color: var(--text-2); }
.nav { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: #c9c9c9; text-decoration: none; font-weight: 500; }
.nav svg { color: var(--text-3); }
.nav:hover { background: #161616; color: var(--text); }
.nav[aria-current="page"] { background: var(--selected); color: #fff; }
.nav[aria-current="page"] svg { color: var(--accent); }
.nav-section { padding: 20px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-3); }
.spacer { flex-grow: 1; }
.chip { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: #161616; border: 1px solid #222; }
.chip-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { flex-shrink: 0; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--selected); color: #8cc4ff; font-size: 12px; font-weight: 600; }
.chip-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chip-text span:first-child { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-kind { font-size: 12px; color: var(--text-2); }
.chip-kind.dev { color: var(--dev); }

.main { padding: 40px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1120px; }
.page-header { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.page-header h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.3px; }
.page-header p { margin: 0; color: var(--text-2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.card p { margin: 0; line-height: 1.5; }
.muted { color: var(--text-2); }
.small { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.danger-card { background: #140c0b; border-color: #3a1714; }

.rows { margin: 0; display: flex; flex-direction: column; }
.rows > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; border-top: 1px solid var(--line); }
.rows dt { font-size: 13px; color: var(--text-2); }
.rows dd { margin: 0; display: flex; align-items: center; gap: 10px; text-align: right; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--ok-fill); color: var(--ok); }
.badge.dev { background: var(--dev-fill); color: var(--dev); }
.badge.plain { background: #1c1c1c; color: var(--text-2); }
.state { display: inline-flex; align-items: center; gap: 6px; }
.state.ok { color: var(--ok); }
.state.no { color: var(--text-3); }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.table thead th { border-top: none; padding-top: 0; font-size: 12px; font-weight: 500; color: var(--text-3); }
.table tbody th { font-weight: 500; }
.table .end { text-align: right; padding-right: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line-strong); background: #1a1a1a; color: #ededed; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #222; }
.btn.primary { border: none; background: var(--accent-fill); color: #fff; }
.btn.primary:hover { background: #1a7ce8; }
.btn.danger { border-color: #5c2320; background: var(--bad-fill); color: var(--bad); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 500; text-decoration: none; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.item { display: flex; align-items: center; gap: 16px; }
.tile { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--raised); color: var(--text-2); }
.danger-card .tile { background: #1f1110; color: var(--bad); }
.item-text { flex-grow: 1; display: flex; flex-direction: column; gap: 4px; }
.item-text h2 { font-size: 15px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 500; color: #d6d6d6; }
.input { min-height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid #333; background: #0b0b0b; color: var(--text); }
.input::placeholder { color: #7a7a7a; }
.input.code { font-family: var(--mono); letter-spacing: 2px; max-width: 180px; }
.form { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.secret { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; word-break: break-all; padding: 12px; border-radius: 8px; background: #0b0b0b; border: 1px solid var(--line-strong); }

.notice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--info-fill); border: 1px solid var(--info-line); color: #cfe3fa; line-height: 1.5; }
.notice svg { flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.notice.error { background: var(--bad-fill); border-color: #5c2320; color: #ffd0cc; }
.notice.error svg { color: var(--bad); }
.notice.ok { background: var(--ok-fill); border-color: #1d4a22; color: #c8f3ca; }
.notice.ok svg { color: var(--ok); }
.error-text { color: var(--bad); font-size: 12px; }

.switch { width: 52px; min-height: 44px; padding: 0; border: none; background: transparent; display: inline-flex; align-items: center; cursor: pointer; }
.switch .track { width: 44px; height: 26px; padding: 3px; border-radius: 13px; background: #3a3a3a; display: flex; align-items: center; transition: background 120ms ease; }
.switch .knob { width: 20px; height: 20px; border-radius: 10px; background: #fff; transition: transform 120ms ease; }
.switch[aria-checked="true"] .track { background: var(--accent-fill); }
.switch[aria-checked="true"] .knob { transform: translateX(18px); }
.pending { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 10px; background: var(--info-fill); border: 1px solid var(--info-line); }
.pending .input { flex-grow: 1; min-width: 0; border-color: #2a4a6e; background: #0b1522; }

.changes { list-style: none; margin: 0; padding: 0; }
.changes li { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--line); }
.changes li strong { font-weight: 500; }
.loading { color: var(--text-3); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; }
  .brand { padding: 0 8px 0 0; }
  .nav-section, .spacer { display: none; }
  .chip { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; }
  .main { padding: 24px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .item { flex-wrap: wrap; }
  .table { display: block; overflow-x: auto; }
}
.mono { font-family: var(--mono); }
.steps { margin: 0 0 16px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; color: var(--text-2); }
.copy-row { display: flex; gap: 8px; margin-bottom: 12px; }
.copy-row .input { flex: 1; min-width: 0; font-size: 13px; }

/* People: waiting-list counts and search (ALL-2101) */
.stats { display: flex; gap: 40px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.search-row { display: flex; gap: 8px; }
.search-row .input { flex: 1; min-width: 0; }
.who { display: flex; flex-direction: column; gap: 2px; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.table .has-answers > * { padding-bottom: 4px; }
.table .answers-row td { border-top: none; padding-top: 0; }
.answers summary { cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 500; min-height: 24px; }
.answers dl { margin: 6px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; font-size: 13px; font-weight: 400; max-width: 520px; }
.answers dl > div { display: contents; }
.answers dt { color: var(--text-3); }
.answers dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Join page and privacy notice (public) */
.join { min-height: 100vh; display: flex; justify-content: center; padding: 48px 16px; }
.join-card { width: min(560px, 100%); display: flex; flex-direction: column; gap: 20px; }
.join-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.join-brand img { width: 30px; height: 30px; }
.join h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.3px; text-wrap: balance; }
.join h1:focus { outline: none; } /* focused by script when a step changes, for screen readers */
.join h2 { margin: 8px 0 0; font-size: 16px; font-weight: 600; }
.join p, .join li { margin: 0; line-height: 1.6; color: var(--text-2); }
.join ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
textarea.input { min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; font: inherit; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
legend { padding: 0 0 8px; font-size: 13px; font-weight: 500; color: #d6d6d6; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid #333; background: #0b0b0b; cursor: pointer; font-weight: 500; }
.choice:has(input:checked) { border-color: var(--accent-fill); background: var(--selected); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice input { margin: 0; accent-color: var(--accent-fill); }
.check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; cursor: pointer; }
.check input { margin: 4px 0 0; accent-color: var(--accent-fill); }
