/* ============================================================
   huddle — design system
   Direction: a small broadcast studio. The meeting room is treated
   as a stage: deep blue-charcoal surfaces, one amber "on air" lamp
   color for everything live (the brand dot, the speaking ring, the
   in-call badge, focus), a geometric display face for signage, and
   a quiet body face for everything else. Boldness is spent once —
   in the display typography; every other surface stays disciplined.
   ============================================================ */

:root {
  color-scheme: dark;

  /* Surfaces */
  --stage: #10131a;      /* page background */
  --panel: #1a1f2b;      /* raised surfaces */
  --panel-raise: #232a3a;
  --well: #0b0e14;       /* recessed: inputs, video mats */
  --line: #2c3547;      /* hairlines and borders */

  /* Ink */
  --text: #e9edf5;
  --muted: #97a0b5;

  /* The one accent: the on-air lamp */
  --on-air: #ffb454;
  --on-air-dim: rgba(255, 180, 84, 0.16);
  --danger: #f2636a;
  --e2ee: #4fd7a5;
  --e2ee-dim: rgba(79, 215, 165, 0.16);

  /* Type */
  --font-display: "Futura", "Avenir Next", "Century Gothic",
    "Trebuchet MS", "DejaVu Sans", sans-serif;
  --font-body: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial,
    "DejaVu Sans", sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-hero: clamp(2.5rem, 6vw, 4.25rem);

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  /* Shape */
  --r-s: 8px;
  --r-m: 14px;
  --r-pill: 999px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--stage);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.5;
}

/* One focus treatment everywhere: the on-air lamp outline. */
:focus-visible {
  outline: 2px solid var(--on-air);
  outline-offset: 2px;
  border-radius: var(--r-s);
}

::selection {
  background: var(--on-air-dim);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- shared utilities ---------- */

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4) var(--sp-7);
}

.page.center {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--sp-4);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--sp-3);
  letter-spacing: 0.01em;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--sp-4);
}

/* The on-air dot: the brand mark, the live indicator. */
.on-air-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--on-air);
  margin-right: var(--sp-2);
  vertical-align: baseline;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-lg);
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* Buttons: pill controls, like studio hardware. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease;
}

.btn:hover {
  background: var(--panel-raise);
  border-color: var(--muted);
}

.btn.primary {
  background: var(--on-air);
  border-color: transparent;
  color: #17120a;
  font-weight: 600;
}

.btn.primary:hover {
  background: #ffc26e;
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn.danger:hover {
  background: rgba(242, 99, 106, 0.12);
}

.btn.small {
  padding: var(--sp-1) var(--sp-4);
  font-size: var(--fs-sm);
}

.btn.large {
  padding: var(--sp-3) var(--sp-6);
  font-size: var(--fs-lg);
}

/* Toggles show their off state: dimmed, dashed — clearly "muted". */
.btn.toggle.is-off {
  border-style: dashed;
  color: var(--muted);
  background: transparent;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Status chips (meeting state, schedule hints). */
.chip {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--muted);
  white-space: nowrap;
}

.chip-open {
  color: var(--on-air);
  border-color: var(--on-air);
  background: var(--on-air-dim);
}

.chip-not-yet {
  color: var(--text);
}

.chip-ended,
.chip-cancelled {
  color: var(--danger);
  border-color: var(--danger);
}

/* Fields */
.field {
  display: block;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field select {
  display: block;
  width: 100%;
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: 400;
}

.field-error {
  margin: calc(-1 * var(--sp-2)) 0 var(--sp-4);
  color: var(--danger);
  font-size: var(--fs-sm);
}

/* Banners: a refusal with a way forward. */
.banner {
  margin-top: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  border-left: 3px solid var(--on-air);
  background: var(--panel);
}

.banner-title {
  margin: 0 0 var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
}

.banner-detail {
  margin: 0 0 var(--sp-4);
  color: var(--muted);
}

.banner-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: var(--sp-6) var(--sp-5);
  max-width: 560px;
  width: 100%;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--on-air);
  animation: spin 0.9s linear infinite;
}

.spinner.large {
  width: 32px;
  height: 32px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- site chrome ---------- */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.site-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.site-links a {
  color: var(--text);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}

.site-links a:hover {
  border-bottom-color: var(--on-air);
}

/* ---------- landing ---------- */

.hero {
  padding: var(--sp-7) 0 var(--sp-6);
  max-width: 640px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 var(--sp-5);
}

.hero-lede {
  font-size: var(--fs-lg);
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 var(--sp-6);
}

.hero-actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.join-strip {
  max-width: 640px;
  padding: var(--sp-5) 0;
  border-top: 1px solid var(--line);
}

.join-strip h2 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  margin: 0 0 var(--sp-4);
}

.join-form {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.join-form input {
  flex: 1 1 240px;
  padding: var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-base);
}

.site-foot {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
}

/* ---------- auth ---------- */

.auth .site-nav {
  margin-bottom: var(--sp-4);
}

.auth-card {
  margin: 0 auto;
}

.auth-card form {
  margin-top: var(--sp-4);
}

.auth-card .btn {
  width: 100%;
}

/* ---------- dashboard ---------- */

.dashboard .panel {
  margin-top: var(--sp-5);
}

.create-form {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  align-items: end;
}

.create-form .field {
  flex: 1 1 180px;
  margin-bottom: var(--sp-4);
}

.meeting-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.meeting-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.meeting-row-main {
  min-width: 220px;
  flex: 1 1 220px;
}

.meeting-title {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.meeting-when {
  margin: var(--sp-1) 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.meeting-code-line {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.meeting-row-passcode {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.meeting-row-passcode input {
  max-width: 12em;
}

.meeting-row-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-left: auto;
}

/* ---------- prejoin ---------- */

.prejoin {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
  gap: var(--sp-6);
  align-items: start;
}

.schedule-hint {
  color: var(--muted);
  margin: 0 0 var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.schedule-hint code {
  font-size: var(--fs-sm);
  background: var(--well);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-s);
}

.preview-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: var(--well);
  overflow: hidden;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  text-align: center;
  padding: var(--sp-4);
  background: rgba(11, 14, 20, 0.82);
}

.overlay-title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.overlay-detail {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  max-width: 46ch;
}

.prejoin-toggles {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  flex-wrap: wrap;
}

.prejoin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: var(--sp-5);
}

.prejoin-panel .join {
  width: 100%;
  margin-top: var(--sp-2);
}

/* ---------- audio settings (issue #34) ---------- */

/* The AEC / noise-suppression toggles: prejoin panel (block) and the
   in-call footer (inline, no bottom margin). */
.audio-settings {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.audio-setting {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.audio-setting input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--on-air);
}

.audio-hint {
  margin: calc(-1 * var(--sp-2)) 0 var(--sp-4);
  font-size: var(--fs-sm);
}

.call-controls .audio-settings {
  margin: 0;
}

/* ---------- the call ---------- */

.call {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  gap: var(--sp-3);
}

.call-header {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  min-height: 44px;
}

/* The in-call badge: an "ON AIR" lamp, the one loud element. */
.on-air {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--on-air);
  border: 1px solid var(--on-air);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-3);
  animation: lamp 2.6s ease-in-out infinite;
}

.on-air .on-air-dot {
  margin: 0;
}

@keyframes lamp {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}

/* The recording badge: consent signage, red to read as "capturing". */
.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-3);
  animation: lamp 2.6s ease-in-out infinite;
}

.recording-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  margin: 0;
  animation: rec-pulse 1.4s ease-in-out infinite;
}

@keyframes rec-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

.call-title {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.call-header [data-testid="call-status"] {
  margin: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.call-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: var(--sp-4);
  min-height: 0;
}

.stage {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  position: relative;
}

/* Adaptive tile grid. `--cols` is set from the tile count in Rust;
   rows share the stage and scroll once the room is big. */
.tiles {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-auto-rows: minmax(180px, 1fr);
  gap: var(--sp-3);
  align-content: start;
}

/* Stage layout: while a screen share is on, the screen tile takes the
   whole first row and everyone else collapses into a strip of small
   tiles below it. One class on the grid drives it all. */
.tiles.has-screen {
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: 120px;
}

.tiles.has-screen .tile.screen {
  grid-column: 1 / -1;
  grid-row: 1;
}

.tiles.has-screen:has(.screen ~ .screen) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tiles.has-screen:has(.screen ~ .screen) .tile.screen {
  grid-column: auto;
  grid-row: auto;
  order: -1;
}

/* Focus-spanning makes no sense inside the strip; keep the ring. */
.tiles.has-screen .tile.focused {
  grid-column: auto;
  grid-row: auto;
}

.tile {
  margin: 0;
  position: relative;
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--panel);
  min-width: 0;
  min-height: 0;
}

.tile video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--well);
}

/* Speaking = your lamp is on: the amber ring. */
.tile.speaking {
  outline: 3px solid var(--on-air);
  outline-offset: -3px;
}

/* Screen tiles stay quiet but distinct: a thin cool line. */
.tile.screen {
  outline: 3px solid var(--line);
  outline-offset: -3px;
}

/* A shared screen must show all of itself: letterbox instead of the
   crop camera tiles use, with the recessed well tone for the bars. */
.tile.screen video {
  object-fit: contain;
}

/* The focused camera tile takes more room and wears the amber ring so
   the selection (and the high simulcast layer it triggers) is visible. */
.tile.focused {
  grid-column: span 2;
  grid-row: span 2;
  outline: 3px solid var(--on-air);
  outline-offset: -3px;
  cursor: pointer;
}

/* Camera tiles are clickable to focus. */
.tile:not(.screen):not(.focused) {
  cursor: pointer;
}

.tile figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: var(--sp-2) var(--sp-3);
  background: rgba(11, 14, 20, 0.72);
  font-size: var(--fs-sm);
}

/* Screen tiles whose share carries computer/tab audio wear a badge, so
   viewers can tell the sound they hear belongs to the share (it plays
   through the screen tile itself, not the sharer's camera tile). The
   same badge marks the sharer's own picture-in-picture. */
.screen-audio-badge {
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--on-air);
  color: var(--well);
  font-size: var(--fs-xs);
}

/* The sharer's picture-in-picture: their own capture, floating above
   the stage with the stop control in reach. */
.share-pip {
  position: absolute;
  right: var(--sp-4);
  bottom: var(--sp-4);
  margin: 0;
  width: min(320px, 36%);
  border: 1px solid var(--on-air);
  border-radius: var(--r-m);
  overflow: hidden;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.share-pip video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--well);
}

.share-pip figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  background: rgba(11, 14, 20, 0.72);
  font-size: var(--fs-sm);
}

/* Sidebar: who's here, then chat. */
.side {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: 0;
}

.side h2 {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 600;
  margin: 0 0 var(--sp-3);
}

.roster-block {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: var(--sp-4);
}

ul[data-testid="roster"] {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

ul[data-testid="roster"] li {
  padding: var(--sp-1) 0;
  border-bottom: 1px solid var(--line);
}

ul[data-testid="roster"] li:last-child {
  border-bottom: none;
}

.chat {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: var(--sp-4);
}

.chat ul[data-testid="chat-log"] {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  min-height: 80px;
  overflow-y: auto;
  line-height: 1.6;
  font-size: var(--fs-sm);
}

.chat ul[data-testid="chat-log"] li {
  padding: var(--sp-1) 0;
  overflow-wrap: anywhere;
}

.chat ul[data-testid="chat-log"] li.system strong {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

.chat-composer {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

.chat-composer input {
  flex: 1;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--well);
  color: var(--text);
  font-family: inherit;
  font-size: var(--fs-sm);
}

.chat-composer .btn {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--fs-sm);
}

/* The control deck. */
.call-controls {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--panel);
  justify-self: center;
}

.call-controls .danger {
  margin-left: auto;
}

/* ---------- end views (left / disconnected) ---------- */

.end-card {
  text-align: left;
}

.end-card.disconnected {
  border-left: 3px solid var(--danger);
}

.end-card [data-testid="call-status"] {
  margin: 0 0 var(--sp-5);
  color: var(--muted);
}

.end-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-5);
  margin: 0 0 var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  background: var(--well);
  border-radius: var(--r-m);
  font-size: var(--fs-sm);
}

.end-info dt {
  color: var(--muted);
  font-weight: 600;
}

.end-info dd {
  margin: 0;
}

.end-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.end-card > .muted {
  font-size: var(--fs-sm);
}

.center-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
}

.center-card .page-title {
  margin: 0;
}

/* ---------- mobile portrait ---------- */

@media (max-width: 720px) {
  .page {
    padding: var(--sp-4) var(--sp-3) var(--sp-6);
  }

  .prejoin {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
  }

  .call {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto auto;
  }

  .call-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .stage {
    min-height: 52vh;
  }

  /* At most two tiles across on a phone, however many people join. */
  .tiles {
    grid-template-columns: repeat(min(var(--cols, 2), 2), minmax(0, 1fr));
    grid-auto-rows: minmax(140px, 1fr);
  }

  .call-controls {
    position: sticky;
    bottom: var(--sp-2);
    justify-self: stretch;
    overflow-x: auto;
  }
}

/* E2EE (issue #27, ADR 010): the trust-mode counterpart of the REC
   badge. Green reads as "protected"; steady (no lamp animation) —
   the server-enforced interlock guarantees it never co-occurs with
   REC. */
.e2ee-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--e2ee);
  border: 1px solid var(--e2ee);
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-3);
}

.chip-e2ee,
.chip-verified {
  color: var(--e2ee);
  border-color: var(--e2ee);
  background: var(--e2ee-dim);
}

/* The safety-number verify dialog (roster affordance). */
.verify-dialog {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  background: var(--panel-raise);
}

.verify-title {
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}

.safety-number {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: var(--fs-xl);
  letter-spacing: 0.08em;
  color: var(--text);
  margin: var(--sp-3) 0;
}

.verify-actions {
  display: flex;
  gap: var(--sp-2);
}
