/* Holla: warm ember dark. Video is the hero; the UI stays quiet around it. */

:root {
  --ink: #17120e;
  --surface: #221a14;
  --surface-2: #2c221a;
  --line: rgba(247, 239, 229, 0.14);
  --cream: #f7efe5;
  --muted: #b8a897;
  --amber: #ffad4d;
  --amber-deep: #e8871e;
  --green: #6fd49b;
  --red: #f2594b;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* CSS display values override the hidden attribute; this puts hidden back in
   charge everywhere, including inline SVG icon swaps. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  background: var(--ink);
  color: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 6px;
}

.screen {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
}

/* ============ LOBBY ============ */

#screen-lobby {
  overflow-y: auto;
  background:
    radial-gradient(90rem 50rem at 85% -20%, rgba(255, 173, 77, 0.13), transparent 60%),
    radial-gradient(60rem 40rem at -10% 110%, rgba(232, 135, 30, 0.08), transparent 55%),
    var(--ink);
}

.lobby-inner {
  max-width: 34rem;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(1.5rem + var(--safe-top)) 1.5rem calc(1.5rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center; /* keeps the top reachable when content outgrows the viewport */
  gap: 1.75rem;
}

/* Sunlit illustration framed like a call tile: same radius, border, amber glow. */
.lobby-hero {
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  box-shadow: 0 0 0 1px rgba(255, 173, 77, 0.22), 0 18px 44px -18px rgba(232, 135, 30, 0.4);
  line-height: 0;
}

.lobby-hero img {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-height: 740px) {
  .lobby-hero img {
    max-height: 30vh;
    object-fit: cover;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}

.brand-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 173, 77, 0.18);
}

.lobby-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 10vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.lobby-title em {
  font-style: normal;
  color: var(--amber);
}

.lobby-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 30rem;
}

.lobby-actions { display: flex; flex-direction: column; gap: 1.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
  touch-action: manipulation;
  user-select: none;
}

.btn:active { transform: scale(0.97); }

.btn svg { width: 1.15em; height: 1.15em; flex: none; }

.btn-primary {
  background: var(--amber);
  color: var(--ink);
}

.btn-primary:hover { background: #ffbd70; }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--line);
  color: var(--cream);
}

.btn-ghost:hover { border-color: rgba(247, 239, 229, 0.35); }

.btn-big {
  font-size: 1.15rem;
  min-height: 58px;
  padding: 0.9rem 2rem;
  align-self: flex-start;
}

.join-form { display: flex; flex-direction: column; gap: 0.5rem; }

.join-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.join-row { display: flex; gap: 0.6rem; }

.join-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--cream);
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
}

.join-row input::placeholder { color: rgba(184, 168, 151, 0.7); }

.join-row input:focus {
  outline: none;
  border-color: var(--amber);
}

.join-error { color: var(--red); font-size: 0.9rem; }

.lobby-foot { color: rgba(184, 168, 151, 0.65); font-size: 0.85rem; }

/* ============ CALL SCREEN ============ */

/* Width the side panel takes from the call area. Zero until the panel docks,
   which only happens from tablet width up; on a phone it covers instead. */
#screen-call {
  background: var(--ink);
  --rail: 0px;
}

.solo {
  position: absolute;
  inset: 0;
  right: var(--rail);
}

/* The main remote video keeps its true shape (no face-cropping zoom when a
   portrait phone meets a landscape screen); a blurred copy of the same feed
   fills the letterbox space so it never looks like black bars. */

#remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#remote-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(42px) brightness(0.4) saturate(1.15);
  transform: scale(1.18);
}

.remote-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(23, 18, 14, 0.5), transparent 22%),
    linear-gradient(transparent 70%, rgba(23, 18, 14, 0.65));
}

/* waiting overlay + the ringing ripple signature */

.wait-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  /* Bottom padding keeps the share card clear of the control bar, which is
     visible on this screen too. */
  padding: 1.5rem 1.5rem calc(7.5rem + var(--safe-bottom));
  background:
    radial-gradient(70rem 45rem at 50% -15%, rgba(255, 173, 77, 0.1), transparent 60%),
    rgba(23, 18, 14, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ripple-stage {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  display: grid;
  place-items: center;
}

.ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 173, 77, 0.55);
  opacity: 0;
  transform: scale(0.4);
}

.ripple-core {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 40px rgba(255, 173, 77, 0.5);
}

.wait-status {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--cream);
}

.share-card {
  width: min(24rem, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.share-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.share-code {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  letter-spacing: -0.01em;
  color: var(--amber);
  word-break: break-word;
}

.share-buttons {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-hint { color: var(--muted); font-size: 0.88rem; }

.end-message { font-size: 1.1rem; }

/* group grid (3+ people) */

.stage {
  position: absolute;
  inset: 0;
  right: var(--rail);
  padding: calc(3.6rem + var(--safe-top)) 0.6rem calc(6.2rem + var(--safe-bottom));
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr; /* rows share the viewport height, so any count fits */
}

.stage.cols-1 { grid-template-columns: 1fr; }
.stage.cols-3 { grid-template-columns: repeat(3, 1fr); }

.tile {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--line);
  min-height: 0;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile.is-me video { transform: scaleX(-1); }
.tile.is-me.rear-facing video { transform: none; }

.tile.speaking {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber), 0 0 26px rgba(255, 173, 77, 0.35);
}

.tile-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 18, 14, 0.75);
  color: var(--red);
}

.tile-badge svg { width: 14px; height: 14px; }

.tile-net {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 18, 14, 0.75);
  color: var(--amber);
}

.tile-net.lost { color: var(--red); }

.tile-net svg { width: 14px; height: 14px; }

.tile-cam-off {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

/* initials avatar (audio view when the camera is off) */
.avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.01em;
  line-height: 1;
  user-select: none;
}

.avatar-xl { width: 128px; height: 128px; font-size: 52px; }

.stage.cols-3 .tile-cam-off .avatar { width: 46px; height: 46px; font-size: 19px; }
.focus-strip .tile-cam-off .avatar { width: 40px; height: 40px; font-size: 16px; }

.tile-name {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 16px);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(23, 18, 14, 0.6);
  color: var(--cream);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.focus-strip .tile-name { font-size: 0.62rem; bottom: 4px; }

.remote-avatar-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ink);
}

.remote-name {
  position: absolute;
  bottom: calc(5.6rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.7);
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 15;
  max-width: 80vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.local-avatar-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

.local-avatar-wrap .avatar { width: 40px; height: 40px; font-size: 16px; }

.name-field { display: flex; flex-direction: column; gap: 0.5rem; }

.name-field input {
  min-height: 48px;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}

.name-field input:focus { outline: none; border-color: var(--amber); }
.name-field input::placeholder { color: rgba(184, 168, 151, 0.7); }
.name-field-center input { text-align: center; }

/* focus mode: someone is sharing, or someone is pinned */

.focus {
  position: absolute;
  inset: 0;
  right: var(--rail);
  display: flex;
  flex-direction: column;
  background: #000;
}

.focus-main {
  position: relative;
  flex: 1;
  min-height: 0;
}

.focus-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* A shared screen is letterboxed against a flat backdrop; a face is not. */
.focus-video.is-screen { object-fit: contain; }
.focus-video.mirrored { transform: scaleX(-1); }

.focus-avatar-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}

.focus-bar {
  position: absolute;
  top: calc(3.4rem + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 20;
  max-width: calc(100% - 1.6rem);
}

.focus-label {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.8);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.8);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.chip-btn:hover { border-color: rgba(247, 239, 229, 0.35); }
.chip-btn svg { width: 14px; height: 14px; }

.focus-strip {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem calc(5.4rem + var(--safe-bottom));
  overflow-x: auto;
  scrollbar-width: none;
  flex: none;
}

.focus-strip::-webkit-scrollbar { display: none; }

.focus-strip .tile {
  flex: none;
  width: 96px;
  aspect-ratio: 3 / 4;
  cursor: pointer;
}

/* a screen in the strip keeps its real shape rather than being cropped */
.focus-strip .tile.is-screen-tile { width: 132px; aspect-ratio: 16 / 9; }
.tile video.is-screen { object-fit: contain; background: #000; }

/* pin control on every tile */

.tile-pin {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 18, 14, 0.72);
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.tile-pin svg { width: 14px; height: 14px; }
.tile:hover .tile-pin,
.tile-pin:focus-visible { opacity: 1; }
.tile-pin.is-pinned { opacity: 1; background: var(--amber); color: var(--ink); }

/* touch devices have no hover, so the affordance is always there */
@media (hover: none) {
  .tile-pin { opacity: 0.9; }
}

/* local preview tile */

.local-tile {
  position: absolute;
  top: calc(0.9rem + var(--safe-top));
  right: 0.9rem;
  width: clamp(88px, 26vw, 150px);
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  background: var(--surface);
  touch-action: none;
  cursor: grab;
  z-index: 30;
}

.local-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.local-tile.rear-facing video { transform: none; }

.local-muted-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 18, 14, 0.75);
  color: var(--red);
}

.local-muted-badge svg { width: 14px; height: 14px; }

/* status chip */

.status-chip {
  position: absolute;
  top: calc(0.9rem + var(--safe-top));
  left: calc(50% - var(--rail) / 2);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 20;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}

.status-chip.is-live .status-dot { background: var(--green); }
.status-chip.is-trouble .status-dot { background: var(--red); }

.call-timer {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* control bar */

.controls {
  position: absolute;
  bottom: calc(1.2rem + var(--safe-bottom));
  left: calc(50% - var(--rail) / 2);
  transform: translateX(-50%);
  display: flex;
  gap: 0.55rem;
  padding: 0.6rem;
  max-width: calc(100vw - 1rem);
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  z-index: 20;
}

.ctl {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.ctl:active { transform: scale(0.92); }

.ctl svg { width: 22px; height: 22px; }

.ctl[aria-pressed='true'] {
  background: var(--cream);
  color: var(--ink);
}

.ctl-danger {
  background: var(--red);
  color: #fff;
}

.ctl-danger:hover { background: #ff6d60; }

/* recording */

.rec-chip {
  position: absolute;
  top: calc(0.9rem + var(--safe-top));
  left: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(242, 89, 75, 0.5);
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  z-index: 20;
}

.rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--red);
  animation: rec-pulse 1.4s ease-in-out infinite;
}

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

.ctl.recording {
  background: var(--red);
  color: #fff;
}

.rec-saved {
  position: absolute;
  bottom: calc(6.8rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(22rem, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.rec-saved-meta { color: var(--muted); font-size: 0.88rem; }

/* toast */

.toast {
  position: fixed;
  bottom: calc(6.5rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--cream);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  z-index: 60;
  max-width: min(90vw, 26rem);
  text-align: center;
}

/* control bar extras: count badge, unread dot */

.ctl { position: relative; flex: none; }

.ctl-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--cream);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.ctl-badge-dot {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
  background: var(--amber);
  border-color: var(--ink);
}

.ctl[aria-pressed='true'] .ctl-badge {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* overflow menu */

.more-menu {
  position: absolute;
  bottom: calc(5.6rem + var(--safe-bottom));
  left: calc(50% - var(--rail) / 2);
  transform: translateX(-50%);
  width: min(15rem, calc(100vw - 2rem));
  padding: 0.4rem;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 45;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
}

.more-item:hover { background: var(--surface-2); }
.more-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.more-item.is-recording svg { color: var(--red); }
.more-item:disabled { opacity: 0.5; cursor: default; }

/* live captions */

.captions {
  position: absolute;
  bottom: calc(5.8rem + var(--safe-bottom));
  left: calc(50% - var(--rail) / 2);
  transform: translateX(-50%);
  width: min(46rem, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: rgba(23, 18, 14, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 25;
  pointer-events: none;
}

.caption-line {
  font-size: 1rem;
  line-height: 1.35;
  color: var(--cream);
}

.caption-who {
  color: var(--muted);
  font-weight: 700;
  margin-right: 0.5rem;
}

/* side panel: people + notes */

.panel {
  position: absolute;
  inset: auto 0 0 0;
  height: min(62vh, 30rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.panel-tabs { display: flex; gap: 0.3rem; }

.panel-tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.panel-tab[aria-selected='true'] {
  background: var(--surface-2);
  color: var(--cream);
}

.panel-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.panel-close:hover { background: var(--surface-2); color: var(--cream); }
.panel-close svg { width: 18px; height: 18px; }

.panel-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.6rem;
}

.panel-pane-notes {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

/* people list */

.people-list { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }

.person {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  row-gap: 0.45rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  flex-wrap: wrap;
}

.person:hover { background: var(--surface-2); }

.person-avatar { width: 36px; height: 36px; font-size: 14px; flex: none; }

/* The name keeps a readable minimum. When the actions no longer fit beside it
   they wrap to their own line rather than crushing the name to one letter. */
.person-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 7rem;
}

.person-name,
.person-status {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-name { font-size: 0.95rem; font-weight: 600; }
.person-status { font-size: 0.78rem; color: var(--muted); }

.person-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.person-action {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.person-action:hover { border-color: rgba(247, 239, 229, 0.35); color: var(--cream); }

.person-action-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

.person-rename {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  margin-top: 0.4rem;
}

.person-rename input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}

.person-rename input:focus { outline: none; border-color: var(--amber); }

/* people waiting to be let in */

.knock-group {
  padding: 0.3rem 0.3rem 0.7rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.person.is-waiting { background: rgba(255, 173, 77, 0.08); }

/* A count that needs answering, not just reporting. */
.ctl-badge.needs-attention {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--ink);
}

/* notes */

.notes-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.notes-empty {
  padding: 0 0.9rem 0.8rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.note { display: flex; flex-direction: column; gap: 0.15rem; }

.note-head { display: flex; align-items: baseline; gap: 0.5rem; }

.note-who { font-size: 0.82rem; font-weight: 700; }
.note.is-mine .note-who { color: var(--amber); }
.note-when { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.note-body { font-size: 0.95rem; overflow-wrap: anywhere; }

.notes-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-top: 1px solid var(--line);
  flex: none;
}

.notes-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}

.notes-form input:focus { outline: none; border-color: var(--amber); }
.notes-form input::placeholder { color: rgba(184, 168, 151, 0.7); }

.notes-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--amber);
  color: var(--ink);
  flex: none;
}

.notes-send svg { width: 18px; height: 18px; }

.notes-foot {
  display: flex;
  gap: 1rem;
  padding: 0 0.9rem calc(0.8rem + var(--safe-bottom));
  flex: none;
}

.link-btn {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  padding: 0;
}

.link-btn:hover { color: var(--cream); }

/* reactions and raised hands */

.reaction-layer {
  position: absolute;
  inset: 0;
  right: var(--rail);
  pointer-events: none;
  overflow: hidden;
  z-index: 35;
}

.reaction-float {
  position: absolute;
  bottom: calc(7rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.reaction-glyph { font-size: 2.4rem; line-height: 1; }

.reaction-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cream);
  background: rgba(23, 18, 14, 0.7);
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.reaction-picker {
  position: absolute;
  bottom: calc(5.6rem + var(--safe-bottom));
  left: calc(50% - var(--rail) / 2);
  transform: translateX(-50%);
  padding: 0.5rem;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 45;
}

.reaction-options { display: flex; gap: 0.2rem; }

.reaction-option {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.55rem;
  line-height: 1;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.reaction-option:hover { background: var(--surface-2); transform: translateY(-2px); }
.reaction-option:active { transform: scale(0.92); }

/* The hand belongs with the reactions, but it is a state rather than a moment,
   so it gets a label and a count instead of being one more emoji. */
.reaction-hand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  font-size: 0.9rem;
  font-weight: 600;
}

.reaction-hand:hover { background: var(--surface-2); }
.reaction-hand svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.reaction-hand.is-raised svg { color: var(--amber); }

.reaction-hand-count {
  margin-left: auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--amber);
  color: var(--ink);
  font-size: 0.72rem;
  line-height: 18px;
  text-align: center;
}

/* Somebody has a hand up, so the control that reveals it says so. */
.ctl.has-hands { box-shadow: inset 0 0 0 2px var(--amber); }

/* One-on-one and focus views have no tile for the person on screen, so the hand
   gets its own chip rather than going unseen. */
.solo-hand {
  position: absolute;
  bottom: calc(8.4rem + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(34, 26, 20, 0.85);
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 16;
}

.solo-hand svg { width: 15px; height: 15px; }

.focus-hand { border-color: var(--amber); color: var(--amber); }

.tile-hand {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(23, 18, 14, 0.75);
  color: var(--amber);
}

.tile-hand svg { width: 14px; height: 14px; }

.more-item.is-on svg { color: var(--amber); }

/* settings pane */

.setting-group {
  padding: 0.9rem 0.3rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.setting-group:last-child { border-bottom: 0; }

.setting-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.45rem 0;
}

.setting-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.92rem;
  font-weight: 500;
  min-width: 0;
}

.setting-hint {
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.35;
}

/* Device names are long and get truncated beside their label, so those rows
   stack and give the select the full width. */
.setting-row-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
}

.setting-select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--cream);
  font: inherit;
  font-size: 0.88rem;
}

.setting-select:focus { outline: none; border-color: var(--amber); }
.setting-select:disabled { opacity: 0.5; }

/* Prose, not a column of figures: tabular numerals would pad the decimal
   point out to a full digit width and read as "2 . 0 MB". */
.setting-readout {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.setting-action {
  width: 100%;
  min-height: 42px;
  margin-top: 0.5rem;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cream);
}

.setting-action:hover { border-color: rgba(247, 239, 229, 0.35); }
.setting-action:disabled { opacity: 0.5; }

/* on/off switch */

.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.18s ease, background-color 0.18s ease;
}

.switch.is-on { background: var(--amber); border-color: var(--amber); }
.switch.is-on .switch-knob { transform: translateX(20px); background: var(--ink); }
.switch:disabled { opacity: 0.6; }

.person-action-danger { color: var(--red); border-color: rgba(242, 89, 75, 0.45); }
.person-action-danger:hover { border-color: var(--red); color: var(--red); }

/* from tablet width the panel docks and the call gives up the space */

@media (min-width: 900px) {
  #screen-call.panel-open { --rail: 21rem; }

  .panel {
    inset: 0 0 0 auto;
    width: 21rem;
    height: auto;
    border-top: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  .notes-foot { padding-bottom: 0.8rem; }
}

/* narrow phones: shrink the controls so the whole bar still fits */

@media (max-width: 430px) {
  .controls {
    gap: 0.35rem;
    padding: 0.45rem;
    /* A phone shows seven controls and they fit. If a narrow window ever ends
       up with more, the bar scrolls rather than clipping "end call" off the
       edge where nobody can reach it. */
    overflow-x: auto;
    scrollbar-width: none;
  }

  .controls::-webkit-scrollbar { display: none; }

  .ctl { width: 44px; height: 44px; }
  .ctl svg { width: 19px; height: 19px; }
}

/* wider screens: give the lobby air, cap card width */

@media (min-width: 900px) {
  .lobby-inner { max-width: 40rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
