/*
 * Dialtone web phone
 * Design tokens follow the Dialtone brand guidelines: Deep Navy primary, Signal Blue for interaction,
 * Quantum Cyan as a sparing accent, Cloud White canvas, Slate Ink text, Manrope headings and Inter body,
 * 12px control radius, 18px card radius, soft shadows only and a 4px spacing grid.
 */

/* ------------------------------------------------------------------------------------------------ Tokens */

:root {
    color-scheme: light;

    --navy: #0F172A;
    --signal: #3B82F6;
    --cyan: #06B6D4;
    --violet: #7C3AED;

    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --surface-muted: #F1F5F9;
    --surface-sunken: #EBECEF;
    --text: #1E293B;
    --text-strong: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --border-strong: #CBD5E1;

    --primary: #0F172A;
    --on-primary: #F8FAFC;
    --interactive: #3B82F6;
    --interactive-strong: #2563EB;
    --interactive-soft: rgba(59, 130, 246, 0.10);
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.35);

    --success: #16A34A;
    --success-strong: #15803D;
    --success-soft: rgba(22, 163, 74, 0.12);
    --warning: #D97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #DC2626;
    --danger-strong: #B91C1C;
    --danger-soft: rgba(220, 38, 38, 0.10);
    --info: #0284C7;
    --info-soft: rgba(2, 132, 199, 0.10);

    --rail-bg: #0F172A;
    --rail-text: rgba(248, 250, 252, 0.68);
    --rail-text-active: #F8FAFC;
    --rail-active: rgba(59, 130, 246, 0.22);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 4px 12px rgba(15, 23, 42, 0.08), 0 24px 48px rgba(15, 23, 42, 0.14);

    --radius-control: 12px;
    --radius-card: 18px;
    --radius-pill: 999px;

    --font-heading: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    /* 1.25 type scale on a 16px base */
    --text-xs: 0.8rem;      /* 12.8px */
    --text-sm: 0.875rem;    /* 14px: dense UI labels */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.25rem;     /* 20px */
    --text-xl: 1.5625rem;   /* 25px */
    --text-2xl: 1.953rem;   /* 31.25px */
    --text-3xl: 2.441rem;   /* 39px */

    --rail-width: 88px;
    --topbar-height: 72px;
    --tabbar-height: 64px;
}

:root[data-theme="dark"] {
    color-scheme: dark;

    --bg: #16181D;
    --surface: #1E2025;
    --surface-muted: #262A31;
    --surface-sunken: #2D323B;
    --text: #E8EAED;
    --text-strong: #F7F7F8;
    --text-muted: #94A3B8;
    --border: #2F3540;
    --border-strong: #414653;

    --primary: #F7F7F8;
    --on-primary: #0F172A;
    --interactive: #60A5FA;
    --interactive-strong: #93C5FD;
    --interactive-soft: rgba(96, 165, 250, 0.14);
    --focus-ring: 0 0 0 3px rgba(96, 165, 250, 0.4);

    --success: #22C55E;
    --success-strong: #16A34A;
    --success-soft: rgba(34, 197, 94, 0.14);
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.14);
    --danger: #EF4444;
    --danger-strong: #DC2626;
    --danger-soft: rgba(239, 68, 68, 0.14);
    --info: #38BDF8;
    --info-soft: rgba(56, 189, 248, 0.14);

    --rail-bg: #0B1120;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.3), 0 24px 48px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------------------------------------ Base */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

h1, h2, h3, h4 {
    color: var(--text-strong);
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

p {
    margin: 0;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

a {
    color: var(--interactive);
}

img {
    max-width: 100%;
}

.hidden,
[hidden] {
    display: none !important;
}

.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;
}

.muted {
    color: var(--text-muted);
}

.eyebrow {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

::selection {
    background: rgba(59, 130, 246, 0.25);
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 24px; height: 24px; }
.icon--xl { width: 32px; height: 32px; }

.icon--solid {
    fill: currentColor;
    stroke: none;
}

/* ------------------------------------------------------------------------------------------------ Buttons */

.btn {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    color: var(--text-strong);
    display: inline-flex;
    font-size: var(--text-sm);
    font-weight: 600;
    gap: 8px;
    height: 40px;
    justify-content: center;
    padding: 0 16px;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease, transform 80ms ease;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: var(--surface-muted);
    border-color: var(--border-strong);
}

.btn:active:not(:disabled) {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
}

.btn--primary {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.btn--primary:hover:not(:disabled) {
    background: #1E293B;
    border-color: #1E293B;
}

:root[data-theme="dark"] .btn--primary:hover:not(:disabled) {
    background: #E2E8F0;
    border-color: #E2E8F0;
}

.btn--secondary {
    background: var(--interactive-soft);
    border-color: transparent;
    color: var(--interactive-strong);
}

.btn--secondary:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.18);
    border-color: transparent;
}

.btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn--ghost:hover:not(:disabled) {
    background: var(--surface-muted);
    border-color: transparent;
    color: var(--text-strong);
}

.btn--success {
    background: var(--success);
    border-color: var(--success);
    color: #FFFFFF;
}

.btn--success:hover:not(:disabled) {
    background: var(--success-strong);
    border-color: var(--success-strong);
}

.btn--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

.btn--danger:hover:not(:disabled) {
    background: var(--danger-strong);
    border-color: var(--danger-strong);
}

.btn--sm {
    font-size: var(--text-xs);
    gap: 6px;
    height: 32px;
    padding: 0 12px;
}

.btn--lg {
    font-size: var(--text-base);
    height: 48px;
    padding: 0 20px;
}

.btn--block {
    width: 100%;
}

.btn--icon {
    padding: 0;
    width: 40px;
}

.icon-btn {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--radius-control);
    color: var(--text-muted);
    display: inline-flex;
    height: 36px;
    justify-content: center;
    padding: 0;
    transition: background-color 120ms ease, color 120ms ease;
    width: 36px;
}

.icon-btn:hover:not(:disabled) {
    background: var(--surface-muted);
    color: var(--text-strong);
}

.icon-btn:disabled {
    opacity: 0.4;
}

.link {
    background: none;
    border: 0;
    color: var(--interactive);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 0;
}

.link:hover {
    text-decoration: underline;
}

/* ------------------------------------------------------------------------------------------------ Chips, badges, pills */

.chip {
    align-items: center;
    background: var(--surface-muted);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    display: inline-flex;
    font-size: var(--text-xs);
    font-weight: 600;
    gap: 6px;
    height: 24px;
    padding: 0 10px;
    white-space: nowrap;
}

.chip::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: 6px;
    width: 6px;
}

.chip--plain::before {
    display: none;
}

.chip[data-state="registered"],
.chip[data-state="connected"],
.chip[data-state="good"],
.chip[data-state="excellent"],
.chip[data-state="available"] {
    background: var(--success-soft);
    color: var(--success);
}

.chip[data-state="registering"],
.chip[data-state="reconnecting"],
.chip[data-state="trying"],
.chip[data-state="ringing"],
.chip[data-state="dialing"],
.chip[data-state="recovering"],
.chip[data-state="fair"],
.chip[data-state="warning"] {
    background: var(--warning-soft);
    color: var(--warning);
}

.chip[data-state="onhold"] {
    background: var(--warning-soft);
    color: var(--warning);
}

.console__actions .btn[aria-pressed="true"] {
    background: var(--warning-soft);
    border-color: var(--warning);
    color: var(--warning);
}

.chip[data-state="incoming"] {
    background: var(--interactive-soft);
    color: var(--interactive);
}

.chip[data-state="failed"],
.chip[data-state="error"],
.chip[data-state="poor"],
.chip[data-state="bad"],
.chip[data-state="busy"],
.chip[data-state="rejected"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge {
    align-items: center;
    background: var(--danger);
    border-radius: var(--radius-pill);
    color: #FFFFFF;
    display: inline-flex;
    font-size: 0.6875rem;
    font-weight: 700;
    height: 18px;
    justify-content: center;
    min-width: 18px;
    padding: 0 5px;
}

.badge--neutral {
    background: var(--surface-sunken);
    color: var(--text-muted);
}

.status-pill {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    display: inline-flex;
    font-size: var(--text-xs);
    font-weight: 600;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    white-space: nowrap;
}

.status-pill::before {
    background: var(--text-muted);
    border-radius: 50%;
    content: "";
    height: 8px;
    width: 8px;
}

.status-pill[data-state="registered"] { color: var(--success); }
.status-pill[data-state="registered"]::before { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-pill[data-state="registering"],
.status-pill[data-state="reconnecting"] { color: var(--warning); }
.status-pill[data-state="registering"]::before,
.status-pill[data-state="reconnecting"]::before { background: var(--warning); animation: pulse-dot 1.2s ease-in-out infinite; }
.status-pill[data-state="failed"],
.status-pill[data-state="unregistered"] { color: var(--danger); }
.status-pill[data-state="failed"]::before,
.status-pill[data-state="unregistered"]::before { background: var(--danger); }

.presence-dot {
    background: var(--text-muted);
    border: 2px solid var(--surface);
    border-radius: 50%;
    display: inline-block;
    height: 12px;
    width: 12px;
}

.presence-dot[data-state="available"] { background: var(--success); }
.presence-dot[data-state="busy"] { background: var(--danger); }
.presence-dot[data-state="ringing"] { background: var(--warning); }
.presence-dot[data-state="offline"] { background: #94A3B8; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ------------------------------------------------------------------------------------------------ Avatars */

.avatar {
    align-items: center;
    background: var(--avatar-bg, #DBEAFE);
    border-radius: 50%;
    color: var(--avatar-fg, #1E3A8A);
    display: inline-flex;
    flex: none;
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 700;
    height: 40px;
    justify-content: center;
    letter-spacing: 0.02em;
    position: relative;
    width: 40px;
}

.avatar--sm { height: 32px; width: 32px; font-size: var(--text-xs); }
.avatar > .icon { height: 50%; width: 50%; }
.avatar--lg { height: 56px; width: 56px; font-size: var(--text-lg); }
.avatar--xl { height: 80px; width: 80px; font-size: var(--text-xl); }
.avatar--xxl { height: 120px; width: 120px; font-size: var(--text-3xl); }

.avatar .presence-dot {
    bottom: -1px;
    position: absolute;
    right: -1px;
}

.avatar--xl .presence-dot { height: 16px; width: 16px; bottom: 2px; right: 2px; }

/* Brand-derived avatar palette, picked from the extension so each contact keeps a stable colour. */
.avatar[data-tone="0"] { --avatar-bg: #DBEAFE; --avatar-fg: #1E40AF; }
.avatar[data-tone="1"] { --avatar-bg: #CFFAFE; --avatar-fg: #155E75; }
.avatar[data-tone="2"] { --avatar-bg: #EDE9FE; --avatar-fg: #5B21B6; }
.avatar[data-tone="3"] { --avatar-bg: #DCFCE7; --avatar-fg: #166534; }
.avatar[data-tone="4"] { --avatar-bg: #FEF3C7; --avatar-fg: #92400E; }
.avatar[data-tone="5"] { --avatar-bg: #FCE7F3; --avatar-fg: #9D174D; }
.avatar[data-tone="6"] { --avatar-bg: #E0E7FF; --avatar-fg: #3730A3; }
.avatar[data-tone="7"] { --avatar-bg: #E2E8F0; --avatar-fg: #1E293B; }

:root[data-theme="dark"] .avatar[data-tone="0"] { --avatar-bg: rgba(59, 130, 246, 0.22); --avatar-fg: #BFDBFE; }
:root[data-theme="dark"] .avatar[data-tone="1"] { --avatar-bg: rgba(6, 182, 212, 0.22); --avatar-fg: #A5F3FC; }
:root[data-theme="dark"] .avatar[data-tone="2"] { --avatar-bg: rgba(124, 58, 237, 0.24); --avatar-fg: #DDD6FE; }
:root[data-theme="dark"] .avatar[data-tone="3"] { --avatar-bg: rgba(22, 163, 74, 0.22); --avatar-fg: #BBF7D0; }
:root[data-theme="dark"] .avatar[data-tone="4"] { --avatar-bg: rgba(217, 119, 6, 0.22); --avatar-fg: #FDE68A; }
:root[data-theme="dark"] .avatar[data-tone="5"] { --avatar-bg: rgba(219, 39, 119, 0.22); --avatar-fg: #FBCFE8; }
:root[data-theme="dark"] .avatar[data-tone="6"] { --avatar-bg: rgba(99, 102, 241, 0.24); --avatar-fg: #C7D2FE; }
:root[data-theme="dark"] .avatar[data-tone="7"] { --avatar-bg: #2D323B; --avatar-fg: #E2E8F0; }

/* ------------------------------------------------------------------------------------------------ Forms */

.field {
    display: grid;
    gap: 8px;
}

.field__label {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: 600;
}

.field__hint {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.input-wrap {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    height: 48px;
    padding: 0 8px 0 14px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input-wrap:focus-within {
    border-color: var(--interactive);
    box-shadow: var(--focus-ring);
}

.input-wrap input {
    background: transparent;
    border: 0;
    color: var(--text-strong);
    flex: 1;
    height: 100%;
    min-width: 0;
    outline: none;
}

.input-wrap input::placeholder {
    color: var(--text-muted);
    opacity: 0.8;
}

.input-wrap input:focus-visible {
    box-shadow: none;
}

.input-action {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--interactive);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 6px 8px;
}

.input-action:hover {
    background: var(--interactive-soft);
}

.select {
    appearance: none;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    color: var(--text-strong);
    font-size: var(--text-sm);
    height: 40px;
    min-width: 0;
    padding: 0 36px 0 12px;
    width: 100%;
}

.select:focus-visible {
    border-color: var(--interactive);
}

.search {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    color: var(--text-muted);
    display: flex;
    gap: 8px;
    height: 40px;
    padding: 0 12px;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.search:focus-within {
    background: var(--surface);
    border-color: var(--interactive);
    box-shadow: var(--focus-ring);
}

.search input {
    background: transparent;
    border: 0;
    color: var(--text-strong);
    flex: 1;
    font-size: var(--text-sm);
    min-width: 0;
    outline: none;
}

.search input:focus-visible {
    box-shadow: none;
}

.search kbd {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.6875rem;
    padding: 1px 6px;
}

.search input:not(:placeholder-shown) ~ kbd {
    display: none;
}

.switch {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 16px;
    justify-content: space-between;
}

.switch input {
    appearance: none;
    background: var(--border-strong);
    border-radius: var(--radius-pill);
    cursor: pointer;
    flex: none;
    height: 24px;
    margin: 0;
    position: relative;
    transition: background-color 150ms ease;
    width: 44px;
}

.switch input::after {
    background: #FFFFFF;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    content: "";
    height: 18px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 150ms ease;
    width: 18px;
}

.switch input:checked {
    background: var(--interactive);
}

.switch input:checked::after {
    transform: translateX(20px);
}

.switch__text strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
}

.switch__text span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.segmented {
    background: var(--surface-muted);
    border-radius: var(--radius-control);
    display: inline-flex;
    gap: 2px;
    padding: 3px;
}

.segmented button {
    background: transparent;
    border: 0;
    border-radius: 9px;
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    height: 30px;
    padding: 0 12px;
    white-space: nowrap;
}

.segmented button:hover {
    color: var(--text-strong);
}

.segmented button[aria-pressed="true"] {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    color: var(--text-strong);
}

/* ------------------------------------------------------------------------------------------------ Alerts and empty states */

.alert {
    align-items: flex-start;
    border-radius: var(--radius-control);
    display: flex;
    font-size: var(--text-sm);
    gap: 10px;
    padding: 12px 14px;
}

.alert .icon {
    margin-top: 1px;
}

.alert--danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.alert--info {
    background: var(--info-soft);
    color: var(--info);
}

.alert--warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.empty {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    font-size: var(--text-sm);
    gap: 8px;
    justify-content: center;
    padding: 32px 16px;
    text-align: center;
}

.empty__icon {
    align-items: center;
    background: var(--surface-muted);
    border-radius: 16px;
    color: var(--text-muted);
    display: inline-flex;
    height: 48px;
    justify-content: center;
    margin-bottom: 4px;
    width: 48px;
}

.empty strong {
    color: var(--text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-base);
}

.skeleton {
    animation: shimmer 1.4s ease-in-out infinite;
    background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-sunken) 50%, var(--surface-muted) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-control);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ------------------------------------------------------------------------------------------------ Cards */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
    min-width: 0;
}

.card__header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    justify-content: space-between;
    padding: 20px 20px 16px;
}

.card__header h3 {
    font-size: var(--text-lg);
}

.card__header p {
    font-size: var(--text-xs);
    margin-top: 2px;
}

.card__body {
    padding: 0 20px 20px;
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ------------------------------------------------------------------------------------------------ Login */

.login {
    display: grid;
    grid-template-columns: minmax(360px, 5fr) 7fr;
    height: 100%;
    overflow: auto;
}

.login-brand {
    background:
        radial-gradient(circle at 85% 12%, color-mix(in srgb, var(--cyan) 18%, transparent), transparent 42%),
        radial-gradient(circle at 10% 90%, color-mix(in srgb, var(--signal) 22%, transparent), transparent 46%),
        var(--navy);
    color: var(--rail-text);
    display: flex;
    flex-direction: column;
    gap: 40px;
    overflow: hidden;
    padding: 48px;
    position: relative;
}

.login-brand__logo {
    height: 52px;
    object-fit: contain;
    object-position: left;
    width: auto;
}

.login-brand__body {
    display: grid;
    gap: 20px;
    margin-top: auto;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-brand__body .eyebrow {
    color: var(--cyan);
}

.login-brand__body h1 {
    color: var(--rail-text-active);
    font-size: var(--text-3xl);
    letter-spacing: -0.02em;
}

.login-brand__body > p {
    color: var(--rail-text);
    font-size: var(--text-base);
}

.login-brand__features {
    display: grid;
    gap: 14px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.login-brand__features li {
    align-items: center;
    color: var(--rail-text);
    display: flex;
    font-size: var(--text-sm);
    gap: 12px;
}

.login-brand__features .icon {
    background: rgba(248, 250, 252, 0.08);
    border-radius: 10px;
    color: var(--cyan);
    height: 36px;
    padding: 8px;
    width: 36px;
}

.login-brand__footer {
    color: var(--rail-text-muted);
    font-size: var(--text-xs);
    margin-top: auto;
    position: relative;
    z-index: 1;
}

/* The logo's keypad dots, scaled up as a quiet backdrop. */
.login-brand__keypad {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, 56px);
    opacity: 0.16;
    position: absolute;
    right: -24px;
    top: 120px;
}

.login-brand__keypad span {
    border-radius: 50%;
    height: 56px;
    width: 56px;
}

.login-main {
    display: flex;
    flex-direction: column;
    padding: 24px 32px 32px;
}

.login-main__top {
    display: flex;
    justify-content: flex-end;
}

.login-card {
    display: grid;
    gap: 24px;
    margin: auto;
    max-width: 420px;
    padding: 24px 0;
    width: 100%;
}

.login-card__mark {
    display: none;
    height: 48px;
    width: auto;
}

.login-card__heading h2 {
    font-size: var(--text-2xl);
    letter-spacing: -0.01em;
}

.login-card__heading p {
    color: var(--text-muted);
    margin-top: 8px;
}

/* Which customer's phone system a per-customer link signs in to. */
.login-domain {
    margin-top: 6px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-status {
    align-items: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    font-size: var(--text-xs);
    gap: 10px;
    padding-top: 20px;
}

.login-notify {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    display: grid;
    gap: 4px 12px;
    grid-template-columns: auto 1fr auto;
    padding: 14px 16px;
}

.login-notify > .icon {
    color: var(--interactive);
    grid-row: span 2;
}

.login-notify p {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.login-notify .chip {
    justify-self: start;
}

.login-notify .btn {
    grid-column: 3;
    grid-row: 1 / span 2;
}

/* ------------------------------------------------------------------------------------------------ App shell */

.app {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
    height: 100%;
}

.rail {
    background: var(--rail-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 12px;
}

.rail__brand {
    display: flex;
    justify-content: center;
    padding-bottom: 8px;
}

.rail__brand img {
    max-width: 64px;
    object-fit: contain;
    height: 44px;
    width: auto;
}

.rail__nav,
.rail__footer {
    display: grid;
    gap: 4px;
}

.rail__footer {
    margin-top: auto;
}

.rail__item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 14px;
    color: var(--rail-text);
    display: flex;
    flex-direction: column;
    font-size: 0.6875rem;
    font-weight: 600;
    gap: 4px;
    padding: 10px 4px;
    position: relative;
    transition: background-color 120ms ease, color 120ms ease;
}

.rail__item .icon {
    height: 22px;
    width: 22px;
}

.rail__item:hover {
    background: rgba(248, 250, 252, 0.06);
    color: var(--rail-text-active);
}

.rail__item[aria-current="page"] {
    background: var(--rail-active);
    color: var(--rail-text-active);
}

.rail__item[aria-current="page"]::before {
    background: var(--cyan);
    border-radius: 0 4px 4px 0;
    content: "";
    height: 24px;
    left: -12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
}

.rail__item .badge {
    position: absolute;
    right: 10px;
    top: 4px;
}

.rail__icon {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 12px;
    color: var(--rail-text);
    display: flex;
    height: 40px;
    justify-content: center;
    justify-self: center;
    width: 40px;
}

.rail__icon:hover {
    background: rgba(248, 250, 252, 0.06);
    color: var(--rail-text-active);
}

.workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.topbar {
    align-items: center;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex: none;
    gap: 24px;
    height: var(--topbar-height);
    padding: 0 32px;
}

.topbar__title {
    min-width: 0;
}

.topbar__title h1 {
    font-size: var(--text-xl);
    white-space: nowrap;
}

.topbar__title p {
    font-size: var(--text-xs);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar__search {
    flex: 1;
    max-width: 440px;
    position: relative;
}

.topbar__status {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.identity {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    display: flex;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    position: relative;
    text-align: left;
}

.identity:hover {
    background: var(--surface-muted);
}

.identity strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
    line-height: 1.2;
}

.identity small {
    color: var(--text-muted);
    display: block;
    font-size: var(--text-xs);
    line-height: 1.2;
}

.menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 2px;
    min-width: 220px;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
}

.menu__header {
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    padding: 8px 10px 12px;
}

.menu__header strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
}

.menu__header span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.menu button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: var(--text);
    display: flex;
    font-size: var(--text-sm);
    gap: 10px;
    padding: 9px 10px;
    text-align: left;
}

.menu button:hover {
    background: var(--surface-muted);
}

.menu button.menu__danger {
    color: var(--danger);
}

.pages {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 24px 32px 32px;
}

.page {
    margin: 0 auto;
    max-width: 1440px;
}

.tabbar {
    display: none;
}

.mobile-only {
    display: none !important;
}

/* ------------------------------------------------------------------------------------------------ Quick search */

.quick-results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    left: 0;
    max-height: 380px;
    overflow: auto;
    padding: 6px;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 30;
}

.quick-results__item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 10px;
    display: flex;
    gap: 12px;
    padding: 8px 10px;
    text-align: left;
    width: 100%;
}

.quick-results__item:hover,
.quick-results__item[aria-selected="true"] {
    background: var(--surface-muted);
}

.quick-results__item strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
}

.quick-results__item > div {
    flex: 1;
    min-width: 0;
}

.quick-results__item > div > span {
    color: var(--text-muted);
    display: block;
    font-size: var(--text-xs);
}

.quick-results__item .icon {
    color: var(--success);
    margin-left: auto;
}

.quick-results__empty {
    color: var(--text-muted);
    font-size: var(--text-sm);
    padding: 16px;
    text-align: center;
}

/* ------------------------------------------------------------------------------------------------ Phone page */

.page-phone {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 380px;
    height: 100%;
    min-height: 600px;
}

.phone-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0;
}

.call-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* Idle */

.stage-idle {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 32px;
    padding: 40px;
}

.stage-idle__hello {
    align-items: center;
    display: flex;
    gap: 24px;
}

.stage-idle__hello h2 {
    font-size: var(--text-2xl);
    letter-spacing: -0.01em;
}

.stage-idle__hello p {
    color: var(--text-muted);
    margin-top: 6px;
}

.stage-idle__section h3 {
    font-size: var(--text-base);
    margin-bottom: 12px;
}

.stage-idle__section-head {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.quick-dial {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.quick-dial__item {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: 14px;
    display: flex;
    gap: 12px;
    padding: 12px;
    text-align: left;
    transition: border-color 120ms ease, background-color 120ms ease;
}

.quick-dial__item:hover {
    background: var(--surface);
    border-color: var(--border-strong);
}

.quick-dial__item strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-dial__item > div > span {
    color: var(--text-muted);
    display: block;
    font-size: var(--text-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-dial__item > div {
    flex: 1;
}

.quick-dial__empty {
    color: var(--text-muted);
    font-size: var(--text-sm);
    grid-column: 1 / -1;
}

.quick-dial__item > div {
    min-width: 0;
}

.quick-dial__call {
    align-items: center;
    background: var(--success-soft);
    border-radius: 50%;
    color: var(--success);
    display: inline-flex;
    flex: none;
    height: 32px;
    justify-content: center;
    margin-left: auto;
    width: 32px;
}

.stage-idle__footer {
    align-items: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: var(--text-xs);
    gap: 8px 24px;
    margin-top: auto;
    padding-top: 20px;
}

.stage-idle__footer kbd {
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-strong);
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    margin-right: 4px;
    padding: 1px 6px;
}

.mic-notice {
    align-items: center;
    display: flex;
    gap: 8px;
}

.mic-notice[data-state="registered"] { color: var(--success); }
.mic-notice[data-state="failed"] { color: var(--danger); }
.mic-notice[data-state="registering"] { color: var(--warning); }

/* Active call */

.stage-call {
    background:
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.10), transparent 55%),
        var(--surface);
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.stage-call__top {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.stage-call__body {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 24px;
    position: relative;
}

.call-identity {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: center;
}

.call-identity .avatar {
    margin-bottom: 16px;
}

.call-identity h2 {
    font-size: var(--text-2xl);
    letter-spacing: -0.01em;
}

.call-identity__number {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.call-identity__state {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: 600;
    margin-top: 8px;
}

.call-identity__timer {
    color: var(--text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.call-identity__detail {
    color: var(--text-muted);
    font-size: var(--text-xs);
    max-width: 420px;
}

/* Ripple rings around the avatar while a call rings. */
.ring-avatar {
    position: relative;
}

.stage-call[data-call-state="incoming"] .ring-avatar::before,
.stage-call[data-call-state="incoming"] .ring-avatar::after,
.stage-call[data-call-state="trying"] .ring-avatar::before,
.stage-call[data-call-state="ringing"] .ring-avatar::before {
    animation: ripple 1.8s ease-out infinite;
    border: 2px solid var(--interactive);
    border-radius: 50%;
    content: "";
    inset: -4px;
    opacity: 0;
    position: absolute;
}

.stage-call[data-call-state="incoming"] .ring-avatar::after {
    animation-delay: 0.9s;
}

@keyframes ripple {
    0% { opacity: 0.6; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.45); }
}

.visualizer {
    height: 96px;
    margin-top: 24px;
    max-width: 520px;
    width: 100%;
}

.visualizer canvas {
    display: block;
    height: 100%;
    width: 100%;
}

.video-stage {
    background: #020617;
    border-radius: 16px;
    inset: 16px;
    overflow: hidden;
    position: absolute;
}

.video-stage__remote {
    height: 100%;
    object-fit: contain;
    width: 100%;
}

.video-stage__local {
    border: 2px solid rgba(248, 250, 252, 0.8);
    border-radius: 12px;
    bottom: 16px;
    box-shadow: var(--shadow-lg);
    height: 120px;
    object-fit: cover;
    position: absolute;
    right: 16px;
    transform: scaleX(-1);
    width: 168px;
}

.video-stage__expand {
    background: rgba(2, 6, 23, 0.55);
    color: #F8FAFC;
    position: absolute;
    right: 12px;
    top: 12px;
}

.video-stage__expand:hover:not(:disabled) {
    background: rgba(2, 6, 23, 0.8);
    color: #FFFFFF;
}

.video-stage__peer {
    background: rgba(2, 6, 23, 0.55);
    border-radius: var(--radius-pill);
    color: #F8FAFC;
    font-size: var(--text-xs);
    font-weight: 600;
    left: 12px;
    padding: 6px 12px;
    position: absolute;
    top: 12px;
}

.in-call-keypad {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 16px 24px;
}

.in-call-keypad .keypad {
    margin: 0 auto;
    max-width: 320px;
}

.in-call-keypad__digits {
    color: var(--text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    letter-spacing: 0.12em;
    min-height: 28px;
    text-align: center;
}

.call-controls {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 20px 24px 24px;
}

.ctrl {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    font-size: var(--text-xs);
    font-weight: 600;
    gap: 8px;
    min-width: 64px;
    padding: 0;
}

.ctrl__icon {
    align-items: center;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-strong);
    display: inline-flex;
    height: 56px;
    justify-content: center;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 80ms ease;
    width: 56px;
}

.ctrl:hover:not(:disabled) .ctrl__icon {
    background: var(--surface-sunken);
    border-color: var(--border-strong);
}

.ctrl:active:not(:disabled) .ctrl__icon {
    transform: scale(0.96);
}

.ctrl[aria-pressed="true"] .ctrl__icon,
.ctrl[aria-pressed="true"]:hover:not(:disabled) .ctrl__icon {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.ctrl:disabled {
    opacity: 0.45;
}

.ctrl--hangup .ctrl__icon {
    background: var(--danger);
    border-color: var(--danger);
    color: #FFFFFF;
}

.ctrl--hangup:hover:not(:disabled) .ctrl__icon {
    background: var(--danger-strong);
    border-color: var(--danger-strong);
}

.ctrl--answer .ctrl__icon {
    background: var(--success);
    border-color: var(--success);
    color: #FFFFFF;
}

.ctrl--answer:hover:not(:disabled) .ctrl__icon {
    background: var(--success-strong);
    border-color: var(--success-strong);
}

.ctrl--answer .ctrl__icon,
.ctrl--hangup.ctrl--large .ctrl__icon,
#incomingControls .ctrl__icon {
    height: 64px;
    width: 64px;
}

/* Decline and answer sit well apart so a ringing call is hard to mis-tap. */
#incomingControls {
    align-items: flex-start;
    gap: 72px;
}

.stage-call[data-call-state="incoming"] .ctrl--answer .ctrl__icon {
    animation: nudge 1.6s ease-in-out infinite;
}

@keyframes nudge {
    0%, 70%, 100% { transform: rotate(0); }
    75% { transform: rotate(-12deg); }
    85% { transform: rotate(12deg); }
}

.feature-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    padding: 0 24px 16px;
    text-align: center;
}

/* Dialer */

.dialer {
    padding: 20px;
}

.dialer__display {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    padding-bottom: 12px;
}

.dialer__display input {
    background: transparent;
    border: 0;
    color: var(--text-strong);
    flex: 1;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    letter-spacing: 0.04em;
    min-width: 0;
    outline: none;
    padding: 4px 0;
    text-align: center;
}

.dialer__display input::placeholder {
    color: var(--text-muted);
    font-size: var(--text-lg);
    font-weight: 500;
    letter-spacing: 0;
    opacity: 0.6;
}

.dialer__display input:focus-visible {
    box-shadow: none;
}

.dialer__match {
    color: var(--text-muted);
    font-size: var(--text-xs);
    min-height: 20px;
    padding-top: 8px;
    text-align: center;
}

.dialer__match strong {
    color: var(--interactive);
}

.keypad {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, 1fr);
    padding: 12px 8px;
}

.key {
    align-items: center;
    aspect-ratio: 1.45;
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: 16px;
    color: var(--text-strong);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    transition: background-color 100ms ease, transform 60ms ease;
    user-select: none;
}

.key:hover {
    background: var(--surface-sunken);
}

.key:active,
.key.is-pressed {
    background: var(--interactive-soft);
    color: var(--interactive-strong);
    transform: scale(0.97);
}

.key__digit {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.1;
}

.key__letters {
    color: var(--text-muted);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    min-height: 12px;
}

.dialer__actions {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 48px 1fr 48px;
    padding-top: 8px;
}

.dialer__actions .btn--call {
    grid-column: 2;
}

.btn--call {
    background: var(--success);
    border: 0;
    border-radius: var(--radius-pill);
    color: #FFFFFF;
    font-size: var(--text-base);
    height: 56px;
}

.btn--call:hover:not(:disabled) {
    background: var(--success-strong);
}

.btn--call:disabled {
    background: var(--surface-sunken);
    color: var(--text-muted);
    opacity: 1;
}

.btn--round {
    border-radius: 50%;
    height: 48px;
    padding: 0;
    width: 48px;
}

/* Recents (phone page) and history */

.recents {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 260px;
}

.recents .card__header {
    padding-bottom: 12px;
}

.recents .card__header h3 {
    font-size: var(--text-base);
}

.recents__list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 8px 12px;
}

.history-group {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 12px 12px 6px;
    text-transform: uppercase;
}

.history-row {
    align-items: center;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    transition: background-color 120ms ease;
}

.history-row:hover {
    background: var(--surface-muted);
}

.history-row__body {
    flex: 1;
    min-width: 0;
}

.history-row__peer {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-row[data-outcome="missed"] .history-row__peer,
.history-row[data-outcome="failed"] .history-row__peer {
    color: var(--danger);
}

.history-row__meta {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: var(--text-xs);
    gap: 6px;
}

.history-row__meta .icon {
    height: 14px;
    width: 14px;
}

.history-row__time {
    color: var(--text-muted);
    font-size: var(--text-xs);
    white-space: nowrap;
}

.history-row__actions {
    display: flex;
    gap: 4px;
}

.history-row__actions .icon-btn[data-history-redial] {
    color: var(--success);
}

.history-row__actions .icon-btn[data-history-redial]:hover {
    background: var(--success-soft);
}

.history-table .history-row {
    padding: 12px 16px;
}

.history-table .history-row + .history-row {
    border-top: 1px solid var(--border);
    border-radius: 0;
}

.history-row__outcome {
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 10px;
}

.history-row__outcome[data-outcome="connected"],
.history-row__outcome[data-outcome="ended"] {
    background: var(--success-soft);
    color: var(--success);
}

.history-row__outcome[data-outcome="missed"],
.history-row__outcome[data-outcome="failed"],
.history-row__outcome[data-outcome="rejected"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.history-row__outcome[data-outcome="cancelled"] {
    background: var(--surface-muted);
    color: var(--text-muted);
}

/* ------------------------------------------------------------------------------------------------ Reception */

.page-reception {
    display: grid;
    gap: 24px;
}

.stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
    align-items: center;
    display: flex;
    gap: 16px;
    padding: 20px;
}

.stat__icon {
    align-items: center;
    border-radius: 14px;
    display: inline-flex;
    flex: none;
    height: 48px;
    justify-content: center;
    width: 48px;
}

.stat__icon--available { background: var(--success-soft); color: var(--success); }
.stat__icon--offline { background: var(--surface-muted); color: var(--text-muted); }
.stat__icon--calls { background: var(--interactive-soft); color: var(--interactive); }
.stat__icon--missed { background: var(--danger-soft); color: var(--danger); }

.stat strong {
    color: var(--text-strong);
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.stat > div > span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.reception-grid {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 380px;
}

.reception-side {
    display: grid;
    gap: 24px;
}

.presence-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    padding: 0 20px 20px;
}

.presence-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: grid;
    gap: 12px;
    padding: 14px;
    position: relative;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.presence-tile:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.presence-tile[data-state="offline"] {
    background: var(--surface-muted);
}

.presence-tile[data-state="offline"] .presence-tile__name {
    color: var(--text-muted);
}

.presence-tile[data-state="busy"] {
    border-color: rgba(220, 38, 38, 0.35);
}

.presence-tile__head {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.presence-tile__head > div {
    min-width: 0;
}

.presence-tile__name {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-tile__meta {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.presence-tile__status {
    align-items: center;
    display: flex;
    font-size: var(--text-xs);
    font-weight: 600;
    gap: 6px;
}

.presence-tile__status .presence-dot {
    border: 0;
    height: 8px;
    width: 8px;
}

.presence-tile[data-state="available"] .presence-tile__status { color: var(--success); }
.presence-tile[data-state="busy"] .presence-tile__status { color: var(--danger); }
.presence-tile[data-state="offline"] .presence-tile__status { color: var(--text-muted); }

.presence-tile__actions {
    display: flex;
    gap: 6px;
}

.presence-tile__actions .btn {
    flex: 1;
    height: 32px;
    padding: 0 8px;
}

.presence-tile__actions .btn--icon {
    flex: none;
    width: 32px;
}

.presence-tile__you {
    background: var(--interactive-soft);
    border-radius: var(--radius-pill);
    color: var(--interactive);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 2px 8px;
    position: absolute;
    right: 12px;
    top: 12px;
}

.console__body {
    padding: 0 20px 16px;
}

.console__idle {
    align-items: center;
    background: var(--surface-muted);
    border-radius: 14px;
    color: var(--text-muted);
    display: flex;
    font-size: var(--text-sm);
    gap: 12px;
    padding: 16px;
}

.console__call {
    align-items: center;
    display: flex;
    gap: 14px;
}

.console__call h4 {
    font-size: var(--text-lg);
}

.console__call p {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.console__timer {
    color: var(--text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin-left: auto;
}

.console__actions {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 16px 20px;
}

.console__actions .btn {
    height: 44px;
}

/* Attended transfer: shown while the receptionist talks to (or rings) the colleague and the caller waits on hold. */
.consult-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 20px 12px;
    padding: 12px 14px;
    border: 1px solid var(--warning);
    border-radius: var(--radius-control);
    background: var(--warning-soft);
    color: var(--text-strong);
}

.consult-banner.hidden {
    display: none;
}

.consult-banner__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.consult-banner__text span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.consult-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.console__note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    padding: 0 20px 16px;
}

.list-panel {
    display: grid;
    gap: 4px;
    padding: 0 12px 12px;
}

.list-panel .empty {
    padding: 20px 12px;
}

.queue-item {
    align-items: center;
    background: var(--interactive-soft);
    border-radius: 14px;
    display: flex;
    gap: 12px;
    padding: 12px;
}

.queue-item__body {
    flex: 1;
    min-width: 0;
}

.queue-item__body strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
}

.queue-item__body span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

/* ------------------------------------------------------------------------------------------------ Contacts */

.contact-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding: 0 20px 20px;
}

.contact-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.contact-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.contact-card__head {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 0;
}

.contact-card__head > div {
    min-width: 0;
}

.contact-card__name {
    color: var(--text-strong);
    font-size: var(--text-base);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-card__ext {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.contact-card__details {
    display: grid;
    gap: 6px;
}

.contact-card__details span {
    align-items: center;
    color: var(--text-muted);
    display: flex;
    font-size: var(--text-xs);
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-card__details .icon {
    height: 14px;
    width: 14px;
}

.contact-card__actions {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 1fr auto;
    margin-top: auto;
}

/* ------------------------------------------------------------------------------------------------ Messages */

.page-messages {
    height: 100%;
}

.messages {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    height: 100%;
    min-height: 520px;
    overflow: hidden;
}

.conversations {
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 20px 12px 12px;
}

.conversations__header {
    align-items: center;
    display: flex;
    gap: 8px;
    padding: 0 8px;
}

.conversations__header h3 {
    flex: 1;
    font-size: var(--text-lg);
}

.conversations .search {
    margin: 0 8px;
}

.conversation-list {
    align-content: start;
    display: grid;
    gap: 2px;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    overflow: auto;
}

.conversation {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    padding: 10px;
    text-align: left;
    width: 100%;
}

.conversation:hover {
    background: var(--surface-muted);
}

.conversation[aria-current="true"] {
    background: var(--interactive-soft);
}

.conversation__body {
    flex: 1;
    min-width: 0;
}

.conversation__top {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.conversation__name {
    color: var(--text-strong);
    font-size: var(--text-sm);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation__time {
    color: var(--text-muted);
    flex: none;
    font-size: 0.6875rem;
}

.conversation__bottom {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.conversation__name,
.conversation__preview {
    min-width: 0;
}

.conversation__preview {
    color: var(--text-muted);
    font-size: var(--text-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation[data-unread="true"] .conversation__preview {
    color: var(--text-strong);
    font-weight: 600;
}

.chat {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.chat__header {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 12px;
    padding: 16px 20px;
}

.chat__header > div {
    flex: 1;
    min-width: 0;
}

.chat__header h3 {
    font-size: var(--text-base);
}

.chat__header p {
    font-size: var(--text-xs);
}

.chat__empty {
    flex: 1;
}

.chat__messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    overflow: auto;
    padding: 20px;
}

.chat__day {
    align-self: center;
    background: var(--surface-muted);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    margin: 12px 0 6px;
    padding: 3px 12px;
}

.bubble-row {
    display: flex;
}

.bubble-row--sent {
    justify-content: flex-end;
}

.bubble {
    background: var(--surface-muted);
    border-radius: 18px 18px 18px 6px;
    color: var(--text-strong);
    font-size: var(--text-sm);
    max-width: min(560px, 78%);
    overflow-wrap: anywhere;
    padding: 10px 14px;
    white-space: pre-wrap;
}

.bubble-row--sent .bubble {
    background: var(--navy);
    border-radius: 18px 18px 6px 18px;
    color: #F8FAFC;
}

:root[data-theme="dark"] .bubble-row--sent .bubble {
    background: #2563EB;
}

.bubble__meta {
    align-items: center;
    display: flex;
    font-size: 0.6875rem;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 4px;
    opacity: 0.7;
}

.bubble__meta .icon {
    height: 13px;
    width: 13px;
}

.bubble__meta[data-status="failed"] {
    color: #FCA5A5;
    opacity: 1;
}

.chat__composer {
    align-items: flex-end;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    padding: 14px 20px 18px;
}

.chat__composer textarea {
    background: var(--surface-muted);
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--text-strong);
    flex: 1;
    font-size: var(--text-sm);
    line-height: 1.5;
    max-height: 128px;
    min-height: 44px;
    outline: none;
    overflow-y: hidden;
    padding: 11px 14px;
    resize: none;
}

.chat__composer textarea[data-overflowing="true"] {
    overflow-y: auto;
}

.chat__composer textarea:focus {
    background: var(--surface);
    border-color: var(--interactive);
    box-shadow: var(--focus-ring);
}

.chat__composer .btn {
    border-radius: 50%;
    height: 44px;
    width: 44px;
}

/* ------------------------------------------------------------------------------------------------ Settings */

.settings-grid {
    align-items: start;
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid .card--wide {
    grid-column: 1 / -1;
}

.settings-section {
    display: grid;
    gap: 16px;
    padding: 0 20px 20px;
}

.settings-row {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.settings-row > div {
    min-width: 0;
}

.settings-row strong {
    color: var(--text-strong);
    display: block;
    font-size: var(--text-sm);
}

.settings-row > div > span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.settings-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 0;
}

.account-summary {
    align-items: center;
    display: flex;
    gap: 16px;
}

.account-summary strong {
    color: var(--text-strong);
    display: block;
    font-family: var(--font-heading);
    font-size: var(--text-lg);
}

.account-summary > div > span {
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.device-group {
    display: grid;
    gap: 8px;
}

.device-group__label {
    align-items: center;
    color: var(--text-strong);
    display: flex;
    font-size: var(--text-sm);
    font-weight: 600;
    gap: 8px;
}

.device-group__current {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 500;
    margin-left: auto;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-list {
    display: grid;
    gap: 6px;
}

.device-option {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    display: flex;
    gap: 12px;
    padding: 10px 12px;
    text-align: left;
    width: 100%;
}

.device-option:hover {
    border-color: var(--border-strong);
}

.device-option[aria-pressed="true"] {
    background: var(--interactive-soft);
    border-color: var(--interactive);
}

.device-option__title {
    color: var(--text-strong);
    flex: 1;
    font-size: var(--text-sm);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.device-option__badge {
    color: var(--interactive);
    font-size: var(--text-xs);
    font-weight: 600;
}

.log-viewer summary {
    color: var(--text-strong);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
    list-style: none;
}

.log-viewer summary::-webkit-details-marker {
    display: none;
}

.log-viewer textarea {
    background: #0B1120;
    border: 0;
    border-radius: var(--radius-control);
    color: #CBD5E1;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.75rem;
    height: 320px;
    line-height: 1.5;
    margin-top: 12px;
    padding: 12px;
    resize: vertical;
    width: 100%;
}

/* ------------------------------------------------------------------------------------------------ Overlays */

.call-toast {
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    display: grid;
    gap: 4px 16px;
    grid-template-columns: auto 1fr;
    opacity: 0;
    padding: 18px;
    pointer-events: none;
    position: fixed;
    right: 24px;
    top: 24px;
    transform: translateY(-12px);
    transition: opacity 180ms ease, transform 180ms ease;
    width: 380px;
    z-index: 60;
}

.call-toast[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.call-toast__avatar {
    grid-row: span 2;
    position: relative;
}

.call-toast[data-mode="incoming"] .call-toast__avatar::after {
    animation: ripple 1.8s ease-out infinite;
    border: 2px solid var(--success);
    border-radius: 50%;
    content: "";
    inset: -4px;
    position: absolute;
}

.call-toast__title {
    color: var(--text-muted);
    font-size: var(--text-xs);
    font-weight: 600;
}

.call-toast__from {
    color: var(--text-strong);
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.call-toast__detail {
    color: var(--text-muted);
    font-size: var(--text-xs);
    grid-column: 1 / -1;
}

.call-toast__actions {
    display: grid;
    gap: 10px;
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
}

.call-toast__status {
    position: absolute;
    right: 16px;
    top: 16px;
}

.call-dock {
    align-items: center;
    background: var(--navy);
    border-radius: var(--radius-pill);
    bottom: 24px;
    box-shadow: var(--shadow-lg);
    color: #E2E8F0;
    display: flex;
    gap: 12px;
    left: 50%;
    padding: 8px 8px 8px 16px;
    position: fixed;
    transform: translateX(-50%);
    z-index: 50;
}

:root[data-theme="dark"] .call-dock {
    background: #273449;
}

.call-dock__live {
    animation: pulse-dot 1.4s ease-in-out infinite;
    background: var(--success);
    border-radius: 50%;
    height: 8px;
    width: 8px;
}

.call-dock__text strong {
    color: #F8FAFC;
    display: block;
    font-size: var(--text-sm);
    line-height: 1.2;
}

.call-dock__text span {
    color: #94A3B8;
    font-size: var(--text-xs);
    font-variant-numeric: tabular-nums;
}

.call-dock .icon-btn {
    color: #CBD5E1;
}

.call-dock .icon-btn:hover:not(:disabled) {
    background: rgba(248, 250, 252, 0.1);
    color: #FFFFFF;
}

.call-dock .icon-btn[aria-pressed="true"],
.call-dock .icon-btn[aria-pressed="true"]:hover:not(:disabled) {
    background: #F8FAFC;
    color: var(--navy);
}

.call-dock__end {
    background: var(--danger);
    border: 0;
    border-radius: var(--radius-pill);
    color: #FFFFFF;
    display: inline-flex;
    height: 40px;
    align-items: center;
    justify-content: center;
    width: 56px;
}

.call-dock__end:hover {
    background: var(--danger-strong);
}

.modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 24px;
    position: fixed;
    z-index: 70;
}

.modal__panel {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 48px);
    max-width: 480px;
    overflow: hidden;
    width: 100%;
}

.modal__header {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 20px 20px 12px;
}

.modal__header h3 {
    font-size: var(--text-lg);
}

.modal__body {
    display: grid;
    gap: 16px;
    overflow: auto;
    padding: 4px 20px 20px;
}

.modal__footer {
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
}

.modal--video {
    background: rgba(2, 6, 23, 0.92);
}

.modal--video video {
    background: #000000;
    border-radius: 16px;
    max-height: calc(100vh - 96px);
    max-width: 100%;
}

.modal--video .icon-btn {
    background: rgba(248, 250, 252, 0.12);
    color: #F8FAFC;
    position: absolute;
    right: 24px;
    top: 24px;
}

.suggestions {
    display: grid;
    gap: 2px;
    max-height: 240px;
    overflow: auto;
}

.toast-host {
    bottom: 24px;
    display: grid;
    gap: 8px;
    position: fixed;
    right: 24px;
    width: min(380px, calc(100vw - 32px));
    z-index: 80;
}

.toast {
    align-items: flex-start;
    animation: toast-in 180ms ease;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    color: var(--text);
    display: flex;
    font-size: var(--text-sm);
    gap: 10px;
    padding: 12px 14px;
}

.toast[data-tone="danger"] { border-left-color: var(--danger); }
.toast[data-tone="success"] { border-left-color: var(--success); }
.toast[data-tone="warning"] { border-left-color: var(--warning); }

.toast[data-tone="danger"] .icon { color: var(--danger); }
.toast[data-tone="success"] .icon { color: var(--success); }
.toast[data-tone="warning"] .icon { color: var(--warning); }
.toast .icon { color: var(--info); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------------------------------------ Responsive */

@media (max-width: 1279px) {
    .reception-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .reception-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-phone {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

@media (max-width: 1023px) {
    body {
        overflow: auto;
    }

    .login {
        display: block;
        overflow: visible;
    }

    .login-brand {
        display: none;
    }

    .login-main {
        min-height: 100%;
        padding: 16px 20px 24px;
    }

    .login-card__mark {
        display: block;
    }

    .app {
        display: block;
        height: auto;
        min-height: 100%;
    }

    .rail {
        display: none;
    }

    .workspace {
        min-height: 100vh;
        padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    }

    .topbar {
        background: var(--bg);
        gap: 12px;
        height: 64px;
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .topbar__title h1 {
        font-size: var(--text-lg);
    }

    .topbar__title p,
    .topbar__search,
    .identity__text,
    .identity .icon,
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: revert !important;
    }

    .pages {
        overflow: visible;
        padding: 16px;
    }

    .tabbar {
        background: var(--surface);
        border-top: 1px solid var(--border);
        bottom: 0;
        display: grid;
        grid-auto-columns: minmax(0, 1fr);
        grid-auto-flow: column;
        height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
        left: 0;
        padding-bottom: env(safe-area-inset-bottom);
        position: fixed;
        right: 0;
        z-index: 40;
    }

    .tabbar__item {
        align-items: center;
        background: transparent;
        border: 0;
        color: var(--text-muted);
        display: flex;
        flex-direction: column;
        font-size: 0.6875rem;
        font-weight: 600;
        gap: 2px;
        justify-content: center;
        position: relative;
    }

    .tabbar__item[aria-current="page"] {
        color: var(--interactive);
    }

    .tabbar__item .badge {
        left: calc(50% + 6px);
        position: absolute;
        top: 6px;
    }

    .page-phone {
        display: block;
        min-height: 0;
    }

    .phone-side {
        gap: 16px;
    }

    .phone-side .recents {
        display: none;
    }

    /* On small screens the stage only appears as a full-screen call view. */
    .call-stage {
        display: none;
    }

    body[data-call-active="true"] .call-stage {
        border: 0;
        border-radius: 0;
        display: flex;
        inset: 0;
        position: fixed;
        z-index: 45;
    }

    .stage-call__top {
        padding-top: calc(16px + env(safe-area-inset-top));
    }

    .call-controls {
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .dialer {
        margin: 0 auto;
        max-width: 420px;
        width: 100%;
    }

    .stats {
        gap: 12px;
    }

    .stat {
        padding: 14px;
    }

    .reception-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .messages {
        border: 0;
        box-shadow: none;
        display: block;
        min-height: calc(100vh - 64px - var(--tabbar-height) - 32px);
    }

    .messages[data-chat-open="false"] .chat,
    .messages[data-chat-open="true"] .conversations {
        display: none;
    }

    .conversations {
        border-right: 0;
        padding: 16px 4px;
    }

    .chat {
        height: calc(100vh - 64px - var(--tabbar-height) - 32px);
    }

    .settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .call-toast {
        left: 12px;
        right: 12px;
        top: 12px;
        width: auto;
    }

    .call-dock {
        bottom: calc(var(--tabbar-height) + 12px + env(safe-area-inset-bottom));
        left: 12px;
        right: 12px;
        transform: none;
    }

    .call-dock__text {
        flex: 1;
        min-width: 0;
    }

    .toast-host {
        bottom: calc(var(--tabbar-height) + 12px);
        left: 16px;
        right: 16px;
        width: auto;
    }
}

@media (max-width: 639px) {
    /* Reception is a desk workflow; on phones the tab bar keeps the five everyday pages. */
    .tabbar__item--wide {
        display: none;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat strong {
        font-size: var(--text-xl);
    }

    .stat__icon {
        height: 40px;
        width: 40px;
    }

    .contact-grid,
    .presence-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 12px 12px;
    }

    .call-identity h2 {
        font-size: var(--text-xl);
    }

    .ctrl {
        min-width: 56px;
    }

    .ctrl__icon {
        height: 52px;
        width: 52px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
