/* ═══════════════════════════════════════════════════════════
   Bloom — Dark Dating Chat Theme
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand rose — sync with theme-color, manifest, and icon mark */
  --brand:        #f43f5e;
  --pink:         var(--brand);
  --pink-dark:    #e11d48;
  --pink-light:   #fda4af;
  --accent:       #fb7185;
  --bg:           #0d0d14;
  --surface:      #16162a;
  --card:         #1e1e38;
  --card-hover:   #282848;
  --input-bg:     #1e1e38;
  --text:         #f0f0f8;
  --text-muted:   #a8a8c8;
  --text-dim:     rgba(255,255,255,0.65);
  --online:       #4CAF50;
  --border:       rgba(255,255,255,0.06);
  --shadow:       rgba(0,0,0,0.4);
  --bubble-me:    var(--brand);
  --bubble-other: #1e1e38;
  --system-msg:   #c8c8e8;
  --danger:       #ef4444;
  --success:      #4ade80;
  --radius:       12px;
  --radius-lg:    20px;
  --sidebar-w:    280px;
  --header-h:     56px;
  --transition:   0.2s ease;
  --font-hebrew:  'Heebo', 'SF Pro Hebrew', 'Arial Hebrew', 'Noto Sans Hebrew', sans-serif;
}

html {
  height: 100%;
  height: 100dvh;
  font-size: 16px;
}

html, body {
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: var(--font-hebrew);
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

html.legal-page {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body.legal-page {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ── Utility ───────────────────────────────────────────────── */
.hidden  { display: none !important; }
.visible { display: flex !important; }
.text-muted { color: var(--text-muted); font-size: 0.85rem; }
.flex-1 { flex: 1; }
.stage-nav-button { width: 100%; font-size: 0.9rem; }
.stage-nav-button.stage-nav-live,
.sidebar-section.stage-nav-section-live .stage-nav-button {
  border-color: var(--accent, #f43f5e);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #f43f5e) 35%, transparent);
  font-weight: 600;
}
.sidebar-section.stage-nav-section-live .section-title span {
  color: var(--accent, #f43f5e);
}
.text-color-control {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
#text-color {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  cursor: pointer;
  appearance: none;
}

/* ── Overlay ───────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  overflow-y: auto;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  z-index: 1000;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Restart notice overlay ─────────────────────────────────── */
.restart-overlay {
  z-index: 3000;
  background: rgba(0, 0, 0, 0.88);
}
.restart-notice-card {
  margin: auto;
  text-align: center;
  color: #fff;
  padding: 2rem 1.5rem;
  width: min(520px, 100%);
}
.restart-title {
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 1.25rem;
}
.restart-countdown {
  font-size: clamp(4rem, 18vw, 7rem);
  font-weight: 800;
  line-height: 1;
  margin: 0 0 1rem;
  font-variant-numeric: tabular-nums;
  color: var(--pink, #f43f5e);
}
.restart-hint {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  margin: 0;
}

/* ── Login Card ────────────────────────────────────────────── */
.login-card {
  margin: auto;
  background: var(--login-bg, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: min(480px, 100%);
  box-shadow: 0 20px 60px var(--shadow);
  animation: slideUp 0.35s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 0.5rem;
  object-fit: contain;
}
.login-title {
  text-align: center; font-size: 2.2rem; font-weight: 800;
  color: var(--pink);
  background: linear-gradient(135deg, var(--pink), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .login-title {
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.login-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 0.35rem; }
.login-version {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}
.version-link {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}
.version-link:hover,
.version-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.version-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.version-link-button {
  background: none;
  border: none;
  border-bottom: 1px dotted var(--border);
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.feedback-lead {
  margin: -0.5rem 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.feedback-status {
  margin: -0.5rem 0 0.75rem;
  font-size: 0.9rem;
}
.feedback-status.error { color: var(--danger, #e11d48); }
.feedback-status.success { color: var(--accent); }
.login-version-sep {
  color: var(--text-muted);
  opacity: 0.65;
}

/* ── Pre-release construction notices ───────────────────────── */
.pre-release-login-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid rgba(251, 113, 133, 0.45);
  border-radius: var(--radius);
  background: rgba(244, 63, 94, 0.1);
}
.pre-release-login-banner-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.pre-release-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 12px 10px;
  padding: 0.55rem 0.65rem;
  border: 1.5px solid rgba(251, 113, 133, 0.55);
  border-radius: var(--radius);
  background: rgba(244, 63, 94, 0.12);
}
.pre-release-banner-body {
  flex: 1;
  min-width: 0;
}
.pre-release-banner-title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.pre-release-banner-text {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.pre-release-banner-dismiss {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.pre-release-banner-dismiss:hover,
.pre-release-banner-dismiss:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.sidebar-meta-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.7rem;
  font-size: 0.72rem;
  padding-inline-start: 1.75rem;
  text-align: start;
}
.changelog-current-version {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.changelog-page h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.changelog-footer {
  margin-top: 2rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.landing-intro {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.landing-intro-summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  list-style: none;
}
.landing-intro-summary::-webkit-details-marker { display: none; }
.landing-intro-summary::before {
  content: '▸ ';
  display: inline-block;
  transition: transform 0.15s ease;
}
.landing-intro[open] .landing-intro-summary::before { transform: rotate(90deg); }
.landing-intro p { margin-bottom: 0.65rem; }
.landing-intro-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.82rem;
}
.landing-intro-links a {
  color: var(--pink-light);
  text-decoration: none;
}
.landing-intro-links a:hover { text-decoration: underline; }

/* ── Form Fields ───────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.85rem; color: var(--text-muted);
  margin-bottom: 4px; font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%; padding: 10px 14px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-hebrew); font-size: 1rem;
  transition: border-color var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(233,30,99,0.15);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-dim); }
.form-row { display: flex; gap: 0.75rem; }
.form-row.three-col { gap: 0.5rem; }
.form-row.two-col { gap: 0.5rem; flex-wrap: wrap; }
.form-row.two-col > .form-group { min-width: 10rem; }
.profile-details-section {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.profile-details-section summary {
  cursor: pointer;
  color: var(--pink-light);
  font-weight: 600;
  padding: 4px 0 8px;
}
.profile-live-summary {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.85em;
  margin-inline-start: 0.45em;
}
.profile-details-section summary .profile-live-summary {
  display: inline;
}
.chat-header-actions .profile-live-summary {
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  line-height: 1.2;
}
.consent-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 12px 0;
}
.consent-group legend {
  padding: 0 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.consent-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 7px 0;
}
.consent-item input { margin-top: 5px; accent-color: var(--pink); }
.consent-item a { color: var(--pink-light); }
.consent-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 4px 0 0 24px;
  font-size: 0.82rem;
}
.consent-links a { color: var(--pink-light); }
.consent-help { font-size: 0.8rem; margin-top: 8px; }
.consent-help a { color: var(--pink-light); }
.user-controls {
  display: grid;
  gap: 10px;
  padding: 10px 12px 8px;
}
.user-controls.filter-sheet-body {
  gap: 18px;
  padding: 12px 16px 16px;
  overflow-x: clip;
}
.directory-section-title {
  margin: 8px 0 2px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.directory-chips {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.chip-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chip-row-label,
.form-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.emoji-chip,
.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.emoji-chip:hover,
.theme-chip:hover {
  border-color: var(--accent);
}
.emoji-chip.active,
.theme-chip.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--input-bg));
  box-shadow: 0 0 0 1px var(--accent);
}
.emoji-chip:focus-visible,
.theme-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chip-emoji {
  font-size: 1.1rem;
  line-height: 1;
}
.profile-chip-host {
  margin-top: 4px;
}
.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 18px;
  margin: 20px 0 14px;
}
.theme-preview-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.15s, transform 0.15s;
}
.theme-preview-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.theme-preview-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.theme-preview-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-preview-swatch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 28px 20px;
  gap: 4px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.theme-preview-bg { grid-column: 1 / -1; }
.theme-preview-surface { border-radius: 0 0 0 4px; }
.theme-preview-accent { border-radius: 0 0 4px 0; }
.theme-preview-label { text-align: center; }
.appearance-lead {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 4px;
}
.appearance-sheet { width: min(520px, 94vw); }
.bell-settings {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.bell-settings-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
}
.bell-settings-lead { margin-bottom: 12px; }
.bell-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bell-sound-row label { font-weight: 600; min-width: 4.5rem; }
.bell-sound-row select {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}
.bell-preview-btn { flex-shrink: 0; }
.filter-sheet {
  width: min(480px, 94vw);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
}
.filter-sheet-body {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0 12px;
}
.btn-header-filter {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-header-filter:hover {
  border-color: var(--accent);
  background: var(--card-hover);
}
.section-title-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-users-section {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.sidebar-users-section .nav-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.directory-inline-filters {
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.directory-inline-filters.hidden {
  display: none;
}
.directory-inline-filters .user-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.directory-inline-filters label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.directory-inline-filters #user-filter {
  width: 100%;
  box-sizing: border-box;
}
.btn-header-filter[aria-expanded='true'] {
  border-color: var(--accent);
  background: var(--card-hover);
}
.directory-range-filters {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 4px;
}
.dual-range-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dual-range-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.dual-range-label {
  font-weight: 600;
  font-size: 0.9rem;
}
.dual-range-readout {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dual-range-track {
  position: relative;
  height: 36px;
  box-sizing: border-box;
  touch-action: none;
}
.dual-range-rail {
  position: absolute;
  inset-inline: 14px;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--border);
  pointer-events: none;
}
.dual-range-fill {
  position: absolute;
  top: 50%;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: var(--accent);
  pointer-events: none;
  inset-inline-start: calc(14px + var(--fill-start, 0) * (100% - 28px));
  width: calc(max(0px, (var(--fill-end, 1) - var(--fill-start, 0)) * (100% - 28px)));
}
.dual-range-thumb {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  touch-action: none;
  inset-inline-start: calc(14px + var(--pos, 0) * (100% - 28px));
  margin-top: -11px;
  margin-inline-start: -11px;
  z-index: 2;
}
.dual-range-thumb.dual-range-max {
  z-index: 3;
}
.dual-range-thumb.is-active {
  z-index: 4;
}
.dual-range-thumb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dual-range-bounds {
  display: flex;
  justify-content: space-between;
  padding-inline: 2px;
  margin-top: -4px;
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 499;
  animation: fadeIn 0.2s ease;
}
.user-controls label {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.user-controls input,
.user-controls select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
}
.user-name-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  overflow: hidden;
  font-weight: 500;
}
.profile-primary-summary,
.profile-secondary-summary {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.2;
  direction: ltr;
  unicode-bidi: plaintext;
}
.profile-primary-summary { font-size: 0.74rem; }
.profile-secondary-summary { margin-top: 2px; }
.demo-user-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 1px 6px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--pink-light);
  background: rgba(255, 96, 144, 0.12);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.registered-user-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-inline-start: 4px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.last-seen-hint {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 400;
}
.account-section {
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.account-section > summary {
  cursor: pointer;
  font-weight: 600;
}
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.account-prune-hint {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  opacity: 0.85;
}
.auth-status-error { color: var(--danger); }
.auth-status-ok    { color: var(--success); }
#profile-demo-label {
  display: flex;
  margin: -7px auto 12px;
}
.trans-identity-label {
  display: inline;
  margin-inline-start: 2px;
  color: var(--pink-light);
  font-size: 0.85em;
  line-height: 1;
  cursor: help;
}
.profile-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  font-weight: 600;
  margin-inline-end: 4px;
}
.form-help {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.profile-token {
  cursor: help;
  text-decoration: underline dotted transparent;
}
.profile-token:hover,
.profile-token:focus-visible {
  text-decoration-color: currentColor;
}
.profile-separator {
  margin: 0 6px;
  padding: 0 2px;
  color: var(--text-dim);
  font-weight: 700;
  opacity: 0.85;
  user-select: none;
}
.profile-primary-summary .profile-token,
.profile-secondary-summary .profile-token {
  white-space: nowrap;
}
.profile-token-label {
  font-size: 0.92em;
  color: var(--text-muted);
}
.profile-legend {
  position: relative;
  z-index: 2;
  margin-top: auto;
  flex: 0 0 auto;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.profile-legend-affordance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.profile-legend-affordance:hover,
.profile-legend-affordance:focus-visible {
  border-color: var(--accent);
  color: var(--text);
  outline: none;
}
.profile-legend-affordance:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.profile-legend-body {
  display: none;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
  max-height: min(42vh, 300px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-inline-end: 4px;
}
.profile-legend.is-expanded .profile-legend-body {
  display: grid;
}
.profile-legend-body > div {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}
.profile-legend .legend-cat {
  flex: 0 0 42px;
  font-weight: 500;
  color: var(--text);
}
.profile-legend .legend-option {
  display: inline-flex;
  gap: 3px;
  align-items: baseline;
  white-space: nowrap;
}
.profile-legend .legend-option + .legend-option::before {
  content: '/';
  margin-inline: 4px 6px;
  color: var(--text-dim);
}
.profile-legend .legend-option [aria-hidden='true'] {
  direction: ltr;
}

.error-msg {
  color: var(--danger); font-size: 0.9rem; text-align: center;
  padding: 8px; margin-bottom: 0.5rem;
  background: rgba(239,68,68,0.1); border-radius: var(--radius);
}
.success-msg {
  color: var(--success); background: rgba(74,222,128,0.08);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: block; width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: #fff; border: none; border-radius: var(--radius);
  font-family: var(--font-hebrew); font-size: 1.1rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  padding: 10px 20px; background: var(--card);
  color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-hebrew);
  cursor: pointer; transition: all var(--transition);
}
.btn-secondary:hover { background: var(--card-hover); color: var(--text); }

.btn-icon {
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 6px;
  border-radius: 8px; transition: all var(--transition);
  line-height: 1;
}
.btn-icon:hover { background: var(--card); color: var(--text); }
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-icon:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--pink-light);
  outline-offset: 2px;
}

.btn-close {
  position: absolute; top: 12px; left: 12px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; transition: all var(--transition);
}
.btn-close:hover { background: var(--card); color: var(--text); }

.badge {
  background: var(--card); color: var(--text-muted);
  font-size: 0.75rem; padding: 2px 8px; border-radius: 10px;
  font-weight: 500;
}

/* ── App Layout ────────────────────────────────────────────── */
#app {
  display: flex;
  width: 100%;
  height: 100%;
  height: 100dvh;
  min-height: -webkit-fill-available;
}

.chat-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-body.stage-open {
  flex-direction: column;
}
@media (min-width: 900px) {
  .chat-body.stage-open {
    flex-direction: row;
    align-items: stretch;
  }
  .chat-body.stage-open .stage-panel {
    flex: 0 0 min(42%, 440px);
    max-height: none;
    border-inline-end: 1px solid var(--border);
  }
  .chat-body.stage-open .messages-area {
    flex: 1;
    min-width: 0;
  }
}

.stage-panel {
  flex-shrink: 0;
  min-width: 0;
  max-height: min(48vh, 520px);
  overflow-y: auto;
  padding: 16px 20px;
  background:
    radial-gradient(circle at top right, rgba(255,96,144,0.14), transparent 35%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.chat-body.stage-open .stage-panel:not(.hidden) {
  display: block;
}
.stage-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.stage-panel-header h2 { font-size: 1.5rem; }
.stage-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.stage-actions .btn-primary { width: auto; }
.stage-actions label { color: var(--text-muted); font-size: 0.85rem; }
.stage-actions select {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
}
.stage-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.stage-participant {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}
.stage-participant small { color: var(--text-muted); }
.stage-participant .demo-user-label,
.stage-invitee .demo-user-label,
.stage-directory-card .demo-user-label {
  margin-inline-start: 6px;
}
.stage-participant button {
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  padding: 4px 8px;
  cursor: pointer;
}
.stage-directory {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.stage-directory-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stage-directory-card > div {
  display: grid;
  gap: 2px;
}
.stage-directory-card span {
  color: var(--text-muted);
  font-size: 0.82rem;
}
.stage-directory-card button {
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius);
  padding: 9px 12px;
  background: var(--pink);
  color: #fff;
  cursor: pointer;
}
.stage-directory-current,
.stage-directory-public,
.stage-empty { color: var(--text-muted); font-size: 0.85rem; }
.stage-directory-public {
  display: block;
  color: var(--accent);
  font-weight: 600;
}
.stage-public-banner {
  margin: 6px 0 8px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: rgba(255, 96, 144, 0.15);
  border: 1px solid rgba(255, 96, 144, 0.35);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}
.stage-media-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
@media (min-width: 760px) {
  .stage-media-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: stretch;
    gap: 16px;
  }
}
.stage-videos[data-count="1"] { grid-template-columns: 1fr; }
.stage-videos[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.stage-videos[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 759px) {
  .stage-videos[data-count="2"],
  .stage-videos[data-count="3"] { grid-template-columns: 1fr; }
}
.stage-video-card.stage-video-hidden {
  min-height: 0;
}
.stage-video-card.stage-video-hidden video {
  display: none;
  min-height: 0;
}
.stage-video-indicators {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.75rem;
}
.stage-video-hide-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
}
.stage-actions .btn-call { width: auto; min-width: 44px; }
.stage-actions .btn-call.muted { background: var(--danger); }
.stage-chat {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: min(40vh, 320px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.stage-chat h3 { margin-bottom: 10px; flex-shrink: 0; }
.stage-chat-messages {
  flex: 1 1 auto;
  min-height: 60px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  direction: rtl;
}
.stage-chat-message {
  display: flex;
  gap: 8px;
  font-size: 0.9rem;
}
.stage-chat-message strong { color: var(--text-muted); }
.stage-chat-empty { color: var(--text-muted); font-size: 0.85rem; }
.stage-chat-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  min-height: 52px;
}
.stage-chat-form input,
#stage-chat-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-hebrew);
  font-size: 1rem;
  transition: border-color var(--transition);
}
.stage-chat-form input:focus,
#stage-chat-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(233,30,99,0.12);
}
.stage-chat-form input::placeholder,
#stage-chat-input::placeholder { color: var(--text-dim); }
.stage-chat-form .btn-primary {
  flex-shrink: 0;
  width: auto;
  min-width: 72px;
  min-height: 44px;
  padding: 10px 18px;
  align-self: center;
}
.stage-invitees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.stage-invitee {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.stage-invitee button {
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  padding: 5px 9px;
  cursor: pointer;
}
.stage-videos {
  display: grid;
  gap: 10px;
  min-height: 0;
}
.stage-video-card {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #050509;
  border: 1px solid var(--border);
}
.stage-video-card video {
  display: block;
  width: 100%;
  min-height: 180px;
  object-fit: cover;
}
.stage-video-label {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.8rem;
}
.stage-disclaimer {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
body.legal-page {
  padding: 24px;
}
body.legal-page main {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  line-height: 1.7;
}
.legal-page h1, .legal-page h2 { margin-bottom: 12px; }
.legal-page h2 { margin-top: 24px; }
.legal-page p, .legal-page li { margin-bottom: 12px; }

/* ── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar-bg, var(--surface));
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.brand-mark {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  object-fit: contain;
}
.brand-wordmark {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--pink);
  background: linear-gradient(135deg, var(--pink), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-wordmark {
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  transition: background var(--transition);
}
.dot.online  { background: var(--online); box-shadow: 0 0 6px var(--online); }
.dot.offline { background: var(--danger); }

.sidebar-section { padding: 12px 0; }
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 8px; font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}

.nav-list { list-style: none; }
#room-list {
  max-height: 7.5rem;
  overflow-y: auto;
}
.nav-list li {
  position: relative;
  font-size: 0.93rem;
}
.nav-list-button {
  width: 100%;
  padding: 8px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition);
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  text-align: start;
}
.nav-list-button:hover { background: var(--card); }
.nav-list li.active .nav-list-button {
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--pink);
}
.nav-list li.offline-user .nav-list-button { opacity: 0.65; }
.nav-list li.offline-user .nav-list-button:hover { opacity: 0.9; }
.nav-list li .dot { width: 8px; height: 8px; flex-shrink: 0; }
@keyframes unread-pulse {
  0%, 100% {
    background-color: transparent;
    box-shadow: none;
  }
  50% {
    background-color: color-mix(in srgb, var(--pink) 16%, transparent);
    box-shadow: inset 3px 0 0 var(--pink);
  }
}
@keyframes unread-badge-pulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.08); }
}
.nav-list li.has-unread:not(.active) .nav-list-button {
  animation: unread-pulse 1.6s ease-in-out infinite;
}
.nav-list li.has-unread:not(.active) .unread-badge {
  animation: unread-badge-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .nav-list li.has-unread:not(.active) .nav-list-button {
    animation: none;
    box-shadow: inset 3px 0 0 var(--pink);
    background-color: color-mix(in srgb, var(--pink) 10%, transparent);
  }
  .nav-list li.has-unread:not(.active) .unread-badge {
    animation: none;
  }
}
.nav-list li .unread-badge {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  background: var(--pink); color: #fff; font-size: 0.7rem;
  padding: 1px 6px; border-radius: 10px; font-weight: 600;
  transition: opacity var(--transition);
}
.nav-list li:hover .unread-badge {
  opacity: 0; pointer-events: none;
}
.nav-list li .btn-close-dm-item {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  background: transparent; color: var(--text-muted); border: none;
  font-size: 0.95rem; padding: 4px; cursor: pointer;
  opacity: 0; transition: opacity var(--transition), color var(--transition);
  z-index: 5;
}
.nav-list li:hover .btn-close-dm-item {
  opacity: 0.6;
}
.nav-list li .btn-close-dm-item:hover {
  opacity: 1; color: var(--danger);
}
.nav-list li .room-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-list-button .nav-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-list-button .nav-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.nav-list li .user-initial {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--pink-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; flex-shrink: 0;
}

.login-door-chooser {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
  padding: 3px;
}
.login-door-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
  border-radius: 999px;
  transition: background var(--transition), color var(--transition);
}
.login-door-btn:hover,
.login-door-btn:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.login-door-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.landing-door-hint {
  margin-bottom: 1rem;
  text-align: center;
}
.landing-panel.hidden {
  display: none;
}
.landing-join-strip {
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.join-strip-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.join-strip-greeting {
  margin-bottom: 0.75rem;
}
.landing-copy-link {
  margin-top: 0.75rem;
  width: 100%;
}
.login-mode-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.login-mode-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.login-path-fields.hidden,
.account-section.hidden {
  display: none;
}

/* ── Main Area ─────────────────────────────────────────────── */
#main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0;
}

#chat-header {
  height: var(--header-h); min-height: var(--header-h);
  background: var(--header-bg, var(--surface)); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 10px;
  padding-top: max(0px, env(safe-area-inset-top));
}
.chat-header-info { flex: 1; min-width: 0; }
.chat-header-info h2 { font-size: 1.1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.app-surface-toggle {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
}
.app-surface-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}
.app-surface-tab.active {
  background: var(--accent);
  color: #fff;
}
.app-surface {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.app-surface.hidden {
  display: none;
}
.board-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px 16px;
  overflow: hidden;
  background: var(--messages-bg, var(--bg));
}
.board-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.board-pane-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.board-pane-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* ── Messages ──────────────────────────────────────────────── */
.chat-transcript {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages-area {
  flex: 1; overflow-y: auto;
  padding-block: 16px;
  padding-inline: max(20px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-right));
  display: flex; flex-direction: column; gap: 4px;
  direction: rtl;
  scroll-behavior: smooth;
  background: var(--messages-bg, var(--bg));
}

.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 0 12px;
}
.empty-icon { font-size: 3rem; }
.empty-state-hint {
  margin: 0;
  max-width: 22rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ── Message Bubbles ───────────────────────────────────────── */
.msg { width: fit-content; max-width: 72%; padding: 10px 14px; position: relative; animation: msgIn 0.2s ease; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* RTL column (direction: rtl): flex-start = physical right, flex-end = physical left */
.msg.me {
  align-self: flex-start;
  background: var(--bubble-me); color: #fff;
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
  border-end-start-radius: 4px;
  border-end-end-radius: 16px;
}
.msg.other {
  align-self: flex-end;
  background: var(--bubble-other);
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
  border-end-start-radius: 16px;
  border-end-end-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.msg .msg-sender {
  font-size: 0.8rem; font-weight: 600; color: var(--accent);
  margin-bottom: 2px; cursor: pointer;
}
.msg .msg-sender:hover { text-decoration: underline; }
.msg .msg-text { font-size: 0.95rem; line-height: 1.5; word-break: break-word; text-align: start; }
.msg .msg-time { font-size: 0.72rem; color: rgba(255,255,255,0.5); margin-top: 4px; text-align: end; }
.msg.me .msg-time { color: rgba(255,255,255,0.7); }

.msg.system {
  align-self: center; max-width: 90%;
  background: #3a3a62; color: #f0f0ff;
  font-size: 0.85rem; font-style: italic; text-align: center;
  padding: 6px 16px; border-radius: var(--radius);
  border: 1px solid #5a5a88;
}

/* ── Message Input ─────────────────────────────────────────── */
.message-input-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  min-width: 0;
}
.message-input-bar input {
  flex: 1; padding: 12px 18px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 24px;
  font-family: var(--font-hebrew); font-size: 1rem;
  outline: none; transition: border-color var(--transition);
}
.message-input-bar input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(233,30,99,0.12);
}
.message-input-bar input::placeholder { color: var(--text-dim); }

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

.composer-media-box {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  overflow: hidden;
}
.composer-media-box .composer-photo-btn {
  border: none;
  border-radius: 0;
  background: transparent;
}
.composer-media-box .composer-voice-btn {
  border: none;
  border-inline-start: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.composer-media-box .composer-voice-btn.recording {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
}
.photo-ttl-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font-hebrew);
  font-size: 0.875rem;
  padding: 8px 10px;
}

.photo-confirm-sheet { max-width: 22rem; }
.photo-confirm-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  max-height: min(50vh, 18rem);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--input-bg);
  border: 1px solid var(--border);
}
.photo-confirm-preview {
  display: block;
  max-width: 100%;
  max-height: min(50vh, 18rem);
  object-fit: contain;
}

.privilege-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 12px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.privilege-progress.hidden { display: none; }
.privilege-progress:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.privilege-progress-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.privilege-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #fb7185);
  transition: width 0.4s ease;
}
.privilege-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
.privilege-locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.privilege-levels-sheet { max-width: 22rem; }
.privilege-levels-lead {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.privilege-levels-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.privilege-level-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
}
.privilege-level-row.unlocked {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.privilege-level-icon { font-size: 0.85rem; }
.privilege-level-label { font-size: 0.9rem; }
.privilege-level-meta { font-size: 0.75rem; white-space: nowrap; }
.emoji-picker-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 30;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: min(18rem, 90vw);
}
.emoji-picker-popover.hidden { display: none; }
.message-input-bar { position: relative; }
.emoji-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.emoji-pick-btn {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1.2;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
}
.emoji-pick-btn:hover,
.emoji-pick-btn:focus-visible {
  background: var(--input-bg);
  outline: none;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  position: relative;
}
.msg-react-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  color: inherit;
}
.msg-react-btn:hover,
.msg-react-btn:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.msg-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.msg-reaction-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  cursor: pointer;
  color: inherit;
}
.msg-reaction-chip.mine {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.14);
}
.msg-reaction-chip:hover,
.msg-reaction-chip:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.msg-react-popover {
  bottom: auto;
  top: calc(100% + 4px);
  inset-inline-start: 0;
}

.photo-ttl-select:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: -2px;
}
.photo-pending-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.composer-discard-btn {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 8px;
}
.composer-discard-btn:hover {
  color: var(--pink);
}

.typing-indicator {
  padding: 4px 16px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  min-height: 1.25em;
}
.typing-indicator.hidden {
  display: none;
}

.msg-media {
  margin: 6px 0;
  max-width: min(280px, 100%);
}
.msg-media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.msg.msg-voice {
  min-width: min(17.5rem, 92%);
  max-width: min(22rem, 92%);
  width: min(20rem, 92%);
}
.msg-media.msg-media-audio {
  width: 100%;
  max-width: none;
  min-width: 0;
}
.msg-media-audio audio {
  display: block;
  width: 100%;
  min-width: 0;
}
.msg-media-countdown {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.msg-media-expired {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 4px 0;
}

.btn-send {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: #fff; border: none; font-size: 1.2rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
  transform: scaleX(-1); /* flip arrow for RTL */
}
.btn-send:hover { filter: brightness(1.15); transform: scaleX(-1) scale(1.05); }

/* ── Video Call Dock (non-blocking, alongside chat) ────────── */
.call-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}
.call-dock.hidden { display: none; }

.call-dock-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  min-height: 40px;
}
.call-dock-toggle {
  margin-inline-start: auto;
  flex-shrink: 0;
}
#call-status { font-weight: 600; }
#call-peer-name { color: var(--accent); }

.call-dock-body {
  display: flex;
  flex-direction: column;
}

.call-dock .video-grid {
  position: relative;
  background: #000;
  overflow: hidden;
  height: min(34vh, 220px);
  min-height: 140px;
}

/* Desktop: video dock beside chat transcript */
@media (min-width: 900px) {
  .chat-body.call-active:not(.stage-open) {
    flex-direction: row;
    align-items: stretch;
  }
  .chat-body.call-active:not(.stage-open) .call-dock:not(.hidden):not(.collapsed) {
    flex: 0 0 min(36%, 340px);
    max-height: none;
    border-inline-end: 1px solid var(--border);
    border-bottom: none;
  }
  .chat-body.call-active:not(.stage-open) .chat-transcript {
    flex: 1;
    min-width: 0;
  }
  .chat-body.call-active:not(.stage-open) .call-dock-body {
    flex: 1;
    min-height: 0;
    flex-direction: column;
  }
  .chat-body.call-active:not(.stage-open) .call-dock .video-grid {
    flex: 1;
    height: auto;
    min-height: 180px;
  }
  .chat-body.call-active:not(.stage-open) .call-dock .call-controls {
    flex-shrink: 0;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  .call-dock-body {
    flex-direction: row;
    align-items: stretch;
  }
  .call-dock .video-grid {
    flex: 1;
    height: min(28vh, 200px);
    min-height: 160px;
  }
  .call-dock .call-controls {
    flex-direction: column;
    justify-content: center;
    padding: 12px;
    border-inline-start: 1px solid var(--border);
  }
}

/* Mobile PiP collapsed mode */
.call-dock.collapsed {
  position: fixed;
  inset-inline-start: max(12px, env(safe-area-inset-left));
  bottom: calc(72px + max(12px, env(safe-area-inset-bottom)));
  width: min(148px, 40vw);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 36px rgba(0,0,0,0.5);
  border: 2px solid var(--accent);
  z-index: 600;
  overflow: hidden;
}
.call-dock.collapsed .call-dock-header {
  padding: 4px 8px;
  font-size: 0.78rem;
}
.call-dock.collapsed #call-peer-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 5.5rem;
}
.call-dock.collapsed .video-grid {
  height: 96px;
  min-height: 96px;
}
.call-dock.collapsed .video-wrapper.floating {
  width: 44px;
  height: 60px;
  top: 6px;
  left: 6px;
}
.call-dock.collapsed .call-controls {
  padding: 6px 8px;
  gap: 8px;
}
.call-dock.collapsed .btn-call {
  width: 38px;
  height: 38px;
  font-size: 1.05rem;
}
.call-dock.collapsed .call-dock-toggle {
  transform: rotate(180deg);
}

.video-wrapper {
  position: absolute; border-radius: var(--radius);
  overflow: hidden; background: #111;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.video-wrapper video {
  width: 100%; height: 100%; object-fit: cover;
}
.video-wrapper video.mirror-selfie,
.stage-video-card video.mirror-selfie {
  transform: scaleX(-1);
}
.btn-call:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.video-wrapper.focused {
  width: 100%; height: 100%; top: 0; left: 0; z-index: 1;
}
.video-wrapper.floating {
  width: 140px; height: 190px; top: 16px; left: 16px;
  z-index: 10; cursor: pointer; border: 2px solid var(--accent);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.video-wrapper.floating:hover {
  transform: scale(1.05); border-color: var(--primary);
}
.video-label {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.8rem; padding: 3px 10px; border-radius: 8px;
  z-index: 2;
}

.call-controls {
  padding: 16px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.btn-call {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--card); color: #fff; border: none;
  font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-call:hover { background: var(--card-hover); transform: scale(1.08); }
.btn-call.btn-hangup { background: var(--danger); }
.btn-call.btn-hangup:hover { background: #dc2626; }
.btn-call.btn-accept { background: var(--online); }
.btn-call.btn-accept:hover { background: #45a049; }
.btn-call.muted { background: var(--danger); }

/* ── Incoming Call ─────────────────────────────────────────── */
.incoming-call-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 2.5rem; text-align: center;
  box-shadow: 0 20px 60px var(--shadow);
  animation: slideUp 0.35s ease;
}
.incoming-call-icon { font-size: 3rem; margin-bottom: 1rem; }
.incoming-call-text { font-size: 1.2rem; margin-bottom: 1.5rem; }
.incoming-call-actions { display: flex; gap: 20px; justify-content: center; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
.pulse { animation: pulse 1.5s ease infinite; }

/* ── Profile Popup ─────────────────────────────────────────── */
.profile-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 2rem; width: min(380px, 90vw); position: relative;
  box-shadow: 0 20px 60px var(--shadow);
  animation: slideUp 0.3s ease;
  color: var(--text);
  isolation: isolate;
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; margin: 0 auto 12px;
  border: none; padding: 0; cursor: pointer; overflow: hidden;
}
.profile-avatar img,
.user-avatar-btn img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.user-avatar-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; padding: 0; flex-shrink: 0; cursor: pointer;
  background: var(--pink-dark); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600;
}
.user-avatar-btn.user-avatar-compact { width: 28px; height: 28px; }
.msg-presence {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  align-self: center;
}
.msg-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  justify-content: flex-start;
}
.msg.other .msg-time-row { justify-content: flex-end; }
.msg.me .msg-time-row .msg-time { margin-top: 0; }
.msg.other .msg-time-row .msg-time { margin-top: 0; }

.msg-sender-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.msg-sender-row .user-avatar-btn {
  width: 24px; height: 24px; font-size: 0.7rem;
}
.msg .msg-sender { margin-bottom: 0; }
.avatar-upload-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.avatar-pending-label { font-size: 0.85rem; }
.avatar-lightbox {
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.avatar-lightbox-img {
  max-width: min(90vw, 480px); max-height: min(80vh, 480px);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px var(--shadow);
}
.avatar-lightbox-close {
  position: fixed; top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
}
.profile-card h3 { text-align: center; font-size: 1.3rem; margin-bottom: 12px; color: var(--text); }
.profile-quicklook {
  text-align: center; font-size: 1.4rem; margin-bottom: 12px;
  display: flex; justify-content: center; gap: 8px; color: var(--text);
}
.profile-details { display: flex; flex-direction: column; gap: 8px; }
.profile-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.9rem; color: var(--text-muted);
}
.profile-row .label { min-width: 70px; font-weight: 500; flex-shrink: 0; }
.profile-row .value {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.profile-row .value.profile-value-long { -webkit-line-clamp: 5; }

/* ── Dialog Card ───────────────────────────────────────────── */
.dialog-card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 1.5rem; width: min(360px, 90vw);
  box-shadow: 0 20px 60px var(--shadow);
  animation: slideUp 0.3s ease;
  color: var(--text);
  isolation: isolate;
}
.dialog-card h3 { margin-bottom: 1rem; font-size: 1.1rem; color: var(--text); }
.dialog-card label,
.dialog-card summary { color: var(--text); }
.dialog-card input,
.dialog-card textarea,
.dialog-card select {
  width: 100%; padding: 10px 14px;
  background: var(--input-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-hebrew); font-size: 1rem;
  outline: none; margin-bottom: 1rem;
}
.dialog-card input:focus,
.dialog-card textarea:focus,
.dialog-card select:focus { border-color: var(--pink); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

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

/* ── Mobile ────────────────────────────────────────────────── */
.mobile-only { display: none; }

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .mobile-only { display: flex; }
  #sidebar {
    position: fixed; top: 0; right: 0; bottom: 0;
    z-index: 500; transform: translateX(100%);
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #sidebar.open { transform: translateX(0); }
  .video-wrapper.floating { width: 95px; height: 130px; top: 12px; left: 12px; }
  .message-input-bar input { min-width: 0; flex: 1 1 120px; }
  .filter-sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: min(92vh, 800px);
  }
  #filter-dialog.overlay {
    align-items: flex-end;
    padding: 0;
  }
}

@media (max-width: 390px) {
  #chat-header {
    gap: 4px 6px;
    padding: 6px 8px;
    min-height: var(--header-h);
    height: auto;
    flex-wrap: wrap;
    align-content: center;
  }
  .chat-header-info {
    flex: 1 1 0;
    min-width: 0;
    order: 1;
  }
  .chat-header-info h2 {
    font-size: 0.92rem;
  }
  #chat-subtitle {
    display: none;
  }
  #btn-toggle-sidebar {
    order: 0;
    flex-shrink: 0;
  }
  .app-surface-toggle {
    order: 2;
    flex-shrink: 0;
    margin-inline-start: auto;
  }
  .app-surface-tab {
    padding: 4px 8px;
    font-size: 0.72rem;
  }
  .chat-header-actions {
    order: 3;
    flex-shrink: 0;
  }
  .message-input-bar {
    flex-wrap: wrap;
    row-gap: 6px;
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .message-input-bar > :not(#message-input):not(.btn-send) {
    order: 1;
    flex-shrink: 0;
  }
  .message-input-bar #message-input {
    order: 2;
    flex: 1 1 calc(100% - 52px);
    min-width: 0;
  }
  .message-input-bar .btn-send {
    order: 3;
    flex: 0 0 auto;
  }
}

/* 🦽 accessibility focus visibility & skip link styles */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-icon:focus-visible,
.btn-close:focus-visible,
.btn-call:focus-visible,
.dialog-card input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  right: 10px;
  background: var(--pink);
  color: white;
  padding: 10px 20px;
  z-index: 2000;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: bold;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 10px;
  outline: 2px solid white;
}

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

.section-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.board-rail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 8px;
}
.board-dialog-tab {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  cursor: pointer;
}
.board-dialog-tab.active {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 96, 144, 0.12);
}
.board-dialog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}
.board-dialog-list {
  max-height: 280px;
  margin-bottom: 12px;
}
.board-dialog-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
}
.board-dialog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.board-dialog-poster {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-post-countdown {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-size: 0.68rem;
}
.board-dialog-body {
  font-size: 0.82rem;
  line-height: 1.35;
  word-break: break-word;
}
.board-dialog-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.board-msg-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--pink-light);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.68rem;
  cursor: pointer;
  white-space: nowrap;
}
.board-msg-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 96, 144, 0.1);
}
.board-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  text-align: center;
}
.board-empty.hidden {
  display: none;
}
.board-empty-lead {
  margin: 0;
  max-width: 18rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.board-anon-panel {
  padding: 8px 0 4px;
}
.board-anon-panel.hidden {
  display: none;
}
.board-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.board-compose.hidden,
.board-compose-fields.hidden,
.board-limit-banner.hidden {
  display: none;
}
.board-compose-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.board-limit-banner {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elevated, var(--bg)));
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}
.board-compose-status-error {
  color: var(--danger, #c62828);
  font-weight: 600;
}
.board-compose-status-ok {
  color: var(--success, #2e7d32);
  font-weight: 600;
}
.board-vote-btn {
  border: none;
  background: transparent;
  color: var(--pink-light);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0;
}
.mailbox-sheet {
  width: min(400px, 92vw);
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mailbox-sheet .mailbox-hint {
  margin: 0 0 10px;
  font-size: 0.72rem;
  line-height: 1.35;
}
.mailbox-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.mailbox-header h3 {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
}
.mailbox-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.mailbox-back-btn {
  font-size: 1.1rem;
  padding: 4px 8px;
}
.mailbox-close-btn {
  position: static;
  margin: 0;
}
.mailbox-panel.hidden {
  display: none;
}
.mailbox-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: min(52vh, 320px);
  overflow: auto;
}
.mailbox-list > li {
  margin: 0;
  padding: 0;
}
.mailbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: start;
  font-family: var(--font-hebrew);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.mailbox-row:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
  background: rgba(255, 96, 144, 0.06);
}
.mailbox-row.unread {
  border-color: var(--accent);
  background: rgba(255, 96, 144, 0.1);
  font-weight: 600;
}
.mailbox-row-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  background: transparent;
}
.mailbox-row.unread .mailbox-row-dot {
  background: var(--accent);
}
.mailbox-row-main {
  flex: 1;
  min-width: 0;
}
.mailbox-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.mailbox-row-from {
  color: var(--text);
  font-weight: 600;
}
.mailbox-row.unread .mailbox-row-from {
  color: var(--pink-light);
}
.mailbox-row-preview {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mailbox-row.unread .mailbox-row-preview {
  color: var(--text);
}
.mailbox-empty {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.82rem;
}
.mailbox-detail-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.mailbox-detail-body {
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  max-height: min(45vh, 280px);
  overflow: auto;
}
.mailbox-compose {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mailbox-compose label {
  margin-bottom: 0;
  font-size: 0.82rem;
}
.mailbox-char-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.72rem;
}
.mailbox-compose input,
.mailbox-compose textarea {
  margin-bottom: 0;
}
.mailbox-compose-status-error,
.mailbox-compose-status.mailbox-full-error {
  color: var(--danger, #c62828);
  font-weight: 600;
}
.mailbox-compose-status-ok {
  color: var(--success, #2e7d32);
  font-weight: 600;
}
.mailbox-anon-panel {
  padding: 8px 0 4px;
}
.mailbox-anon-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.mailbox-anon-actions .btn-primary,
.mailbox-anon-actions .btn-secondary {
  flex: 1;
}
#btn-open-mailbox.has-unread,
[data-mailbox-trigger].has-unread {
  position: relative;
}
.mailbox-unread-badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -4px;
  min-width: 1rem;
  height: 1rem;
  padding: 0 3px;
  font-size: 0.6rem;
  line-height: 1rem;
  text-align: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}
.mailbox-sidebar-btn {
  width: 100%;
  margin-bottom: 8px;
  position: relative;
  justify-content: center;
}
.directory-empty-coaching {
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  line-height: 1.45;
}
.directory-available-strip {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.directory-available-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.directory-available-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.directory-available-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}
.directory-available-chip:hover {
  border-color: var(--accent);
}
.stage-empty-warmth {
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}
.stage-empty-warmth p {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}
.stage-empty-warmth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.save-nick-overlay {
  align-items: flex-end;
  padding: 0;
  pointer-events: none;
  background: transparent;
}
.save-nick-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  position: relative;
  pointer-events: auto;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}
.save-nick-dismiss {
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  font: inherit;
}
