﻿/* Amor â€” NOVA midnight / electric violet UI */
:root {
  --bg: #060B20;
  --bg-2: #0B1534;
  --bg-elevated: #0B1534;
  --panel: rgba(16, 27, 64, 0.78);
  --panel-solid: #101B40;
  --panel-2: rgba(24, 36, 80, 0.62);
  --elevated: #182450;
  --ink: #F8FAFF;
  --muted: #A9B5D4;
  --gold: #7938FF;
  --gold-2: #A34BFF;
  --gold-3: #1677FF;
  --cyan: #13D9FF;
  --violet: #7938FF;
  --neon: #A34BFF;
  --on-accent: #F8FAFF;
  --gold-soft: rgba(121, 56, 255, 0.18);
  --gold-line: rgba(163, 75, 255, 0.38);
  --gold-shine: linear-gradient(135deg, #1677FF 0%, #7938FF 48%, #A34BFF 100%);
  --danger: #FF4569;
  --online: #3ecf8e;
  --bubble-in: #1C2A52;
  --bubble-out: linear-gradient(160deg, #5B28F0 0%, #7938FF 55%, #9B45FF 100%);
  --focus-ring: 0 0 0 3px var(--gold-soft);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --touch: 44px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 20px 60px rgba(3, 8, 28, 0.55);
  --elev-1: 0 8px 24px rgba(3, 8, 28, 0.4);
  --elev-2: 0 20px 48px rgba(3, 8, 28, 0.55);
  --glow: 0 0 28px rgba(121, 56, 255, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 140ms;
  --dur: 220ms;
  --bp-xs: 320px;
  --bp-sm: 430px;
  --bp-md: 768px;
  --bp-lg: 1024px;
  --bp-xl: 1366px;
  --bp-xxl: 1920px;
  --font: "Inter", "IBM Plex Sans Arabic", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --display: "Inter", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --script: "Inter", "IBM Plex Sans Arabic", sans-serif;
  --nav-w: 88px;
  --list-w: 360px;
  --info-w: 300px;
  --amor-frame: min(100%, 26.75rem);
}
html[dir="rtl"] {
  --font: "IBM Plex Sans Arabic", "Tajawal", "Inter", "Segoe UI", Tahoma, sans-serif;
  --display: "IBM Plex Sans Arabic", "Tajawal", "Inter", sans-serif;
  --script: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html {
  /* direction comes from <html dir="rtl|ltr"> */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
[hidden] { display: none !important; }

/* NOVA scrollbars â€” midnight track + violet thumb */
* {
  scrollbar-width: thin;
  scrollbar-color: #7938FF #0B1534;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: #0B1534;
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #A34BFF, #7938FF);
  border-radius: 10px;
  border: 2px solid #0B1534;
  min-height: 40px;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #13D9FF, #A34BFF);
}
*::-webkit-scrollbar-corner {
  background: #0B1534;
}
.messages::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.panel::-webkit-scrollbar-track,
.info-panel::-webkit-scrollbar-track,
.conv-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.55);
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 82% -8%, rgba(121, 56, 255, 0.22), transparent 55%),
    radial-gradient(640px 420px at 8% 108%, rgba(22, 119, 255, 0.16), transparent 52%),
    var(--bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* â€”â€” Auth (Amor) â€”â€” */
.auth-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1rem max(1.5rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(121,56,255,.28), transparent 52%),
    radial-gradient(ellipse at 18% 86%, rgba(22,119,255,.18), transparent 48%),
    #060B20;
}
.auth-card input:not([type="checkbox"]):not([type="radio"]),
.auth-card button.btn {
  min-height: var(--touch, 44px);
}
.auth-card,
.auth-card.amor-card {
  width: min(400px, 100%);
  max-width: calc(100% - 1.5rem);
  box-sizing: border-box;
  background: #0a0a0a;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.5px solid rgba(121, 56, 255,.55);
  border-radius: 28px;
  padding: 1.75rem 1.6rem 1.85rem;
  box-shadow:
    0 0 0 1px rgba(121, 56, 255,.12),
    0 0 40px rgba(121, 56, 255,.18),
    0 24px 60px rgba(0,0,0,.65);
  text-align: center;
  position: relative;
}
.lang-switch {
  display: inline-flex;
  gap: .2rem;
  margin: 0 auto 1.1rem;
  padding: .2rem;
  border-radius: 999px;
  border: 1px solid rgba(121, 56, 255,.35);
  background: rgba(0,0,0,.55);
}
.lang-switch a {
  padding: .4rem 1rem;
  border-radius: 999px;
  font-size: .8rem;
  color: #f5f0e6;
  text-decoration: none;
  font-weight: 500;
}
.lang-switch a.active {
  background: var(--gold-shine);
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: 0 0 16px rgba(121, 56, 255,.35);
}
.lang-switch a:hover:not(.active) {
  color: var(--gold);
}
.lang-switch.compact {
  margin: 0;
  padding: .12rem;
  flex-shrink: 0;
}
.lang-switch.compact a {
  padding: .28rem .55rem;
  font-size: .72rem;
}
.amor-signature {
  position: relative;
  margin: 0 auto .15rem;
  width: min(260px, 85%);
  height: 78px;
  display: grid;
  place-items: center;
  overflow: visible;
  background: transparent;
}
.amor-sig-img {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: screen; /* drop black plate if image logo is used */
  filter: drop-shadow(0 0 14px rgba(121, 56, 255,.35));
}
.amor-sig-text {
  font-family: var(--script);
  font-size: clamp(2.4rem, 8vw, 3.1rem);
  line-height: 1.05;
  background: var(--gold-shine);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(240,215,140,.4));
  letter-spacing: .01em;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}
.amor-sig-shine {
  position: absolute;
  inset: 10% 5%;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.4) 50%, transparent 65%);
  mix-blend-mode: soft-light;
  animation: amor-shine 3.6s ease-in-out infinite;
  pointer-events: none;
  border-radius: 12px;
}
@keyframes amor-shine {
  0%, 100% { transform: translateX(-45%); opacity: .2; }
  50% { transform: translateX(45%); opacity: .65; }
}
.brand-mark {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem;
  background: var(--gold-shine);
  box-shadow: var(--glow);
  position: relative;
  display: grid;
  place-items: center;
  color: var(--on-accent);
}
.brand-mark .nova-ico { width: 28px; height: 28px; color: var(--on-accent); }
.brand-name {
  font-family: var(--display);
  font-size: 2.35rem;
  margin: 0;
  letter-spacing: 0.06em;
  background: var(--gold-shine);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}
.brand-name.sm { font-size: 1.15rem; letter-spacing: 0.06em; }
.brand-tag {
  margin: .2rem 0 1.15rem;
  color: rgba(245,240,230,.78);
  font-size: .82rem;
  letter-spacing: .02em;
}
.auth-card h1, .page-head h1 {
  font-family: var(--font);
  margin: .2rem 0 .65rem;
  font-weight: 800;
  color: #fff;
  font-size: 1.55rem;
}
.auth-sub, .fineprint { color: rgba(245,240,230,.78); font-size: .9rem; line-height: 1.6; text-align: center; }
.auth-card .error {
  color: #e8a090;
  font-size: .88rem;
  margin: .5rem 0 .75rem;
}
.auth-session-hint {
  color: rgba(245,240,230,.82);
  font-size: .86rem;
  line-height: 1.55;
  margin: 0 0 .65rem;
  text-align: start;
}
.auth-session-request {
  width: 100%;
  margin-bottom: .65rem;
}
.btn-iconic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  width: 100%;
}
.btn-iconic .nova-ico {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.amor-actions { gap: .75rem; }
.amor-card .btn.primary {
  background: var(--gold-shine);
  border: 0;
  color: var(--on-accent);
  font-weight: 800;
  min-height: 50px;
  border-radius: 999px;
  box-shadow: 0 0 22px rgba(121, 56, 255,.28);
}
.amor-card .btn.primary .nova-ico { color: var(--on-accent); }
.amor-card .btn.ghost {
  border: 1px solid rgba(245,240,230,.35);
  color: #f5f0e6;
  border-radius: 999px;
  min-height: 48px;
  background: transparent;
}
.amor-card .btn.ghost .nova-ico { color: #f5f0e6; }
.amor-card .btn.ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}
.amor-card .btn.ghost:hover .nova-ico { color: var(--gold); }
.stack { display: grid; gap: .85rem; text-align: start; }
.stack label { display: grid; gap: .35rem; font-size: .9rem; color: var(--muted); }
input, textarea, select, button { font: inherit; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
textarea { resize: none; max-height: 140px; }
.btn {
  border: 0;
  border-radius: 12px;
  padding: .7rem 1.15rem;
  min-height: 44px;
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: .01em;
  transition: background .15s, opacity .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: scale(.98); opacity: .92; }
.btn.primary {
  background: linear-gradient(180deg, #e8d08a, var(--gold) 55%, var(--gold-3));
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 8px 18px rgba(121, 56, 255, .18);
}
.btn.primary:hover { filter: brightness(1.04); background: linear-gradient(180deg, #ead898, var(--gold) 55%, var(--gold-3)); }
.btn.ghost {
  background: transparent;
  color: #0a84ff;
  font-weight: 600;
}
.btn.ghost:hover { background: rgba(10, 132, 255, .1); }
.btn.danger {
  background: rgba(255, 69, 58, .16);
  color: #ff453a;
  font-weight: 700;
}
.btn.danger:hover { background: rgba(255, 69, 58, .24); }
.btn.block { width: 100%; }
.btn:disabled, .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.error { color: #f0a090; text-align: start; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; }

/* â€”â€” App shell â€”â€” */
.app-shell {
  height: 100dvh;
  display: grid;
  grid-template-columns: var(--nav-w) var(--list-w) 1fr;
  background: var(--bg);
  gap: 0;
}
.app-shell.user-chat {
  grid-template-columns: var(--nav-w) 1fr;
}
.app-shell.admin-chat {
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}
@media (min-width: 1600px) {
  .app-shell.admin-chat {
    --list-w: 380px;
  }
}
.app-shell.admin-shell {
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}
.app-shell.admin-shell.is-workspace {
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}
.app-shell.admin-shell.is-workspace .module-stage-host {
  display: none;
}
.app-shell.admin-shell.is-workspace .sidebar.module-rail {
  min-width: 0;
  width: auto;
  max-width: none;
  overflow-x: hidden;
}
.app-shell.admin-shell.is-workspace .module-panel.active {
  width: 100%;
  min-width: 0;
  margin-inline: 0;
  padding-inline: clamp(1rem, 2.4vw, 2.25rem);
  box-sizing: border-box;
}
.app-shell.admin-shell.is-workspace #panel-security.active,
.app-shell.admin-shell.is-workspace #panel-users.active,
.app-shell.admin-shell.is-workspace #panel-admins.active,
.app-shell.admin-shell.is-workspace #panel-audit.active,
.app-shell.admin-shell.is-workspace #panel-sys.active,
.app-shell.admin-shell.is-workspace #panel-prefs.active,
.app-shell.admin-shell.is-workspace #panel-control.active {
  max-width: none;
  margin-inline: 0;
  width: 100%;
}
.app-shell.admin-shell.is-workspace .conv-list {
  display: grid;
  align-content: start;
  gap: .65rem;
  padding: 0 0 1.25rem;
}
.app-shell.admin-shell.is-workspace .conv-list li {
  border: 1px solid rgba(121, 56, 255, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  padding: .95rem 1.1rem;
}
.app-shell.admin-shell.is-workspace .conv-list .name span:first-child,
.app-shell.admin-shell.is-workspace .conv-list .meta > span {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: anywhere;
}
.app-shell.admin-shell.is-workspace .user-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  max-width: 32rem;
  padding-inline: 0;
}
.app-shell.admin-shell.is-workspace .user-admin-actions .btn.block {
  width: auto;
  min-width: min(100%, 12.5rem);
}
.app-shell.admin-shell.is-workspace .module-toolbar .search-row {
  padding-inline: 0;
}
.app-shell.admin-shell.is-workspace .module-toolbar .audit-hint {
  padding-inline: 0;
}
.app-shell.user-settings-shell {
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
}
.settings-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg, #050505);
}
.settings-head {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1rem .55rem;
  border-bottom: 1px solid rgba(121, 56, 255, .12);
  flex-shrink: 0;
}
.settings-head-copy { flex: 1; min-width: 0; }
.settings-head-copy h1 { margin: 0; font-size: 1.25rem; color: var(--ink); }
.settings-tabs {
  display: flex;
  gap: .4rem;
  padding: .55rem 1rem .35rem;
  flex-shrink: 0;
}
.settings-tab {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(121, 56, 255, .22);
  color: var(--gold-2);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}
.settings-tab:hover,
.settings-tab:focus-visible,
.settings-tab.is-active {
  background: rgba(121, 56, 255, .14);
  border-color: rgba(121, 56, 255, .45);
  color: var(--gold);
  outline: none;
}
.settings-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  max-width: none;
  width: 100%;
  margin-inline: 0;
}

/* Module panels: each owns its toolbar + scroll body */
.module-rail > .module-panel {
  flex: 1;
  min-height: 0;
  flex-direction: column;
}
.module-toolbar {
  flex-shrink: 0;
  display: grid;
  gap: .55rem;
  padding-bottom: .35rem;
}
.module-toolbar .search-row {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding-inline-end: .65rem;
}
.module-toolbar .search-row input {
  flex: 1;
  min-width: 0;
}
.module-toolbar .audit-hint {
  margin: 0;
  padding: 0 1rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.4;
}
.module-toolbar .user-admin-actions {
  padding: 0 1rem;
}
.module-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.module-stage-host .module-stage {
  display: none;
  margin: auto;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 28rem;
}
.module-stage-host .module-stage.is-active {
  display: block;
}
.prefs-form .field,
.prefs-form label.field {
  display: grid;
  gap: .35rem;
  text-align: start;
}
.prefs-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--gold);
  font-family: var(--font);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.prefs-form select,
.prefs-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  padding: .7rem .9rem;
  font: inherit;
  color-scheme: dark;
}
.prefs-form select option {
  background: #1c1c1e;
  color: #f5f0e6;
}

/* Custom Amor selects (dark dropdowns â€” replace native OS white menus) */
.amor-select {
  position: relative;
  width: 100%;
}
.amor-select-native {
  display: none !important;
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  inset-inline-start: 0;
  top: 0;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}
.amor-select-trigger {
  appearance: none;
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  padding: .7rem 2.4rem .7rem .9rem;
  font: inherit;
  text-align: start;
  cursor: pointer;
  position: relative;
}
.amor-select-trigger::after {
  content: '';
  position: absolute;
  inset-inline-end: .95rem;
  top: 50%;
  width: .55rem;
  height: .55rem;
  border-inline-end: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: translateY(-65%) rotate(45deg);
  opacity: .85;
}
.amor-select.is-open .amor-select-trigger {
  border-color: rgba(121, 56, 255, .55);
  box-shadow: 0 0 0 3px rgba(121, 56, 255, .15);
}
.amor-select-menu {
  position: absolute;
  z-index: 40;
  inset-inline: 0;
  top: calc(100% + .35rem);
  margin: 0;
  padding: .35rem;
  list-style: none;
  border-radius: 14px;
  border: 1px solid rgba(121, 56, 255, .18);
  background: rgba(28, 28, 30, .98);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
  max-height: 240px;
  overflow: auto;
}
.amor-select-option {
  padding: .75rem .85rem;
  border-radius: 10px;
  color: var(--ink);
  cursor: pointer;
  font-size: .92rem;
}
.amor-select-option:hover {
  background: rgba(121, 56, 255, .12);
}
.amor-select-option.is-selected {
  background: linear-gradient(145deg, rgba(230, 199, 106, .28), rgba(121, 56, 255, .18));
  color: var(--gold);
  font-weight: 700;
}
.mr888-logo {
  display: block;
  object-fit: contain;
  background: #000;
  border-radius: 12px;
}
.peer-brand .peer-logo {
  width: 120px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid rgba(121, 56, 255, .25);
}
.chat-header .peer {
  cursor: pointer;
  border-radius: 12px;
  padding: .15rem .25rem;
  margin: -.15rem -.25rem;
  transition: background .15s;
}
.chat-header .peer:hover,
.chat-header .peer:focus-visible {
  background: rgba(121, 56, 255, .08);
  outline: none;
}
.avatar {
  overflow: hidden;
}
.avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.avatar .avatar-img.avatar-brand {
  object-fit: contain;
  background: #000;
  padding: 4px;
}
.contact-sheet .contact-body {
  text-align: center;
  display: grid;
  gap: .65rem;
  justify-items: center;
}
.contact-hero-avatar {
  width: 112px !important;
  height: 112px !important;
  font-size: 2.2rem !important;
  margin: .25rem auto .35rem;
}
.contact-fields {
  width: 100%;
  margin: .5rem 0 0;
  text-align: start;
  display: grid;
  gap: .65rem;
}
.contact-fields.compact {
  margin-top: .85rem;
  gap: .45rem;
}
.contact-field {
  background: rgba(121, 56, 255, .06);
  border: 1px solid rgba(121, 56, 255, .14);
  border-radius: 12px;
  padding: .7rem .85rem;
}
.contact-field dt {
  margin: 0;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.contact-field dd {
  margin: .2rem 0 0;
  color: var(--ink);
  font-size: .95rem;
  word-break: break-word;
}
.profile-brand {
  text-align: center;
  cursor: pointer;
  border-radius: 16px;
  padding: .35rem;
  transition: background .15s;
}
.profile-brand:hover,
.profile-brand:focus-visible {
  background: rgba(121, 56, 255, .06);
  outline: none;
}
.settings-services {
  display: grid;
  gap: .55rem;
  margin-top: .35rem;
}
.settings-services .sheet-btn {
  width: 100%;
  text-align: start;
}
.profile-brand .info-logo {
  width: min(100%, 220px);
  height: auto;
  margin: 0 auto .75rem;
  border-radius: 14px;
  border: 1px solid rgba(121, 56, 255, .2);
  box-shadow: var(--glow);
}
.profile-card {
  display: grid;
  gap: .85rem;
  margin-bottom: .5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(121, 56, 255, .12);
}
.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.profile-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(121, 56, 255, .15);
  border: 2px solid rgba(121, 56, 255, .35);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--gold);
  overflow: hidden;
}
.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-actions {
  display: grid;
  gap: .35rem;
  flex: 1;
  min-width: 0;
}
.prefs-privacy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: .9rem;
}

/* Nav rail */
.nova-nav {
  background: linear-gradient(180deg, #0a0a0a, #050505);
  border-inline-end: 1px solid rgba(121, 56, 255,.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem .55rem;
  gap: .35rem;
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  align-self: stretch;
  overflow: hidden;
}
.nova-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: inherit;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #7938FF transparent;
}
.nova-nav-scroll::-webkit-scrollbar {
  width: 6px;
}
.nova-nav-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.nova-logo,
.nova-nav > #btn-logout {
  flex-shrink: 0;
}
.nova-logo {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(145deg, var(--gold-2), var(--gold), var(--gold-3));
  display: grid; place-items: center;
  color: var(--on-accent); font-size: 1.35rem;
  margin-bottom: .85rem;
  box-shadow: var(--glow);
  text-decoration: none;
}
.nova-nav a.nav-item,
.nova-nav button.nav-item {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: .28rem;
  padding: .7rem .2rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  cursor: pointer;
  font-size: .68rem;
  text-decoration: none;
  line-height: 1.2;
}
.nova-nav .nav-item span:not(.nova-ico) {
  color: inherit;
}
.nova-nav .nav-item .ico { font-size: 1.25rem; color: var(--gold-2); line-height: 1; }
.nova-nav .nav-item .nova-ico {
  width: 24px;
  height: 24px;
  color: var(--gold-2);
}
.nova-nav .nav-item.active,
.nova-nav .nav-item:hover {
  background: var(--gold-soft);
  color: var(--gold);
}
.nova-nav .nav-item.active .nova-ico,
.nova-nav .nav-item:hover .nova-ico {
  color: var(--gold);
}
.nova-nav .nav-item.active { box-shadow: inset -3px 0 0 var(--gold); }
[dir="ltr"] .nova-nav .nav-item.active { box-shadow: inset 3px 0 0 var(--gold); }
.nova-nav .spacer { flex: 1; }
.nova-nav .nav-new {
  width: 48px; height: 48px; border-radius: 16px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
  margin-top: .5rem;
  display: grid;
  place-items: center;
}
.nova-nav .nav-new .nova-ico { width: 22px; height: 22px; color: var(--gold); }
.nova-nav .nav-new:hover { background: var(--gold-soft); box-shadow: var(--glow); }

/* Side list panel */
.sidebar {
  border-inline-end: 1px solid rgba(121, 56, 255,.1);
  background: rgba(10, 10, 10, 0.92);
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(12px);
}
.sidebar-head, .chat-header, .page-head, .info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  gap: .75rem;
}
.sidebar-head h1, .chat-header h1 {
  margin: 0;
  font-size: 1.35rem;
  font-family: var(--display);
  font-weight: 600;
  color: var(--ink);
}
.sidebar-actions, .chat-actions {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-toggle { display: none; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; cursor: pointer; font-size: 1.05rem;
  color: var(--gold-2);
  display: grid; place-items: center;
}
.icon-btn:hover {
  background: var(--gold-soft);
  border-color: var(--gold-line);
  color: var(--gold);
}
.icon-btn:focus-visible,
.btn:focus-visible,
.nav-item:focus-visible,
.call-actions .btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.nova-ico {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}
.nova-ico.sm { width: 18px; height: 18px; }
.nova-ico.lg { width: 26px; height: 26px; }
.nova-nav .nav-item .ico,
.nova-nav .nav-item .nova-ico {
  width: 24px;
  height: 24px;
  color: var(--gold-2);
}
.nova-nav .nav-item.active .nova-ico,
.nova-nav .nav-item:hover .nova-ico {
  color: var(--gold);
}
.nova-logo {
  width: 52px; height: 52px; border-radius: 16px;
  background: var(--gold-shine);
  display: grid; place-items: center;
  color: var(--on-accent); font-size: 1.35rem;
  margin-bottom: .85rem;
  box-shadow: var(--glow);
  text-decoration: none;
}
.nova-logo .nova-ico {
  width: 26px; height: 26px;
  color: var(--on-accent);
  stroke-width: 1.6;
}
.amor-mark-letter {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--on-accent);
  line-height: 1;
}
.info-actions .nova-ico { width: 22px; height: 22px; color: var(--gold); margin-bottom: .15rem; }
.info-menu .nova-ico { width: 20px; height: 20px; color: var(--gold); }
.mic-btn .nova-ico { width: 22px; height: 22px; color: var(--on-accent); }
.search-row, .search-bar { padding: 0 1rem .75rem; }
.search-row {
  position: relative;
}
.search-row::before {
  content: "";
  position: absolute;
  top: calc(50% - 0.35rem);
  inset-inline-start: 1.75rem;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'><circle cx='11' cy='11' r='6.25'/><path d='m16.4 16.4 4.1 4.1'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'><circle cx='11' cy='11' r='6.25'/><path d='m16.4 16.4 4.1 4.1'/></svg>") center / contain no-repeat;
  background-color: var(--gold-2);
  pointer-events: none;
  z-index: 1;
}
.search-row input, .search-bar input {
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(121, 56, 255,.18);
  color: var(--ink);
}
.search-row input {
  padding-inline-start: 2.55rem;
}
.tabs, .filter-pills {
  display: flex; gap: .4rem; padding: 0 .9rem .75rem; flex-wrap: wrap;
}
.tab, .pill {
  border: 1px solid transparent;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  padding: .4rem .85rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: .82rem;
}
.tab.active, .pill.active {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}
.panel { display: none; overflow: hidden; flex: 1; min-height: 0; }
.panel.active { display: flex; flex-direction: column; }
.conv-list, .meta-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow: auto; }
.conv-list .conv-empty {
  display: block;
  grid-template-columns: none;
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
  cursor: default;
}
.conv-list .name .time { margin-inline-start: auto; flex-shrink: 0; }
.conv-list li > div { min-width: 0; }
.conv-list .name span:first-child,
.conv-list .meta > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-list li, .meta-list li {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid rgba(121, 56, 255,.08);
  cursor: pointer;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .75rem;
  align-items: center;
  transition: background .15s;
}
#admin-list li:has(.admin-row-del) {
  grid-template-columns: 48px minmax(0, 1fr) auto;
}
.admin-row-del {
  min-height: 40px;
  min-width: 44px;
  padding-inline: .7rem;
  flex-shrink: 0;
  background: rgba(255, 69, 58, .14);
  color: #ff6961;
  border: 1px solid rgba(255, 69, 58, .28);
}
.admin-row-del:hover {
  background: rgba(255, 69, 58, .24);
}
.conv-list li:hover, .conv-list li.active {
  background: var(--gold-soft);
}
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(145deg, #3a3220, #1a160e);
  border: 1.5px solid var(--gold-line);
  display: grid; place-items: center;
  color: var(--gold);
  font-weight: 700;
  font-size: 1rem;
  position: relative;
}
.avatar.online {
  border-color: var(--online);
  box-shadow: 0 0 0 2px rgba(62, 207, 142, .35);
}
.avatar.online::after {
  content: "";
  position: absolute; bottom: 1px; inset-inline-start: 1px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--online);
  border: 2px solid #0a0a0a;
}
.peer-meta h1.is-online,
.conv-list .name.is-online > span:first-child,
#contact-name.is-online,
#info-name.is-online {
  color: var(--online);
}
.conv-list .name {
  font-weight: 700;
  color: var(--ink);
  display: flex; justify-content: space-between; gap: .5rem;
  align-items: center;
}
.conv-list .name .time { color: var(--muted); font-size: .75rem; font-weight: 500; }
.conv-list .meta {
  color: var(--muted); font-size: .82rem;
  display: flex; justify-content: space-between; gap: .5rem; align-items: center;
  margin-top: .15rem;
}
.badge {
  background: linear-gradient(135deg, var(--gold), var(--gold-3));
  color: var(--on-accent); border-radius: 999px; min-width: 1.35rem;
  text-align: center; font-size: .72rem; padding: .12rem .4rem; font-weight: 700;
}
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; margin-inline-start: .35rem; }
.dot.online { background: var(--online); }
.dot.offline { background: #555; }

/* Chat pane â€” solid NOVA black (no photo wallpaper) */
.chat-pane {
  display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative;
  background: #080808;
}
.chat-pane.filled {
  background:
    radial-gradient(ellipse at 80% -10%, rgba(121, 56, 255, 0.07), transparent 40%),
    #070707;
}
body.wp-forest .chat-pane.filled {
  background: radial-gradient(ellipse at 30% 20%, rgba(31, 138, 101, 0.1), transparent 48%), #070707;
}
body.wp-dusk .chat-pane.filled {
  background: radial-gradient(ellipse at 80% 10%, rgba(90, 60, 120, 0.12), transparent 45%), #070707;
}
body.wp-solid-teal .chat-pane.filled,
body.wp-solid-ink .chat-pane.filled {
  background: #050505;
}
.chat-header {
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(121, 56, 255,.12);
  flex-shrink: 0;
  gap: .85rem;
}
.chat-header .peer {
  display: flex; align-items: center; gap: .75rem;
  min-width: 0;
  flex: 1;
}
.chat-header .peer-meta {
  min-width: 0;
  flex: 1;
}
.chat-header .peer-meta h1 {
  font-size: 1.05rem;
  font-family: var(--font);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-header .chat-actions {
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.status-line {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.conv-list li.is-active {
  background: var(--gold-soft);
  box-shadow: inset 3px 0 0 var(--gold);
}
[dir="rtl"] .conv-list li.is-active {
  box-shadow: inset -3px 0 0 var(--gold);
}
.menu-actions {
  display: grid;
  gap: .55rem;
}
.menu-actions .sheet-btn,
#menu-dialog .manage-actions .sheet-btn {
  width: 100%;
}
#menu-dialog .sheet-btn-cancel {
  color: var(--ink);
  background: rgba(120, 120, 128, .28);
}
#camera-dialog .sheet-btn-cancel {
  color: var(--ink);
  background: rgba(120, 120, 128, .28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
}
#camera-dialog .sheet-btn-cancel .nova-ico {
  width: 20px;
  height: 20px;
  color: var(--gold);
}
.camera-live-dialog {
  border: 0;
  padding: 0;
  width: min(100vw, 520px);
  max-width: 100vw;
  max-height: min(100dvh, 100vh);
  background: #050505;
  color: var(--ink);
  border-radius: 18px;
  overflow: hidden;
}
.camera-live-dialog::backdrop {
  background: rgba(0, 0, 0, .78);
}
.camera-live {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: min(70dvh, 640px);
  max-height: min(92dvh, 900px);
}
.camera-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(121, 56, 255,.12);
}
.camera-live-head p {
  margin: 0;
  font-weight: 700;
  color: var(--gold);
}
.camera-live-stage {
  position: relative;
  background: #000;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.camera-live-stage video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  background: #000;
}
.camera-live-timer {
  position: absolute;
  top: .85rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: #ff8f84;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: .25rem .7rem;
  border-radius: 999px;
  margin: 0;
}
.camera-live-actions {
  display: grid;
  place-items: center;
  padding: 1.1rem calc(1.1rem + env(safe-area-inset-bottom, 0px));
  background: #0a0a0a;
  border-top: 1px solid rgba(121, 56, 255,.12);
}
.cam-shutter {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: #fff;
  cursor: pointer;
  box-shadow: var(--glow);
}
.cam-shutter.is-recording {
  background: #ff453a;
  border-color: #ff8f84;
  border-radius: 16px;
  width: 56px;
  height: 56px;
  animation: rec-pulse 1.1s ease-in-out infinite;
}
#menu-dialog .sheet-btn-primary {
  background: linear-gradient(145deg, #e6c76a, var(--gold), var(--gold-3));
  color: var(--on-accent);
}
#menu-dialog .sheet-btn-danger {
  background: linear-gradient(145deg, #ff6b5a, #ff453a, #c62828);
  color: #fff;
}
.empty-state {
  margin: auto; text-align: center; color: var(--muted); padding: 2rem;
}
.empty-state h2 { color: var(--gold); font-family: var(--display); font-weight: 600; }

.messages {
  flex: 1; overflow: auto; padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: .55rem;
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  align-items: stretch;
  position: relative;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
.chat-pane { position: relative; }
.swipe-reply-hint {
  position: fixed;
  left: 0.35rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transform: scale(0.7);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.swipe-reply-hint.is-on {
  opacity: 1;
  transform: scale(1);
}
.msg {
  width: fit-content;
  max-width: min(72%, 34rem);
  margin-left: 0;
  margin-right: auto;
  padding: .7rem .9rem;
  border-radius: 18px;
  touch-action: pan-y;
  position: relative;
  border-bottom-right-radius: 6px;
  background: var(--bubble-in);
  border: 1px solid var(--gold-line);
  backdrop-filter: blur(10px);
  align-self: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  text-align: start;
  will-change: transform;
  overflow-wrap: break-word;
  word-break: normal;
  line-break: auto;
  hyphens: none;
}
.msg .body { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; }
.msg.out {
  margin-left: auto;
  margin-right: 0;
  background: var(--bubble-out);
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 6px;
}
.msg .time {
  font-size: .7rem; color: var(--muted); margin-top: .4rem;
  display: flex; gap: .35rem; justify-content: start;
}
.msg.out .time { justify-content: end; }
.msg .ticks { letter-spacing: -1px; }
.msg .ticks.sent { color: rgba(121, 56, 255, .72); }
.msg .ticks.delivered { color: var(--gold-2); }
.msg .ticks.seen { color: #3ddc84; }
.msg .ticks.failed { color: #ff453a; font-weight: 700; }
.msg .ticks.sending { opacity: .7; }
/* Admin â€º Users: Login & Security */
.auth-chips { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin-top: .3rem; font-size: .72rem; color: var(--muted); }
.auth-chip b { font-weight: 700; }
.auth-chip.is-on b { color: var(--gold); }
.auth-policy { border: 1px solid var(--gold-line); border-radius: 12px; padding: .85rem 1rem 1rem; margin: .4rem 0 0; display: grid; gap: .35rem; min-width: 0; }
.auth-policy legend { padding: 0 .35rem; color: var(--gold); font-weight: 600; font-size: .92rem; }
.auth-policy-hint, .auth-policy-sub { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.auth-policy-sub { padding-inline: 0; margin: .15rem 0 .35rem; }
.auth-policy-warn { margin: .25rem 0 0; font-size: .8rem; color: var(--gold-2); }
.auth-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.85rem;
  padding: .55rem 0;
  border-bottom: 1px solid rgba(121, 56, 255, .12);
  cursor: pointer;
  position: relative;
}
.auth-policy > .auth-toggle:last-of-type { border-bottom: 0; }
.auth-toggle-text {
  display: grid;
  gap: .15rem;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-align: start;
}
.auth-toggle-text small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.35;
}
.auth-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  margin: 0;
}
.auth-switch {
  flex: 0 0 auto;
  width: 2.85rem;
  height: 1.65rem;
  border-radius: 999px;
  background: #2c2c2e;
  border: 1px solid rgba(121, 56, 255, .22);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
  position: relative;
  transition: background .2s ease, border-color .2s ease;
}
.auth-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #d8d4cc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: inset-inline-start .2s ease, background .2s ease;
}
.auth-toggle input:checked + .auth-switch {
  background: linear-gradient(145deg, #e6c76a, var(--gold), var(--gold-3));
  border-color: rgba(121, 56, 255, .55);
}
.auth-toggle input:checked + .auth-switch::after {
  inset-inline-start: calc(100% - 2px - 1.25rem);
  background: var(--on-accent);
}
.auth-toggle input:disabled + .auth-switch {
  opacity: .55;
}
.auth-toggle input:focus-visible + .auth-switch {
  box-shadow: 0 0 0 3px rgba(121, 56, 255, .28);
}
.auth-toggle input:disabled ~ .auth-toggle-text,
.auth-toggle:has(input:disabled) { cursor: not-allowed; }
.auth-policy-actions { display: flex; justify-content: flex-end; padding-top: .35rem; }
/* File being sent (local bubble until the server stores it) */
.msg.is-uploading .upload-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: .35rem .6rem; min-width: min(15rem, 62vw); white-space: normal;
}
.msg.is-uploading .upload-name {
  grid-column: 1 / -1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.msg.is-uploading .upload-meta { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.msg.is-uploading .upload-bar {
  height: .35rem; border-radius: 999px; background: var(--gold-soft); overflow: hidden;
}
.msg.is-uploading .upload-bar > span {
  display: block; height: 100%; background: var(--gold-shine); transition: width .2s linear;
}
.msg.is-uploading .upload-cancel { width: 2rem; height: 2rem; font-size: 1.1rem; }
.msg.upload-failed .upload-meta { color: var(--danger); }
.msg.upload-failed .upload-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.msg.upload-failed .upload-actions .btn { padding: .3rem .8rem; font-size: .82rem; }
.msg.pinned { box-shadow: 0 0 0 1px var(--gold), var(--glow); }
.msg.is-swiping { transition: none; user-select: none; -webkit-user-select: none; }
.msg.swipe-snap {
  transition: transform var(--dur-fast) var(--ease);
}
.msg.is-highlight {
  box-shadow: 0 0 0 2px var(--gold), var(--glow);
}
.msg .reply {
  display: block;
  width: 100%;
  font: inherit;
  font-size: .8rem;
  border: 0;
  border-inline-start: 3px solid var(--gold);
  padding: .35rem .55rem;
  margin-bottom: .4rem;
  color: var(--gold-2);
  background: rgba(121, 56, 255, .08);
  border-radius: 0 10px 10px 0;
  overflow-wrap: anywhere;
  cursor: pointer;
  text-align: start;
}
.msg .reply .reply-from {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: .1rem;
}
.msg .reply:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
[dir="rtl"] .msg .reply { border-radius: 10px 0 0 10px; }
.msg.is-deleted .body { font-style: italic; color: var(--muted); }
.msg .edited-mark { font-size: .68rem; color: var(--muted); margin-inline-start: .35rem; }
.msg .audit-note {
  margin-top: .35rem;
  font-size: .72rem;
  color: var(--gold-2);
  overflow-wrap: anywhere;
}
.msg-actions-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 .75rem calc(.75rem + env(safe-area-inset-bottom, 0px) + var(--kb-inset, 0px));
  box-sizing: border-box;
}
.msg-actions-overlay[hidden] { display: none !important; }
.msg-actions-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.msg-actions-sheet {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  padding: .85rem .85rem 1rem;
  border-radius: 18px 18px 16px 16px;
  background: #141414;
  border: 1px solid rgba(121, 56, 255, .32);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .55);
}
.msg-actions-head {
  text-align: center;
  padding: .15rem .4rem .7rem;
}
.msg-actions-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gold);
  font-family: var(--font);
}
.msg-actions-list {
  display: grid;
  gap: .15rem;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(121, 56, 255, .14);
}
.msg-act {
  display: flex;
  align-items: center;
  gap: .7rem;
  min-height: 48px;
  width: 100%;
  padding: .55rem .9rem;
  border: 0;
  border-bottom: 1px solid rgba(121, 56, 255, .1);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.msg-act:last-child { border-bottom: 0; }
.msg-act:hover,
.msg-act:focus-visible { background: rgba(121, 56, 255, .12); outline: none; }
.msg-act .nova-ico { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; }
.msg-act.is-danger { color: #ff8a80; }
.msg-act.is-danger .nova-ico { color: #ff8a80; }
.msg-actions-close {
  display: block;
  width: 100%;
  margin-top: .7rem;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(121, 56, 255, .28);
  background: rgba(121, 56, 255, .1);
  color: var(--gold);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.msg-actions-close:hover,
.msg-actions-close:focus-visible {
  background: rgba(121, 56, 255, .18);
  outline: none;
}
.msg img.preview {
  max-width: 100%; border-radius: 12px; margin-top: .35rem;
  border: 1px solid var(--gold-line);
}
.typing {
  padding: 0 1.1rem .4rem; color: var(--gold-2); font-size: .88rem; min-height: 1.2rem;
  text-align: start;
}
.reply-bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem;
  background: rgba(121, 56, 255, .1);
  border-top: 1px solid rgba(121, 56, 255,.2);
  flex-shrink: 0;
}
.reply-bar[hidden],
.media-preview[hidden],
.live-map[hidden],
.typing[hidden],
.conn-banner[hidden],
.search-bar[hidden] {
  display: none !important;
}
.reply-bar .reply-copy { flex: 1; min-width: 0; }
.reply-bar .reply-from {
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
}
.reply-bar .reply-text {
  font-size: .85rem; color: var(--gold-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: start;
}
.media-preview {
  padding: .75rem 1rem;
  border-top: 1px solid rgba(121, 56, 255,.12);
  background: rgba(8, 8, 8, .92);
}
.media-preview-card {
  display: grid; gap: .65rem;
  padding: .85rem;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
}
.media-preview-card img {
  width: 100%; max-height: 220px; object-fit: contain;
  border-radius: 12px; background: #000;
}
.media-preview-name {
  margin: 0; font-size: .88rem; color: var(--muted); text-align: start;
}
.media-preview-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: .55rem;
}
.composer {
  display: flex; align-items: center; gap: .45rem;
  padding: .85rem 1rem 1rem;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(121, 56, 255,.12);
}
.composer-box {
  flex: 1;
  display: flex; align-items: center; gap: .35rem;
  background: rgba(0,0,0,.45);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-pill);
  padding-block: .25rem;
  padding-inline: .55rem .45rem;
  min-height: 48px;
}
.composer-box textarea,
.composer-box .composer-editor {
  border: 0; background: transparent; box-shadow: none; padding: .55rem .4rem;
  flex: 1; min-width: 0; width: 100%; color: var(--ink); text-align: start;
  resize: none; line-height: 1.35;
}
.composer-box textarea::placeholder {
  color: rgba(235, 235, 245, .45);
  opacity: 1;
}
.composer-box textarea:focus { box-shadow: none; }
.composer-box .send-btn .nova-ico {
  color: var(--gold);
}
[dir="rtl"] .composer-box .send-btn .nova-ico {
  transform: scaleX(-1);
}
.mic-btn {
  width: 52px; height: 52px; border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #e6c76a, var(--gold), var(--gold-3));
  color: var(--on-accent);
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--glow);
  flex-shrink: 0;
  display: grid; place-items: center;
}
.mic-btn:hover { filter: brightness(1.05); }
.mic-btn.recording {
  filter: brightness(1.08);
  animation: rec-pulse 1.1s ease-in-out infinite;
}
.mic-btn[hidden], .send-btn[hidden], .composer-tools[hidden], .composer-box[hidden], .composer-recording[hidden] {
  display: none !important;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}
.cam-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(0,0,0,.45);
  color: var(--gold);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.cam-btn:hover { background: var(--gold-soft); }
.cam-btn .nova-ico { width: 20px; height: 20px; color: var(--gold); }
.composer-recording {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .65rem;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255, 69, 58, .35);
  border-radius: var(--radius-pill);
  padding: .35rem .55rem .35rem .45rem;
  min-height: 48px;
}
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #ff453a;
  box-shadow: 0 0 0 0 rgba(255, 69, 58, .55);
  animation: rec-pulse 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
.rec-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--gold);
  min-width: 3rem;
}
.rec-label {
  color: var(--muted);
  font-size: .88rem;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rec-cancel {
  color: #ff8f84 !important;
}
.rec-stop .nova-ico { color: var(--on-accent); }
[dir="rtl"] .rec-stop .nova-ico { transform: scaleX(-1); }
@keyframes rec-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 69, 58, .45); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(255, 69, 58, 0); }
}
.voice-note {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: min(280px, 72vw);
  min-width: min(200px, 60vw);
  margin-top: .15rem;
  padding: .35rem .45rem .35rem .35rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, .18);
}
.msg.out .voice-note {
  background: rgba(0, 0, 0, .12);
}
.voice-play {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0;
  background: linear-gradient(145deg, #e6c76a, var(--gold));
  color: var(--on-accent);
  font-size: .85rem;
  cursor: pointer;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.msg.out .voice-play {
  background: linear-gradient(145deg, #f0d98a, var(--gold));
}
.voice-meta {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: .2rem;
}
.voice-seek {
  width: 100%;
  accent-color: var(--gold);
  height: 4px;
}
.voice-dur {
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.voice-note audio { display: none; }
.msg .video-preview {
  display: block;
  width: 100%;
  max-width: min(320px, 72vw);
  max-height: min(360px, 50vh);
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #0a0a0a;
  margin-top: .25rem;
}
.media-duration {
  font-size: .75rem;
  color: var(--muted);
  margin-top: .2rem;
}
.media-preview-video {
  display: block;
  width: 100%;
  max-height: min(280px, 42vh);
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: #0a0a0a;
  margin-bottom: .5rem;
}
.loc-card {
  display: grid;
  gap: .4rem;
  min-width: min(220px, 70vw);
  max-width: min(300px, 78vw);
}
.loc-title {
  font-size: .82rem;
  color: var(--gold-2);
  font-weight: 600;
}
.loc-map {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background: rgba(0,0,0,.35);
}
.loc-map.is-fallback,
.live-map-fallback {
  display: grid;
  place-items: center;
  padding: .75rem;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
  height: 100%;
  min-height: 100px;
}
.loc-meta {
  font-size: .75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.loc-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45rem .7rem;
  border-radius: 10px;
  background: rgba(121, 56, 255,.14);
  border: 1px solid rgba(121, 56, 255,.28);
  color: var(--gold);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
}
.loc-open:hover { background: rgba(121, 56, 255,.22); }
.attach-wrap {
  position: relative;
  flex-shrink: 0;
}
.attach-menu {
  position: absolute;
  bottom: calc(100% + .45rem);
  inset-inline-start: 0;
  z-index: 30;
  display: grid;
  gap: .2rem;
  min-width: 168px;
  max-width: min(220px, calc(100vw - 1.5rem));
  padding: .4rem;
  border-radius: 14px;
  background: rgba(12, 12, 12, .96);
  border: 1px solid rgba(121, 56, 255,.28);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  transform: translateX(var(--attach-shift-x, 0px));
}
.attach-menu[hidden] { display: none !important; }
.attach-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .55rem .65rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text, #f5f0e6);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  text-align: start;
}
.attach-item:hover,
.attach-item:focus-visible {
  background: rgba(121, 56, 255,.12);
  outline: none;
}
.attach-item .nova-ico {
  width: 18px;
  height: 18px;
  color: var(--gold);
  flex-shrink: 0;
}
.sidebar-backdrop {
  display: none;
}
.sidebar-backdrop[hidden] { display: none !important; }
.msg .media-body em { display: none; }
.chk {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; color: var(--muted); white-space: nowrap;
  padding: 0 .35rem;
}
.device-list {
  list-style: none;
  margin: .35rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
  width: 100%;
}
.device-card {
  border: 1px solid rgba(121, 56, 255,.18);
  border-radius: 12px;
  padding: .7rem .8rem;
  background: rgba(255,255,255,.03);
}
.device-card.is-revoked { opacity: .65; }
.device-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.device-meta {
  margin: .35rem 0 .55rem;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
  word-break: break-word;
}
.device-status {
  font-size: .75rem;
  color: var(--gold);
}
.device-empty { margin: .25rem 0 0; color: var(--muted); }
.device-revoke { width: 100%; margin-top: .15rem; }
.manage-devices-row { margin-top: .35rem; }
.conn-banner.ok { background: #1f6b45; }
.live-map {
  height: min(32vh, 220px);
  max-height: 240px;
  flex: 0 0 auto;
  border-top: 1px solid var(--gold-line);
  z-index: 2;
  position: relative;
  background: #0a0a0a;
  overflow: hidden;
}
.live-map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #0a0a0a;
}
.live-map-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted, #9a917f);
  font-size: .9rem;
  padding: 1rem;
  text-align: center;
}

/* Info panel â€” solid surface matching NOVA (no city / photo bleed) */
.info-panel {
  background: #0a0a0a;
  border-inline-end: 1px solid rgba(121, 56, 255,.12);
  padding: 1.25rem 1rem;
  overflow: auto;
  display: flex; flex-direction: column; gap: 1rem;
  min-height: 0;
}
.info-panel .profile {
  text-align: center;
}
.info-panel .profile .avatar.lg {
  width: 96px; height: 96px; margin: 0 auto .75rem; font-size: 2rem;
  border-width: 2px;
}
.info-panel .profile h2 {
  margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.4rem;
}
.info-actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
}
.info-actions button {
  border: 1px solid var(--gold-line);
  background: transparent;
  color: var(--gold);
  border-radius: 14px;
  padding: .75rem .3rem;
  cursor: pointer;
  font-size: .72rem;
  display: grid; gap: .35rem; justify-items: center;
  align-content: center;
}
.info-actions button:hover { background: var(--gold-soft); }
.info-actions .ico { font-size: 1.15rem; }
.info-menu {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid rgba(121, 56, 255,.12);
}
.info-menu li {
  display: flex; justify-content: space-between; align-items: center;
  padding: .85rem .2rem;
  border-bottom: 1px solid rgba(121, 56, 255,.08);
  color: var(--ink); font-size: .9rem;
  gap: .75rem;
}
.info-menu .ico { color: var(--gold); }

.cardish {
  background: var(--panel);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  padding: 1.25rem; margin: 1rem; max-width: 560px;
  backdrop-filter: blur(12px);
}
.settings-page {
  max-width: 720px; margin: 0 auto; padding: 1rem;
  min-height: 100%;
}
.disclosure p { color: var(--muted); line-height: 1.55; }
.page-head a { color: var(--gold); }

dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  width: min(320px, 86vw);
  background: rgba(44, 44, 46, .92);
  color: var(--ink);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
  overflow: hidden;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}
dialog::backdrop {
  background: rgba(0, 0, 0, .45);
  pointer-events: auto;
  touch-action: none;
}
dialog .stack { padding: 1.15rem 1.1rem .95rem; gap: .75rem; }
dialog h3 {
  font-family: var(--font);
  color: var(--ink);
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
}
dialog .fineprint { text-align: center; margin: 0; }
.call-ui { display: grid; gap: .75rem; padding: 1.15rem; text-align: center; }
.call-dialog {
  width: min(360px, 92vw);
  border-radius: 18px;
  background: rgba(20, 20, 22, .96);
}
.call-stage {
  position: relative;
  min-height: 180px;
  border-radius: 16px;
  background: #0a0a0a;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.call-ui.is-voice .call-stage {
  background: radial-gradient(circle at 50% 30%, rgba(121, 56, 255,.18), #0a0a0a 70%);
}
#remote-video, #local-video {
  width: 100%; background: #000; border-radius: 12px; max-height: 280px;
  border: 1px solid var(--gold-line);
}
#remote-video { max-height: 260px; }
#local-video {
  position: absolute;
  inset-inline-end: .65rem;
  inset-block-end: .65rem;
  width: 96px; max-height: 120px;
  border-radius: 12px;
  border: 1px solid var(--gold-line);
}
.call-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #e6c76a, var(--gold), var(--gold-3));
  color: var(--on-accent); font-weight: 800; font-size: 1.8rem;
  box-shadow: var(--glow);
}
.call-peer {
  margin: .35rem 0 0;
  font-weight: 700;
  font-size: 1.1rem;
}
.call-status {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
.call-timer {
  margin: .35rem 0 0;
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.15rem;
  letter-spacing: .04em;
}
.call-timer[hidden] { display: none !important; }
.call-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
}
.call-actions .btn { min-width: 88px; }

.back-arrow::before { content: 'â†'; }
[dir="rtl"] .back-arrow::before { content: 'â†’'; }
.back-link {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--gold); text-decoration: none;
}

/* â€”â€” Sheet dialogs (create / delete user) â€”â€” */
.sheet-dialog {
  width: min(380px, 92vw);
  max-height: min(90dvh, 720px);
  background: rgba(28, 28, 30, .96);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
}
/* Create / Manage user: room for Login & Security labels (AR + EN). */
#create-user-dialog,
#manage-user-dialog,
#create-admin-dialog,
#delete-admin-dialog,
#manage-admin-dialog {
  width: min(34rem, 94vw);
  max-height: min(92dvh, 860px);
}
#create-user-dialog .sheet-form,
#manage-user-dialog .sheet-form,
#create-admin-dialog .sheet-form,
#manage-admin-dialog .sheet-form {
  max-height: min(92dvh, 860px);
}
.sheet-dialog::backdrop {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.sheet-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(90dvh, 720px);
}
.sheet-head {
  padding: 1.2rem 1.2rem .55rem;
  text-align: center;
  flex-shrink: 0;
}
.sheet-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  font-family: var(--font);
}
.sheet-sub {
  margin: .4rem 0 0;
  color: rgba(235, 235, 245, .6);
  font-size: .82rem;
  line-height: 1.45;
  overflow-wrap: break-word;
  word-break: normal;
}
.sheet-body {
  padding: .35rem 1.2rem calc(1rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: .75rem;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  text-align: start;
  flex: 1;
  min-height: 0;
}
.sheet-banner {
  margin: 0;
  padding: .7rem .85rem;
  border-radius: 12px;
  background: rgba(255, 69, 58, .14);
  color: #ff8a80;
  font-size: .86rem;
  line-height: 1.4;
  border: 1px solid rgba(255, 69, 58, .28);
  text-align: start;
}
.sheet-body .field {
  display: grid;
  gap: .35rem;
  margin: 0;
}
.sheet-body .field-label {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(235, 235, 245, .72);
  text-align: start;
}
.sheet-body input,
.sheet-body select {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  padding: .7rem .9rem;
  font: inherit;
  text-align: start;
  direction: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.sheet-body input:focus,
.sheet-body select:focus {
  outline: none;
  border-color: rgba(10, 132, 255, .7);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .2);
  background: rgba(0, 0, 0, .45);
}
.sheet-body .field.is-invalid input,
.sheet-body .field.is-invalid select {
  border-color: rgba(255, 69, 58, .75);
  box-shadow: 0 0 0 3px rgba(255, 69, 58, .18);
}
.sheet-body .field-error {
  font-size: .78rem;
  color: #ff453a;
  line-height: 1.35;
  text-align: start;
}

/* iOS-like user picker (delete dialog) */
.pick-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .28);
  overflow: auto;
  max-height: min(42vh, 320px);
}
.pick-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
  padding: .75rem .85rem;
  cursor: pointer;
  border-bottom: .5px solid rgba(255, 255, 255, .08);
  text-align: start;
  transition: background .12s;
}
.pick-item:last-child { border-bottom: 0; }
.pick-item:hover { background: rgba(255, 255, 255, .05); }
.pick-item.is-selected {
  background: rgba(121, 56, 255, .16);
}
.pick-item .avatar {
  width: 40px; height: 40px; font-size: .85rem;
}
.pick-meta {
  display: grid;
  gap: .15rem;
  min-width: 0;
}
.pick-name {
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-sub {
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
  flex-shrink: 0;
}
.pick-item.is-selected .pick-check {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px rgba(28, 28, 30, .95);
}
.pick-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

.sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  padding: .85rem 1.2rem 1.15rem;
  border-top: .5px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .22);
  flex-shrink: 0;
}
.sheet-actions-single {
  grid-template-columns: 1fr;
}
.manage-actions {
  display: grid;
  gap: .55rem;
}
.manage-actions .sheet-btn {
  width: 100%;
}
.manage-meta {
  display: grid;
  gap: .55rem;
  text-align: start;
}
.manage-row {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
}
.manage-row span {
  color: var(--muted);
  font-size: .82rem;
}
.manage-row strong {
  font-size: .88rem;
  text-align: end;
  overflow-wrap: anywhere;
}
.manage-loading {
  margin: 0;
  color: var(--muted);
  text-align: center;
}
#settings-form.settings-form,
#settings-form.stack {
  gap: .85rem;
}
#settings-form .settings-field {
  display: grid;
  gap: .35rem;
  text-align: start;
}
#settings-form .field-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
#settings-form .field-hint {
  font-size: .75rem;
  color: rgba(235, 235, 245, .45);
  line-height: 1.35;
}
#settings-form input,
#settings-form textarea {
  width: 100%;
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  color: var(--ink);
  padding: .65rem .85rem;
  font: inherit;
  resize: vertical;
}
#settings-form textarea {
  min-height: 88px;
  line-height: 1.45;
}
.audit-hint {
  margin: 0;
  padding-bottom: .35rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.4;
}
.audit-empty {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}
.audit-detail-head {
  display: grid;
  gap: .65rem;
  border-bottom: .5px solid rgba(255, 255, 255, .08);
  padding-bottom: .85rem;
}
.audit-back {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, .06);
  color: var(--gold, var(--gold));
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: .45rem .75rem;
  border-radius: 10px;
  cursor: pointer;
  width: fit-content;
  text-align: start;
}
.audit-back:hover { background: rgba(255, 255, 255, .1); }
.audit-detail-user {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.audit-detail-user .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold), #8a7014);
  color: var(--on-accent);
  font-weight: 800;
  flex-shrink: 0;
}
.audit-detail-user .name {
  font-weight: 700;
  color: var(--ink);
}
.audit-detail-user .meta {
  color: var(--muted);
  font-size: .82rem;
}
.audit-cap {
  margin: 0;
  color: rgba(235, 235, 245, .45);
  font-size: .75rem;
}
.audit-log-list {
  list-style: none;
  margin: 0;
  padding: .5rem .75rem 1rem;
  display: grid;
  gap: .55rem;
}
.audit-log-item {
  display: grid;
  gap: .25rem;
  padding: .75rem .85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  text-align: start;
  min-width: 0;
  overflow-wrap: anywhere;
}
.app-shell.admin-shell.is-workspace .audit-log-item {
  padding: .95rem 1.1rem;
  border-color: rgba(121, 56, 255, .14);
}
.audit-log-action {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  color: var(--ink);
}
.audit-log-target {
  display: block;
  margin-top: .2rem;
  font-size: .78rem;
  color: var(--muted);
}
.audit-log-time {
  font-size: .75rem;
  color: rgba(235, 235, 245, .45);
}
.audit-loading {
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  list-style: none;
}
.sheet-btn {
  appearance: none;
  border: 0;
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, opacity .12s, filter .12s;
  -webkit-tap-highlight-color: transparent;
}
.sheet-btn:active { transform: scale(.98); }
.sheet-btn:disabled { opacity: .45; cursor: not-allowed; }
.sheet-btn-cancel {
  background: rgba(120, 120, 128, .28);
  color: var(--ink);
  font-weight: 600;
}
.sheet-btn-cancel:hover { background: rgba(120, 120, 128, .38); }
.sheet-btn-primary {
  background: linear-gradient(180deg, #5ac8fa, #0a84ff);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 8px 18px rgba(10, 132, 255, .28);
}
.sheet-btn-primary:hover { filter: brightness(1.05); }
.sheet-btn-danger {
  background: linear-gradient(180deg, #ff6961, #ff453a);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 18px rgba(255, 69, 58, .25);
}
.sheet-btn-danger:hover { filter: brightness(1.05); }

.pad { padding: 1rem; }
.user-admin-actions { display: grid; gap: .55rem; }

/* â€”â€” NOVA notifications (toast + dialog) â€”â€” */
/* Global host lives in the top layer via popover=manual so it sits above <dialog>. */
.nova-toast-host,
.nova-toast-host[popover] {
  position: fixed !important;
  inset: unset !important;
  top: max(0.7rem, env(safe-area-inset-top, 0px)) !important;
  inset-inline: 0.75rem !important;
  bottom: auto !important;
  left: auto;
  right: auto;
  transform: none !important;
  margin: 0 !important;
  border: 0;
  padding: 0;
  width: auto !important;
  max-width: none !important;
  height: fit-content;
  max-height: min(46dvh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
  color: inherit;
  box-shadow: none;
  z-index: 2147483646;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  pointer-events: none;
}
.nova-toast-host::backdrop {
  display: none !important;
  pointer-events: none !important;
  background: transparent;
}
dialog .nova-toast-host.is-dialog-fallback {
  position: absolute;
  top: 0.55rem;
  left: 50%;
  z-index: 30;
  width: min(calc(100% - 1.2rem), 420px);
}
.nova-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .7rem;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
  padding: .85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--gold-line);
  background: rgba(18, 16, 12, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow), var(--glow);
  color: var(--ink);
  text-align: start;
  animation: nova-toast-in .28s ease-out;
}
.nova-toast.is-out { animation: nova-toast-out .25s ease-in forwards; }
.nova-toast .nt-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(145deg, var(--gold-2), var(--gold), var(--gold-3));
  color: var(--on-accent);
  display: grid; place-items: center;
  font-size: 1rem;
  box-shadow: var(--glow);
  flex-shrink: 0;
}
.nova-toast .nt-body { min-width: 0; }
.nova-toast .nt-title {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--gold);
  margin: 0 0 .15rem;
  font-weight: 600;
}
.nova-toast .nt-msg {
  margin: 0;
  font-size: .92rem;
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}
.nova-toast .nt-close {
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  width: 28px; height: 28px; border-radius: 8px;
}
.nova-toast .nt-close:hover { background: var(--gold-soft); color: var(--gold); }
.nova-toast.success .nt-mark { background: linear-gradient(145deg, #e6c76a, var(--gold), var(--gold-3)); }
.nova-toast.error { border-color: rgba(196, 75, 60, .45); }
.nova-toast.error .nt-title { color: #f0a090; }
.nova-toast.error .nt-mark { background: linear-gradient(145deg, #e07a6c, var(--danger)); color: #fff; box-shadow: none; }
.nova-toast.info .nt-title { color: var(--gold-2); }

@keyframes nova-toast-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes nova-toast-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

.nova-modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(380px, 92vw);
  background: rgba(28, 28, 30, .96);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.nova-modal::backdrop {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.nova-modal .nm-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.nova-modal .nm-copy {
  padding: 1.2rem 1.2rem .55rem;
  display: grid;
  gap: .4rem;
  text-align: center;
}
.nova-modal .nm-title {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
}
.nova-modal .nm-msg {
  margin: .35rem 0 0;
  color: rgba(235, 235, 245, .6);
  line-height: 1.45;
  font-size: .86rem;
  white-space: pre-wrap;
}
.nova-modal .nm-input {
  width: calc(100% - 2.4rem);
  margin: .35rem 1.2rem 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: .7rem .9rem;
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  font: inherit;
  text-align: start;
  min-height: 46px;
}
.nova-modal .nm-input:focus {
  outline: none;
  border-color: rgba(121, 56, 255, .55);
  box-shadow: 0 0 0 3px rgba(121, 56, 255, .15);
}
.nova-modal .nm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  padding: .85rem 1.2rem 1.15rem;
  border-top: .5px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .22);
}
.nova-modal .nm-actions .nm-btn {
  appearance: none;
  border: 0;
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  padding: .75rem .5rem;
  -webkit-tap-highlight-color: transparent;
  color: var(--ink);
  background: rgba(120, 120, 128, .28);
}
.nova-modal .nm-actions .nm-btn + .nm-btn {
  border-inline-start: 0;
}
.nova-modal .nm-actions .nm-btn.is-default {
  background: linear-gradient(145deg, #e6c76a, var(--gold), var(--gold-3));
  color: var(--on-accent);
}
.nova-modal .nm-actions .nm-btn.is-destructive {
  background: linear-gradient(145deg, #ff6b5a, #ff453a, #c62828);
  color: #fff;
}
.nova-modal .nm-actions .nm-btn:hover { filter: brightness(1.05); }
.nova-modal .nm-actions .nm-btn:active { transform: scale(.98); }
.nova-modal.is-prompt .nm-actions { grid-template-columns: 1fr 1fr; }
.nova-modal .nm-cancel[hidden] + .nm-ok,
.nova-modal .nm-actions:has(.nm-cancel[hidden]) {
  grid-template-columns: 1fr;
}

@media (max-width: 1100px) {
  .app-shell.user-chat { grid-template-columns: var(--nav-w) 1fr; }
  .info-panel { display: none; }
}
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  html, body {
    height: 100%;
    height: 100dvh;
  }
  .app-shell, .app-shell.admin-shell, .app-shell.admin-chat, .app-shell.user-chat, .app-shell.user-settings-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: var(--app-vvh, 100dvh);
    max-height: var(--app-vvh, 100dvh);
    position: relative;
    overflow: hidden;
  }
  .app-shell.admin-chat,
  .app-shell.user-chat {
    position: fixed;
    inset-inline: 0;
    top: var(--app-vv-top, 0px);
    width: 100%;
  }
  html.kb-open .composer,
  html.kb-open .app-shell.admin-chat .composer,
  html.kb-open .app-shell.user-chat .composer {
    padding-bottom: .45rem !important;
  }
  html.kb-open .reply-bar {
    padding-bottom: .4rem;
  }
  html.kb-open .chat-header {
    padding-top: calc(.3rem + env(safe-area-inset-top, 0px));
    padding-bottom: .3rem;
  }
  html.kb-open .chat-header .status-line { display: none; }
  .chat-pane { flex: 1; min-height: 0; width: 100%; }
  .nav-toggle { display: inline-flex; }
  .nova-nav {
    display: flex;
    position: fixed;
    z-index: 70;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 12px 0 32px rgba(0,0,0,.45);
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    overflow: auto;
  }
  [dir="rtl"] .nova-nav { transform: translateX(105%); }
  .app-shell.nav-open .nova-nav { transform: translateX(0); }
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 65;
    border: 0;
    background: rgba(0,0,0,.5);
  }
  .nav-backdrop[hidden] { display: none !important; }
  /* Admin chat list is an in-flow screen (rules below). Other shells may still use a drawer. */
  .admin-shell .sidebar,
  .admin-chat .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(340px, 88vw);
    max-width: 100vw;
    z-index: 45;
    transform: translateX(-105%);
    transition: transform .22s ease;
    background: var(--bg, #050505);
    box-shadow: 8px 0 28px rgba(0,0,0,.45);
  }
  .user-settings-shell .settings-main {
    flex: 1;
    min-height: 0;
    width: 100%;
  }
  .user-settings-shell .settings-head {
    padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
  }
  .user-settings-shell .settings-scroll {
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
  [dir="rtl"] .admin-shell .sidebar,
  [dir="rtl"] .admin-chat .sidebar {
    transform: translateX(105%);
    box-shadow: -8px 0 28px rgba(0,0,0,.45);
  }
  .admin-shell.show-list .sidebar,
  .admin-chat.show-list .sidebar {
    transform: translateX(0);
  }
  .admin-chat.list-only .sidebar,
  .admin-shell.list-only .sidebar {
    width: 100%;
    max-width: 100%;
  }
  .admin-shell .chat-pane,
  .admin-chat .chat-pane {
    display: flex;
    min-width: 0;
    width: 100%;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 40;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(0,0,0,.45);
    cursor: pointer;
  }
  .chat-back-btn { display: none; flex-shrink: 0; }
  .admin-chat.has-conversation .chat-back-btn { display: inline-flex; }
  .admin-chat .nav-desktop-only { display: none; }
  .chat-header .ui-scale { display: none; }
  .chat-header .chat-actions #btn-search { display: none; }
  .chat-header .chat-actions #btn-menu { display: inline-flex; flex-shrink: 0; }
  .admin-chat .chat-header,
  .admin-chat .sidebar-head {
    padding-top: calc(.45rem + env(safe-area-inset-top, 0px));
    min-width: 0;
  }
  .admin-chat .sidebar-head { flex-wrap: nowrap; }
  .admin-chat .sidebar-actions { flex-wrap: nowrap; flex-shrink: 0; }
  .admin-chat .chat-actions { flex-wrap: nowrap; overflow: visible; gap: .15rem; }
  .admin-chat .search-row input,
  .admin-chat .composer textarea,
  .user-chat .composer textarea { font-size: 16px; }
  .admin-chat .sidebar { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .admin-chat .sidebar#admin-side {
    position: relative !important;
    transform: none !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    z-index: 2;
    display: flex !important;
    box-shadow: none;
  }
  .admin-chat:not(.has-conversation) .chat-pane { display: none !important; }
  .admin-chat.has-conversation .sidebar#admin-side { display: none !important; }
  .admin-chat.has-conversation .chat-pane {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
  }
  .admin-shell .sidebar.module-rail {
    position: relative !important;
    transform: none !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    z-index: 2;
    display: flex !important;
    box-shadow: none;
  }
  .admin-shell .module-stage-host { display: none !important; }
  .admin-shell .sidebar-head {
    padding-top: calc(.45rem + env(safe-area-inset-top, 0px));
  }
  .chat-header { padding-inline: .65rem; gap: .45rem; }
  .chat-actions .icon-btn,
  .nav-toggle { width: 44px; height: 44px; }
  .composer {
    padding-bottom: calc(.65rem + env(safe-area-inset-bottom, 0px));
  }
  .attach-menu {
    inset-inline-start: 0;
    bottom: calc(100% + .35rem);
  }
  .msg { max-width: min(88%, 100%); min-width: 0; }
  .messages, .chat-pane, .composer, .reply-bar { max-width: 100%; }
  .reply-bar { padding-inline: .75rem; }
  .msg .video-preview { max-width: min(100%, 78vw); }
  .camera-live-dialog {
    width: 100vw;
    max-width: 100vw;
    border-radius: 0;
    height: 100dvh;
    max-height: 100dvh;
  }
  .camera-live {
    min-height: 100dvh;
    max-height: 100dvh;
  }
  .live-map {
    height: min(28dvh, 200px);
  }
  #call-ui.is-video {
    position: fixed;
    inset: 0;
    z-index: 80;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
  }
  .composer { padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px)); }
  .nova-toast-host,
  .nova-toast-host[popover] {
    top: max(0.55rem, env(safe-area-inset-top, 0px)) !important;
    inset-inline: 0.6rem !important;
    transform: none !important;
    width: auto !important;
  }
  .nova-toast { padding: .8rem .85rem; }
}
@media (max-width: 430px) {
  .peer-meta h1 { font-size: .98rem; }
  .admin-chat .chat-actions { gap: 0; }
  .admin-chat .chat-actions #btn-search { display: none; }
  .admin-chat .chat-header { padding-inline: .35rem; gap: .25rem; }
  .admin-chat .sidebar-head h1 { font-size: 1.15rem; }
  .location-card { width: 100%; min-height: 100dvh; border-radius: 0; }
  .location-map { height: min(52dvh, 420px); }
}

.location-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
}
.location-dialog::backdrop { background: rgba(0,0,0,.62); }
.location-card {
  width: min(440px, calc(100vw - 1.5rem));
  background: #111;
  color: var(--ink, #f5f0e6);
  border-radius: 16px;
  padding: 1rem;
  border: 1px solid rgba(121, 56, 255,.2);
}
.location-map {
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  margin: .75rem 0;
}
.location-map.is-fallback,
.loc-map.is-fallback {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 1rem;
  color: var(--muted, #b7ad98);
}
.location-address { margin: 0 0 .75rem; line-height: 1.4; }
.location-actions { display: flex; gap: .5rem; justify-content: flex-end; }

/* Login camera verification + admin login security */
.auth-shell:has(.camera-verify-card) {
  place-items: center;
  align-content: center;
  overflow-x: hidden;
}
.camera-verify-card.auth-card,
.auth-card.amor-card.camera-verify-card {
  width: min(440px, calc(100vw - 2rem));
  max-width: 440px;
  overflow: hidden;
  box-sizing: border-box;
}
.camera-verify-card .camera-stage {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  max-height: min(48dvh, 340px);
  margin: .85rem 0 1rem;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(121, 56, 255,.18);
  isolation: isolate;
  contain: layout paint;
}
.camera-verify-card #camera-preview {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
  transform: scaleX(-1);
  transform-origin: center center;
}
.camera-verify-card #camera-preview[hidden],
.camera-verify-card .camera-placeholder[hidden],
.camera-verify-card .btn[hidden],
.camera-verify-card .btn.is-hidden {
  display: none !important;
}
.camera-verify-card .camera-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  text-align: center;
  color: var(--muted, #9a917f);
  z-index: 1;
}
.camera-verify-card .camera-consent {
  margin: 0 0 .35rem;
  line-height: 1.45;
}
.camera-verify-card .amor-actions {
  width: 100%;
}
.camera-verify-card .amor-actions .btn {
  width: 100%;
}
.login-security-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .65rem;
}
.login-security-item:not(.sec-card) {
  border: 1px solid rgba(121, 56, 255,.16);
  border-radius: 12px;
  padding: .75rem .85rem;
  background: rgba(255,255,255,.03);
}
.login-capture-img {
  width: 100%;
  max-height: min(70dvh, 520px);
  object-fit: contain;
  border-radius: 12px;
  background: #000;
}
@media (max-width: 860px) {
  .camera-verify-card.auth-card,
  .auth-card.amor-card.camera-verify-card {
    width: min(100%, calc(100vw - 1.25rem));
    padding: 1.25rem 1rem 1.35rem;
  }
  .camera-verify-card .camera-stage {
    max-height: min(42dvh, 300px);
    aspect-ratio: 3 / 4;
  }
}

/* Call stage â€” full-bleed remote video, floating local preview, safe areas */
.call-dialog {
  width: min(440px, calc(100vw - 1.5rem));
  max-height: min(92dvh, 860px);
  background: #070707;
  border-radius: 20px;
  overflow: hidden;
}
.call-dialog.is-video-call {
  width: min(980px, calc(100vw - 2rem));
  height: min(88dvh, 860px);
}
.call-ui {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  min-height: 0;
  height: 100%;
  padding: 1rem 1rem calc(.9rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.call-stage {
  position: relative;
  flex: 1;
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  display: grid;
  place-items: center;
}
.call-ui.is-voice .call-stage {
  min-height: 180px;
  background: radial-gradient(circle at 50% 30%, rgba(121, 56, 255,.18), #0a0a0a 70%);
}
#remote-video, #local-video {
  background: #000;
  max-height: none;
}
#remote-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}
#local-video {
  position: absolute;
  z-index: 3;
  top: .75rem;
  inset-inline-end: .75rem;
  width: 112px;
  height: 158px;
  max-height: none;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(121, 56, 255,.45);
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  transform: scaleX(-1);
}
#local-video.is-cam-off { opacity: .35; }
#remote-audio { display: none; }
.call-meta { text-align: center; }
.call-kind {
  margin: 0;
  color: var(--gold-2);
  font-size: .92rem;
  font-weight: 700;
}
.call-actions .btn {
  min-width: 44px;
  min-height: 48px;
  padding-inline: .9rem;
}
.call-ui.is-ringing .call-accept,
.call-ui.is-ringing .call-reject {
  min-width: 42%;
  min-height: 52px;
  font-size: 1.05rem;
}
.call-ui.is-active.is-video .call-meta { display: none; }
.call-ui.is-active.is-video {
  padding: 0;
  gap: 0;
  min-height: 100%;
}
.call-ui.is-active.is-video .call-stage {
  border-radius: 0;
  min-height: 0;
}
.call-ui.is-active.is-video .call-actions {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(transparent, rgba(0,0,0,.72));
}
.call-ui.is-active.is-video #local-video {
  top: calc(.75rem + env(safe-area-inset-top, 0px));
}

/* Attachment preview + view-once viewer */
.media-preview-dialog {
  width: min(460px, calc(100vw - 1.5rem));
  max-height: min(92dvh, 780px);
  border-radius: 18px;
  background: #121212;
}
.media-preview-card { display: grid; gap: .75rem; padding: 1rem; }
.media-preview-stage {
  background: #000;
  border-radius: 14px;
  min-height: 140px;
  max-height: min(48dvh, 420px);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.media-preview-stage img,
.media-preview-stage video,
.media-preview-video {
  width: 100%;
  max-height: min(48dvh, 420px);
  object-fit: contain;
  background: #000;
}
.view-once-toggle {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  color: var(--ink);
  font-size: .95rem;
}
.view-once-toggle input { width: 1.15rem; height: 1.15rem; }
.media-preview-actions .btn { min-height: 48px; }
.view-once-dialog {
  width: min(960px, 100vw);
  height: min(100dvh, 920px);
  max-width: 100vw;
  margin: 0;
  padding: 0;
  background: #000;
  border-radius: 0;
}
.view-once-sheet { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.view-once-dialog img,
.view-once-dialog video {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  object-fit: contain;
  background: #000;
}
.view-once-close {
  position: absolute;
  z-index: 2;
  top: calc(.6rem + env(safe-area-inset-top, 0px));
  inset-inline-end: .6rem;
  background: rgba(0,0,0,.55);
  color: #fff;
}
.view-once-opened, .view-once-open { min-height: 44px; }

@media (max-width: 860px) {
  .call-dialog,
  .call-dialog.is-video-call {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
  .call-ui {
    min-height: 100dvh;
    padding-top: calc(.75rem + env(safe-area-inset-top, 0px));
  }
  .call-ui.is-active.is-video { padding-top: 0; }
  .media-preview-dialog {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border-radius: 18px 18px 0 0;
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto;
  }
  .chat-header { padding-top: calc(.55rem + env(safe-area-inset-top, 0px)); }
  .msg img.preview, .msg video.preview, .loc-card, .voice-note { max-width: 100%; }
}

/* =====================================================================
   2026-09-29 audit/fix pass â€” bubbles, voice, view once, security, dialogs
   (appended; overrides earlier rules by order, black/gold theme kept)
   ===================================================================== */

/* Distinct bubbles: outgoing violet, incoming midnight card */
:root {
  --bubble-in: #1C2A52;
  --bubble-out: linear-gradient(160deg, #5B28F0 0%, #7938FF 55%, #9B45FF 100%);
}
.msg.in { border-color: rgba(163, 75, 255, 0.22); }
.msg.out { border-color: transparent; }
.msg.out .time { color: rgba(248, 250, 255, 0.78); }

/* Compact voice note (WhatsApp-like) */
.voice-note {
  width: min(260px, 68vw);
  min-width: min(190px, 58vw);
  gap: .5rem;
  padding: .2rem .15rem;
  background: transparent;
}
.msg.out .voice-note { background: transparent; }
.voice-play { width: 34px; height: 34px; }
.voice-play svg { width: 18px; height: 18px; }
.voice-main {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: .45rem;
}
.voice-wave {
  position: relative;
  flex: 1; min-width: 0;
  height: 28px;
  display: flex; align-items: center; gap: 2px;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.voice-wave:focus-visible { box-shadow: 0 0 0 2px var(--gold-line); border-radius: 6px; }
.voice-bar {
  flex: 1 1 0;
  min-width: 2px;
  height: calc(var(--h, .4) * 100%);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  transition: background-color .12s linear;
}
.msg.out .voice-bar { background: rgba(255, 240, 200, 0.32); }
.voice-bar.is-played { background: var(--gold); }
.msg.out .voice-bar.is-played { background: #fbe7a6; }
.voice-knob {
  position: absolute;
  top: 50%;
  inset-inline-start: calc(var(--p, 0) * 100%);
  width: 11px; height: 11px;
  margin-inline-start: -5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
  transform: translateY(-50%) scale(0);
  transition: transform .12s ease;
  pointer-events: none;
}
.voice-note.is-playing .voice-knob,
.voice-note.is-scrubbing .voice-knob { transform: translateY(-50%) scale(1); }
.voice-dur { flex-shrink: 0; min-width: 2.4rem; text-align: end; font-size: .72rem; }

/* Compact View Once chip (no filename) */
.vo-chip {
  display: inline-flex; align-items: center; gap: .55rem;
  min-height: 44px;
  padding: .4rem .75rem .4rem .5rem;
  border-radius: 14px;
  border: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, .22);
  color: var(--ink);
  font: inherit;
  text-align: start;
  max-width: 100%;
}
button.vo-chip { cursor: pointer; }
button.vo-chip:hover { background: var(--gold-soft); }
button.vo-chip:disabled { opacity: .6; cursor: progress; }
.vo-chip .vo-ico { width: 26px; height: 26px; flex-shrink: 0; color: var(--gold); }
.vo-chip .vo-text { display: grid; line-height: 1.2; min-width: 0; }
.vo-chip .vo-text strong { font-size: .88rem; font-weight: 600; }
.vo-chip .vo-text small { font-size: .72rem; color: var(--muted); }
.vo-chip .vo-text small:empty { display: none; }
.vo-chip.is-opened { border-style: dashed; }
.vo-chip.is-opened .vo-ico { color: var(--muted); }
.vo-chip .vo-badge {
  font-size: .66rem; padding: .1rem .4rem; border-radius: 999px;
  background: var(--gold-soft); color: var(--gold); white-space: nowrap;
}

/* Header notification bell */
.push-bell { position: relative; }
.push-bell .push-bell-dot {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: transparent;
}
.push-bell[data-state="on"] { color: var(--gold); }
.push-bell[data-state="on"] .push-bell-dot { background: #3ddc84; }
.push-bell[data-state="off"] .push-bell-dot,
.push-bell[data-state="ios_install"] .push-bell-dot { background: var(--gold); }
.push-bell[data-state="blocked"] { color: #ff6b61; }
.push-bell[data-state="blocked"]::after {
  content: ""; position: absolute; left: 25%; right: 25%; top: 50%;
  height: 2px; background: currentColor; transform: rotate(-35deg); border-radius: 2px;
}
.push-status { margin: 0; font-weight: 600; }
.push-status[data-state="on"] { color: #3ddc84; }
.push-status[data-state="blocked"] { color: #ff6b61; }
#push-settings .fineprint { white-space: pre-line; }

/* Conversation menu (grouped, destructive last) */
.chat-menu-body { display: grid; gap: .35rem; }
.menu-group-title {
  margin: .55rem .15rem .15rem;
  font-size: .72rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: break-word;
  word-break: normal;
}
.menu-group-title.is-danger { color: #ff8a80; }
.menu-group {
  display: grid;
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .02);
}
.menu-group.is-danger { border-color: rgba(255, 69, 58, .35); }
.menu-item {
  display: flex; align-items: center; gap: .7rem;
  min-height: 48px;
  padding: .6rem .9rem;
  border: 0; border-bottom: 1px solid rgba(121, 56, 255, .12);
  background: transparent; color: var(--ink);
  font: inherit; text-align: start; cursor: pointer;
  overflow-wrap: break-word;
  word-break: normal;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item:hover, .menu-item:focus-visible { background: var(--gold-soft); outline: none; }
.menu-item .nova-ico { width: 20px; height: 20px; color: var(--gold); flex-shrink: 0; }
.menu-group.is-danger .menu-item .nova-ico { color: #ff8a80; }
.menu-item.is-danger { color: #ff8a80; }

/* Small buttons + badges */
.btn.sm { min-height: 34px; padding: .35rem .75rem; font-size: .82rem; border-radius: 10px; gap: .35rem; }
.btn.sm .nova-ico { width: 16px; height: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.nav-item { position: relative; }
.nav-badge {
  position: absolute; top: 4px; inset-inline-end: 6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: #ff453a; color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 18px; text-align: center;
}
.pill .pill-count:empty { display: none; }
.pill .pill-count {
  display: inline-block; min-width: 1.2rem; padding: 0 .35rem; margin-inline-start: .2rem;
  border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: .72rem;
}

/* Security approvals panel â€” full workspace cards */
.sec-toolbar {
  display: grid;
  gap: .7rem;
  padding-bottom: .55rem;
}
.sec-toolbar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.sec-toolbar .prefs-section-title { margin: 0; }
.sec-toolbar-filters { min-width: 0; }
.sec-filters {
  display: flex;
  flex-wrap: nowrap;
  gap: .4rem;
  padding: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.sec-filters .pill {
  flex: 0 0 auto;
  white-space: nowrap;
}
.sec-bulk {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  padding: .55rem .75rem;
  border: 1px solid rgba(121, 56, 255, .16);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}
.login-security-list {
  list-style: none;
  margin: 0;
  padding: 0 0 calc(1rem + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: .85rem;
  min-width: 0;
  overflow-x: hidden;
}
.sec-card,
.login-security-item.sec-card {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: .9rem 1.1rem;
  align-items: start;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(121, 56, 255, .16);
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
}
.sec-card.is-pending {
  border-color: rgba(121, 56, 255, .55);
  box-shadow: 0 0 0 1px rgba(121, 56, 255, .18) inset;
}
.sec-card-main {
  min-width: 0;
  display: grid;
  gap: .7rem;
}
.sec-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: .65rem 1rem;
  min-width: 0;
}
.sec-identity {
  min-width: 0;
  display: grid;
  gap: .15rem;
  text-align: start;
}
.sec-identity strong {
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}
.sec-user { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.sec-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: .4rem .5rem;
  flex: 0 1 auto;
  margin-inline-start: auto;
}
.sec-check {
  display: grid;
  place-items: center;
  margin-inline-start: .15rem;
}
.sec-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--gold); }
.sec-photo {
  appearance: none;
  -webkit-appearance: none;
  width: 4.5rem;
  height: 4.5rem;
  max-width: 4.5rem;
  max-height: 4.5rem;
  flex: 0 0 4.5rem;
  align-self: start;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  background: #000;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
}
.sec-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.sec-photo.is-empty {
  display: grid;
  place-items: center;
  cursor: default;
  font-size: .68rem;
  color: var(--muted);
  text-align: center;
  padding: .3rem;
  line-height: 1.25;
}
.sec-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr));
  gap: .65rem 1.15rem;
  min-width: 0;
}
.sec-field { min-width: 0; display: grid; gap: .18rem; text-align: start; }
.sec-field dt {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.sec-field dd {
  margin: 0;
  font-size: .9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.sec-mono {
  display: inline-block;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.sec-status, .sec-cap {
  font-size: .72rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  color: var(--gold);
  white-space: nowrap;
}
.sec-status.is-pending { background: var(--gold); color: var(--on-accent); border-color: var(--gold); }
.sec-status.is-approved, .sec-status.is-not_required { color: #3ddc84; border-color: rgba(61, 220, 132, .4); }
.sec-status.is-denied { color: #ff6b61; border-color: rgba(255, 69, 58, .45); }
.sec-status.is-expired { color: var(--muted); border-color: rgba(154, 144, 128, .4); }
.sec-cap { color: #ffb74d; border-color: rgba(255, 183, 77, .4); }
.sec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.sec-expiry { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin: .8rem 0 .4rem;
  font-size: .85rem;
}
@media (min-width: 1200px) {
  .sec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sec-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .sec-toolbar-head { grid-column: 1 / -1; }
  .sec-bulk { justify-self: end; }
}
@media (min-width: 861px) and (max-width: 1199px) {
  .sec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sec-card,
  .login-security-item.sec-card {
    grid-template-columns: 3.5rem minmax(0, 1fr);
    padding: .85rem .9rem;
    gap: .7rem;
  }
  .sec-photo { width: 3.5rem; height: 3.5rem; max-width: 3.5rem; max-height: 3.5rem; flex-basis: 3.5rem; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec-card-head { flex-direction: column; align-items: stretch; }
  .sec-card-meta { margin-inline-start: 0; justify-content: flex-start; }
  .sec-actions .btn { min-height: 44px; }
}

/* Key/value grid used by device cards, security rows, audit details */
.device-kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .3rem .8rem; }
.device-kv > div { min-width: 0; }
.device-kv dt { font-size: .68rem; color: var(--muted); }
.device-kv dd { margin: 0; font-size: .82rem; overflow-wrap: anywhere; }
.device-kv small { color: var(--muted); }
.device-kv .is-gps dd a { color: #3ddc84; }

/* User details dialog */
.udlg-body { display: grid; gap: .75rem; }
.udlg-section { display: grid; gap: .45rem; }
.udlg-h {
  margin: 0; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-2);
  border-bottom: 1px solid rgba(121, 56, 255, .16); padding-bottom: .3rem;
}
.udlg-summary { display: flex; gap: .8rem; align-items: center; }
.udlg-summary .avatar { width: 52px; height: 52px; flex-shrink: 0; }
.udlg-locs { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.udlg-locs li {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .45rem .6rem; border: 1px solid rgba(121, 56, 255, .14); border-radius: 10px;
}
.udlg-locs li div { display: grid; min-width: 0; }
.udlg-locs li span { font-size: .72rem; color: var(--muted); }
.device-card { display: grid; gap: .35rem; }
.device-card .device-revoke { justify-self: start; }
.device-soft { margin: 0; font-size: .82rem; }
.device-trust { margin: 0; font-size: .75rem; color: var(--muted); }
.device-trust.is-trusted { color: #3ddc84; }
.device-status.is-active { color: #3ddc84; }
.device-status.is-inactive { color: var(--muted); }
.device-status.is-revoked { color: #ff6b61; }
.udlg-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.udlg-actions .sheet-btn { flex: 1 1 auto; }
.udlg-actions .udlg-danger { flex-basis: 100%; margin-top: .35rem; }

/* Audit details */
.audit-log-details { grid-column: 1 / -1; margin-top: .3rem; }
.audit-log-details summary { cursor: pointer; font-size: .78rem; color: var(--gold-2); }
.audit-log-details .device-kv { margin-top: .4rem; }

/* Login approval waiting page */
.approval-card { text-align: center; }
.approval-spinner {
  width: 64px; height: 64px; margin: .5rem auto .75rem;
  display: grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--gold-line); border-top-color: var(--gold);
  animation: approval-spin 1.2s linear infinite;
}
.approval-spinner .nova-ico { width: 26px; height: 26px; color: var(--gold); animation: approval-spin 1.2s linear infinite reverse; }
.approval-spinner.is-done, .approval-spinner.is-failed { animation: none; }
.approval-spinner.is-done .nova-ico, .approval-spinner.is-failed .nova-ico { animation: none; }
.approval-spinner.is-done { border-color: #3ddc84; }
.approval-spinner.is-failed { border-color: #ff453a; }
.approval-status { font-weight: 600; color: var(--gold-2); }
@keyframes approval-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .approval-spinner, .approval-spinner .nova-ico { animation: none; }
  .msg.swipe-snap, .swipe-reply-hint { transition: none; }
  .msg { will-change: auto; }
}

/* Call avatar shows the photo, not just initials */
.call-avatar img.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.call-avatar img.avatar-brand { object-fit: contain; padding: 14%; background: #0b0b0b; }
/* =====================================================================
   2026-09-30 QA pass â€” UI scale, language popup, compact location/live
   cards, location sheet, slim voice, media sizing, header/menu cleanup.
   Appended last so it overrides earlier rules by order.
   ===================================================================== */

/* Interface scale: root font size = preference base Ã— header scale (rem-based UI). */
html { font-size: calc(var(--font-base, 100%) * var(--ui-scale, 1)); }
html[data-font-base="sm"] { --font-base: 87.5%; }
html[data-font-base="md"] { --font-base: 100%; }
html[data-font-base="lg"] { --font-base: 112.5%; }
html[data-ui-scale="85"] { --ui-scale: .85; }
html[data-ui-scale="90"] { --ui-scale: .9; }
html[data-ui-scale="95"] { --ui-scale: .95; }
html[data-ui-scale="100"] { --ui-scale: 1; }
html[data-ui-scale="105"] { --ui-scale: 1.05; }
html[data-ui-scale="110"] { --ui-scale: 1.1; }
html[data-ui-scale="115"] { --ui-scale: 1.15; }
html[data-ui-scale="120"] { --ui-scale: 1.2; }
body { overflow-x: hidden; }
.chat-pane, .messages { min-width: 0; max-width: 100%; }
/* iOS zooms into fields under 16px; keep them readable at any scale. */
@media (hover: none) and (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: max(16px, 1rem); }
}

.ui-scale {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  padding: 2px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
}
.ui-scale-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}
.ui-scale-btn .nova-ico { width: 15px; height: 15px; }
.ui-scale-btn:hover:not(:disabled), .ui-scale-btn:focus-visible { background: var(--gold-soft); outline: none; }
.ui-scale-btn:disabled { opacity: .35; cursor: default; }

/* Header: photo + name + status and compact actions only; never wraps or overflows. */
.chat-header { min-width: 0; }
.chat-header .chat-actions { display: flex; align-items: center; gap: .25rem; min-width: 0; }
.chat-header .nav-toggle, .chat-header .chat-back-btn, .chat-header .lang-switch { display: none !important; }

/* Menu entries that only make sense on phones / very narrow headers. */
.mobile-only, .narrow-only { display: none !important; }
@media (max-width: 430px) {
  .menu-item.narrow-only { display: flex !important; }
}
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  .menu-item.mobile-only { display: flex !important; }
  .menu-group.mobile-only { display: grid !important; }
  .menu-group-title.mobile-only { display: block !important; }
}
@media (max-width: 380px) {
  .ui-scale-btn { width: 24px; height: 24px; }
  .chat-header .chat-actions { gap: .1rem; }
  .chat-header .chat-actions .icon-btn { width: 36px; height: 36px; }
}

/* Language popup */
.lang-dialog { width: min(320px, 92vw); }
.lang-options { gap: .5rem; }
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: 50px;
  padding: .65rem 1rem;
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.lang-option:hover, .lang-option:focus-visible { background: var(--gold-soft); outline: none; }
.lang-option.is-active { border-color: var(--gold); color: var(--gold); }
.lang-option .nova-ico { width: 18px; height: 18px; color: var(--gold); }

/* Compact location + live-location cards (no embedded map in the timeline). */
.msg.is-location { padding: .45rem .55rem .35rem; }
.loc-card {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: min(210px, 64vw);
  max-width: min(290px, 74vw);
  padding: .5rem .6rem;
  border-radius: 14px;
  border: 1px solid var(--gold-line);
  background: rgba(0, 0, 0, .22);
  color: var(--ink);
  text-decoration: none;
  white-space: normal;
}
a.loc-card:hover, a.loc-card:focus-visible { background: rgba(121, 56, 255, .1); outline: none; }
.loc-ico {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(121, 56, 255, .16);
  color: var(--gold);
}
.loc-ico svg { width: 20px; height: 20px; }
.loc-card.is-live:not(.is-ended) .loc-ico { box-shadow: 0 0 0 0 rgba(61, 220, 132, .5); animation: live-pulse 2s infinite; color: #3ddc84; background: rgba(61, 220, 132, .14); }
.loc-card.is-ended { opacity: .72; }
.loc-card.is-ended .loc-ico { color: var(--muted); background: rgba(255, 255, 255, .06); }
.loc-text { display: grid; gap: .1rem; min-width: 0; }
.loc-card .loc-title { font-size: .86rem; font-weight: 700; color: var(--gold-2); }
.loc-card .loc-meta { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-card .loc-open { padding: 0; border: 0; background: none; font-size: .76rem; font-weight: 600; color: var(--gold); }
.loc-stop {
  margin-top: .35rem;
  width: 100%;
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 69, 58, .4);
  background: rgba(255, 69, 58, .12);
  color: #ff8a80;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 220, 132, .45); }
  70% { box-shadow: 0 0 0 8px rgba(61, 220, 132, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 132, 0); }
}
@media (prefers-reduced-motion: reduce) { .loc-card.is-live .loc-ico { animation: none; } }
.loc-map, .live-map { display: none !important; }

/* Location sheet: a modal overlay (never part of the chat layout), bottom sheet on phones. */
.location-dialog { max-height: 100dvh; overflow: visible; }
.location-card {
  display: grid;
  gap: .65rem;
  max-height: min(88dvh, 640px);
  overflow: auto;
  overscroll-behavior: contain;
}
.location-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.location-head h3 { margin: 0; font-size: 1.05rem; color: var(--gold); }
.location-map { height: min(34dvh, 240px); margin: 0; }
.location-map[hidden] { display: none !important; }
.location-status { display: flex; align-items: center; gap: .55rem; min-height: 1.5rem; }
.location-address { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.location-address.is-error { color: #ff8a80; }
.loc-spinner {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(121, 56, 255, .25);
  border-top-color: var(--gold);
  animation: loc-spin .8s linear infinite;
}
.loc-spinner[hidden] { display: none; }
@keyframes loc-spin { to { transform: rotate(360deg); } }
#location-preview-link { justify-self: start; }
#location-preview-link[hidden] { display: none; }
.location-live {
  display: grid;
  gap: .4rem;
  padding: .7rem .8rem;
  border-radius: 14px;
  border: 1px solid var(--gold-line);
  background: rgba(255, 255, 255, .02);
}
.location-dialog.is-live-first .location-live { border-color: var(--gold); }
.location-live-title { display: flex; align-items: center; gap: .45rem; margin: 0; font-weight: 700; }
.location-live-title .nova-ico { width: 18px; height: 18px; color: var(--gold); }
.location-live-sub { margin: 0; font-size: .8rem; color: var(--muted); }
.location-durations { display: flex; flex-wrap: wrap; gap: .4rem; }
.loc-duration {
  min-height: 38px;
  padding: .35rem .85rem;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: rgba(121, 56, 255, .1);
  color: var(--gold);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.loc-duration:disabled { opacity: .4; cursor: default; }
.location-actions { flex-wrap: wrap; }
.location-actions .btn { min-height: 44px; }
.location-actions .btn[hidden] { display: none; }
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  .location-dialog {
    position: fixed;
    inset-inline: 0;
    top: auto;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
  }
  .location-card {
    width: 100%;
    min-height: 0;
    max-height: min(86dvh, 640px);
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .location-map { height: min(30dvh, 220px); }
  .location-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 430px) {
  .location-card { min-height: 0; border-radius: 18px 18px 0 0; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .location-map { display: none !important; }
  .location-card { max-height: 92dvh; }
}

/* Slim voice note bubble: â–¶ â”â”â” 0:12 + time/ticks. */
.msg.is-voice { padding: .35rem .6rem .3rem; }
.msg.is-voice .body.media-body { margin: 0; }
.msg.is-voice .voice-note {
  width: min(250px, 64vw);
  min-width: min(180px, 52vw);
  margin: 0;
  padding: .1rem 0;
  gap: .5rem;
  background: transparent;
}
.msg.is-voice .voice-wave { height: 24px; }
.msg.is-voice .voice-play { width: 32px; height: 32px; }
.msg.is-voice .time { margin-top: .1rem; }

/* Media never becomes one huge container. */
.msg img.preview { display: block; max-width: min(280px, 70vw); max-height: 320px; width: auto; height: auto; object-fit: cover; }
.msg button.image-open {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  max-width: 100%;
}
.msg button.image-open img.preview { pointer-events: none; }
.msg .video-preview { max-width: min(300px, 72vw); max-height: min(340px, 46dvh); }

.image-viewer-dialog {
  width: min(960px, 100vw);
  height: min(100dvh, 920px);
  max-width: 100vw;
  margin: 0;
  padding: 0;
  background: #000;
  border: 0;
  border-radius: 0;
}
.image-viewer-sheet { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.image-viewer-dialog img {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  object-fit: contain;
  background: #000;
  transition: filter .2s ease, opacity .2s ease;
}
.image-viewer-dialog img.is-loading {
  opacity: .7;
  filter: blur(8px);
}
.image-viewer-close {
  position: absolute;
  z-index: 2;
  top: calc(.6rem + env(safe-area-inset-top, 0px));
  inset-inline-end: .6rem;
  background: rgba(0,0,0,.55);
  color: #fff;
}

.call-mini {
  position: fixed;
  z-index: 80;
  inset-inline: 0.75rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: rgba(12, 10, 6, 0.94);
  border: 1px solid var(--gold-line);
  box-shadow: var(--glow);
}
.call-mini[hidden] { display: none !important; }
.call-mini-return {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: start;
  cursor: pointer;
}
.call-mini-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #3dcc7a;
  box-shadow: 0 0 0 4px rgba(61, 204, 122, 0.18);
  flex-shrink: 0;
}
.call-mini-hint { opacity: 0.7; font-size: 0.8rem; }
.call-mini-end { flex-shrink: 0; }

/* Attachment preview sheet: [hidden] must win over display rules (no empty black video box). */
.media-preview-dialog [hidden] { display: none !important; }
.media-preview-dialog .media-preview-stage { max-height: min(46dvh, 420px); }
.media-preview-dialog .media-preview-stage img,
.media-preview-dialog .media-preview-stage video { max-height: min(46dvh, 420px); width: auto; max-width: 100%; }
.media-preview-dialog.is-sending .media-preview-stage { opacity: .6; }
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  .media-preview-dialog { max-height: min(92dvh, 100%); overflow: auto; }
  .media-preview-card { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }
}
@media (orientation: landscape) and (max-height: 500px) {
  .media-preview-dialog .media-preview-stage,
  .media-preview-dialog .media-preview-stage img,
  .media-preview-dialog .media-preview-stage video { max-height: 52dvh; }
}
/* Header budget on phones: the peer photo + name + status always keep room. */
.chat-header .peer { flex: 1 1 0; min-width: 0; }
.chat-header .avatar { flex-shrink: 0; }
.menu-scale { cursor: default; }
.menu-scale > span:first-of-type { flex: 1; }
.menu-scale .ui-scale-btn { width: 34px; height: 34px; }
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  .chat-header { gap: .4rem; }
  .chat-header .peer { min-width: 84px; gap: .55rem; }
  .chat-header .chat-actions { gap: 0; }
  .chat-header .chat-actions .icon-btn { width: 40px; height: 40px; }
}
@media (max-width: 560px) {
  .chat-header .chat-actions #btn-search { display: none; }
}
@media (max-width: 380px) {
  .chat-header .ui-scale { display: none; }
  .chat-header { padding-inline: .45rem; }
  .chat-header .chat-actions .icon-btn { width: 38px; height: 38px; }
}
@media (max-width: 320px) {
  .composer { gap: .2rem; padding-inline: .45rem; }
  .msg { max-width: 94%; padding: .55rem .65rem; }
  .auth-card, .auth-card.amor-card { padding: 1.1rem .85rem 1.2rem; border-radius: 20px; }
}
/* Connection banner: a small overlay pill, never an in-flow row that pushes the chat down. */
.conn-banner {
  position: absolute;
  z-index: 6;
  top: calc(env(safe-area-inset-top, 0px) + 4.9rem);
  inset-inline: 0;
  width: fit-content;
  max-width: calc(100% - 1.5rem);
  margin-inline: auto;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: rgba(40, 32, 12, .92);
  border: 1px solid var(--gold-line);
  color: var(--gold-2);
  font-size: .76rem;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.conn-banner.ok { background: #1f6b45; color: #eafff3; border-color: transparent; }

/* Shared mobile dialog contract: visual viewport height, bottom-safe, no horizontal overflow. */
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  html { overflow-x: hidden; }
  body, .app-shell { overflow-x: hidden; }
  dialog.sheet-dialog,
  dialog.nova-modal,
  dialog.lang-dialog {
    width: min(26rem, calc(100vw - 1.2rem));
    max-width: calc(100vw - 1.2rem);
    max-height: min(var(--app-vvh, 100dvh), 92dvh);
    margin: auto auto 0;
    margin-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sheet-form,
  .sheet-body,
  .nova-modal .nm-inner {
    max-height: min(var(--app-vvh, 100dvh), 88dvh);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .msg-actions-overlay {
    align-items: flex-end;
    padding: 0 .75rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    max-height: var(--app-vvh, 100dvh);
  }
  .msg-actions-sheet { width: min(26rem, 100%); max-width: 100%; }
  .location-dialog,
  .media-preview-dialog,
  .call-dialog,
  .camera-live-dialog {
    max-height: var(--app-vvh, 100dvh);
  }
}

.amor-hub {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.amor-hub-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  box-sizing: border-box;
  padding: 1.05rem 1.25rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: inherit;
  text-align: start;
  text-decoration: none;
  min-height: 76px;
  cursor: pointer;
}
.amor-hub-ico {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gold); color: #111;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px;
}
.amor-hub-copy { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.amor-hub-copy strong { font-size: 1.02rem; }
.amor-hub-copy small { color: var(--muted); font-size: .78rem; }
.amor-chevron { color: var(--gold); flex: 0 0 auto; }
[dir="ltr"] .amor-chevron { transform: scaleX(-1); }
.amor-inbox-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: 1rem 1.25rem .5rem;
}
.amor-inbox-head.is-sub { justify-content: flex-start; }
.amor-inbox-head h1 { font-size: 1.7rem; font-weight: 800; margin: 0; }
.amor-call-row .is-missed { color: #e25b5b; }

.amor-tabs {
  display: none;
}
@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  .nova-nav,
  .nav-toggle { display: none !important; }
  .amor-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 40;
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, .06);
    padding: .35rem .2rem calc(.4rem + env(safe-area-inset-bottom, 0px));
  }
  .amor-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    color: var(--muted);
    text-decoration: none;
    font-size: .72rem;
    min-height: 48px;
    justify-content: center;
  }
  .amor-tab.is-active { color: var(--gold); }
  .amor-tab .nova-ico { width: 22px; height: 22px; }
  .app-shell.user-chat,
  .app-shell.admin-chat,
  .app-shell.user-settings-shell,
  .app-shell.admin-shell,
  .updates-shell,
  .calls-shell {
    padding-bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
  }
  .admin-chat.has-conversation,
  html.kb-open .app-shell {
    padding-bottom: 0;
  }
  .admin-chat.has-conversation .amor-tabs,
  html.kb-open .amor-tabs {
    display: none;
  }
  .settings-scroll,
  .messages,
  .module-scroll,
  .conv-list {
    padding-bottom: .75rem;
  }
  .amor-inbox .sidebar-head h1,
  .amor-inbox-head h1 {
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0;
    color: #f5f0e6;
  }
  .amor-inbox-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1rem .35rem;
  }
  .amor-inbox-head.is-sub {
    justify-content: flex-start;
    padding-top: calc(.55rem + env(safe-area-inset-top, 0px));
  }
  .amor-inbox .search-row input,
  .amor-inbox #side-search,
  .module-toolbar #conv-search {
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: #161616;
    color: #f5f0e6;
    padding: .7rem 1rem;
  }
  .amor-pills,
  .amor-inbox .filter-pills,
  .calls-filters {
    display: flex;
    justify-content: flex-end;
    gap: .45rem;
    padding: .45rem 1rem .2rem;
  }
  .amor-pills .pill,
  .amor-inbox .filter-pills .pill,
  .calls-filters .pill {
    border-radius: 999px;
    min-height: 34px;
    padding: .25rem .9rem;
    background: #141414;
    color: #d8d0c2;
    border: 0;
  }
  .amor-pills .pill.active,
  .amor-inbox .filter-pills .pill.active,
  .calls-filters .pill.active {
    background: var(--gold);
    color: #111;
  }
  .amor-list li,
  .amor-inbox .conv-list li,
  .calls-shell .conv-list li {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .amor-list .avatar,
  .amor-inbox .avatar,
  .calls-shell .avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--gold);
    color: #111;
    flex: 0 0 46px;
  }
  .amor-list .badge,
  .amor-inbox .badge {
    min-width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--gold);
    color: #111;
    font-size: .72rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .amor-call-row .is-missed { color: #e25b5b; }
  .amor-hub {
    display: flex;
    flex-direction: column;
  }
  .amor-hub-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    color: inherit;
    text-align: start;
    text-decoration: none;
    min-height: 72px;
  }
  .amor-hub-ico {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gold);
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
  }
  .amor-hub-ico .nova-ico { width: 20px; height: 20px; }
  .amor-hub-copy {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
    min-width: 0;
  }
  .amor-hub-copy strong { font-size: 1.02rem; }
  .amor-hub-copy small { color: var(--muted); font-size: .78rem; }
  .amor-chevron {
    color: var(--gold);
    flex: 0 0 auto;
  }
  [dir="ltr"] .amor-chevron { transform: scaleX(-1); }
}

.status-card {
  margin: .75rem 1rem;
  padding: .9rem;
  border: 1px solid var(--gold-line);
  border-radius: 14px;
  background: #121212;
}
.status-card-head {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .4rem;
}
.status-photo { display: block; width: 100%; border-radius: 10px; margin-top: .5rem; }
.control-health { margin-bottom: 1rem; }
.calls-filters { padding: 0 1rem 0.5rem; }

/* Phone chrome: black / gold lists matching the approved mockups */
.amor-hub-row,
.amor-tab,
.pill,
.icon-btn,
.btn,
.call-redial,
.sheet-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.amor-search input,
.amor-inbox input,
.amor-settings input,
.amor-settings select,
.calls-shell input,
.module-panel input,
.module-panel select,
.module-panel textarea {
  font-size: 16px;
}
.amor-settings-page:not([hidden]) { display: block; }
.control-scroll .manage-actions {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  margin: .75rem 0 1.25rem;
}
.control-scroll .sheet-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  background: #161616;
  color: #f5f0e6;
  border: 1px solid rgba(255,255,255,.08);
}
.admin-shell.is-workspace .sidebar-head {
  display: flex;
  max-width: 960px;
  margin-inline: auto;
  width: 100%;
}
.admin-shell.is-workspace .module-panel.active {
  max-width: 960px;
  width: 100%;
  margin-inline: auto;
  padding-inline: 1rem;
}
.amor-search { padding: .65rem 1rem .2rem; }
.amor-search::before { display: none !important; }
.amor-search input,
.amor-inbox .search-row input,
.amor-inbox #side-search {
  width: 100%;
  border: 0 !important;
  border-radius: 999px !important;
  background: #161616 !important;
  color: #f5f0e6 !important;
  padding: .78rem 1.1rem !important;
  box-shadow: none !important;
}
.amor-pills,
.amor-inbox .filter-pills,
.calls-filters {
  display: flex;
  justify-content: flex-end;
  gap: .45rem;
  padding: .4rem 1rem .15rem;
  flex-wrap: nowrap;
}
.amor-pills .pill,
.amor-inbox .filter-pills .pill,
.calls-filters .pill {
  border-radius: 999px !important;
  min-height: 34px;
  padding: .28rem 1rem !important;
  background: #1a1a1a !important;
  color: #d8d0c2 !important;
  border: 0 !important;
}
.amor-pills .pill.active,
.amor-inbox .filter-pills .pill.active,
.calls-filters .pill.active {
  background: var(--gold) !important;
  color: #111 !important;
}
.amor-inbox .conv-list li,
.calls-shell .conv-list li,
.amor-list li {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1rem !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  border-radius: 0 !important;
}
.amor-inbox .conv-list li.conv-empty,
.calls-shell .conv-list li.conv-empty,
.amor-list li.conv-empty {
  justify-content: center;
  border-bottom: 0 !important;
}
.amor-inbox-copy,
.amor-call-copy {
  flex: 1;
  min-width: 0;
}
.amor-inbox .avatar,
.calls-shell .avatar,
.amor-list .avatar {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px;
  border-radius: 50% !important;
  background: var(--gold) !important;
  color: #111 !important;
  border: 0 !important;
  box-shadow: none !important;
}
.amor-inbox .avatar img,
.calls-shell .avatar img,
.amor-list .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.amor-inbox .avatar.online,
.calls-shell .avatar.online {
  border: 0 !important;
  box-shadow: none !important;
}
.amor-inbox .avatar.online::after { display: none; }
.amor-inbox .badge,
.amor-list .badge {
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--gold) !important;
  color: #111 !important;
  font-size: .72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.amor-call-dir {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--gold);
}
.amor-call-dir.is-missed,
.amor-call-row .is-missed { color: #e25b5b !important; }
.amor-call-dir .nova-ico { width: 14px; height: 14px; }
.calls-shell .call-redial {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--gold);
  flex: 0 0 40px;
}
.amor-hub-row { background: #050505; }
.amor-hub-letter {
  font-weight: 800;
  font-size: 1.05rem;
  color: #111;
  line-height: 1;
}
.amor-settings,
.calls-shell .settings-main,
.amor-inbox,
.amor-hub,
.settings-scroll {
  background: #050505;
  width: 100%;
}
.amor-inbox-desk,
.amor-inbox .brand-name,
.admin-shell:not(.is-workspace) .sidebar-head,
#chat-filters [data-filter="inactive"],
#admin-filters [data-filter="inactive"],
.amor-desk-only,
.nova-nav {
  display: none !important;
}

.amor-tabs {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  width: var(--amor-frame);
  max-width: 100%;
  margin-inline: auto;
  background: #050505;
  border-top: 1px solid rgba(255, 255, 255, .06);
  padding: .35rem .2rem calc(.4rem + env(safe-area-inset-bottom, 0px));
}
.amor-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  color: #8a8274;
  text-decoration: none;
  font-size: .78rem;
  min-height: 56px;
  justify-content: center;
}
.amor-tab.is-active { color: var(--gold); }
.amor-tab .nova-ico { width: 22px; height: 22px; }

.app-shell.admin-shell,
.app-shell.admin-chat,
.app-shell.user-settings-shell,
.app-shell.calls-shell {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  padding-bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
}
.app-shell.user-chat {
  padding-bottom: calc(3.6rem + env(safe-area-inset-bottom, 0px));
}

.admin-shell:not(.is-workspace) .module-stage-host,
.admin-chat:not(.has-conversation) .chat-pane {
  display: none !important;
}

.admin-shell:not(.is-workspace) .sidebar,
.admin-chat .sidebar#admin-side {
  border: 0;
  background: #050505;
}
.admin-shell:not(.is-workspace) .sidebar.module-rail,
.admin-chat:not(.has-conversation) .sidebar#admin-side,
.user-chat:not(.has-conversation) .sidebar#admin-side,
.calls-shell .settings-main,
.user-settings-shell .settings-main {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  width: var(--amor-frame);
  max-width: 100%;
  margin-inline: auto;
  position: relative !important;
  transform: none !important;
  inset: auto !important;
  min-height: 0;
  box-shadow: none;
}

.admin-chat.has-conversation .sidebar#admin-side,
.admin-chat.has-conversation .amor-tabs,
#chat-app.has-conversation ~ .amor-tabs,
html.kb-open .amor-tabs {
  display: none !important;
}

.app-shell.admin-chat.has-conversation,
.app-shell.user-chat {
  display: flex !important;
  flex-direction: column;
  height: var(--app-vvh, 100dvh);
  max-height: var(--app-vvh, 100dvh);
  min-height: 0;
}
.app-shell.admin-chat.has-conversation { padding-bottom: 0; }
.app-shell.admin-chat.has-conversation .chat-pane,
.app-shell.user-chat.has-conversation .chat-pane {
  display: flex !important;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: none;
}
.app-shell.admin-chat.has-conversation .messages,
.app-shell.user-chat.has-conversation .messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.app-shell.admin-chat.has-conversation .composer,
.app-shell.user-chat.has-conversation .composer {
  flex-shrink: 0;
  margin-top: auto;
}
.app-shell.admin-chat.has-conversation .chat-back-btn {
  display: inline-flex !important;
  flex-shrink: 0;
}

@media (max-width: 860px), ((max-width: 1366px) and (hover: none) and (pointer: coarse)) {
  .admin-shell:not(.is-workspace) .sidebar.module-rail,
  .admin-chat:not(.has-conversation) .sidebar#admin-side,
  .calls-shell .settings-main,
  .user-settings-shell .settings-main {
    max-width: 100%;
  }
  .app-shell.admin-shell.is-workspace .amor-inbox .conv-list,
  .app-shell.admin-shell.is-workspace .conv-list {
    display: block;
    gap: 0;
    padding: 0 0 4.5rem;
  }
  .app-shell.admin-shell.is-workspace .amor-inbox .conv-list li,
  .app-shell.admin-shell.is-workspace .conv-list li {
    border: 0 !important;
    border-bottom: 1px solid rgba(255,255,255,.06) !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: .9rem 1rem !important;
  }
  .amor-inbox .conv-list li:hover,
  .calls-shell .conv-list li:hover,
  .amor-list li:hover {
    background: transparent !important;
  }
}
