/* Sign-in, choosing a password, and the team's pages (Team, Activity) on the live prototype.
   The sign-in look is the review site's screen (prototype/site/sign-in.html); the team's pages
   use the surface's cards, tables and chips. */

/* ── Sign in, choose a password ── */
body.bx-surface .si { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; box-sizing: border-box; }
body.bx-surface .si-box { width: min(25rem, 100%); }
body.bx-surface .si-logo { display: block; width: 120px; height: 24px; margin: 0 auto 1.75rem; filter: invert(1); }
body.bx-surface .si-card h1 { margin: 0 0 0.3rem; font-size: 1.375rem; color: var(--s-ink); }
body.bx-surface .si-card p { margin: 0 0 1.25rem; }
body.bx-surface .si-card label { display: block; margin: 0.9rem 0 0.3rem; font-size: 0.875rem; font-weight: 600; color: var(--s-ink); }
body.bx-surface .si-card input { width: 100%; box-sizing: border-box; font: inherit; padding: 0.6rem 0.7rem; border: 1px solid var(--s-border); border-radius: var(--s-r-sm); color: var(--s-text); background: var(--s-surface); }
body.bx-surface .si-card .bx-btn { width: 100%; margin-top: 1.4rem; justify-content: center; text-align: center; }
body.bx-surface .si-card p.si-hint { margin: 0.3rem 0 0; font-size: 0.8125rem; color: var(--s-muted); }
body.bx-surface .si-card p.si-error { margin: 0.9rem 0 0; font-size: 0.875rem; font-weight: 600; color: var(--s-err); }
body.bx-surface .si-error[hidden], body.bx-surface .si-out[hidden], body.bx-surface .si-card[hidden] { display: none; }
body.bx-surface .si-out { margin-bottom: 1rem; padding: 0.6rem 0.8rem; border-radius: var(--s-r-sm); background: var(--s-ok-bg); color: var(--s-ok); font-size: 0.875rem; font-weight: 600; }
body.bx-surface .si-foot { margin-top: 1rem; text-align: center; font-size: 0.8125rem; }

/* ── The team's pages ── */
body.bx-surface .tm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
body.bx-surface .tm-section { margin-top: 1.5rem; }
body.bx-surface .tm-section > h2 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--s-ink); }
body.bx-surface .tm-note { margin: 0; font-size: 0.875rem; color: var(--s-muted); }
body.bx-surface .tm-empty { padding: 1rem 0.75rem; color: var(--s-muted); font-size: 0.875rem; }
body.bx-surface .tm-muted { color: var(--s-muted); }
body.bx-surface .tm-small { font-size: 0.8125rem; }
body.bx-surface .tm-nowrap { white-space: nowrap; }
body.bx-surface .tm-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: flex-end; }
body.bx-surface .tm-actions .bx-btn { min-height: 2rem; padding: 0.3rem 0.7rem; font-size: 0.8125rem; }
body.bx-surface .bx-table tr.is-off td { opacity: 0.55; }

/* Adding a person */
body.bx-surface .tm-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 0.75rem; align-items: end; }
body.bx-surface .tm-form label { display: block; margin: 0 0 0.3rem; font-size: 0.8125rem; font-weight: 600; color: var(--s-ink); }
body.bx-surface .tm-form input, body.bx-surface .tm-form select { width: 100%; box-sizing: border-box; font: inherit; font-size: 0.875rem; padding: 0.5rem 0.6rem; border: 1px solid var(--s-border); border-radius: var(--s-r-sm); color: var(--s-text); background: var(--s-surface); }
body.bx-surface .tm-error { margin: 0.75rem 0 0; font-size: 0.875rem; font-weight: 600; color: var(--s-err); }
body.bx-surface .tm-error[hidden], body.bx-surface .tm-link[hidden] { display: none; }

/* A sign-in link to send */
body.bx-surface .tm-link { margin-top: 1rem; padding: 0.9rem 1rem; border-radius: var(--s-r-md); background: var(--s-navy-tint); }
body.bx-surface .tm-link p { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--s-text); }
body.bx-surface .tm-link-row { display: flex; gap: 0.5rem; }
body.bx-surface .tm-link-row input { flex: 1; min-width: 0; font-family: var(--s-mono); font-size: 0.8125rem; padding: 0.45rem 0.6rem; border: 1px solid var(--s-border); border-radius: var(--s-r-sm); background: var(--s-surface); color: var(--s-text); }

/* Activity */
body.bx-surface .ac-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
body.bx-surface .ac-stat { padding: 0.9rem 1rem; }
body.bx-surface .ac-stats .bx-card + .bx-card { margin-top: 0; }
body.bx-surface .ac-stat b { display: block; font-size: 1.5rem; line-height: 1.2; color: var(--s-ink); font-variant-numeric: tabular-nums; }
body.bx-surface .ac-stat span { font-size: 0.8125rem; color: var(--s-muted); }
body.bx-surface .ac-stat.is-alert b { color: var(--s-err); }
body.bx-surface .bx-table tr.ac-row { cursor: pointer; }
body.bx-surface .bx-table tr.ac-row:hover { background: var(--s-well); }
body.bx-surface .bx-table tr.ac-row.is-open { background: var(--s-navy-tint); }
body.bx-surface .bx-table td.is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.bx-surface .bx-table th.is-num { text-align: right; }
body.bx-surface .ac-flags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
body.bx-surface .ac-detail td { padding: 0; background: var(--s-well); }
body.bx-surface .ac-convo { padding: 1rem 1.25rem 1.25rem; }
body.bx-surface .ac-convo + .ac-convo { border-top: 1px solid var(--s-border); }
body.bx-surface .ac-convo h3 { margin: 0 0 0.75rem; font-size: 0.9375rem; color: var(--s-ink); }
body.bx-surface .ac-msg { margin: 0 0 0.6rem; padding: 0.6rem 0.8rem; border-radius: var(--s-r-md); background: var(--s-surface); border: 1px solid var(--s-border); font-size: 0.875rem; white-space: pre-wrap; }
body.bx-surface .ac-msg.is-user { border-color: var(--s-navy); }
body.bx-surface .ac-msg.is-record { background: transparent; border-style: dashed; color: var(--s-muted); font-size: 0.8125rem; }
body.bx-surface .ac-msg-who { display: block; margin-bottom: 0.2rem; font-family: var(--s-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--s-muted); }
body.bx-surface .ac-turn { margin: -0.3rem 0 0.75rem; font-size: 0.75rem; color: var(--s-muted); }
body.bx-surface .ac-turn .bx-chip { margin-right: 0.3rem; }
body.bx-surface .ac-turn .is-note { display: block; margin-top: 0.2rem; color: var(--s-err); }
body.bx-surface .ac-filter { display: flex; gap: 0.5rem; align-items: center; font-size: 0.875rem; color: var(--s-muted); }
body.bx-surface .ac-filter select { font: inherit; font-size: 0.875rem; padding: 0.35rem 0.5rem; border: 1px solid var(--s-border); border-radius: var(--s-r-sm); background: var(--s-surface); color: var(--s-text); }

@media (max-width: 760px) {
  body.bx-surface .tm-form { grid-template-columns: 1fr; }
  body.bx-surface .ac-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.bx-surface .bx-table { display: block; overflow-x: auto; }
}

/* Dark mode (prototype/site/theme.css re-points the surface tokens; server.py links it on these pages).
   What is left is what the tokens do not reach. */
@media screen {
  /* The wordmark is a dark image: drawn light, as in the top bar. */
  html[data-theme="dark"] body.bx-surface .si-logo { filter: brightness(0) invert(0.94); }
  html[data-theme="dark"] body.bx-surface :is(.si-card input, .tm-form input, .tm-form select, .tm-link-row input, .ac-filter select):focus { outline-color: var(--s-navy); }
  html[data-theme="dark"] body.bx-surface :is(.si-card input, .tm-form input, .tm-link-row input)::placeholder { color: #6b7890; }
}

/* ── Admin: its two tabs, as the surface's segmented control (.bx-seg), and their panes ── */
body.bx-surface .ad-tabs { margin-bottom: 1.25rem; }
body.bx-surface .ad-tabs a { padding: 0.35rem 0.9rem; border-radius: 4px; font-size: 0.875rem; font-weight: 600; color: var(--s-muted); text-decoration: none; }
body.bx-surface .ad-tabs a:hover { color: var(--s-ink); }
body.bx-surface .ad-tabs a.is-on { background: var(--s-ink); color: var(--s-on-navy); }
body.bx-surface .ad-pane[hidden] { display: none; }
body.bx-surface .ad-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
body.bx-surface .ad-h2 { margin: 0 0 0.9rem; font-size: 1rem; color: var(--s-ink); }
body.bx-surface .bx-card.ad-table { padding: 0; overflow: hidden; }
body.bx-surface .ac-convo h3 { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
body.bx-surface .ac-convo .ac-open, body.bx-surface .ac-asked .bx-btn { min-height: 1.9rem; padding: 0.25rem 0.7rem; font-size: 0.8125rem; font-weight: 600; }
