/* ============================================================
   Serenity Spaces — Main Stylesheet
   Dark glassmorphism design system
   ============================================================ */

:root {
  --bg: #0d0d0f;
  --surface: rgba(255,255,255,0.05);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.1);
  --text: #e8e8f0;
  --text-muted: rgba(255,255,255,0.45);
  --accent: #7c6af7;
  --accent-glow: rgba(124,106,247,0.35);
  --crimson: #8b1a1a;
  --crimson-bright: #dc143c;
  --highlight-yellow: rgba(255,214,0,0.35);
  --highlight-pink: rgba(255,105,180,0.4);
  --highlight-blue: rgba(30,144,255,0.45);
  --highlight-crimson: rgba(139,0,0,0.5);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 280px;
}

/* ── Light mode overrides (applies to all non-room pages) ── */
body.theme-light {
  --bg:           #f0f0f6;
  --surface:      rgba(255,255,255,0.88);
  --surface-hover:rgba(0,0,0,0.04);
  --border:       rgba(0,0,0,0.1);
  --text:         #1a1a2e;
  --text-muted:   rgba(0,0,0,0.45);
  --accent:       #6355e0;
  --accent-glow:  rgba(99,85,224,0.25);
  background: var(--bg);
  color: var(--text);
}
body.theme-light .glass-panel {
  background: rgba(255,255,255,0.92);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
body.theme-light .dashboard-header {
  background: rgba(240,240,248,0.95);
  border-bottom-color: rgba(0,0,0,0.1);
}
body.theme-light .app-name {
  background: linear-gradient(135deg, #3a3a5c, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
body.theme-light.auth-page {
  background: var(--bg);
  background-image: radial-gradient(ellipse at 30% 30%, rgba(99,85,224,0.07) 0%, transparent 60%);
}
body.theme-light .landing-page,
body.theme-light .join-page { background: var(--bg); }
body.theme-light input,
body.theme-light textarea,
body.theme-light select {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}
body.theme-light input::placeholder,
body.theme-light textarea::placeholder { color: rgba(0,0,0,0.35); }
body.theme-light .user-menu-dropdown {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
body.theme-light .btn-ghost {
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}
body.theme-light .btn-ghost:hover { background: rgba(0,0,0,0.06); }
body.theme-light .admin-user-table th { color: rgba(0,0,0,0.5); }
body.theme-light .admin-user-table td { border-bottom-color: rgba(0,0,0,0.06); }
body.theme-light .admin-user-table tbody tr:hover td { background: rgba(0,0,0,0.03); }
body.theme-light .room-card-invite { background: rgba(0,0,0,0.06); }
body.theme-light .room-card-live-strip { background: rgba(99,85,224,0.07); }
body.theme-light .alert-error   { background: rgba(220,20,60,0.1); border-color: rgba(220,20,60,0.3); }
body.theme-light .alert-success { background: rgba(40,180,80,0.1); border-color: rgba(40,180,80,0.3); }
body.theme-light .setup-card { background: rgba(255,255,255,0.92); }

/* ── App logo image ── */
.app-logo-img {
  max-height: 75px;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

/* ── Admin settings divider ── */
.admin-setting-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
body.scrollable { overflow: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Glass panels ── */
.glass-panel {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, box-shadow 0.15s;
  background: var(--surface);
  color: var(--text);
}
.btn:hover { background: var(--surface-hover); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}
.btn-primary:hover { background: #6a5ae0; box-shadow: 0 0 18px var(--accent-glow); }
.btn-danger {
  background: var(--crimson);
  border-color: var(--crimson-bright);
  color: #fff;
}
.btn-danger:hover { background: #a02020; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ── */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 13px; }
.form-group { margin-bottom: 16px; }
.f-group { margin-bottom: 16px; }
.f-label { font-weight: 600; font-size: 13px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.f-input { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: 13px; font-family: inherit; outline: none; box-sizing: border-box; }
.f-input:focus { border-color: var(--accent); }
textarea.f-input { resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-error { color: #ff6b6b; font-size: 13px; margin-top: 4px; }

/* ── Centered auth layouts ── */
.auth-page {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 30% 30%, rgba(124,106,247,0.08) 0%, transparent 60%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  margin: 20px;
}
.auth-card h1 {
  font-size: 28px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #e8e8f0, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 15px;
}
.auth-card .btn-primary { width: 100%; justify-content: center; padding: 12px; }
.auth-footer { margin-top: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ── Dashboard layout ── */
.dashboard-page { overflow: auto; background: var(--bg); }
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(20px);
  z-index: 100;
}
.dashboard-header .app-name {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #e8e8f0, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dashboard-body { padding: 32px 36px; max-width: 1200px; margin: 0 auto; }
.dashboard-section { margin-bottom: 40px; }
.dashboard-section h2 { font-size: 17px; font-weight: 600; margin-bottom: 16px; color: var(--text); }
.dash-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.dash-section-header h2 { margin: 0; }
.dash-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px; gap: 16px; flex-wrap: wrap;
}
.dash-welcome { font-size: 22px; font-weight: 700; margin: 0; }
.dash-empty-state {
  padding: 48px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.dash-empty-icon { font-size: 36px; }
.dash-empty-state p { color: var(--text-muted); margin: 0; }

/* ── User menu (header dropdown) ── */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
}
.user-menu-btn:hover { background: var(--surface-hover); border-color: var(--border); }
.user-menu-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent);
}
.user-menu-avatar-placeholder {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-dim); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
.user-menu-name { font-size: 14px; font-weight: 500; color: var(--text); }
.user-menu-chevron { width: 12px; height: 12px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.2s; }
details[open].user-menu .user-menu-chevron { transform: rotate(180deg); }
.user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 180px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(16px); overflow: hidden;
  z-index: 200;
}
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--text);
  text-decoration: none; width: 100%; background: transparent; border: none; cursor: pointer;
  transition: background 0.1s;
}
.user-menu-item:hover { background: var(--surface-hover); }
.user-menu-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-signout { color: var(--text-muted); }
.user-menu-signout:hover { color: #dc143c; background: rgba(220,20,60,0.08); }

/* ── Room cards ── */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.room-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.room-card-cover {
  position: relative;
  height: 120px;
  background: var(--surface-hover);
  overflow: hidden;
}
.room-card-cover-media {
  width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.7;
}
.room-card-live-badge {
  position: absolute; bottom: 8px; right: 8px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 12px;
}
.room-card-live-strip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 16px; font-size: 12px; color: var(--accent);
  background: rgba(124,106,247,0.07); border-bottom: 1px solid var(--border);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #3c3;
  box-shadow: 0 0 6px #3c3; animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.room-card-body { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.room-card-name { font-size: 15px; font-weight: 600; }
.room-card-invite {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.3); border-radius: 4px; padding: 4px 6px 4px 8px;
}
.room-card-token {
  font-size: 11px; color: var(--text-muted); font-family: monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;
}
.btn-icon-copy {
  flex-shrink: 0; background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px; border-radius: 3px;
  display: flex; align-items: center; transition: color 0.15s;
}
.btn-icon-copy:hover { color: var(--accent); }
.btn-icon-copy svg { width: 14px; height: 14px; }
.room-card-actions {
  display: flex; gap: 8px; padding: 8px 16px 16px; margin-top: auto;
}

/* ── Setup wizard ── */
.setup-card {
  width: 100%; max-width: 600px;
  margin: 60px auto 0;
  padding: 40px 48px;
  border-radius: var(--radius);
}
.setup-brand {
  font-size: 20px; font-weight: 700; text-align: center; margin-bottom: 20px;
  background: linear-gradient(135deg, #e8e8f0, var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.setup-steps {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-bottom: 28px; font-size: 12px;
}
.setup-step { color: var(--text-muted); }
.setup-step.active { color: var(--accent); font-weight: 600; }
.setup-step.done { color: var(--text-muted); }
.setup-step-sep { color: var(--border); }

/* ── Admin panel ── */
.admin-page-header { margin-bottom: 32px; }
.admin-page-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.admin-settings-panel { padding: 20px 24px; }
.admin-setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* ── Toggle switch ── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: rgba(255,255,255,0.1); border-radius: 24px;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; top: 3px;
  background: var(--text-muted); border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(139,92,246,0.3); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--accent); }
.admin-setting-label { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.btn-success {
  background: rgba(40,200,80,0.15); color: #3c3; border: 1px solid rgba(40,200,80,0.3);
}
.btn-success:hover { background: rgba(40,200,80,0.25); }
.admin-user-table-wrap { overflow-x: auto; padding: 0; }
.admin-user-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.admin-user-table th {
  text-align: left; padding: 12px 16px; color: var(--text-muted);
  font-weight: 500; font-size: 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-user-table td {
  padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-user-table tr:last-child td { border-bottom: none; }
.admin-user-table tbody tr:hover td { background: var(--surface-hover); }
.role-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px;
}
.role-admin { background: rgba(124,106,247,0.2); color: var(--accent); }
.role-user  { background: rgba(255,255,255,0.07); color: var(--text-muted); }
.admin-you-badge {
  display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: rgba(124,106,247,0.15); color: var(--accent); margin-left: 4px; vertical-align: middle;
}

/* ── Background thumbnails ── */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.bg-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.bg-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bg-thumb video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.bg-thumb:hover { border-color: var(--accent); }
.bg-thumb-type-badge {
  position: absolute;
  top: 4px; left: 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
}
.bg-thumb .bg-thumb-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 4px 6px;
  font-size: 11px;
  background: rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Create room form ── */
.create-room-form { padding: 24px; }
.bg-option-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

/* ── Room layout (main session page) ── */
#container { display: flex; height: 100%; }
#main { flex: 4; position: relative; padding: 10px; }
#sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(10px);
  border-left: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 16px;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1), width 0.28s cubic-bezier(.4,0,.2,1);
}

/* ── Sidebar toggle button ── */
#sidebar-toggle {
  display: none; /* desktop: hidden */
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 201;
  width: 32px;
  height: 48px;
  background: rgba(20,25,45,0.92);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  color: rgba(200,210,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
#sidebar-toggle:hover { background: rgba(124,106,247,.2); color: var(--accent); }
#sidebar-toggle svg { width: 16px; height: 16px; }

/* ── Room background mirror (shows behind chat when room collapsed) ── */
#room-bg-mirror {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 0;
  background: center/cover;
  filter: brightness(0.35) blur(1px);
  pointer-events: none;
  border-radius: var(--radius);
  overflow: hidden;
}
#main.room-collapsed #room-bg-mirror { display: block; }

/* ── Room collapse states ── */
#main.room-collapsed #room {
  height: 0 !important;
  min-height: 0 !important;
  overflow: hidden;
  border: none;
}
#main.room-collapsed #horizontal-divider {
  top: 6px !important;
  background: rgba(124,106,247,0.3);
}
#main.room-collapsed #horizontal-divider:hover { background: rgba(124,106,247,0.6); }
#main.room-collapsed #chat-pane {
  top: 28px !important;
  height: calc(100% - 38px) !important;
  background: rgba(5,8,16,0.78);
  backdrop-filter: blur(16px);
  z-index: 1;
}
/* Collapse button inside divider */
#room-collapse-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 20px;
  background: rgba(20,25,45,0.9);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  z-index: 11;
  transition: background .15s, color .15s;
}
#room-collapse-btn:hover { background: rgba(124,106,247,.2); color: var(--accent); }
#room-collapse-btn svg { width: 12px; height: 8px; transition: transform .25s; }
#main.room-collapsed #room-collapse-btn svg { transform: rotate(180deg); }

/* ── Room pane ── */
#room {
  position: absolute;
  top: 10px; left: 10px; right: 10px;
  height: calc(var(--room-height,60%) - 10px);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
#room .bg {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: center/cover;
  filter: brightness(0.45);
}

/* ── Horizontal divider ── */
#horizontal-divider {
  position: absolute;
  top: calc(var(--room-height,60%));
  left: 10px; right: 10px;
  height: 6px; cursor: row-resize;
  background: var(--border);
  border-radius: 3px;
  z-index: 10;
  transition: background 0.15s;
}
#horizontal-divider:hover { background: var(--accent); }

/* ── Chat pane ── */
#chat-pane {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  height: calc(100% - var(--room-height,60%) - 26px);
  display: flex; flex-direction: column;
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
#messages {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
}
#messages::-webkit-scrollbar { width: 4px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
#file-preview, #voice-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.file-preview-thumb {
  max-height: 80px;
  max-width: 120px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.file-preview-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
}
.file-preview-remove { padding: 4px 8px; font-size: 12px; }

#input-area {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}
.input-icon-btn {
  padding: 0 10px;
  background: transparent;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.input-icon-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.input-icon-btn.recording {
  color: #ff4444;
  animation: pulse-record 1s ease-in-out infinite;
}
@keyframes pulse-record {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
#input-area.voice-active { outline: 1px solid rgba(255,68,68,0.5); }
#input-area input {
  flex: 1; padding: 12px 16px;
  background: transparent;
  border: none; border-radius: 0;
  color: var(--text);
  font-size: 14px;
}
#input-area input:focus { box-shadow: none; }
#send-btn {
  padding: 0 20px;
  background: var(--accent);
  border: none;
  border-left: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
}
#send-btn:hover { background: #6a5ae0; }

/* ── Chat messages — original demo style ── */
.chat-message {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  word-break: break-word;
  line-height: 1.5;
  gap: 12px;
}
.chat-message.you   { background: rgba(140,207,255,0.2); }
.chat-message.other { background: rgba(255,255,255,0.05); }
.chat-message.pinned {
  background: rgba(139,0,0,0.35) !important;
  border: 1px solid rgba(220,20,60,0.3);
}
/* ① Timestamp — left edge, small, vertically centred */
.msg-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 3px;
  min-width: 42px;
}
/* ② Avatar */
.chat-message img.chat-avatar {
  width: 40px; height: 40px;
  object-fit: cover;
  flex-shrink: 0;
}
/* ③ Name + text */
.chat-message .msg-body { flex: 1; min-width: 0; }
.chat-message strong { white-space: nowrap; }
.chat-message .msg-text { word-break: break-word; }

/* ── Inline message edit ── */
.edit-msg-input {
  width: 100%;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--text);
  resize: none;
  margin-bottom: 4px;
  font-family: inherit;
}
.edit-msg-save, .edit-msg-cancel { margin-right: 4px; margin-top: 4px; }

/* ── Deleted / edited messages ── */
.chat-message.msg-deleted .msg-text { text-decoration: line-through; opacity: 0.5; }
.msg-deleted-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}
.msg-edited-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}

/* ── Highlight toolbar edit section separator ── */
.hl-section-sep {
  font-size: 16px;
  color: var(--border);
  padding: 0 2px;
  user-select: none;
}

/* ── SS Modals ── */
.ss-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.ss-modal-box {
  background: #0e1020;
  border: 1px solid rgba(124,106,247,0.25);
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 12px 48px rgba(0,0,0,0.75);
}
.ss-modal-msg {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.5;
}
.ss-modal-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 16px;
}
.ss-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Danger button ── */
.btn-danger {
  background: #8b0000;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-danger:hover { background: #a00000; }

/* ── Session timer input ── */
.timer-input {
  width: 64px;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.chat-image {
  max-width: 150px; max-height: 150px;
  margin: 0 3px;
  border-radius: 4px;
  vertical-align: middle;
}

/* ── Highlights ── */
mark.hl-yellow  { background: var(--highlight-yellow);  color: inherit; border-radius: 2px; padding: 0 2px; }
mark.hl-pink    { background: var(--highlight-pink);    color: inherit; border-radius: 2px; padding: 0 2px; }
mark.hl-blue    { background: var(--highlight-blue);    color: inherit; border-radius: 2px; padding: 0 2px; }
mark.hl-crimson { background: var(--highlight-crimson); color: inherit; border-radius: 2px; padding: 0 2px; }

/* ── Highlight toolbar ── */
.highlight-toolbar {
  position: fixed;
  display: none;
  flex-direction: column;
  background: rgba(20,20,30,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  gap: 6px;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  min-width: 160px;
}
.highlight-toolbar.visible { display: flex; }
.highlight-toolbar.edit-mode { flex-direction: row; align-items: center; }
.hl-section { display: flex; flex-direction: column; gap: 4px; }
.hl-section + .hl-section { border-top: 1px solid var(--border); padding-top: 6px; }
#hl-section-edit { flex-direction: row; align-items: center; border-top: none; padding-top: 0; border-left: 1px solid var(--border); padding-left: 6px; margin-left: 2px; }
.hl-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 2px;
}
.hl-section-btns { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.hl-btn {
  width: 28px; height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, border-color 0.1s;
  background: transparent;
}
.hl-btn:hover { transform: scale(1.2); border-color: rgba(255,255,255,0.3); }
.hl-btn-yellow { background: var(--highlight-yellow); }
.hl-btn-pink   { background: var(--highlight-pink); }
.hl-btn-blue   { background: var(--highlight-blue); }
.hl-btn-pin    { color: var(--crimson-bright); font-size: 18px; }
.react-emoji-btn { font-size: 18px; }

/* ── Reactions display ── */
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px 0 2px;
  justify-content: flex-end;
}
.reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 2px 6px 2px 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  user-select: none;
}
.reaction-chip:hover { background: rgba(255,255,255,0.12); }
.reaction-chip.own { border-color: var(--accent); background: rgba(139,92,246,0.15); }
.reaction-avatar {
  width: 14px; height: 14px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.55;
  margin-left: 2px;
  flex-shrink: 0;
}
.reaction-count { font-size: 11px; color: var(--text-muted); margin-left: 1px; }

/* ── Avatars in room ── */
.avatar {
  position: absolute;
  width: 150px;
  height: 150px;
  user-select: none;
  cursor: grab;
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  object-fit: cover;
}
.avatar:active { cursor: grabbing; }
.avatar.linked { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.avatar.avatar-dim { opacity: 0.4; filter: grayscale(0.5); transition: opacity 0.6s ease, filter 0.6s ease; }
.avatar.avatar-disconnected { opacity: 0.2; filter: grayscale(1); }

/* ── Webcam live badge ── */
.webcam-live-badge {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.75);
  border-radius: 4px;
  font-size: 12px;
  z-index: 26;
  pointer-events: none;
  line-height: 1;
}


/* ── Typing bubble on room avatar ── */
.typing-bubble {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  background: rgba(30,30,40,0.85);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.typing-bubble span {
  width: 5px; height: 5px;
  background: #ccc;
  border-radius: 50%;
  display: block;
  animation: typingBounce 1.1s infinite ease-in-out;
}
.typing-bubble span:nth-child(2) { animation-delay: 0.18s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
  30%           { transform: translateY(-5px); opacity: 1;    }
}

/* ── Noting bubble on room avatar (practitioner writing notes / highlighting) ── */
.noting-bubble {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: rgba(15, 18, 40, 0.88);
  border: 1px solid rgba(124, 106, 247, 0.5);
  border-radius: 50%;
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 8px rgba(124,106,247,0.25);
}
.noting-bubble svg {
  animation: notingWrite 1.6s ease-in-out infinite;
  color: #a898f8;
}
@keyframes notingWrite {
  0%   { transform: rotate(-8deg) translate(0, 0);    opacity: 0.7; }
  25%  { transform: rotate(-4deg) translate(1px, 1px); opacity: 1;   }
  50%  { transform: rotate(-8deg) translate(0, 2px);  opacity: 0.7; }
  75%  { transform: rotate(-4deg) translate(-1px,1px); opacity: 1;   }
  100% { transform: rotate(-8deg) translate(0, 0);    opacity: 0.7; }
}

/* ── Chat bubbles ── */
.chat-bubble {
  position: absolute;
  max-width: 200px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 20;
  border: 1px solid rgba(255,255,255,0.15);
}
.chat-bubble.show { opacity: 1; }
.chat-bubble::before {
  content: "";
  position: absolute;
  width: 0; height: 0;
  border: 8px solid transparent;
}
.chat-bubble.br::before { top: -16px; left: 12px; border-bottom-color: rgba(255,255,255,0.12); }
.chat-bubble.bl::before { top: -16px; right: 12px; border-bottom-color: rgba(255,255,255,0.12); }
.chat-bubble.tr::before { bottom: -16px; left: 12px; border-top-color: rgba(255,255,255,0.12); }
.chat-bubble.tl::before { bottom: -16px; right: 12px; border-top-color: rgba(255,255,255,0.12); }

/* ── Sidebar components ── */
.sidebar-section { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.sidebar-section:last-child { border-bottom: none; }
.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ── Room tab ── */
.room-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 13px;
}
.room-tab-name { font-weight: 600; }
.room-tab-count { color: var(--text-muted); font-size: 12px; }

/* ── Participant list ── */
#user-list { list-style: none; }
.participant-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: default;
}
.participant-card:hover { background: var(--surface-hover); }
.participant-avatar {
  width: 36px; height: 36px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.participant-name { font-size: 13px; }

/* ── Split nameplate (linked users) ── */
.user-linked {
  display: flex;
  align-items: center;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid rgba(124,106,247,0.35);
  background: linear-gradient(135deg, rgba(124,106,247,0.18) 0%, rgba(220,20,60,0.12) 100%);
  padding: 0 8px;
  gap: 6px;
}
.user-linked .link-half {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  cursor: pointer;
}
.link-half-avatar {
  position: relative;
  flex-shrink: 0;
}
.user-linked .link-half span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.link-heart {
  flex-shrink: 0;
  font-size: 14px;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(220,20,60,0.7));
}

/* ── Notes panel ── */
.notes-panel { display: flex; flex-direction: column; gap: 8px; }
.notes-participant-select {
  margin-bottom: 8px;
}
.notes-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  font-size: 13px;
  font-family: inherit;
}
.notes-save-indicator {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

/* ── Notes toolbar (#10) ── */
.notes-template-row select {
  width: 100%;
  font-size: 11px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 4px;
  flex-wrap: wrap;
}
.notes-tb-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
  min-width: 24px;
  text-align: center;
}
.notes-tb-btn:hover { background: rgba(124,106,247,0.15); color: var(--text); }
.notes-tb-btn.active { background: rgba(124,106,247,0.25); color: var(--accent); }
.notes-tb-sep { width: 1px; height: 14px; background: var(--border); margin: 0 2px; }
.notes-preview-pane {
  width: 100%;
  min-height: 100px;
  max-height: 280px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
}
.notes-preview-pane h1, .notes-preview-pane h2, .notes-preview-pane h3 {
  color: var(--accent); margin: 8px 0 4px; font-size: 13px; font-weight: 600;
}
.notes-preview-pane strong { color: var(--text); }
.notes-preview-pane em { color: var(--text-muted); }
.notes-preview-pane code {
  background: rgba(124,106,247,0.15); padding: 1px 4px; border-radius: 3px; font-size: 11px;
}
.notes-preview-pane ul, .notes-preview-pane ol { padding-left: 16px; margin: 4px 0; }
.notes-preview-pane li { margin: 2px 0; }

/* ── Notes history (#12) ── */
.notes-history-section {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 4px;
}
.notes-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}
.notes-history-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.notes-history-header:hover .notes-history-label { color: var(--text); }
#notes-history-toggle { font-size: 10px; color: var(--text-muted); }
.notes-history-entry {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.notes-history-date {
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.notes-history-text {
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}
.notes-history-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }

/* ── Action items panel (#15) ── */
.action-add-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.action-item-input {
  flex: 1;
  font-size: 12px;
  padding: 5px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}
.action-item-input::placeholder { color: var(--text-muted); }
.action-item-input:focus { outline: none; border-color: var(--accent); }
.action-add-btn {
  background: rgba(124,106,247,0.2);
  border: 1px solid rgba(124,106,247,0.3);
  color: var(--accent);
  font-size: 18px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
  flex-shrink: 0;
}
.action-add-btn:hover { background: rgba(124,106,247,0.35); }
.action-item-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.action-item-row:last-child { border-bottom: none; }
.action-item-check {
  width: 14px;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.action-item-check:hover { border-color: var(--accent); }
.action-item-check.done { background: rgba(124,106,247,0.3); border-color: var(--accent); }
.action-item-text {
  flex: 1;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.action-item-text.done { text-decoration: line-through; color: var(--text-muted); }
.action-item-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.action-item-del:hover { opacity: 1; color: #e85555; }
.action-items-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.sidebar-label-badge {
  display: inline-block;
  background: rgba(124,106,247,0.2);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Pin panel ── */
.pin-panel { display: flex; flex-direction: column; gap: 6px; }
.pin-item {
  background: rgba(139,0,0,0.2);
  border: 1px solid rgba(220,20,60,0.2);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.pin-item:hover { background: rgba(139,0,0,0.35); }
.pin-item-text { margin-bottom: 4px; }
.pin-item-annotation { color: var(--text-muted); font-style: italic; }
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 10px;
}
.collapsible-header:hover .sidebar-label { color: var(--text); }
.collapsible-toggle { color: var(--text-muted); font-size: 12px; }

/* ── End session button ── */
#end-session-btn {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  padding: 12px;
}

/* ── Context menu ── */
#ctx-menu {
  position: fixed;
  background: rgba(20,20,30,0.98);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: none;
  z-index: 1000;
  padding: 6px;
  min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
#ctx-menu.visible { display: block; }
#ctx-menu button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
  transition: background 0.1s;
}
#ctx-menu button:hover { background: var(--surface-hover); }
#ctx-menu button.danger { color: var(--crimson-bright); }


/* ── Landing page ── */
.landing-page {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(124,106,247,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(139,0,0,0.08) 0%, transparent 50%);
}
.landing-card {
  text-align: center;
  padding: 60px 40px;
  max-width: 500px;
  width: 90%;
}
.landing-card h1 {
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, #e8e8f0 0%, var(--accent) 60%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.landing-card .tagline {
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 40px;
}
.landing-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Join room page ── */
.join-page {
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% 30%, rgba(124,106,247,0.1) 0%, transparent 60%);
}
.join-card {
  width: 100%;
  max-width: 480px;
  padding: 40px;
  margin: 20px;
}
.join-card h1 { font-size: 24px; margin-bottom: 6px; }
.join-card .room-name { color: var(--accent); margin-bottom: 28px; font-size: 16px; }
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.upload-area:hover { border-color: var(--accent); }

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Alerts / flash messages ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
}
.alert-error { background: rgba(220,20,60,0.15); border: 1px solid rgba(220,20,60,0.3); color: #ff6b6b; }
.alert-success { background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); color: #4ade80; }

/* ── Utilities ── */
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }

/* ── Flash overlay for newly pinned ── */
.msg.flash-pin { animation: flashCrimson 0.6s ease; }
@keyframes flashCrimson {
  0%   { background: rgba(220,20,60,0.5); }
  100% { background: inherit; }
}

/* ── Participant name label under avatar in room ── */
.avatar-label {
  position: absolute;
  font-size: 11px;
  white-space: nowrap;
  background: rgba(0,0,0,0.6);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  color: var(--text);
  z-index: 5;
  transform: translateX(-50%);
  transition: opacity 0.15s ease;
}

/* ── Participant card with host crown ── */
.participant-card { position: relative; }
.host-crown {
  position: absolute;
  top: 2px; right: 2px;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

/* ── System message in chat ── */
.chat-system {
  text-align: center;
  margin: 10px 0;
  padding: 2px 0;
}

.system-badge {
  display: inline-block;
  background: linear-gradient(135deg, #b8860b 0%, #daa520 40%, #ffd700 60%, #b8860b 100%);
  color: #1a1200;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  box-shadow: 0 1px 4px rgba(184, 134, 11, 0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  text-shadow: 0 1px 0 rgba(255,255,255,0.25);
}

/* ── Practitioner sidebar tabs (info strip) ── */
.room-info-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.room-info-strip .room-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.room-info-strip .session-info { font-size: 12px; color: var(--text-muted); }

/* ============================================================
   New Feature Styles (v2)
   ============================================================ */

/* ── Room context menu (background picker trigger) ── */
#room-ctx-menu {
  display: none;
  position: fixed;
  z-index: 1100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 180px;
}
#room-ctx-menu button {
  display: block; width: 100%;
  padding: 8px 14px;
  background: transparent; border: none;
  color: var(--text); font-size: 13px;
  text-align: left; cursor: pointer;
  border-radius: 4px;
}
#room-ctx-menu button:hover { background: var(--surface-hover); }

/* ── Background picker ── */
#bg-picker {
  display: none;
  flex-direction: column;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1200;
  width: min(500px, 92vw);
  max-height: 80vh;
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  overflow: hidden;
}
#bg-picker.visible { display: flex; }
#bg-picker-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 14px;
}
.bg-picker-close {
  background: transparent; border: none;
  color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1;
}
.bg-picker-close:hover { color: var(--text); }
#bg-picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.bg-tab {
  flex: 1; padding: 10px;
  background: transparent; border: none;
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.bg-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.bg-tab:hover  { color: var(--text); }
#bg-picker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 12px;
  overflow-y: auto; flex: 1;
}
.bg-thumb {
  aspect-ratio: 16/9;
  background: rgba(255,255,255,0.06) center/cover no-repeat;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer; overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.bg-thumb:hover  { border-color: rgba(255,255,255,0.3); transform: scale(1.03); }
.bg-thumb.active { border-color: var(--accent); }
.bg-thumb video  { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.bg-empty { grid-column: 1/-1; text-align: center; color: var(--text-muted); font-size: 13px; padding: 24px 0; }
.bg-upload-label {
  display: flex; align-items: center; justify-content: center;
  padding: 12px; border-top: 1px solid var(--border);
  color: var(--accent); font-size: 13px; cursor: pointer;
  transition: background 0.15s;
}
.bg-upload-label:hover { background: rgba(124,106,247,0.1); }

/* ── Lightbox ── */
#lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.92);
  align-items: center; justify-content: center;
  cursor: pointer;
}
#lightbox.visible { display: flex; }
#lightbox-img {
  max-width: 90vw; max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

/* ── Voice notes in chat ── */
.voice-note-wrap {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 0;
}
.voice-note-wrap audio { max-width: 280px; height: 36px; }
.voice-note-caption { font-size: 12px; color: var(--text-muted); margin: 0; }
.listened-avatars { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.listener-avatar {
  width: 18px; height: 18px;
  border-radius: 50%; object-fit: cover;
  opacity: 0.55; border: 1px solid rgba(255,255,255,0.2);
  transition: opacity 0.2s;
}
.listener-avatar:hover { opacity: 1; }

/* ── File attachments in chat ── */
.file-attachment { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.file-thumb {
  max-width: 200px; max-height: 150px;
  object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer;
  transition: opacity 0.15s;
}
.file-thumb:hover { opacity: 0.85; }
.file-video { max-width: 240px; border-radius: 6px; }
.file-caption { font-size: 12px; color: var(--text-muted); margin: 0; }
.file-download-row {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px; text-decoration: none; color: var(--text);
  font-size: 13px; max-width: 280px;
  transition: background 0.15s;
}
.file-download-row:hover { background: rgba(255,255,255,0.1); }
.file-dl-icon { font-size: 20px; flex-shrink: 0; }
.file-dl-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-dl-size { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.file-dl-btn  { color: var(--accent); font-size: 12px; flex-shrink: 0; }

/* ── YouTube / Spotify embeds ── */
.chat-embed {
  display: block; width: 100%; max-width: 400px;
  border: none; border-radius: 8px;
  margin-top: 8px;
}
.chat-embed[style*="aspect-ratio"] { height: auto; }

/* ── Emoji picker ── */
#emoji-picker {
  display: none;
  position: fixed; z-index: 1500;
  width: 280px; max-height: 320px; overflow-y: auto;
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
  padding: 8px;
}
#emoji-picker.visible { display: block; }
.emoji-cat-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-muted); text-transform: uppercase;
  padding: 8px 4px 4px;
}
.emoji-grid { display: flex; flex-wrap: wrap; gap: 2px; }
.emoji-item {
  width: 32px; height: 32px;
  background: transparent; border: none;
  border-radius: 4px; cursor: pointer;
  font-size: 18px; line-height: 1;
  transition: background 0.1s;
}
.emoji-item:hover { background: rgba(255,255,255,0.1); }

/* ── Webcam button in ctx menu ── */
#ctx-webcam-enable { display: none; }

/* ── Embed collapsible section ── */
.msg-embed-section {
  margin-top: 4px;
  width: 100%;
}
.msg-embed-toggle {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.msg-embed-toggle:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.msg-embed-wrap {
  display: none;
  margin-top: 6px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.msg-embed-section.open .msg-embed-wrap { display: block; }
.chat-embed {
  display: block;
  border: none;
  border-radius: var(--radius-sm);
  background: #000;
  max-width: 480px;
}

/* ── Activity modal window ── */
.activity-modal {
  position: fixed;
  width: 720px; height: 720px;
  min-width: 320px; min-height: 240px;
  background: #111115;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.8);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: height 0.2s;
}
.activity-modal.minimized {
  height: 42px;
}
.activity-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  height: 42px;
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: grab; user-select: none; flex-shrink: 0;
}
.activity-modal-header:active { cursor: grabbing; }
.activity-modal-title {
  font-size: 13px; font-weight: 600; color: #d0ccf0;
}
.activity-modal-controls {
  display: flex; gap: 4px;
}
.activity-modal-btn {
  width: 24px; height: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  color: rgba(255,255,255,0.7);
  font-size: 13px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.activity-modal-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }
.activity-modal-body {
  flex: 1; overflow: hidden;
}
.activity-iframe {
  width: 100%; height: 100%; border: none; display: block;
}

/* ── Activity picker dropdown ── */
.activity-picker-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px); left: 0; right: 0;
  background: #1a1a26;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 120;
  overflow: hidden;
}
.activity-picker-dropdown.visible { display: block; }
.activity-pick-item {
  display: block; width: 100%;
  padding: 9px 12px;
  background: transparent; border: none;
  text-align: left; color: var(--text);
  font-size: 13px; cursor: pointer;
  transition: background 0.1s;
}
.activity-pick-item:hover { background: rgba(255,255,255,0.07); }

/* ── Activity cards in sidebar ── */
.activity-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
}
.activity-card-name {
  color: var(--text);
  font-weight: 600;
  margin-bottom: 5px;
}
.activity-card-actions {
  display: flex; gap: 5px;
}

/* ── Voice chat ── */
#voice-section { border-top: 1px solid var(--border); }
.voice-participant {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.voice-participant.voice-active {
  color: var(--text);
}
.voice-mic-icon { font-size: 14px; }
#voice-join-btn.btn-danger {
  background: rgba(220,20,60,0.15);
  border-color: rgba(220,20,60,0.4);
  color: #e05070;
}
#voice-join-btn.btn-danger:hover {
  background: rgba(220,20,60,0.25);
}
/* Hidden audio elements */
.voice-audio { display: none; }

/* ============================================================
   Scheduling, Directory & Bookings — new styles
   ============================================================ */

/* ── input[type=number] base ── */
input[type="number"],
input[type="date"],
input[type="time"] {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
body.theme-light input[type="number"],
body.theme-light input[type="date"],
body.theme-light input[type="time"] {
  background: rgba(255,255,255,0.9);
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}

/* ── Dashboard layout with sidebar ── */
.dashboard-with-schedule {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 69px); /* minus header */
}

/* ── Today's schedule sidebar ── */
.schedule-sidebar {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  margin: 24px 0 24px 24px;
  padding: 0;
  overflow: hidden;
  position: sticky;
  top: 85px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}
.schedule-sidebar-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  position: sticky;
  top: 0;
  background: var(--surface);
  backdrop-filter: blur(10px);
  z-index: 1;
}
.schedule-empty {
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}
.schedule-card {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.schedule-card:last-child { border-bottom: none; }
.schedule-card.status-scheduled { border-left: 3px solid var(--accent); }
.schedule-card.status-pending   { border-left: 3px solid rgba(255,170,50,0.7); }
.schedule-card-time { font-size: 13px; font-weight: 600; color: var(--accent); }
.schedule-card.status-pending .schedule-card-time { color: rgba(255,170,50,0.9); }
.schedule-card-name { font-size: 14px; font-weight: 500; }
.schedule-card-room { font-size: 12px; color: var(--text-muted); }
.schedule-room-link { color: var(--accent); text-decoration: none; }
.schedule-room-link:hover { text-decoration: underline; }
.schedule-card-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-scheduled .schedule-card-status { color: var(--accent); }
.status-pending   .schedule-card-status { color: rgba(255,170,50,0.9); }

/* ── Pending bookings section ── */
.booking-list { display: flex; flex-direction: column; gap: 12px; }
.booking-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.booking-card-meta { flex: 1; min-width: 200px; }
.booking-card-name { font-size: 15px; font-weight: 600; }
.booking-card-time { font-size: 13px; color: var(--accent); margin-top: 2px; }
.booking-card-email { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.booking-card-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.booking-room-select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
}

/* ── Practice types ── */
.practice-types-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.practice-type-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: border-color 0.15s, background 0.15s;
}
.practice-type-checkbox:hover { border-color: var(--accent); background: rgba(124,106,247,0.05); }
.practice-type-checkbox input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

/* ── Schedule builder ── */
.schedule-day-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
}
.schedule-day-row:last-child { border-bottom: none; }
.schedule-day-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 110px;
  flex-shrink: 0;
}
.schedule-day-toggle input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.schedule-day-name { font-size: 14px; font-weight: 500; }
.schedule-day-times {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.15s;
}
.schedule-day-times input[type="time"] {
  width: 110px;
  padding: 6px 10px;
  font-size: 13px;
}

/* ── Date exclusion tags ── */
.excl-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(124,106,247,0.12);
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: 14px;
  font-size: 13px;
  color: var(--accent);
}
.excl-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}
.excl-tag button:hover { color: var(--crimson-bright); }

/* ── Practitioner Directory ── */
/* ── Hero Section ──────────────────────────────────────────────── */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, rgba(124,106,247,0.12) 0%, transparent 70%),
              var(--bg);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px;
  max-width: 600px;
}
.hero-logo {
  max-height: 200px;
  margin-bottom: 24px;
}
.hero-wordmark {
  font-size: clamp(36px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 20%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
  line-height: 1.1;
}
.hero-tagline {
  font-size: clamp(15px, 2.5vw, 19px);
  color: var(--text-muted);
  margin-bottom: 36px;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-btn {
  padding: 13px 32px;
  font-size: 15px;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  opacity: 0.45;
  animation: hero-bounce 2.4s ease-in-out infinite;
  z-index: 2;
}
@keyframes hero-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ── Cloud Animation ────────────────────────────────────────────── */
.hero-clouds {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hero-cloud {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.055);
  filter: blur(40px);
  animation: cloud-drift linear infinite;
}
/* Each cloud: different size, vertical position, speed, starting offset */
.hero-cloud-1 {
  width: 520px; height: 160px;
  top: 12%;
  animation-duration: 55s;
  animation-delay: 0s;
}
.hero-cloud-2 {
  width: 380px; height: 120px;
  top: 28%;
  animation-duration: 72s;
  animation-delay: -18s;
  background: rgba(255,255,255,0.04);
}
.hero-cloud-3 {
  width: 640px; height: 200px;
  top: 52%;
  animation-duration: 90s;
  animation-delay: -35s;
  background: rgba(124,106,247,0.06);
  filter: blur(60px);
}
.hero-cloud-4 {
  width: 300px; height: 100px;
  top: 68%;
  animation-duration: 48s;
  animation-delay: -10s;
  background: rgba(255,255,255,0.03);
}
.hero-cloud-5 {
  width: 460px; height: 140px;
  top: 82%;
  animation-duration: 65s;
  animation-delay: -28s;
  background: rgba(124,106,247,0.045);
  filter: blur(50px);
}
@keyframes cloud-drift {
  from { transform: translateX(110vw); }
  to   { transform: translateX(-130%); }
}

/* Clouds on browse/directory view (no hero) */
.directory-clouds {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.directory-page .directory-body {
  position: relative;
  z-index: 1;
}

/* ── Directory page ─────────────────────────────────────────────── */
.directory-page {
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
}
.directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,15,0.92);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}
body.theme-light .directory-header {
  background: rgba(240,240,248,0.95);
  border-bottom-color: rgba(0,0,0,0.1);
}
.directory-header-brand .app-name {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #e8e8f0, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.directory-header-nav { display: flex; align-items: center; gap: 10px; }
.directory-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 32px;
}
.directory-intro { margin-bottom: 32px; }
.directory-intro h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.directory-fallback {
  display: flex; align-items: center; justify-content: center;
  min-height: 60vh;
}

/* ── Practitioner cards (directory) ── */
.practitioner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.practitioner-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.practitioner-card-avatar {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, rgba(124,106,247,0.15), rgba(0,0,0,0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.practitioner-card-avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; opacity: 0.85;
}
.practitioner-card-avatar-placeholder {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(124,106,247,0.2);
  border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: var(--accent);
}
.practitioner-card-body { padding: 16px 16px 8px; flex: 1; }
.practitioner-card-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.practitioner-card-types {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.practice-badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  background: rgba(124,106,247,0.15);
  color: var(--accent);
  border: 1px solid rgba(124,106,247,0.25);
  white-space: nowrap;
}
.practice-badge-more {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border-color: var(--border);
}
.practitioner-card-about {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.practitioner-card-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

/* ── Book page ── */
.book-page {
  display: flex;
  gap: 32px;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.book-profile {
  width: 260px;
  min-width: 220px;
  flex-shrink: 0;
  padding: 24px;
  text-align: center;
  position: sticky;
  top: 80px;
}
.book-profile-avatar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.book-profile-avatar img {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--accent);
}
.book-profile-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.book-profile-about {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: left;
  margin-top: 12px;
}
.book-flow { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 20px; }
.book-step { padding: 24px; }
.book-step h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* ── Date scroller ── */
.date-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.date-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-width: 64px;
}
.date-btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.date-btn.active { border-color: var(--accent); background: rgba(124,106,247,0.15); }
.date-btn-dow { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.date-btn-d   { font-size: 20px; font-weight: 700; line-height: 1; }
.date-btn-mon { font-size: 11px; color: var(--text-muted); }

/* ── Time slots ── */
.time-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.time-slot-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s;
}
.time-slot-btn:hover { border-color: var(--accent); background: var(--surface-hover); }
.time-slot-btn.active { border-color: var(--accent); background: rgba(124,106,247,0.15); color: var(--accent); }

/* ── Avatar preset grid (booking) ── */
.avatar-preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.avatar-preset-opt {
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  object-fit: cover;
  transition: border-color 0.15s, transform 0.1s;
}
.avatar-preset-opt:hover { border-color: var(--accent); transform: scale(1.05); }
.avatar-preset-opt.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Waiting room overlay ── */
.waiting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,13,15,0.88);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.waiting-card {
  text-align: center;
  padding: 48px 40px;
  max-width: 400px;
  width: 90%;
}
.waiting-pulse {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(124,106,247,0.2);
  border: 3px solid var(--accent);
  margin: 0 auto 24px;
  animation: waitPulse 2s ease-in-out infinite;
}
@keyframes waitPulse {
  0%,100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.1); opacity: 0.6; }
}
.waiting-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.waiting-sub {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 8px;
}
.waiting-muted {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── flex-1 helper ── */
.flex-1 { flex: 1; }

/* ── Identity & Inclusivity Sections (profile.php) ─────────── */
.identity-field-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.identity-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0.85;
  filter: brightness(0) invert(1);
}
.identity-visibility-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.identity-visibility-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Toggle switch (inclusivity) */
.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-switch input[type="checkbox"] {
  display: none;
}
.toggle-track {
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: left 0.2s, background 0.2s;
}
.toggle-switch input:checked ~ .toggle-track {
  background: rgba(124,106,247,0.35);
  border-color: var(--accent);
}
.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  left: 20px;
  background: var(--accent);
}

/* ── Practitioner directory card additions ────────────────────*/
.practitioner-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.practitioner-card-inclusivity {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.inclusivity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(124,106,247,0.18);
  color: var(--accent);
  border: 1px solid rgba(124,106,247,0.3);
  white-space: nowrap;
}
.practitioner-card-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.lang-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.lang-badge-more {
  color: var(--text-muted);
}

/* ── Schedule sidebar header update ─────────────────────────── */
.schedule-sidebar-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sched-full-btn {
  font-size: 11px !important;
  padding: 4px 8px !important;
  white-space: nowrap;
}

/* ── Booking/schedule avatars ────────────────────────────────── */
.booking-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,106,247,0.18);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  border-radius: 50%;
}

/* Schedule card with avatar */
.schedule-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.schedule-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.schedule-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.schedule-card-detail {
  flex: 1;
  min-width: 0;
}

/* Booking card with avatar */
.booking-card-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.booking-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.booking-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Calendar Modal ──────────────────────────────────────────── */
.cal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cal-modal-box {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cal-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.cal-month-label {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
}
.cal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  margin-left: auto;
}
.cal-close-btn:hover { background: rgba(255,255,255,0.07); color: var(--text); }

.cal-grid-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.cal-grid-head > div {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal-loading {
  grid-column: span 7;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.cal-cell {
  min-height: 80px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
.cal-cell-empty {
  background: transparent;
  border-color: transparent;
}
.cal-cell-today {
  border-color: rgba(124,106,247,0.5);
  background: rgba(124,106,247,0.06);
}
.cal-cell-past {
  opacity: 0.6;
}
/* Availability states */
.cal-cell-working {
  background: rgba(72,199,142,0.07);
  border-color: rgba(72,199,142,0.22);
}
.cal-cell-working .cal-day-num {
  color: #48c78e;
}
.cal-cell-excluded {
  background: rgba(255,180,50,0.07);
  border-color: rgba(255,180,50,0.22);
}
.cal-cell-excluded .cal-day-num {
  color: #f5c842;
}
.cal-cell-off {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}
/* today overrides availability border */
.cal-cell-today.cal-cell-working,
.cal-cell-today.cal-cell-excluded,
.cal-cell-today.cal-cell-off {
  border-color: rgba(124,106,247,0.5);
  background: rgba(124,106,247,0.06);
}
.cal-day-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 2px;
  cursor: default;
}
.cal-day-num[title] {
  cursor: help;
}
.cal-cell-today .cal-day-num {
  color: var(--accent);
}

.cal-event {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  overflow: hidden;
  cursor: default;
}
.cal-event-scheduled { background: rgba(124,106,247,0.25); color: var(--accent); }
.cal-event-pending    { background: rgba(244,143,177,0.2); color: #f48fb1; }
.cal-event-completed  { background: rgba(100,181,246,0.15); color: #64b5f6; }
.cal-event-cancelled  { background: rgba(255,255,255,0.05); color: var(--text-muted); text-decoration: line-through; }

.cal-event-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.cal-event-avatar-initial {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  flex-shrink: 0;
  color: inherit;
}
.cal-event-time {
  opacity: 0.75;
  flex-shrink: 0;
}
.cal-event-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.cal-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.cal-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.cal-dot-scheduled { background: var(--accent); }
.cal-dot-pending   { background: #f48fb1; }
.cal-dot-completed { background: #64b5f6; }
.cal-dot-cancelled { background: rgba(255,255,255,0.2); }
.cal-avail-legend  { margin-top: 6px; border-top: none; padding-top: 0; }
.cal-avail-swatch {
  display: inline-block;
  width: 12px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  border: 1px solid transparent;
}
.cal-avail-working  { background: rgba(72,199,142,0.2);  border-color: rgba(72,199,142,0.4); }
.cal-avail-excluded { background: rgba(245,200,66,0.2);  border-color: rgba(245,200,66,0.4); }
.cal-avail-off      { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); }

/* ── Booking Detail Modal ──────────────────────────────────────── */
.booking-detail-box {
  width: 100%;
  max-width: 480px;
  padding: 0;
  overflow: hidden;
}
.booking-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.booking-detail-avatar-wrap {
  flex-shrink: 0;
}
.booking-detail-avatar-wrap img,
.booking-detail-avatar-wrap .booking-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  background: rgba(124,106,247,0.18);
  color: var(--accent);
  border: 2px solid rgba(124,106,247,0.35);
}
.booking-detail-title {
  flex: 1;
  min-width: 0;
}
.booking-detail-name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.booking-detail-status {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 3px;
  opacity: .75;
}
.booking-detail-status.status-scheduled { color: var(--accent); }
.booking-detail-status.status-pending   { color: #f48fb1; }
.booking-detail-status.status-completed { color: #64b5f6; }
.booking-detail-status.status-cancelled { color: var(--text-muted); }
.booking-detail-body {
  padding: 16px 20px 8px;
}
.booking-detail-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: baseline;
}
.booking-detail-row:last-child {
  border-bottom: none;
}
.booking-detail-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  width: 52px;
  flex-shrink: 0;
}
.booking-detail-value {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  word-break: break-word;
}
.booking-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ── Draggable modal handles ─────────────────────────────────── */
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }

/* ── Settings layout (admin + profile — Facebook-style sidebar) ── */
.settings-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}
.settings-nav {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 0 40px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  background: rgba(13,13,15,0.6);
}
body.theme-light .settings-nav {
  background: rgba(240,240,248,0.8);
}
.settings-nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
  line-height: 1.3;
}
.settings-nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.settings-nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(124,106,247,0.07);
}
.settings-nav-item svg {
  flex-shrink: 0;
  opacity: .65;
}
.settings-nav-item.active svg {
  opacity: 1;
}
.settings-main {
  flex: 1;
  min-width: 0;
  padding: 36px 48px;
  max-width: 820px;
}
@media (max-width: 768px) {
  .settings-layout { flex-direction: column; }
  .settings-nav {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 0;
    gap: 0;
  }
  .settings-nav-label { display: none; }
  .settings-nav-item { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .settings-nav-item.active { border-bottom-color: var(--accent); border-left-color: transparent; }
  .settings-main { padding: 24px 20px; }
}
.settings-section { display: none; }
.settings-section.active { display: block; }
.settings-section-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.settings-section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Site Banners ────────────────────────────────────────────── */
.site-banners { display: flex; flex-direction: column; gap: 0; }
.site-banner {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

/* ── Agreement step (book.php) ──────────────────────────────── */
.agreement-scroll {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  background: rgba(255,255,255,0.02);
  font-size: 13.5px;
  line-height: 1.65;
}
.agreement-scroll p { margin: 0 0 10px; }
.agreement-scroll ul { margin: 0 0 10px; padding-left: 20px; }
.agreement-scroll li { margin-bottom: 4px; }
.agreement-section { margin-bottom: 20px; }
.agreement-section:last-child { margin-bottom: 0; }
.agreement-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--accent);
  margin-bottom: 8px;
}
.agreement-section-crisis .agreement-section-title { color: #f48fb1; }
.agreement-consent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}
.agreement-consent-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }

/* ── Service type (book.php + directory) ─────────────────────── */
.book-service-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 20px;
  margin: 12px auto 0;
}
.svc-clinical     { background: rgba(100,181,246,0.15); color: #64b5f6; }
.svc-non-clinical { background: rgba(124,106,247,0.15); color: var(--accent); }
.book-service-disclosure {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
  line-height: 1.55;
  text-align: center;
}
.svc-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
}
.svc-badge-clinical     { background: rgba(100,181,246,0.15); color: #64b5f6; }
.svc-badge-non-clinical { background: rgba(124,106,247,0.12); color: var(--accent); }

/* ── Welcome Overlay ──────────────────────────────────────────── */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 9, 20, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  cursor: default;
}
.welcome-overlay.welcome-visible {
  opacity: 1;
  pointer-events: auto;
}
.welcome-card {
  text-align: center;
  padding: 0 24px;
}
.welcome-text {
  font-size: 26px;
  font-weight: 300;
  color: #e0dff5;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}
.welcome-sub {
  font-size: 15px;
  color: rgba(224, 223, 245, 0.55);
  font-weight: 300;
  line-height: 1.9;
}

/* ── Password strength meter ─────────────────────────────────── */
.pw-meter {
  margin-top: 8px;
}
.pw-meter-track {
  position: relative;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: visible;
}
.pw-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width .25s ease, background .25s ease;
  position: relative;
  z-index: 1;
}
.pw-meter-tick {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  border-radius: 1px;
  background: rgba(255,255,255,0.22);
  z-index: 2;
  pointer-events: none;
}
.pw-meter-tick.pw-tick-pract {
  background: rgba(124,106,247,0.55);
}
.pw-meter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  min-height: 14px;
}
.pw-meter-lbl {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  transition: color .2s;
}
.pw-meter-pct {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color .2s;
}
.pw-req-text {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 5px;
  line-height: 1.55;
}

/* ── Session not-begun dim ────────────────────────────────────── */
#container.session-not-begun #chat-pane {
  opacity: 0.45;
  transition: opacity 0.5s ease;
}
#container.session-not-begun #chat-pane #input-area {
  pointer-events: none;
}
#container.session-not-begun #messages {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   Session Review Overlay
   ═══════════════════════════════════════════════════════════════ */
.sr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg, #080c1e);
  display: flex;
  flex-direction: column;
  font-family: inherit;
}
.sr-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--surface, rgba(255,255,255,0.03));
  flex-shrink: 0;
}
.sr-topbar-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #e0dff5);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sr-topbar-meta {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted, rgba(224,223,245,0.5));
}
.sr-close-btn {
  background: none;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  color: var(--text-muted, rgba(224,223,245,0.5));
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sr-close-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text, #e0dff5);
}
.sr-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ── Chat log ── */
.sr-chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sr-day-divider {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-dim, rgba(224,223,245,0.3));
  text-transform: uppercase;
  margin: 18px 0 10px;
}
.sr-msg {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  scroll-margin-top: 12px;
}
.sr-msg.sr-self { flex-direction: row-reverse; }
.sr-msg.sr-hidden { display: none; }
.sr-msg.sr-flash .sr-bubble {
  animation: srFlash .7s ease;
}
@keyframes srFlash {
  0%,100% { box-shadow: none; }
  40% { box-shadow: 0 0 0 3px rgba(124,106,247,0.6); }
}
.sr-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 2px;
}
.sr-av-ph {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(124,106,247,0.15));
  border: 1px solid rgba(124,106,247,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent, #7c6af7);
  flex-shrink: 0;
  margin-top: 2px;
}
.sr-bubble-wrap {
  max-width: 62%;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sr-msg.sr-self .sr-bubble-wrap { align-items: flex-end; }
.sr-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim, rgba(224,223,245,0.3));
}
.sr-msg.sr-self .sr-meta { flex-direction: row-reverse; }
.sr-meta-name { font-weight: 600; color: var(--text-muted, rgba(224,223,245,0.5)); }
.sr-bubble {
  background: var(--surface2, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px 14px 14px 4px;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text, #e0dff5);
  word-break: break-word;
  position: relative;
}
.sr-msg.sr-self .sr-bubble {
  background: rgba(124,106,247,0.12);
  border-color: rgba(124,106,247,0.2);
  border-radius: 14px 14px 4px 14px;
}
.sr-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: rgba(124,106,247,0.8);
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* Voice note bubble */
.sr-voice-bubble {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
}
.sr-voice-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(124,106,247,0.8);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sr-audio {
  width: 100%;
  height: 32px;
  accent-color: var(--accent, #7c6af7);
}
.sr-audio::-webkit-media-controls-panel { background: rgba(124,106,247,0.08); }
.sr-caption {
  font-size: 12px;
  color: var(--text-muted, rgba(224,223,245,0.5));
  font-style: italic;
}

/* File bubble */
.sr-file-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent, #7c6af7);
  font-size: 13px;
  text-decoration: none;
}
.sr-file-link:hover { text-decoration: underline; }
.sr-file-size { font-size: 11px; color: var(--text-dim, rgba(224,223,245,0.3)); }

/* Inline text highlights */
mark.hl-yellow  { background: rgba(255,230,50,.32);  color: inherit; border-radius: 3px; padding: 0 1px; }
mark.hl-pink    { background: rgba(255,100,150,.28); color: inherit; border-radius: 3px; padding: 0 1px; }
mark.hl-blue    { background: rgba(80,180,255,.28);  color: inherit; border-radius: 3px; padding: 0 1px; }
mark.hl-crimson { background: rgba(220,50,80,.28);   color: inherit; border-radius: 3px; padding: 0 1px; }

/* Notes section at bottom of chat */
.sr-notes-section {
  margin-top: 32px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  padding-top: 20px;
}
.sr-notes-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(224,223,245,0.3));
  margin-bottom: 10px;
}
.sr-notes-content {
  background: var(--accent-dim, rgba(124,106,247,0.06));
  border: 1px solid rgba(124,106,247,0.15);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted, rgba(224,223,245,0.5));
  white-space: pre-wrap;
}

/* ── Side panel ── */
.sr-panel {
  width: 252px;
  flex-shrink: 0;
  border-left: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--surface, rgba(255,255,255,0.02));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sr-panel-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sr-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(224,223,245,0.3));
  margin-bottom: 8px;
}
.sr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sr-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: none;
  font-size: 12px;
  color: var(--text-muted, rgba(224,223,245,0.5));
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.sr-chip:hover { background: rgba(255,255,255,0.05); }
.sr-chip.on {
  background: rgba(124,106,247,0.14);
  border-color: rgba(124,106,247,0.4);
  color: var(--accent, #7c6af7);
}
.sr-chip.on.chip-yellow { background: rgba(255,230,50,.14); border-color: rgba(255,220,0,.45); color: #e6ca00; }
.sr-chip.on.chip-pink   { background: rgba(255,100,150,.14); border-color: rgba(255,80,130,.45); color: #ff7aaa; }
.sr-chip.on.chip-blue   { background: rgba(80,180,255,.14); border-color: rgba(60,160,255,.45); color: #6ec6ff; }
.sr-chip.on.chip-crimson{ background: rgba(220,50,80,.14); border-color: rgba(220,40,70,.45); color: #ff7a8a; }
.sr-chip-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.sr-chip-dot.yellow  { background: #e6ca00; }
.sr-chip-dot.pink    { background: #ff7aaa; }
.sr-chip-dot.blue    { background: #6ec6ff; }
.sr-chip-dot.crimson { background: #ff7a8a; }
.sr-chip-count {
  font-size: 10px;
  opacity: .6;
}

/* Jump-to list */
.sr-jump-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sr-jump-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  background: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.sr-jump-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border, rgba(255,255,255,0.08));
}
.sr-jump-icon {
  flex-shrink: 0;
  font-size: 13px;
  margin-top: 1px;
}
.sr-jump-body { flex: 1; min-width: 0; }
.sr-jump-who {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, rgba(224,223,245,0.5));
  margin-bottom: 2px;
}
.sr-jump-time {
  font-size: 10px;
  color: var(--text-dim, rgba(224,223,245,0.3));
  margin-bottom: 3px;
}
.sr-jump-snippet {
  font-size: 12px;
  color: var(--text-muted, rgba(224,223,245,0.5));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-empty-panel {
  font-size: 12px;
  color: var(--text-dim, rgba(224,223,245,0.3));
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

/* ═══════════════════════════════════════════════════════════════
   Inbox Messaging
   ═══════════════════════════════════════════════════════════════ */

/* Badge */
.ib-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e05252;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 0 5px;
  margin-left: auto;
  flex-shrink: 0;
}

/* Two-pane layout */
.ib-layout {
  display: flex;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

/* Conversation list (left pane) */
.ib-list {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border, rgba(255,255,255,0.08));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ib-list-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #dddcf2);
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ib-list-scroll {
  flex: 1;
  overflow-y: auto;
}
.ib-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .12s;
}
.ib-conv-item:hover  { background: rgba(255,255,255,0.04); }
.ib-conv-item.active { background: var(--accent-dim, rgba(124,106,247,0.12)); }
.ib-conv-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ib-conv-av-ph {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-dim, rgba(124,106,247,0.15));
  border: 1px solid rgba(124,106,247,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent, #7c6af7);
  flex-shrink: 0;
}
.ib-conv-body {
  flex: 1;
  min-width: 0;
}
.ib-conv-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #dddcf2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.ib-conv-snippet {
  font-size: 11.5px;
  color: var(--text-muted, rgba(221,220,242,0.44));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib-conv-meta {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.ib-conv-time {
  font-size: 10px;
  color: var(--text-dim, rgba(221,220,242,0.26));
}

/* Thread (right pane) */
.ib-thread-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.ib-thread-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #dddcf2);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ib-thread-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ib-day-sep {
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(221,220,242,0.26));
  margin: 12px 0 6px;
}

/* Message bubbles */
.ib-msg-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ib-msg-row.ib-mine { flex-direction: row-reverse; }
.ib-msg-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.ib-msg-av-ph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124,106,247,0.15);
  border: 1px solid rgba(124,106,247,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent, #7c6af7);
  flex-shrink: 0;
}
.ib-bubble {
  max-width: 68%;
  background: var(--surface2, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 14px 14px 14px 4px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text, #dddcf2);
  word-break: break-word;
}
.ib-msg-row.ib-mine .ib-bubble {
  background: rgba(124,106,247,0.13);
  border-color: rgba(124,106,247,0.22);
  border-radius: 14px 14px 4px 14px;
}
.ib-msg-time {
  font-size: 10px;
  color: var(--text-dim, rgba(221,220,242,0.26));
  margin-top: 3px;
  padding: 0 4px;
}
.ib-msg-row.ib-mine .ib-msg-time { text-align: right; }

/* Image messages */
.ib-img-thumb {
  max-width: 200px;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
  display: block;
}

/* Voice note in inbox */
.ib-audio {
  width: 100%;
  min-width: 200px;
  height: 32px;
  accent-color: var(--accent, #7c6af7);
}

/* Compose area */
.ib-compose {
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  padding: 12px 16px;
  flex-shrink: 0;
  background: var(--surface, rgba(255,255,255,0.02));
}
.ib-compose-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.ib-compose-text {
  flex: 1;
  background: var(--surface2, rgba(255,255,255,0.05));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 20px;
  color: var(--text, #dddcf2);
  font-family: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  outline: none;
  resize: none;
  min-height: 38px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.45;
  transition: border-color .15s;
}
.ib-compose-text:focus { border-color: rgba(124,106,247,0.45); }
.ib-compose-text::placeholder { color: var(--text-dim, rgba(221,220,242,0.26)); }
.ib-compose-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  background: none;
  color: var(--text-muted, rgba(221,220,242,0.44));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s;
}
.ib-compose-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text, #dddcf2); }
.ib-compose-icon-btn.recording {
  background: rgba(224,82,82,0.15);
  border-color: rgba(224,82,82,0.4);
  color: #e05252;
  animation: ibRecordPulse 1s ease infinite;
}
@keyframes ibRecordPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(224,82,82,0); }
  50%      { box-shadow: 0 0 0 5px rgba(224,82,82,0.2); }
}
.ib-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent, #7c6af7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity .15s;
}
.ib-send-btn:disabled { opacity: .4; cursor: default; }
.ib-send-btn:not(:disabled):hover { opacity: .85; }
.ib-preview-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ib-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(124,106,247,0.3);
}
.ib-preview-item img {
  display: block;
  height: 60px;
  width: auto;
  object-fit: cover;
}
.ib-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.65);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ib-voice-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(224,82,82,0.08);
  border: 1px solid rgba(224,82,82,0.2);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #e05252;
}
.ib-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, rgba(221,220,242,0.44));
  font-size: 13px;
  gap: 8px;
  padding: 40px;
}

/* Lightbox */
.ib-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9900;
  background: rgba(0,0,0,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.ib-lightbox.open { display: flex; }
.ib-lightbox img {
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.ib-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.ib-lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════════════════════
   Email Template Editor
   ═══════════════════════════════════════════════════════════════ */
.etpl-layout { display: flex; gap: 20px; align-items: flex-start; }
.etpl-list { flex: 0 0 220px; display: flex; flex-direction: column; gap: 6px; }
.etpl-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--surface2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s;
}
.etpl-row:hover { border-color: rgba(124,106,247,0.35); }
.etpl-row.active { border-color: rgba(124,106,247,0.5); background: rgba(124,106,247,0.07); }
.etpl-row-name { font-size: 13px; font-weight: 600; }
.etpl-row-key { font-size: 11px; color: var(--text-dim, rgba(255,255,255,0.3)); font-family: monospace; }
.etpl-editor {
  flex: 1;
  min-width: 0;
  background: var(--surface2, rgba(255,255,255,0.04));
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: 10px;
  padding: 20px;
}
.etpl-editor-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 8px;
  flex-wrap: wrap;
}
.etpl-editor textarea {
  width: 100%;
  background: var(--bg, #080910);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  color: var(--text, #dddcf2);
  font-family: monospace;
  font-size: 12.5px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 180px;
  outline: none;
  line-height: 1.55;
  margin-top: 4px;
}
.etpl-editor textarea:focus { border-color: rgba(124,106,247,0.4); }
.etpl-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,0.7);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.etpl-preview-box {
  background: var(--surface, #12131f);
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
  width: 100%;
  max-width: 680px;
  padding: 20px;
  position: relative;
  color: var(--text, #dddcf2);
}
.etpl-preview-topbar {
  background: #1a1b2e;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #dddcf2;
  font-weight: 600;
}
.etpl-preview-iframe {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
}

/* ── Global mobile base ── */
@media (max-width: 640px) {
  .setup-card { padding: 28px 20px !important; }
  .auth-page { padding: 16px; }
}

/* ── Dashboard mobile ── */
@media (max-width: 768px) {
  .cms-wrap {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
  }
  .cms-sidebar {
    height: auto !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }
  .cms-sidebar.mobile-open {
    max-height: 80vh;
    overflow-y: auto;
  }
  .cms-body { height: auto !important; overflow-y: auto; }
  .cms-topbar { padding: 0 16px; }
  .topbar-hamburger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: none; border-radius: 7px;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
  }
  .cms-section { padding: 16px !important; }
  .sec-hdr { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .dash-stat-grid { grid-template-columns: 1fr 1fr !important; }
  .dash-panel-grid { grid-template-columns: 1fr !important; }
  .booking-grid { grid-template-columns: 1fr !important; }
}
.topbar-hamburger { display: none; }

/* ── Login / Register mobile ── */
@media (max-width: 480px) {
  .auth-page .glass-panel { padding: 28px 20px !important; margin: 16px !important; }
}

/* ── Admin mobile ── */
@media (max-width: 768px) {
  .admin-layout { flex-direction: column !important; }
  .admin-sidebar { width: 100% !important; position: static !important; border-right: none !important; border-bottom: 1px solid var(--border); display: flex !important; flex-wrap: wrap; flex-direction: row !important; }
  .admin-main { padding: 20px !important; }
  .admin-user-table { font-size: 12px; }
  .admin-user-table th:nth-child(3),
  .admin-user-table td:nth-child(3) { display: none; }
}

/* ── Room mobile layout ── */
@media (max-width: 768px) {
  /* Show sidebar toggle button */
  #sidebar-toggle { display: flex; }

  /* Sidebar: hidden by default on mobile, slides in as overlay */
  #sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 60vw !important;
    min-width: 0 !important;
    max-width: 320px;
    z-index: 200;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
  }
  #sidebar.sidebar-open {
    transform: translateX(0);
  }
  /* Backdrop when sidebar is open */
  #sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
  }
  #sidebar-backdrop.visible { display: block; }

  /* Main takes full width on mobile */
  #container { display: block; height: 100%; }
  #main { height: 100%; padding: 6px; }

  /* Room and chat panes adjust for smaller padding */
  #room {
    left: 6px; right: 6px; top: 6px;
    height: calc(var(--room-height,60%) - 6px);
  }
  #horizontal-divider {
    left: 6px; right: 6px;
    height: 22px;
    background: transparent;
    display: flex; align-items: center; justify-content: center;
    margin-top: -8px;
  }
  #horizontal-divider::after {
    content: ''; display: block;
    width: 36px; height: 4px;
    background: var(--border-hi, rgba(124,106,247,0.35));
    border-radius: 2px;
    transition: background 0.15s;
  }
  #horizontal-divider:hover::after,
  #horizontal-divider:active::after { background: var(--accent); }
  #chat-pane { left: 6px; right: 6px; bottom: 6px; }

  /* Collapsed room on mobile: extra generous chat space */
  #main.room-collapsed #chat-pane {
    top: 26px !important;
    height: calc(100% - 34px) !important;
  }
}

/* ── Media Recommendation Widget ── */
/* Sizing is authoritative in room.php's inline <style> block (loads after this file).
   Only non-conflicting base styles live here. */
.media-rec-widget {
  background: linear-gradient(160deg, #0d0d18 0%, #060608 100%);
  border: 1px solid rgba(124,106,247,0.22);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 4px;
  display: inline-block;
  vertical-align: top;
}
.mrw-inner { display: flex; min-height: 90px; }
.mrw-cover {
  width: 135px; flex-shrink: 0;
  background: rgba(0,0,0,0.5);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mrw-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mrw-cover-ph { font-size: 24px; color: rgba(255,255,255,0.15); position: absolute; }
.mrw-content {
  padding: 10px 12px; flex: 1; min-width: 0;
  background: linear-gradient(160deg, #0d0d18 0%, #060608 100%);
}
.mrw-badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: rgba(124,106,247,0.85); margin-bottom: 5px;
}
.mrw-title {
  font-size: 13px; font-weight: 700; color: #dddcf2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.mrw-author {
  font-size: 11.5px; color: rgba(221,220,242,0.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px;
}
.mrw-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 5px; }
.mrw-meta span { font-size: 10.5px; color: rgba(221,220,242,0.4); }
.mrw-meta-sep { color: rgba(221,220,242,0.2) !important; }
.mrw-desc {
  font-size: 11px; color: rgba(221,220,242,0.5); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mrw-note {
  font-size: 11px; color: rgba(221,220,242,0.55); font-style: italic;
  margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(124,106,247,0.15);
  line-height: 1.5;
}
.mrw-amazon {
  display: block; margin-top: 6px; font-size: 11px; font-weight: 600;
  color: rgba(245,200,66,0.75); text-decoration: none;
}
.mrw-amazon:hover { color: #f5c842; }
.mrw-more-link {
  display: inline-block; margin-top: 7px; font-size: 11px; font-weight: 600;
  color: rgba(124,106,247,0.8); text-decoration: none;
}
.mrw-more-link:hover { color: #c5b8ff; }

/* ── Media search result rows (inside modal) ── */
.mrm-result-row {
  display: flex; gap: 12px; padding: 11px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer; transition: background 0.12s; align-items: flex-start;
}
.mrm-result-row:hover { background: rgba(124,106,247,0.07); }
.mrm-result-cover {
  width: 42px; height: 60px; border-radius: 4px;
  background: rgba(255,255,255,0.05); flex-shrink: 0;
  overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.mrm-result-cover img { width: 100%; height: 100%; object-fit: cover; }
.mrm-result-info { flex: 1; min-width: 0; }
.mrm-result-title { font-size: 13px; font-weight: 700; color: #dddcf2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrm-result-author { font-size: 12px; color: rgba(221,220,242,0.55); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrm-result-chips { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.mrm-result-chips span { font-size: 10.5px; color: rgba(221,220,242,0.4); background: rgba(255,255,255,0.05); padding: 1px 6px; border-radius: 3px; }
.mrm-detail-inner { padding: 16px 20px; }
.mrm-detail-top { display: flex; gap: 16px; margin-bottom: 14px; }
.mrm-detail-cover { width: 90px; border-radius: 7px; flex-shrink: 0; overflow: hidden; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.mrm-detail-cover img { width: 100%; display: block; }
.mrm-detail-info { flex: 1; }
.mrm-detail-title { font-size: 15px; font-weight: 700; color: #dddcf2; margin-bottom: 5px; }
.mrm-detail-author { font-size: 13px; color: rgba(221,220,242,0.6); margin-bottom: 8px; }
.mrm-detail-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mrm-detail-chip { font-size: 11px; background: rgba(124,106,247,0.1); border: 1px solid rgba(124,106,247,0.22); border-radius: 4px; padding: 2px 8px; color: rgba(221,220,242,0.6); }
.mrm-detail-desc { font-size: 12.5px; color: rgba(221,220,242,0.6); line-height: 1.65; margin-bottom: 14px; max-height: 140px; overflow-y: auto; }
