/* Live waiting room — matches book.psycharts.org / drmattbrown tokens */

:root {
  --background: #f6f6f7;
  --foreground: #111111;
  --muted: #71717a;
  --border: #e4e4e7;
  --accent: #111111;
  --surface: #ffffff;
  --ring: #a1a1aa;
  --slot-bg: #f4f4f5;
  --ok: #166534;
  --ok-bg: #f0fdf4;
  --ok-border: #bbf7d0;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 1.75rem;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.28s;
}

html.dark {
  --background: #0a0a0b;
  --foreground: #f4f4f5;
  --muted: #a1a1aa;
  --border: #27272a;
  --accent: #f4f4f5;
  --surface: #141416;
  --ring: #71717a;
  --slot-bg: #1c1c1f;
  --ok: #86efac;
  --ok-bg: #052e16;
  --ok-border: #14532d;
  --danger: #fca5a5;
  --danger-bg: #450a0a;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #d4d4d8;
  color: #111;
}

html.dark ::selection {
  background: #3f3f46;
  color: #fafafa;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

a {
  color: var(--foreground);
  text-underline-offset: 3px;
  transition: opacity var(--dur) var(--ease);
}

a:hover {
  opacity: 0.8;
}

.wrap {
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1.15rem 5.5rem;
}

@media (min-width: 640px) {
  .wrap {
    max-width: 32rem;
    padding: 2.75rem 1.5rem 6rem;
  }
}

.wrap-wide {
  max-width: 36rem;
}

/* Brand */
.brand.brand-split {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.5rem 1.75rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.brand-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex: 0 0 auto;
  text-align: center;
  max-width: 9.5rem;
}

.brand-logo-link {
  display: block;
  line-height: 0;
  border-radius: 50%;
  margin: 0;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}

.brand-logo-link:hover {
  opacity: 0.88;
}

.brand-logo {
  width: 7.15rem;
  height: auto;
  display: block;
  border-radius: 50%;
}

/* Name under logo — matches booker brand-side kicker */
.brand-side .kicker {
  margin: 0;
  text-align: center;
  width: 100%;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.35;
  max-width: 9.5rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 22rem;
  text-align: center;
}

.brand-text .kicker,
.brand-text h1,
.brand-text p {
  text-align: center;
  width: 100%;
  margin: 0;
}

.brand .kicker,
.brand-text .kicker {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.brand-text h1 {
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.brand-text p,
.brand-lead {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  max-width: 22rem;
}

@media (max-width: 560px) {
  .brand.brand-split {
    flex-direction: column;
    gap: 0.85rem;
  }
  .brand-side {
    max-width: none;
  }
  .brand-logo {
    width: 5.75rem;
  }
}

/* Cards / forms */
.card {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .card {
    padding: 1.55rem 1.6rem 1.65rem;
  }
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--foreground);
}

input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-size: 1rem;
  font-family: var(--font);
  margin-bottom: 0.85rem;
  background: var(--surface);
  color: var(--foreground);
  transition: border-color var(--dur) var(--ease);
}

input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--foreground) 40%, var(--border));
}

input::placeholder {
  color: var(--muted);
}

.row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

button,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: none;
  background: var(--accent);
  color: var(--background);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

button:hover,
a.btn:hover {
  opacity: 0.92;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

button.secondary,
a.btn.secondary {
  width: auto;
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

button.secondary:hover,
a.btn.secondary:hover {
  border-color: var(--foreground);
  opacity: 1;
}

.btn-inline {
  width: auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

.err {
  color: var(--danger);
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

.ok {
  color: var(--ok);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

.status-card {
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  background: var(--ok-bg);
}

.status-card h2 {
  font-size: 1.02rem;
  margin: 0 0 0.4rem;
  font-weight: 600;
  color: var(--ok);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--foreground);
}

.status-card .meta {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.pulse {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

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

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: none;
}

.list .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.list .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--slot-bg);
  color: var(--muted);
  margin-left: 0.35rem;
  vertical-align: middle;
}

.badge.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.empty {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 0.25rem 0;
}

.foot {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

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

.nav {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-align: center;
}

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

code {
  font-size: 0.78rem;
  background: var(--slot-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Waiting room layout */
.wrap-wait {
  max-width: 26rem;
}

@media (min-width: 640px) {
  .wrap-wait {
    max-width: 30rem;
  }
}

.card-status {
  padding-bottom: 1.15rem;
}

.admit-box {
  margin-top: 0.85rem;
}

/* Match footer centering so leave + foot share the same axis */
.leave-wrap {
  display: block;
  width: 100%;
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
}

.leave-wrap .leave-btn,
#leave-btn.leave-btn,
button#leave-btn {
  display: inline-flex !important;
  width: fit-content !important;
  max-width: 100%;
  min-width: 0;
  margin: 0 auto !important;
  float: none !important;
  position: static !important;
  justify-content: center;
  text-align: center;
}

/* Network check */
.net-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.net-result {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  font-size: 0.84rem;
  line-height: 1.35;
}

.net-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.3rem;
  background: var(--muted);
}

.net-dot.net-good {
  background: #22c55e;
}
.net-dot.net-fair {
  background: #eab308;
}
.net-dot.net-poor {
  background: #ef4444;
}
.net-dot.net-pending {
  background: var(--muted);
  animation: pulse 1.2s ease-in-out infinite;
}

.net-label {
  color: var(--foreground);
}

.net-rating {
  font-weight: 600;
}

.net-detail {
  flex: 1 1 100%;
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: 0.95rem;
}

button.net-recheck {
  width: auto !important;
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem !important;
  font-size: 0.78rem !important;
  margin: 0;
}

/* A/V pretest */
.card-av {
  padding-top: 1.2rem;
}

.av-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.av-head strong {
  display: block;
  font-size: 0.98rem;
}

.av-head-hint {
  margin: 0.2rem 0 0;
}

.av-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  overflow: hidden;
  background: #0a0a0b;
  border: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.av-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #0a0a0b;
}

.av-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1a1aa;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  padding: 1rem;
  pointer-events: none;
}

.av-preview-placeholder.hidden {
  display: none !important;
}

.av-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

button.av-toggle {
  width: auto !important;
  flex: 1 1 auto;
  min-width: 5.5rem;
  padding: 0.5rem 0.7rem !important;
  border-radius: 999px !important;
  font-size: 0.8rem !important;
  font-weight: 550 !important;
  background: var(--slot-bg) !important;
  color: var(--foreground) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

button.av-toggle:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--foreground) 35%, var(--border)) !important;
  opacity: 1;
}

button.av-toggle.is-off {
  opacity: 0.65;
  color: var(--muted) !important;
}

button.av-toggle.is-on {
  border-color: color-mix(in srgb, #3b82f6 55%, var(--border)) !important;
  background: color-mix(in srgb, #3b82f6 12%, var(--surface)) !important;
}

button.av-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.av-ico {
  font-size: 0.55rem;
  vertical-align: middle;
  margin-right: 0.15rem;
}

.av-meter-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.95rem;
}

.av-meter-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  width: 1.75rem;
  flex-shrink: 0;
}

.av-meter {
  flex: 1;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--slot-bg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.av-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.05s linear;
}

.av-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.av-field-inline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.av-field-inline label {
  flex: 0 0 auto;
  margin: 0;
  min-width: 4.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.av-field-inline select.av-select {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  width: auto;
}

select.av-select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  font-size: 0.88rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--foreground);
  appearance: auto;
}

select.av-select:disabled {
  opacity: 0.55;
}

.av-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
  margin-bottom: 0.55rem;
}

.av-actions .btn,
.av-actions button.secondary {
  width: auto;
  flex: 1 1 8rem;
}

.av-actions .btn {
  /* primary already full-contrast */
}

/* ===== Host session: letterboxed video + docked waiting room ===== */
body.host-body {
  min-height: 100vh;
}

body.host-body.in-call {
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0a0a0b;
}

body.host-body.in-call .theme-toggle {
  bottom: 1rem;
  right: 1rem;
  left: auto;
  z-index: 50;
}

.host-lobby {
  padding-bottom: 4rem;
}

/* Full-viewport session shell */
.session {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: #0a0a0b;
  color: #f4f4f5;
}

.session.hidden {
  display: none !important;
}

.session-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0.85rem;
  background: #141416;
  border-bottom: 1px solid #27272a;
  flex: 0 0 auto;
}

.session-bar-left,
.session-bar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.session-bar-left {
  font-size: 0.9rem;
}

.session-bar-left code {
  background: #27272a;
  color: #e4e4e7;
}

.host-conn {
  color: #a1a1aa;
  font-size: 0.8rem;
}

button.host-bar-btn,
a.host-bar-btn {
  width: auto !important;
  padding: 0.45rem 0.7rem !important;
  font-size: 0.82rem !important;
  border-color: #3f3f46 !important;
  color: #f4f4f5 !important;
  background: #18181b !important;
}

button.host-bar-btn.is-off {
  opacity: 0.7;
  text-decoration: line-through;
}

button.host-bar-btn.is-on {
  border-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.25) !important;
  color: #fff !important;
}

/* Screen share fills the letterbox when present */
.host-video-grid.has-screen .host-tile.is-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: none;
  z-index: 1;
}

.host-video-grid.has-screen .host-tile.is-screen .host-tile-media video {
  object-fit: contain;
  background: #000;
  transform: none !important;
}

.host-video-grid.has-screen .host-tile.is-remote:not(.is-screen),
.host-video-grid.has-screen .host-tile.is-local:not(.is-screen) {
  position: absolute;
  z-index: 5;
  width: min(180px, 26%);
  aspect-ratio: 16 / 10;
  min-height: 0;
  border-radius: 0.65rem;
  border: 1px solid #52525b;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.host-video-grid.has-screen .host-tile.is-local:not(.is-screen) {
  right: 0.75rem;
  bottom: 0.75rem;
}

.host-video-grid.has-screen .host-tile.is-remote:not(.is-screen) {
  left: 0.75rem;
  bottom: 0.75rem;
}

/* Split: letterboxed stage + waiting dock */
.session-body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 23rem);
  grid-template-rows: 1fr;
}

@media (max-width: 860px) {
  .session-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(12rem, 38vh);
  }
}

.session-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #000;
}

/* Letterbox: black bars around 16:9 call surface */
.letterbox {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0.5rem;
}

.letterbox .host-video-grid {
  width: 100%;
  height: 100%;
  max-height: 100%;
  /* Prefer 16:9 cinema frame inside available space */
  aspect-ratio: 16 / 9;
  max-width: min(100%, calc((100vh - 7rem) * 16 / 9));
  margin: 0 auto;
  background: #0a0a0b;
  border-radius: 0.65rem;
  border: 1px solid #27272a;
  overflow: hidden;
  position: relative;
  padding: 0;
}

.stage-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #a1a1aa;
  background: #141416;
  border-top: 1px solid #27272a;
}

.stage-hint.hidden {
  display: none !important;
}

.stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
}

.stage-empty.hidden {
  display: none !important;
}

.host-video-grid {
  display: grid;
  gap: 0;
  min-height: 0;
  align-content: stretch;
}

.host-video-grid.solo {
  place-items: stretch;
}

.host-video-grid.solo .host-tile.is-local {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  border-radius: 0;
  border: none;
}

.host-video-grid.has-remote {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.host-video-grid.has-remote .host-tile.is-remote {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: none;
}

.host-video-grid.has-remote .host-tile.is-local {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: min(200px, 28%);
  aspect-ratio: 16 / 10;
  min-height: 0;
  z-index: 5;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
  border: 1px solid #52525b;
  border-radius: 0.65rem;
}

.host-tile {
  position: relative;
  background: #18181b;
  overflow: hidden;
  min-height: 0;
}

.host-tile-media {
  width: 100%;
  height: 100%;
  background: #000;
}

.host-tile-media video,
.host-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}

.host-tile.is-local video,
.host-tile.is-local .host-tile-media video {
  transform: scaleX(-1);
}

.host-tile-label {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.55);
  color: #fafafa;
  z-index: 2;
}

.host-tile-timer {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.6);
  color: #e4e4e7;
  z-index: 2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.host-tile-timer.hidden {
  display: none !important;
}

.wait-timer {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem !important;
  font-weight: 500;
  color: #d4d4d8 !important;
}

.host-stage-err {
  position: absolute;
  left: 50%;
  top: 0.75rem;
  transform: translateX(-50%);
  z-index: 6;
  max-width: 90%;
  background: #450a0a;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

/* Waiting dock — part of the session layout (not a separate Meet tab) */
.wait-dock,
.wait-widget {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #141416;
  color: #f4f4f5;
  border-left: 1px solid #27272a;
  overflow: hidden;
}

@media (max-width: 860px) {
  .wait-dock,
  .wait-widget {
    border-left: none;
    border-top: 1px solid #27272a;
  }
}

.wait-dock.hidden,
.wait-widget.hidden {
  display: none !important;
}

.wait-dock.has-waiters,
.wait-widget.has-waiters {
  box-shadow: inset 3px 0 0 #2563eb;
}

.wait-dock.has-alert,
.wait-widget.has-alert {
  animation: wait-pulse 1.2s ease-in-out 2;
}

@keyframes wait-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

.wait-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #27272a;
  flex: 0 0 auto;
}

.wait-widget-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
}

.wait-bell {
  color: #71717a;
  font-size: 0.55rem;
}

.wait-bell.alert {
  color: #3b82f6;
  animation: pulse 0.8s ease-in-out infinite;
}

.wait-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #3f3f46;
  color: #fafafa;
}

.wait-dock.has-waiters .wait-count,
.wait-widget.has-waiters .wait-count {
  background: #2563eb;
  color: #fff;
}

.wait-widget-body {
  flex: 0 0 auto;
  min-height: 0;
  max-height: 36%;
  padding: 0.65rem 0.85rem 0.55rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.office-client-slot {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0 0.7rem 0.7rem;
  border-top: 1px solid #27272a;
}

#office-client {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.85rem 0.9rem 1rem;
  box-sizing: border-box;
}

.wait-empty {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.88rem;
  color: #a1a1aa;
}

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

.wait-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #27272a;
}

.wait-item:last-child {
  border-bottom: none;
}

.wait-item.is-waiting .name {
  font-weight: 600;
}

.wait-item .meta {
  font-size: 0.75rem;
  color: #a1a1aa;
}

.wait-item-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.wait-item-actions .admit-btn {
  width: auto !important;
  padding: 0.45rem 0.8rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  background: #2563eb !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0.5rem !important;
}

.wait-item-actions .kick-btn {
  width: auto !important;
  padding: 0.4rem 0.6rem !important;
  font-size: 0.78rem !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
  background: transparent !important;
}

.wait-mini-btn {
  width: auto !important;
  padding: 0.35rem 0.6rem !important;
  font-size: 0.78rem !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
  background: #18181b !important;
}

.wait-help {
  margin: 0.65rem 0 0;
  font-size: 0.74rem;
  color: #a1a1aa;
  line-height: 1.4;
}

.wait-help code {
  font-size: 0.72rem;
  background: #27272a;
  color: #e4e4e7;
}

.wait-widget-foot {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
}

/* hide legacy collapse chrome */
.wait-widget-fab,
.wait-icon-btn[hidden] {
  display: none !important;
}

/* Theme toggle — same as booker */
.theme-toggle {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 50;
  display: inline-flex;
  height: 2.6rem;
  width: 2.6rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--muted);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
  padding: 0;
}

@media (min-width: 640px) {
  .theme-toggle {
    bottom: 1.5rem;
    left: 1.5rem;
  }
}

.theme-toggle:hover {
  border-color: var(--foreground);
  color: var(--foreground);
  transform: scale(1.05);
}

.theme-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle .icon-moon {
  display: block;
}

html.dark .theme-toggle .icon-sun {
  display: block;
}

html.dark .theme-toggle .icon-moon {
  display: none;
}

.pdrive-kicker {
  margin: 0.7rem 0 0.15rem;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Proton Drive dock / popup */
.pdrive { font-size: 0.78rem; }
.pdrive-bar {
  display: flex; align-items: center; gap: 0.3rem;
  margin: 0.45rem 0 0.3rem;
}
.pdrive-path {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 0.72rem;
}
.pdrive-up, .pdrive-ref {
  border: 1px solid var(--border); background: var(--background);
  color: var(--foreground); border-radius: 0.4rem; cursor: pointer;
  width: 1.7rem; height: 1.7rem; font: inherit; line-height: 1;
}
.pdrive-list { max-height: 11rem; overflow: auto; }
.pdrive-item {
  display: flex; justify-content: space-between; gap: 0.4rem; width: 100%;
  text-align: left; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: inherit; font: inherit; padding: 0.32rem 0.1rem;
  cursor: pointer;
}
.pdrive-item em { color: var(--muted); font-style: normal; font-size: 0.68rem; }
.pdrive-item.is-folder { font-weight: 600; }
