/* VOX wordmark face (brand lockup). Used for the phone top bar. */
@font-face { font-family: "Hudson NY"; src: url("fonts/HudsonNY-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }

/* Colour tokens. Dark is the default; theme.js sets data-theme="light" on <html> for the light look.
   Text pairs are WCAG AA (4.5:1 or better) in both themes. Accent is a calm blue. */
:root {
    color-scheme: dark;
    --vox-bg: #0e0f13;
    --vox-surface: #16171d;
    --vox-text: #ececf1;
    --vox-muted: #9a9ca8;
    --vox-border: #272932;
    --vox-accent: #5b93e0;
    --vox-accent-text: #0b1220;
    --vox-focus: #8fb8ee;
    --vox-rail-bg: #0b0c10;
    --vox-rail-text: #ececf1;
    --vox-rail-muted: #9a9ca8;
    --vox-rail-active: #22242c;
    --vox-row-active: #22242c;
    --vox-pill: #22242c;
    --vox-pill-active: #1d3a63;
    --vox-pill-active-text: #cfe2fa;
    --vox-bubble-in: #262832;
    --vox-bubble-out: #1d3a63;
    --vox-badge-bg: #3a7bd5;
    --vox-badge-text: #ffffff;
    --vox-warning-border: #ecc94b;
    --vox-danger-bg: #3b1717;
    --vox-danger-text: #ffd7d7;
    --vox-danger-border: #fc8181;
    --vox-banner-bg: #3d3112;
    --vox-banner-text: #fbe9a6;
    --vox-backdrop: rgba(0, 0, 0, .6);
    --vox-missed: #f0625a;
    --vox-series-0: #5b93e0;
    --vox-series-1: #e8a33d;
    --vox-series-2: #e26d8e;
    --vox-series-3: #8b93a7;
    --vox-series-4: #4fb3a5;
    --vox-heat-0: #1b1d25;
    --vox-heat-1: #1d3a63;
    --vox-heat-2: #2a5a96;
    --vox-heat-3: #3a7bd5;
    --vox-heat-4: #8fb8ee;
}

[data-theme="light"] {
    color-scheme: light;
    --vox-bg: #f5f7fa;
    --vox-surface: #ffffff;
    --vox-text: #1a202c;
    --vox-muted: #4a5568;
    --vox-border: #cbd5e0;
    --vox-accent: #2b6cb0;
    --vox-accent-text: #ffffff;
    --vox-focus: #2b6cb0;
    --vox-rail-bg: #1f2a44;
    --vox-rail-text: #ffffff;
    --vox-rail-muted: #c3cde0;
    --vox-rail-active: #2f3f66;
    --vox-row-active: #e8eef8;
    --vox-pill: #edf2f7;
    --vox-pill-active: #2b6cb0;
    --vox-pill-active-text: #ffffff;
    --vox-bubble-in: #edf2f7;
    --vox-bubble-out: #d6e4f7;
    --vox-badge-bg: #2b6cb0;
    --vox-badge-text: #ffffff;
    --vox-warning-border: #d69e2e;
    --vox-danger-bg: #fde8e8;
    --vox-danger-text: #742a2a;
    --vox-danger-border: #c53030;
    --vox-banner-bg: #ffe9a8;
    --vox-banner-text: #1a202c;
    --vox-backdrop: rgba(0, 0, 0, .5);
    --vox-missed: #c53030;
    --vox-series-0: #2b6cb0;
    --vox-series-1: #b7791f;
    --vox-series-2: #b83280;
    --vox-series-3: #4a5568;
    --vox-series-4: #2c7a7b;
    --vox-heat-0: #edf2f7;
    --vox-heat-1: #bee3f8;
    --vox-heat-2: #63b3ed;
    --vox-heat-3: #2b6cb0;
    --vox-heat-4: #1a4f8a;
}

html, body { font-family: system-ui, "Segoe UI", sans-serif; margin: 0; background: var(--vox-bg); color: var(--vox-text); }
h1:focus { outline: none; }
:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
svg.vox-icon { width: 1rem; height: 1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.vox-brand { font-weight: 700; letter-spacing: .1em; }
.vox-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Signed-in shell: sidebar on the left, page content on the right. */
.vox-shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.vox-content { min-width: 0; }
.vox-zone-host { display: contents; }

/* Sidebar: profile, primary, workspace, inboxes, footer. */
.vox-sidebar { display: flex; flex-direction: column; gap: .15rem; padding: .9rem .6rem; background: var(--vox-rail-bg); color: var(--vox-rail-text); overflow-y: auto; height: 100vh; position: sticky; top: 0; box-sizing: border-box; }
.vox-profile { display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem .9rem; font-weight: 600; font-size: .95rem; overflow: hidden; }
.vox-profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-sidebar-heading { margin: 1rem .4rem .3rem; font-size: .75rem; color: var(--vox-rail-muted); }
.vox-side-link { display: flex; align-items: center; gap: .65rem; width: 100%; box-sizing: border-box; padding: .45rem .5rem; border: 0; border-radius: .4rem; background: none; color: inherit; font: inherit; font-size: .9rem; text-align: left; text-decoration: none; cursor: pointer; }
.vox-side-link:hover { background: var(--vox-rail-active); }
.vox-side-link.active { background: var(--vox-rail-active); font-weight: 600; }
.vox-side-link:disabled, .vox-side-link.is-disabled { color: var(--vox-rail-muted); cursor: not-allowed; }
.vox-side-link:disabled:hover, .vox-side-link.is-disabled:hover { background: none; }
.vox-side-link svg.vox-icon { color: var(--vox-rail-muted); }
.vox-side-link.active svg.vox-icon, .vox-side-link:hover svg.vox-icon { color: var(--vox-rail-text); }
.vox-inbox-link { align-items: flex-start; }
.vox-inbox-children { margin: 0 0 .25rem 1.1rem; padding-left: .5rem; border-left: 1px solid var(--vox-rail-muted); }
.vox-inbox-children .vox-side-link { padding-left: .6rem; font-size: .85rem; }
.vox-inbox-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vox-inbox-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-inbox-number { font-size: .75rem; color: var(--vox-rail-muted); }
.vox-sidebar-spacer { flex: 1; }
.vox-sidebar-footer { border-top: 1px solid var(--vox-rail-active); padding-top: .6rem; margin-top: .6rem; }
.vox-sidebar-footer .vox-ghost { width: 100%; padding: .4rem .5rem; color: var(--vox-rail-text); font-size: .85rem; }
.vox-feed-status { display: flex; flex-direction: column; gap: .15rem; padding: .2rem .5rem .5rem; font-size: .75rem; color: var(--vox-rail-muted); }
.vox-feed-line { display: flex; align-items: center; gap: .4rem; color: var(--vox-rail-text); }
.vox-feed-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--vox-accent); flex: none; }
.vox-feed-status.is-retrying .vox-feed-dot { background: var(--vox-muted); }
.vox-feed-last { padding-left: .9rem; }
.vox-badge-count { flex: none; min-width: 1.3rem; padding: 0 .4rem; border-radius: 999px; background: var(--vox-badge-bg); color: var(--vox-badge-text); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.25rem; }

/* Three-pane inbox: thread list (with tabs and pills) and conversation. */
.vox-panes { display: grid; grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); height: 100vh; }
.vox-pane { min-width: 0; overflow: auto; background: var(--vox-surface); border-right: 1px solid var(--vox-border); }
.vox-pane-list { display: flex; flex-direction: column; }
.vox-pane-timeline { display: flex; flex-direction: column; }
.vox-pane-placeholder { color: var(--vox-muted); padding: 0 1rem; }
.vox-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; color: var(--vox-muted); }
.vox-empty svg.vox-icon { width: 2.2rem; height: 2.2rem; }

/* Thread list header: tabs, filter pills, rows. */
.vox-list-head { padding: .9rem .9rem .4rem; }
.vox-list-head h1 { font-size: 1rem; margin: 0; }
.vox-tabs { display: flex; gap: 1rem; font-size: .95rem; }
.vox-tab { color: var(--vox-muted); text-decoration: none; padding-bottom: .3rem; }
.vox-tab.active { color: var(--vox-text); font-weight: 700; border-bottom: 2px solid var(--vox-accent); }
.vox-tab.is-disabled { cursor: not-allowed; opacity: .6; }
.vox-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.vox-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .75rem; border-radius: 999px; background: var(--vox-pill); color: var(--vox-muted); font-size: .85rem; text-decoration: none; border: 0; font: inherit; cursor: pointer; }
.vox-pill.active { background: var(--vox-pill-active); color: var(--vox-pill-active-text); }
.vox-pill.is-disabled, .vox-pill:disabled { cursor: not-allowed; opacity: .6; }

.vox-thread-list { list-style: none; margin: .4rem 0 0; padding: 0; }
.vox-thread-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; color: var(--vox-text); text-decoration: none; }
a.vox-thread-row:hover { background: var(--vox-rail-active); }
a.vox-thread-row.active { background: var(--vox-row-active); }
.vox-thread-row.is-disabled { color: var(--vox-muted); }
.vox-thread-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.vox-thread-top, .vox-thread-bottom { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-width: 0; }
.vox-thread-company { display: block; font-size: .75rem; font-weight: 400; color: var(--vox-muted, inherit); opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-thread-name {font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vox-thread-date { flex: none; font-size: .8rem; color: var(--vox-muted); }
.vox-thread-line { display: flex; align-items: center; gap: .3rem; min-width: 0; font-size: .85rem; color: var(--vox-muted); }
.vox-thread-line .vox-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-thread-line.is-missed svg.vox-icon { color: var(--vox-missed); }
.vox-thread-line svg.vox-icon { width: .85rem; height: .85rem; }
.vox-unread { flex: none; min-width: 1.2rem; height: 1.2rem; padding: 0 .35rem; border-radius: 999px; background: var(--vox-badge-bg); color: var(--vox-badge-text); font-size: .75rem; font-weight: 700; line-height: 1.2rem; text-align: center; }

/* Row actions: a hover bar (Call, Mark as done, Mark as read, More) and the More menu. Web with a mouse only. */
@media not all and (hover: hover) and (pointer: fine) {
    .vox-row-actions, .vox-row-menu, .vox-row-backdrop { display: none !important; }
}
body:has(.vox-tabbar) .vox-row-actions, body:has(.vox-tabbar) .vox-row-menu, body:has(.vox-tabbar) .vox-row-backdrop { display: none !important; }
@media (hover: hover) and (pointer: fine) {
    .vox-thread-list > li { position: relative; }
    .vox-row-actions { display: none; position: absolute; top: .5rem; right: .6rem; z-index: 30; align-items: center; gap: .2rem; padding: .2rem; background: var(--vox-surface); border: 1px solid var(--vox-border); border-radius: .6rem; box-shadow: 0 4px 14px var(--vox-backdrop); }
    .vox-thread-list li:hover .vox-row-actions, .vox-thread-list li:has(:focus-visible) .vox-row-actions { display: inline-flex; }
    .vox-row-action { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--vox-muted); cursor: pointer; }
    .vox-row-action:hover:not(:disabled) { background: var(--vox-rail-active); color: var(--vox-text); }
    .vox-row-action:disabled { opacity: .45; cursor: not-allowed; }
    .vox-row-action svg, .vox-row-menu-item svg { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .vox-row-more svg { stroke-width: 3; }
    .vox-row-copied { padding: 0 .4rem; font-size: .75rem; color: var(--vox-muted); white-space: nowrap; }
    .vox-row-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: transparent; }
    .vox-row-menu { display: flex; flex-direction: column; position: absolute; top: 2.6rem; right: .6rem; z-index: 40; min-width: 14rem; padding: .3rem; background: var(--vox-surface); border: 1px solid var(--vox-border); border-radius: .6rem; box-shadow: 0 8px 24px var(--vox-backdrop); }
    .vox-row-menu-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .6rem; border: 0; border-radius: .4rem; background: transparent; color: var(--vox-text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
    .vox-row-menu-item:hover:not([aria-disabled="true"]) { background: var(--vox-rail-active); }
    .vox-row-menu-item[aria-disabled="true"] { color: var(--vox-muted); cursor: not-allowed; }
    .vox-row-menu-item.is-danger { color: var(--vox-missed); }
}

/* Avatars: initials on a hue derived from the name, or a silhouette when there is no name. */
.vox-avatar { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #3a3d48; color: #ffffff; font-weight: 700; font-size: .95rem; overflow: hidden; }
.vox-avatar svg { width: 1.7rem; height: 1.7rem; fill: #c9ccd6; }
.vox-avatar.is-small { width: 2rem; height: 2rem; font-size: .8rem; }
.vox-avatar.is-small svg { width: 1.3rem; height: 1.3rem; }

/* Conversation pane: header, bubbles, call cards. */
.vox-search { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; }
.vox-search-input { flex: 1; min-width: 0; padding: .45rem .6rem; box-sizing: border-box; background: var(--vox-surface); color: var(--vox-text); border: 1px solid var(--vox-border); border-radius: 6px; font: inherit; }
.vox-search-clear { flex: none; font-size: .85rem; color: var(--vox-muted); }
.vox-convo-head { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--vox-border); position: sticky; top: 0; z-index: 2; background: var(--vox-surface); }
.vox-convo-head h1 { font-size: 1rem; margin: 0; }
.vox-convo-body { padding: 1rem 1.1rem; }
.vox-timeline-top { text-align: center; color: var(--vox-muted); font-size: .85rem; padding: .5rem 0; }
.vox-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.vox-bubble-row { display: flex; flex-direction: column; max-width: 75%; }
.vox-bubble-row.is-in { align-self: flex-start; align-items: flex-start; }
.vox-bubble-row.is-out { align-self: flex-end; align-items: flex-end; }
.vox-bubble { padding: .5rem .8rem; border-radius: .9rem; background: var(--vox-bubble-in); color: var(--vox-text); }
.vox-bubble-row.is-out .vox-bubble { background: var(--vox-bubble-out); }
.vox-msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.vox-media-link { margin: .3rem 0 0; overflow-wrap: anywhere; font-size: .85rem; }
.vox-bubble-time { margin-top: .2rem; font-size: .75rem; color: var(--vox-muted); }
.vox-call-row { align-self: center; width: 100%; max-width: 32rem; }
.vox-call { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .5rem .75rem; border: 1px solid var(--vox-border); border-radius: .6rem; background: var(--vox-bubble-in); font-size: .85rem; color: var(--vox-muted); }
.vox-call-meta { display: block; margin-bottom: .2rem; font-size: .75rem; color: var(--vox-muted); text-align: center; }
.vox-badge { padding: .1rem .4rem; border: 1px solid var(--vox-border); border-radius: 999px; font-size: .75rem; }

/* Anonymous sign-in and error pages: plain, centred. */
/* Phone top bar (VOX app): clears the status bar / notch on iOS (viewport-fit=cover), then the brand and the About link. */
.vox-phone-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(env(safe-area-inset-top, 0px) + .6rem) 1rem .6rem; border-bottom: 1px solid var(--vox-border); background: var(--vox-surface); }
.vox-phone-bar a { color: var(--vox-accent); text-decoration: none; padding: .4rem .2rem; }
.vox-auth-layout { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; box-sizing: border-box; padding: 1rem; }

.vox-auth-logo { display: block; margin: 0 auto; width: 180px; height: auto; border-radius: .75rem; }
.vox-auth { max-width: 24rem; width: 100%; margin: 2rem auto; }
.vox-auth label { display: block; margin-top: .75rem; }
.vox-auth input:not([type=checkbox]) { width: 100%; padding: .5rem; box-sizing: border-box; background: var(--vox-surface); color: var(--vox-text); border: 1px solid var(--vox-border); }
.vox-auth button, .vox-modal button { margin: 1rem .5rem 0 0; padding: .5rem 1rem; }
.vox-auth button:not(.vox-ghost), .vox-modal button:not(.vox-ghost) { background: var(--vox-accent); color: var(--vox-accent-text); border: 0; }
.vox-check { display: flex; gap: .5rem; align-items: center; }
.vox-ghost { background: none; color: inherit; border: 1px solid currentColor; }
.vox-alert { margin: 1rem; padding: .6rem 1rem; background: var(--vox-danger-bg); color: var(--vox-danger-text); border: 1px solid var(--vox-danger-border); }
.vox-auth-footer { margin-top: 2rem; font-size: .85rem; color: var(--vox-muted); }
.validation-message { color: var(--vox-danger-text); font-size: .85rem; }

/* Settings page: one field per row, business hours as a compact row. */
.vox-settings-page { padding: 1.5rem; max-width: 40rem; }
.vox-settings fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.vox-settings label { display: block; margin-top: .75rem; }
.vox-settings label.vox-check { display: flex; }
.vox-settings input:not([type=checkbox]), .vox-settings select, .vox-settings textarea { width: 100%; max-width: 32rem; padding: .4rem; box-sizing: border-box; background: var(--vox-surface); color: var(--vox-text); border: 1px solid var(--vox-border); }
.vox-hours-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .5rem; }
.vox-hours-row select, .vox-hours-row input { width: auto; }
.vox-settings button:not(.vox-ghost) { margin: 1rem .5rem 0 0; padding: .5rem 1rem; background: var(--vox-accent); color: var(--vox-accent-text); border: 0; }
.vox-settings-tabs { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0; border-bottom: 1px solid var(--vox-border); }
.vox-settings-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: .4rem 0; color: var(--vox-muted); cursor: pointer; }
.vox-settings-tab[aria-selected=true] { color: var(--vox-text); border-bottom-color: var(--vox-text); }
.vox-dept-list { list-style: none; padding: 0; margin: 1rem 0; }
.vox-dept-list li { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .4rem 0; }
.vox-stub-section { margin-top: 1.5rem; }
.vox-stub-badge { font-size: .7rem; font-weight: normal; padding: .1rem .4rem; border: 1px solid var(--vox-border); color: var(--vox-muted); }
.vox-stub-toggle span { display: flex; flex-direction: column; }
.vox-stub-toggle small { padding: 0; }

.vox-backdrop { position: fixed; inset: 0; background: var(--vox-backdrop); z-index: 900; }
.vox-modal { position: fixed; top: 20%; left: 50%; transform: translateX(-50%); width: min(28rem, 90vw); padding: 1.5rem; background: var(--vox-surface); color: var(--vox-text); border: 2px solid var(--vox-warning-border); z-index: 901; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: .6rem 1rem; background: var(--vox-banner-bg); color: var(--vox-banner-text); z-index: 1000; }
#blazor-error-ui[hidden] { display: none; }

/* Narrow windows (under 1100px) collapse the sidebar to icons and stack the panes. */
@media (max-width: 1100px) {
    .vox-shell { grid-template-columns: 4.5rem minmax(0, 1fr); }
    .vox-sidebar .vox-side-link span, .vox-sidebar .vox-profile-name, .vox-sidebar .vox-sidebar-heading, .vox-sidebar .vox-inbox-text { display: none; }
    .vox-panes { grid-template-columns: minmax(0, 1fr); height: auto; }
    .vox-pane { border-right: 0; border-bottom: 1px solid var(--vox-border); }
}

/* Call card (ATL-627). Model and SMS text keeps its line breaks. */
.vox-call-card { margin-top: .5rem; padding: .75rem; border: 1px solid var(--vox-border); border-radius: .6rem; background: var(--vox-surface); color: var(--vox-text); }
.vox-call-header { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .85rem; color: var(--vox-muted); }
.vox-call-text { white-space: pre-wrap; }
.vox-call-cost { margin: .4rem 0; font-size: .85rem; color: var(--vox-muted); }
.vox-tags { list-style: none; margin: 0 0 .5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.vox-tag { border: 1px solid var(--vox-border); border-radius: 999px; padding: 0 .5rem; color: var(--vox-muted); }
.vox-tag.is-spam { border-color: var(--vox-missed, #f0625a); color: var(--vox-missed, #f0625a); font-weight: 600; }

/* Analytics and activity (reporting components). Colours come from the theme variables above, so both themes follow. */
.vox-analytics, .vox-activity { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem 1.5rem; box-sizing: border-box; overflow-y: auto; height: 100vh; }
.vox-report-controls { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.vox-report-controls .vox-pills { gap: .35rem; }
.vox-report-period { margin: 0; color: var(--vox-muted); font-size: .85rem; }
.vox-section-title { margin: 1rem 0 0; font-size: 1rem; font-weight: 600; }
.vox-tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; }
.vox-tile { background: var(--vox-surface); border: 1px solid var(--vox-border); border-radius: .6rem; padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }
.vox-tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.vox-tile-title { margin: 0; font-size: .9rem; font-weight: 600; }
.vox-tile-totals { display: flex; align-items: center; gap: .5rem; }
.vox-tile-total { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.vox-tile-previous { color: var(--vox-muted); font-variant-numeric: tabular-nums; }
.vox-tile-previous::before { content: "vs "; }
.vox-tile-empty { margin: .5rem 0; color: var(--vox-muted); font-size: .85rem; }
.vox-change { font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; background: var(--vox-pill); color: var(--vox-muted); font-variant-numeric: tabular-nums; }
.vox-change.is-up { color: var(--vox-series-4); }
.vox-change.is-down { color: var(--vox-series-2); }
.vox-chart { width: 100%; height: 170px; display: block; }
.vox-chart rect[class^="vox-series-"], .vox-chart rect[class*=" vox-series-"] { opacity: .9; }
.vox-grid { stroke: var(--vox-border); stroke-width: 1; }
.vox-axis { stroke: var(--vox-muted); stroke-width: 1; }
.vox-axis-label { fill: var(--vox-muted); font-size: 10px; }
.vox-prev-line { stroke: var(--vox-muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.vox-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; color: var(--vox-muted); }
.vox-legend li { display: inline-flex; align-items: center; gap: .3rem; }
.vox-swatch { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; }
.vox-swatch.is-dashed { background: none; border-top: 2px dashed var(--vox-muted); height: 0; width: 1rem; }
.vox-series-0 { fill: var(--vox-series-0); }
.vox-series-1 { fill: var(--vox-series-1); }
.vox-series-2 { fill: var(--vox-series-2); }
.vox-series-3 { fill: var(--vox-series-3); }
.vox-series-4 { fill: var(--vox-series-4); }
.vox-swatch.vox-series-0 { background: var(--vox-series-0); }
.vox-swatch.vox-series-1 { background: var(--vox-series-1); }
.vox-swatch.vox-series-2 { background: var(--vox-series-2); }
.vox-swatch.vox-series-3 { background: var(--vox-series-3); }
.vox-swatch.vox-series-4 { background: var(--vox-series-4); }
.vox-heatmap { display: flex; flex-direction: column; gap: .5rem; overflow-x: auto; }
.vox-heatmap svg { width: 100%; max-width: 760px; height: auto; }
.vox-heat-0 { fill: var(--vox-heat-0); }
.vox-heat-1 { fill: var(--vox-heat-1); }
.vox-heat-2 { fill: var(--vox-heat-2); }
.vox-heat-3 { fill: var(--vox-heat-3); }
.vox-heat-4 { fill: var(--vox-heat-4); }
.vox-heat-legend { display: flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--vox-muted); }
.vox-heat-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.vox-heat-swatch.vox-heat-0 { background: var(--vox-heat-0); }
.vox-heat-swatch.vox-heat-1 { background: var(--vox-heat-1); }
.vox-heat-swatch.vox-heat-2 { background: var(--vox-heat-2); }
.vox-heat-swatch.vox-heat-3 { background: var(--vox-heat-3); }
.vox-heat-swatch.vox-heat-4 { background: var(--vox-heat-4); }
.vox-table-wrap { overflow-x: auto; }
.vox-user-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.vox-user-table th, .vox-user-table td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--vox-border); white-space: nowrap; }
.vox-user-table td { font-variant-numeric: tabular-nums; }
.vox-sort { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.vox-notice { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--vox-banner-bg); color: var(--vox-banner-text); border-radius: .6rem; padding: .75rem 1rem; }
.vox-notice p { margin: .2rem 0 0; font-size: .85rem; }
.vox-activity-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vox-activity-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .5rem; border-bottom: 1px solid var(--vox-border); color: inherit; text-decoration: none; }
.vox-activity-row:hover { background: var(--vox-row-active); }
.vox-activity-row.is-disabled { cursor: default; }
.vox-activity-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.vox-activity-kind { font-size: .75rem; color: var(--vox-muted); }
.vox-activity-who { font-weight: 600; }

/* Reply box and department move, under the open thread. */
.vox-composer { display: flex; flex-direction: column; gap: .4rem; padding: .7rem 1.1rem; border-top: 1px solid var(--vox-border); }
.vox-composer-input { width: 100%; resize: vertical; min-height: 2.5rem; font: inherit; padding: .5rem; background: inherit; color: inherit; border: 1px solid var(--vox-border); border-radius: 4px; }
.vox-composer-actions { display: flex; align-items: center; justify-content: flex-end; gap: .7rem; }
.vox-composer-count { font-size: .75rem; color: var(--vox-muted); }
.vox-composer button, .vox-move button { padding: .4rem .9rem; background: var(--vox-accent); color: var(--vox-accent-text); border: 0; border-radius: 4px; }
.vox-composer button:disabled, .vox-move button:disabled { opacity: .55; }
.vox-move { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .5rem 1.1rem; border-top: 1px solid var(--vox-border); font-size: .85rem; }
.vox-move-status { color: var(--vox-muted); }
.vox-thread-dept { font-size: .75rem; color: var(--vox-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Call button in the conversation header (ATL-629 click-to-call). */
.vox-call-wrap { margin-left: auto; }
.vox-call-button { padding: .35rem .85rem; border: 0; border-radius: 4px; background: var(--vox-accent); color: var(--vox-accent-text); cursor: pointer; font: inherit; }
.vox-call-button:disabled { opacity: .55; cursor: not-allowed; }
/* Block / Unblock control beside the Call button in the conversation header (phone threads with a block service). */
.vox-block-button { margin-left: .4rem; padding: .35rem .85rem; border: 1px solid var(--vox-border); border-radius: 4px; background: var(--vox-pill); color: var(--vox-text); cursor: pointer; font: inherit; }
.vox-block-button.is-armed { background: var(--vox-pill-active); color: var(--vox-pill-active-text); border-color: transparent; }
.vox-block-button:disabled { opacity: .55; cursor: not-allowed; }
.vox-block-button:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
.vox-block-status { font-size: .75rem; color: var(--vox-muted); }

/* Customer flyout (right pane). Wide screens: a third column. Under 1100px: an overlay on the right. */
.vox-customer-toggle { margin-left: auto; padding: .35rem .85rem; border: 1px solid var(--vox-border); border-radius: 4px; background: var(--vox-pill); color: var(--vox-text); cursor: pointer; font: inherit; }
.vox-customer-toggle[aria-expanded="true"] { background: var(--vox-pill-active); color: var(--vox-pill-active-text); border-color: transparent; }
.vox-customer-toggle:focus-visible, .vox-cust-action:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
.vox-pane-customer { min-width: 0; overflow: auto; background: var(--vox-surface); border-left: 1px solid var(--vox-border); }
.vox-cust { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; color: var(--vox-text); }
.vox-cust-head h2 { font-size: 1.05rem; margin: 0 0 .25rem; }
.vox-cust-sub { margin: .1rem 0; color: var(--vox-muted); overflow-wrap: anywhere; }
.vox-cust-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.vox-cust-action { padding: .3rem .7rem; border: 1px solid var(--vox-border); border-radius: 4px; background: var(--vox-pill); color: var(--vox-text); font: inherit; font-size: .85rem; cursor: pointer; }
.vox-cust-action:disabled { opacity: .55; cursor: not-allowed; }
.vox-cust-section { border-top: 1px solid var(--vox-border); padding-top: .7rem; }
.vox-cust-title { font-size: .9rem; margin: 0 0 .4rem; }
.vox-cust-note, .vox-cust-stub { color: var(--vox-muted); margin: .25rem 0; font-size: .88rem; }
.vox-cust-badge { display: inline-block; padding: .05rem .45rem; border-radius: 4px; background: var(--vox-pill); color: var(--vox-muted); font-size: .78rem; margin-right: .3rem; }
.vox-cust dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .25rem .75rem; margin: 0; font-size: .9rem; }
.vox-cust dt { color: var(--vox-muted); }
.vox-cust dd { margin: 0; overflow-wrap: anywhere; }
.vox-cust-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.vox-cust-tag { display: inline-block; margin: .1rem .2rem 0 0; padding: .05rem .4rem; border-radius: 4px; background: var(--vox-pill); font-size: .8rem; }
.vox-cust-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.vox-cust-table th, .vox-cust-table td { text-align: left; padding: .2rem .3rem; border-bottom: 1px solid var(--vox-border); vertical-align: top; }
@media (min-width: 1101px) {
    .vox-panes.has-customer { grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr) minmax(18rem, 22rem); }
}
@media (max-width: 1100px) {
    .vox-panes.has-customer { grid-template-columns: minmax(0, 1fr); }
    .vox-pane-customer { position: fixed; top: 0; right: 0; bottom: 0; width: min(26rem, 100vw); z-index: 50; box-shadow: -4px 0 16px rgba(0, 0, 0, .35); border-left: 1px solid var(--vox-border); }
}

/* Softphone dock (ATL-629): fixed bottom right, signed-in users only, shown only when Softphone:Enabled is true. */
.vox-sidebar .vox-softphone:not(.is-incoming) { position: static; width: auto; margin: .5rem 0; }
.vox-softphone { position: fixed; right: 1rem; bottom: 1rem; z-index: 900; width: 17rem; box-sizing: border-box; padding: .8rem; background: var(--vox-surface); color: var(--vox-text); border: 1px solid var(--vox-border); border-radius: .6rem; box-shadow: 0 6px 20px var(--vox-backdrop); font-size: .9rem; }
/* Incoming call: half the width and half the height of the screen, centred, above the dimmed page. */
.vox-softphone.is-incoming { top: 50%; left: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: 50vw; height: 50vh; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1rem; }
.vox-softphone.is-incoming .vox-softphone-status { font-size: 1.6rem; margin: 0; }
.vox-softphone.is-incoming .vox-softphone-party { font-size: 2.6rem; margin: 0; }
.vox-softphone-detail { margin: .15rem 0 0; color: var(--vox-muted); overflow-wrap: anywhere; }
.vox-softphone.is-incoming .vox-softphone-detail { font-size: 1.6rem; margin: 0; }
.vox-softphone.is-incoming .vox-softphone-actions { gap: 1.5rem; margin-top: 1rem; justify-content: center; }
.vox-softphone.is-incoming .vox-softphone-actions button { font-size: 1.5rem; padding: 1rem 3rem; border-radius: .6rem; }
.vox-softphone-status { margin: 0 0 .5rem; font-weight: 600; }
.vox-softphone-reason { margin: .4rem 0 0; color: var(--vox-muted); }
.vox-softphone-party { margin: .2rem 0 .5rem; overflow-wrap: anywhere; }
.vox-softphone-clock { margin-left: .4rem; color: var(--vox-muted); font-variant-numeric: tabular-nums; }
.vox-softphone-dial { display: flex; flex-direction: column; gap: .4rem; }
.vox-softphone-dial input { padding: .4rem; background: var(--vox-bg); color: var(--vox-text); border: 1px solid var(--vox-border); border-radius: .3rem; }
.vox-softphone-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.vox-softphone button { padding: .4rem .6rem; border: 1px solid transparent; border-radius: .3rem; background: var(--vox-accent); color: var(--vox-accent-text); cursor: pointer; font: inherit; }
.vox-softphone button.vox-ghost { background: none; color: var(--vox-text); border-color: var(--vox-border); }
.vox-softphone button.vox-danger { background: var(--vox-danger-bg); color: var(--vox-danger-text); border-color: var(--vox-danger-border); }
.vox-softphone button:disabled { opacity: .55; cursor: not-allowed; }
.vox-softphone button:focus-visible, .vox-softphone input:focus-visible, .vox-softphone summary:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
.vox-softphone-keypad { margin-top: .6rem; }
.vox-softphone-keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; margin-top: .4rem; }
.vox-softphone-keypad-grid button { padding: .4rem 0; text-align: center; }
@media (max-width: 600px) { body:has(.vox-softphone.is-live:not(.is-incoming)) .vox-pane-timeline { padding-bottom: 12rem; } .vox-softphone { left: .5rem; right: .5rem; bottom: .5rem; width: auto; } .vox-softphone.is-incoming { width: 90vw; height: auto; min-height: 50vh; } .vox-softphone.is-incoming .vox-softphone-party { font-size: 2rem; } }

/* ---- Phone shell (Stage A): bottom tab bar, inbox drawer, top bar avatar. ----
   The bar and the avatar button are hidden by default, so the desktop layout is unchanged; the phone rules show them. */
.vox-tabbar, .vox-avatar-button { display: none; }
@media (max-width: 600px) {
    body:has(.vox-tabbar) .vox-pane { padding-bottom: 6rem; }
    body:has(.vox-tabbar) .vox-softphone:not(.is-incoming) { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.25rem); }
    .vox-tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .25rem; position: fixed; left: .75rem; right: .75rem; bottom: calc(env(safe-area-inset-bottom, 0px) + .5rem); z-index: 800; padding: .35rem; box-sizing: border-box; background: var(--vox-surface); border: 1px solid var(--vox-border); border-radius: 1.4rem; box-shadow: 0 6px 20px var(--vox-backdrop); }
    .vox-tab-slot { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem .2rem; border-radius: 1rem; color: var(--vox-muted); text-decoration: none; font-size: .72rem; }
    .vox-tab-slot.is-active { background: var(--vox-accent); color: var(--vox-accent-text); font-weight: 600; }
    .vox-tab-icon { position: relative; display: inline-flex; }
    .vox-tab-icon svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .vox-tab-badge { position: absolute; top: -.4rem; right: -.7rem; min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem; box-sizing: border-box; border-radius: 999px; background: var(--vox-missed, #f0625a); color: #ffffff; font-size: .68rem; font-weight: 700; line-height: 1.1rem; text-align: center; }
    .vox-avatar-button { display: inline-flex; align-items: center; gap: .45rem; flex: none; height: 2.25rem; padding: 0; border: 0; background: transparent; color: var(--vox-text); font-family: "Hudson NY", system-ui, sans-serif; font-size: 1.35rem; letter-spacing: .06em; cursor: pointer; }
    .vox-avatar-mark { width: 2.25rem; height: 2.25rem; border-radius: .55rem; }
    .vox-topbar { justify-content: flex-start; gap: .75rem; }
    .vox-drawer { position: fixed; inset: 0; z-index: 950; }
    .vox-drawer-backdrop { position: absolute; inset: 0; background: var(--vox-backdrop); }
    .vox-drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(84vw, 20rem); box-sizing: border-box; padding: calc(env(safe-area-inset-top, 0px) + 1rem) .75rem 1rem; background: var(--vox-surface); border-right: 1px solid var(--vox-border); box-shadow: 4px 0 16px var(--vox-backdrop); overflow-y: auto; }
    .vox-drawer-heading { margin: .25rem .5rem 1rem; font-size: 1.1rem; }
    .vox-drawer-row { display: flex; align-items: center; gap: .5rem; padding: .6rem; border-radius: .6rem; color: var(--vox-text); text-decoration: none; }
    .vox-drawer-row.is-selected { background: var(--vox-row-active); color: var(--vox-focus); }
    .vox-drawer-row .vox-tab-badge { position: static; margin-left: auto; }
    .vox-drawer-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
    .vox-drawer-number { color: var(--vox-muted); font-size: .85rem; }
    .vox-shell-placeholder { text-align: center; margin-top: 3rem; }
    /* On the phone the keypad is the dialer, so the idle dock is hidden everywhere. It still shows while a call is ringing, dialing or live (controls). */
    .vox-softphone:not(.is-live) { display: none; }
    /* Conversation: the Back/name bar stays on screen, and the number row sticks just under it. */
    .vox-thread-bar { position: sticky; top: 0; z-index: 30; }
    body:has(.vox-thread-bar) .vox-convo-head { top: calc(env(safe-area-inset-top, 0px) + 3.1rem); }
    /* The pane must not scroll on its own: as a scroll container it made the sticky number row sit over the first message.
       The page scrolls instead, the pane fills the screen under the bar, and the composer stays at the bottom. */
    body:has(.vox-thread-bar) .vox-pane-timeline { overflow: visible; min-height: calc(100dvh - env(safe-area-inset-top, 0px) - 3.1rem); }
    body:has(.vox-thread-bar) .vox-convo-body { flex: 1; }
    body:has(.vox-thread-bar) .vox-composer { position: sticky; bottom: 0; z-index: 20; background: var(--vox-surface); padding-bottom: calc(env(safe-area-inset-bottom, 0px) + .7rem); }
}

/* ---- Contacts (phone): search, letter headers, rows with Message and Call. Colours come from the theme variables. */
.vox-contacts { padding-bottom: 5rem; }
.vox-contact-search { padding: .6rem .9rem; }
.vox-contact-search-input { width: 100%; box-sizing: border-box; padding: .55rem .8rem; border: 1px solid var(--vox-border); border-radius: 8px; background: var(--vox-surface); color: var(--vox-text); font: inherit; }
.vox-contact-letter { margin: .9rem .9rem .2rem; font-size: .8rem; font-weight: 700; color: var(--vox-muted); }
.vox-contact-list { list-style: none; margin: 0; padding: 0; }
.vox-contact-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid var(--vox-border); }
.vox-contact-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.vox-contact-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-contact-company, .vox-contact-number { font-size: .8rem; color: var(--vox-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-contact-actions { display: flex; gap: .5rem; flex: none; }
.vox-contact-message, .vox-contact-call { padding: .4rem .75rem; border-radius: 999px; border: 1px solid var(--vox-border); background: var(--vox-pill); color: var(--vox-text); font: inherit; font-size: .85rem; text-decoration: none; cursor: pointer; }
.vox-contact-call { background: var(--vox-accent); color: var(--vox-accent-text); border-color: var(--vox-accent); }
.vox-contact-call:disabled { opacity: .5; cursor: default; }
.vox-contact-more { display: block; margin: .8rem auto 0; padding: .5rem 1.2rem; border-radius: 999px; border: 1px solid var(--vox-border); background: var(--vox-pill); color: var(--vox-text); font: inherit; cursor: pointer; }
.vox-contact-more:disabled { opacity: .5; cursor: default; }

/* ---- Keypad (Stage C): dial pad for new calls and new messages. Phone only; desktop is unchanged.
   Colours: the accent is the blue used across VOX; the call key uses a green success tone (no existing success variable). */
@media (max-width: 600px) {
    .vox-keypad { display: flex; flex-direction: column; align-items: center; min-height: 100%; box-sizing: border-box; padding: 1rem 1rem 6rem; }
    .vox-keypad-display { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; flex: 1; width: 100%; min-height: 5rem; text-align: center; }
    .vox-keypad-number { color: var(--vox-text); font-size: 2rem; font-weight: 600; letter-spacing: .05em; overflow-wrap: anywhere; }
    .vox-keypad-placeholder { color: var(--vox-muted); font-size: 1rem; }
    .vox-keypad-status { margin: .35rem 0 0; color: var(--vox-muted); font-size: .85rem; }
    .vox-keypad-grid { display: grid; grid-template-columns: repeat(3, 4.5rem); gap: 1rem .9rem; justify-content: center; margin-top: 1.25rem; }
    .vox-keypad-key { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; padding: 0; border: 1px solid var(--vox-border); border-radius: 50%; background: var(--vox-surface); color: var(--vox-text); font: inherit; cursor: pointer; }
    .vox-keypad-digit { font-size: 1.75rem; font-weight: 600; line-height: 1; }
    .vox-keypad-letters { margin-top: .15rem; color: var(--vox-muted); font-size: .6rem; letter-spacing: .2em; }
    .vox-keypad-actions { display: grid; grid-template-columns: repeat(3, 4.5rem); gap: .9rem; justify-content: center; align-items: center; margin-top: 1.5rem; }
    .vox-keypad-message, .vox-keypad-call, .vox-keypad-back { display: inline-flex; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; padding: 0; border: 0; border-radius: 50%; color: #ffffff; cursor: pointer; }
    .vox-keypad-message { background: var(--vox-accent); }
    .vox-keypad-call { justify-self: center; width: 5.5rem; height: 5.5rem; background: #2f9e5b; }
    .vox-keypad-back { background: transparent; color: var(--vox-muted); }
    .vox-keypad svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    .vox-keypad-call svg { width: 2rem; height: 2rem; fill: #ffffff; stroke: none; }
    .vox-keypad button:disabled { opacity: .45; cursor: default; }
    .vox-keypad button:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
    .vox-new-thread-banner { margin: .5rem .75rem; padding: .5rem .75rem; box-sizing: border-box; border: 1px solid var(--vox-border); border-radius: .6rem; background: var(--vox-surface); color: var(--vox-muted); font-size: .8rem; }
}

/* ---- Home (Stage B): inbox name and number in the top bar, Chats and Calls tiles, larger rows, compose button.
   The new elements are hidden by default because the Threads page is shared with the web; the phone rules show them
   only on the tab pages (body:has(.vox-tabbar)) and only at 600px or less. Existing rules are not changed. */
.vox-home-tiles, .vox-compose, .vox-topbar-subtitle { display: none; }
@media (max-width: 600px) {
    body:has(.vox-tabbar) .vox-topbar-text { display: flex; flex-direction: column; min-width: 0; }
    body:has(.vox-tabbar) .vox-topbar-subtitle { display: block; color: var(--vox-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body:has(.vox-tabbar) .vox-home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; padding: .75rem .9rem .25rem; }
    body:has(.vox-tabbar) .vox-home-tile { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; padding: .8rem .9rem; box-sizing: border-box; border: 1px solid var(--vox-border); border-radius: 1.1rem; background: var(--vox-surface); color: var(--vox-text); text-decoration: none; }
    body:has(.vox-tabbar) .vox-home-tile.is-active { background: var(--vox-pill); border-color: var(--vox-accent); }
    body:has(.vox-tabbar) .vox-home-tile-icon { display: inline-flex; color: var(--vox-muted); }
    body:has(.vox-tabbar) .vox-home-tile.is-active .vox-home-tile-icon { color: var(--vox-accent); }
    body:has(.vox-tabbar) .vox-home-tile-icon svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
    body:has(.vox-tabbar) .vox-home-tile-label { margin-top: .35rem; font-weight: 700; font-size: .95rem; }
    body:has(.vox-tabbar) .vox-home-tile-count { color: var(--vox-muted); font-size: .8rem; }
    body:has(.vox-tabbar) .vox-tabs { display: none; }
    body:has(.vox-tabbar) .vox-list-head { padding: .5rem .9rem .3rem; }
    body:has(.vox-tabbar) .vox-search { padding: .25rem 0; }
    body:has(.vox-tabbar) .vox-search-input { width: 100%; padding: .55rem 1rem; border-radius: 999px; font-size: .95rem; }
    body:has(.vox-tabbar) .vox-pills { margin-top: .5rem; gap: .35rem; }
    body:has(.vox-tabbar) .vox-pill { padding: .2rem .6rem; font-size: .78rem; }
    body:has(.vox-tabbar) .vox-thread-row { padding: .85rem .9rem; gap: .85rem; }
    body:has(.vox-tabbar) .vox-avatar { width: 3.25rem; height: 3.25rem; font-size: 1.2rem; }
    body:has(.vox-tabbar) .vox-thread-name { font-weight: 700; font-size: 1rem; }
    body:has(.vox-tabbar) .vox-thread-line.is-missed { color: var(--vox-missed); }
    body:has(.vox-tabbar) .vox-unread { min-width: 1.25rem; height: 1.25rem; padding: 0 .4rem; background: var(--vox-accent); color: var(--vox-accent-text); font-size: .75rem; line-height: 1.25rem; }
    body:has(.vox-tabbar) .vox-compose { display: inline-flex; position: fixed; right: 1rem; bottom: calc(env(safe-area-inset-bottom, 0px) + 5.75rem); z-index: 700; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; box-sizing: border-box; border-radius: 50%; background: var(--vox-accent); color: var(--vox-accent-text); box-shadow: 0 6px 20px var(--vox-backdrop); text-decoration: none; }
    body:has(.vox-tabbar) .vox-compose svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
}

/* ---- Picture messages (MMS): inline thumbnail that opens a lightbox. Prefixes vox-media- and vox-lightbox-.
   The lightbox is always dark, so its controls use white text on a dark pill (--vox-text is dark in the light theme). */
.vox-media-img { display: block; max-width: 15rem; max-height: 20rem; border-radius: .6rem; cursor: zoom-in; }
.vox-media-open { display: block; padding: 0; border: 0; background: none; }
.vox-media-open:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
.vox-media-fallback { display: none; font-size: .85rem; color: var(--vox-muted); }
.vox-media.is-failed .vox-media-open { display: none; }
.vox-media.is-failed .vox-media-fallback { display: block; }
.vox-lightbox { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.88); overflow: auto; }
.vox-lightbox-img { max-width: 96vw; max-height: 92vh; margin: auto; cursor: zoom-in; }
.vox-lightbox-img.is-actual { max-width: none; max-height: none; cursor: zoom-out; }
.vox-lightbox-close, .vox-lightbox-original { position: fixed; z-index: 2001; padding: .4rem .9rem; border: 0; border-radius: 999px; background: rgba(0,0,0,.6); color: #ffffff; font-size: .9rem; text-decoration: none; cursor: pointer; }
.vox-lightbox-close { top: .75rem; right: .75rem; }
.vox-lightbox-original { bottom: calc(env(safe-area-inset-bottom, 0px) + .75rem); left: 50%; transform: translateX(-50%); }
.vox-lightbox-close:focus-visible, .vox-lightbox-original:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }

/* ---- Phone thread header: contact name (h1), muted company and number, copy-number button. Prefixes vox-convo- and vox-copy-. */
.vox-convo-head { min-width: 0; }
.vox-convo-head h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vox-convo-number { color: var(--vox-muted); font-size: .8rem; white-space: nowrap; }
.vox-convo-company { color: var(--vox-muted); font-size: .8rem; white-space: nowrap; }
.vox-convo-company::after { content: " \00b7 "; }
.vox-copy-number { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--vox-muted); cursor: pointer; }
.vox-copy-number:hover { color: var(--vox-text); }
.vox-copy-number:focus-visible { outline: 2px solid var(--vox-focus); outline-offset: 2px; }
.vox-copy-number svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vox-convo-copied { font-size: .75rem; color: var(--vox-muted); }
.vox-composer-count.is-warn { color: var(--vox-warn, #c98a00); }
.vox-composer-count.is-over { color: var(--vox-missed, #f0625a); font-weight: 600; }

/* ---- In-call screen (phone): full-screen call with a bottom sheet. Colours come from the theme variables; the green is the mic-live tone (no success variable exists). */
.vox-incall { position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; box-sizing: border-box; padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); background: var(--vox-bg); color: var(--vox-text); }
.vox-incall svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vox-incall-top { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; }
.vox-incall-back, .vox-incall-handle, .vox-incall-row, .vox-incall-keypad button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.vox-incall-back { width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 50%; color: var(--vox-text); }
.vox-incall-timer { display: flex; flex: 1; flex-direction: column; align-items: center; }
.vox-incall-clock { color: var(--vox-muted); font-variant-numeric: tabular-nums; }
.vox-incall-status { color: var(--vox-muted); font-size: .8rem; }
.vox-incall-spacer { width: 2.75rem; }
.vox-incall-centre { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 0; padding: 1rem; text-align: center; }
.vox-incall-avatar { display: flex; align-items: center; justify-content: center; width: 9rem; height: 9rem; border-radius: 50%; color: #fff; font-size: 4rem; font-weight: 500; }
.vox-incall-avatar svg { width: 4.5rem; height: 4.5rem; }
.vox-incall-name { margin: 1rem 0 0; font-size: 1.8rem; font-weight: 600; overflow-wrap: anywhere; }
.vox-incall-company, .vox-incall-number { margin: 0; color: var(--vox-muted); overflow-wrap: anywhere; }
.vox-incall-sheet { display: flex; flex-direction: column; gap: .5rem; max-height: 75vh; box-sizing: border-box; padding: .25rem 1rem 1rem; overflow-y: auto; background: var(--vox-surface); border-radius: 1.5rem 1.5rem 0 0; }
.vox-incall-handle { align-self: center; padding: .25rem 2rem; color: var(--vox-muted); }
.vox-incall-buttons { display: flex; justify-content: space-between; }
.vox-incall-key { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 0; border: 0; background: none; color: var(--vox-text); font: inherit; cursor: pointer; }
.vox-incall-key-face { display: flex; align-items: center; justify-content: center; width: 4.25rem; height: 4.25rem; border-radius: .9rem; background: var(--vox-bubble-in); color: var(--vox-text); }
.vox-incall-key.is-on .vox-incall-key-face { background: var(--vox-accent); color: var(--vox-accent-text); }
.vox-incall-key.is-muted .vox-incall-key-face { background: var(--vox-bubble-in); color: var(--vox-muted); }
.vox-incall-key.is-live .vox-incall-key-face { background: #16a34a; color: #fff; }
.vox-incall-key.is-end .vox-incall-key-face { background: var(--vox-missed); color: #fff; }
.vox-incall-key-label { font-size: .8rem; color: var(--vox-muted); }
.vox-incall-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.vox-incall-keypad button { padding: .9rem 0; border-radius: .75rem; background: var(--vox-bubble-in); color: var(--vox-text); font-size: 1.4rem; }
.vox-incall-list { display: flex; flex-direction: column; }
.vox-incall-row { display: flex; align-items: center; gap: 1rem; width: 100%; box-sizing: border-box; padding: .9rem .25rem; color: var(--vox-text); text-align: left; }
.vox-incall-row:disabled { color: var(--vox-muted); cursor: not-allowed; }
.vox-incall-row.is-static { margin: 0; cursor: default; }
.vox-incall-row svg { color: var(--vox-muted); }
.vox-incall-rec { fill: var(--vox-missed); stroke: none; }
.vox-incall-connection { display: inline-flex; align-items: center; gap: .4rem; margin-left: auto; color: var(--vox-muted); font-size: .9rem; }
.vox-incall-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--vox-warning-border); }
.vox-incall-dot.is-ok { background: #16a34a; }
.vox-incall-note { margin: .25rem .25rem 0; color: var(--vox-muted); }
.vox-incall-banner { position: fixed; top: calc(env(safe-area-inset-top, 0px) + .5rem); left: .75rem; right: .75rem; z-index: 1250; display: flex; align-items: center; justify-content: space-between; gap: .75rem; box-sizing: border-box; padding: .6rem .9rem; background: var(--vox-surface); color: var(--vox-text); border: 1px solid var(--vox-border); border-radius: .75rem; box-shadow: 0 6px 20px var(--vox-backdrop); }
.vox-incall-return { padding: .4rem .9rem; border: 0; border-radius: .5rem; background: var(--vox-accent); color: var(--vox-accent-text); font: inherit; cursor: pointer; }
@media (max-width: 600px) { body:has(.vox-incall-marker) .vox-softphone.is-live:not(.is-incoming) { display: none; } }
