:root {
  --bg: #000;
  --panel: #09080f;
  --tile: #0b0a16;
  --line: rgba(139, 92, 246, .35);
  --line-soft: rgba(139, 92, 246, .25);
  --text: #ede9fe;
  --muted: #b9b4dc;
  --dim: #a7a2cf;
  --accent: linear-gradient(135deg, #8b5cf6, #6d28d9);
  --title: linear-gradient(90deg, #c084fc, #818cf8, #38bdf8);
  --danger: #dc2626;
  --focus: #c4b5fd;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  color: var(--text);
  background: var(--bg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.sprite { position: absolute; width: 0; height: 0; }
h1, h2, p { margin: 0; }
button, a.primary, input, select { font: inherit; }
button, a.primary {
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: var(--tile);
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
button:hover:not(:disabled), a.primary:hover { filter: brightness(1.14); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button.primary, a.primary { background: var(--accent); font-size: 17px; }
.ghost { border: 1px solid rgba(167, 139, 250, .55); background: var(--panel); color: #e9d5ff; }
.small { min-height: 40px; padding: 7px 14px; border-radius: 12px; font-size: 14px; }
.danger-btn { background: var(--danger); }

label { display: block; margin-bottom: 5px; color: var(--dim); font-size: 13px; }
input, select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #fff;
  background: #000;
  font-size: 16px;
}
input::placeholder { color: #7d78a8; }

.panel {
  padding: 22px;
  border: 1px solid rgba(139, 92, 246, .4);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 20px 60px -24px #7c3aed;
  display: grid;
  gap: 14px;
  align-content: start;
}
.panel h2 { font-size: 22px; line-height: 1.25; }
.hint { color: #8f8ab8; font-size: 14px; }
.err {
  padding: 10px 12px;
  border: 1px solid rgba(239, 68, 68, .4);
  border-radius: 12px;
  background: rgba(239, 68, 68, .12);
  color: #fca5a5;
  font-size: 14px;
}

.split {
  min-height: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 16px 48px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
}
.logo-holder { width: max-content; }
.logo-mid { justify-self: center; }
.pitch h1 { margin: 18px 0 12px; font-size: clamp(28px, 5vw, 44px); line-height: 1.1; }
.pitch h1 span {
  background: var(--title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { margin-bottom: 18px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts li { padding: 11px 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--tile); font-size: 15px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 14px; background: #000; }
.tabs button { min-height: 42px; padding: 8px; border-radius: 10px; background: transparent; color: var(--dim); font-size: 14px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }

.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; }
.brand b {
  background: var(--title);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.me { display: flex; align-items: center; gap: 12px; color: var(--muted); min-width: 0; }
#me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: start; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.results:empty { display: none; }
.results li {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--tile);
  display: flex;
  align-items: center;
  gap: 12px;
}
.who { flex: 1; min-width: 0; }
.who b, .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who small { color: var(--dim); }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #4b4768; }
.dot.on { background: #22c55e; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: max-content;
  max-width: 92vw;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.overlay { position: fixed; inset: 0; z-index: 50; padding: 16px; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; }
.ring-card { width: min(100%, 400px); text-align: center; }
.ring-card small { color: var(--dim); }
.ring-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }

.center { min-height: 100%; padding: 24px 16px; display: flex; align-items: center; justify-content: center; }
.narrow { width: min(100%, 440px); }
.middle { text-align: center; }

#call { position: fixed; inset: 0; background: #000; overflow: hidden; }
#grid {
  position: absolute;
  inset: 8px 8px 84px;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
}
#grid.spotlight { grid-template-columns: minmax(0, 4fr) minmax(0, 1fr); grid-auto-rows: minmax(0, 1fr); }
#grid.spotlight .tile.screen { grid-column: 1; grid-row: 1 / span 8; }
#grid.spotlight .tile:not(.screen) { grid-column: 2; }
.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 2px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
}
.tile.speaking { border-color: #a78bfa; box-shadow: 0 0 18px -4px #8b5cf6; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tile.screen video { object-fit: contain; }
.tile.mine:not(.screen) video { transform: scaleX(-1); }
.tile .initial {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(48px, 12vmin, 96px);
  height: clamp(48px, 12vmin, 96px);
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: clamp(20px, 5vmin, 40px);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile .label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(9, 8, 15, .78);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile.muted .label::after { content: " 🔇"; }
#status {
  position: absolute;
  left: 16px;
  top: 16px;
  max-width: calc(100% - 190px);
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(9, 8, 15, .85);
}
#status:empty { display: none; }
#enable-audio { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); }
.ghost-link { color: #c4b5fd; }
#lang-call {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  width: auto;
  min-height: 44px;
  padding: 8px 10px;
  background: rgba(9, 8, 15, .92);
  font-size: 14px;
}
.round.wide {
  flex: 0 1 auto;
  width: auto;
  padding: 0 16px;
  border-radius: 28px;
  gap: 8px;
  font-size: 15px;
}
.round.wide[aria-pressed="false"] { border-color: #a78bfa; box-shadow: 0 0 14px -2px rgba(139, 92, 246, .8); }
/* Here the pressed look means "on" with no slash; muted voice shows the slash instead. */
#voice[aria-pressed="false"] .slash { display: inline; }
#voice[aria-pressed="true"] .slash { display: none; }
#subs-hint {
  position: absolute;
  left: 50%;
  bottom: 84px;
  z-index: 3;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 8, 15, .95);
}
#topbar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}
#topbar .brand { color: var(--text); text-decoration: none; }
.tabs-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--tile); }
.tabs-nav a { padding: 9px 14px; border-radius: 10px; color: var(--dim); font-size: 14px; font-weight: 700; text-decoration: none; }
.tabs-nav a:hover { color: #fff; }
.tabs-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.page { max-width: 1040px; margin: 0 auto; padding: 8px 16px 48px; }
.page-card { max-width: 640px; margin: 0 auto 20px; }
.stack { display: grid; gap: 12px; }
.profile-photo { display: flex; align-items: center; gap: 18px; }
#profile-avatar { border-radius: 50%; object-fit: cover; }
.avatar-initial { width: 96px; height: 96px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; font-size: 40px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.avatar-small { border-radius: 50%; object-fit: cover; }
label.ghost-btn { margin: 0; cursor: pointer; font-size: 15px; color: #e9d5ff; }
.results li .small-avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.ghost-btn {
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid rgba(167, 139, 250, .55);
  border-radius: 14px;
  background: var(--panel);
  color: #e9d5ff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.auth-links { display: grid; gap: 8px; text-align: center; font-size: 14px; }
.auth-links a, .logo-link { color: #c4b5fd; }
.logo-link { justify-self: center; }
select.ui-lang:not(.pitch select):not(.page select) { margin: 0; }
.code-value { padding: 12px; border: 1px dashed #a78bfa; border-radius: 12px; font: 700 19px/1.3 ui-monospace, Consolas, monospace; letter-spacing: 1px; overflow-wrap: anywhere; user-select: all; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 15px; text-align: left; }
.check input { width: 20px; min-height: 20px; height: 20px; }
select.ui-lang { display: block; width: auto; min-height: 40px; padding: 6px 10px; margin-bottom: 14px; font-size: 14px; }
.me select.ui-lang { margin: 0; }
.credit { margin-top: 24px; color: #7d78a8; font-size: 12px; line-height: 1.6; text-align: center; }
.credit-wide { grid-column: 1 / -1; }
.center { flex-direction: column; }
#remote-bar select { width: auto; min-height: 40px; padding: 6px 8px; font-size: 14px; }
.remote-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 10px; align-items: end; }
#remote { position: fixed; inset: 0; background: #000; }
#remote:not([hidden]) { display: flex; flex-direction: column; }
#remote-view { position: relative; flex: 1 1 auto; min-height: 0; order: 2; overflow: hidden; background: #000; }
#remote-view.zoomed { overflow: auto; }
#remote-screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; outline: none; touch-action: none; cursor: crosshair; }
#remote-view.zoomed #remote-screen { position: static; display: block; margin: auto; object-fit: fill; touch-action: pan-x pan-y; }
#remote-bar {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(9, 8, 15, .88);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
@media (max-width: 620px) { .remote-row { grid-template-columns: 1fr; } }
.control-btn { position: absolute; right: 8px; top: 8px; z-index: 2; }
.tile.controlling { border-color: #38bdf8; }
.tile.controlling video { cursor: crosshair; touch-action: none; }
#control-bar {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 5;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 6px 8px 6px 14px;
  border: 1px solid rgba(239, 68, 68, .6);
  border-radius: 12px;
  background: rgba(9, 8, 15, .92);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
#agent-form {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  transform: translate(-50%, -50%);
  width: min(92vw, 460px);
  max-height: calc(100% - 24px);
  overflow: auto;
}
#people {
  position: absolute;
  right: 12px;
  bottom: 84px;
  width: min(calc(100vw - 24px), 400px);
  max-height: calc(100% - 100px);
  overflow: auto;
}
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-row input { flex: 1 1 200px; width: auto; min-width: 0; }
.link-row button { font-size: 15px; }
#controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 0 8px;
}
.round {
  flex: 0 1 56px;
  width: 56px;
  height: 56px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(11, 10, 22, .92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.round svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.round .slash { display: none; stroke-width: 2.4; }
.round[aria-pressed="true"] .slash { display: inline; }
#mic[aria-pressed="true"], #cam[aria-pressed="true"] { border-color: var(--danger); background: var(--danger); }
#share[aria-pressed="true"], #subs[aria-pressed="true"], #add[aria-pressed="true"] { border-color: transparent; background: var(--accent); }
.danger { border-color: var(--danger); background: var(--danger); }
.danger svg { fill: currentColor; stroke: none; }
#subtitles {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  width: min(92vw, 760px);
  display: grid;
  gap: 6px;
  pointer-events: none;
}
#subtitles:empty { display: none; }
.subtitle {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 8, 15, .92);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.sub-badge {
  flex: none;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--accent);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.sub-text { font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.sub-text.pending { color: var(--dim); }
.sub-speaker { color: #c4b5fd; font-weight: 700; }
.sub-original { margin-top: 4px; color: var(--dim); font-size: 14px; overflow-wrap: anywhere; }
#own-speech {
  position: absolute;
  right: 16px;
  bottom: 88px;
  max-width: min(40vw, 320px);
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(9, 8, 15, .78);
  color: var(--dim);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#subtitles:not(:empty) ~ #own-speech { bottom: 200px; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; padding-top: 20px; }
  .home-grid { grid-template-columns: 1fr; }
  .logo-big { width: 100px; height: 88px; }
}
@media (max-width: 480px) {
  #subtitles:not(:empty) ~ #own-speech { display: none; }
  #subs-word { display: none; }
  .round.wide { padding: 0; width: 50px; flex-basis: 50px; border-radius: 50%; }
  #controls { gap: 6px; }
  .round { width: 50px; height: 50px; flex-basis: 50px; }
}

/* Support centre and staff panel */
:root { color-scheme: dark; }
.wide-page { max-width: 1240px; }
.tabs-nav { flex-wrap: nowrap; min-width: 0; }
.tabs-nav a { white-space: nowrap; }
@media (max-width: 1000px) { .tabs-nav { flex-wrap: wrap; } }
textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: #fff; background: #000;
  font: inherit; resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.nav-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: #e66767; color: #000; font-size: 12px; line-height: 18px; text-align: center; }
.guest-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 0; }
.guest-bar select { width: auto; }
.support-hero { padding: 26px 0 18px; display: grid; gap: 8px; }
.support-hero h1, .admin-head h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent; }
.support-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.support-card { display: grid; gap: 4px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); text-decoration: none; }
.support-card:hover { border-color: #a78bfa; }
.support-card.on { border-color: #a78bfa; box-shadow: 0 0 0 1px #a78bfa, 0 14px 40px -22px #7c3aed; }
.support-card b { font-size: 17px; }
.support-card small { color: var(--muted); font-size: 14px; }
.phone { white-space: nowrap; font-weight: 700; color: var(--text); }
.faq-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.faq-list { display: grid; gap: 8px; }
.faq-item { border: 1px solid var(--line-soft); border-radius: 12px; background: #000; }
.faq-item summary { padding: 12px 14px; font-weight: 700; cursor: pointer; }
.faq-item p { padding: 0 14px 14px; color: var(--muted); }
#assistant { position: sticky; top: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; min-height: 180px; max-height: 420px; overflow-y: auto; padding: 4px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; background: #15122a; }
.bubble small { display: block; margin-bottom: 2px; color: var(--dim); font-size: 12px; }
.bubble p { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-end; background: #2c1f63; }
.bubble-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.chat-form { display: flex; gap: 8px; align-items: stretch; }
.chat-form input { flex: 1; min-width: 0; }
.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.ticket-side { display: grid; gap: 20px; min-width: 0; }
.ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ticket-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--line-soft); border-radius: 12px; background: #000; }
.ticket-row.unread { border-color: #a78bfa; }
.ticket-open { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 8px 10px; background: transparent; font-weight: 400; text-align: left; }
.ticket-open b { overflow-wrap: anywhere; }
.ticket-open small { color: var(--dim); font-size: 12px; }
.ticket-open small:empty { display: none; }
.pill { flex: none; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.thread { position: sticky; top: 12px; }
.thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.thread-head h2 { overflow-wrap: anywhere; }
.contact-card { margin-bottom: 20px; }
.contact-phone { font-size: clamp(24px, 4vw, 34px); font-weight: 800; color: #fff; text-decoration: none; }
.auth-links a.help-link, .landing-help { color: var(--muted); }
.landing-help { display: inline-block; margin-top: 4px; font-size: 14px; }

.admin-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px 0 14px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); }
.admin-tabs button { min-height: 40px; padding: 8px 14px; border-radius: 10px; background: transparent; color: var(--dim); font-size: 14px; }
.admin-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.small-kpis { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 16px; background: linear-gradient(160deg, #120e24, var(--panel)); }
.kpi small { color: var(--dim); font-size: 13px; }
.kpi b { font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.small-kpis .kpi b { font-size: 20px; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; margin-bottom: 18px; }
.chart-card { min-width: 0; padding: 16px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel); }
.chart-card h3 { margin: 0 0 2px; font-size: 16px; }
.plot-holder { position: relative; margin-top: 8px; touch-action: pan-y; }
.plot { display: block; width: 100%; height: auto; }
.plot .grid { stroke: rgba(185, 180, 220, .14); stroke-width: 1; }
.plot .axis { stroke: rgba(185, 180, 220, .4); stroke-width: 1; }
.plot .tick { fill: var(--dim); font-size: 12px; }
.plot .cross { stroke: rgba(237, 233, 254, .5); stroke-width: 1; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); display: grid; gap: 2px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #000; font-size: 12.5px; white-space: nowrap; pointer-events: none; z-index: 2; }
.swatch { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.chart-table { margin-top: 8px; color: var(--dim); font-size: 13px; }
.chart-table summary { cursor: pointer; }
.table-wrap { overflow-x: auto; }
.chart-table .table-wrap { max-height: 220px; margin-top: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
th { color: var(--dim); font-size: 12.5px; font-weight: 600; }
.panel-table { border: 1px solid var(--line-soft); border-radius: 16px; background: var(--panel); }
.row-blocked { opacity: .62; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell img, .mini-initial { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.mini-initial { display: grid; place-items: center; background: #2c1f63; font-weight: 800; }
.user-cell div { display: grid; }
.user-cell small { color: var(--dim); }
.cell-select { min-height: 36px; padding: 5px 8px; width: auto; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar input { flex: 1 1 260px; width: auto; }
.toolbar select { width: auto; }
.toolbar label { margin: 0; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px 0; color: var(--muted); }
.row-bars { display: grid; gap: 10px; margin-top: 10px; }
.row-bar { display: grid; grid-template-columns: minmax(70px, 150px) 1fr 44px; align-items: center; gap: 10px; font-size: 14px; }
.row-bar span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.row-track { height: 10px; border-radius: 5px; background: rgba(185, 180, 220, .1); }
.row-track i { display: block; height: 100%; min-width: 2px; border-radius: 5px; }
.server-top { display: grid; grid-template-columns: 260px 1fr; gap: 14px; margin-bottom: 14px; }
.holo-box { display: grid; place-items: center; min-height: 240px; border: 1px solid var(--line-soft); border-radius: 18px; background: radial-gradient(circle at 50% 80%, rgba(124, 58, 237, .28), transparent 62%), var(--panel); overflow: hidden; }
.holo { position: relative; width: 190px; height: 190px; perspective: 520px; }
.holo-ring { position: absolute; inset: 0; border: 2px solid rgba(144, 133, 233, .7); border-radius: 50%; box-shadow: 0 0 18px rgba(124, 58, 237, .55), inset 0 0 18px rgba(56, 189, 248, .2); transform-style: preserve-3d; animation: holo-spin 9s linear infinite; }
.holo-ring.r2 { inset: 18px; border-color: rgba(56, 189, 248, .6); animation-duration: 13s; animation-direction: reverse; }
.holo-ring.r3 { inset: 36px; border-style: dashed; animation-duration: 6s; }
.holo-core { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.holo-core span { font-size: 34px; font-weight: 800; color: #fff; text-shadow: 0 0 14px #8b5cf6; font-variant-numeric: tabular-nums; }
.holo-core small { color: var(--muted); font-size: 12px; }
.holo-beam { position: absolute; left: 10%; right: 10%; height: 2px; top: 0; background: linear-gradient(90deg, transparent, #38bdf8, transparent); opacity: .7; animation: holo-scan 4s ease-in-out infinite alternate; }
.holo[data-level="high"] .holo-ring { border-color: #e66767; }
@keyframes holo-spin { from { transform: rotateX(68deg) rotateZ(0); } to { transform: rotateX(68deg) rotateZ(360deg); } }
@keyframes holo-scan { from { top: 8%; } to { top: 92%; } }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.gauge-box { display: grid; justify-items: center; align-content: center; gap: 3px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 18px; background: var(--panel); text-align: center; }
.gauge { width: 120px; height: 120px; }
.gauge-track { fill: none; stroke: rgba(185, 180, 220, .12); stroke-width: 9; }
.gauge-number { fill: var(--text); font-size: 24px; font-weight: 800; }
.gauge-box small { color: var(--dim); font-size: 12.5px; }
.ecg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; margin-bottom: 14px; }
.ecg-card { background: #05040b; }
.ecg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ecg-head b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ecg { display: block; width: 100%; height: 150px; margin-top: 6px; }
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.service { display: grid; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.service small { color: var(--dim); font-size: 12.5px; }
.service.bad { border-color: #e66767; }
.next-step { display: grid; gap: 4px; padding: 22px; margin-bottom: 12px; border: 1px solid #a78bfa; border-radius: 20px; background: linear-gradient(135deg, #1f1547, #0b0a16); box-shadow: 0 18px 50px -26px #7c3aed; }
.next-step small { color: #c4b5fd; font-weight: 700; }
.next-step h3 { margin: 0; font-size: 24px; }
.analyst-note { margin-bottom: 10px; }
.advice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.advice { display: grid; gap: 6px; align-content: start; padding: 16px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--panel); }
.advice h3 { margin: 0; font-size: 16px; }
.advice-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.advice-head small { color: var(--dim); }
.advice.critical { border-color: #e66767; }
.advice.warning { border-color: #c98500; }
.audit-card .table-wrap { max-height: 320px; }
@media (max-width: 900px) {
  .support-cards, .faq-grid, .ticket-grid, .server-top { grid-template-columns: 1fr; }
  .chart-grid, .ecg-grid { grid-template-columns: minmax(0, 1fr); }
  #assistant, .thread { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .holo-ring { animation: none; transform: rotateX(68deg); }
  .holo-beam { animation: none; top: 50%; }
}

/* Profile photo, same pattern as Yaqinda */
.avatar-edit { display: grid; justify-items: center; gap: 8px; text-align: center; }
.avatar-circle { position: relative; display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; background: var(--accent); cursor: pointer; box-shadow: 0 14px 30px -16px #8b5cf6; }
.avatar-circle img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-circle .avatar-initial { width: 100%; height: 100%; background: transparent; }
.avatar-circle::after { content: ""; position: absolute; right: 0; bottom: 2px; width: 30px; height: 30px; border: 3px solid var(--panel); border-radius: 50%; background: #7c3aed url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' d='M4 20h4L19 9l-4-4L4 16zM13.5 6.5l4 4'/%3E%3C/svg%3E") no-repeat center / 14px; }
.avatar-pick { margin: 0; }
.avatar-link { margin: 0; color: #c4b5fd; font-size: 15px; font-weight: 700; cursor: pointer; }
.crop-dialog { width: 100%; max-width: 480px; max-height: 100dvh; margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: #0b0a16; color: var(--text); overflow: hidden; }
.crop-dialog::backdrop { background: rgba(0, 0, 0, .8); }
.crop-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.crop-top b { flex: 1; font-size: 16px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; touch-action: none; cursor: grab; background: #000; user-select: none; -webkit-user-select: none; }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55); outline: 2px solid rgba(255, 255, 255, .85); outline-offset: -2px; pointer-events: none; }
.crop-bar { display: grid; gap: 10px; padding: 14px 16px 18px; }
.crop-bar input { min-height: 0; padding: 0; border: 0; accent-color: #8b5cf6; }

.warn-pill { border-color: #c98500; color: #ffd27a; text-decoration: none; }
.tile-remove { position: absolute; top: 8px; right: 8px; z-index: 3; min-height: 32px; padding: 4px 10px; border-radius: 10px; background: rgba(220, 38, 38, .9); font-size: 13px; }

/* Home additions, phone card, files during remote control */
.push-card { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 18px; border: 1px solid #a78bfa; border-radius: 18px; background: linear-gradient(135deg, #1f1547, #0b0a16); }
.push-card > div { flex: 1 1 260px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.star { flex: none; min-height: 40px; width: 40px; padding: 0; border-radius: 12px; background: transparent; color: var(--dim); font-size: 20px; line-height: 1; }
.star.on { color: #ffd27a; }
.history li { flex-wrap: wrap; }
.history li.missed b { color: #fca5a5; }
.call-meta { flex: 1 1 100%; order: 3; color: var(--dim); font-size: 12.5px; }
.file-status { color: var(--muted); font-size: 13px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.incoming-file { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; max-width: 92vw; padding: 12px 16px; border: 1px solid #a78bfa; border-radius: 14px; background: #0b0a16; box-shadow: 0 14px 40px -14px #7c3aed; }
@media (max-width: 800px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }

.device-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.device-list:empty { display: none; }
.device { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 14px 16px; border: 1px solid #a78bfa; border-radius: 16px; background: #000; }
.device-name { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.device-codes { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.device-codes small { display: block; color: var(--dim); font-size: 12px; }
.device-codes b { font-size: 24px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.device-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.device-state { color: #ffd27a; font-size: 13px; }

.local-codes { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 30px; padding: 16px 18px; border: 1px solid #a78bfa; border-radius: 16px; background: #000; }
.local-codes small { display: block; color: var(--dim); font-size: 13px; }
.local-codes b { font-size: 30px; letter-spacing: .5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.local-codes button { margin-left: auto; }
.local-more summary { cursor: pointer; color: #c4b5fd; font-weight: 700; }
.local-more p { margin: 8px 0 10px; }

/* The bar sits above the picture, not on it. In full screen it slides away and returns at the top edge. */
#remote #remote-bar { position: relative; left: auto; top: auto; order: 1; flex: none; transform: none; width: 100%; max-width: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: #09080f; justify-content: center; z-index: 3; }
#remote:fullscreen #remote-bar { position: absolute; top: 0; left: 0; right: 0; transition: transform .2s; }
#remote:fullscreen.bar-away #remote-bar { transform: translateY(-100%); }
.zoom-group { display: inline-flex; align-items: center; gap: 4px; }
.zoom-group .small { min-width: 40px; padding-left: 10px; padding-right: 10px; }
.zoom-label { min-width: 62px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

#rec[aria-pressed="true"], #remote-rec[aria-pressed="true"] { background: #dc2626; color: #fff; border-color: #dc2626; }
#rec-notice { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5; max-width: 90vw; padding: 7px 14px; border-radius: 999px; background: rgba(220, 38, 38, .92); color: #fff; font-size: 14px; font-weight: 700; }

#remote-more { display: none; }
@media (max-width: 800px) {
  #remote-more { display: inline-block; }
  #remote-title { display: none; }
  #remote:not(.more-open) #remote-keys, #remote:not(.more-open) #remote-paste, #remote:not(.more-open) #remote-file,
  #remote:not(.more-open) #remote-rec, #remote:not(.more-open) .zoom-group, #remote:not(.more-open) #remote-monitor { display: none; }
}
.user-cell { min-width: 170px; }
.user-cell div { min-width: 120px; }
.user-cell b, .user-cell small { overflow: visible; text-overflow: clip; white-space: nowrap; }
.landing-help { padding: 9px 2px; }
.warn-pill { padding: 8px 12px; }
.card-call-fix { display: inline; }

/* Computers: nothing changes. These parts exist only for the phone menu. */
#mobilebar, #side-overlay, .only-phone, .drawer-brand, .tabs-nav .side-ico, .settings-tabs { display: none; }
@media (min-width: 961px) {
  body:not(.signed-in) #topbar { display: none; }
}

/* Phones, as in the Alhikma CRM: menu button at the edge, turning logo, the name filling the bar up to the screen edge.
   Everything else opens from the menu, one section at a time. */
@media (max-width: 960px) {
  :root { --mobile-bar: 68px; }
  body.with-shell { padding-top: var(--mobile-bar); }
  body.with-shell #mobilebar {
    display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; top: 0; z-index: 25; height: var(--mobile-bar);
    padding: 0 0 0 6px; background: rgba(7, 6, 15, .97); border-bottom: 1px solid var(--line-soft);
  }
  .brand-row { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; color: var(--text); text-decoration: none; }
  .brand-logo { flex: none; display: inline-flex; }
  .brand-logo img { display: block; }
  .wordmark { flex: 1 1 auto; min-width: 0; height: 54px; display: block; margin-right: 6px; }
  #menu-btn { flex: none; display: grid; place-items: center; width: 46px; min-height: 46px; padding: 0; border-radius: 12px; background: transparent; color: #fff; }
  .side-ico { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .tabs-nav .side-ico { display: block; }

  body.with-shell #topbar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; width: min(84vw, 310px); max-width: none; margin: 0; padding: 12px 0 14px 12px;
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 14px;
    background: linear-gradient(180deg, #0d0a1f, #07060f); border-right: 1px solid var(--line-soft); overflow-y: auto;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: 12px 0 40px rgba(0, 0, 0, .6);
  }
  body.with-shell.menu-open #topbar { transform: none; }
  body.with-shell.menu-open #side-overlay { display: block; position: fixed; inset: 0; z-index: 28; background: rgba(0, 0, 0, .6); }
  body.with-shell.menu-open { overflow: hidden; }
  #topbar > .brand { display: none; }
  #topbar .drawer-brand { display: flex; flex: none; }
  #topbar .tabs-nav { display: grid; gap: 4px; padding: 0 12px 0 0; border: 0; background: none; flex: none; }
  #topbar .tabs-nav a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); font-size: 15px; font-weight: 600; white-space: normal; }
  #topbar .tabs-nav a[aria-current="page"] { color: #fff; background: linear-gradient(135deg, rgba(135, 60, 255, .34), rgba(70, 40, 180, .16)); border-color: rgba(170, 100, 255, .45); }
  body:not(.signed-in) .only-in, body.signed-in .only-out { display: none !important; }
  body.signed-in .only-in.only-phone, body:not(.signed-in) .only-out.only-phone { display: flex; }
  .drawer-lang { display: block !important; width: calc(100% - 12px); margin-top: auto; }
  body.signed-in .drawer-lang { display: none !important; }
  #topbar .me { margin-top: auto; margin-right: 12px; padding-top: 10px; border-top: 1px solid var(--line-soft); display: flex; flex-wrap: wrap; }
  #me-name { flex: 1 1 90px; }

  /* One section at a time. */
  body[data-section="calls"] #home [data-sec]:not([data-sec="calls"]),
  body[data-section="contacts"] #home [data-sec]:not([data-sec="contacts"]),
  body[data-section="history"] #home [data-sec]:not([data-sec="history"]) { display: none; }
  #home #push-card, .pitch > .ui-lang, .landing-help, #landing .facts, #support-guest, .auth-links .help-link { display: none !important; }
  .settings-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
  .settings-tabs button { min-height: 42px; padding: 7px 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--panel); color: var(--muted); font-size: 13.5px; font-weight: 600; }
  .settings-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; border-color: transparent; }
  #settings > section.tab-off { display: none; }
  body.with-shell .page { padding-top: 16px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) and (prefers-reduced-motion: reduce) { body.with-shell #topbar { transition: none; } }

#m-user, #bottom-nav, .m-hero, .m-quick, .m-stats { display: none; }
@media (max-width: 960px) {
  .phone-hide { display: none !important; }
  body.with-shell.signed-in { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  /* Top bar */
  body.with-shell #mobilebar { padding-right: 8px; }
  #mobilebar .brand-logo img { width: 36px; height: auto; }
  #mobilebar .wordmark { margin-right: 0; height: 46px; }
  body:not(.signed-in) #mobilebar .wordmark { height: 58px; margin-right: 8px; }
  body.signed-in #m-user { display: block; position: relative; flex: none; }
  #m-user-btn { display: grid; place-items: center; width: 42px; min-height: 42px; height: 42px; padding: 0; border: 1px solid rgba(170, 100, 255, .45); border-radius: 11px; overflow: hidden; background: linear-gradient(135deg, #7c3aed, #4c1d95); color: #fff; font-weight: 800; }
  #m-avatar { width: 100%; height: 100%; object-fit: cover; }
  #m-user-menu { position: absolute; right: 0; top: 50px; z-index: 40; min-width: 160px; padding: 6px; border: 1px solid rgba(170, 100, 255, .4); border-radius: 14px; background: #0d0a1f; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); display: grid; gap: 2px; }
  #m-user-menu[hidden] { display: none; }
  #m-user-menu a, #m-user-menu button { display: block; width: 100%; min-height: 44px; padding: 11px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; text-decoration: none; }
  #m-user-menu a:hover, #m-user-menu button:hover { background: rgba(145, 75, 255, .14); }
  /* Bottom menu */
  body.with-shell.signed-in #bottom-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 24;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: rgba(7, 6, 15, .97); border-top: 1px solid rgba(170, 100, 255, .25);
  }
  #bottom-nav a, #bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 54px; padding: 5px 2px; border: 0; border-radius: 12px; background: none; color: #a7a2cf; font-size: 10.5px; font-weight: 500; line-height: 1.15; text-align: center; text-decoration: none; }
  #bottom-nav a[aria-current="page"] { color: #fff; background: rgba(145, 75, 255, .2); }
  #bottom-nav span { overflow-wrap: anywhere; }
  /* Home */
  body[data-section="calls"] .m-hero { display: flex; }
  body[data-section="calls"] .m-quick { display: grid; }
  body[data-section="calls"] .m-stats { display: grid; }
  .m-hero { justify-content: space-between; align-items: center; gap: 12px; padding: 18px; margin-bottom: 14px; border: 1px solid rgba(170, 100, 255, .32); border-radius: 18px; background: radial-gradient(circle at 90% 0, rgba(124, 58, 237, .4), transparent 60%), linear-gradient(135deg, #1a1236, #0b0a16); }
  .m-hero small { display: block; color: #c4b5fd; font-size: 13px; }
  .m-hero b { display: block; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
  .m-date { flex: none; text-align: right; }
  .m-date span { display: block; color: var(--dim); font-size: 12px; }
  .m-date b { font-size: 18px; font-variant-numeric: tabular-nums; }
  .m-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .m-quick a, .m-quick button { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; min-height: 84px; padding: 11px 3px; border: 1px solid var(--line-soft); border-radius: 15px; background: var(--panel); color: var(--text); font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; }
  .m-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(145, 75, 255, .2); color: #d8b4fe; }
  .m-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .m-stats a { display: grid; gap: 2px; min-width: 0; padding: 12px 10px; border: 1px solid var(--line-soft); border-radius: 15px; background: linear-gradient(160deg, #120e24, var(--panel)); color: var(--text); text-decoration: none; }
  .m-stats b { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .m-stats small { color: var(--muted); font-size: 11px; line-height: 1.2; overflow-wrap: anywhere; }
}
