@font-face {
  font-family: Geist;
  src: url('/assets/geist-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* Brand roles match numberlang/components/rico/ui/dashboard/workspace.css.
   Call-state colors are semantic and kept separate from the brand accent. */
:root {
  --canvas: #f5f8fc;
  --surface: #fff;
  --subtle: #f8fafc;
  --hover: #eef3f9;
  --selected: #e6edf7;
  --text: #14243b;
  --muted: #53647a;
  --border: #dce4ee;
  --border-strong: #c9d4e2;
  --control-border: #8796aa;
  --input-border: var(--control-border);   /* dashboard: --input = --tt-control-border */
  --ring: rgba(37, 99, 235, .25);            /* ring-ring/50 */
  --outline-border: #d1d5db;                 /* Button outline: border-gray-300 */
  --outline-text: #374151;                   /* text-gray-700 */
  --outline-hover: #f9fafb;                  /* hover:bg-gray-50 */
  --nav-hover: #eaf0f7;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
  --radius-xl: 12px;                         /* rounded-xl on buttons, inputs, selects */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #edf3ff;
  --accent-line: #bcd0fb;
  --accent-ink: #1d4ed8;
  --focus: #2563eb;
  --success: #047857;
  --success-hover: #065f46;
  --success-soft: #ecfdf5;
  --success-line: #a7e3c6;
  --warning: #92400e;
  --warning-soft: #fff7ed;
  --warning-line: #f3d1a2;
  --error: #b91c1c;
  --danger: #dc2626;
  --error-soft: #fef2f2;
  --error-line: #f7c4c4;
  --control-radius: 8px;
  --panel-radius: 12px;
  --gutter: 24px;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Strong curves: built-in CSS easings are too soft to feel intentional. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  font-family: Geist, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--canvas); color: var(--text); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); }
.muted { color: var(--muted); font-size: 13px; line-height: 18px; }
.note { color: var(--muted); font-size: 12px; line-height: 17px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 8px 12px; border-radius: var(--control-radius); background: var(--text); color: #fff; }
.skip-link:focus { top: 12px; }

i[data-icon] { display: inline-flex; flex-shrink: 0; width: 16px; height: 16px; }
i[data-icon] svg { width: 100%; height: 100%; }

/* ---------- Controls ---------- */
button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-xl);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; line-height: 18px;
  cursor: pointer; transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 160ms var(--ease-out);
}
/* Primary buttons (dashboard Button default): blue-600, shadow-sm and a faint blue ring. */
button:not([class]), button.full:not(.secondary), .answer-button, .call-button { box-shadow: var(--shadow-sm), 0 0 0 1px rgba(37, 99, 235, .1); }
/* The interface heard you: a subtle press, never on disabled controls. */
button:active:not(:disabled) { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { button:hover:not(:disabled) { background: var(--accent-hover); } }
button.secondary { background: var(--surface); border-color: var(--outline-border); color: var(--outline-text); box-shadow: var(--shadow-xs), 0 0 0 1px rgba(229, 231, 235, .4); }
button.secondary:hover:not(:disabled) { background: var(--outline-hover); border-color: var(--outline-border); color: #1f2937; }
button.danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-xs); }
button.danger:hover:not(:disabled) { background: var(--error); }
button:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.text-button { min-height: 32px; padding: 0 6px; background: transparent; color: var(--accent-ink); box-shadow: none; }
.text-button:hover:not(:disabled) { background: var(--accent-soft); }
.text-button:disabled { background: transparent; color: var(--muted); }
.icon-button { width: 32px; min-height: 32px; padding: 0; border-radius: 10px; }
.full { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

label { font-size: 13px; font-weight: 500; }
.field { display: grid; gap: 6px; }
/* Inputs: flat, inset, text cursor. You type here. */
input, select {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--input-border); border-radius: var(--radius-xl);
  background: var(--surface); font-size: 14px; font-weight: 400; color: var(--text); cursor: text;
  box-shadow: var(--shadow-xs); transition: border-color 140ms ease, box-shadow 140ms ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
input:focus-visible, select:focus-visible { outline: none; }
select { padding-right: 32px; }
input::placeholder { color: #8796aa; }
input:disabled, select:disabled { background-color: var(--subtle); color: var(--muted); border-color: var(--border-strong); cursor: not-allowed; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=range] { height: 24px; padding: 0; border: 0; accent-color: var(--accent); background: transparent; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--subtle); color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.badge.ready { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.badge.ready::before, .badge.warning::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warning { background: var(--warning-soft); border-color: var(--warning-line); color: var(--warning); }
body[data-connection=reconnect] #connection-badge, body[data-connection=signed-out] #connection-badge { background: var(--warning-soft); border-color: var(--warning-line); color: var(--warning); }

/* ---------- Shell ---------- */
.shell { position: relative; display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; display: flex; flex-direction: column; height: 100dvh; padding: 16px 12px 12px;
  border-right: 1px solid var(--border); background: var(--canvas); overflow-y: auto;
}
.brand { display: inline-flex; align-items: center; gap: 9px; padding: 4px 8px; color: var(--text); font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; color: var(--accent-ink); }
.brand svg { flex-shrink: 0; }
.workspace-name { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 13px; font-weight: 500; line-height: 17px; }
.workspace-name small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.workspace-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.nav-label { margin: 20px 10px 6px; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 2px; }
.nav-item { position: relative; justify-content: flex-start; width: 100%; min-height: 36px; padding: 0 10px; gap: 10px; background: transparent; color: var(--muted); font-size: 14px; }
.nav-item i[data-icon] { width: 18px; height: 18px; }
.nav-item { border-radius: var(--control-radius); box-shadow: none; }
.nav-item:hover:not(:disabled) { background: var(--nav-hover); color: var(--text); }
.nav-item.selected, .nav-item.selected:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); }
.nav-item.selected::after { content: ''; width: 4px; height: 16px; margin-left: auto; flex-shrink: 0; border-radius: 4px; background: var(--accent); }
.nav-item.selected i[data-icon] { color: var(--accent-ink); }
.nav-live { display: none; width: 8px; height: 8px; margin-left: 2px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.nowrap { white-space: nowrap; }
body[data-call-active=true] .nav-live { display: inline-block; }
body[data-call-state=ringing] .nav-live { display: inline-block; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body[data-call-state=held] .nav-live { background: #d97706; box-shadow: 0 0 0 3px var(--warning-soft); }
.sidebar-bottom { display: grid; gap: 8px; margin-top: auto; padding-top: 16px; }
.sidebar-card { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.sidebar-card p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 17px; }
.pilot-label { color: var(--accent-ink); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.quiet-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--muted); font-size: 13px; }
.quiet-link:hover { color: var(--text); text-decoration: none; }

main { display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
main:focus { outline: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 var(--gutter); border-bottom: 1px solid var(--border); }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb span { margin: 0 6px; color: var(--border-strong); }
.breadcrumb strong { color: var(--text); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 600; }

.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px var(--gutter) 12px; }
.page-heading h1 { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.page-heading p { margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 18px; }
.page-heading > button { flex-shrink: 0; min-height: 32px; padding: 0 12px; font-size: 13px; }
/* The Phone page needs its height; the breadcrumb and nav already say "Phone". */
body:has(#calling-view:not([hidden])) .page-heading { display: none; }
.call-presence:not([hidden]) ~ #status { margin-top: 0; }
.topbar-button { min-height: 30px; padding: 0 10px; font-size: 13px; }
body:has(#settings-view:not([hidden])) .topbar-button { display: none; }
/* During a call the calling view needs the height; the presence bar carries the context. */
body[data-call-active=true]:has(#calling-view:not([hidden])) .page-heading { display: none; }
body[data-call-active=true]:has(#calling-view:not([hidden])) .call-presence { margin-bottom: 12px; }

.notice { display: flex; gap: 8px; margin: 12px var(--gutter) 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--control-radius); background: var(--subtle); color: var(--muted); font-size: 13px; line-height: 18px; }
.notice::before { content: ''; flex-shrink: 0; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.notice.error { border-color: var(--error-line); background: var(--error-soft); color: var(--error); }
.notice.error::before { background: var(--error); }
.notice:empty { display: none; }

/* ---------- Persistent call presence (every view) ---------- */
.call-presence {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; margin: 12px var(--gutter) 12px; padding: 8px 8px 8px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--panel-radius); background: var(--subtle); color: var(--text);
}
.call-presence > div { flex: 1; min-width: 0; }
.call-presence strong { display: block; font-size: 14px; font-weight: 600; }
#presence-detail { display: block; color: var(--muted); font-size: 12px; line-height: 16px; overflow-wrap: anywhere; }
#presence-clock { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.call-presence button { min-height: 34px; }
.presence-dot, .call-avatar { position: relative; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); }
.presence-dot { width: 34px; height: 34px; }
.presence-dot i, .call-avatar i { grid-area: 1 / 1; }
.icon-held { display: none !important; }
body[data-call-state=held] .icon-phone { display: none !important; }
body[data-call-state=held] .icon-held { display: inline-flex !important; }

body[data-call-state=ringing] .call-presence { border-color: var(--accent-line); background: var(--accent-soft); }
body[data-call-state=ringing] .presence-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
body[data-call-state=connecting] .presence-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 700ms linear infinite; }
body[data-call-state=live] .call-presence { border-color: var(--success-line); background: var(--success-soft); }
body[data-call-state=live] .presence-dot { border-color: var(--success); background: var(--success); color: #fff; }
body[data-call-state=live] .presence-dot::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--success); animation: pulse 2s ease-out infinite; }
body[data-call-state=live] #presence-clock { color: var(--success); }
body[data-call-state=held] .call-presence { border-color: var(--warning-line); background: var(--warning-soft); }
body[data-call-state=held] .presence-dot { border-color: #d97706; background: #d97706; color: #fff; }
body[data-call-state=held] #presence-clock, body[data-call-state=held] #presence-state { color: var(--warning); }
body[data-call-state=ending] .call-presence { opacity: .85; }
/* Already looking at the call: the shortcut is redundant. Ringing has its own card. */
body:has(#calling-view:not([hidden])) #show-current-call, body[data-call-state=ringing] #show-current-call { display: none; }

/* ---------- Calling workspace ---------- */
.workspace-grid {
  display: grid; grid-template-columns: 288px minmax(0, 1fr) 304px; margin: 0 var(--gutter) var(--gutter);
  border: 1px solid var(--border); border-radius: var(--panel-radius); background: var(--surface); overflow: clip;
}
body[data-call-active=true] .workspace-grid, body[data-call-state=ringing] .workspace-grid { grid-template-columns: minmax(0, 1fr) 304px; }
body[data-call-active=true] .call-sidebar, body[data-call-state=ringing] .call-sidebar { display: none; }
/* The incoming card and the ended card replace the call header in those states. */
body[data-call-state=ringing] .conversation-header, body[data-call-state=ended] .conversation-header { display: none; }
body[data-call-state=ended] #call-ended { order: -1; }
body[data-call-state=ringing]:has(#calling-view:not([hidden])) .page-heading,
body[data-call-state=ringing]:has(#calling-view:not([hidden])) .call-presence { display: none !important; }
body[data-call-state=ringing] .workspace-grid { margin-top: 4px; }

.call-sidebar { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); background: var(--subtle); }
.dial-section { display: grid; gap: 12px; padding: 16px 18px; }
.handoff-section { padding: 12px 18px 16px; border-top: 1px solid var(--border); }
/* Your line: a stacked selector like the workspace card — icon, small label over the number, ⇅. */
.caller-card { display: block; }
.combobox-trigger.stacked { justify-content: flex-start; height: 54px; padding: 0 8px 0 10px; gap: 10px; }
.combobox-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.combobox-icon svg { width: 16px; height: 16px; }
.combobox-stack { display: grid; flex: 1; min-width: 0; text-align: left; }
.combobox-prefix { color: var(--muted); font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: .02em; }
.combobox-stack .combobox-value { font-size: 15px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.combobox-trigger.stacked:disabled .combobox-icon { background: var(--hover); color: var(--muted); }
/* Move a call: a clear card. The picker appears only when RingCentral reports a call. */
.handoff-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--panel-radius); background: var(--surface); }
.handoff-intro { display: flex; align-items: flex-start; gap: 10px; }
.handoff-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); }
.handoff-icon i[data-icon] { width: 17px; height: 17px; }
.handoff-intro h2 { font-size: 14px; line-height: 19px; font-weight: 600; }
.handoff-intro .note { margin-top: 2px; }
.handoff-actions { display: grid; gap: 6px; }
.handoff-actions button { min-height: 34px; font-size: 13px; }
#refresh-calls[aria-busy=true] i[data-icon] { animation: spin 700ms linear infinite; }
.handoff-picker { display: grid; gap: 8px; transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
@starting-style { .handoff-picker { opacity: 0; transform: translateY(-4px); } }
.handoff-section:not(:has(#existing-call option:not([value='']))) .handoff-picker { display: none; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { font-size: 15px; line-height: 20px; font-weight: 600; }
.section-heading > i { color: var(--muted); }
.dial-section #number { height: 46px; padding-right: 44px; border-radius: 12px; font-size: 19px; font-weight: 500; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.dial-section #number::placeholder { font-size: 15px; font-weight: 400; letter-spacing: 0; }
.number-field { position: relative; display: block; }
.backspace-button { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 34px; min-height: 34px; background: transparent; color: var(--muted); }
.backspace-button:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.backspace-button:active:not(:disabled) { transform: translateY(-50%) scale(0.94); }
.backspace-button:disabled { opacity: 0; pointer-events: none; }
.backspace-button i[data-icon] { width: 18px; height: 18px; }
/* Dial pad: tap or type; both edit the same formatted field. */
.dial-pad { --key: 50px; display: grid; grid-template-columns: repeat(3, var(--key)); justify-content: center; column-gap: 22px; row-gap: 7px; }
.dial-pad button { flex-direction: column; gap: 0; width: var(--key); height: var(--key); min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--nav-hover); color: var(--text); box-shadow: none; font-weight: 400;
  transition: background-color 120ms ease, transform 120ms var(--ease-out); }
.dial-pad button:active:not(:disabled) { background: #d9e6fd; color: var(--accent-ink); transform: scale(0.94); }
@media (hover: hover) and (pointer: fine) { .dial-pad button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); } }
.dial-pad span { font-size: 21px; line-height: 23px; font-weight: 400; font-variant-numeric: tabular-nums; }
.dial-pad small { color: var(--muted); font-size: 8px; line-height: 10px; font-weight: 600; letter-spacing: .14em; }

.call-button { min-height: 44px; font-size: 15px; }
.call-button i[data-icon] { width: 18px; height: 18px; }
.handoff-section #move-call { min-height: 38px; }
.headset-tip { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 12px; line-height: 17px; }
.headset-tip i { color: var(--accent-ink); margin-top: 1px; }

.conversation-pane { display: flex; flex-direction: column; min-width: 0; background: var(--surface); container-type: inline-size; }
/* Scrolling panes contain their positioned children (screen-reader text, hidden selects), so nothing
   inside a pane can stretch the page and make the whole app scroll. */
.call-sidebar, .conversation-pane, .listening-pane, main { position: relative; }

/* Incoming: a single, dominant decision. */
.incoming-box { display: none; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 16px; padding: 18px 18px 18px 20px; border: 1px solid var(--accent-line); border-radius: 14px; background: linear-gradient(180deg, #f3f7ff, var(--accent-soft)); }
body[data-call-state=ringing] .incoming-box.ringing { display: flex; }
.ring-icon { position: relative; display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; background: var(--accent); color: #fff; }
.ring-icon i[data-icon] { width: 22px; height: 22px; animation: wiggle 1.2s ease-in-out infinite; }
.ring-icon::before, .ring-icon::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: ring 1.8s ease-out infinite; }
.ring-icon::after { animation-delay: .9s; }
.incoming-text { flex: 1 1 220px; min-width: 0; }
.incoming-more { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 4px 0 0 -6px; }
.incoming-more .text-button { min-height: 28px; font-size: 13px; }
.incoming-more i[data-icon] { width: 15px; height: 15px; }
.incoming-kicker { display: block; color: var(--accent-ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
#incoming { margin-top: 2px; font-size: 17px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.incoming-actions { display: flex; gap: 8px; flex-shrink: 0; }
.incoming-actions button { min-height: 44px; padding: 0 18px; font-size: 15px; }
.decline-button { color: var(--error) !important; }
.decline-button:hover:not(:disabled) { background: var(--error-soft) !important; border-color: var(--error-line) !important; }

.conversation-header { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); box-shadow: inset 0 3px 0 transparent; }
.call-avatar { width: 40px; height: 40px; }
.call-avatar i[data-icon] { width: 18px; height: 18px; }
.call-identity { flex: 1; min-width: 0; }
.call-identity h2 { font-size: 17px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.call-identity p { color: var(--muted); font-size: 13px; line-height: 18px; }
.state-chips span { display: none; align-items: center; gap: 6px; height: 20px; margin-bottom: 2px; padding: 0 8px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.state-chips span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
body[data-call-state=ringing] .state-chips [data-state=ringing],
body[data-call-state=connecting] .state-chips [data-state=connecting], body[data-call-state=live] .state-chips [data-state=live],
body[data-call-state=held] .state-chips [data-state=held], body[data-call-state=ending] .state-chips [data-state=ending],

.call-clock { color: var(--muted); font-size: 20px; line-height: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
body:not([data-call-state=live]):not([data-call-state=held]) .call-clock { display: none; }

body[data-call-state=ringing] .conversation-header { box-shadow: inset 0 3px 0 var(--accent); }
body[data-call-state=ringing] .state-chips [data-state=ringing] { background: var(--accent-soft); color: var(--accent-ink); }
body[data-call-state=connecting] .conversation-header { box-shadow: inset 0 3px 0 var(--accent-line); }
body[data-call-state=connecting] .state-chips [data-state=connecting] { background: var(--accent-soft); color: var(--accent-ink); }
body[data-call-state=connecting] .call-avatar::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 700ms linear infinite; }
body[data-call-state=live] .conversation-header { box-shadow: inset 0 3px 0 var(--success); }
body[data-call-state=live] .state-chips [data-state=live] { background: var(--success-soft); color: var(--success); }
body[data-call-state=live] .call-avatar { border-color: var(--success); background: var(--success); color: #fff; }
body[data-call-state=live] .call-clock { color: var(--text); }
body[data-call-state=held] .conversation-header { box-shadow: inset 0 3px 0 #d97706; background: var(--warning-soft); }
body[data-call-state=held] .state-chips [data-state=held] { background: #fdecd3; color: var(--warning); }
body[data-call-state=held] .call-avatar { border-color: #d97706; background: #d97706; color: #fff; }
body[data-call-state=held] .call-clock, body[data-call-state=held] #call-subtitle { color: var(--warning); }
body[data-call-state=held] #transcripts { opacity: .6; }
/* Idle: a quiet identity row. The avatar carries phone health (green ready, amber offline). */
body:not([data-call-active=true]):not([data-call-state=ringing]) .conversation-header { padding: 12px 20px; }
body:not([data-call-active=true]):not([data-call-state=ringing]) .call-identity h2 { font-size: 15px; line-height: 20px; }
body[data-call-state=idle] .call-avatar { width: 36px; height: 36px; }
body[data-call-state=idle][data-connection=ready] .call-avatar { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
body[data-call-state=idle][data-connection=ready] .call-avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--success); border: 2px solid var(--surface); }
body[data-call-state=idle][data-connection=reconnect] .call-avatar { border-color: var(--warning-line); background: var(--warning-soft); color: var(--warning); }
body[data-call-state=idle][data-connection=connecting] .call-avatar::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 700ms linear infinite; }

.language-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 16px 10px 20px; border-bottom: 1px solid var(--border); background: var(--subtle); transition: background-color 160ms ease; }
body[data-translation=on] .language-bar, body[data-translation=default-on] .language-bar { background: #f3f7ff; }
.language-pair { display: flex; align-items: center; gap: 6px; }
.language-pair label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.language-pair .label-long { display: none; }
.language-pair select { width: auto; min-width: 108px; max-width: 190px; height: 32px; font-size: 13px; font-weight: 500; color: var(--text); }
.swap-button { width: 28px; min-height: 28px; border-color: transparent; background: transparent; color: var(--muted); }
.swap-button:hover:not(:disabled) { border-color: var(--border-strong); }
.swap-button i[data-icon] { width: 15px; height: 15px; }

/* Translation switch: the one control that turns translation on or off. */
.translate-switch { gap: 8px; min-height: 36px; padding: 0 12px 0 6px; border: 1px solid var(--outline-border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-xs); }
.translate-switch:hover:not(:disabled) { background: var(--surface); border-color: var(--control-border); }
.switch-track { position: relative; width: 40px; height: 24px; flex-shrink: 0; border-radius: 999px; background: var(--input-border); transition: background-color 180ms ease; }
.switch-thumb { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform 220ms var(--ease-out); }
.translate-switch[aria-checked=true] .switch-track { background: var(--accent); }
.translate-switch[aria-checked=true] .switch-thumb { transform: translateX(16px); }
.switch-state { min-width: 0; padding: 1px 7px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; }
body[data-translation=on] .translate-switch, body[data-translation=default-on] .translate-switch { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
body[data-translation=on] .switch-state, body[data-translation=default-on] .switch-state { background: var(--accent); color: #fff; }
body[data-translation=starting] .switch-track, body[data-translation=switching] .switch-track { background: var(--accent-line); }
body[data-translation=starting] .switch-thumb, body[data-translation=switching] .switch-thumb { animation: thumb-wait 900ms ease-in-out infinite alternate; }
body[data-translation=starting] .switch-state, body[data-translation=switching] .switch-state { background: var(--accent-soft); color: var(--accent-ink); }
body[data-translation=paused] .translate-switch { border-color: var(--warning-line); background: var(--warning-soft); color: var(--warning); }
body[data-translation=paused] .switch-track { background: #d97706; }
body[data-translation=paused] .switch-state { background: #fdecd3; color: var(--warning); }

/* Translation style: segmented, beside the switch it modifies. */
.mode-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: 9px; background: var(--hover); }
.mode-switch::before { content: ''; position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 7px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 36, 59, .12), 0 0 0 1px var(--border); transition: transform 240ms var(--ease-out), opacity 160ms ease; }
.mode-switch:has(#mode-interpreter[aria-pressed=true])::before { transform: translateX(100%); }
body[data-mode=custom] .mode-switch::before { opacity: 0; }
.mode-option { position: relative; z-index: 1; min-height: 32px; padding: 0 12px; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; }
.mode-option:hover:not(:disabled), .mode-option:active:not(:disabled) { background: transparent; color: var(--text); }
.mode-option[aria-pressed=true] { color: var(--text); }
body[data-consult-active=true] .language-bar { display: none; }

/* Auto-detect: what we know about the customer's language, in plain words. */
.language-status { display: flex; align-items: flex-start; gap: 10px; margin: 12px 20px 0; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--subtle); transition: background-color 200ms ease, border-color 200ms ease, opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
.language-status strong { display: block; font-size: 13px; line-height: 18px; font-weight: 600; }
.language-status p { margin-top: 1px; color: var(--muted); font-size: 12px; line-height: 17px; }
.detect-icon { position: relative; display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); }
.detect-icon i[data-icon] { width: 15px; height: 15px; }
body[data-detect=waiting] .detect-icon::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--accent-line); animation: pulse 1.8s ease-out infinite; }
body[data-detect=identifying] .language-status { border-color: var(--accent-line); background: var(--accent-soft); }
body[data-detect=identifying] .detect-icon { color: var(--accent-ink); border-color: var(--accent-line); }
body[data-detect=identifying] .detect-icon::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--accent); animation: spin 700ms linear infinite; }
body[data-detect=detected] .language-status { border-color: var(--success-line); background: var(--success-soft); }
body[data-detect=detected] .detect-icon { border-color: var(--success); background: var(--success); color: #fff; }
body[data-detect=detected] .language-status strong { color: var(--success); }
body[data-detect=captions] .language-status, body[data-detect=unavailable] .language-status { border-color: var(--warning-line); background: var(--warning-soft); }
body[data-detect=captions] .language-status strong, body[data-detect=unavailable] .language-status strong { color: var(--warning); }
.call-ended { display: flex; align-items: center; gap: 12px; margin: 16px 20px 0; padding: 12px 12px 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--panel-radius); background: var(--subtle); }
.call-ended > div { flex: 1; min-width: 0; }
.call-ended strong { font-size: 14px; font-weight: 600; }
.call-ended p { margin-top: 2px; color: var(--muted); font-size: 13px; line-height: 18px; }
.ended-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--hover); color: var(--muted); }

.transcript-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 6px; }
.transcript-header h2 { font-size: 13px; line-height: 18px; font-weight: 600; }
#transcripts { flex: 1; min-height: 180px; padding: 0 20px 12px; overflow-y: auto; overscroll-behavior: contain; }
.turn { padding: 10px 0 10px 12px; border-left: 2px solid var(--accent); margin: 8px 0; }
.turn[data-side="0"] { border-left-color: var(--border-strong); }
.turn strong { display: block; color: var(--accent-ink); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .04em; }
.turn[data-side="0"] strong { color: var(--muted); }
.turn p { margin-top: 2px; font-size: 15px; line-height: 22px; }
.turn .original { color: var(--muted); font-size: 13px; line-height: 18px; }
/* No translation to show (yet): a quiet note instead of a translated line. */
.turn p.muted { color: var(--muted); font-size: 13px; line-height: 18px; font-style: italic; }
.turn-note { display: flex; align-items: center; gap: 10px; margin: 12px 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.turn-note::before, .turn-note::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 100%; padding: 24px 16px; color: var(--muted); text-align: center; }
p.empty { font-size: 14px; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.empty-icon i[data-icon] { width: 22px; height: 22px; }
.empty h3 { color: var(--text); font-size: 16px; line-height: 22px; font-weight: 600; }
.empty p { max-width: 380px; font-size: 13px; line-height: 19px; }
.privacy-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.privacy-note i[data-icon] { width: 14px; height: 14px; }

.transcript-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; padding: 2px 14px 2px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.transcript-footer .text-button { font-size: 13px; }
.workflow-banner { padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: var(--panel-radius); background: var(--accent-soft); }
.workflow-banner > strong { font-size: 14px; font-weight: 600; }
.workflow-banner p { margin: 6px 0 12px; font-size: 13px; line-height: 19px; }
#consultation { flex-shrink: 0; margin: 8px 16px; }
.consult-ready { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 500; }

.call-dock { position: sticky; bottom: 0; z-index: 5; flex-shrink: 0; padding: 10px 16px 8px; border-top: 1px solid var(--border); background: var(--subtle); }
body:not([data-call-active=true]) .call-dock, body:not([data-call-active=true]) .transcript-footer { display: none; }
.call-toolbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tool-button {
  flex-direction: column; gap: 4px; width: 74px; min-height: 56px; padding: 6px 4px; border: 1px solid var(--outline-border);
  border-radius: var(--radius-xl); background: var(--surface); color: var(--outline-text); font-size: 12px; line-height: 14px; font-weight: 500; box-shadow: var(--shadow-xs);
}
.tool-button i[data-icon] { width: 18px; height: 18px; }
.tool-button:hover:not(:disabled) { background: var(--outline-hover); }
.tool-button[aria-pressed=true] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
body[data-call-state=held] #hold { background: var(--warning-soft); border-color: #e3a65a; color: var(--warning); }
.tool-button.recording { background: var(--error-soft); border-color: var(--error-line); color: var(--error); }
.tool-button.danger { width: 92px; margin-left: 8px; background: var(--danger); border-color: var(--danger); color: #fff; }
.tool-button.danger:hover:not(:disabled) { background: var(--error); border-color: var(--error); }
.tool-button:disabled { opacity: .4; }
.tool-button.danger:disabled { opacity: .5; }
.control-status { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 16px; text-align: center; }
.control-status.error { color: var(--error); }

/* ---------- Listening pane ---------- */
.listening-pane { min-width: 0; padding: 16px; border-left: 1px solid var(--border); background: var(--subtle); overflow-y: auto; }
.listening-pane details > * + * { margin-top: 12px; }
.listening-pane summary { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font-size: 15px; font-weight: 600; border-radius: 6px; }
.listening-pane summary::-webkit-details-marker { display: none; }
.listening-pane summary::after { content: ''; width: 7px; height: 7px; margin: -3px 4px 0 auto; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform 160ms ease; }
.listening-pane details:not([open]) summary::after { transform: rotate(-45deg); margin-top: 0; }
.listening-pane summary i { color: var(--muted); }
.listening-pane details > .muted { margin-top: 4px; font-size: 12px; line-height: 17px; }
.mode-explainer p { display: none; padding: 10px 12px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 12px; line-height: 17px; }
.mode-explainer strong { display: block; margin-bottom: 2px; color: var(--accent-ink); font-size: 13px; font-weight: 600; }
body[data-mode=translator] [data-mode-desc=translator], body[data-mode=interpreter] [data-mode-desc=interpreter], body[data-mode=custom] [data-mode-desc=custom] { display: block; }
body[data-mode=custom] [data-mode-desc=custom] { border-color: var(--border); background: var(--surface); }
body[data-mode=custom] [data-mode-desc=custom] strong { color: var(--text); }
.plain-note { display: none; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 17px; }
.plain-note i[data-icon] { margin-top: 1px; color: var(--success); }
body[data-translation=off] .plain-note { display: flex; }
body[data-translation=off] .mix-grid { opacity: .6; }
.mix-grid { display: grid; gap: 10px; }
.mix-card { display: grid; gap: 4px; min-width: 0; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.mix-card legend { float: left; width: 100%; padding: 0; font-size: 13px; font-weight: 600; }
.mix-card legend + * { clear: both; }
.mix-card > .note { margin: -2px 0 6px; }
.mix-card label:not(.check) { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--text); font-size: 12px; font-weight: 500; }
.mix-card output { margin-left: auto; color: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* A word for the number, so 10% reads as "Faint" — the same word the Translator description uses. */
.level-word { min-width: 50px; padding: 1px 7px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 600; text-align: center; }

/* ---------- What's playing: four live lanes over the transcript ---------- */
.audio-activity { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 2px 20px 8px; }
body[data-call-active=true] .audio-activity { display: grid; }
.activity-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding: 6px; border: 1px solid var(--border); border-radius: var(--panel-radius); background: var(--subtle); }
.activity-heading { flex-basis: 100%; padding: 0 4px 2px; color: var(--muted); font-size: 10px; line-height: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.lane { display: inline-flex; flex: 1 1 0; align-items: center; gap: 7px; min-width: 0; height: 30px; padding: 0 9px 0 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.lane-label { overflow: hidden; font-size: 12px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.lane-state { margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 10px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.lane-state:empty { display: none; }
.lane-wait { display: none; align-items: center; gap: 4px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--surface); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line);
  font-size: 10px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.lane-wait::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.2s ease-in-out infinite; }
.lane[data-waiting=true]:not([data-silenced=true]) .lane-wait { display: inline-flex; }
.lane[data-waiting=true]:not([data-silenced=true]) { border-color: var(--accent-line); border-style: dashed; }
@keyframes pulse-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.lane-bars { display: inline-flex; align-items: center; gap: 2px; height: 16px; flex-shrink: 0; }
/* Bars scale from the middle; JS writes scaleY each frame, so no transition (it would lag the audio). */
.lane-bars i { width: 3px; height: 16px; border-radius: 2px; background: currentColor; opacity: .35; transform: scaleY(.16); transform-origin: center; }
.lane[data-silenced=true] { border-style: dashed; background: transparent; }
.lane[data-silenced=true] .lane-bars i { opacity: .2; }
/* Real voices are slate; translations are TalkTool blue. Lit while audible. */
.lane[data-active=true] { border-color: var(--border-strong); color: var(--text); }
.lane[data-active=true] .lane-bars i { opacity: .9; }
.lane.translation[data-active=true] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-ink); }
@container (max-width: 560px) { .audio-activity { grid-template-columns: minmax(0, 1fr); } }

/* The caption being spoken right now gets a small equalizer: "Playing to customer". */
.turn-playing { display: none; align-items: center; gap: 2px; margin-left: 8px; padding: 0 7px 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
  font-size: 10px; line-height: 16px; font-weight: 600; letter-spacing: .02em; text-transform: none; vertical-align: 1px; }
.turn-playing i { width: 2px; height: 9px; margin-right: 1px; border-radius: 1px; background: currentColor; transform-origin: bottom; animation: playing 900ms ease-in-out infinite; }
.turn-playing i:nth-child(2) { animation-delay: -300ms; }
.turn-playing i:nth-child(3) { margin-right: 4px; animation-delay: -600ms; }
.turn.speaking .turn-playing { display: inline-flex; }
/* Interpreter timing: the translation is ready and waits for its speaker to finish. */
.turn-queued { display: none; margin-left: 8px; padding: 0 7px; border-radius: 999px; color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line);
  font-size: 10px; line-height: 16px; font-weight: 600; letter-spacing: .02em; text-transform: none; vertical-align: 1px; }
.turn.queued .turn-queued { display: inline-flex; }
.turn.queued { border-left-style: dashed; }
.turn { transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out), background-color 200ms ease, border-color 200ms ease; }
.turn.speaking { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
@keyframes playing { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---------- Guided level sliders ---------- */
.level { display: grid; grid-template-columns: 16px minmax(0, 1fr) 16px; align-items: start; gap: 8px; margin-top: 6px; }
.level-icon { display: grid; place-items: center; height: 20px; color: var(--muted); }
.level-icon svg { width: 16px; height: 16px; }
.level[data-off=true] .level-icon.low { color: var(--accent-ink); }
.level-track { position: relative; padding-bottom: 18px; }
input[type=range].level-input {
  --fill: 0%; display: block; width: 100%; height: 20px; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; cursor: pointer; -webkit-appearance: none; appearance: none;
}
.level-input::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(to right, var(--accent) 0 var(--fill), var(--border) var(--fill) 100%); }
.level-input::-moz-range-track { height: 6px; border-radius: 999px; background: var(--border); }
.level-input::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--accent); }
.level-input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border: 1px solid var(--input-border); border-radius: 50%; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform 140ms var(--ease-out), box-shadow 140ms ease; }
.level-input::-moz-range-thumb { width: 18px; height: 18px; border: 1px solid var(--input-border); border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform 140ms var(--ease-out), box-shadow 140ms ease; }
/* Pressing the thumb grows it a touch: you're holding something. Keyboard changes stay instant. */
.level-input:active::-webkit-slider-thumb { transform: scale(1.15); }
.level-input:active::-moz-range-thumb { transform: scale(1.15); }
.level-input:focus { box-shadow: none; }
.level-input:focus-visible { outline: none; }
.level-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--ring), var(--shadow-sm); border-color: var(--accent); }
.level-input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--ring), var(--shadow-sm); border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .level-input:hover::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(37, 99, 235, .1), var(--shadow-sm); } }
.level-input:disabled { cursor: not-allowed; }
/* Checkpoints sit under the thumb's travel (inset by its radius) so 0% and 100% line up exactly. */
.level-ticks { position: absolute; top: 22px; left: 9px; right: 9px; height: 16px; }
.level-tick { position: absolute; top: 0; width: 2px; height: 5px; margin-left: -1px; border-radius: 1px; background: var(--border-strong); }
.level-tick.passed { background: var(--accent-line); }
.level-tick.labeled { cursor: pointer; }
.level-tick.labeled::before { content: ''; position: absolute; inset: -4px -12px -12px; } /* a comfortable click target */
.level-tick.labeled::after { content: attr(data-label); position: absolute; top: 6px; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 10px; line-height: 11px; font-weight: 500; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .level-tick.labeled:hover::after { color: var(--accent-ink); } }
@media (prefers-reduced-motion: reduce) { .level-input:active::-webkit-slider-thumb, .level-input:active::-moz-range-thumb { transform: none; } }
.mix-card .check { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.listening-note { margin-top: 10px; }

.return-help { display: flex; gap: 12px; margin: 0 var(--gutter) var(--gutter); }
.return-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--surface); color: var(--accent-ink); border: 1px solid var(--accent-line); }
.return-body { flex: 1; min-width: 0; }
#return-code { padding: 1px 6px; border-radius: 6px; background: var(--surface); font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- History, directory, settings ---------- */
.content-view { padding: 0 var(--gutter) var(--gutter); }
.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.view-toolbar > p { color: var(--muted); font-size: 13px; }
#directory-status { margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.view-note { margin-top: 10px; }
.search-field { position: relative; display: block; flex: 1; max-width: 420px; }
.search-field i[data-icon] { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field input { height: 36px; padding-left: 34px; }
.record-list { border: 1px solid var(--border); border-radius: var(--panel-radius); overflow: hidden; background: var(--surface); }
.record-list:empty { display: none; }
#directory-list:not(:has(.record-row)) { padding: 16px; color: var(--muted); font-size: 13px; }
.record-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: var(--subtle); }
.row-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--hover); color: var(--muted); }
.row-icon svg { width: 16px; height: 16px; }
.row-icon[data-icon=record] { background: var(--error-soft); color: var(--error); }
.row-content { flex: 1; min-width: 0; }
.row-content strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.row-content p { margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 16px; overflow-wrap: anywhere; }
.record-row button { min-height: 32px; padding: 0 12px; font-size: 13px; }
#recording-player { display: grid; gap: 8px; margin-bottom: 12px; }
#recording-player p { margin: 0; }
#recording-audio { width: min(100%, 560px); }
#recording-player .text-button { justify-self: start; }
#directory-more { margin-top: 12px; }

.settings-view { max-width: 760px; }
.settings-group { display: grid; gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.settings-group:first-of-type { padding-top: 4px; }
.settings-group:last-child { border-bottom: 0; }
.group-heading h2 { font-size: 15px; line-height: 20px; font-weight: 600; }
.group-heading p { margin-top: 2px; }
#account { color: var(--muted); font-size: 13px; }
.settings-group > button { justify-self: start; }
#test-result { margin: 0; max-height: 280px; padding: 12px; overflow: auto; border: 1px solid var(--border); border-radius: var(--control-radius); background: var(--subtle); font-size: 12px; line-height: 18px; white-space: pre-wrap; }
#test-result:empty { display: none; }
.settings-view details { font-size: 13px; }
.settings-view details summary { width: fit-content; cursor: pointer; color: var(--accent-ink); font-weight: 500; }
.settings-view details p { margin: 8px 0 6px; color: var(--muted); }
code { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--subtle); border: 1px solid var(--border); font-size: 12px; word-break: break-all; }
body[data-connection=ready] #connect, body[data-connection=ready] #register { display: none; }

/* ---------- Sign-in (signed out) ---------- */
.signin-intro { display: none; }
body[data-connection=signed-out] .sidebar,
body[data-connection=signed-out] .topbar,
body[data-connection=signed-out] .page-heading,
body[data-connection=signed-out] #status:not(.error),
body[data-connection=signed-out] .audio-group,
body[data-connection=signed-out] .about-group,
body[data-connection=signed-out] #connection-heading,
body[data-connection=signed-out] #account,
body[data-connection=signed-out] #register,
body[data-connection=signed-out] #logout { display: none; }
body[data-connection=signed-out] .shell { grid-template-columns: minmax(0, 1fr); }
body[data-connection=signed-out] main { justify-content: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, #e8f0ff, transparent 70%), var(--canvas); }
body[data-connection=signed-out] #status { width: min(100%, 440px); margin: 0 auto 12px; }
body[data-connection=signed-out] .settings-view {
  width: min(100%, 440px); margin: 0 auto; padding: 32px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--surface); box-shadow: 0 1px 2px rgba(20, 36, 59, .04), 0 12px 32px rgba(20, 36, 59, .08);
}
body[data-connection=signed-out] .signin-intro { display: grid; gap: 10px; }
body[data-connection=signed-out] .content-view.settings-view { flex: 0 0 auto; overflow: visible; }
body[data-connection=signed-out] main { overflow-y: auto; }
body[data-connection=signed-out] .connection-group { padding: 20px 0 0; margin-top: 20px; border-top: 1px solid var(--border); border-bottom: 0; }
body[data-connection=signed-out] #connect { width: 100%; min-height: 44px; font-size: 15px; }
.signin-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); }
.signin-kicker { color: var(--accent-ink); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.signin-intro h2 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.signin-points { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; }
.signin-points li { display: flex; align-items: center; gap: 10px; }
.signin-points i[data-icon] { color: var(--accent-ink); }

/* ---------- Dialog ---------- */
dialog { width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 20px; border: 0; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(20, 36, 59, .22); overflow-y: auto; }
dialog::backdrop { background: rgba(20, 36, 59, .38); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 17px; line-height: 24px; font-weight: 600; }
#dialog-description { margin: 8px 0 14px; }
#dialog-target-group { display: grid; gap: 6px; }
.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.keypad-grid button { min-height: 48px; background: var(--surface); border-color: var(--outline-border); color: var(--outline-text); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-xs); }
.keypad-grid button:hover:not(:disabled) { background: var(--hover); }
#dialog-error { margin-top: 10px; color: var(--error); font-size: 13px; }
#dialog-error:empty { display: none; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---------- Motion ---------- */
/* Occasional state changes get a short entrance (opacity + a few pixels, never
   from scale 0). Exits are instant: the system is responding, so be quick. */
.incoming-box, .call-ended, #consultation, .call-presence, .return-help, #recording-player, .turn, .turn-note {
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style {
  .incoming-box { opacity: 0; transform: translateY(-6px) scale(0.98); }
  .language-status, .call-ended, #consultation, .return-help, #recording-player { opacity: 0; transform: translateY(-4px); }
  .call-presence { opacity: 0; transform: translateY(-6px); }
  .turn, .turn-note { opacity: 0; transform: translateY(4px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes thumb-wait { from { transform: translateX(0); } to { transform: translateX(16px); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes ring { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 10%, 30%, 50% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
/* Reduced motion = no movement, but keep the colour and opacity changes that explain state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  button:active:not(:disabled), .backspace-button:active:not(:disabled) { transform: none; }
  .backspace-button:active:not(:disabled) { transform: translateY(-50%); }
  .switch-thumb, .mode-switch::before { transition: none; }
  .incoming-box, .language-status, .call-ended, #consultation, .call-presence, .return-help, #recording-player, .turn, .turn-note { transform: none !important; }
}
/* Touch screens keep :hover after a tap; drop hover fills so keys don't look stuck. */
@media (hover: none) {
  .tool-button:hover:not(:disabled), button.secondary:hover:not(:disabled) { background: var(--surface); border-color: var(--border); }
  button.secondary:hover:not(:disabled) { border-color: var(--border-strong); }
  .nav-item:not(.selected):hover:not(:disabled), .text-button:hover:not(:disabled) { background: transparent; }
}

/* ---------- App layout: desktop keeps call controls on screen ---------- */
@media (min-width: 1180px) and (min-height: 620px) {
  .shell { height: 100dvh; }
  main { height: 100dvh; overflow: hidden; }
  .workspace-grid { flex: 1; min-height: 0; }
  .call-sidebar, .listening-pane { overflow-y: auto; }
  .conversation-pane { min-height: 0; overflow-y: auto; }
  #transcripts { min-height: 96px; }
  .content-view { flex: 1; min-height: 0; overflow-y: auto; }
  .return-help { flex-shrink: 0; margin-top: -8px; }
}

/* Mid-width: listening controls move below the call. */
@media (max-width: 1179px) {
  .workspace-grid { grid-template-columns: 280px minmax(0, 1fr); }
  body[data-call-active=true] .workspace-grid, body[data-call-state=ringing] .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .listening-pane { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
  .mix-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-switch, .mode-explainer, .plain-note { max-width: 640px; }
}

/* Narrow: the sidebar becomes a top bar; one task pane at a time. */
@media (max-width: 899px) {
  :root { --gutter: 12px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { position: static; flex-direction: row; align-items: center; gap: 8px; height: auto; min-height: 56px; padding: 8px 180px 8px 8px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .workspace-name, .nav-label, .sidebar-bottom { display: none; }
  .brand { padding: 4px 6px; font-size: 17px; }
  .sidebar nav { display: flex; gap: 2px; }
  .nav-item { width: auto; min-height: 40px; padding: 0 10px; }
  .nav-live { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; margin: 0; }
  .nav-item.selected::after { display: none; } /* the blue fill marks the selection in the top bar */
  main { position: static; } /* the top bar sits in the nav row, positioned against the shell */
  .topbar { position: absolute; top: 0; right: 0; min-height: 56px; padding: 0 12px; border: 0; }
  .breadcrumb, .avatar { display: none; }
  .topbar-button { width: 34px; padding: 0; }
  .topbar-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .page-heading { padding: 14px var(--gutter) 10px; }
  .page-heading h1 { font-size: 18px; line-height: 24px; }
  .call-presence { margin: 10px var(--gutter); }
  .workspace-grid, body[data-call-active=true] .workspace-grid, body[data-call-state=ringing] .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .call-sidebar { border-right: 0; }
  .conversation-pane { border-top: 1px solid var(--border); }
  body[data-call-active=true] .conversation-pane, body[data-call-state=ringing] .conversation-pane { order: -1; border-top: 0; }
  body[data-call-state=ringing] .conversation-pane { border-bottom: 1px solid var(--border); }
  /* After a call, the ended card leads; the dialer follows for the next call. */
  body[data-call-state=ended] .conversation-pane { order: -1; border-top: 0; border-bottom: 1px solid var(--border); }
  #transcripts { max-height: max(240px, 55dvh); }
  .call-toolbar { flex-wrap: nowrap; }
  .tool-button { flex: 1 1 0; width: auto; min-width: 0; }
  .tool-button.danger { flex: 1.3 1 0; width: auto; margin-left: 4px; }
}
@media (max-width: 899px) and (min-width: 600px) { .nav-item span { display: inline; } .dial-section, .handoff-section { width: 100%; max-width: 480px; } }
@media (max-width: 599px) {
  .nav-item span { display: none; }
  .brand span { display: none; }
  .sidebar { padding-right: 166px; }
  .mix-grid { grid-template-columns: minmax(0, 1fr); }
  .call-presence { flex-wrap: wrap; gap: 8px 10px; }
  .call-presence > div { flex: 1 1 110px; }
  .call-presence button { flex: 0 0 auto; min-height: 40px; padding: 0 12px; }
  #presence-clock { font-size: 15px; }
  .incoming-box { flex-wrap: wrap; margin: 12px 12px 0; padding: 16px; }
  .incoming-actions { width: 100%; }
  .incoming-actions button { flex: 1; min-height: 48px; }
  .conversation-header { padding: 12px 14px; }
  .language-bar { padding: 10px 14px; }
  .translate-switch { flex: 1 1 auto; justify-content: flex-start; min-height: 44px; }
  .language-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; flex-basis: 100%; order: 1; }
  .language-pair .label-long { display: inline; }
  .mode-option { min-height: 40px; }
  .language-pair label { display: grid; gap: 4px; }
  .language-pair select { width: 100%; min-width: 0; }
  .swap-button { margin-bottom: 2px; }

  .transcript-header, .call-ended { margin-left: 14px; margin-right: 14px; }
  .call-ended { flex-wrap: wrap; }
  .call-ended > div { flex: 1 1 200px; }
  .call-ended .text-button { margin-left: 38px; }
  .transcript-header { padding-left: 0; padding-right: 0; }
  #transcripts { padding: 0 14px 12px; min-height: 200px; }
  .call-dock { padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .call-toolbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .tool-button { min-height: 52px; }
  .tool-button.danger { margin-left: 0; }
  .view-toolbar { flex-wrap: wrap; }
  .search-field { max-width: none; flex-basis: 100%; }
  .record-row { flex-wrap: wrap; gap: 8px 12px; }
  .record-row .row-content { flex: 1 1 150px; }
  .record-row button { margin-left: auto; }
  .dial-section, .handoff-section { padding: 16px 14px; }
  .dial-pad { --key: 62px; column-gap: 28px; row-gap: 10px; }
  /* iOS zooms into any field under 16px on focus. */
  input, select, .language-pair select, .search-field input { font-size: 16px; }
  .language-status { margin: 10px 14px 0; }
  .return-help { flex-direction: column; }
  .workflow-banner .actions button { flex: 1 1 auto; min-height: 44px; }
  body[data-connection=signed-out] .settings-view { padding: 24px 20px; }
}
/* Short landscape: trim vertical chrome, keep End call and transfer actions reachable. */
@media (max-height: 520px) {
  .page-heading { padding-top: 10px; padding-bottom: 8px; }
  .page-heading p { display: none; }
  .call-presence { padding: 6px 6px 6px 8px; }
  .presence-dot { width: 30px; height: 30px; }
  .conversation-header { padding: 10px 16px; }
  .call-avatar { width: 34px; height: 34px; }
  #transcripts { min-height: 140px; }
  .empty { padding: 12px; }
  .empty-icon { display: none; }
  .tool-button { min-height: 46px; padding: 4px 2px; }
  .control-status { margin-top: 4px; }
  .incoming-box { padding: 12px 14px; }
}


/* ---------- Dropdowns: shadcn-style Combobox (raised trigger + ⇅, popover with search) ---------- */
label { position: relative; }
/* The native select stays in the DOM as the source of truth; the trigger replaces it visually. */
select.native-select { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0; margin: 0; border: 0; opacity: 0; pointer-events: none; }
.combobox-trigger {
  justify-content: space-between; gap: 8px; width: 100%; min-width: 0; height: 40px; min-height: 0; padding: 0 8px 0 12px;
  border: 1px solid var(--input-border); border-radius: var(--radius-xl); background: var(--surface);
  color: var(--text); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; box-shadow: var(--shadow-xs);
}
.combobox-trigger:hover:not(:disabled) { background: var(--subtle); }
.combobox-trigger[aria-expanded=true] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.combobox-trigger:disabled { opacity: .5; background: var(--surface); color: var(--text); cursor: not-allowed; }
.combobox-trigger:disabled .combobox-chevron { opacity: .4; }
.combobox-trigger.placeholder .combobox-value { color: var(--muted); font-weight: 400; }
.combobox-value { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.combobox-chevron { display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); }
.combobox-chevron svg { width: 15px; height: 15px; }
.combobox-trigger:hover:not(:disabled) .combobox-chevron { background: var(--hover); color: var(--text); }
.combobox-leading { display: inline-grid; place-items: center; flex-shrink: 0; width: 20px; color: var(--muted); }
.combobox-leading.flag { font-size: 16px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.combobox-leading svg { width: 16px; height: 16px; }
/* Grows to fit a long variant ("Portuguese (Portugal)") or what auto-detect found ("Auto-detect · Spanish"). */
.language-pair .combobox-trigger { width: auto; min-width: 168px; max-width: 228px; height: 34px; font-size: 13px; }

.combobox-popover {
  position: fixed; z-index: 60; display: flex; flex-direction: column; padding: 4px; overflow: hidden;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 16px 40px -12px rgba(20, 36, 59, .28), 0 4px 10px -4px rgba(20, 36, 59, .1);
  transform-origin: top center; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out);
}
.combobox-popover[data-side=top] { transform-origin: bottom center; }
@starting-style { .combobox-popover { opacity: 0; transform: translateY(-4px) scale(0.97); } .combobox-popover[data-side=top] { transform: translateY(4px) scale(0.97); } }
/* Opened from the keyboard: no animation (Emil: never animate keyboard actions). */
.combobox-popover[data-instant=true] { transition: none; }
.combobox-search { display: flex; align-items: center; gap: 8px; margin: -4px -4px 4px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--muted); }
.combobox-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.combobox-search input { height: 42px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 14px; }
.combobox-search input:focus { box-shadow: none; }
.combobox-popover.no-search .combobox-search { display: none; }
.combobox-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; outline: none; scroll-padding: 4px; }
.combobox-group + .combobox-group { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.combobox-group-label, .command-group-label { padding: 6px 8px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.combobox-option { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.combobox-option-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.combobox-option.active { background: var(--accent-soft); color: var(--accent-ink); }
.combobox-option[aria-selected=true] { font-weight: 600; }
.combobox-option[aria-disabled=true] { opacity: .45; cursor: not-allowed; }
.combobox-check { display: grid; place-items: center; width: 16px; color: var(--accent); opacity: 0; }
.combobox-check svg { width: 15px; height: 15px; }
.combobox-option[aria-selected=true] .combobox-check { opacity: 1; }
.combobox-empty { padding: 18px 8px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- Contact search (Command list) ---------- */
.number-wrap { position: relative; }
.number-field .field-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.dial-section #number { padding-left: 38px; }
.command-list { display: grid; gap: 2px; max-height: 300px; margin-top: 8px; padding: 4px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.command-list.overlay { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; max-height: 216px; margin-top: 6px;
  box-shadow: 0 16px 40px -12px rgba(20, 36, 59, .28), 0 4px 10px -4px rgba(20, 36, 59, .1);
  transform-origin: top center; transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out); }
@starting-style { .command-list.overlay { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.command-group + .command-group { margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--border); }
.command-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.command-item.active { background: var(--accent-soft); }
.command-item.active .command-text strong { color: var(--accent-ink); }
.command-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 600; }
.command-avatar.external { background: var(--surface); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border-strong); }
.command-avatar.recent { background: var(--hover); color: var(--muted); font-size: 14px; }
.command-text { display: grid; min-width: 0; }
.command-text strong { overflow: hidden; font-size: 14px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.command-text small { overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.command-empty, .command-note { padding: 12px 8px; color: var(--muted); font-size: 13px; }
.command-note { padding: 6px 8px; border-top: 1px dashed var(--border); font-size: 12px; }
#transfer-results { max-height: 260px; }

/* ---------- Contacts tabs ---------- */
.view-tabs { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 14px; padding: 4px; border-radius: 12px; background: var(--hover); }
.view-tab { flex-direction: column; align-items: flex-start; gap: 0; min-height: 44px; padding: 6px 14px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; text-align: left; }
.view-tab small { color: var(--muted); font-size: 11px; font-weight: 400; }
.view-tab:hover:not(:disabled) { background: rgba(255, 255, 255, .6); color: var(--text); }
.view-tab[aria-selected=true], .view-tab[aria-selected=true]:hover:not(:disabled) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20, 36, 59, .1), 0 0 0 1px var(--border); }

@media (max-width: 599px) {
  .language-pair .combobox-trigger { width: 100%; min-width: 0; max-width: none; height: 44px; padding: 0 6px 0 10px; gap: 6px; font-size: 14px; }
  .combobox-trigger { height: 44px; }
  .combobox-option { min-height: 44px; font-size: 15px; }
  .combobox-search input { font-size: 16px; }
  .view-tabs { display: grid; }
}
@media (prefers-reduced-motion: reduce) { .combobox-popover, .command-list.overlay, .handoff-picker { transform: none !important; } .dial-pad button:active:not(:disabled) { transform: none; } }
