/* ==========================================================
   Integra Phone — Repaginação 2026
   Source: Phone/ui/styles.css adapted for #Phone app-shell
   ========================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.18);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --row-h: 68px;
  --sidebar-w: 340px;
  --drawer-w: 380px;
}

/* ===== DARK (default) ===== */
[data-theme="dark"], :root:not([data-theme="light"]) {
  --bg-app:        oklch(0.18 0.02 255);
  --bg-surface:    oklch(0.22 0.022 255);
  --bg-surface-2:  oklch(0.26 0.025 255);
  --bg-surface-3:  oklch(0.30 0.027 255);
  --bg-chat:       oklch(0.16 0.018 255);
  --border:        oklch(0.32 0.022 255);
  --border-strong: oklch(0.40 0.025 255);
  --text:          oklch(0.97 0.005 255);
  --text-muted:    oklch(0.72 0.015 255);
  --text-subtle:   oklch(0.55 0.018 255);
  --accent:        oklch(0.68 0.14 240);
  --accent-fg:     oklch(0.99 0 0);
  --accent-soft:   oklch(0.30 0.08 240);
  --call:          oklch(0.72 0.15 155);
  --call-soft:     oklch(0.32 0.09 155);
  --danger:        oklch(0.65 0.22 25);
  --warn:          oklch(0.78 0.16 75);
  --bubble-out:    oklch(0.42 0.13 240);
  --bubble-out-fg: oklch(0.99 0 0);
  --bubble-in:     oklch(0.28 0.022 255);
  --bubble-in-fg:  oklch(0.97 0.005 255);
  --pattern-opacity: 0.025;
}

/* ===== LIGHT ===== */
[data-theme="light"] {
  --bg-app:        oklch(0.985 0.003 255);
  --bg-surface:    oklch(1 0 0);
  --bg-surface-2:  oklch(0.97 0.005 255);
  --bg-surface-3:  oklch(0.94 0.008 255);
  --bg-chat:       oklch(0.975 0.005 255);
  --border:        oklch(0.91 0.008 255);
  --border-strong: oklch(0.85 0.012 255);
  --text:          oklch(0.22 0.022 255);
  --text-muted:    oklch(0.48 0.015 255);
  --text-subtle:   oklch(0.62 0.012 255);
  --accent:        oklch(0.55 0.16 240);
  --accent-fg:     oklch(1 0 0);
  --accent-soft:   oklch(0.93 0.03 240);
  --call:          oklch(0.58 0.16 155);
  --call-soft:     oklch(0.93 0.04 155);
  --danger:        oklch(0.58 0.22 25);
  --warn:          oklch(0.68 0.16 75);
  --bubble-out:    oklch(0.55 0.16 240);
  --bubble-out-fg: oklch(1 0 0);
  --bubble-in:     oklch(1 0 0);
  --bubble-in-fg:  oklch(0.22 0.022 255);
  --pattern-opacity: 0.04;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ===== App shell ===== */
#Phone {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background: var(--bg-app);
  max-width: 100vw !important;
}
#Phone[data-drawer="open"] {
  grid-template-columns: var(--sidebar-w) 1fr var(--drawer-w);
}

/* Stream visibility — jQuery toggles class "stream"/"streamSelected" */
.stream          { display: none !important; }
.streamSelected  { display: flex !important; flex-direction: column; min-width: 0; flex: 1; position: relative; }

/* ===== Sidebar ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-mark { display: flex; align-items: center; gap: 8px; }
.brand-logo { height: 36px; width: auto; display: block; }
.brand-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), oklch(0.55 0.18 195));
  display: grid; place-items: center;
  color: white; font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 6px oklch(0.55 0.18 240 / 0.35);
  flex-shrink: 0;
}

.icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.15s var(--ease);
}
.icon-btn:hover { background: var(--bg-surface-3); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); }

/* Me-card */
.me-card {
  margin: 12px 12px 8px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.me-avatar {
  position: relative;
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  display: grid; place-items: center;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.me-avatar::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--call);
  border: 2px solid var(--bg-surface-2);
}
.me-avatar[data-status="connecting"]::after { background: var(--warn); }
.me-avatar[data-status="offline"]::after    { background: var(--text-subtle); }

.me-info { flex: 1; min-width: 0; }
.me-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.me-status {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}
.me-status .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--call); flex-shrink: 0; }
.me-actions { display: flex; gap: 2px; }
.voiceMessageNotifyer {
  background: var(--danger);
  color: white;
  border-radius: var(--r-full);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  display: none;
}
.voiceMessageNotifyer:not(:empty) { display: inline-block; cursor: pointer; }

/* Search */
.search-wrap {
  padding: 4px 12px 10px;
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.search-input { flex: 1; position: relative; }
.search-input svg {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.search-input input {
  width: 100%; height: 36px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0 12px 0 34px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.search-input input:focus { border-color: var(--accent); background: var(--bg-surface-3); }
.search-input input::placeholder { color: var(--text-subtle); }

/* Filter chips */
.filter-chips {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-full);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s var(--ease);
  cursor: pointer;
}
.chip:hover  { background: var(--bg-surface-3); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.chip .count { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.85; }

/* Filter chip filtering — CSS hides non-matching convos */
#myContacts[data-active-filter="missed"]   .convo:not([data-type="missed"])   { display: none; }
#myContacts[data-active-filter="voice"]    .convo:not([data-type="voice"])    { display: none; }
#myContacts[data-active-filter="whatsapp"] .convo:not([data-type="whatsapp"]) { display: none; }

/* Conversation list */
.convo-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.convo {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 11px;
  align-items: center;
  padding: 10px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  position: relative;
  transition: background 0.12s;
}
.convo:hover                   { background: var(--bg-surface-2); }
.convo.active                  { background: var(--accent-soft); }
.convo.active .convo-name      { color: var(--accent); }
.convo.buddyActiveCall         { background: var(--call-soft); }
.convo.buddyActiveCallHollding { background: var(--bg-surface-2); opacity: 0.75; }

.convo-avatar {
  position: relative;
  width: 44px; height: 44px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 15px;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  font-family: var(--font-sans);
}
.chat-header .convo-avatar { width: 38px; height: 38px; font-size: 14px; }
.drawer-avatar { width: 88px !important; height: 88px !important; font-size: 30px !important; margin: 0 auto 14px; }

.convo-avatar.tone-1 { background: linear-gradient(135deg, oklch(0.62 0.16 30),  oklch(0.55 0.18 15)); }
.convo-avatar.tone-2 { background: linear-gradient(135deg, oklch(0.62 0.16 200), oklch(0.55 0.16 230)); }
.convo-avatar.tone-3 { background: linear-gradient(135deg, oklch(0.62 0.16 145), oklch(0.55 0.16 165)); }
.convo-avatar.tone-4 { background: linear-gradient(135deg, oklch(0.65 0.16 80),  oklch(0.58 0.18 55)); }
.convo-avatar.tone-5 { background: linear-gradient(135deg, oklch(0.62 0.18 320), oklch(0.55 0.18 290)); }
.convo-avatar.tone-6 { background: linear-gradient(135deg, oklch(0.60 0.14 260), oklch(0.52 0.16 280)); }

.convo-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.convo-top  { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.convo-name {
  font-weight: 600; font-size: 13.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.convo-name.is-num { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.01em; }
.convo-time { font-size: 11px; color: var(--text-subtle); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.convo-bottom { display: flex; align-items: center; gap: 6px; }
.convo-preview {
  font-size: 12px; color: var(--text-muted); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px;
}
.convo-type    { width: 14px; height: 14px; display: grid; place-items: center; flex-shrink: 0; }
.type-missed   { color: var(--danger); }
.type-incoming { color: var(--call); }
.type-outgoing { color: var(--accent); }
.type-whatsapp { color: oklch(0.65 0.16 145); }
.convo-meta    { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.unread-badge  {
  min-width: 18px; height: 18px;
  background: var(--accent); color: var(--accent-fg);
  border-radius: var(--r-full);
  font-size: 10.5px; font-weight: 600; padding: 0 6px;
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.unread-badge.missed { background: var(--danger); }

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-subtle);
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  background: var(--bg-surface-3);
  border-radius: var(--r-full);
  padding: 3px;
}
.theme-toggle button {
  width: 26px; height: 26px;
  border: none; background: transparent;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  color: var(--text-subtle);
  font-size: 14px;
  transition: all 0.2s var(--ease);
}
.theme-toggle button.active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Right content wrapper */
#rightContent {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
  background: var(--bg-chat);
}

/* ===== Chat panel ===== */
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  height: 64px;
  flex-shrink: 0;
}
.chat-title { flex: 1; min-width: 0; cursor: pointer; }
.chat-title h2 {
  font-size: 14.5px; font-weight: 600; margin: 0;
  color: var(--text); font-family: var(--font-mono);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-title .sub {
  font-size: 11.5px; color: var(--text-muted);
  margin-top: 1px; display: flex; align-items: center; gap: 5px;
}
.chat-title .sub .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--call); flex-shrink: 0; }
.chat-actions { display: flex; gap: 2px; align-items: center; }
.chat-actions .icon-btn { width: 36px; height: 36px; }
.chat-actions .divider  { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.icon-btn.call-btn { color: var(--call); }
.icon-btn.call-btn:hover { background: oklch(from var(--call) l c h / 0.12); color: var(--call); }

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 12px;
  position: relative;
  scroll-behavior: smooth;
  background: var(--bg-chat);
}
.messages::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><circle cx='10' cy='10' r='1' fill='currentColor'/><circle cx='40' cy='30' r='1' fill='currentColor'/><circle cx='70' cy='15' r='1' fill='currentColor'/><circle cx='20' cy='55' r='1' fill='currentColor'/><circle cx='55' cy='65' r='1' fill='currentColor'/></svg>");
  opacity: var(--pattern-opacity);
  pointer-events: none;
  color: var(--text);
}
.messages-inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Date divider */
.date-divider { display: flex; align-items: center; justify-content: center; margin: 18px 0 10px; }
.date-divider span {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg-surface-2);
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em;
}

/* Bubbles */
.msg-row { display: flex; gap: 8px; align-items: flex-end; }
.msg-row.out { justify-content: flex-end; }
.msg-row.in  { justify-content: flex-start; }
.msg-author {
  font-size: 11.5px; color: var(--text-muted);
  font-weight: 500; margin-bottom: 4px; margin-left: 12px;
}
.msg-row.out .msg-author { text-align: right; margin-left: 0; margin-right: 12px; }
.msg-group { display: flex; flex-direction: column; max-width: 70%; }
.bubble {
  padding: 8px 13px;
  border-radius: 18px;
  font-size: 13.5px; line-height: 1.45;
  position: relative; word-wrap: break-word;
}
.msg-row.out .bubble {
  background: var(--bubble-out); color: var(--bubble-out-fg);
  border-bottom-right-radius: 6px;
}
.msg-row.in .bubble {
  background: var(--bubble-in); color: var(--bubble-in-fg);
  border-bottom-left-radius: 6px;
  border: 1px solid var(--border);
}
.bubble-time {
  font-size: 10.5px; opacity: 0.7; margin-top: 3px;
  font-variant-numeric: tabular-nums; font-family: var(--font-mono);
  display: inline-flex; align-items: center; gap: 3px;
}
.msg-row.out .bubble-time { color: var(--bubble-out-fg); }
.msg-row.in  .bubble-time { color: var(--text-muted); }
.msg-row + .msg-row.same { margin-top: -4px; }
.msg-row.same .msg-author { display: none; }

/* Call card */
.call-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin: 0 0 12px;
  box-shadow: var(--shadow-sm);
}
.call-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.call-icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: oklch(from var(--call) l c h / 0.15);
  color: var(--call);
  display: grid; place-items: center; flex-shrink: 0; font-size: 18px;
}
.call-icon.missed { background: oklch(from var(--danger) l c h / 0.15); color: var(--danger); }
.call-meta { flex: 1; min-width: 0; }
.call-meta h3 { font-size: 14px; font-weight: 600; margin: 0; color: var(--text); }
.call-meta .call-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  display: flex; gap: 10px; flex-wrap: wrap;
  font-variant-numeric: tabular-nums;
}
.audio-player {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.play-btn {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  background: var(--accent); color: var(--accent-fg);
  border: none; display: grid; place-items: center;
  flex-shrink: 0; font-size: 14px;
  transition: transform 0.1s;
}
.play-btn:hover  { transform: scale(1.06); }
.play-btn:active { transform: scale(0.96); }
.waveform {
  flex: 1; height: 28px;
  display: flex; align-items: center; gap: 2px;
  position: relative; cursor: pointer;
}
.waveform .bar { flex: 1; background: var(--border-strong); border-radius: 2px; transition: background 0.15s; }
.waveform .bar.played { background: var(--accent); }
.audio-time {
  font-family: var(--font-mono); font-size: 11.5px;
  color: var(--text-muted); min-width: 70px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.call-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn {
  height: 34px; padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface-2); color: var(--text);
  font-size: 12.5px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.12s var(--ease); cursor: pointer;
}
.btn:hover   { background: var(--bg-surface-3); border-color: var(--border-strong); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.primary:hover { background: oklch(from var(--accent) calc(l - 0.04) c h); }

/* System message pill */
.system-msg { display: flex; justify-content: center; margin: 10px 0; }
.system-msg .pill {
  background: var(--bg-surface-2); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: var(--r-full);
  font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 8px;
}

/* Composer */
.composer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 12px 18px;
  display: flex; align-items: flex-end; gap: 10px;
  flex-shrink: 0;
}
.composer-input {
  flex: 1;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  display: flex; gap: 8px; align-items: flex-end;
  transition: border-color 0.15s;
}
.composer-input:focus-within { border-color: var(--accent); }
.composer-input textarea {
  flex: 1; background: transparent; border: none; resize: none; outline: none;
  color: var(--text); font-size: 13.5px; line-height: 1.5;
  max-height: 120px; min-height: 22px; font-family: var(--font-sans);
}
.composer-input textarea::placeholder { color: var(--text-subtle); }
.send-btn {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: var(--accent); color: var(--accent-fg);
  border: none; display: grid; place-items: center;
  flex-shrink: 0; font-size: 16px;
  transition: transform 0.1s, background 0.15s;
}
.send-btn:hover   { background: oklch(from var(--accent) calc(l - 0.04) c h); }
.send-btn:active  { transform: scale(0.94); }
.send-btn:disabled { background: var(--border); color: var(--text-subtle); cursor: not-allowed; }

/* ===== Drawer ===== */
.drawer {
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  flex-direction: column;
  height: 100vh;
  /* display toggled by ToggleDrawer() via .css("display","flex") / .hide() */
}
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border); height: 64px;
}
.drawer-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.drawer-body { padding: 24px 18px; }
.drawer-avatar { margin: 0 auto 14px; display: grid; place-items: center; }
.drawer-name {
  text-align: center; font-family: var(--font-mono);
  font-weight: 600; font-size: 17px; color: var(--text); margin-bottom: 4px;
}
.drawer-handle { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
.drawer-quick-actions { display: flex; justify-content: center; gap: 10px; margin: 18px 0 22px; }
.qa {
  width: 56px; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 11px; font-weight: 500; cursor: pointer;
}
.qa .qa-icon {
  width: 42px; height: 42px; border-radius: var(--r-full);
  background: var(--bg-surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--accent); font-size: 18px;
  transition: all 0.15s var(--ease);
}
.qa:hover .qa-icon { background: var(--accent-soft); border-color: var(--accent); }
.drawer-section { border-top: 1px solid var(--border); padding: 16px 18px; }
.drawer-section h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 0 0 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-section h4 .count {
  font-family: var(--font-mono);
  background: var(--bg-surface-2); padding: 2px 7px;
  border-radius: var(--r-full); font-size: 10px; border: 1px solid var(--border);
  text-transform: none; letter-spacing: 0;
}
.note {
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 12px;
  font-size: 12.5px; color: var(--text-muted); line-height: 1.5; min-height: 64px;
}

/* Search bar in chat */
.search-bar {
  background: var(--bg-surface); border-bottom: 1px solid var(--border);
  padding: 10px 18px; display: flex; gap: 10px; align-items: center; flex-shrink: 0;
}
.search-bar input {
  flex: 1; height: 34px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0 12px; color: var(--text);
  font-size: 13px; outline: none;
}
.search-bar input:focus { border-color: var(--accent); }

/* ===== Dialer modal ===== */
.dialer-backdrop {
  position: fixed; inset: 0;
  background: oklch(0 0 0 / 0.5);
  display: grid; place-items: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.dialer {
  background: var(--bg-surface);
  border-radius: var(--r-xl);
  padding: 28px 24px; width: 320px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: pop 0.2s var(--ease);
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.dialer-display {
  width: 100%; height: 56px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 26px; font-weight: 500;
  color: var(--text); letter-spacing: 0.02em; margin-bottom: 18px;
  font-variant-numeric: tabular-nums;
  background: transparent; border: none; outline: none; text-align: center;
}
.dialer-display.empty { color: var(--text-subtle); }

.dialer-pad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 18px;
}
.dial-key {
  height: 56px; border-radius: var(--r-md);
  background: var(--bg-surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font-mono); font-size: 22px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all 0.1s var(--ease); line-height: 1; cursor: pointer;
}
.dial-key span { font-size: 9px; letter-spacing: 0.15em; color: var(--text-subtle); margin-top: 3px; font-family: var(--font-sans); }
.dial-key:hover  { background: var(--bg-surface-3); border-color: var(--accent); }
.dial-key:active { transform: scale(0.96); }

.dialer-actions { display: flex; gap: 10px; align-items: center; }
.dialer-actions .btn { flex: 1; height: 44px; justify-content: center; }
.dial-call { background: var(--call); color: white; border-color: var(--call); font-weight: 600; }
.dial-call:hover { background: oklch(from var(--call) calc(l - 0.04) c h); }
.dial-bksp { width: 44px; height: 44px; flex: 0 0 44px; }

/* ===== Login overlay ===== */
#LoginOverlay { background: var(--bg-app); }
.login-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.login-logo  { height: 190px; width: auto; filter: drop-shadow(0 6px 32px rgba(74,124,220,0.45)); }
.login-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 32px 36px; width: 360px;
  box-shadow: var(--shadow-lg);
}
.login-brand-text-wrap {
  font-size: 28px; font-weight: 800; color: #ffffff;
  letter-spacing: -0.03em; text-align: center; margin-bottom: 4px;
}
.login-brand-sub  { color: var(--text-muted); font-weight: 400; }
.login-subtitle   { text-align: center; color: var(--text-muted); font-size: 13px; margin: 0 0 20px; }
.login-fields     { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.login-field-wrap { position: relative; }
.login-field-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); font-size: 13px; }
.login-input {
  width: 100%; height: 42px;
  background: #1a2035; border: 1px solid #3a4a6b;
  border-radius: var(--r-md); padding: 0 12px 0 36px;
  color: #ffffff; font-size: 13.5px; outline: none; transition: border-color 0.15s;
}
.login-input::placeholder { color: #7a8aaa; opacity: 1; }
.login-input:focus { border-color: #4a7cdc; }
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff;
  -webkit-box-shadow: 0 0 0px 1000px #1a2035 inset;
  transition: background-color 5000s ease-in-out 0s;
}
.login-btn {
  width: 100%; height: 44px;
  background: var(--accent); color: var(--accent-fg);
  border: none; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.login-btn:hover { background: oklch(from var(--accent) calc(l - 0.04) c h); }
.login-error { font-size: 12px; color: var(--danger); text-align: center; margin: 8px 0 0; }

/* Loading spinner */
.loading {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-app); color: var(--text-muted); font-size: 32px; z-index: 9998;
}

/* ===== Responsive ===== */
@media (max-width: 920px) {
  #Phone { grid-template-columns: 1fr !important; }
  #leftContent  { display: none !important; }
  #leftContent.show { display: flex !important; }
  #rightContent { display: flex; flex-direction: column; }
}
@media (max-width: 1100px) {
  #Phone[data-drawer="open"] { grid-template-columns: 0 1fr var(--drawer-w) !important; }
  #Phone[data-drawer="open"] #leftContent { display: none; }
}

/* ===== Legacy compat — keeps old call-panel HTML from breaking ===== */
.roundButtons {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--bg-surface-3); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 13px;
  transition: all 0.12s var(--ease);
}
.roundButtons:hover { background: var(--bg-surface-2); color: var(--text); }

/* ===== Buttons global ===== */
.btn-primary {
  height: 34px; padding: 0 16px;
  background: var(--accent); color: var(--accent-fg);
  border: none; border-radius: var(--r-md);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s var(--ease);
}
.btn-primary:hover { background: oklch(from var(--accent) calc(l - 0.04) c h); }

.btn-ghost {
  height: 34px; padding: 0 14px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.12s var(--ease);
}
.btn-ghost:hover { background: var(--bg-surface-2); color: var(--text); }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: oklch(0 0 0 / 0.55);
  display: flex; align-items: center; justify-content: center;
  animation: modal-fade-in 0.12s ease-out;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 16px; width: 340px; max-width: calc(100vw - 32px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  animation: modal-scale-in 0.12s ease-out;
}
@keyframes modal-scale-in {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 0;
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center;
}
.modal-close:hover { background: var(--bg-surface-2); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }
.modal-subtitle { font-size: 12px; color: var(--text-muted); margin: 4px 20px 0; }
.modal-body { padding: 16px 20px; }
.modal-body .field-group { margin-bottom: 10px; }
.modal-body .field-label { display: block; font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.modal-body .field-input {
  width: 100%; height: 36px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0 12px;
  color: var(--text); font-size: 13px; outline: none;
  transition: border-color 0.12s; box-sizing: border-box;
}
.modal-body .field-input:focus { border-color: var(--accent); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 0 20px 18px;
}

/* ===== Context menu ===== */
.ctx-menu {
  position: fixed; z-index: 10001;
  list-style: none; margin: 0; padding: 4px 0;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  animation: modal-fade-in 0.1s ease-out;
}
.ctx-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 13px; color: var(--text);
  cursor: pointer; user-select: none;
}
.ctx-item:hover { background: var(--bg-surface-2); }
.ctx-item svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.ctx-item--danger { color: var(--danger); }
.ctx-item--danger svg { color: var(--danger); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }
.ctx-item--disabled { opacity: 0.45; cursor: default; pointer-events: none; }

/* ===== Call panel buttons ===== */
.call-panel {
  display: flex; flex-direction: column; align-items: center;
  gap: 0; padding: 24px 32px 32px; width: 100%;
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--bg-surface) 60%, transparent);
  z-index: 10;
}
.call-panel .call-actions { margin-top: 0; }
.call-panel-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.62 0.16 200), oklch(0.55 0.16 230));
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700; color: white;
  flex-shrink: 0;
}
.call-panel-name  { font-size: 17px; font-weight: 600; color: var(--text); }
.call-panel-timer {
  font-family: var(--font-mono); font-size: 14px; color: var(--call);
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
}
.call-panel-status { font-size: 12px; color: var(--text-muted); }
.call-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px; margin-top: 10px;
}
.call-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 11px;
}
.call-btn-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--text);
  transition: all 0.12s var(--ease);
}
.call-btn-icon svg { width: 20px; height: 20px; }
.call-btn:hover .call-btn-icon { background: var(--bg-surface-3); border-color: var(--border-strong); }
.call-btn--active .call-btn-icon { background: var(--accent); border-color: var(--accent); color: white; }
.call-btn--active .call-btn-icon svg { color: white; }
.call-btn--end .call-btn-icon { background: var(--danger); border-color: var(--danger); color: white; }
.call-btn--end .call-btn-icon svg { color: white; }
.call-btn-label { color: var(--text-muted); font-size: 10.5px; }

/* ===== Settings panel ===== */
.settings-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; z-index: 9500;
  background: var(--bg-surface); border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,0.25);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s var(--ease);
}
.settings-panel.settings-panel--open { transform: translateX(0); }
.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.settings-title { font-size: 15px; font-weight: 600; color: var(--text); }
.settings-close {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center;
}
.settings-close:hover { background: var(--bg-surface-2); color: var(--text); }
.settings-close svg { width: 16px; height: 16px; }
.settings-body {
  flex: 1; overflow-y: auto; padding: 0 20px 20px;
}
.settings-section { padding-top: 18px; margin-bottom: 4px; }
.settings-section + .settings-section { border-top: 1px solid var(--border); }
.settings-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  margin: 0 0 12px;
}
.settings-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Modern overrides for legacy settings fields */
.UiSideField { padding: 0; border: none; background: none; }
.UiTextHeading {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--text);
  cursor: pointer; border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.UiTextHeading .UiTextHeadingIcon {
  width: 22px; height: 22px; border-radius: var(--r-xs);
  display: inline-grid; place-items: center; font-size: 11px; color: white;
}
.UiText { font-size: 12px; color: var(--text-muted); margin: 8px 0 4px; }
.UiInputText {
  width: 100%; height: 36px;
  background: var(--bg-surface-2) !important; border: 1px solid var(--border) !important;
  border-radius: var(--r-md) !important; padding: 0 12px !important;
  color: var(--text) !important; font-size: 13px; outline: none;
  transition: border-color 0.12s; box-sizing: border-box !important;
}
.UiInputText:focus { border-color: var(--accent) !important; }
#ButtonBar { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-bottom: 8px; }
#ButtonBar button {
  height: 34px; padding: 0 14px;
  border-radius: var(--r-md); font-size: 13px; cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-surface-2); color: var(--text);
  transition: all 0.12s;
}
#ButtonBar button:last-child {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}
#ButtonBar button:last-child:hover { background: oklch(from var(--accent) calc(l - 0.04) c h); }

/* ===== Call progress (dialing) ===== */
.call-progress {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; padding: 32px 16px; height: 100%;
}
.call-progress-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.62 0.16 200), oklch(0.55 0.16 230));
  display: grid; place-items: center;
  font-size: 26px; font-weight: 700; color: white; flex-shrink: 0;
  animation: call-ring-pulse 1.8s ease-out infinite;
}
@keyframes call-ring-pulse {
  0%   { box-shadow: 0 0 0 0 oklch(0.68 0.14 240 / 0.5); }
  70%  { box-shadow: 0 0 0 20px oklch(0.68 0.14 240 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.68 0.14 240 / 0); }
}
.call-progress-status {
  font-size: 12px; color: var(--text-muted); letter-spacing: 0.03em;
  animation: call-progress-blink 1.6s ease-in-out infinite;
}
@keyframes call-progress-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

/* ===== Dark theme for native form controls in settings panel ===== */
.settings-body select {
  width: 100%; height: 36px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text);
  font-size: 13px; padding: 0 8px; outline: none; cursor: pointer;
  box-sizing: border-box; margin-bottom: 6px;
}
.settings-body select:focus { border-color: var(--accent); }
.settings-body input[type=radio],
.settings-body input[type=checkbox] {
  accent-color: var(--accent); cursor: pointer;
  width: 14px; height: 14px; vertical-align: middle;
}
.settings-body label {
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  vertical-align: middle; margin-left: 3px;
}
.settings-body button.roundButtons {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--bg-surface-2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; display: inline-grid; place-items: center;
  font-size: 11px; transition: all 0.12s var(--ease);
}
.settings-body button.roundButtons:hover {
  background: var(--bg-surface-3); border-color: var(--accent); color: var(--accent);
}

/* ===== Active Call — Apple-inspired redesign ===== */

/* Stream table: make call content row fill remaining height */
.streamSelected tr:nth-child(2) { flex: 1; min-height: 0; }
.streamSelected tr:nth-child(2) > td { height: 100%; overflow: hidden; position: relative; }

/* Progress and answer divs fill the td */
[id$="-progress"], [id$="-AnswerCall"] { height: 100%; }

/* Active audio call — clean Apple surface */
[id$="-AudioCall"] { background: var(--bg-surface); height: 100%; }

/* Remove legacy decorative overlays */
.CallPictureUnderlay, .CallColorUnderlay { display: none !important; }

/* CallUi — flex column, content centered */
.CallUi {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; gap: 8px;
  padding: 32px 32px 32px; text-align: center;
  position: relative; box-sizing: border-box;
}
/* Reserve space at bottom for floating call controls when in active audio call */
[id$="-AudioCall"] .CallUi { padding-bottom: 120px; }

/* In-call avatar — Apple circle with shadow */
.inCallAvatar {
  width: 96px; height: 96px; border-radius: 50%;
  background-color: oklch(0.36 0.06 240);
  background-size: cover; background-position: center;
  border: none; flex-shrink: 0; margin-bottom: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Typography — SF Pro-like weight and letter-spacing */
.callingDisplayName {
  font-size: 26px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  line-height: 1.2; margin: 0;
}
.callingDisplayNumber {
  font-size: 14px; color: var(--text-muted); letter-spacing: -0.01em; margin: 0;
}

/* Incoming call buttons — Apple pill style */
.answerCall {
  display: flex !important; gap: 20px !important;
  justify-content: center !important; flex-wrap: wrap !important;
  margin-top: 32px !important; line-height: normal !important; padding: 0 !important;
}
.answerButton, .rejectButton {
  display: inline-flex !important; align-items: center !important;
  justify-content: center !important; gap: 8px !important;
  padding: 14px 32px !important; border-radius: var(--r-full) !important;
  font-size: 16px !important; font-weight: 600 !important;
  font-family: -apple-system, BlinkMacSystemFont, system-ui !important;
  border: none !important; cursor: pointer !important;
  letter-spacing: -0.01em !important; line-height: 1 !important;
  transition: filter 0.15s !important; min-width: 0 !important; min-height: 0 !important;
}

/* ===== .btn.danger + .danger-zone ===== */
.btn.danger {
  background: oklch(from var(--danger) l c h / 0.15);
  color: var(--danger);
  border-color: oklch(from var(--danger) l c h / 0.3);
}
.btn.danger:hover { background: var(--danger); color: white; }

.danger-zone {
  margin-top: 24px; padding: 14px 16px;
  border: 1px solid oklch(from var(--danger) l c h / 0.4);
  border-radius: var(--r-md);
  background: oklch(from var(--danger) l c h / 0.05);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}

/* ===== Generic .input, .slider, .seg, .tgl, .meter ===== */
.input {
  width: 100%; height: 36px;
  padding: 0 12px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text);
  font-size: 13px; outline: none; font-family: var(--font-sans);
}
.input.mono { font-family: var(--font-mono); }
.input:focus { border-color: var(--accent); }
.input:disabled { opacity: 0.6; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px;
}

.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: var(--border); border-radius: 999px; outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: var(--accent); border-radius: 50%; cursor: pointer;
}

.tgl {
  width: 36px; height: 22px; border-radius: 999px;
  background: var(--border); border: none; position: relative;
  transition: background 0.18s; flex-shrink: 0; cursor: pointer;
}
.tgl-knob {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; background: white; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: left 0.18s var(--ease);
}
.tgl.on { background: var(--accent); }
.tgl.on .tgl-knob { left: 16px; }

.seg {
  display: inline-flex; background: var(--bg-surface-2);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 3px; gap: 0;
}
.seg button {
  border: none; background: transparent;
  padding: 6px 12px; font-size: 12.5px; font-weight: 500;
  color: var(--text-muted); border-radius: var(--r-sm); transition: all 0.12s;
}
.seg button.active { background: var(--bg-surface); color: var(--accent); box-shadow: var(--shadow-sm); }

.meter { margin-bottom: 16px; }
.meter-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; }
.meter-bar { display: flex; gap: 3px; height: 18px; align-items: center; }
.meter-tick { flex: 1; height: 100%; background: var(--bg-surface-3); border-radius: 1px; }
.meter-tick.on { background: var(--call); }
.meter-tick.on.hot { background: var(--warn); }

/* ===== Settings card / row / fields ===== */
.settings-card {
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 4px;
}
.settings-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
}
.settings-row + .settings-row { border-top: 1px solid var(--border); }

.setting-field { margin-bottom: 16px; }
.setting-field-head {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px;
}
.setting-field-head label { font-size: 12.5px; font-weight: 500; color: var(--text); }
.setting-field-head .hint { font-size: 11px; color: var(--text-subtle); font-family: var(--font-mono); }

.settings-h { font-size: 18px; font-weight: 600; color: var(--text); margin: 0 0 4px; letter-spacing: -0.01em; }
.settings-sh {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted); margin: 22px 0 8px; font-weight: 600;
}
.settings-p { font-size: 13px; color: var(--text-muted); margin: 0 0 22px; }

/* ===== Settings modal — full redesign ===== */
.settings-modal {
  display: grid; grid-template-columns: 220px 1fr;
  width: min(880px, 92vw); height: min(640px, 88vh);
  background: var(--bg-surface); border-radius: var(--r-xl);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  overflow: hidden; animation: modal-scale-in 0.22s var(--ease);
}
.settings-nav {
  background: var(--bg-app); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.settings-nav-head {
  padding: 16px 16px 12px; display: flex;
  align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.settings-nav nav {
  flex: 1; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 1px; overflow-y: auto;
}
.settings-nav-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; background: transparent; border: none;
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  color: var(--text-muted); text-align: left; transition: all 0.12s; cursor: pointer;
}
.settings-nav-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.settings-nav-btn:hover { background: var(--bg-surface-2); color: var(--text); }
.settings-nav-btn.active { background: var(--accent-soft); color: var(--accent); }
.settings-nav-foot {
  padding: 12px 14px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-subtle);
  display: flex; align-items: center; gap: 8px;
}
.settings-main { padding: 28px 32px; overflow-y: auto; }

/* Theme cards in settings */
.theme-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-card {
  text-align: left; background: var(--bg-surface-2);
  border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px; transition: all 0.12s;
}
.theme-card:hover { border-color: var(--border-strong); }
.theme-card.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-preview { height: 60px; border-radius: var(--r-sm); display: flex; gap: 4px; padding: 6px; margin-bottom: 8px; }
.theme-preview span { flex: 1; border-radius: 3px; }
.theme-preview-dark { background: oklch(0.18 0.02 255); }
.theme-preview-dark span:nth-child(1) { background: oklch(0.22 0.022 255); }
.theme-preview-dark span:nth-child(2) { background: oklch(0.16 0.018 255); }
.theme-preview-dark span:nth-child(3) { background: oklch(0.68 0.14 240); }
.theme-preview-light { background: oklch(0.985 0.003 255); border: 1px solid oklch(0.91 0.008 255); }
.theme-preview-light span:nth-child(1) { background: oklch(0.97 0.005 255); }
.theme-preview-light span:nth-child(2) { background: oklch(1 0 0); }
.theme-preview-light span:nth-child(3) { background: oklch(0.55 0.16 240); }
.theme-card-meta strong { display: block; font-size: 13px; color: var(--text); }
.theme-card-meta span { font-size: 11.5px; color: var(--text-muted); }

/* Shortcut rows */
.shortcut-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-size: 13px;
}
.shortcut-row + .shortcut-row { border-top: 1px solid var(--border); }
.shortcut-row kbd {
  font-family: var(--font-mono); font-size: 11.5px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 5px; padding: 3px 8px; color: var(--text-muted);
}

/* About info rows */
.info-row {
  display: flex; justify-content: space-between;
  padding: 10px 12px; font-size: 13px;
}
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row .mono { font-family: var(--font-mono); color: var(--text-muted); font-size: 12px; }

/* Video placeholder */
.video-preview {
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); aspect-ratio: 16/9;
  display: grid; place-items: center; margin-bottom: 16px;
}
.video-placeholder {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; color: var(--text-subtle); font-size: 12px;
}

/* ===== In-Call modal overlay ===== */
@keyframes pulse {
  0%   { transform: scale(0.95); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}

.incall {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); width: 380px;
  padding: 22px 22px 18px;
  box-shadow: var(--shadow-lg); animation: modal-scale-in 0.22s var(--ease);
  position: relative;
}
.incall-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.incall-state {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
}
.state-dot {
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 0 4px oklch(from var(--call) l c h / 0.15);
}
.incall-timer {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--text); font-variant-numeric: tabular-nums;
  margin-left: 6px; text-transform: none; letter-spacing: 0;
}

.incall-body {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0 18px; position: relative;
}
.incall-avatar {
  width: 96px; height: 96px; border-radius: var(--r-full);
  display: grid; place-items: center;
  font-size: 32px; font-weight: 600; color: white;
  margin-bottom: 14px; position: relative;
}
.incall-avatar[data-pulse="true"]::before,
.incall-avatar[data-pulse="true"]::after {
  content: ''; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0.3;
  animation: pulse 1.6s ease-out infinite;
}
.incall-avatar[data-pulse="true"]::after { animation-delay: 0.8s; }

.incall-name {
  font-family: var(--font-mono); font-weight: 600; font-size: 18px;
  color: var(--text); letter-spacing: -0.01em;
}
.incall-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.incall-volume {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--bg-surface-2);
  border-radius: var(--r-md); margin-bottom: 14px; color: var(--text-muted);
}
.incall-volume input[type="range"] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--border); border-radius: 999px; outline: none;
}
.incall-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px;
  background: var(--accent); border-radius: 50%; cursor: pointer;
}
.vol-pct { font-family: var(--font-mono); font-size: 11px; min-width: 32px; text-align: right; }

.incall-actions {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 18px;
}
.call-action {
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  transition: all 0.12s var(--ease); cursor: pointer;
}
.call-action:hover { background: var(--bg-surface-3); color: var(--text); }
.call-action.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.ca-icon { width: 32px; height: 32px; display: grid; place-items: center; }
.ca-icon svg { width: 18px; height: 18px; }

.incall-bottom { display: flex; gap: 10px; }
.big-btn {
  flex: 1; height: 56px; border-radius: var(--r-lg); border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: white;
  transition: transform 0.1s var(--ease), background 0.15s; cursor: pointer;
}
.big-btn:active { transform: scale(0.97); }
.big-btn.accept { background: var(--call); }
.big-btn.accept:hover { background: oklch(from var(--call) calc(l - 0.04) c h); }
.big-btn.decline { background: var(--danger); }
.big-btn.decline:hover { background: oklch(from var(--danger) calc(l - 0.04) c h); }
.big-btn.solo { flex: 1; }
.big-btn svg { width: 22px; height: 22px; }

.ended-msg {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 10px; font-size: 13px; color: var(--text-muted);
  padding: 14px; background: var(--bg-surface-2);
  border-radius: var(--r-md); font-variant-numeric: tabular-nums;
}

.dtmf-panel, .transfer-panel {
  position: absolute; top: 50px; left: 14px; right: 14px; bottom: 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 5; animation: modal-fade-in 0.15s var(--ease);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.dtmf-panel .dialer-pad { flex: 1; margin-bottom: 0; min-height: 0; }
.dtmf-panel .dial-key { height: auto; min-height: 44px; }
.dtmf-display {
  height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 20px;
  background: var(--bg-surface-2); border-radius: var(--r-md);
  color: var(--text); letter-spacing: 0.05em;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.transfer-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 13px;
}
.transfer-body { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.transfer-search { position: relative; display: flex; align-items: center; }
.transfer-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); }
.transfer-search input {
  width: 100%; height: 34px;
  background: var(--bg-surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 0 12px 0 32px;
  color: var(--text); font-size: 13px; outline: none;
}
.transfer-search input:focus { border-color: var(--accent); }
.transfer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-sm);
}
.transfer-row:hover { background: var(--bg-surface-2); }
.answerButton:hover, .rejectButton:hover { filter: brightness(1.12) !important; }
