:root {
    --col1: 300px;
    --col2: 280px;
    --col4: 220px;
    --border: var(--dough-300);
    --bg-input: var(--bg-primary, #fff);
    --status-danger-bg: #fef2f2;
    --status-danger-text: #991b1b;
    --status-danger-border: #fca5a5;
    --status-success-bg: #f0fdf4;
    --status-success-border: #86efac;
    --brand-blue-bg: #eff6ff;
    --brand-blue-hover: #007bc2;
    --brand-green: #2d8a4e;
}

html, body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: calc(50px + var(--safe-top));
    padding: 0 0.75rem;
    padding-top: var(--safe-top);
    background: var(--brand-blue);
    box-shadow: none;
    flex-shrink: 0;
    z-index: 100;
    gap: 0.5rem;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.header-title {
    font-family: var(--font-display);
    font-variation-settings: "wght" 950, "wdth" 75, "slnt" 0;
    font-size: 1rem;
    color: #fff;
    text-transform: uppercase;
    line-height: .8;
}
.header-center {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}
.header-grade-filter {
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    font-family: inherit;
    font-size: 0.78rem;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 150px;
}
.header-grade-filter:focus-visible { outline: 2px solid var(--dough-100); outline-offset: 1px; }
.header-grade-filter option { color: var(--text-primary); background: var(--dough-100); }
.header-team-filter {
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.15);
    font-family: inherit;
    font-size: 0.78rem;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 220px;
}
.header-team-filter:focus-visible { outline: 2px solid var(--dough-100); outline-offset: 1px; }
.header-team-filter option { color: var(--text-primary); background: var(--dough-100); }
.header-team-filter option.filter-group-header { color: var(--dough-700); font-weight: 700; background: var(--dough-200); }
.header-search {
    flex: 1;
    position: relative;
    min-width: 0;
    display: flex;
    gap: 0;
}
.header-search-field {
    padding: 0.3rem 0.3rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-right: none;
    border-radius: 6px 0 0 6px;
    background: rgba(255,255,255,0.2);
    font-family: inherit;
    font-size: 0.72rem;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    max-width: 110px;
}
.header-search-field:focus-visible { outline: 2px solid var(--dough-100); outline-offset: 1px; }
.header-search-field option { color: var(--text-primary); background: var(--dough-100); }
.header-search .search-input {
    flex: 1;
    min-width: 120px;
    padding: 0.3rem 0.6rem;
    padding-right: 2rem;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 0 6px 6px 0;
    background: rgba(255,255,255,0.15);
    font-family: inherit;
    font-size: 0.8rem;
    color: #fff;
}
.header-search .search-input::placeholder { color: rgba(255,255,255,0.6); }
.header-search .search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
}
.header-search .search-clear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: rgba(255,255,255,0.6);
    display: none;
    padding: 0.15rem;
}
.header-search .search-clear.show { display: block; }
.header-btn {
    background: none;
    border: none;
    color: #fff;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem;
    min-height: 44px;
    min-width: 44px;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.header-btn:hover { opacity: 0.75; }
.header-btn:focus-visible { outline: 2px solid var(--dough-100); outline-offset: 2px; }
.header-btn--calendar {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.72rem;
    white-space: nowrap;
}
.header-btn--create-org {
    background: var(--accessible-red);
    color: var(--dough-100);
    font-weight: 700;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
}
.header-btn--create-org:hover { opacity: 0.85; }
.header-right {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.header-link {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 99rem;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.header-link:hover { background: rgba(255,255,255,0.25); }
.header-link:focus-visible { outline: 2px solid var(--dough-100); outline-offset: 2px; }

/* Search results dropdown */
.search-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    background: var(--dough-100);
    border: 1px solid var(--dough-300);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 150;
    max-height: 320px;
    overflow-y: auto;
    min-width: 300px;
}
.search-results.open { display: block; }
.search-result {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--dough-200);
    font-size: 0.82rem;
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: var(--dough-200); }
.search-result-name {
    font-weight: 600;
    color: var(--text-primary);
}
.search-result-detail {
    color: var(--text-tertiary);
    font-size: 0.75rem;
}
.search-no-results {
    padding: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
}
.search-loading {
    padding: 0.75rem;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
}
.search-footer {
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    color: var(--text-tertiary);
    border-top: 1px solid var(--dough-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.search-footer a {
    color: var(--accessible-blue);
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}
.search-footer a:hover { text-decoration: underline; }

/* ======== PAGE BODY — 4-column CSS grid ======== */
.page-body {
    flex: 1;
    display: grid;
    grid-template-columns: var(--col1) 4px var(--col2) 4px 1fr 4px var(--col4);
    grid-template-rows: 1fr auto;
    overflow: hidden;
}

/* Column 1 — Contact Info (always-visible summary) */
.contact-info-panel {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    background: var(--dough-100);
    border-right: 1px solid var(--dough-300);
    overflow: hidden;
    contain: layout paint;
}
/* Contact search card — stacked inputs */
#cs-name:focus, #cs-phone:focus, #cs-email:focus {
    background: var(--dough-50);
    box-shadow: inset 0 0 0 1px var(--brand-blue);
}
#cs-name::placeholder, #cs-phone::placeholder {
    color: var(--text-tertiary);
}
/* Voice bar — docked call controls */
.vb-btn {
    padding: 4px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--dough-300);
    min-height: 36px;
    min-width: 36px;
    transition: background 0.15s;
}
.vb-btn:hover { background: rgba(255,255,255,0.2); }
.vb-btn--hangup { background: var(--status-danger); border-color: var(--status-danger); color: #fff; }
.vb-btn--hangup:hover { background: var(--accessible-red); }
.vb-btn.active { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
#voice-record.active { background: var(--status-danger); border-color: var(--status-danger); color: #fff; }
/* Collapsible metadata */
.ci-meta-details summary { list-style: none; }
.ci-meta-details summary::-webkit-details-marker { display: none; }
.ci-meta-details summary::before { content: '\25B6'; font-size: 0.55rem; margin-right: 4px; display: inline-block; transition: transform 0.25s cubic-bezier(0.4,0,0.2,1); }
.ci-meta-details[open] summary::before { transform: rotate(90deg); }
/* Extension fields */
.ci-ext { border-color: var(--dough-300); }

.contact-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    text-align: center;
    padding: 0.75rem;
}
.queue-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 200px;
}
.queue-prompt-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.queue-prompt-msg {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}
.queue-prompt-msg.no-leads {
    color: var(--brand-red);
    font-weight: 600;
}
.ci-card {
    display: none;
    flex-direction: column;
    padding: 0.4rem;
    gap: 0;
    font-size: 0.75rem;
    overflow-y: auto;
    flex: 1;
}
.ci-card.active {
    display: flex;
}
/* Accordion contact cards */
.ci-contact-card {
    border: none;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    overflow: hidden;
    transition: box-shadow 0.15s;
    box-shadow: 0 4px 6px rgba(96,57,19,0.08);
    background: var(--dough-50);
}
.ci-contact-card:hover:not(.ci-contact-card--active) {
    box-shadow: 0 4px 8px rgba(96,57,19,0.12);
}
.ci-contact-card--active {
    box-shadow: 0 4px 6px rgba(96,57,19,0.08), 0 0 0 2px var(--brand-blue);
}
.ci-contact-card-header {
    user-select: none;
    transition: background 0.15s ease;
    cursor: pointer;
}
.ci-contact-card-header:hover {
    background: color-mix(in srgb, var(--brand-blue) 4%, transparent);
}
.ci-contact-card:not(.ci-contact-card--active) .ci-contact-card-header:hover {
    background: var(--dough-200);
}
/* Org section styling */
.ci-org-section {
    padding-bottom: 0.3rem;
    background: var(--dough-100);
    border-radius: 6px;
    padding: 0.5rem;
    margin: -0.1rem -0.1rem 0.3rem;
}
.ci-org-section .ci-org-prominent {
    font-size: 1rem;
}
/* Team contact person cards */
.ci-tc-person-card {
    border: 1px solid var(--dough-400);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    background: var(--dough-50);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: border-color 0.15s, background 0.15s;
}
.ci-tc-person-card:hover {
    border-color: var(--brand-blue);
    box-shadow: 0 2px 4px rgba(96,57,19,0.08);
}
.ci-tc-person-card.tc-active {
    border-color: var(--brand-blue);
}
.ci-tc-person-card.tc-collapsed:hover {
    background: var(--dough-50);
}
.ci-group-pic {
    width: 100%;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    cursor: pointer;
}
/* VS-style: Name prominent at top */
.ci-name {
    font-family: var(--font-display);
    font-variation-settings: "wght" 900, "wdth" 75, "slnt" 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: .9;
    word-break: break-word;
}
.ci-name-wrap { position: relative; }
.ci-name-split { display: flex; gap: 6px; }
.ci-name-split input { font-family: var(--font-text); font-weight: 700; font-size: 1.05rem; }
/* VS-style: Title under name (smaller, muted) */
.ci-title-field {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.3;
    border-color: var(--dough-300);
    background: var(--dough-50);
}
/* VS-style: Org name large and prominent */
.ci-org-row {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    margin-top: 0.25rem;
}
.ci-org-prominent {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    flex: 1;
    min-width: 0;
    border-color: var(--dough-300);
    background: var(--dough-50);
}
.ci-org-zip {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-tertiary);
    background: var(--dough-400);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
/* VS-style: Section labels (Address, Mobile, etc.) */
.ci-section-label {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-top: 0.15rem;
}
/* VS-style: Contact line with icon button */
.ci-contact-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.1rem 0;
}
.ci-contact-row .ci-edit {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
}
.ci-contact-row .ci-edit.ci-phone-big {
    font-size: 0.88rem;
    font-weight: 600;
}
/* VS-style: Circular icon buttons for email/phone */
.ci-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--brand-blue);
    background: transparent;
    color: var(--brand-blue);
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.ci-icon-btn:hover {
    background: var(--brand-blue);
    color: #fff;
}
.ci-icon-btn:active {
    background: var(--dark-blue);
    color: #fff;
}
/* Small icon button variant for team card headers */
.ci-icon-btn--sm {
    width: 22px;
    height: 22px;
    border-width: 1.5px;
    font-size: 0.7rem;
}
/* Disabled state for action icons when data is missing */
.ci-icon-btn.ci-btn-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}
.ci-dnc-btn.ci-btn-disabled {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}
/* VS-style: Metadata grid at bottom */
.ci-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.5rem;
    font-size: 0.72rem;
    align-items: baseline;
}
.ci-meta-label {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    white-space: nowrap;
}
.ci-meta-value {
    color: var(--text-secondary);
    font-size: 0.72rem;
    word-break: break-word;
}
.ci-meta-value input.ci-edit {
    font-size: 0.72rem;
    padding: 0.1rem 0.25rem;
}
.ci-lead-status {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.72rem;
    color: var(--text-primary);
    background: var(--dough-50);
    cursor: pointer;
}
.ci-lead-status:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.ci-field {
    display: flex;
    gap: 0.3rem;
    align-items: baseline;
    line-height: 1.4;
    min-height: 1.2em;
}
.ci-label {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    text-transform: uppercase;
    flex-shrink: 0;
    min-width: 3rem;
}
.ci-value {
    color: var(--text-secondary);
    font-size: 0.75rem;
    word-break: break-word;
}
.ci-value a {
    color: var(--brand-blue);
    text-decoration: none;
}
.ci-value a:hover { text-decoration: underline; }
.ci-divider {
    border: none;
    height: 1px;
    background: var(--dough-300);
    margin: 0.6rem 0;
}
.routing-blocked {
    background: rgba(231,0,0,0.08);
    border: 1px solid rgba(231,0,0,0.25);
    color: var(--status-danger);
}
.ci-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    margin-top: 0.15rem;
}
.ci-tag {
    padding: 0.1rem 0.3rem;
    background: var(--brand-blue);
    color: #fff;
    border-radius: 3px;
    font-size: 0.67rem;
    font-weight: 600;
}
.ci-actions {
    display: flex;
    gap: 0.3rem;
    padding: 0.4rem 0.6rem;
    border-top: 1px solid var(--dough-300);
    background: var(--dough-100);
    flex-shrink: 0;
}
.ci-dial-row {
    display: flex;
    gap: 0.3rem;
    margin-top: 0.3rem;
}
.ci-dial-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    background: var(--brand-blue);
    color: #fff;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    border-radius: 99rem;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    flex: 1;
    white-space: nowrap;
    transition: all .1s;
}
.ci-dial-btn:hover { background: var(--accessible-blue); }
.ci-email-btn.connected { border-color: var(--dark-blue); color: var(--dark-blue); opacity: 1; }

/* Email compose modal */
.email-modal { max-width: 640px; }
.email-field { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.email-field label { min-width: 60px; font-size: 0.75rem; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; }
.email-field input, .email-field select {
    flex: 1; padding: 0.35rem 0.5rem; border: 1px solid var(--dough-300); border-radius: 6px;
    font-family: inherit; font-size: 0.8rem; color: var(--text-primary); background: var(--dough-50);
}
.email-field input:focus, .email-field select:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.email-body-editor {
    min-height: 200px; max-height: 360px; overflow-y: auto;
    padding: 0.5rem; border: 1px solid var(--dough-300); border-radius: 6px;
    font-family: inherit; font-size: 0.8rem; color: var(--text-primary); background: var(--dough-50);
    line-height: 1.5;
}
.email-body-editor:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.email-body-editor p { margin: 0 0 0.5em; }
.email-attach-bar { display: flex; gap: 0.3rem; margin-top: 0.5rem; flex-wrap: wrap; align-items: center; }
.email-attach-btn {
    padding: 0.25rem 0.5rem; border: 1px solid var(--dough-300); border-radius: 4px;
    background: var(--dough-50); font-family: inherit; font-size: 0.7rem; font-weight: 600;
    color: var(--text-secondary); cursor: pointer;
}
.email-attach-btn:hover { background: var(--dough-200); }
.email-attach-chips { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-top: 0.3rem; }
.email-chip {
    display: flex; align-items: center; gap: 0.2rem;
    padding: 0.15rem 0.4rem; background: var(--dough-200); border-radius: 4px;
    font-size: 0.7rem; color: var(--text-secondary);
}
.email-chip-x { cursor: pointer; font-size: 0.85rem; color: var(--brand-red); margin-left: 0.2rem; }
.email-chip-x:hover { opacity: 0.7; }
.email-attach-dropdown {
    position: absolute; background: var(--dough-50); border: 1px solid var(--dough-300);
    border-radius: 6px; box-shadow: 0 4px 12px rgba(96,57,19,0.08); z-index: 550;
    max-height: 200px; overflow-y: auto; min-width: 200px; padding: 0.25rem 0;
}
.email-attach-dropdown-item {
    padding: 0.35rem 0.6rem; font-size: 0.75rem; cursor: pointer; display: flex;
    align-items: center; gap: 0.3rem; color: var(--text-primary);
}
.email-attach-dropdown-item:hover { background: var(--dough-200); }
.email-connect-prompt {
    text-align: center; padding: 2rem 1rem;
}
.email-connect-prompt p { margin-bottom: 1rem; font-size: 0.85rem; color: var(--text-secondary); }
.email-connect-btn {
    padding: 0.5rem 1.5rem; background: var(--brand-blue); color: #fff; border: none;
    border-radius: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
    cursor: pointer; text-transform: uppercase;
}
.email-connect-btn:hover { background: var(--accessible-blue); }
.email-error { color: var(--brand-red); font-size: 0.75rem; margin-top: 0.3rem; }
.email-sending { opacity: 0.6; pointer-events: none; }
.email-send-spinner {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: auto;
}
.email-send-spinner::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--accessible-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    flex-shrink: 0;
}

/* Toast notification */
/* Toast notification container */
.toast-container {
    position: fixed; top: 4rem; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; gap: 0.4rem;
    align-items: center; pointer-events: none;
}
.toast {
    background: var(--text-primary); color: #fff; padding: 0.6rem 1.2rem; border-radius: 8px;
    font-size: 0.85rem; opacity: 0; transition: opacity 0.3s;
    pointer-events: auto; display: flex; align-items: center; gap: 0.5rem;
    position: relative;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--accessible-blue); }
.toast.error { background: var(--brand-red); }
.toast.info { background: var(--brand-blue); color: #fff; }
.toast.warning { background: var(--status-warning, #f59e0b); color: #fff; }
.toast-close {
    background: none; border: none; color: rgba(255,255,255,0.7); font-size: 1.1rem;
    cursor: pointer; padding: 0 0.15rem; line-height: 1; flex-shrink: 0;
}
.toast-close:hover { color: #fff; }
@keyframes flash-red { 0%,100%{background:transparent;} 25%,75%{background:rgba(220,53,69,0.25);} }
.flash-highlight { animation: flash-red 0.6s ease 2; border-color: var(--brand-red) !important; }

.ci-edit {
    width: 100%;
    padding: 0.15rem 0.3rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: transparent;
    transition: border-color 0.15s, background 0.15s;
}
select.ci-edit, select.ci-edit option,
textarea.ci-edit,
select.tc-field, select.tc-field option,
textarea.tc-field,
select.tc-rank-select, select.tc-rank-select option {
    color: var(--text-secondary);
}
/* Contact rank badges */
.tc-rank-badge {
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    padding: 2px 6px;
    border-radius: 8px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tc-badge-primary { background: var(--brand-blue); }
.tc-badge-secondary { background: var(--text-tertiary); }
.tc-badge-approval { background: var(--text-primary); }
.tc-badge-additional { background: var(--dough-400); color: var(--text-primary); }
.ci-edit:hover { border-color: var(--dough-300); background: var(--dough-200); }
.ci-edit:focus {
    outline: none;
    border-color: var(--brand-blue);
    background: var(--dough-50);
}
.ci-edit.dirty { border-color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 6%, transparent); }
.ci-edit::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}
.tc-field {
    color: var(--text-secondary);
    font-family: inherit;
}
.tc-field::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}
.ci-edit-name {
    font-family: var(--font-text);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.2;
    min-height: 1.6em;
    border-color: var(--dough-300);
    background: var(--dough-50);
    word-break: break-word;
    resize: none;
    overflow: hidden;
}
.ci-edit-row {
    display: flex;
    gap: 0.15rem;
}
.ci-edit-field {
    flex: 1;
    min-width: 0;
}
.ci-save-btn {
    background: var(--brand-blue);
    border: 1px solid var(--brand-blue);
    color: #fff;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 99rem;
    text-transform: uppercase;
    transition: all .1s;
    cursor: pointer;
    white-space: nowrap;
    flex: 1;
    display: none;
}
.ci-save-btn:hover { background: var(--accessible-blue); }
.ci-save-btn.show { display: inline-block; }
/* ci-dial-sm is now only used as a JS hook class — styling comes from ci-icon-btn */

/* Resize handles */
.resize-handle {
    grid-row: 1;
    width: 4px;
    cursor: col-resize;
    background: var(--dough-300);
    transition: background 0.15s;
    position: relative;
    z-index: 10;
}
.resize-handle:hover,
.resize-handle.dragging {
    background: var(--brand-blue);
}
.resize-handle::after {
    content: '';
    position: absolute;
    inset: 0 -6px;
    z-index: 11;
}

/* Column 2 — Tabbed Data */
.tabbed-data-panel {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    background: var(--dough-50);
    border-right: 1px solid var(--dough-300);
    overflow: hidden;
    contain: layout paint;
}

.contact-card {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}
.contact-card.active {
    display: flex;
}

.td-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.88rem;
    text-align: center;
    padding: 1rem;
}

/* Tabs */
.contact-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--dough-300);
    scrollbar-width: none;
    flex-shrink: 0;
}
.contact-tabs::-webkit-scrollbar { display: none; }
.contact-tab {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    margin-bottom: -2px;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.contact-tab:hover { color: var(--text-primary); border-bottom-color: var(--dough-400); }
.contact-tab.active {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-blue);
}

.tab-panels-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.tab-panel {
    display: none;
}
.tab-panel.active { display: block; }

.contact-fields {
    display: grid;
    grid-template-columns: auto 1fr 1.2rem;
    gap: 0.3rem 0.5rem;
    font-size: 0.88rem;
    align-items: center;
}
/* 2-col for tabs without save indicators (org, store, etc.) */
.contact-fields.two-col {
    grid-template-columns: auto 1fr;
}
.field-label {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    text-transform: uppercase;
    padding-top: 0.35rem;
}
.field-input {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--dough-200);
    width: 100%;
    transition: border-color 0.15s, background 0.15s;
}
.field-input:focus { outline: none; border-color: var(--brand-blue); background: var(--dough-50); }
.field-input.dirty { border-color: var(--brand-blue); background: var(--dough-50); }
/* Textareas in lead fields span full width below their label — label too */
.contact-fields textarea.field-input { grid-column: 1 / -1; }
.contact-fields .field-label--full { grid-column: 1 / -1; text-align: left; }
select.field-input { cursor: pointer; }
.field-readonly {
    padding: 0.3rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}
.field-readonly a {
    color: var(--brand-blue);
    text-decoration: none;
}
.field-readonly a:hover { text-decoration: underline; }

.save-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-top: 1px solid var(--dough-300);
    background: var(--dough-100);
}
.save-contact-btn {
    background: var(--brand-blue);
    border: 1px solid var(--brand-blue);
    color: #fff;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 99rem;
    text-transform: uppercase;
    transition: all .1s;
    cursor: pointer;
    white-space: nowrap;
    display: none;
}
.save-contact-btn:hover { background: var(--accessible-blue); }
.save-contact-btn.show { display: inline-block; }
.save-contact-btn.saving { opacity: 0.6; pointer-events: none; position: relative; }
.save-contact-btn.saving::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 4px;
    vertical-align: middle;
}
.save-status {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    display: none;
}
.save-status.show { display: inline; }
.save-status.error { color: var(--accessible-red); }
.save-status.success { color: var(--accessible-blue); }

/* + Add Contact button — override inline styles */
#cs-add-btn, #ci-tc-add-btn {
    background: var(--brand-blue) !important;
    border: none !important;
    border-radius: 99rem !important;
    transition: background 0.1s !important;
}
#cs-add-btn:hover, #ci-tc-add-btn:hover {
    background: var(--accessible-blue) !important;
}
#cs-add-btn:active, #ci-tc-add-btn:active {
    background: var(--dark-blue) !important;
}

/* Column 3 — Script panel */
.script-panel {
    grid-column: 5;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    contain: layout paint;
    min-width: 0;
    /* Cap the readable width on wide/ultrawide monitors and center within
       the 1fr grid cell — script content doesn't benefit from stretching
       past ~1300px, and script buttons become hard to scan when spread wide. */
    max-width: 1300px;
    width: 100%;
    justify-self: center;
}

/* Toolbar */
.toolbar {
    flex-shrink: 0;
    background: var(--dough-100);
    border-bottom: 1px solid var(--dough-300);
    padding: 0.5rem 0.75rem;
}
.script-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--dough-300);
    border-radius: 8px;
    background: var(--dough-200);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238f6c49' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    transition: border-color 0.15s;
}
.script-select:hover {
    border-color: var(--text-tertiary);
}
.script-select:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.toolbar-gear {
    background: none;
    border: 1px solid var(--dough-300);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s;
}
.toolbar-gear:hover { color: var(--text-primary); border-color: var(--text-secondary); }

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    min-height: 1.2em;
}
.breadcrumb-item {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.15s;
}
.breadcrumb-item:hover { text-decoration-color: var(--text-tertiary); }
.breadcrumb-item.current {
    font-weight: 600;
    color: var(--text-primary);
    cursor: default;
    text-decoration: none;
}
.breadcrumb-sep { color: var(--dough-300); margin: 0 0.15rem; user-select: none; }

/* Content area */
.content-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

/* Login gate */
.login-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1rem;
}
.login-gate h2 {
    font-family: var(--font-display);
    font-variation-settings: "wght" 900, "wdth" 75, "slnt" 0;
    font-size: 1.3rem;
    color: var(--text-primary);
    text-transform: uppercase;
    line-height: .8;
}
.login-gate input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--dough-300);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    width: 240px;
    text-align: center;
}
.login-gate input:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.login-gate button {
    padding: 0.6rem 2rem;
    background: var(--brand-red);
    color: #fff;
    border: none;
    border-radius: 99rem;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: all .1s;
    cursor: pointer;
}
.login-gate button:hover { background: var(--accessible-red); }
.login-gate .login-error {
    color: var(--accessible-red);
    font-size: 0.85rem;
    display: none;
}
.login-gate .remember-row {
    display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-secondary);
}
.login-gate .remember-row input { width: auto; }

/* Response buttons */
.responses-area {
    flex-shrink: 0;
    background: var(--dough-100);
    border-top: 1px solid var(--dough-300);
    padding: 0.5rem;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
    max-height: 40vh;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.responses-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-start;
    flex: 1;
    min-width: 0;
    align-items: center;
}
.response-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.7rem;
    min-height: 28px;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 99rem;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.72rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all .1s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.response-pill:hover { background: var(--accessible-blue); }
.response-pill:active { background: var(--dark-blue); }
.response-pill.visited::after {
    content: '\2713';
    font-size: 0.65em;
    opacity: 0.6;
    margin-left: 0.15rem;
}
.pill-badge { font-size: 0.65em; opacity: 0.65; font-weight: 400; }
.pill-key { font-size: 0.6em; opacity: 0.4; font-family: 'Consolas', monospace; margin-right: 0.1rem; }

/* Script-type pill variants */
.pill-call { background: var(--text-primary); }
.pill-call:hover { background: var(--text-secondary); }
.pill-ko { background: transparent; color: var(--text-primary); border: 1.5px solid var(--text-primary); }
.pill-ko:hover { background: var(--dough-300); }
.pill-agreement { background: var(--brand-red); }
.pill-agreement:hover { background: var(--accessible-red); }
.pill-vm { background: var(--text-tertiary); }
.pill-vm:hover { background: var(--text-secondary); }
.pill-vr { background: transparent; color: var(--brand-red); border: 1.5px solid var(--brand-red); }
.pill-vr:hover { background: color-mix(in srgb, var(--accessible-red) 8%, transparent); }
.pill-end { }
.pill-group-break { width: 100%; height: 0.35rem; }

.start-over-btn {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.3rem 0.8rem;
    background: none;
    border: 1px solid var(--accessible-blue);
    border-radius: 20px;
    color: var(--accessible-blue);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.start-over-btn:hover { background: color-mix(in srgb, var(--brand-blue) 8%, transparent); }

/* End card */
.end-card {
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 1rem;
    background: var(--dough-200);
    border-radius: 12px;
    border: 1px solid var(--dough-300);
}
.end-card h3 {
    font-family: var(--font-display);
    font-variation-settings: "wght" 900, "wdth" 75, "slnt" 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    line-height: .8;
    margin-bottom: 0.5rem;
}
.end-card p {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 1rem;
    color: var(--text-tertiary);
}
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--dough-300);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Column 4 — Right Sidebar (Notes + Result Codes) */
.right-sidebar {
    grid-column: 7;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    background: var(--dough-100);
    border-left: 1px solid var(--dough-300);
    overflow: hidden;
}
.rs-section {
    padding: 0.5rem;
}
.rs-header {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.3rem;
}
.rs-textarea {
    flex: 1;
    width: 100%;
    min-height: 60px;
    padding: 0.4rem;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.78rem;
    color: var(--text-primary);
    background: var(--dough-50);
    resize: none;
}
.rs-textarea:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.rs-comments {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
.notes-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--dough-300);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;     /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
}
.notes-tabs::-webkit-scrollbar { display: none; }
.notes-tab {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
}
.notes-tab:hover { color: var(--text-primary); border-bottom-color: var(--dough-400); }
.notes-tab.active {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-blue);
}
.notes-panel {
    display: none;
    flex: 1;
    flex-direction: column;
    padding-top: 0.35rem;
    min-height: 0;
}
.notes-panel.active {
    display: flex;
}
.notes-textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary, #fff);
    min-height: 0;
}
.notes-textarea:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.notes-textarea.notes-new { flex: 0 0 auto; min-height: 60px; border-top: 2px solid var(--brand-blue); border-radius: 0 0 6px 6px; }
.notes-history { max-height: 120px; overflow-y: auto; font-size: 0.75rem; color: var(--text-secondary); padding: 0.4rem 0.5rem; background: var(--bg-primary, #fff); border: 1px solid var(--dough-200); border-radius: 6px 6px 0 0; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.notes-history:empty { display: none; }
.notes-history:empty + .notes-textarea.notes-new { border-radius: 6px; border-top: 1px solid var(--dough-300); }

/* AI Chat Panel — removed (unused) */

.call-warning {
    background: var(--dough-200);
    border: 1px solid var(--dough-400);
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.5rem 0.6rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--status-warning);
}
.call-warning-text { flex: 1; }
.call-warning-dismiss {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--status-warning);
    padding: 0;
    line-height: 1;
}
.dnc-warning {
    background: color-mix(in srgb, var(--brand-red) 8%, var(--dough-100));
    border: 1px solid color-mix(in srgb, var(--brand-red) 30%, var(--dough-300));
    color: var(--lava-1000);
    text-align: center;
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    font-weight: 600;
    position: relative;
    z-index: 5;
    border-radius: 6px;
    margin: 0.3rem 0.6rem 0;
    box-shadow: 0 2px 4px rgba(200,0,0,0.08);
    transition: box-shadow 0.15s;
}
.dnc-warning:hover {
    box-shadow: 0 4px 8px rgba(200,0,0,0.15);
}
.dnc-badge {
    background: var(--status-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    cursor: default;
    transition: background 0.15s, box-shadow 0.15s;
    animation: presence-pulse 2.5s ease-in-out infinite;
}
.dnc-badge:hover {
    box-shadow: 0 0 0 2px rgba(200,0,0,0.2);
}
/* Scrub badges — LITIGANT (red), BLOCKED (red), CELL (amber) */
.scrub-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    cursor: default;
    transition: background 0.15s, box-shadow 0.15s;
}
.scrub-badge--blocked {
    background: var(--status-danger);
    color: #fff;
}
.scrub-badge--blocked:hover {
    box-shadow: 0 0 0 2px rgba(200,0,0,0.2);
}
.scrub-badge--cell {
    background: var(--dough-400);
    color: var(--text-primary);
}
.scrub-badge--cell:hover {
    box-shadow: 0 0 0 2px rgba(232,217,191,0.4);
}
.scrub-badge--rnd {
    background: var(--lava-1100);
    color: #fff;
}
.scrub-badge--ctr {
    background: var(--status-danger);
    color: #fff;
    animation: presence-pulse 2s ease-in-out infinite;
}
.scrub-badge--ctr:hover {
    box-shadow: 0 0 0 2px rgba(200,0,0,0.2);
}
.scrub-badge--time {
    background: var(--accessible-blue);
    color: #fff;
    font-variant-numeric: tabular-nums;
}
/* Disconnected / wrong number badge */
.disc-badge {
    background: var(--status-warning);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
    vertical-align: middle;
    cursor: default;
    transition: background 0.15s, box-shadow 0.15s;
}
.disc-badge:hover {
    box-shadow: 0 0 0 2px rgba(125,81,0,0.2);
}
.disc-badge--wrong {
    background: var(--status-danger);
}
.ci-dnc-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: inherit;
}
.ci-dial-sm.dnc-disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: var(--text-tertiary);
}
/* SMS icon — matches Messages tab sms/mms color */
.ci-msg-btn {
    border-color: var(--accessible-blue);
    color: var(--accessible-blue);
    opacity: 0.7;
}
.ci-msg-btn:hover {
    background: var(--accessible-blue);
    color: #fff;
    opacity: 1;
}
.ci-msg-btn:active {
    background: var(--dark-blue);
    color: #fff;
}
/* Email icon — Domino's dark blue */
.ci-email-btn {
    border-color: var(--dark-blue);
    color: var(--dark-blue);
    opacity: 0.7;
}
.ci-email-btn:hover {
    background: var(--dark-blue);
    color: #fff;
    opacity: 1;
}
.ci-email-btn:active {
    background: var(--dark-blue);
    color: #fff;
}
/* DNC circle button — text only, no icon */
.ci-dnc-btn {
    border-color: var(--status-danger);
    color: var(--status-danger);
    opacity: 0.7;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700;
    font-size: 0.5rem;
    letter-spacing: 0.02em;
}
.ci-dnc-btn:hover {
    background: var(--status-danger);
    color: #fff;
    opacity: 1;
}
.ci-dnc-btn:active {
    background: var(--accessible-red);
    color: #fff;
}
/* === Messaging Conversation View (inline in Messages tab / col2) === */
#tab-messages { display: none; flex-direction: column; }
#tab-messages.active { display: flex; }
.messaging-view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.messaging-view.active { display: flex; }
.messaging-header {
    flex-shrink: 0; background: var(--dough-200); border-bottom: 1px solid var(--dough-300);
    padding: 0.5rem 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.messaging-header .msg-contact-name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); flex: 1; }
.messaging-header .msg-contact-number { font-size: 0.8rem; color: var(--text-secondary); }
.msg-back-btn {
    background: none; border: 1px solid var(--dough-300); border-radius: 6px;
    padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-secondary); font-weight: 600;
}
.msg-back-btn:hover { background: var(--dough-100); color: var(--text-primary); }
.msg-thread {
    flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem;
}
.msg-thread-empty { color: var(--text-tertiary); text-align: center; margin-top: 2rem; font-size: 0.9rem; }
.msg-bubble {
    max-width: 80%; padding: 8px 12px; border-radius: 12px; font-size: 0.85rem;
    line-height: 1.4; word-wrap: break-word; position: relative;
}
.msg-bubble.sent {
    align-self: flex-end; background: var(--brand-blue); color: #fff;
    border-bottom-right-radius: 4px;
    animation: msg-in 0.15s ease-out;
}
.msg-bubble.received {
    align-self: flex-start; background: var(--dough-200); color: var(--text-primary);
    border-bottom-left-radius: 4px;
    animation: msg-in 0.15s ease-out;
}
@keyframes msg-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.msg-thread.no-anim .msg-bubble { animation: none !important; }
.msg-bubble-meta {
    font-size: 0.7rem; margin-top: 3px; opacity: 0.7;
}
.msg-bubble.sent .msg-bubble-meta { text-align: right; color: rgba(255,255,255,0.7); }
.msg-bubble.received .msg-bubble-meta { color: var(--text-tertiary); }
.msg-status-icon { font-size: 0.65rem; margin-left: 4px; }
.msg-media { max-width: 200px; max-height: 200px; border-radius: 6px; margin-top: 4px; cursor: pointer; }
.msg-text { font-size: 0.82rem; line-height: 1.4; word-wrap: break-word; }
.msg-meta { font-size: 0.7rem; margin-top: 3px; opacity: 0.7; }
.conv-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.conv-dot--unread { background: var(--brand-blue, #0090e2); }
.conv-dot--replied { background: var(--status-success, #22c55e); }
.conv-dot--draft { background: var(--status-warning, #f59e0b); }
.conv-item:hover > div { background: var(--dough-50, #faf8f5); }
.conv-item.active > div { background: var(--dough-100); }
.msg-compose-bar {
    flex-shrink: 0; background: var(--dough-200); border-top: 1px solid var(--dough-300);
    padding: 0.5rem 0.75rem;
}
.msg-compose-bar .msg-template-row { margin-bottom: 6px; }
.msg-compose-bar select { width: 100%; padding: 5px 8px; border: 1px solid var(--dough-300); border-radius: 6px; font-size: 12px; background: var(--bg-primary, #fff); }
.msg-compose-row { display: flex; gap: 6px; align-items: flex-end; }
.msg-compose-row textarea {
    flex: 1; min-height: 38px; max-height: 120px; padding: 8px 10px; border: 1px solid var(--dough-300);
    border-radius: 8px; font-size: 13px; resize: none; font-family: inherit; line-height: 1.4;
}
.msg-compose-row textarea:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.msg-compose-send {
    background: var(--brand-blue); color: #fff; border: none; border-radius: 50%;
    width: 36px; height: 36px; font-size: 16px; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.msg-compose-send:hover { background: var(--dark-blue); }
.msg-compose-send:disabled { opacity: 0.4; cursor: not-allowed; }
.msg-compose-extras { display: flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 11px; }
.msg-compose-extras .char-info { color: var(--text-tertiary); }
.msg-compose-extras .attach-btn {
    background: none; border: 1px solid var(--dough-300); border-radius: 4px;
    padding: 2px 8px; cursor: pointer; color: var(--text-secondary); font-size: 11px;
}
.msg-compose-extras .attach-btn:hover { background: var(--dough-100); }
/* Unified comms list in Messages tab */
.comms-list .comms-item {
    padding: 8px 10px; border-bottom: 1px solid var(--dough-200); cursor: pointer;
    font-size: 0.82rem; display: flex; gap: 8px; align-items: flex-start;
    transition: background 0.15s;
}
.comms-list .comms-item:hover { background: var(--dough-50); }
.comms-list .comms-item.selected { background: var(--dough-100); border-left: 3px solid var(--brand-blue); }
.comms-item-icon { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }
.comms-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.comms-item-top { display: flex; justify-content: space-between; align-items: center; }
.comms-item-type { font-weight: 600; font-size: 0.72rem; text-transform: uppercase; }
.comms-item-type.call { color: var(--brand-blue); }
.comms-item-type.sms, .comms-item-type.mms { color: var(--accessible-blue); }
.comms-item-type.email { color: var(--dark-blue); }
.comms-item-time { font-size: 0.68rem; color: var(--text-tertiary); }
.comms-item-preview { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.78rem; }
.comms-item-meta { font-size: 0.68rem; color: var(--text-tertiary); }
/* Text compose modal */
.text-compose-modal .modal { max-width: 420px; }
.text-compose-field { margin-bottom: 8px; }
.text-compose-field label { font-size: 11px; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 2px; }
.text-compose-field textarea { width: 100%; min-height: 80px; padding: 8px; border: 1px solid var(--dough-300); border-radius: 6px; font-family: inherit; font-size: 13px; resize: vertical; }
.text-compose-field select { width: 100%; padding: 6px 8px; border: 1px solid var(--dough-300); border-radius: 6px; font-family: inherit; font-size: 13px; }
.text-compose-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-tertiary); }
/* Comm detail view */
.comm-detail-view { display: none; flex-direction: column; height: 100%; }
.comm-detail-view.active { display: flex; }
.result-btn--dnc {
    background: var(--status-danger);
    border-color: var(--status-danger);
}
.result-btn--dnc:hover {
    background: var(--bg-primary, #fff);
    border-color: var(--status-danger);
    color: var(--status-danger);
}
.rs-results {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 80px;
    overflow: hidden;
}
.rs-results-fixed {
    flex-shrink: 0;
    padding: 0 0 0.2rem;
}
.rs-results-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 0;
}
.rs-resize-handle {
    height: 6px;
    cursor: row-resize;
    background: var(--dough-300);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.rs-resize-handle:hover { background: var(--brand-blue); }
.rs-resize-grip {
    width: 24px;
    height: 2px;
    border-radius: 1px;
    background: rgba(143,108,73,0.4);
}
.rs-resize-handle:hover .rs-resize-grip { background: rgba(255,255,255,0.7); }
.result-btn {
    width: 100%;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 99rem;
    background: var(--brand-red);
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.75rem;
    color: #fff;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    transition: all .1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}
.rb-code { font-weight: 700; }
.rb-desc { font-size: 0.6rem; font-weight: 400; opacity: 0.85; line-height: 1.1; }
@media (hover: hover) {
    .result-btn:hover {
        filter: brightness(0.85);
        transform: translateY(-1px);
    }
}
.result-btn:active {
    transform: scale(0.97);
    filter: brightness(0.7);
}
.result-btn.dimmed { opacity: 0.3; transition: opacity 0.2s; }
.result-btn.dragging { opacity: 0.4; }
.result-btn.drag-over { border-color: var(--brand-blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-blue) 30%, transparent); }
.result-btn[draggable="true"] { cursor: grab; }
.result-btn[draggable="true"]:active { cursor: grabbing; }
.result-btn--active {
    background: var(--dough-100) !important;
    color: var(--brand-red) !important;
    box-shadow: 0 0 0 2px var(--brand-red);
}
.result-more-btn {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px dashed var(--dough-300);
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}
.result-more-btn:hover { background: var(--dough-200); color: var(--text-primary); }
.result-all-panel {
    display: none;
    max-height: 45vh;
    overflow-y: auto;
    contain: content;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    background: var(--bg-primary);
    padding: 0.3rem;
}
.result-all-panel.open { display: block; }
.result-all-panel .result-group-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    padding: 0.35rem 0.2rem 0.1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.result-all-panel .result-row {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.73rem;
    color: var(--text-primary);
    transition: background 0.1s;
}
.result-all-panel .result-row:hover { background: var(--dough-200); }
.result-all-panel .result-row .pin-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
    opacity: 0.3;
    transition: opacity 0.15s;
}
.result-all-panel .result-row .pin-icon.pinned { opacity: 1; }
.result-all-panel .result-row .pin-icon:hover { opacity: 0.8; }
.result-all-panel .result-row .result-code-label { flex: 1; font-weight: 600; }
.result-all-panel .result-row .result-desc { color: var(--text-tertiary); font-size: 0.65rem; }
.result-defaults-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.3rem 0.5rem;
    border: 1px dashed var(--dough-300);
    border-radius: 6px;
    background: transparent;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, color 0.15s;
}
.result-defaults-btn:hover { background: var(--dough-200); color: var(--text-primary); }

/* Decision tree filter */
.result-tree {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid var(--dough-300);
}
.result-tree-q {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.result-tree-btn {
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
    background: transparent;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    color: var(--text-secondary);
}
.result-tree-btn:hover { background: var(--dough-200); }
.result-tree-btn.active { color: #fff; border-color: transparent; }
.result-tree-yes.active { background: var(--brand-green, #2d8a4e); }
.result-tree-no.active { background: var(--brand-red); }
.result-tree-all.active { background: var(--brand-blue); }

/* Manager Dashboard */
.mgr-dashboard {
    position: fixed;
    top: 0; right: 0;
    width: 380px; max-width: 90vw;
    height: 100vh;
    background: var(--dough-100);
    z-index: 200;
    box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.mgr-dash-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.75rem 1rem;
    background: var(--brand-blue); color: #fff;
    font-size: 0.9rem; font-weight: 700;
    position: sticky; top: 0; z-index: 1;
}
.mgr-dash-close { cursor: pointer; font-size: 1.4rem; line-height: 1; }
.mgr-dash-summary {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--dough-300);
}
.mgr-pill {
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.65rem; font-weight: 600;
    background: var(--dough-200);
    color: var(--text-primary);
}
.mgr-pill--green { background: color-mix(in srgb, var(--accessible-blue) 12%, transparent); color: var(--accessible-blue); }
.mgr-pill--red { background: color-mix(in srgb, var(--accessible-red) 12%, transparent); color: var(--accessible-red); }
.mgr-dash-section {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--dough-200);
}
.mgr-dash-section > b { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }
.mgr-list { margin-top: 0.3rem; }
.mgr-empty { font-size: 0.7rem; color: var(--text-tertiary); padding: 0.5rem 0; }
.mgr-rep-row {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.25rem 0;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--dough-200);
}
.mgr-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mgr-rep-name { flex: 1; font-weight: 600; }
.mgr-rep-state { font-size: 0.65rem; color: var(--text-secondary); min-width: 50px; }
.mgr-rep-team { font-size: 0.6rem; color: var(--text-tertiary); }
.mgr-stats-hdr, .mgr-stats-row {
    display: grid;
    grid-template-columns: 1fr 40px 45px 40px 50px 70px;
    gap: 0.2rem;
    font-size: 0.68rem;
    padding: 0.2rem 0;
    align-items: center;
}
.mgr-stats-hdr { font-weight: 700; color: var(--text-secondary); border-bottom: 1px solid var(--dough-300); }
.mgr-stats-row { border-bottom: 1px solid var(--dough-200); }
.mgr-stats-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mgr-rc-row {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.15rem 0;
    font-size: 0.68rem;
}
.mgr-rc-code { min-width: 70px; font-weight: 600; }
.mgr-rc-bar { flex: 1; height: 10px; background: var(--dough-200); border-radius: 5px; overflow: hidden; }
.mgr-rc-fill { height: 100%; width: 100%; background: var(--brand-blue); border-radius: 5px; transform-origin: left; transition: transform 0.3s; }
.mgr-rc-cnt { min-width: 30px; text-align: right; color: var(--text-secondary); }

/* Active Calls in manager dashboard */
.mgr-call-row {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.3rem 0;
    font-size: 0.72rem;
    border-bottom: 1px solid var(--dough-200);
}
.mgr-call-row .mgr-call-agent { flex: 1; font-weight: 600; }
.mgr-call-row .mgr-call-to { flex: 1; color: var(--text-secondary); }
.mgr-call-row .mgr-call-dur { min-width: 40px; font-size: 0.65rem; color: var(--text-secondary); }
.mgr-call-listen {
    padding: 2px 8px; font-size: 0.62rem; font-weight: 700;
    background: var(--dark-blue); color: #fff; border: none; border-radius: 4px;
    cursor: pointer; text-transform: uppercase; letter-spacing: 0.03em;
}
.mgr-call-listen:hover { background: var(--brand-blue); }
.mgr-call-listen:disabled { opacity: 0.5; cursor: not-allowed; }

/* My Stats panel */
.my-stats-panel {
    position: fixed;
    top: 44px; right: 0;
    width: 340px; max-width: 90vw;
    background: var(--dough-100);
    z-index: 199;
    box-shadow: -4px 4px 20px rgba(0,0,0,0.08);
    border-radius: 0 0 0 12px;
    overflow: hidden;
}
.my-stats-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 1rem;
    background: var(--dark-blue); color: #fff;
    font-size: 0.85rem; font-weight: 700;
}
.my-stats-close { cursor: pointer; font-size: 1.3rem; line-height: 1; }
.my-stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem; padding: 0.8rem 1rem;
}
.my-stats-card {
    text-align: center;
    padding: 0.4rem 0;
    background: var(--bg-primary, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.my-stats-val { font-size: 1.1rem; font-weight: 800; color: var(--brand-blue); }
.my-stats-label { font-size: 0.58rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.my-stats-range {
    display: flex; justify-content: center; gap: 0.4rem;
    padding: 0 1rem 0.8rem;
}
.my-stats-range-btn {
    padding: 3px 12px; font-size: 0.62rem; font-weight: 600;
    border: 1px solid var(--dough-300); border-radius: 12px;
    background: var(--bg-primary, #fff); color: var(--text-secondary); cursor: pointer;
}
.my-stats-range-btn.active { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }

/* Hamburger menu (left slide-out) */
.menu-panel {
    position: fixed; top: 0; left: 0; width: 300px; max-width: 85vw;
    height: 100%; background: var(--dough-100); z-index: 201;
    transform: translateX(-100%); transition: transform 0.25s ease;
    display: flex; flex-direction: column;
    box-shadow: 4px 0 20px rgba(71,43,16,0.12);
}
.menu-panel.open { transform: translateX(0); }
.menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem; padding-top: calc(0.75rem + var(--safe-top));
    background: var(--brand-blue); color: #fff;
    font-family: var(--font-display); font-variation-settings: "wght" 900, "wdth" 75, "slnt" 0; font-size: 0.9rem;
    text-transform: uppercase; line-height: .8;
}
.menu-header button {
    background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
    transition: opacity 0.15s;
}
.menu-header button:hover { opacity: 0.7; }
.menu-body {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1rem + var(--safe-bottom));
}
.menu-section-label {
    padding: 0.75rem 1rem 0.25rem; font-size: 0.68rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--accessible-blue); font-weight: 700;
    font-family: var(--font-display);
    border-left: 3px solid var(--brand-blue); margin-left: 0.5rem; padding-left: 0.5rem;
}
.menu-link {
    display: block; padding: 0.6rem 1rem; color: var(--text-primary);
    text-decoration: none; font-size: 0.85rem;
    border-bottom: 1px solid var(--dough-200);
    transition: background 0.15s, padding-left 0.15s;
}
.menu-link:hover { background: var(--dough-200); padding-left: 1.15rem; }
.ext-icon { font-size: 0.65rem; opacity: 0.5; margin-left: 2px; }
.menu-form-subs { padding: 0.4rem 1rem; }
#hamburger-btn { position: relative; }
.notif-dot {
    position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--accessible-red); display: none;
}
.notif-dot.active { display: block; }

/* Bottom Bar — Call History */
.bottom-bar {
    grid-column: 1 / -1;
    grid-row: 2;
    background: var(--dough-50);
    display: flex;
    flex-direction: column;
    max-height: 200px;
    border-top: 1px solid var(--dough-300);
}
.bottom-bar.collapsed {
    max-height: 30px;
}
.bb-drag-handle {
    height: 6px; cursor: row-resize; background: var(--dough-200);
    border-top: 2px solid var(--dough-300); flex-shrink: 0;
    transition: background 0.15s;
    position: relative;
}
.bb-drag-handle::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 2px;
    background: var(--dough-300);
    border-radius: 1px;
}
.bb-drag-handle:hover,
.bb-drag-handle.dragging { background: var(--brand-blue); }
.bb-drag-handle:hover::after,
.bb-drag-handle.dragging::after { background: rgba(255,255,255,0.7); }
.bottom-bar.collapsed .bb-drag-handle { display: none; }
.bb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.75rem;
    height: 30px;
    flex-shrink: 0;
    background: var(--dough-100);
}
.bb-tabs {
    display: flex;
    gap: 0.1rem;
}
.bb-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 0;
    transition: color 0.15s, border-color 0.15s;
}
.bb-tab:hover { color: var(--text-primary); border-bottom-color: var(--dough-400); }
.bb-tab.active {
    color: var(--brand-blue);
    border-bottom-color: var(--brand-blue);
}
.bb-toggle {
    background: none;
    border: none;
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 0.2rem;
    transition: transform 0.25s, color 0.15s;
}
.bb-toggle:hover { color: var(--text-primary); }
.bottom-bar.collapsed .bb-toggle {
    transform: rotate(180deg);
}
.bb-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem 0.5rem;
}
.bottom-bar.collapsed .bb-content {
    display: none;
}
.bb-panel { display: none; }
.bb-panel.active { display: block; }
/* Skeleton loading placeholders for tab content */
.skeleton-loader { padding: 12px; }
.skeleton-bar { height: 12px; background: linear-gradient(90deg, var(--dough-300) 25%, var(--dough-200) 50%, var(--dough-300) 75%); background-size: 200% 100%; animation: skeleton-pulse 1.5s infinite; border-radius: 4px; margin-bottom: 8px; }
.skeleton-bar:nth-child(2) { width: 75%; }
.skeleton-bar:nth-child(3) { width: 60%; }
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.bb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.bb-table th {
    background: var(--dough-200);
    padding: 0.35rem 0.5rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--dough-300);
    position: sticky;
    top: 0;
}
.bb-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--dough-200);
    color: var(--text-secondary);
}

/* District Blocked Dates */
.blocked-dates-header {
    display: flex; align-items: center; gap: 8px; padding: 0.4rem 0;
    font-size: 0.78rem; font-weight: 600; color: var(--text-primary);
    border-bottom: 1px solid var(--dough-200); margin-bottom: 0.4rem;
}
.blocked-dates-header .district-label {
    background: var(--dough-200); padding: 1px 6px; border-radius: 3px;
    font-size: 0.7rem; color: var(--text-secondary); font-weight: 500;
}
.blocked-date-row {
    display: flex; align-items: center; gap: 8px; padding: 0.3rem 0.4rem;
    border-bottom: 1px solid var(--dough-100); font-size: 0.75rem;
    border-left: 3px solid transparent;
}
.blocked-date-row:hover { background: var(--dough-50); }
.blocked-date-row.bd-past { border-left-color: var(--dough-400); opacity: 0.6; }
.blocked-date-row.bd-active { border-left-color: var(--status-danger); background: var(--dough-100); }
.blocked-date-row.bd-future { border-left-color: var(--status-warning); }
.bd-org { font-weight: 600; color: var(--text-primary); min-width: 180px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-dates { color: var(--text-secondary); white-space: nowrap; }
.bd-status { font-size: 0.65rem; padding: 1px 5px; border-radius: 3px; font-weight: 600; }
.bd-status.past { background: var(--dough-300); color: var(--text-tertiary); }
.bd-status.active { background: var(--dough-200); color: var(--status-danger); }
.bd-status.future { background: var(--dough-200); color: var(--status-warning); }
.bd-legend { display: flex; gap: 12px; font-size: 0.65rem; color: var(--text-tertiary); padding: 0.3rem 0; }
.bd-legend-item { display: flex; align-items: center; gap: 3px; }
.bd-legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* Mobile compact contact bar */
.contact-bar-mobile {
    display: none;
    background: var(--dough-200);
    border-bottom: 1px solid var(--dough-300);
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.contact-bar-mobile .bar-name {
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.contact-bar-mobile .bar-detail {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Mapping editor modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
}
.modal-overlay.open { display: flex; align-items: center; justify-content: center; }
.modal {
    background: var(--dough-100);
    border-radius: 12px;
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    animation: caller-modal-in 0.2s ease-out;
}
@keyframes caller-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--brand-blue);
    color: #fff;
    border-radius: 12px 12px 0 0;
    font-family: var(--font-display);
    font-variation-settings: "wght" 900, "wdth" 75, "slnt" 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    line-height: .8;
}
.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: opacity 0.15s;
}
.modal-close:hover { opacity: 0.7; }
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}
.mapping-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.4rem;
}
.mapping-row input {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--bg-primary, #fff);
}
.mapping-row input:focus { outline: 2px solid var(--brand-blue); outline-offset: -1px; }
.mapping-delete {
    background: none;
    border: none;
    color: var(--brand-red);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem;
}
.mapping-add-btn {
    margin-top: 0.5rem;
    padding: 0.4rem 1rem;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.mapping-add-btn:hover { background: var(--accessible-blue); }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--dough-300);
}
.modal-footer button {
    padding: 0.5rem 1rem;
    border-radius: 99rem;
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.85rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all .1s;
}
.btn-save {
    background: var(--brand-blue);
    color: #fff;
    border: none;
}
.btn-save:hover { background: var(--accessible-blue); }
.btn-reset {
    background: none;
    border: 1px solid var(--text-tertiary);
    color: var(--text-tertiary);
}
.btn-reset:hover { background: var(--dough-300); }
.btn-cancel {
    background: none;
    border: 1px solid var(--dough-300);
    color: var(--text-secondary);
}
.btn-cancel:hover {
    background: var(--dough-200);
    color: var(--text-primary);
}

.mapping-help {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.mapping-header {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.3px;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--dough-300);
    margin-bottom: 0.4rem;
}

/* Rep name prompt */
.rep-prompt {
    display: none;
    background: var(--dough-200);
    border-bottom: 1px solid var(--dough-300);
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    align-items: center;
    gap: 0.5rem;
}
.rep-prompt.show { display: flex; }
.rep-prompt input {
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.8rem;
    width: 120px;
}
.rep-prompt button {
    padding: 0.3rem 0.6rem;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

/* Prevent text selection while dragging resize handles */
body.resizing {
    cursor: col-resize !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}
body.resizing * {
    cursor: col-resize !important;
}

/* Focus management: suppress outline on mouse click, show on keyboard nav */
*:focus { outline: none; }
*:focus-visible {
    outline: 2px solid var(--accessible-blue);
    outline-offset: 2px;
}

/* Voice mute active state (toggled via classList in JS) */
.voice-mute--active {
    background: var(--brand-red) !important;
    color: #fff !important;
}

/* Responsive */
@media (max-width: 768px) {
    .page-body {
        display: flex;
        flex-direction: column;
    }
    .contact-info-panel {
        display: none;
    }
    .tabbed-data-panel {
        display: none;
    }
    .tabbed-data-panel.mobile-expanded {
        display: flex;
        max-height: 50vh;
    }
    .resize-handle { display: none; }
    .right-sidebar { display: none; }
    .bottom-bar { display: none; }
    .script-panel {
        flex: 1;
        grid-column: auto;
    }
    .contact-bar-mobile.active { display: flex; }
    .header-center { max-width: none; }
    /* Manager dashboard full-width on mobile */
    .mgr-dashboard { width: 100%; max-width: 100vw; }
    .my-stats-panel { width: 100%; max-width: 100vw; border-radius: 0 0 0 0; }
    /* Menu panel safe-area on mobile */
    .menu-panel { width: 85vw; }
}
/* Image Editor Modal */
#imageEditorModal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--dough-100);
    z-index: 10000;
    flex-direction: column;
}
#imageEditorModal.active { display: flex; }
#imageEditorModal .editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 52px;
    min-height: 52px;
    background: linear-gradient(135deg, var(--brand-blue) 0%, var(--accessible-blue) 100%);
    border-bottom: 2px solid var(--accessible-blue);
    z-index: 10001;
}
#imageEditorModal .editor-toolbar-title {
    color: #fff;
    font-family: var(--font-display, inherit);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#imageEditorModal .editor-toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}
#imageEditorModal .editor-bg-btn {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body, inherit);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    transition: all 0.15s ease;
}
#imageEditorModal .editor-bg-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}
#imageEditorModal .editor-close-btn {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-family: var(--font-body, inherit);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    transition: all 0.15s ease;
}
#imageEditorModal .editor-close-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
}
#imageEditorModal .editor-save-btn {
    background: var(--brand-blue);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: none;
    font-family: var(--font-body, inherit);
    font-size: 13px;
    font-weight: 700;
    padding: 7px 20px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
#imageEditorModal .editor-save-btn:hover { background: var(--accessible-blue); }
#imageEditorModal .editor-save-btn:disabled {
    background: var(--dough-400);
    cursor: not-allowed;
    box-shadow: none;
}
#imageEditorContainer {
    width: 100%;
    height: calc(100vh - 52px);
    overflow: hidden;
}
/* CE.SDK renders its own navigation bar inside the container with undo/redo/zoom.
   We keep it visible — our toolbar handles Save/Cancel, theirs handles editing controls. */
/* Org Images in KO tab — matches ci-field / ci-label patterns */
.org-images-section { grid-column: 1 / -1; margin-top: 0.15rem; }
.org-images-header {
    display: flex; align-items: center; gap: 0.4rem;
    padding-top: 0.3rem; margin-bottom: 0.25rem;
    border-top: 1px solid var(--dough-300);
}
.org-images-header span {
    color: var(--text-tertiary); font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.3px;
}
.org-images-header button {
    font-size: 0.6rem; padding: 1px 6px; border-radius: 3px; cursor: pointer;
    background: var(--dough-300); color: var(--text-tertiary); border: none;
    font-weight: 600;
}
.org-images-header button:hover { background: var(--brand-blue); color: #fff; }
.org-images-grid { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.org-image-card {
    position: relative; width: 120px; border-radius: 4px; overflow: hidden;
    border: 1px solid var(--dough-300); background: var(--bg-primary, #fff);
}
.org-image-card img {
    width: 100%; height: 40px; object-fit: cover; display: block; cursor: pointer;
}
.org-image-card .img-edit-btn {
    position: absolute; bottom: 2px; right: 2px;
    font-size: 0.55rem; padding: 1px 5px; border-radius: 3px; cursor: pointer;
    background: rgba(0,0,0,0.55); color: #fff; border: none;
    opacity: 0; transition: opacity 0.15s;
}
.org-image-card:hover .img-edit-btn { opacity: 1; }
.org-image-card .img-edit-btn:hover { background: var(--brand-red); }
.org-image-card .img-del-btn {
    position: absolute; top: 2px; right: 2px;
    font-size: 0.6rem; line-height: 1; padding: 1px 4px; border-radius: 3px; cursor: pointer;
    background: rgba(0,0,0,0.55); color: #fff; border: none;
    opacity: 0; transition: opacity 0.15s;
}
.org-image-card:hover .img-del-btn { opacity: 1; }
.org-image-card .img-del-btn:hover { background: var(--status-danger); }
.org-images-empty {
    font-size: 0.7rem; color: var(--text-tertiary); padding: 0.25rem 0;
}
.org-images-drop {
    border: 1px dashed var(--dough-300); border-radius: 4px;
    padding: 0.3rem; text-align: center; font-size: 0.65rem;
    color: var(--text-tertiary); cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    aspect-ratio: 3 / 1;
    display: flex; align-items: center; justify-content: center;
}
.org-images-drop.drag-over {
    border-color: var(--brand-blue); background: color-mix(in srgb, var(--brand-blue) 5%, transparent);
    color: var(--brand-blue);
}

/* === Script Widgets (replace PHP text-image <img> tags) === */
/* --- Script Widgets — matches site Domino's brand palette --- */
.sw-widget {
    display: inline-block; max-width: 100%;
    padding: 4px 0; border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-variation-settings: "wght" 450, "wdth" 75, "slnt" 0;
    color: var(--text-primary);
    line-height: 1.5; vertical-align: top;
}
.sw-widget a { color: var(--brand-blue); }
.sw-widget strong, .sw-widget b {
    font-variation-settings: "wght" 700, "wdth" 75, "slnt" 0;
}
.sw-loading { color: var(--text-tertiary); font-style: italic; }
.sw-loading::after {
    content: ''; display: inline-block; width: 12px; height: 12px;
    margin-left: 6px; border: 2px solid var(--dough-300);
    border-top-color: var(--brand-blue); border-radius: 50%;
    animation: sw-spin 0.8s linear infinite; vertical-align: middle;
}
@keyframes sw-spin { to { transform: rotate(360deg); } }
.sw-error {
    color: var(--brand-red); border: 1px solid var(--brand-red);
    background: var(--dough-100); padding: 4px 8px; border-radius: 4px;
}
.sw-table { border-collapse: collapse; }
.sw-table td, .sw-table th {
    padding: 2px 12px 2px 0; white-space: nowrap;
    font-size: inherit; line-height: inherit;
}
.sw-table th {
    font-variation-settings: "wght" 700, "wdth" 75, "slnt" 0;
    color: var(--text-primary);
    text-align: left; border-bottom: 1px solid var(--dough-400); padding-bottom: 4px;
}
.sw-text-red {
    color: var(--brand-red);
    font-variation-settings: "wght" 600, "wdth" 75, "slnt" 0;
}
.sw-badge-green {
    color: var(--accessible-blue);
    font-variation-settings: "wght" 600, "wdth" 75, "slnt" 0;
}
.sw-badge-yellow {
    color: var(--status-warning);
    font-variation-settings: "wght" 700, "wdth" 75, "slnt" 0;
}
.sw-badge-red {
    color: var(--brand-red);
    font-variation-settings: "wght" 700, "wdth" 75, "slnt" 0;
}
.sw-footnote { font-size: 0.8em; color: var(--text-tertiary); margin-top: 4px; }
.sw-hotlist-header {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 75, "slnt" 0;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.sw-row-red td { color: var(--brand-red); }
.sw-row-blue td { color: var(--brand-blue); }
.sw-row-grey td { color: var(--text-secondary); }

/* ============ QUEUE MODE BAR ============ */
.queue-bar {
    display: none;
    background: var(--dark-blue);
    color: var(--dough-50);
    padding: 6px 16px;
    font-size: 0.8rem;
    align-items: center;
    gap: 12px;
}
.queue-bar.active { display: flex; }
.queue-bar-label {
    font-family: var(--font-display);
    font-variation-settings: "wght" 700, "wdth" 50, "slnt" 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--dough-50);
}
.queue-bar-stats { display: flex; gap: 16px; flex: 1; }
.queue-bar-stat { opacity: 0.9; color: var(--dough-50); }
.queue-bar-stat b { color: var(--dough-50); }
.queue-bar-divider { opacity: 0.3; margin: 0 2px; }
.queue-overdue-badge {
    display: none;
    background: var(--status-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    animation: overdue-pulse 2s infinite;
}
.queue-overdue-badge.active { display: inline-block; }
@keyframes overdue-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.queue-sync-issue {
    display: none;
    background: var(--status-warning, #f59e0b);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    opacity: 0.85;
}
.queue-sync-issue.active { display: inline-block; }

/* Keyboard shortcuts help */
.shortcuts-help { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9999; background: rgba(0,0,0,0.6); padding: 4px; border-radius: 12px; }
.shortcuts-help-inner { background: var(--bg-primary, #fff); border-radius: 10px; padding: 16px 24px; min-width: 280px; font-size: 13px; color: var(--text-primary); }
.sh-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin-top: 10px; }
.sh-key { font-family: monospace; background: var(--dough-100); border: 1px solid var(--dough-300); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 600; text-align: center; }
.queue-bar-actions { display: flex; gap: 8px; align-items: center; }
.queue-next-btn {
    background: var(--dough-100);
    color: var(--accessible-blue);
    border: none;
    border-radius: 6px;
    padding: 4px 14px;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}
.queue-next-btn:hover { background: var(--dough-200); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.06); }
.queue-next-btn:focus-visible { outline: 2px solid var(--dough-100); outline-offset: 2px; }
.queue-next-btn:active { transform: scale(0.97); box-shadow: none; }
.queue-exit-btn {
    background: transparent;
    color: rgba(255,255,255,0.7);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
}
.queue-exit-btn:hover { color: #fff; border-color: #fff; }
.queue-link { color: #fff; text-decoration: none; font-size: 0.75rem; }

/* Upcoming Appointments Bar */
.appt-bar {
    display: none;
    background: var(--dough-300);
    color: var(--text-primary);
    padding: 6px 16px;
    font-size: 0.8rem;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--dough-400);
}
.appt-bar.active { display: flex; }
.appt-bar-icon { font-size: 1rem; }
.appt-bar-label { font-weight: 700; white-space: nowrap; }
.appt-bar-items { display: flex; gap: 12px; flex: 1; overflow-x: auto; }
.appt-bar-item {
    background: var(--dough-200);
    border-radius: 6px;
    padding: 3px 10px;
    white-space: nowrap;
    font-size: 0.75rem;
}
.appt-bar-item b { margin-right: 4px; color: var(--accessible-blue); }
.appt-bar-dismiss {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.appt-bar-dismiss:hover { color: var(--text-primary); }
.queue-link:hover { text-decoration: underline; }

/* Result Code Modal */
.rc-modal-overlay {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    align-items: center; justify-content: center;
}
.rc-modal-overlay.active { display: flex; }
.rc-modal {
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    padding: 0;
    width: 420px;
    max-width: 92vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
}
.rc-modal-header {
    background: var(--brand-blue);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.rc-modal-header h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1rem;
}
.rc-modal-code-badge {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}
.rc-modal-body { padding: 20px; }
.rc-modal-body label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.rc-modal-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.rc-modal-field { flex: 1; }
.rc-modal-body input[type="date"],
.rc-modal-body input[type="time"],
.rc-modal-body select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: inherit;
    background: var(--bg-primary, #fff);
    box-sizing: border-box;
}
.rc-modal-body input:focus,
.rc-modal-body select:focus,
.rc-modal-body textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-blue) 15%, transparent);
}
.rc-modal-notes {
    width: 100%;
    min-height: 80px;
    max-height: 160px;
    padding: 8px 10px;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    margin-bottom: 14px;
}
.rc-modal-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    padding: 8px 10px;
    background: var(--dough-100);
    border-radius: 6px;
    border-left: 3px solid var(--brand-blue);
}
.rc-modal-cb-section {
    border-top: 1px solid var(--dough-200);
    padding-top: 14px;
    margin-top: 4px;
    margin-bottom: 14px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}
.rc-modal-cb-section--visible {
    max-height: 200px;
    opacity: 1;
}
.rc-modal-cb-section .rc-modal-cb-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-blue);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rc-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    border-top: 1px solid var(--dough-200);
    background: var(--dough-100);
}
.rc-modal-actions button {
    padding: 9px 22px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    transition: opacity 0.15s;
}
.rc-modal-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.rc-modal-save {
    background: var(--dark-blue);
    color: #fff;
}
.rc-modal-save:hover:not(:disabled) { background: var(--accessible-blue); }
.rc-modal-cancel {
    background: var(--dough-300);
    color: var(--text-primary);
}
.rc-modal-cancel:hover { background: var(--dough-400); }
.rc-modal-save .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* Calendar Tab */
#bb-calendar { padding: 8px; height: 100%; }
#crm-calendar { height: calc(100% - 36px); }
.calendar-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; font-size: 12px; flex-wrap: wrap; }
.calendar-toggle { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.calendar-toggle input { margin: 0; }
.calendar-legend { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.legend-label { font-size: 10px; color: var(--text-secondary); margin-right: 6px; }
.legend-sep { width: 1px; height: 12px; background: var(--dough-400); margin: 0 4px; }
.fc-rc-badge { font-size: 9px; font-weight: 600; opacity: 0.85; margin-right: 3px; background: rgba(0,0,0,0.2); padding: 0 3px; border-radius: 3px; }
.bb-tab svg.bb-tab-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }

/* FullCalendar overrides to match app theme */
.fc { font-size: 12px; }
.fc .fc-toolbar-title { font-size: 14px; font-weight: 600; }
.fc .fc-button { font-size: 11px; padding: 2px 8px; }
.fc .fc-button-primary { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.fc .fc-button-primary:hover { background: var(--dark-blue); border-color: var(--dark-blue); }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--dark-blue); border-color: var(--dark-blue); }
.fc .fc-event { cursor: pointer; font-size: 11px; border: none; padding: 1px 4px; }
.fc .fc-daygrid-day-number { font-size: 11px; }
.fc .fc-col-header-cell-cushion { font-size: 11px; }
.fc-event-overdue { background: var(--status-danger) !important; }
.fc .fc-timegrid-slot { height: 20px; }

/* Calendar event popover */
.cal-popover {
    position: fixed; z-index: 9999; background: var(--bg-primary, #fff); border: 1px solid var(--dough-300);
    border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); padding: 10px 14px;
    font-size: 12px; max-width: 280px; min-width: 180px;
}
.cal-popover-title { font-weight: 700; margin-bottom: 4px; }
.cal-popover-time { color: var(--text-tertiary); margin-bottom: 4px; }
.cal-popover-loc { color: var(--text-secondary); }
.cal-popover-close { position: absolute; top: 4px; right: 8px; cursor: pointer; color: var(--text-tertiary); font-size: 14px; background: none; border: none; }
.cal-popover-actions { display: flex; gap: 6px; margin-top: 8px; }
.cal-popover-btn { padding: 4px 10px; border: none; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; }
.cal-popover-btn-nav { background: var(--brand-blue); color: #fff; }
.cal-popover-btn-nav:hover { background: var(--dark-blue); }
.cal-popover-btn-complete { background: var(--status-success); color: #fff; }
.cal-popover-btn-complete:hover { background: var(--dark-blue); }
.cal-popover-btn-delete { background: var(--status-danger); color: #fff; }
.cal-popover-btn-delete:hover { opacity: 0.85; }
.cal-popover-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ============ Calendar Event Modal ============ */
.cal-event-modal { max-width: 440px; }
.cal-event-field { margin-bottom: 0.6rem; }
.cal-event-field label {
    display: block; font-size: 0.72rem; font-weight: 600; color: var(--text-tertiary);
    text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 0.2rem;
}
.cal-event-field input,
.cal-event-field select,
.cal-event-field textarea {
    width: 100%; padding: 0.4rem 0.6rem; border: 1px solid var(--dough-300);
    border-radius: 6px; font-family: inherit; font-size: 0.85rem;
    color: var(--text-primary); background: var(--bg-primary, #fff); box-sizing: border-box;
}
.cal-event-field input:focus,
.cal-event-field select:focus,
.cal-event-field textarea:focus {
    outline: 2px solid var(--brand-blue); outline-offset: -1px;
}
.cal-event-field textarea { min-height: 60px; resize: vertical; }
.cal-event-field .cal-event-readonly {
    padding: 0.4rem 0.6rem; background: var(--dough-100); border: 1px solid var(--dough-200);
    border-radius: 6px; font-size: 0.85rem; color: var(--text-secondary);
}
.cal-event-actions {
    display: flex; gap: 0.5rem; justify-content: flex-end; padding-top: 0.5rem;
    border-top: 1px solid var(--dough-300); margin-top: 0.5rem;
}
.cal-event-save {
    padding: 0.4rem 1.2rem; background: var(--dark-blue); color: #fff; border: none;
    border-radius: 6px; font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.cal-event-save:hover { background: var(--accessible-blue); }
.cal-event-cancel {
    padding: 0.4rem 1.2rem; background: var(--dough-300); color: var(--text-primary); border: none;
    border-radius: 6px; font-family: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.cal-event-cancel:hover { background: var(--dough-400); }

/* ============ Search Result Last Contacted Indicator ============ */
.search-result-last-contacted {
    color: var(--text-tertiary); font-size: 0.68rem; margin-top: 1px;
}

/* ============ Search Results Keyboard Navigation ============ */
.search-result:focus {
    outline: 2px solid var(--brand-blue); outline-offset: -2px;
    background: var(--dough-200);
}

/* ============ SMS Delivery Status Indicator ============ */
.sms-delivery-status {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 0.65rem; margin-left: 4px; vertical-align: middle;
}
.sms-delivery-status.delivered { color: var(--accessible-blue); }
.sms-delivery-status.failed { color: var(--brand-red); }
.sms-delivery-status.undelivered { color: var(--brand-red); }
.sms-delivery-status svg { width: 12px; height: 12px; }

/* ============ Lead Status Badge Icons ============ */
.lead-status-icon { margin-right: 2px; font-size: 0.7em; }

/* ============ Extracted Inline Styles (Fix 22) ============ */

/* Owner badge base style */
.owner-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 0.25rem 0.6rem;
}
.owner-badge--mine {
    background: var(--dough-200);
    color: var(--status-success);
}
.owner-badge--other {
    background: var(--dough-200);
    color: var(--text-tertiary);
}

/* KO placeholder note */
.ko-placeholder-note {
    grid-column: 1 / -1;
    padding: 0.5rem 0;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* Store map container */
.store-map-container {
    width: 100%;
    margin-bottom: 8px;
}

/* Script sidebar category header */
.sidebar-cat-header {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
    padding: 0.75rem 0 0.25rem;
    letter-spacing: 0.5px;
}

/* Sidebar row — flex container for eye toggle + script button */
.sidebar-row {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Script sidebar button */
.sidebar-script-btn {
    display: block;
    width: 100%;
    flex: 1;
    text-align: left;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
}
.sidebar-script-btn:hover:not(.sidebar-script-active) { background: var(--dough-200); }
.sidebar-script-active { background: var(--brand-blue); color: #fff; }
.sidebar-script-hidden { opacity: 0.4; text-decoration: line-through; }
.sidebar-eye-btn { background: none; border: none; cursor: pointer; padding: 2px 6px; font-size: 10px; flex-shrink: 0; }

/* Mapping select input */
.mapping-source-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--bg-primary, #fff);
}

/* Result code search container */
.result-search-wrap {
    padding: 4px 6px;
    position: sticky;
    top: 0;
    background: var(--dough-100);
    z-index: 1;
}

/* Result code search input */
.result-search-input {
    width: 100%;
    padding: 4px 8px;
    font-size: 0.78rem;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
}

/* Undo button in toast */
.undo-toast-btn {
    margin-left: 8px;
    padding: 2px 10px;
    cursor: pointer;
    background: var(--bg-primary, #fff);
    color: var(--brand-blue);
    border: 1px solid var(--brand-blue);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
}

/* Existing notes display in result modal */
.rc-existing-notes {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--dough-100);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.5rem;
    max-height: 4rem;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* No-queue message */
.no-queue-msg {
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    text-align: center;
}

/* Calendar full-screen modal */
.calendar-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9100;
}
.calendar-modal-backdrop.open { display: block; }
.calendar-modal {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    z-index: 9101;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
}
.calendar-modal.open { display: flex; }
.calendar-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--brand-blue);
    color: #fff;
    flex-shrink: 0;
}
.calendar-modal-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.calendar-modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}
.calendar-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: auto;
}
.calendar-modal-close:hover { opacity: 0.7; }
.calendar-modal-body {
    flex: 1;
    overflow: auto;
    padding: 8px;
}
.calendar-modal-body #crm-calendar {
    height: 100%;
}
/* Legend in modal header — pills with embedded color dots */
.calendar-modal-header .calendar-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.calendar-modal-header .calendar-legend .legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.92);
    color: var(--text-primary);
    padding: 2px 8px 2px 5px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.6rem;
    white-space: nowrap;
}
.calendar-modal-header .calendar-legend .legend-pill .legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.calendar-modal-header .calendar-legend .legend-sep {
    width: 1px;
    height: 14px;
    background: rgba(255,255,255,0.3);
    margin: 0 2px;
}
.calendar-modal-header .calendar-toggle {
    font-size: 0.75rem;
    color: #fff;
    background: rgba(255,255,255,0.15);
    padding: 2px 8px;
    border-radius: 10px;
}
.calendar-modal-header .calendar-toggle input { margin-right: 4px; }

/* === Activity Pivot Widget === */
.pivot-widget { margin: 8px 0; }
.pivot-header { font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--text-primary); }
.pivot-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pivot-pill {
    padding: 6px 14px; border-radius: 20px; border: 1px solid var(--dough-300);
    background: var(--dough-100); font-size: 12px; cursor: pointer; font-family: inherit;
    transition: all 0.15s;
}
.pivot-pill:hover { background: var(--dough-200); border-color: var(--brand-blue); }
.pivot-existing { background: var(--dough-200); border-color: var(--status-success); }
.pivot-existing:hover { background: var(--dough-300); }

/* === Website Intel Full-Screen Modal === */
.wi-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9200;
}
.wi-modal-backdrop.open { display: block; }
.wi-modal {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    z-index: 9201;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    overflow: hidden;
}
.wi-modal.open { display: flex; }
.wi-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--brand-blue);
    color: #fff;
    flex-shrink: 0;
}
.wi-modal-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.wi-modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}
.wi-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    margin-left: auto;
}
.wi-modal-close:hover { opacity: 0.7; }
.wi-modal-body {
    flex: 1;
    overflow: auto;
    padding: 16px 24px;
}
.wi-modal-section {
    margin-bottom: 24px;
}
.wi-modal-section-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--brand-blue);
}
.wi-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.wi-modal-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--dough-100);
    border-bottom: 2px solid var(--dough-300);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    white-space: nowrap;
}
.wi-modal-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--dough-200);
    vertical-align: middle;
}
.wi-modal-table tr:hover td {
    background: color-mix(in srgb, var(--brand-blue) 4%, transparent);
}
.wi-modal-table a {
    color: var(--brand-blue);
}
/* Expand button next to WI tab */
.wi-expand-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    vertical-align: middle;
    margin-left: -4px;
}
.wi-expand-btn:hover { color: var(--brand-blue); }

/* Create-org modal result states */
.co-result {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.co-result--error {
    background: var(--status-danger-bg, #fef2f2);
    color: var(--status-danger-text, #991b1b);
    border: 1px solid var(--status-danger-border, #fca5a5);
}
.co-result--success {
    background: var(--status-success-bg, #f0fdf4);
    color: var(--status-success, #16a34a);
    border: 1px solid var(--status-success-border, #86efac);
}
.co-call-now-btn {
    margin-left: 10px;
    padding: 3px 12px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.co-call-now-btn:hover { background: var(--brand-blue-hover, #007bc2); }

/* ── F38: Club/performance color custom property ── */
:root {
    --color-club: var(--dark-blue);
}

/* ── F47: Comm detail type badge ── */
.comm-detail-type-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    color: #fff;
    background: var(--text-tertiary);
}
.comm-detail-type-badge.comm-type-call { background: var(--brand-blue); }
.comm-detail-type-badge.comm-type-email { background: var(--brand-red); }
.comm-detail-type-badge.comm-type-note { background: var(--status-warning); }
.comm-detail-type-badge.comm-type-sms,
.comm-detail-type-badge.comm-type-mms { background: var(--accessible-blue); }

/* ── F36/F37: Web intel assign/dismiss action buttons ── */
.wi-action-btn {
    padding: 1px 6px;
    font-size: 0.7rem;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 3px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-tertiary);
}
.wi-btn-assign {
    border-color: var(--status-success);
    color: var(--status-success);
}
.wi-btn-assign-blue {
    border-color: var(--brand-blue);
    color: var(--brand-blue);
}
.wi-btn-dismiss {
    border-color: var(--border);
    color: var(--text-tertiary);
}
@media (hover: none) {
    .wi-action-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 8px 10px;
        font-size: 0.78rem;
    }
}

/* ── F31: Team contact drag handle and remove button touch targets ── */
@media (hover: none) {
    .tc-drag-handle,
    .tc-remove {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── F46: Text recipient label touch target ── */
.text-recipient-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
@media (hover: none) {
    .text-recipient-label {
        min-height: 44px;
        padding: 10px 8px;
    }
}

/* Accessibility: respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── F4: Voice bar ── */
.voice-bar {
    display: none;
    flex-shrink: 0;
    background: var(--dark-blue);
    padding: 6px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.2);
}

/* ── F5: Phone tree (blank state) — light-mode base ── */
.phone-tree-block {
    margin: 4px 0;
    padding: 5px 8px;
    background: var(--dough-200);
    border: 1px solid var(--dough-400);
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1.4;
}
.phone-tree-block__label {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.phone-tree-block__text {
    color: var(--text-primary);
    white-space: pre-line;
    margin-top: 2px;
}

/* ── F6: Feature-request modal ── */
.fr-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.fr-modal__box {
    background: var(--bg-primary, #fff);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(71, 43, 16, 0.18);
}
.fr-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.fr-modal__title {
    margin: 0;
    font-size: 16px;
}
.fr-modal__close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
}
.fr-modal__input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    font-family: inherit;
}
.fr-modal__textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 16px;
    box-sizing: border-box;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    font-family: inherit;
}
.fr-modal__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.fr-modal__cancel {
    padding: 8px 16px;
    border: 1px solid var(--dough-300);
    border-radius: 6px;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
}
.fr-modal__submit {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--brand-blue);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}
.fr-modal__status {
    margin-top: 8px;
    font-size: 13px;
    display: none;
}

/* ── F7: Add-email buttons ── */
.ci-email-action-btn {
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 600;
}
.ci-email-action-btn--save {
    background: var(--brand-blue);
    color: #fff;
    border: none;
}
.ci-email-action-btn--cancel {
    background: none;
    border: 1px solid var(--dough-300);
    color: var(--text-secondary);
}

/* ── F8: Phone tree edit button ── */
.phone-tree-edit-btn {
    font-size: 0.6rem;
    color: var(--brand-blue);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    min-height: 28px;
    text-decoration: underline;
}

/* ── F13: Lead field status indicators ── */
.lead-indicator--saving {
    color: var(--dough-400);
    opacity: 1;
}
.lead-indicator--saved {
    color: var(--status-success);
    opacity: 1;
    transition: opacity 300ms;
}
.lead-indicator--saved.fade-out {
    opacity: 0;
}
.lead-indicator--error {
    color: var(--status-danger);
    opacity: 1;
    transition: opacity 300ms;
}
.lead-indicator--error.fade-out {
    opacity: 0;
}

/* ── F14: Search loading spinner ── */
.search-loading--active {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.search-loading--active::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--dough-300);
    border-top-color: var(--brand-blue);
    border-radius: 50%;
    animation: pf-spin 0.6s linear infinite;
    flex-shrink: 0;
}

/* ── F15: Login error show/hide via class ── */
.login-gate .login-error.show {
    display: block;
}

/* ── F20: Routing banner variants ── */
.routing-banner--ok {
    display: none !important;
}
.routing-banner--blocked {
    display: block;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--dough-100);
    border: 1px solid var(--status-danger);
    color: var(--status-danger);
}

/* ── F21: Recent contact banner ── */
.recent-contact-banner {
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    display: none;
    background: var(--dough-200);
    border: 1px solid var(--dough-400);
    color: var(--text-secondary);
}
.recent-contact-banner.show { display: block; }

/* ── F22: Google Places update banner ── */
.places-update-banner {
    position: fixed;
    top: 60px;
    right: 16px;
    z-index: 9999;
    background: var(--dough-200);
    color: var(--text-secondary);
    border: 1px solid var(--dough-400);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.82rem;
    box-shadow: 0 2px 8px rgba(71, 43, 16, 0.12);
    max-width: 320px;
    cursor: pointer;
}

/* ── F23: Phone tree inline editor ── */
.phone-tree-inline-editor {
    width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    font-size: 0.72rem;
    font-family: inherit;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
    resize: vertical;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    margin-top: 4px;
}
.phone-tree-inline-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.phone-tree-inline-save {
    padding: 3px 10px;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    min-height: 24px;
}
.phone-tree-inline-cancel {
    padding: 3px 10px;
    font-size: 0.65rem;
    background: none;
    border: 1px solid var(--dough-300);
    border-radius: 3px;
    cursor: pointer;
    color: var(--text-secondary);
    min-height: 24px;
}

/* ── F24: Lead field textarea ── */
.field-input--textarea {
    resize: vertical;
    min-height: 60px;
}

/* ── F51: Script lead input ── */
.script-lead-input {
    width: 140px;
    padding: 3px 6px;
    font-size: 0.85em;
    border: 1px solid var(--dough-300);
    border-radius: 4px;
    background: var(--bg-input, #fff);
}

/* ── F52: End recording div ── */
.script-end-rec {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--status-danger);
    border-radius: 8px;
    background: var(--status-danger-bg, #fff5f5);
    text-align: center;
}

/* ── F53: Create org div (venue script) ── */
.script-create-org {
    margin-top: 16px;
    padding: 14px;
    border: 2px solid var(--brand-blue);
    border-radius: 10px;
    background: var(--brand-blue-bg, #eff6ff);
    text-align: center;
}

/* ── F59: Undo toast / F63: ci-card advancing ── */
.ci-card--advancing {
    opacity: 0.3;
    transition: opacity 0.15s;
}

/* ── F60: Email recipient label ── */
.email-recipient-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}

/* ── F65: Notes required state ── */
.rc-notes--required {
    border-color: var(--status-danger) !important;
}

/* ── F72: Calendar popover BEM helpers ── */
.cal-popover-organizer {
    color: var(--text-tertiary);
    margin-top: 2px;
}
.cal-popover-meta {
    margin-top: 2px;
}
.cal-popover-lead {
    color: var(--text-tertiary);
}
.cal-popover-overdue {
    color: var(--status-danger);
    font-weight: 600;
    margin-top: 2px;
}
.cal-popover-notes {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 11px;
}
.cal-popover-rc-badge {
    font-size: 10px;
}

/* ── F73: Calendar load error ── */
.cal-load-error {
    padding: 2rem;
    text-align: center;
    color: var(--brand-red);
    font-size: 0.9rem;
}
.cal-loading {
    padding: 2rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Conversation modal */
.conv-modal { border-radius: 10px; }
#conv-modal-overlay {
    position: fixed; inset: 0; z-index: 520;
    background: rgba(0,0,0,0);
    transition: background 0.2s ease-out;
    align-items: center; justify-content: center;
}
#conv-modal-overlay.open { background: rgba(0,0,0,0.5); }
#conv-modal {
    transform: scale(0.96) translateY(6px);
    opacity: 0;
    transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), opacity 0.2s ease-out;
}
#conv-modal-overlay.open #conv-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}
#conv-modal-sms.active { display: flex; }
#conv-modal-email.active { display: flex; }
.conv-expand-btn { opacity: 0; transition: opacity 0.15s; }
.conv-item:hover .conv-expand-btn { opacity: 1; }
