/* Global Tokens (Dynamic Theme) */
:root {
    --brand-bg: #FAF7ED;
    --brand-bg-login: #FDFBF7; /* Exact cream from Agency OS image */
    --brand-dark: #111827;
    --brand-muted: rgba(17, 24, 39, 0.7);
    --brand-border: rgba(17, 24, 39, 0.1);
    --brand-card-bg: #FFFFFF;
    --brand-cream: #FAF7ED;
    --brand-yellow: #FFD644; /* More vibrant Agency yellow */
    --brand-on-accent: #111827; /* Text + icons on solid accent fills */
}

/* Dark Mode Overrides - Midnight Navy Theme */
.dark {
    --brand-bg: #020617; /* Slate 950 */
    --brand-dark: #F8FAFC; /* Slate 50 */
    --brand-muted: #cbd5e1; /* Slate 300 — stronger muted-body contrast on navy */
    --brand-border: rgba(255, 255, 255, 0.1);
    --brand-card-bg: #0F172A; /* Slate 900 */
    --brand-cream: #1E293B; /* Slate 800 - Used for hovers/inputs */
}

body {
    background-color: var(--brand-bg);
    color: var(--brand-dark);
    font-family: 'Inter', ui-sans-serif, system-ui;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Manrope', sans-serif;
    color: var(--brand-dark);
}

/* Button Animations & Styles */
.btn-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(253, 224, 71, 0.35);
}

.btn-pill:active {
    transform: translateY(0);
}

.btn-primary {
    background-color: var(--brand-yellow);
    color: var(--brand-on-accent, #111827);
}

.btn-primary:hover {
    background-color: color-mix(in srgb, var(--brand-yellow) 88%, #000);
}

/* Alias used across Social Posts / studio CTAs — same fill + on-accent pairing. */
.btn-brand-yellow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--brand-yellow);
    color: var(--brand-on-accent, #111827) !important;
    border: 1px solid transparent;
    transition: filter 0.15s ease, background-color 0.15s ease;
}

.btn-brand-yellow:hover {
    background-color: color-mix(in srgb, var(--brand-yellow) 88%, #000);
    filter: brightness(1.03);
}

.btn-brand-yellow:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}

/* Solid accent fills: on-accent color for labels AND icons (stroke/currentColor).
   Exact class tokens so hover:bg-brand-yellow / bg-brand-yellow/20 do not match.
   !important beats Tailwind text-brand-dark / text-slate-900 / .ws-nav-item-active.
   dark:bg-brand-yellow only fills with the accent in dark mode, so it is scoped under .dark below;
   in light mode those elements keep their own fill and text color (e.g. white on bg-brand-dark). */
.btn-primary,
.btn-brand-yellow,
[class~="bg-brand-yellow"],
.ws-nav-item-active.bg-brand-yellow,
a[class~="bg-brand-yellow"],
button[class~="bg-brand-yellow"],
.dm-prompt-btn--primary,
.dm-prompt-btn--generate,
.dm-studio-topbtn--primary,
.bulk-bar-btn--accent,
.bulk-bar-btn--focus,
.platform-tab.active,
.sp-fb-copy-btn {
    color: var(--brand-on-accent, #111827) !important;
}

.btn-primary *,
.btn-brand-yellow *,
[class~="bg-brand-yellow"] *,
.dark [class~="dark:bg-brand-yellow"] *,
.ws-nav-item-active[class~="bg-brand-yellow"] *,
.dm-prompt-btn--primary *,
.dm-prompt-btn--generate *,
.dm-studio-topbtn--primary *,
.platform-tab.active *,
.sp-fb-copy-btn * {
    color: inherit;
}

.btn-primary svg,
.btn-brand-yellow svg,
[class~="bg-brand-yellow"] svg,
.btn-primary i,
.btn-brand-yellow i,
[class~="bg-brand-yellow"] i,
.dm-prompt-btn--primary svg,
.dm-prompt-btn--generate svg,
.dm-studio-topbtn--primary svg,
.platform-tab.active svg,
.sp-fb-copy-btn svg {
    color: var(--brand-on-accent, #111827) !important;
    stroke: var(--brand-on-accent, #111827) !important;
}

.btn-primary svg[fill]:not([fill="none"]),
.btn-brand-yellow svg[fill]:not([fill="none"]),
[class~="bg-brand-yellow"] svg[fill]:not([fill="none"]),
.dm-prompt-btn--primary svg[fill]:not([fill="none"]),
.dm-prompt-btn--generate svg[fill]:not([fill="none"]) {
    fill: var(--brand-on-accent, #111827) !important;
}

.dark .btn-primary,
.dark .btn-brand-yellow,
.dark [class~="bg-brand-yellow"],
.dark [class~="dark:bg-brand-yellow"],
.dark .ws-nav-item-active[class~="bg-brand-yellow"],
.dark .dm-prompt-btn--primary,
.dark .dm-prompt-btn--generate,
.dark .dm-studio-topbtn--primary,
.dark .bulk-bar-btn--accent,
.dark .bulk-bar-btn--focus,
.dark .platform-tab.active,
.dark .sp-fb-copy-btn {
    color: var(--brand-on-accent, #111827) !important;
}

.dark .btn-primary svg,
.dark .btn-brand-yellow svg,
.dark [class~="bg-brand-yellow"] svg,
.dark [class~="dark:bg-brand-yellow"] svg,
.dark .btn-primary i,
.dark .btn-brand-yellow i,
.dark [class~="bg-brand-yellow"] i,
.dark [class~="dark:bg-brand-yellow"] i,
.dark .dm-prompt-btn--primary svg,
.dark .dm-prompt-btn--generate svg,
.dark .dm-studio-topbtn--primary svg {
    color: var(--brand-on-accent, #111827) !important;
    stroke: var(--brand-on-accent, #111827) !important;
}

.dark .btn-primary svg[fill]:not([fill="none"]),
.dark [class~="bg-brand-yellow"] svg[fill]:not([fill="none"]),
.dark [class~="dark:bg-brand-yellow"] svg[fill]:not([fill="none"]),
.dark .dm-prompt-btn--primary svg[fill]:not([fill="none"]),
.dark .dm-prompt-btn--generate svg[fill]:not([fill="none"]) {
    fill: var(--brand-on-accent, #111827) !important;
}

/* Solid brand-dark fills: keep the fill genuinely dark in dark mode (where
   --brand-dark flips to a light body-copy token) so white/yellow lettering reads.
   Elements that declare their own dark: background are left alone. */
.dark [class~="bg-brand-dark"]:not([class*="dark:bg-"]) {
    background-color: #0b1220;
}

/* Solid brand-dark fills with no explicit text color: white lettering, not dark-on-dark.
   Match only the exact token bg-brand-dark — not opacity variants like bg-brand-dark/40
   (those are translucent overlays and must not force white descendants). */
[class~="bg-brand-dark"]:not([class*="text-"]):not([class*="bg-brand-dark/"]) {
    color: #ffffff;
}

/* Black buttons contrast with their own fill, never with the brand's accent text color. */
html:not(.dark) [class~="bg-brand-dark"][class~="text-white"] {
    color: #ffffff !important;
}

/* Inverse chips (dark:bg-white + dark:text-brand-dark): in dark mode --brand-dark is
   light body ink, so the label vanishes on the white fill (Today tabs, toasts, etc.). */
html.dark [class~="dark:bg-white"][class~="dark:text-brand-dark"],
.dark [class~="dark:bg-white"][class~="dark:text-brand-dark"] {
    color: #0f172a !important;
}
html.dark [class~="dark:bg-white"][class~="dark:text-brand-dark"] svg,
.dark [class~="dark:bg-white"][class~="dark:text-brand-dark"] svg {
    color: #0f172a !important;
    stroke: currentColor;
}

/* Navigation Styles */
.nav-link {
    font-weight: 600;
    color: var(--brand-muted);
    transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--brand-dark);
}

.dark .nav-link:hover,
.dark .nav-link.active {
    color: #fff;
}

/* Left sidebar app shell */
:root {
    --app-sidebar-width: 16.5rem;
    --ghl-sidebar-bg: #ffffff;
    --ghl-sidebar-border: #e5e7eb;
    --ghl-sidebar-text: #374151;
    --ghl-sidebar-text-strong: #111827;
    --ghl-sidebar-icon: #6b7280;
    --ghl-sidebar-hover: #f3f4f6;
    --ghl-sidebar-active: #f3f4f6;
}

/* Floating chat widgets (global assistant + CEO mobile bubble) */
.app-floating-layer {
    position: fixed;
    z-index: 155;
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    left: auto;
    top: auto;
    width: auto;
    height: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    pointer-events: none;
    /* Stable compositing — iOS Safari otherwise leaves fixed bottom widgets mid-page. */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Alex FAB host: pin explicitly so nested portals / page transforms cannot unstick it. */
#ceoChatFloat.app-floating-layer {
    position: fixed !important;
    z-index: 155;
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px)) !important;
    right: max(1.25rem, env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.app-floating-layer > * {
    pointer-events: auto;
}

/* Fixed overlays portaled to body (chat FAB, bulk bar) — excluded from sidebar grid crush */
.app-body-portal {
    pointer-events: none;
}

.app-body-portal > * {
    pointer-events: auto;
}

#bulkActionBar.app-body-portal.bulk-action-bar--visible,
#bulkActionBar.app-body-portal[data-visible='true'] {
    pointer-events: auto;
}

@media (min-width: 768px) {
    body.app-with-sidebar {
        display: grid;
        grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
        min-height: 100vh;
        transition: grid-template-columns 0.22s ease;
    }

    body.app-with-sidebar #appSidebar {
        grid-column: 1;
        grid-row: 1 / -1;
        align-self: start;
        display: flex !important;
        flex-direction: column;
        width: var(--app-sidebar-width);
        min-width: var(--app-sidebar-width);
        position: sticky;
        top: 0;
        height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        /* Above frosted #appTopbar (z-50) so search never paints through the sidebar */
        z-index: 60;
        /* Solid fill — never inherit a translucent stack from the topbar blur */
        background-color: #ffffff;
        opacity: 1;
        /* Extra top pad so the brand mark isn’t clipped by the scrollport edge */
        padding-top: 0.35rem;
        box-sizing: border-box;
        transition: width 0.22s ease, min-width 0.22s ease, transform 0.22s ease, opacity 0.18s ease;
    }
    html.dark body.app-with-sidebar #appSidebar {
        background-color: #0f172a;
    }

    body.app-with-sidebar .app-shell-content {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        min-height: 100dvh;
    }

    body.app-with-sidebar .app-shell-content > main {
        flex: 0 1 auto;
        width: 100%;
        min-width: 0;
    }

    body.app-with-sidebar .app-shell-content > footer {
        margin-top: auto;
        flex-shrink: 0;
    }

    /* Page scripts / dock after shell — must not consume layout height */
    body.app-with-sidebar > script {
        display: none !important;
    }

    body.app-with-sidebar > :not(#appSidebar):not(.app-shell-content):not(.app-body-portal) {
        grid-column: 2;
        grid-row: 1;
        height: 0;
        min-height: 0;
        overflow: visible;
        margin: 0;
        padding: 0;
        pointer-events: none;
    }

    body.app-with-sidebar > :not(#appSidebar):not(.app-shell-content):not(.app-body-portal) * {
        pointer-events: auto;
    }

    body.app-with-sidebar .app-shell-top {
        width: 100%;
        flex-shrink: 0;
    }

    .app-shell-content > script {
        display: none !important;
    }

    body.app-with-sidebar > .app-body-portal {
        grid-column: auto;
        grid-row: auto;
        height: auto;
        min-height: auto;
        width: auto;
        max-width: none;
    }

    body.app-with-sidebar #appTopbar {
        min-width: 0;
        width: 100%;
    }

    body.app-with-sidebar.sidebar-collapsed {
        --app-sidebar-width: 4.25rem;
    }

    body.app-with-sidebar.sidebar-hidden {
        --app-sidebar-width: 0px;
    }

    body.app-with-sidebar.sidebar-hidden #appSidebar {
        opacity: 0;
        pointer-events: none;
        transform: translateX(-100%);
        border-right-width: 0;
    }

    body.app-with-sidebar.sidebar-hidden #sidebarOpenBtn {
        display: inline-flex !important;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-ws-text,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-ws-sub,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .ws-switcher-chevron,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-nav-link > span,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-nav-group-label,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-settings-label,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-settings-chevron,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-leads-sub,
    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-leads-chevron {
        display: none !important;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-logo-row {
        flex-shrink: 0;
        padding-top: 1rem;
        padding-bottom: 0.5rem;
    }
    body.app-with-sidebar #appSidebar .sidebar-logo-row {
        flex-shrink: 0;
    }
    body.app-with-sidebar #appSidebar .sidebar-logo-link {
        flex-shrink: 0;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-brand-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-ws-btn {
        justify-content: center;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .ghl-ws-switcher > span:first-child {
        margin: 0 auto;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-collapse-row {
        justify-content: center;
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-nav-link {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        gap: 0;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-nav-link.sidebar-nav-cta {
        font-size: 0;
        letter-spacing: 0;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-nav-link.sidebar-nav-cta svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-icon-collapse {
        display: none;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-icon-expand {
        display: block !important;
    }

    body.app-with-sidebar.sidebar-collapsed #appSidebar .sidebar-primary-nav {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }
}

/* Phone: drop the marketing footer band that looked like empty white space. */
@media (max-width: 767px) {
    body.app-with-sidebar .app-shell-content > footer.app-shell-footer {
        display: none;
    }
}

/* GHL-inspired sidebar shell */
.ghl-sidebar {
    background: var(--ghl-sidebar-bg);
    border-right: 1px solid var(--ghl-sidebar-border);
}

.dark .ghl-sidebar,
html.dark .ghl-sidebar {
    --ghl-sidebar-bg: #0f172a;
    --ghl-sidebar-border: rgba(255, 255, 255, 0.08);
    /* High-contrast white menu labels on the dark sidebar */
    --ghl-sidebar-text: #ffffff;
    --ghl-sidebar-text-strong: #ffffff;
    --ghl-sidebar-icon: #f1f5f9;
    --ghl-sidebar-hover: rgba(255, 255, 255, 0.08);
    --ghl-sidebar-active: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* Force white menu ink in dark mode — beats body text-brand-dark / stale caches. */
html.dark .ghl-sidebar .sidebar-nav-link,
.dark .ghl-sidebar .sidebar-nav-link,
html.dark #appSidebar .sidebar-nav-link,
.dark #appSidebar .sidebar-nav-link,
html.dark #mobileMenuPanel .sidebar-nav-link,
.dark #mobileMenuPanel .sidebar-nav-link {
    color: #ffffff !important;
}

html.dark .ghl-sidebar .sidebar-nav-link > span,
.dark .ghl-sidebar .sidebar-nav-link > span,
html.dark #appSidebar .sidebar-nav-link > span,
.dark #appSidebar .sidebar-nav-link > span {
    color: inherit !important;
}

html.dark .ghl-sidebar .sidebar-nav-icon,
.dark .ghl-sidebar .sidebar-nav-icon,
html.dark #appSidebar .sidebar-nav-icon,
.dark #appSidebar .sidebar-nav-icon,
html.dark .ghl-sidebar .sidebar-nav-link svg:not(.sidebar-leads-chevron):not(.sidebar-settings-chevron),
.dark .ghl-sidebar .sidebar-nav-link svg:not(.sidebar-leads-chevron):not(.sidebar-settings-chevron) {
    color: #f1f5f9 !important;
}

.ghl-ws-switcher {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.dark .ghl-ws-switcher {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.ghl-ws-switcher:hover,
.ghl-ws-switcher:focus,
.ghl-ws-switcher:focus-visible,
.ghl-ws-switcher:active,
.ghl-ws-switcher[aria-expanded="true"] {
    background: #eef0f3;
}

.dark .ghl-ws-switcher:hover,
.dark .ghl-ws-switcher:focus,
.dark .ghl-ws-switcher:focus-visible,
.dark .ghl-ws-switcher:active,
.dark .ghl-ws-switcher[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.07);
}

/* Workspace switcher popover — always opaque (never frosted / see-through) */
#wsSwitcherMenu,
#wsSwitcherMenuSidebar {
    background-color: #ffffff !important;
    background-image: none !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
html.dark #wsSwitcherMenu,
html.dark #wsSwitcherMenuSidebar,
.dark #wsSwitcherMenu,
.dark #wsSwitcherMenuSidebar {
    background-color: #0f172a !important;
}

.sidebar-nav-icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--ghl-sidebar-icon);
}

.sidebar-nav-link.active .sidebar-nav-icon,
.sidebar-nav-link:hover .sidebar-nav-icon {
    color: var(--ghl-sidebar-text-strong);
}

.dark .sidebar-nav-link.active .sidebar-nav-icon,
.dark .sidebar-nav-link:hover .sidebar-nav-icon {
    color: #ffffff;
}

.sidebar-nav-link svg:not(.sidebar-nav-icon):not(.sidebar-leads-chevron):not(.sidebar-settings-chevron) {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--ghl-sidebar-icon);
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ghl-sidebar-text);
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-nav-group + .sidebar-nav-group {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.dark .sidebar-nav-group + .sidebar-nav-group {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-group-label {
    padding: 0 0.75rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--brand-muted);
    opacity: 0.85;
}

.dark .sidebar-nav-group-label,
html.dark .sidebar-nav-group-label,
html.dark .ghl-sidebar .sidebar-nav-group-label,
.dark .ghl-sidebar .sidebar-nav-group-label {
    color: rgba(255, 255, 255, 0.78) !important;
    opacity: 1;
}

.sidebar-nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-nav-link:hover {
    background: var(--ghl-sidebar-hover);
    color: var(--ghl-sidebar-text-strong);
}

.sidebar-nav-link.active {
    background: var(--ghl-sidebar-active);
    color: var(--ghl-sidebar-text-strong);
    font-weight: 600;
}

/* Explicit ink — never inherit (mobile overlay / --brand-on-accent white washes out the label). */
.sidebar-nav-link.sidebar-nav-cta {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    border: 1.5px solid rgba(17, 24, 39, 0.38);
    background: transparent;
    color: #111827 !important;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-nav-link.sidebar-nav-cta .sidebar-nav-icon,
.sidebar-nav-link.sidebar-nav-cta svg {
    color: #111827 !important;
    stroke: currentColor;
}

html.dark .sidebar-nav-link.sidebar-nav-cta,
.dark .sidebar-nav-link.sidebar-nav-cta {
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff !important;
}

html.dark .sidebar-nav-link.sidebar-nav-cta .sidebar-nav-icon,
html.dark .sidebar-nav-link.sidebar-nav-cta svg,
.dark .sidebar-nav-link.sidebar-nav-cta .sidebar-nav-icon,
.dark .sidebar-nav-link.sidebar-nav-cta svg {
    color: #ffffff !important;
}

.sidebar-nav-link.sidebar-nav-cta:hover {
    border-color: var(--brand-yellow, #ca8a04);
    background: rgba(255, 214, 68, 0.16);
    color: #111827 !important;
}

html.dark .sidebar-nav-link.sidebar-nav-cta:hover,
.dark .sidebar-nav-link.sidebar-nav-cta:hover {
    color: #ffffff !important;
}

.sidebar-nav-link.sidebar-nav-cta.active {
    border-color: var(--brand-yellow, #ca8a04);
    background: rgba(255, 214, 68, 0.16);
    color: #111827 !important;
    font-weight: 700;
    box-shadow: none;
}

html.dark .sidebar-nav-link.sidebar-nav-cta.active,
.dark .sidebar-nav-link.sidebar-nav-cta.active {
    color: #f8fafc !important;
}

.sidebar-nav-link.sidebar-nav-sub {
    font-size: 0.8125rem;
    font-weight: 600;
    padding-left: 0.875rem;
}

.sidebar-leads-summary {
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
    width: 100%;
}

.sidebar-leads-sub .sidebar-nav-sub {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    padding-left: 2rem;
}

.sidebar-leads-sub {
    border-left: none;
}

.ws-nav-item-active {
    color: var(--brand-on-accent, #111827) !important;
}

.dark .ws-nav-item-active {
    color: var(--brand-on-accent, #111827) !important;
}

/* Workspace settings: sticky tab strip + instant tap feedback */
.ws-settings-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    padding-top: 0.35rem;
    background: color-mix(in srgb, var(--brand-bg, #faf7ed) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .ws-settings-nav {
    background: color-mix(in srgb, #0b1220 88%, transparent);
}

body.app-with-sidebar .ws-settings-nav {
    top: 0;
}

#wsSettingsNav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    gap: 0.35rem;
}

#wsSettingsNav .ws-nav-item {
    scroll-snap-align: center;
    touch-action: manipulation;
}

#wsSettingsNav .ws-nav-item:active {
    transform: scale(0.97);
}

html.ws-settings-navigating .ws-settings-main {
    opacity: 0.55;
    transition: opacity 120ms ease;
    pointer-events: none;
}

/* In-app leave: frosted dim + centered circle loader with brand icon. */
#adhelloNavLoading {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms ease;
    background: rgba(15, 23, 42, 0.22);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Full viewport — do not inherit sidebar grid cell sizing */
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Desktop sidebar shell: keep loader a true viewport portal (not content-column only). */
@media (min-width: 768px) {
    body.app-with-sidebar > #adhelloNavLoading.app-body-portal {
        grid-column: auto;
        grid-row: auto;
        position: fixed;
        inset: 0;
        width: 100vw;
        width: 100dvw;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-width: none;
        margin: 0;
        padding: 0;
        overflow: visible;
        pointer-events: none;
    }
}
#adhelloNavLoading.is-on {
    opacity: 1;
}
#adhelloNavLoading .adhello-nav-loader {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#adhelloNavLoading .adhello-nav-loader-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: adhello-nav-loader-spin 0.95s linear infinite;
}
#adhelloNavLoading .adhello-nav-loader-track {
    stroke: rgba(255, 219, 58, 0.14);
    stroke-width: 3;
}
#adhelloNavLoading .adhello-nav-loader-arc {
    stroke: #FFDB3A;
    stroke-width: 3.25;
    stroke-linecap: round;
    /* ~1/3 of circumference (2π·34 ≈ 213) so the gap reads clearly while spinning */
    stroke-dasharray: 70 143;
}
#adhelloNavLoading .adhello-nav-loader-icon {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    display: block;
    flex-shrink: 0;
    border-radius: 22%;
    object-fit: cover;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}
@keyframes adhello-nav-loader-spin {
    to { transform: rotate(360deg); }
}
html.adhello-nav-loading {
    cursor: progress;
}
@media (prefers-reduced-motion: reduce) {
    #adhelloNavLoading {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        background: rgba(15, 23, 42, 0.35);
    }
    #adhelloNavLoading .adhello-nav-loader-ring {
        animation: none;
    }
    #adhelloNavLoading .adhello-nav-loader-arc {
        stroke-dasharray: 160 52;
        opacity: 0.85;
    }
}

@media (max-width: 639px) {
    .ws-settings-search-wrap {
        display: none;
    }
    .ws-settings-nav {
        top: env(safe-area-inset-top, 0px);
    }
}

.sidebar-settings-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

body.sidebar-settings-open .sidebar-settings-chevron {
    transform: rotate(180deg);
}

body.sidebar-settings-open .sidebar-settings-toggle {
    background: var(--ghl-sidebar-active);
    color: var(--ghl-sidebar-text-strong);
    font-weight: 600;
}

.dark body.sidebar-settings-open .sidebar-settings-toggle {
    color: #f8fafc;
}

@media (min-width: 768px) {
    body.app-with-sidebar.sidebar-collapsed .sidebar-settings-block {
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }

    body.app-with-sidebar.sidebar-collapsed .sidebar-settings-toggle {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    body.app-with-sidebar.sidebar-collapsed .sidebar-settings-menu:not(.hidden) {
        position: absolute;
        bottom: calc(100% + 0.25rem);
        left: 0.25rem;
        right: 0.25rem;
        min-width: 11.5rem;
        z-index: 130;
        margin-bottom: 0;
        padding: 0.375rem;
        border-radius: 0.75rem;
        border: 1px solid rgba(226, 232, 240, 0.8);
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    }

    .dark body.app-with-sidebar.sidebar-collapsed .sidebar-settings-menu:not(.hidden) {
        border-color: rgba(255, 255, 255, 0.12);
        background: rgba(15, 23, 42, 0.98);
    }
}

/* Card Styles */
.brand-card {
    background: var(--brand-card-bg);
    border: 1px solid var(--brand-border);
    border-radius: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.4s ease, border-color 0.4s ease;
}

.brand-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* LMV outreach playbook (pipeline) */
.lmv-playbook__summary::-webkit-details-marker {
    display: none;
}

.lmv-playbook__summary:hover .lmv-playbook__chevron {
    border-color: rgba(255, 214, 68, 0.45);
    color: var(--brand-dark);
}

.lmv-method-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lmv-method-card:hover {
    border-color: rgba(255, 214, 68, 0.35);
    box-shadow: 0 6px 18px rgba(17, 24, 39, 0.06);
}

.lmv-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
}

.lmv-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.lmv-icon--hot {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.22);
    color: #e11d48;
}

.lmv-icon--warm {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #d97706;
}

.lmv-icon--cold {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.22);
    color: #0284c7;
}

.dark .lmv-icon--hot { color: #fb7185; }
.dark .lmv-icon--warm { color: #fbbf24; }
.dark .lmv-icon--cold { color: #38bdf8; }

.lmv-temp {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid transparent;
}

.lmv-temp--hot {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.25);
    color: #be123c;
}

.lmv-temp--warm {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #b45309;
}

.lmv-temp--cold {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.22);
    color: #0369a1;
}

.dark .lmv-temp--hot { color: #fda4af; }
.dark .lmv-temp--warm { color: #fcd34d; }
.dark .lmv-temp--cold { color: #7dd3fc; }

.lmv-contact-hint {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: rgba(255, 255, 255, 0.65);
    color: var(--brand-muted);
}

.dark .lmv-contact-hint {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.lmv-method-btn {
    background: transparent;
    border-width: 1.5px;
    border-style: solid;
}

.lmv-method-btn--warm {
    color: var(--brand-dark);
    border-color: rgba(255, 214, 68, 0.85);
}

.lmv-method-btn--warm:hover {
    background: rgba(255, 214, 68, 0.12);
    border-color: var(--brand-yellow, #ffd644);
    box-shadow: 0 4px 14px rgba(253, 224, 71, 0.2);
}

.dark .lmv-method-btn--warm {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.5);
}

.dark .lmv-method-btn--warm:hover {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.75);
}

.lmv-method-btn--cold {
    color: var(--brand-dark);
    border-color: rgba(17, 24, 39, 0.22);
}

.lmv-method-btn--cold:hover {
    background: rgba(17, 24, 39, 0.04);
    border-color: rgba(17, 24, 39, 0.35);
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.08);
}

.dark .lmv-method-btn--cold {
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.18);
}

.dark .lmv-method-btn--cold:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.28);
}

.lmv-method-btn--cold:hover,
.lmv-method-card:hover .lmv-method-btn--cold {
  border-color: rgba(255, 214, 68, 0.45);
}

/* Arm's Reach scripts (sales/personas) */
.arms-reach-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
}

.arms-reach-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.arms-reach-icon--hot {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.22);
  color: #e11d48;
}

.arms-reach-icon--warm {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #d97706;
}

.arms-reach-icon--cold {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.22);
  color: #0284c7;
}

.dark .arms-reach-icon--hot { color: #fb7185; }
.dark .arms-reach-icon--warm { color: #fbbf24; }
.dark .arms-reach-icon--cold { color: #38bdf8; }

.arms-reach-version:focus-within {
  border-color: rgba(255, 214, 68, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 214, 68, 0.12);
}

.upwork-tab {
  margin-bottom: -1px;
}

.upwork-tab--active {
  color: var(--brand-dark);
  border-bottom-color: var(--brand-yellow, #ffd644) !important;
}

.dark .upwork-tab--active {
  color: #f8fafc;
}

.upwork-saved-item pre {
  display: none;
}

/* Detail panel slide-in */
.detail-panel {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
    background: var(--brand-card-bg);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

.detail-panel.open {
    transform: translateX(0);
}

/* Mobile Panel Animations & Sidebar */
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.animate-slide-up {
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lg\:animate-slide-in-right {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobilePanel {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 400;
}

#mobilePanel.open {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    opacity: 1 !important;
    pointer-events: auto !important;
}

@media (min-width: 1024px) {
    #mobilePanel.open {
        flex-direction: row;
        justify-content: flex-end;
        align-items: stretch;
    }
}

#mobilePanel > div {
    z-index: 101;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s ease;
    background-color: var(--brand-card-bg) !important;
}

/* Full-screen sheet below lg: keep prev/next/close clear of the status bar (viewport-fit=cover) */
@media (max-width: 1023px) {
    #leadPanelSheet {
        padding-top: max(1rem, calc(env(safe-area-inset-top, 0px) + 0.5rem));
    }
}

/* Sidebar behavior on Desktop */
@media (min-width: 1024px) {
    #mobilePanel > div {
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        border-top-left-radius: 3rem !important;
        border-bottom-left-radius: 3rem !important;
    }
}

/* Table row selection & clickability */
.result-row {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
    border-radius: 1rem;
    content-visibility: auto;
    contain-intrinsic-size: auto 72px;
}

table {
    border-collapse: separate;
    border-spacing: 0 4px;
}

.result-row:hover {
    background-color: var(--brand-cream) !important;
    transform: scale(1.002);
}

/* Bulk checkbox selection (search results, pipeline, inbound) */
.result-row.bulk-selected {
    background-color: rgba(253, 224, 71, 0.14) !important;
    box-shadow: inset 4px 0 0 var(--brand-yellow);
}

.result-row.bulk-selected > td {
    background-color: rgba(253, 224, 71, 0.14) !important;
}

.result-row.bulk-selected:hover {
    background-color: rgba(253, 224, 71, 0.22) !important;
}

.result-row.bulk-selected:hover > td {
    background-color: rgba(253, 224, 71, 0.22) !important;
}

tbody.bulk-select-all-active .result-row.bulk-selected,
table.bulk-select-all-active .result-row.bulk-selected {
    background-color: rgba(253, 224, 71, 0.1) !important;
}

html.dark .result-row.bulk-selected {
    background-color: rgba(253, 224, 71, 0.12) !important;
}

html.dark .result-row.bulk-selected > td {
    background-color: rgba(253, 224, 71, 0.12) !important;
}

html.dark tbody.bulk-select-all-active .result-row.bulk-selected,
html.dark table.bulk-select-all-active .result-row.bulk-selected {
    background-color: rgba(253, 224, 71, 0.08) !important;
}

.result-row.selected {
    background-color: var(--brand-cream) !important;
    position: relative;
}

.result-row.selected.bulk-selected {
    box-shadow: inset 4px 0 0 var(--brand-yellow);
}

.result-row.selected::after {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 4px;
    background: var(--brand-yellow);
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 0 10px rgba(253, 224, 71, 0.4);
}

.max-wide {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 640px) {
    main.max-wide,
    footer.max-wide {
        padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    }
}

.line-height-1 {
    line-height: 1;
}

/* Feature Section Styles */
.feature-icon-container {
    width: 4.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1.25rem;
    margin-bottom: 2rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-card:hover .feature-icon-container {
    transform: scale(1.1) rotate(-5deg);
}

.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Custom scrollbar for sidebar */
#mobilePanel > div::-webkit-scrollbar {
    width: 6px;
}
#mobilePanel > div::-webkit-scrollbar-track {
    background: transparent;
}
#mobilePanel > div::-webkit-scrollbar-thumb {
    background: var(--brand-border);
    border-radius: 10px;
}
#mobilePanel > div::-webkit-scrollbar-thumb:hover {
    background: var(--brand-muted);
}

/* Bulk Selection Styles & Animations */
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2) rotate(15deg); }
}
.animate-sparkle {
  animation: sparkle 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes magic {
  0% { filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.4)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 20px rgba(253, 224, 71, 0.8)); transform: scale(1.02); }
  100% { filter: drop-shadow(0 0 5px rgba(253, 224, 71, 0.4)); transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-magic {
  animation: magic 2s ease-in-out infinite, pulse-soft 2s ease-in-out infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255, 214, 68, 0.2), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
}

.js-bulk-enhance.loading {
    position: relative;
    overflow: hidden;
}

.js-bulk-enhance.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.js-bulk-verify-phones.loading,
.js-bulk-reviews.loading {
    position: relative;
    overflow: hidden;
    opacity: 1;
    pointer-events: none;
    border-color: rgba(125, 211, 252, 0.55);
}

.js-bulk-verify-phones.loading::after,
.js-bulk-reviews.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.18), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

#deepEnhanceBtn.loading,
#pageSpeedAuditRunBtn.audit-active {
    position: relative;
    overflow: hidden;
}

@keyframes hunt-ring {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.45), 0 0 18px rgba(253, 224, 71, 0.12);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(253, 224, 71, 0.35), 0 0 28px rgba(253, 224, 71, 0.22);
  }
}

@keyframes btn-action-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(253, 224, 71, 0.35);
  }
  50% {
    transform: scale(1.018);
    box-shadow: 0 0 0 4px rgba(253, 224, 71, 0.2);
  }
}

#deepEnhanceBtn.hunt-active,
#deepEnhanceBtn[data-hunt-state="active"] {
  animation: btn-action-pulse 0.95s ease-in-out infinite, hunt-ring 1.1s ease-in-out infinite;
  border-color: rgba(253, 224, 71, 0.9) !important;
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.22) 0%, rgba(255, 255, 255, 1) 52%);
  opacity: 1 !important;
}

.dark #deepEnhanceBtn[data-hunt-state="active"] {
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.18) 0%, rgb(30 41 59) 52%);
}

#deepEnhanceBtn[data-hunt-state="done"] {
  border-color: rgba(16, 185, 129, 0.45) !important;
  background: rgba(16, 185, 129, 0.08);
  animation: none;
}

#deepEnhanceBtn[data-hunt-state="active"] .deep-enhance-main,
#deepEnhanceBtn[data-hunt-state="active"] .deep-enhance-idle {
  display: flex !important;
}

#deepEnhanceBtn[data-hunt-state="active"] .deep-enhance-progress-row {
  display: block !important;
}

#deepEnhanceBtn[data-hunt-state="done"] .deep-enhance-main,
#deepEnhanceBtn[data-hunt-state="done"] .deep-enhance-idle,
#deepEnhanceBtn[data-hunt-state="idle"] .deep-enhance-progress-row,
#deepEnhanceBtn[data-hunt-state="done"] .deep-enhance-progress-row {
  display: none !important;
}

#deepEnhanceBtn[data-hunt-state="done"] .deep-enhance-done:not(.hidden) {
  display: flex !important;
}

#deepEnhanceBtn[data-hunt-state="active"] .deep-enhance-done,
#deepEnhanceBtn[data-hunt-state="idle"] .deep-enhance-done {
  display: none !important;
}

#rapidapiWebsiteEnrichBtn[data-enrich-state="active"] .rapidapi-enrich-idle,
#rapidapiWebsiteEnrichBtn[data-enrich-state="active"] .rapidapi-enrich-done,
#rapidapiWebsiteEnrichBtn[data-enrich-state="done"] .rapidapi-enrich-idle,
#rapidapiWebsiteEnrichBtn[data-enrich-state="done"] .rapidapi-enrich-active,
#rapidapiWebsiteEnrichBtn[data-enrich-state="idle"] .rapidapi-enrich-active,
#rapidapiWebsiteEnrichBtn[data-enrich-state="idle"] .rapidapi-enrich-done {
  display: none !important;
}

#rapidapiWebsiteEnrichBtn[data-enrich-state="active"] .rapidapi-enrich-active,
#rapidapiWebsiteEnrichBtn[data-enrich-state="done"] .rapidapi-enrich-done {
  display: flex !important;
}

#rapidapiWebsiteEnrichBtn[data-enrich-state="active"] .rapidapi-enrich-progress-row {
  display: block !important;
}

#rapidapiWebsiteEnrichBtn[data-enrich-state="idle"] .rapidapi-enrich-progress-row,
#rapidapiWebsiteEnrichBtn[data-enrich-state="done"] .rapidapi-enrich-progress-row {
  display: none !important;
}

#rapidapiWebsiteEnrichBtn[data-enrich-state="active"] {
  border-color: rgba(234, 179, 8, 0.65) !important;
  animation: btn-action-pulse 0.95s ease-in-out infinite, hunt-ring 1.1s ease-in-out infinite;
}

#rapidapiWebsiteEnrichBtn[data-enrich-state="done"] {
  border-color: rgba(16, 185, 129, 0.45) !important;
  background: rgba(16, 185, 129, 0.08);
  animation: none;
}

/* Website audit button — same active/loading pattern as hunt */
#pageSpeedAuditRunBtn.audit-active,
#pageSpeedAuditRunBtn[data-audit-state="active"] {
  animation: btn-action-pulse 0.95s ease-in-out infinite, hunt-ring 1.1s ease-in-out infinite;
  border-color: rgba(253, 224, 71, 0.9) !important;
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.22) 0%, rgba(255, 255, 255, 1) 52%);
  opacity: 1 !important;
}

.dark #pageSpeedAuditRunBtn[data-audit-state="active"] {
  background: linear-gradient(180deg, rgba(253, 224, 71, 0.18) 0%, rgb(30 41 59) 52%);
}

#pageSpeedAuditRunBtn[data-audit-state="active"] .page-speed-audit-main,
#pageSpeedAuditRunBtn[data-audit-state="active"] .page-speed-audit-idle {
  display: flex !important;
}

#pageSpeedAuditRunBtn[data-audit-state="active"] .page-speed-audit-progress-row {
  display: block !important;
}

#pageSpeedAuditRunBtn[data-audit-state="idle"] .page-speed-audit-progress-row {
  display: none !important;
}

.deep-enhance-progress-fill,
.page-speed-audit-progress-fill {
  min-width: 6%;
  transition: width 0.45s ease-out;
}

#reviewIntelGrid.review-intel-loading {
  opacity: 0.45;
  pointer-events: none;
}

@keyframes hunt-progress-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

.hunt-progress-indeterminate {
  animation: hunt-progress-slide 1.4s ease-in-out infinite;
}

.lead-run-progress-shimmer {
  animation: hunt-progress-slide 1.6s ease-in-out infinite;
}

/* Floating bulk bar — Apple-style frosted glass */
#bulkActionBar.bulk-action-bar--visible,
#dmBulkActionBar.bulk-action-bar--visible,
#bulkActionBar[data-visible='true'],
#dmBulkActionBar[data-visible='true'] {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important;
  pointer-events: auto !important;
}

/* Nested controls (Move, + Folder, Call room) must stay clickable inside portaled bar */
#bulkActionBar.bulk-action-bar--visible *,
#bulkActionBar[data-visible='true'] *,
#dmBulkActionBar.bulk-action-bar--visible *,
#dmBulkActionBar[data-visible='true'] * {
  pointer-events: auto;
}

/* Hidden bar only slides 4rem down, so on phones most of it still covers the bottom of
   the table. Keep it inert or taps on rows open its invisible folder / stage selects. */
#bulkActionBar:not(.bulk-action-bar--visible):not([data-visible='true']),
#dmBulkActionBar:not(.bulk-action-bar--visible):not([data-visible='true']) {
  visibility: hidden;
  pointer-events: none !important;
}

#bulkActionBar:not(.bulk-action-bar--visible):not([data-visible='true']) *,
#dmBulkActionBar:not(.bulk-action-bar--visible):not([data-visible='true']) * {
  pointer-events: none !important;
}

#bulkFolderNewRow:not(.hidden),
#bulkTagsRow:not(.hidden),
#dmBulkTagsRow:not(.hidden) {
  display: flex !important;
}

#bulkActionBar input.bulk-tag-color-input,
#bulkActionBar input[type="color"].bulk-tag-color-input {
  width: 2rem;
  height: 2rem;
  padding: 0.125rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  pointer-events: auto;
}

#bulkActionBar input.bulk-tag-color-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#focusLeadTagsSection input.focus-tag-color-input,
#focusLeadTagsSection input[type="color"].focus-tag-color-input {
  width: 2rem;
  height: 2rem;
  padding: 0.125rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  pointer-events: auto;
}

.dark #focusLeadTagsSection input.focus-tag-color-input,
.dark #focusLeadTagsSection input[type="color"].focus-tag-color-input {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.85);
}

.tags-manage-color {
  padding: 0.125rem;
  cursor: pointer;
  pointer-events: auto;
}

#bulkActionBar .bulk-bar-expand-row:not(.hidden) {
  animation: bulk-bar-expand-in 0.18s ease-out;
}

#bulkActionBar,
#dmBulkActionBar {
  z-index: 280;
  position: fixed;
  left: 50%;
  right: auto;
  bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  width: min(calc(100vw - 1rem), 56rem);
  max-width: min(calc(100vw - 1rem), 56rem);
  height: auto;
  pointer-events: auto;
  background: rgba(32, 32, 36, 0.55) !important;
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.16) !important;
}

/* Compact bulk action bar controls */
#bulkActionBar .bulk-bar-btn,
#dmBulkActionBar .bulk-bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    opacity 0.15s ease;
}

#bulkActionBar .bulk-bar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#bulkActionBar .bulk-bar-btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
}

#bulkActionBar .bulk-bar-btn--ghost.text-brand-yellow {
  color: var(--brand-yellow, #eab308) !important;
  border-color: rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.1);
}

#bulkActionBar .bulk-bar-btn--ghost.text-sky-300 {
  color: #7dd3fc !important;
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

#bulkActionBar .bulk-bar-btn--ghost.text-violet-300 {
  color: #c4b5fd !important;
  border-color: rgba(196, 181, 253, 0.35);
  background: rgba(139, 92, 246, 0.12);
}

#bulkActionBar #bulkBookmarkBtn.bulk-bookmark-btn--saved {
  color: var(--brand-on-accent, #111827) !important;
  border-color: transparent;
  background: var(--brand-yellow, #ffd644);
}

#bulkActionBar #bulkBookmarkBtn.bulk-bookmark-btn--saved svg {
  fill: currentColor;
  color: var(--brand-on-accent, #111827) !important;
  stroke: var(--brand-on-accent, #111827);
}

#bulkActionBar .bulk-bar-btn--ghost.text-brand-yellow:hover:not(:disabled),
#bulkActionBar .bulk-bar-btn--ghost.text-sky-300:hover:not(:disabled),
#bulkActionBar .bulk-bar-btn--ghost.text-violet-300:hover:not(:disabled) {
  filter: brightness(1.08);
}

#bulkActionBar .bulk-bar-btn--ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Brand accent fills — fill + on-accent text from Workspace → Brand accent. */
#bulkActionBar .bulk-bar-btn--accent {
  background: var(--brand-yellow, #ffd644);
  color: var(--brand-on-accent, #111827) !important;
  border-color: transparent;
}

#bulkActionBar .bulk-bar-btn--accent:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-yellow, #ffd644) 88%, #000);
  filter: none;
}

#bulkActionBar .bulk-bar-btn--accent svg,
#bulkActionBar .bulk-bar-btn--accent i {
  color: var(--brand-on-accent, #111827) !important;
  stroke: var(--brand-on-accent, #111827) !important;
}

#bulkActionBar .bulk-bar-btn--board {
  background: rgba(16, 185, 129, 0.88);
  color: #fff;
  border-color: rgba(52, 211, 153, 0.55);
}

#bulkActionBar .bulk-bar-btn--board:hover:not(:disabled) {
  filter: brightness(1.06);
}

#bulkActionBar .bulk-bar-btn--save {
  background: #059669;
  color: #fff;
  border-color: rgba(16, 185, 129, 0.45);
}

#bulkActionBar .bulk-bar-btn--primary-lg {
  padding: 0.65rem 1.35rem;
  min-height: 2.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  border-radius: 0.625rem;
  font-weight: 900;
  border-width: 1.5px;
}

#bulkActionBar .bulk-bar-btn--call.bulk-bar-btn--primary-lg {
  background: rgba(225, 29, 72, 0.88);
  border-color: rgba(251, 113, 133, 0.65);
  color: #fff;
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.35);
}

#bulkActionBar .bulk-bar-btn--call.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.95);
  filter: brightness(1.05);
}

#bulkActionBar .bulk-bar-btn--focus.bulk-bar-btn--primary-lg {
  background: var(--brand-yellow, #ffd644);
  border-color: transparent;
  color: var(--brand-on-accent, #111827) !important;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand-yellow, #ffd644) 35%, transparent);
}

#bulkActionBar .bulk-bar-btn--focus.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-yellow, #ffd644) 88%, #000);
  filter: none;
}

#bulkActionBar .bulk-bar-btn--softphone.bulk-bar-btn--primary-lg {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--brand-yellow, #ffd644);
  color: #fff;
}

#bulkActionBar .bulk-bar-btn--softphone.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
}

#bulkActionBar .bulk-bar-btn--accent.bulk-bar-btn--primary-lg {
  background: var(--brand-yellow, #ffd644);
  border-color: transparent;
  color: var(--brand-on-accent, #111827) !important;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand-yellow, #ffd644) 35%, transparent);
}

#bulkActionBar .bulk-bar-btn--accent.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-yellow, #ffd644) 88%, #000);
  filter: none;
}

#bulkActionBar .bulk-bar-btn--mail.bulk-bar-btn--primary-lg {
  background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
  border-color: rgba(167, 139, 250, 0.85);
  color: #fff;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

#bulkActionBar .bulk-bar-btn--mail.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  background: linear-gradient(180deg, #c4b5fd 0%, #8b5cf6 100%);
  filter: brightness(1.04);
}

#bulkActionBar .bulk-bar-btn--email.bulk-bar-btn--primary-lg {
  background: #0ea5e9;
  border-color: rgba(56, 189, 248, 0.85);
  color: #fff;
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.35);
}

#bulkActionBar .bulk-bar-btn--email.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  filter: brightness(1.06);
}

#bulkActionBar .bulk-bar-btn--sms.bulk-bar-btn--primary-lg {
  background: #10b981;
  border-color: rgba(52, 211, 153, 0.85);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35);
}

#bulkActionBar .bulk-bar-btn--sms.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  filter: brightness(1.06);
}

#bulkActionBar .bulk-bar-btn--ghl {
  background: rgba(234, 88, 12, 0.28);
  border-color: rgba(251, 146, 60, 0.5);
  color: #ffedd5;
}

#bulkActionBar .bulk-bar-btn--ghl:hover:not(:disabled) {
  filter: brightness(1.08);
  background: rgba(234, 88, 12, 0.4);
}

#bulkActionBar .bulk-bar-btn--ghl.bulk-bar-btn--primary-lg {
  background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%);
  border-color: rgba(251, 146, 60, 0.55);
  color: #fff;
  box-shadow: 0 2px 10px rgba(234, 88, 12, 0.28);
}

#bulkActionBar .bulk-bar-btn--ghl.bulk-bar-btn--primary-lg:hover:not(:disabled) {
  filter: brightness(1.06);
}

#bulkActionBar .bulk-bar-btn--subaccount {
  background: rgba(8, 145, 178, 0.28);
  border-color: rgba(34, 211, 238, 0.5);
  color: #a5f3fc;
}

#bulkActionBar .bulk-bar-btn--subaccount:hover:not(:disabled) {
  filter: brightness(1.08);
  background: rgba(8, 145, 178, 0.4);
}

#bulkActionBar .bulk-bar-btn--mail {
  background: rgba(124, 58, 237, 0.22);
  border-color: rgba(167, 139, 250, 0.45);
  color: #ede9fe;
  text-decoration: none;
}

#bulkActionBar .bulk-bar-btn--email {
  background: rgba(14, 165, 233, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
  text-decoration: none;
}

#bulkActionBar .bulk-bar-btn--call {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(251, 113, 133, 0.35);
  color: #ffe4e6;
}

#bulkActionBar .bulk-bar-btn--focus {
  background: var(--brand-yellow, #ffd644);
  border-color: transparent;
  color: var(--brand-on-accent, #111827) !important;
  text-decoration: none;
}

/* Native folder/tag pickers on the frosted bar — light popup + dark text (white-on-white was invisible) */
#bulkActionBar .bulk-bar-select,
#dmBulkActionBar .bulk-bar-select {
  color-scheme: light;
}

#bulkActionBar .bulk-bar-select option,
#dmBulkActionBar .bulk-bar-select option {
  background-color: #ffffff;
  color: #0f172a;
}

#bulkActionBar .bulk-bar-folder-strip {
  flex: 0 1 auto;
}

#bulkActionBar .bulk-bar-tools-row {
  flex-shrink: 0;
  padding-top: 0.35rem;
  margin-top: 0.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

#bulkActionBar .bulk-bar-tools-row::-webkit-scrollbar {
  display: none;
}

#bulkActionBar .bulk-bar-primary-row {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  padding-top: 0.4rem;
  margin-top: 0.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#bulkActionBar .bulk-bar-primary-split {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

#bulkActionBar .bulk-bar-btn--ghl.is-busy,
#bulkActionBar .bulk-bar-btn--ghl[aria-busy='true'],
#bulkActionBar .bulk-bar-btn--subaccount.is-busy,
#bulkActionBar .bulk-bar-btn--subaccount[aria-busy='true'] {
  cursor: wait;
  opacity: 0.92;
  animation: bulk-ghl-push-pulse 1.1s ease-in-out infinite;
}

@keyframes bulk-ghl-push-pulse {
  0%,
  100% {
    filter: brightness(1);
    box-shadow: 0 2px 10px rgba(234, 88, 12, 0.28);
  }
  50% {
    filter: brightness(1.14);
    box-shadow: 0 2px 16px rgba(234, 88, 12, 0.45);
  }
}

/* Solid action fills. Written in CSS (not Tailwind utilities) so the text stays
   white in both themes — tinted fills with dark lettering were hard to read. */
.btn-solid {
  color: #fff !important;
  border-width: 2px;
  border-style: solid;
}

.btn-solid svg {
  color: #fff;
  stroke: #fff;
}

.btn-solid:disabled,
.btn-solid[aria-busy='true'] {
  opacity: 0.7;
}

.btn-solid--ghl {
  background-color: #ea580c;
  border-color: #ea580c;
}

.btn-solid--ghl:hover:not(:disabled) {
  background-color: #c2410c;
  border-color: #c2410c;
}

.btn-solid--sms {
  background-color: #059669;
  border-color: #059669;
}

.btn-solid--sms:hover:not(:disabled) {
  background-color: #047857;
  border-color: #047857;
}

.btn-solid--email {
  background-color: #0284c7;
  border-color: #0284c7;
}

.btn-solid--email:hover:not(:disabled) {
  background-color: #0369a1;
  border-color: #0369a1;
}

.btn-solid--mail {
  background-color: #7c3aed;
  border-color: #7c3aed;
}

.btn-solid--mail:hover:not(:disabled) {
  background-color: #6d28d9;
  border-color: #6d28d9;
}

/* Stop / cancel a running background job — dark fill, white lettering in both themes. */
.btn-solid--stop {
  background-color: #1f2937;
  border-color: #1f2937;
}

.btn-solid--stop:hover:not(:disabled) {
  background-color: #111827;
  border-color: #111827;
}

#bulkActionBar .bulk-bar-main,
#bulkActionBar .bulk-bar-expand-row:not(.hidden) {
  align-items: center;
}

#bulkActionBar .bulk-bar-secondary-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

@media (max-width: 639px) {
  #bulkActionBar {
    max-height: calc(100dvh - 5.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  #bulkActionBar .bulk-bar-primary-row {
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  /* Call / Softphone / SMS on the first line; Email / Direct Mail / Auto outreach on the second. */
  #bulkActionBar .bulk-bar-primary-split {
    flex: 1 1 28%;
    width: auto;
    min-height: 3rem;
    padding: 0.7rem 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    line-height: 1.1;
    white-space: normal;
  }

  #bulkActionBar .bulk-bar-tools-row {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  /* Room to scroll the last rows above the open bar */
  body:has(#bulkActionBar[data-visible='true']) #tableView {
    margin-bottom: 16rem;
  }

  body:has(#bulkActionBar[data-visible='true'][data-minimized='true']) #tableView {
    margin-bottom: 4.5rem;
  }

  /* Minimized: a small pill showing only the selection count */
  #bulkActionBar[data-minimized='true'] {
    width: auto;
    max-width: calc(100vw - 1rem);
    padding: 0.4rem 0.55rem;
    cursor: pointer;
  }

  #bulkActionBar[data-minimized='true'] .bulk-bar-expand-row,
  #bulkActionBar[data-minimized='true'] #bulkOpenGhlContactsLink,
  #bulkActionBar[data-minimized='true'] .bulk-bar-folder-strip,
  #bulkActionBar[data-minimized='true'] .bulk-bar-main > :not(:first-child) {
    display: none !important;
  }

  #bulkActionBar[data-minimized='true'] .bulk-bar-count {
    border-right: 0;
    padding-right: 0;
    margin-right: 0;
  }

  #bulkActionBar[data-minimized='true'] .bulk-bar-selected-label {
    display: inline;
  }

  #bulkActionBar[data-minimized='true'] #bulkBarMinimizeBtn svg {
    transform: rotate(180deg);
  }
}

.dark #bulkActionBar {
  background: rgba(22, 22, 26, 0.62) !important;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* In-app toasts — solid contrast on cream (do not rely on Tailwind JS className) */
#appToast.app-toast,
#appToast {
  position: fixed !important;
  left: 50% !important;
  top: 4.5rem !important;
  z-index: 520 !important;
  max-width: min(92vw, 26rem);
  width: max-content;
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  border-width: 1px;
  border-style: solid;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.375;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  transform: translateX(-50%) translateY(0.5rem);
  opacity: 0;
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}
#appToast.app-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#appToast.app-toast--enter {
  opacity: 0;
  transform: translateX(-50%) translateY(0.5rem);
}
#appToast.app-toast--dismissible {
  pointer-events: auto;
  cursor: pointer;
}
#appToast.app-toast--error {
  background: #fff1f2 !important;
  color: #9f1239 !important;
  border-color: #fb7185 !important;
  box-shadow: 0 10px 28px rgba(159, 18, 57, 0.16);
}
#appToast.app-toast--warning {
  background: #fffbeb !important;
  color: #92400e !important;
  border-color: #fbbf24 !important;
}
#appToast.app-toast--success {
  background: #ecfdf5 !important;
  color: #065f46 !important;
  border-color: #34d399 !important;
}
#appToast.app-toast--info {
  background: #111827 !important;
  color: #ffffff !important;
  border-color: rgba(234, 179, 8, 0.55) !important;
}
.dark #appToast.app-toast--error {
  background: #4c0519 !important;
  color: #fecdd3 !important;
  border-color: #fb7185 !important;
}
.dark #appToast.app-toast--warning {
  background: #451a03 !important;
  color: #fde68a !important;
  border-color: #f59e0b !important;
}
.dark #appToast.app-toast--success {
  background: #064e3b !important;
  color: #a7f3d0 !important;
  border-color: #34d399 !important;
}
.dark #appToast.app-toast--info {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-color: rgba(234, 179, 8, 0.55) !important;
}

#prospectToast {
  position: fixed !important;
  left: 50% !important;
  z-index: 520 !important;
  max-width: min(90vw, 20rem);
  padding: 0.75rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(234, 179, 8, 0.5);
  background: #111827 !important;
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
  transform: translateX(-50%);
  transition:
    opacity 0.2s ease-out,
    transform 0.2s ease-out;
}
.dark #prospectToast {
  background: #0f172a !important;
  color: #f8fafc !important;
}

#bulkSaveFeedback:not(.hidden) {
  animation: bulk-save-feedback-in 0.25s ease-out;
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
}
#bulkSaveFeedback.text-rose-300,
#bulkSaveFeedback.app-bulk-feedback--error {
  color: #fecdd3 !important;
  background: rgba(127, 29, 29, 0.55);
}
#bulkSaveFeedback.text-emerald-300,
#bulkSaveFeedback.app-bulk-feedback--success {
  color: #d1fae5 !important;
  background: rgba(6, 78, 59, 0.78);
}
#bulkSaveFeedback.text-white\/80,
#bulkSaveFeedback.app-bulk-feedback--loading {
  color: rgba(255, 255, 255, 0.9) !important;
}

@keyframes bulk-save-feedback-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bulk-bar-expand-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bulk-save-btn.bulk-save-btn--success {
  background: #059669 !important;
  box-shadow: 0 0 0 2px rgba(110, 231, 183, 0.45);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  #bulkActionBar {
    background: rgba(15, 23, 42, 0.94) !important;
  }
  .dark #bulkActionBar {
    background: rgba(15, 15, 18, 0.94) !important;
  }
}

/* Kanban: empty column drop hint + card hover lift */
.kanban-drop-zone:empty::after {
  content: 'Drag a lead here from another column to move its stage.';
  display: block;
  margin-top: auto;
  margin-bottom: auto;
  padding: 0.85rem 0.65rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--brand-muted);
  border-radius: 1.15rem;
  background: rgba(253, 214, 68, 0.14);
  border: 1px dashed var(--brand-border);
}

.dark .kanban-drop-zone:empty::after {
  background: rgba(253, 214, 68, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.kanban-card--lift {
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.kanban-card--lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px -10px rgba(0, 0, 0, 0.2);
}

.kanban-card-contact .kanban-card-socials .inline-flex.w-8 {
  width: 1.65rem;
  height: 1.65rem;
}

.kanban-card-contact .kanban-card-socials svg {
  width: 0.85rem;
  height: 0.85rem;
}

.dark .kanban-card--lift:hover {
  box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.55);
}

/* Folders page: phones get two tags + "+N", one primary button, and the rest behind More */
@media (max-width: 639px) {
  .folder-row .folder-tag-extra { display: none; }
  .folder-row .folder-row-more { display: none; }
  .folder-row.is-more-open .folder-row-more {
    display: flex;
    padding-top: 0.5rem;
  }
  .folder-row.is-more-open .folder-row-more > [role='group'] { justify-content: flex-start; }
  .folder-row.is-more-open .folder-more-chevron { transform: rotate(180deg); }
}
@media (min-width: 640px) {
  .folder-row .folder-tag-more { display: none; }
}

/* Task board cards — wrap long URLs/text inside the card */
.ceo-task-card,
.task-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.ceo-task-card > p,
.task-card > p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Prospecting: sortable column headers */
.prospect-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
  text-align: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0.15rem 0.1rem;
  margin: -0.15rem -0.1rem;
  border: 0;
  background: transparent;
  border-radius: 0.35rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.prospect-sort-btn:hover {
  color: var(--brand-dark, #111827);
  background: rgba(253, 214, 68, 0.12);
}

.dark .prospect-sort-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.prospect-sort-btn--right {
  width: 100%;
  justify-content: flex-end;
}

.prospect-sort-indicator {
  font-size: 0.65em;
  opacity: 0.35;
  line-height: 1;
  font-weight: 900;
}

.prospect-sort-btn.prospect-sort-btn--active .prospect-sort-indicator {
  opacity: 1;
  color: var(--brand-yellow, #e8bc1a);
}

#prospectLeadsTable thead th[data-plc]:not([data-plc='check']) {
  cursor: pointer;
}

#prospectLeadsTable thead th[data-plc] .plc-col-resize {
  cursor: col-resize;
}

.prospect-leads-table tr.result-row {
  cursor: pointer;
}

#prospectLeadsTable td[data-plc="company"],
#prospectLeadsTable td[data-plc="company"] .lead-company-inline {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

/* Sticky checkbox cell paints above company (z-index 35 vs 34) and can cover the
   bookmark on the column seam. Let clicks pass through the empty cell. */
.prospect-leads-table td.lead-sticky-check {
  pointer-events: none;
}
.prospect-leads-table td.lead-sticky-check .lead-checkbox,
.prospect-leads-table td.lead-sticky-check button,
.prospect-leads-table td.lead-sticky-check a,
.prospect-leads-table th.lead-sticky-check .prospect-bookmark-top-btn {
  pointer-events: auto;
}

#prospectLeadsTable .pipeline-bookmark-btn {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
  z-index: 40;
  pointer-events: auto !important;
}

#prospectLeadsTable .pipeline-bookmark-btn:hover:not(.bookmark-btn--saved):not([data-saved='1']) {
  background-color: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--brand-on-accent, #111827);
}

.bookmark-btn[data-saved='1'],
.bookmark-btn.bookmark-btn--saved,
#prospectLeadsTable .pipeline-bookmark-btn.bookmark-btn--saved,
#prospectLeadsTable .pipeline-bookmark-btn[data-saved='1'],
#prospectLeadsTable .pipeline-bookmark-btn.bookmark-btn--saved:hover,
#prospectLeadsTable .pipeline-bookmark-btn[data-saved='1']:hover {
  background-color: var(--brand-yellow) !important;
  color: var(--brand-on-accent, #111827) !important;
  border-color: var(--brand-yellow) !important;
}

.bookmark-btn[data-saved='1'] svg,
.bookmark-btn.bookmark-btn--saved svg,
#prospectLeadsTable .pipeline-bookmark-btn.bookmark-btn--saved svg,
#prospectLeadsTable .pipeline-bookmark-btn[data-saved='1'] svg {
  fill: currentColor !important;
}

a.website-link.website-link--holding {
  color: var(--brand-yellow, #f5c518) !important;
  border-bottom-color: rgb(245 197 24 / 0.45) !important;
}

#websitePreview {
  z-index: 10050;
}

.lead-category-input--suspect {
  border-color: rgb(251 191 36 / 0.75) !important;
  background: rgb(254 243 199 / 0.35);
}
.dark .lead-category-input--suspect {
  background: rgb(120 53 15 / 0.25);
  border-color: rgb(251 191 36 / 0.55) !important;
}

/* Prospecting pipeline table: sticky header + checkbox/company, row hover actions */
.prospect-leads-table thead th {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--brand-card-bg);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.08);
}

.dark .prospect-leads-table thead th {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Horizontal scroll: checkbox + company stay fixed; --plc-check-sticky-w set by JS to match real column width */
.prospect-leads-table th.lead-sticky-check,
.prospect-leads-table td.lead-sticky-check {
  position: sticky;
  left: 0;
  z-index: 35;
  box-shadow: 1px 0 0 rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 252, 245, 0.82) !important;
}

.prospect-leads-table th.lead-sticky-company,
.prospect-leads-table td.lead-sticky-company {
  position: sticky;
  left: var(--plc-check-sticky-w, 5.25rem);
  z-index: 34;
  box-shadow: 1px 0 0 rgba(17, 24, 39, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 252, 245, 0.82) !important;
}

.dark .prospect-leads-table th.lead-sticky-check,
.dark .prospect-leads-table td.lead-sticky-check,
.dark .prospect-leads-table th.lead-sticky-company,
.dark .prospect-leads-table td.lead-sticky-company {
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.07);
  background: rgba(15, 23, 42, 0.78) !important;
}

.prospect-leads-table tbody tr:nth-child(odd) td.lead-sticky-check,
.prospect-leads-table tbody tr:nth-child(odd) td.lead-sticky-company {
  background: rgba(250, 247, 237, 0.45) !important;
}

.prospect-leads-table tbody tr:nth-child(even) td.lead-sticky-check,
.prospect-leads-table tbody tr:nth-child(even) td.lead-sticky-company {
  background: var(--brand-card-bg) !important;
}

.dark .prospect-leads-table tbody tr:nth-child(odd) td.lead-sticky-check,
.dark .prospect-leads-table tbody tr:nth-child(odd) td.lead-sticky-company {
  background: rgba(30, 41, 59, 0.55) !important;
}

.dark .prospect-leads-table tbody tr:nth-child(even) td.lead-sticky-check,
.dark .prospect-leads-table tbody tr:nth-child(even) td.lead-sticky-company {
  background: var(--brand-card-bg) !important;
}

.prospect-leads-table thead th.lead-sticky-check {
  z-index: 45;
  position: sticky;
  left: 0;
}

.prospect-leads-table thead th.lead-sticky-company {
  z-index: 44;
  position: sticky;
  left: var(--plc-check-sticky-w, 5.25rem);
}

.prospect-leads-table thead th.lead-sticky-check,
.prospect-leads-table thead th.lead-sticky-company {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 1px 0 0 rgba(17, 24, 39, 0.06);
  background: var(--brand-card-bg) !important;
}

.dark .prospect-leads-table thead th.lead-sticky-check,
.dark .prospect-leads-table thead th.lead-sticky-company {
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.07);
  background: var(--brand-card-bg) !important;
}

/* Pipeline "Columns" menu — portaled fixed dropdown (above sticky table header) */
.js-pipeline-columns-wrap {
  position: relative;
  z-index: 20;
}

.js-pipeline-columns-wrap--open {
  z-index: 10051;
}

.pipeline-columns-popover,
#pipelineColumnsPopover {
  z-index: 10050 !important;
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: var(--brand-dark);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: isolate;
  opacity: 1 !important;
  position: fixed;
  box-shadow:
    0 20px 40px -12px rgba(17, 24, 39, 0.18),
    0 8px 16px -8px rgba(17, 24, 39, 0.1);
}

.pipeline-columns-popover__header {
  background-color: var(--brand-cream, #faf7ed) !important;
}

.pipeline-columns-popover__body {
  background-color: inherit;
}

.dark .pipeline-columns-popover__header,
html.dark .pipeline-columns-popover__header {
  background-color: #1e293b !important;
}

#pipelineColumnsCheckboxes label {
  padding: 0.15rem 0;
}

#pipelineColumnsCheckboxes {
  background-color: inherit;
  padding-right: 0.25rem;
}

.dark .pipeline-columns-popover,
.dark #pipelineColumnsPopover,
html.dark .pipeline-columns-popover,
html.dark #pipelineColumnsPopover {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f8fafc;
  box-shadow:
    0 20px 40px -12px rgba(0, 0, 0, 0.55),
    0 8px 16px -8px rgba(0, 0, 0, 0.35);
}

/* Modals opened from lead panel (panel is z-index 400) */
.email-intel-modal {
  z-index: 500 !important;
}

#smsScriptModal {
  z-index: 520 !important;
  pointer-events: auto !important;
}

#smsScriptModal.hidden {
  display: none !important;
}

#smsScriptModal:not(.hidden) {
  display: flex !important;
  align-items: flex-start;
  justify-content: center;
}

#leadPanelOutreachFeedback.lead-panel-outreach-feedback--info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.35);
  color: #1e40af;
}

.dark #leadPanelOutreachFeedback.lead-panel-outreach-feedback--info {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(96, 165, 250, 0.35);
  color: #bfdbfe;
}

#leadPanelOutreachFeedback.lead-panel-outreach-feedback--success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #047857;
}

.dark #leadPanelOutreachFeedback.lead-panel-outreach-feedback--success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}

#leadPanelOutreachFeedback.lead-panel-outreach-feedback--error {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.35);
  color: #be123c;
}

.dark #leadPanelOutreachFeedback.lead-panel-outreach-feedback--error {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

#leadPanelOutreachDrawer [aria-disabled='true'] {
  pointer-events: auto;
}

#prospectLeadsTable {
  border-collapse: separate !important;
}

/* Checkbox + bookmark sit in the sticky check column. */
.prospect-leads-table th.lead-sticky-check,
.prospect-leads-table td.lead-sticky-check {
  width: 5.25rem;
  min-width: 5.25rem;
  max-width: 5.25rem;
  box-sizing: border-box;
}

.prospect-leads-table tbody tr:nth-child(odd) td {
  background-color: rgba(250, 247, 237, 0.45);
}

.prospect-leads-table tbody tr:nth-child(even) td {
  background-color: var(--brand-card-bg);
}

.dark .prospect-leads-table tbody tr:nth-child(odd) td {
  background-color: rgba(30, 41, 59, 0.55);
}

.dark .prospect-leads-table tbody tr:nth-child(even) td {
  background-color: var(--brand-card-bg);
}

.prospect-leads-table--comfortable tbody td {
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable tbody td {
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}

.prospect-leads-table--comfortable thead th {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable thead th {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.prospect-leads-table--compact tbody td {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.prospect-leads-table--compact thead th {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Split Phone / Email / Domain columns: rows stay single-line via inline flex in template */
.prospect-leads-table--compact .lead-company-inline {
  min-height: 2.6rem;
}

.prospect-leads-table--comfortable .lead-company-inline {
  min-height: 3rem;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-company-inline {
  min-height: 3rem;
}

.prospect-leads-table .lead-row-address {
  max-width: 100%;
  white-space: normal;
}

.prospect-leads-table--compact .lead-row-address--detail {
  display: none;
}

.prospect-leads-table--comfortable .lead-row-address--compact {
  display: none;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-row-address--compact {
  display: none;
}

.prospect-leads-table--comfortable .lead-row-address--detail,
html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-row-address--detail {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.prospect-leads-table--comfortable .lead-col-contact-split {
  display: none;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-col-contact-split {
  display: none;
}

.prospect-leads-table--compact .lead-col-contact-split {
  display: none;
}

html[data-prospect-density="compact"] #prospectLeadsTable .lead-col-contact-split {
  display: none;
}

/* Socials column — hide empty dash placeholder from renderLinks */
.prospect-leads-table .lead-cell-socials-content .text-brand-muted\/60 {
  display: none;
}

.prospect-leads-table th[data-plc="socials"],
.prospect-leads-table td[data-plc="socials"] {
  min-width: 5.5rem;
}

.prospect-leads-table--comfortable th[data-plc="socials"],
.prospect-leads-table--comfortable td[data-plc="socials"] {
  min-width: 7.5rem;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable th[data-plc="socials"],
html[data-prospect-density="comfortable"] #prospectLeadsTable td[data-plc="socials"] {
  min-width: 7.5rem;
}

.prospect-leads-table--comfortable .lead-cell-socials-content {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-cell-socials-content {
  display: inline-flex;
  flex-flow: row nowrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

.prospect-leads-table--comfortable .lead-cell-socials-content > a,
.prospect-leads-table--comfortable .lead-cell-socials-content > span {
  flex-shrink: 0;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-cell-socials-content > a,
html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-cell-socials-content > span {
  flex-shrink: 0;
}

.prospect-leads-table--comfortable .lead-contact-phone-slot.js-click-to-call-number {
  flex-wrap: nowrap;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-contact-phone-slot.js-click-to-call-number {
  flex-wrap: nowrap;
}

.lead-phone-line-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  flex-shrink: 0;
}

.lead-phone-line-mark--cell {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.14);
}

.lead-phone-line-mark--landline {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
}

.lead-phone-line-mark--voip {
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.16);
}

.dark .lead-phone-line-mark--cell {
  color: #7dd3fc;
}

.dark .lead-phone-line-mark--landline {
  color: #fcd34d;
}

.dark .lead-phone-line-mark--voip {
  color: #c4b5fd;
}

.prospect-leads-table--compact .lead-col-tail-tight,
.prospect-leads-table--compact th.lead-col-tail-tight {
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.prospect-leads-table--compact .lead-col-opportunity {
  min-width: 7.5rem;
  max-width: 15rem;
}

.opportunity-cell .lead-owner-signal {
  display: none !important;
}

.prospect-leads-table--compact .lead-actions-cell {
  padding-right: 0.65rem;
}

.lead-actions-cell {
  min-width: 6.75rem;
  overflow: visible;
  white-space: nowrap;
}

.lead-actions-cell .quick-outreach-btn,
.lead-actions-cell .ai-analysis-btn,
.lead-actions-cell .pipeline-row-call-btn,
.lead-actions-cell .pipeline-row-sms-btn,
.lead-actions-cell .view-detail-btn {
  flex-shrink: 0;
}

.prospect-leads-table--compact .lead-col-pipeline .pipeline-inline-select {
  font-size: 0.625rem;
  line-height: 1.2;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.prospect-leads-table--comfortable .lead-col-tail-tight,
.prospect-leads-table--comfortable th.lead-col-tail-tight {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-col-tail-tight,
html[data-prospect-density="comfortable"] #prospectLeadsTable th.lead-col-tail-tight {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.prospect-leads-table--comfortable .lead-col-opportunity {
  max-width: 20rem;
}

html[data-prospect-density="comfortable"] #prospectLeadsTable .lead-col-opportunity {
  max-width: 20rem;
}

.result-row:focus-within .ai-analysis-btn,
.lead-actions-cell:focus-within .ai-analysis-btn {
  opacity: 1 !important;
  pointer-events: auto !important;
}

html[data-prospect-density="compact"] #tableView .lead-density-btn[data-density="compact"],
html[data-prospect-density="comfortable"] #tableView .lead-density-btn[data-density="comfortable"] {
  background-color: var(--brand-yellow);
  color: var(--brand-on-accent, #111827);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

html[data-prospect-density="compact"] #tableView .lead-density-btn[data-density="comfortable"],
html[data-prospect-density="comfortable"] #tableView .lead-density-btn[data-density="compact"] {
  background-color: transparent;
  color: var(--brand-muted, #64748b);
  box-shadow: none;
}

.dark html[data-prospect-density="compact"] #tableView .lead-density-btn[data-density="comfortable"],
.dark html[data-prospect-density="comfortable"] #tableView .lead-density-btn[data-density="compact"] {
  color: rgb(148 163 184);
}

/* Containing block for absolutely positioned bits in cells (.sr-only labels, resize
   handles). Without it they position against the page, escape this box's clipping and
   stretch the page to the table's full width — phones then zoom out / pan sideways. */
#prospectPipelineTableScroll,
#kanbanView {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
}

html.pipeline-prefs-pending #prospectPipelineTableScroll {
  visibility: hidden;
  min-height: 12rem;
}

html[data-pipeline-prefs-ready="1"] #prospectPipelineTableScroll {
  visibility: visible;
}

#pipelineTableLoading {
  display: none;
}

html.pipeline-prefs-pending #pipelineTableLoading {
  display: flex;
}

.lead-checkbox:checked {
  background-color: var(--brand-yellow);
  border-color: var(--brand-yellow);
}

.bookmark-btn[data-saved='1'],
.bookmark-btn.bookmark-btn--saved {
  background-color: var(--brand-yellow) !important;
  color: var(--brand-on-accent, #111827) !important;
  border-color: var(--brand-yellow) !important;
}

.bookmark-btn[data-saved='1'] svg,
.bookmark-btn.bookmark-btn--saved svg {
  fill: currentColor !important;
}

.prospect-leads-table tr.result-row.pipeline-row-page-hidden {
  display: none !important;
}

/* Search Container 2.0 Animations */
#searchContainer {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#scheduledSearchSettings {
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s ease-out,
              padding-top 0.4s ease;
}

#searchBtn {
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#searchBtn:active {
  transform: scale(0.95);
}

.search-input-focus:focus-within {
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

@media (max-width: 1024px) {
  #searchContainer {
    border-radius: 2rem;
  }
}

/* Find Leads page — full-width, mobile-responsive layout */
body.find-leads-page {
  --find-leads-offset: 260px;
}

body.find-leads-page .app-shell-content > main.find-leads-main {
  flex: 1 1 auto;
  min-height: 0;
}

body.find-leads-page #searchContainer {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.find-leads-page .find-leads-card {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

body.find-leads-page #searchForm {
  flex: 1 1 auto;
  min-height: 0;
}

body.find-leads-page .find-leads-step-panel:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
}

body.find-leads-page .find-leads-step1-panel {
  flex: 1 1 auto;
  min-height: 0;
}

@media (min-width: 768px) {
  body.find-leads-page .find-leads-step1-panel {
    min-height: calc(100dvh - var(--find-leads-offset));
  }
}

body.find-leads-page #findTypeTabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}

body.find-leads-page #findTypeTabs::-webkit-scrollbar {
  display: none;
}

body.find-leads-page #findTypeTabs .find-type-tab {
  flex-shrink: 0;
}

@media (max-width: 639px) {
  body.find-leads-page .find-location-search-row {
    flex-direction: column;
    border-radius: 1.25rem;
  }

  body.find-leads-page .find-location-search-row input {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  body.find-leads-page .find-location-search-row #findLocationResolveBtn {
    width: 100%;
    margin: 0;
    border-radius: 0 0 1.125rem 1.125rem;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
  }

  body.find-leads-page .find-leads-header-desc {
    display: none;
  }

  body.find-leads-page .find-leads-header h1 {
    font-size: 1.5rem;
    line-height: 2rem;
  }

  body.find-leads-page .find-step-pill {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  body.find-leads-page #findAreaMapCol {
    min-height: min(45vh, 420px);
  }
}

@media (min-width: 768px) {
  body.find-leads-page {
    --find-leads-offset: 300px;
  }
}

@media (min-width: 1024px) {
  body.find-leads-page {
    --find-leads-offset: 320px;
  }
}

/* Notification Bell & Processing Indicator */
.processing-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Monochrome sweep from workspace accent (--brand-yellow), not multi-hue */
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        color-mix(in srgb, var(--brand-yellow) 25%, transparent) 70deg,
        color-mix(in srgb, var(--brand-yellow) 70%, white) 160deg,
        var(--brand-yellow) 250deg,
        color-mix(in srgb, var(--brand-yellow) 35%, transparent) 320deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 2.5px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 2.5px));
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--brand-yellow) 45%, transparent));
}

.processing-active .processing-ring {
    opacity: 1;
    inset: -5px;
    animation: alexa-sweep 1.2s cubic-bezier(0.55, 0.055, 0.675, 0.19) infinite;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--brand-yellow) 55%, transparent));
}

.bell-icon-wrapper {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.processing-active .bell-icon-wrapper {
    transform: scale(1.1);
}

#processingIndicator:has(#bulkEnhanceBellBadge:not(.hidden)) > svg {
    opacity: 0.9;
}

/* Navbar work badge — always high contrast (progress / LIVE / ART). */
.nav-bell-badge,
#bulkEnhanceBellBadge {
  position: absolute;
  bottom: -0.1rem;
  right: -0.15rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  height: 1.2rem;
  padding: 0 0.28rem;
  border-radius: 0.4rem;
  border: 2px solid #fff;
  background: #059669 !important;
  color: #fff !important;
  font-size: 0.5625rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  pointer-events: none;
}

.dark .nav-bell-badge,
.dark #bulkEnhanceBellBadge {
  border-color: #0f172a;
}

.nav-inbound-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.25rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.dark .nav-inbound-badge {
  border-color: #0f172a;
}

.nav-inbound-badge.hidden,
#notificationDropdown.has-inbound #notificationList > div.italic:only-child {
  display: none !important;
}

#bulkEnhanceBellBadge.hidden {
  display: none !important;
}

.bell-icon-wrapper.has-notification::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: #EF4444; /* Red dot */
    border-radius: 50%;
    border: 2px solid var(--brand-card-bg);
}

.bell-shake {
    animation: bell-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes alexa-sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    60% { transform: rotate(10deg); }
    80% { transform: rotate(-10deg); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Resources library: URL badge — full address after hover/focus dwell (~480ms, see resources.ejs) */
.res-url-reveal {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    margin-top: 0.25rem;
    min-width: 0;
    max-width: 100%;
}

.res-url-reveal .res-url-tip {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 30;
    margin-top: 0.35rem;
    padding: 0.5rem 0.75rem;
    max-width: min(100%, 22rem);
    width: max-content;
    border-radius: 0.75rem;
    border: 1px solid var(--brand-border);
    background: var(--brand-card-bg);
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.12), 0 4px 12px -4px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.dark .res-url-reveal .res-url-tip {
    box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45), 0 4px 12px -4px rgba(0, 0, 0, 0.25);
}

.res-url-reveal.res-url-open .res-url-tip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Resources library: clamp long notes; click Show more to expand */
.res-note-block {
    min-width: 0;
}
.res-note-preview.is-collapsed {
    max-height: 7.5rem;
    overflow: hidden;
    position: relative;
}
.res-note-preview.is-collapsed::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.25rem;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, var(--brand-card-bg, #fff));
}
.dark .res-note-preview.is-collapsed::after {
    background: linear-gradient(to bottom, transparent, rgb(15 23 42));
}
.res-card-equal {
    height: 100%;
}

/* ========= Lead panel map strip (tiles only; contact card is separate) ========= */
#leadPanelHeroBackdropTint {
    background: linear-gradient(145deg, var(--brand-cream) 0%, #ffffff 48%, var(--brand-cream) 100%);
}
.dark #leadPanelHeroBackdropTint {
    background: linear-gradient(145deg, rgb(15 23 42) 0%, rgb(30 41 59) 52%, rgb(15 23 42) 100%);
}

#leadPanelMapStripWrap.lead-panel-hero-map #leadPanelHeroBackdropTint {
    background: linear-gradient(145deg, rgb(71 85 105), rgb(51 65 85), rgb(30 41 59));
}
.dark #leadPanelMapStripWrap.lead-panel-hero-map #leadPanelHeroBackdropTint {
    background: linear-gradient(145deg, rgb(15 23 42), rgb(30 41 59), rgb(2 6 23));
}

.lead-panel-hero-backdrop-link {
    display: none !important;
}
#leadPanelMapStripWrap.lead-panel-hero-map .lead-panel-hero-backdrop-link {
    display: block !important;
}

.lead-panel-hero-backdrop-img {
    opacity: 0;
    transition: opacity 0.35s ease;
}
#leadPanelMapStripWrap.lead-panel-hero-map .lead-panel-hero-backdrop-img:not(.hidden) {
    opacity: 1;
}

#leadPanelHeroBackdropEmbed:not(.hidden) {
    opacity: 1;
}

/* Embedded iframe maps: don't paint a heavy slate wash on top of blank iframe chrome */
#leadPanelMapStripWrap.lead-panel-map-embed-mode.lead-panel-hero-map #leadPanelHeroBackdropTint {
    background: transparent !important;
}

.dark #leadPanelMapStripWrap.lead-panel-map-embed-mode.lead-panel-hero-map #leadPanelHeroBackdropTint {
    background: rgba(15, 23, 42, 0.28) !important;
}

.lead-panel-sticky-phone {
    font-variant-numeric: tabular-nums;
}

/* Lead panel: interactive Maps JS strip (scrolls with tab body) */
#leadPanelJsMapWrap:not(.hidden) {
    touch-action: pan-x pan-y pinch-zoom;
}
#leadPanelMapStripWrap.lead-panel-js-map-mode,
#leadPanelMapStripWrap.lead-panel-strip-map-mode {
    border-color: rgba(148, 163, 184, 0.22);
    overflow: visible;
}
#leadPanelMapStaticImg:not(.hidden),
#leadPanelMapEmbed:not(.hidden) {
    touch-action: pan-x pan-y pinch-zoom;
}
.dark #leadPanelMapStripWrap.lead-panel-js-map-mode,
.dark #leadPanelMapStripWrap.lead-panel-strip-map-mode {
    border-color: rgba(255, 255, 255, 0.08);
}
#leadPanelMapStripWrap.lead-panel-map-embed-mode #leadPanelHeroBackdrop,
#leadPanelMapStripWrap.lead-panel-hero-map:not(.lead-panel-strip-map-mode):not(.lead-panel-js-map-mode) #leadPanelHeroBackdrop {
    overflow: hidden;
    border-radius: 2rem 2rem 0 0;
}

/* Lead panel: bundled note inside quick log — always visible when quick log is open */
#leadPanelComposerDrawer.lead-panel-composer-drawer {
    max-height: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
}
#leadPanelComposerDrawer.lead-panel-composer-drawer.lead-panel-composer-drawer--open {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
}

/* Lead panel: quick log + note — single open block */
#leadPanelQuickLogDrawer.lead-panel-quicklog-drawer {
    max-height: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
}
#leadPanelQuickLogDrawer.lead-panel-quicklog-drawer.lead-panel-quicklog-drawer--open {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
}
#leadPanelQuickLogChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}
#mobilePanel.open #leadPanelQuickLogDrawer.lead-panel-quicklog-drawer--open,
#mobilePanel.open #leadPanelQuickLogDrawer.lead-panel-quicklog-drawer--open * {
    pointer-events: auto;
}

/* Lead panel: send info drawer — collapsed by default */
#leadPanelOutreachDrawer.lead-panel-outreach-drawer {
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.22s ease;
    overflow: hidden;
    pointer-events: none;
}
#leadPanelOutreachDrawer.lead-panel-outreach-drawer.lead-panel-outreach-drawer--open {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    padding-bottom: 0.75rem;
}
#mobilePanel.open #leadPanelNotepad,
#mobilePanel.open #leadPanelNotepad button,
#mobilePanel.open #leadPanelNotepad select,
#mobilePanel.open #leadPanelNotepad input,
#mobilePanel.open #leadPanelNotepad label,
#mobilePanel.open #leadPanelComposerDrawer.lead-panel-composer-drawer--open,
#mobilePanel.open #leadPanelComposerDrawer.lead-panel-composer-drawer--open *,
#mobilePanel.open #leadPanelOutreachDrawer.lead-panel-outreach-drawer--open,
#mobilePanel.open #leadPanelOutreachDrawer.lead-panel-outreach-drawer--open *,
#mobilePanel.open #leadPanelGlanceContent,
#mobilePanel.open #leadPanelGlanceContent *,
#mobilePanel.open #leadPanelCompanyTagsSection,
#mobilePanel.open #leadPanelCompanyTagsSection * {
    pointer-events: auto;
}
#leadPanelOutreachChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Lead panel: cadence playbook block — collapsed by default */
#leadPanelCadencePlaybookDrawer.lead-panel-cadence-playbook-drawer {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    transition:
        max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.22s ease,
        margin-top 0.28s ease;
    overflow: hidden;
    pointer-events: none;
}
#leadPanelCadencePlaybookDrawer.lead-panel-cadence-playbook-drawer.lead-panel-cadence-playbook-drawer--open {
    max-height: min(56rem, 90vh);
    opacity: 1;
    margin-top: 0 !important;
    pointer-events: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#leadPanelCadencePlaybookChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}
#mobilePanel.open #leadPanelCadencePlaybookDrawer.lead-panel-cadence-playbook-drawer--open,
#mobilePanel.open #leadPanelCadencePlaybookDrawer.lead-panel-cadence-playbook-drawer--open * {
    pointer-events: auto;
}

/* Lead panel: AI tools assessment — collapsed by default */
#leadPanelAiToolsDrawer.lead-panel-ai-tools-drawer {
    max-height: 0;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transition:
        max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.22s ease,
        padding 0.28s ease;
    overflow: hidden;
    pointer-events: none;
}
#leadPanelAiToolsDrawer.lead-panel-ai-tools-drawer.lead-panel-ai-tools-drawer--open {
    max-height: min(24rem, 75vh);
    opacity: 1;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    pointer-events: auto;
    overflow: visible;
}
#leadPanelAiToolsChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}
#mobilePanel.open #leadPanelAiToolsDrawer.lead-panel-ai-tools-drawer--open,
#mobilePanel.open #leadPanelAiToolsDrawer.lead-panel-ai-tools-drawer--open * {
    pointer-events: auto;
}

/* Lead panel: quick log / outreach dock — collapsible as one unit */
#leadPanelNotepadBody.lead-panel-notepad-body {
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.38s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.24s ease;
    overflow: hidden;
    pointer-events: none;
}
#leadPanelNotepadBody.lead-panel-notepad-body.lead-panel-notepad-body--open {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    padding-bottom: 0.5rem;
}
#leadPanelSendInfoCard.lead-panel-send-info-card--open {
    overflow: visible;
}
#leadPanelOutreachDrawer.lead-panel-outreach-drawer.lead-panel-outreach-drawer--open .lead-send-info {
    overflow: visible;
}
#leadPanelOutreachDrawer.lead-panel-outreach-drawer.lead-panel-outreach-drawer--open .lead-send-info-pack-details[open] {
    max-height: none;
}
#leadPanelNotepadChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}
/* Action dock shared by Money mode and the company profile (Call · SMS · third action · More) */
.focus-mobile-dock-sheet {
    margin-bottom: 0.55rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: #fff;
    padding: 0.65rem;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    max-height: min(50vh, 22rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.focus-mobile-dock-sheet:not(.hidden) {
    display: grid;
}
html.dark .focus-mobile-dock-sheet {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.12);
}
.focus-mobile-dock-sheet .focus-dock-btn {
    min-height: 3.1rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 0.9rem;
    padding: 0.65rem 0.5rem;
}
.focus-mobile-dock-bar {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1.2fr auto;
    gap: 0.45rem;
    align-items: stretch;
}
.focus-mobile-dock-bar .focus-dock-btn {
    min-height: 3.35rem;
    border-radius: 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    font-weight: 900;
    text-transform: uppercase;
    padding: 0.55rem 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}
.focus-dock-btn--call {
    background: #111827;
    color: #fff;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.28);
}
html.dark .focus-dock-btn--call {
    background: #FFDB3A;
    color: #111827;
}
.focus-dock-btn--sms {
    background: rgba(16, 185, 129, 0.18);
    color: #065f46;
    border: 1.5px solid rgba(16, 185, 129, 0.45) !important;
}
html.dark .focus-dock-btn--sms {
    color: #a7f3d0;
}
.focus-dock-btn--next {
    background: rgba(250, 204, 21, 0.35);
    color: #111827;
    border: 1.5px solid rgba(202, 138, 4, 0.45) !important;
}
html.dark .focus-dock-btn--next {
    color: #fef9c3;
}
.focus-dock-btn--more {
    width: 3.35rem;
    min-width: 3.35rem;
    background: #fff;
    color: #111827;
    border: 1.5px solid rgba(17, 24, 39, 0.14) !important;
}
html.dark .focus-dock-btn--more {
    background: #1e293b;
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.14) !important;
}
.focus-dock-btn--more[aria-expanded="true"] {
    background: #111827;
    color: #fff;
}
html.dark .focus-dock-btn--more[aria-expanded="true"] {
    background: #FFDB3A;
    color: #111827;
}
.focus-dock-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}
.focus-dock-btn svg {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
}
/* Mask icons survive app.js swapping button textContent (e.g. "Syncing…") */
.focus-dock-btn--icon-call::before,
.focus-dock-btn--icon-sms::before {
    content: '';
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: var(--dock-icon) center / contain no-repeat;
    mask: var(--dock-icon) center / contain no-repeat;
}
.focus-dock-btn--icon-call {
    --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z'/%3E%3C/svg%3E");
}
.focus-dock-btn--icon-sms {
    --dock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10h8M8 14h5M21 12a8 8 0 01-8 8H7l-4 3V12a8 8 0 1118 0z'/%3E%3C/svg%3E");
}

#leadPanelDockSheet.hidden {
    display: none !important;
}
#leadPanelDockSheet {
    margin-top: 0.4rem;
    margin-bottom: 0.45rem;
}
#mobilePanel.open #leadPanelNotepad.lead-panel-notepad--collapsed #leadPanelOutreachCtaRow,
#mobilePanel.open #leadPanelNotepad.lead-panel-notepad--collapsed #leadPanelOutreachCtaRow button,
#mobilePanel.open #leadPanelNotepad.lead-panel-notepad--collapsed #leadPanelDockSheet,
#mobilePanel.open #leadPanelNotepad.lead-panel-notepad--collapsed #leadPanelDockSheet *,
#mobilePanel.open #leadPanelNotepad.lead-panel-notepad--collapsed #leadPanelGhlEmailSection,
#mobilePanel.open #leadPanelNotepad.lead-panel-notepad--collapsed #leadPanelGhlEmailSection * {
    pointer-events: auto;
}

/* Softphone keypad must stay scrollable to the top after wrap-up */
#softphoneTabKeypad {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
#mobilePanel.open #leadPanelNotepadBody.lead-panel-notepad-body--open,
#mobilePanel.open #leadPanelNotepadBody.lead-panel-notepad-body--open * {
    pointer-events: auto;
}

/* Dock cards keep their natural height — overflow scrolls instead of squishing (and clipping) the quick log card. */
#leadPanelNotepadBody > * {
    flex-shrink: 0;
}

/* SMS bubbles: long links / tokens wrap inside the bubble instead of being clipped by the thread. */
#leadSmsThreadList {
    overflow-x: hidden;
}
#leadSmsThreadList > div {
    min-width: 0;
}
#leadSmsThreadList > div > div {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 767px) {
    #leadSmsThreadSection.lead-panel-composer,
    #leadPanelGhlEmailSection.lead-panel-composer {
        padding: 0.9rem;
    }
    #leadSmsThreadList {
        min-height: 40vh;
        max-height: 60vh;
        -webkit-overflow-scrolling: touch;
    }
    #leadSmsThreadList > div {
        max-width: 88%;
    }
    #leadSmsThreadList > div > div {
        font-size: 0.875rem;
        line-height: 1.45;
    }
    #leadSmsComposeInput {
        min-height: 9.5rem;
    }
    #leadPanelGhlEmailBody {
        min-height: 14rem;
    }
    #leadPanelGhlEmailTo {
        max-width: 100%;
    }
    #leadPanelNotepadBody .lead-panel-composer-footer {
        flex-direction: column;
        align-items: stretch;
    }
    #leadPanelNotepadBody .lead-panel-composer-actions {
        width: 100%;
        flex-wrap: nowrap;
    }
    #leadPanelNotepadBody .lead-panel-composer-actions > button {
        flex: 1 1 0;
        min-height: 2.9rem;
    }
}

/* Lead panel scroll body: uniform vertical rhythm */
#leadPanelTabScroll {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#leadPanelTabScroll > #leadPanelCallerShell,
#leadPanelTabScroll > section,
#leadPanelTabScroll > .lead-tab-panel {
    margin-bottom: 0 !important;
    margin-top: 0 !important;
}

#leadPanelTabScroll .lead-panel-tab-stack > section {
    margin-bottom: 0 !important;
}

#leadPanelSectionNav {
    margin-bottom: 0 !important;
    flex-shrink: 0;
}

.lead-panel--non-agency .lead-panel-agency-only {
    display: none !important;
}

#leadPanelContactDetailsToggle[aria-expanded="true"] .lead-panel-contact-toggle-chevron {
    transform: rotate(180deg);
}

/* Lead panel history tab: consistent widget spacing */
.lead-panel-tab-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.lead-panel-widget {
    border-radius: 1.5rem;
    padding: 1.25rem 1.35rem;
}

.lead-panel-widget--callback {
    border: 1px solid rgba(14, 165, 233, 0.28);
    background: rgba(14, 165, 233, 0.06);
}

.dark .lead-panel-widget--callback {
    background: rgba(8, 47, 73, 0.35);
    border-color: rgba(56, 189, 248, 0.22);
}

.lead-panel-widget--ai-tools {
    border: 1px solid rgba(249, 115, 22, 0.28);
    background: rgba(249, 115, 22, 0.06);
    padding: 0;
    overflow: hidden;
}

.dark .lead-panel-widget--ai-tools {
    background: rgba(67, 20, 7, 0.42);
    border-color: rgba(251, 146, 60, 0.24);
}

.lead-panel-widget--cadence {
    border: 1px solid rgba(139, 92, 246, 0.32);
    background: rgba(139, 92, 246, 0.06);
    padding: 0;
    overflow: hidden;
}

.dark .lead-panel-widget--cadence {
    background: rgba(46, 16, 101, 0.45);
    border-color: rgba(139, 92, 246, 0.28);
}

.lead-panel-widget--plain {
    padding: 1.15rem 1.25rem 1.25rem;
}

.lead-panel-widget__block {
    padding: 1.25rem 1.35rem;
}

.lead-panel-widget__divider {
    height: 1px;
    margin: 0 1.35rem;
    background: rgba(139, 92, 246, 0.28);
}

.dark .lead-panel-widget__divider {
    background: rgba(139, 92, 246, 0.38);
}

.lead-panel-widget__inner {
    margin-top: 0.75rem;
    padding: 1.1rem 1.15rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(250, 248, 245, 0.55);
}

.dark .lead-panel-widget__inner {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.lead-panel-widget__title {
    margin: 0 0 0.65rem;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.3;
}

.lead-panel-widget__title--sky {
    color: rgb(7, 89, 133);
}

.dark .lead-panel-widget__title--sky {
    color: rgb(186, 230, 253);
}

.lead-panel-widget__title--orange {
    color: rgb(194, 65, 12);
}

.dark .lead-panel-widget__title--orange {
    color: rgb(253, 186, 116);
}

.lead-panel-widget__title--violet {
    color: rgb(91, 33, 182);
}

.dark .lead-panel-widget__title--violet {
    color: rgb(221, 214, 254);
}

.lead-panel-widget__title--muted {
    color: var(--brand-muted, #64748b);
}

.dark .lead-panel-widget__title--muted {
    color: rgb(148, 163, 184);
}

.lead-panel-widget__lede {
    margin: 0 0 0.85rem;
    font-size: 11px;
    line-height: 1.55;
    color: var(--brand-muted, #64748b);
}

.dark .lead-panel-widget__lede {
    color: rgb(148, 163, 184);
}

.lead-panel-field-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--brand-muted, #64748b);
}

.lead-panel-field-label--violet {
    color: rgb(91, 33, 182);
}

.dark .lead-panel-field-label--violet {
    color: rgb(196, 181, 253);
}

/* Schedule callback — compact branded date picker */
.adhello-date-trigger__label--empty {
    color: var(--brand-muted, #64748b);
    font-weight: 600;
}

.dark .adhello-date-trigger__label--empty {
    color: rgb(148, 163, 184);
}

.adhello-mini-calendar {
    border-radius: 1rem;
    border: 1px solid rgba(14, 165, 233, 0.28);
    background-color: #fff !important;
    background: #fff !important;
    opacity: 1 !important;
    isolation: isolate;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow:
        0 16px 40px -16px rgba(15, 23, 42, 0.28),
        0 0 0 1px rgba(15, 23, 42, 0.04);
    padding: 0;
    user-select: none;
    overflow: hidden;
}

.adhello-mini-calendar__surface {
    background-color: #fff !important;
    background: #fff !important;
    padding: 0.65rem 0.7rem 0.55rem;
}

.dark .adhello-mini-calendar {
    background-color: rgb(15, 23, 42) !important;
    background: rgb(15, 23, 42) !important;
    border-color: rgba(56, 189, 248, 0.24);
    box-shadow:
        0 18px 44px -14px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06);
}

.dark .adhello-mini-calendar__surface {
    background-color: rgb(15, 23, 42) !important;
    background: rgb(15, 23, 42) !important;
}

#leadCallbackDatePopover.adhello-mini-calendar {
    position: fixed;
    z-index: 10050 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: var(--brand-dark);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    isolation: isolate;
    opacity: 1 !important;
    box-shadow:
        0 20px 40px -12px rgba(17, 24, 39, 0.18),
        0 8px 16px -8px rgba(17, 24, 39, 0.1);
}

.dark #leadCallbackDatePopover.adhello-mini-calendar,
html.dark #leadCallbackDatePopover.adhello-mini-calendar {
    background-color: #0f172a !important;
    background: #0f172a !important;
    color: #f8fafc;
}

.adhello-mini-calendar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
    background-color: #fff !important;
    background: #fff !important;
}

.dark .adhello-mini-calendar__head {
    background-color: rgb(15, 23, 42) !important;
    background: rgb(15, 23, 42) !important;
}

.adhello-mini-calendar__month {
    margin: 0;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgb(7, 89, 133);
    text-align: center;
    flex: 1;
}

.dark .adhello-mini-calendar__month {
    color: rgb(186, 230, 253);
}

.adhello-mini-calendar__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(250, 247, 237, 0.65);
    color: rgb(51, 65, 85);
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.adhello-mini-calendar__nav:hover {
    border-color: rgba(14, 165, 233, 0.45);
    background: rgba(14, 165, 233, 0.08);
    color: rgb(7, 89, 133);
}

.dark .adhello-mini-calendar__nav {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgb(203, 213, 225);
}

.dark .adhello-mini-calendar__nav:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(14, 165, 233, 0.12);
    color: rgb(186, 230, 253);
}

.adhello-mini-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.15rem;
    background-color: #fff !important;
    background: #fff !important;
}

.dark .adhello-mini-calendar__grid {
    background-color: rgb(15, 23, 42) !important;
    background: rgb(15, 23, 42) !important;
}

.adhello-mini-calendar__dow {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.35rem;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.85);
}

.dark .adhello-mini-calendar__dow {
    color: rgba(148, 163, 184, 0.85);
}

.adhello-mini-calendar__pad {
    display: block;
    height: 1.75rem;
}

.adhello-mini-calendar__day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 1.75rem;
    border: none;
    border-radius: 0.55rem;
    background: transparent;
    font-size: 11px;
    font-weight: 700;
    color: rgb(30, 41, 59);
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.adhello-mini-calendar__day:hover {
    background: rgba(14, 165, 233, 0.1);
    color: rgb(7, 89, 133);
}

.adhello-mini-calendar__day.is-today:not(.is-selected) {
    box-shadow: inset 0 0 0 1.5px rgba(255, 214, 68, 0.85);
    color: rgb(7, 89, 133);
}

.adhello-mini-calendar__day.is-selected {
    background: rgb(14, 165, 233);
    color: #fff;
    box-shadow: 0 4px 12px -4px rgba(14, 165, 233, 0.65);
}

.adhello-mini-calendar__day.is-selected:hover {
    background: rgb(2, 132, 199);
    color: #fff;
}

.dark .adhello-mini-calendar__day {
    color: rgb(226, 232, 240);
}

.dark .adhello-mini-calendar__day:hover {
    background: rgba(14, 165, 233, 0.18);
    color: rgb(186, 230, 253);
}

.dark .adhello-mini-calendar__day.is-today:not(.is-selected) {
    color: rgb(186, 230, 253);
}

.adhello-mini-calendar__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background-color: #fff !important;
    background: #fff !important;
}

.dark .adhello-mini-calendar__foot {
    border-top-color: rgba(255, 255, 255, 0.08);
    background-color: rgb(15, 23, 42) !important;
    background: rgb(15, 23, 42) !important;
}

.adhello-mini-calendar__link {
    border: none;
    background: transparent;
    padding: 0.15rem 0.25rem;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(100, 116, 139);
    cursor: pointer;
}

.adhello-mini-calendar__link:hover {
    color: rgb(7, 89, 133);
}

.adhello-mini-calendar__link--accent {
    color: rgb(14, 165, 233);
}

.adhello-mini-calendar__link--accent:hover {
    color: rgb(2, 132, 199);
}

.dark .adhello-mini-calendar__link {
    color: rgb(148, 163, 184);
}

.dark .adhello-mini-calendar__link:hover {
    color: rgb(186, 230, 253);
}

.dark .adhello-mini-calendar__link--accent {
    color: rgb(56, 189, 248);
}

#leadPanelFollowupStrip .gcal-datetime {
    width: 100%;
}

#leadPanelFollowupStrip .gcal-datetime-trigger {
    width: 100%;
    border-radius: 0.75rem;
    border-color: color-mix(in srgb, var(--brand-border, #d6d3d1) 50%, transparent);
    background: #fff;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.dark #leadPanelFollowupStrip .gcal-datetime-trigger {
    background: rgb(15 23 42);
    border-color: rgba(255, 255, 255, 0.1);
}

#leadPanelFollowupStrip .gcal-datetime-trigger:hover,
#leadPanelFollowupStrip .gcal-datetime-trigger:focus-visible {
    border-color: color-mix(in srgb, var(--brand-yellow, #facc15) 55%, transparent);
}

.lead-callback-hint {
    min-height: 1rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.45;
}

.lead-callback-hint--success {
    color: rgb(4 120 87);
    background: rgb(209 250 229 / 0.65);
    border: 1px solid rgb(52 211 153 / 0.45);
}

.dark .lead-callback-hint--success {
    color: rgb(167 243 208);
    background: rgb(6 78 59 / 0.35);
    border-color: rgb(16 185 129 / 0.35);
}

.lead-callback-hint--error {
    color: rgb(185 28 28);
    background: rgb(254 226 226 / 0.75);
    border: 1px solid rgb(248 113 113 / 0.45);
}

.dark .lead-callback-hint--error {
    color: rgb(252 165 165);
    background: rgb(127 29 29 / 0.35);
    border-color: rgb(239 68 68 / 0.35);
}

.lead-callback-hint--pending {
    color: rgb(3 105 161);
    background: rgb(224 242 254 / 0.75);
    border: 1px solid rgb(56 189 248 / 0.45);
}

.dark .lead-callback-hint--pending {
    color: rgb(125 211 252);
    background: rgb(12 74 110 / 0.35);
    border-color: rgb(14 165 233 / 0.35);
}

/* Focus mode — send info drawer — collapsed by default */
#focusSendInfoDrawer.focus-send-info-drawer {
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.22s ease;
    overflow: hidden;
    pointer-events: none;
}
#focusSendInfoDrawer.focus-send-info-drawer.focus-send-info-drawer--open {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    padding-bottom: 0.75rem;
}
#focusSendInfoDrawer.focus-send-info-drawer--open .lead-send-info {
    overflow: visible;
}

/* Focus mode — notes drawer — collapsed by default */
#focusNotesDrawer.focus-notes-drawer {
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.22s ease;
    overflow: hidden;
    pointer-events: none;
}
#focusNotesDrawer.focus-notes-drawer.focus-notes-drawer--open {
    max-height: 12rem;
    opacity: 1;
    pointer-events: auto;
    overflow: auto;
}

/* Focus mode — contact details drawer — collapsed by default */
#focusContactDetailsDrawer.focus-contact-details-drawer {
    max-height: 0;
    opacity: 0;
    transition:
        max-height 0.34s cubic-bezier(0.33, 1, 0.68, 1),
        opacity 0.22s ease;
    overflow: hidden;
    pointer-events: none;
}
#focusContactDetailsDrawer.focus-contact-details-drawer.focus-contact-details-drawer--open {
    max-height: none;
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
    padding-top: 0.625rem;
    padding-bottom: 0.75rem;
}
#focusNotesChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}

#focus-outcome-panel.focus-outcome-panel--send-customize #focus-outcome-details {
    overflow: visible;
}
#focusSendInfoChevron {
    transform-origin: center;
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Send info — hide quick fields when customize panel is open */
.lead-send-info--customize-open .lead-send-info-quick-fields {
    display: none;
}

/* Focus — focus panel on customize send (hide CTAs, quick log, notes) */
#focus-outcome-panel.focus-outcome-panel--send-customize #focus-outcome-actions,
#focus-outcome-panel.focus-outcome-panel--send-customize #focus-outcome-shortcuts {
    display: none;
}

/* Focus mode — wider layout on large screens */
@media (min-width: 1280px) {
    #focus-card-section .focus-primary-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    #focus-card-section #focus-body {
        min-height: 16rem;
    }
}

.focus-mail-list-btn.is-on-list {
    opacity: 0.72;
    cursor: default;
}

#dmListFilters .dm-select {
    min-height: 2rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.95);
    color: inherit;
}

.dark #dmListFilters .dm-select {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
}

#dmLeadsTable tr.dm-filter-hidden {
    display: none;
}

/* Focus mode — collapsible call outcome panel */
#focus-outcome-panel[data-collapsed="true"] {
    padding-top: 0.65rem;
    padding-bottom: 0.75rem;
}

#focus-outcome-panel[data-collapsed="true"] #focus-outcome-header {
    justify-content: flex-end;
    margin-bottom: 0.15rem;
}

#focus-outcome-panel[data-collapsed="true"] #focus-outcome-actions {
    padding-top: 0;
}

/* Focus mode — compact single-row action bar */
#focus-outcome-panel[data-compact="true"] {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    transition: padding 0.22s ease;
}

#focus-outcome-panel[data-compact="true"] #focus-outcome-header {
    order: 2;
    margin-bottom: 0;
    margin-left: auto;
    flex-shrink: 0;
}

#focus-outcome-panel[data-compact="true"]:has(#focus-sms-compose-section:not(.hidden)) #focus-outcome-compact-toggle,
#focus-outcome-panel[data-compact="true"]:has(#focus-email-compose-section:not(.hidden)) #focus-outcome-compact-toggle {
    display: none;
}

#focus-outcome-panel[data-compact="true"] #focus-outcome-actions {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.375rem;
    padding-top: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#focus-outcome-panel[data-compact="true"] #focus-outcome-actions::-webkit-scrollbar {
    display: none;
}

#focus-outcome-panel[data-compact="true"] .focus-primary-actions,
#focus-outcome-panel[data-compact="true"] .focus-secondary-actions {
    display: contents;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-open-dialer,
#focus-outcome-panel[data-compact="true"] #focus-btn-back-secondary,
#focus-outcome-panel[data-compact="true"] #focus-quick-log-section,
#focus-outcome-panel[data-compact="true"] #focus-notes-section,
#focus-outcome-panel[data-compact="true"] #focus-followup-strip,
#focus-outcome-panel[data-compact="true"] #focus-quick-task-strip,
#focus-outcome-panel[data-compact="true"] #focus-bulk-ghl-section,
#focus-outcome-panel[data-compact="true"] #focus-outcome-feedback {
    display: none !important;
}

#focus-outcome-panel[data-compact="true"] #focus-outcome-actions .btn-pill {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.25rem;
    padding: 0.45rem 0.7rem;
    font-size: 10px;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-call {
    order: 1;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-sms {
    order: 2;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-email {
    order: 3;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-log {
    order: 4;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-call-next {
    order: 5;
}

#focus-outcome-panel[data-compact="true"] #focus-btn-skip {
    order: 6;
}

#focus-outcome-panel[data-compact="true"] #focus-outcome-compact-toggle {
    border-color: color-mix(in srgb, var(--brand-yellow, #facc15) 55%, transparent);
    color: var(--brand-dark, #111827);
    background: color-mix(in srgb, var(--brand-yellow, #facc15) 12%, transparent);
}

/* Focus compact bar — SMS/email composer spans full width above action buttons */
#focus-outcome-panel[data-compact="true"]:has(#focus-sms-compose-section:not(.hidden)),
#focus-outcome-panel[data-compact="true"]:has(#focus-email-compose-section:not(.hidden)) {
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0.5rem 0.65rem 0.55rem;
}

#focus-outcome-panel[data-compact="true"]:has(#focus-sms-compose-section:not(.hidden)) #focus-sms-compose-section,
#focus-outcome-panel[data-compact="true"]:has(#focus-email-compose-section:not(.hidden)) #focus-email-compose-section {
    order: 0;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

#focus-outcome-panel[data-compact="true"]:has(#focus-sms-compose-section:not(.hidden)) #focus-outcome-actions,
#focus-outcome-panel[data-compact="true"]:has(#focus-email-compose-section:not(.hidden)) #focus-outcome-actions {
    order: 1;
    flex: 1 1 100%;
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
}

#focus-outcome-panel[data-compact="true"]:has(#focus-sms-compose-section:not(.hidden)) #focus-sms-compose-input,
#focus-outcome-panel[data-compact="true"]:has(#focus-email-compose-section:not(.hidden)) #focus-email-compose-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    resize: vertical;
}

#focus-sms-compose-input {
    resize: vertical;
    min-height: 3.5rem;
    max-height: 8rem;
}

#focus-email-compose-input {
    resize: vertical;
    min-height: 4.5rem;
    max-height: 12rem;
}

.dark #focus-outcome-panel[data-compact="true"] #focus-outcome-compact-toggle {
    color: var(--brand-yellow, #facc15);
}

@media (max-width: 767px) {
    #focus-outcome-panel[data-compact="true"] {
        flex-wrap: wrap;
    }

    #focus-outcome-panel[data-compact="true"] #focus-outcome-actions {
        flex-wrap: wrap;
        overflow-x: visible;
        order: 1;
        flex-basis: 100%;
    }

    #focus-outcome-panel[data-compact="true"] #focus-outcome-header {
        order: 0;
        flex-basis: 100%;
        justify-content: flex-end;
    }
}

.focus-quick-outcome[data-active="true"],
.lead-notepad-tag[data-active="true"],
.lead-followup-preset[data-active="true"] {
    border-color: var(--brand-yellow, #ca8a04) !important;
    background: color-mix(in srgb, var(--brand-yellow, #facc15) 20%, transparent) !important;
    color: var(--brand-dark, #111827);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--brand-yellow, #facc15) 35%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--brand-yellow, #facc15) 25%, transparent);
}

.dark .focus-quick-outcome[data-active="true"],
.dark .lead-notepad-tag[data-active="true"],
.dark .lead-followup-preset[data-active="true"] {
    color: var(--brand-yellow, #facc15);
}

/* Brand-aligned datetime picker (Focus follow-up) */
.gcal-datetime {
  position: relative;
  width: 100%;
}

.gcal-datetime-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.85rem;
  border: 1px solid color-mix(in srgb, var(--brand-border, #d6d3d1) 70%, transparent);
  background: #fff;
  color: var(--brand-dark, #111827);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.dark .gcal-datetime-trigger {
  background: rgb(15 23 42);
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}

.gcal-datetime-trigger:hover,
.gcal-datetime-trigger:focus-visible {
  border-color: color-mix(in srgb, var(--brand-yellow, #ca8a04) 65%, var(--brand-border, #d6d3d1));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-yellow, #ca8a04) 22%, transparent);
  outline: none;
}

.gcal-datetime-trigger--empty .gcal-datetime-display {
  color: var(--brand-muted, #64748b);
  font-weight: 500;
}

.gcal-datetime-display {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#navQuickTaskModal .gcal-datetime,
#navQuickTaskModal .gcal-datetime-trigger {
  max-width: 100%;
  min-width: 0;
}

#navQuickTaskModal input[type="datetime-local"] {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.gcal-datetime-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: var(--brand-yellow, #ca8a04);
}

.gcal-datetime-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 0.35rem);
  z-index: 80;
  width: 13.25rem;
  max-width: calc(100vw - 2rem);
  padding: 0.55rem 0.6rem 0.45rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand-border, #d6d3d1) 55%, transparent);
  background: color-mix(in srgb, #fff 92%, var(--brand-cream, #faf7ed));
  box-shadow:
    0 4px 6px -1px rgba(15, 23, 42, 0.06),
    0 12px 24px -8px rgba(15, 23, 42, 0.14);
}

.dark .gcal-datetime-popover {
  background: rgb(15 23 42);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.55);
}

.gcal-datetime-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.gcal-datetime-month {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--brand-dark, #111827);
}

.dark .gcal-datetime-month {
  color: #f8fafc;
}

.gcal-datetime-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid color-mix(in srgb, var(--brand-border, #d6d3d1) 50%, transparent);
  border-radius: 9999px;
  background: #fff;
  color: var(--brand-muted, #64748b);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.dark .gcal-datetime-nav {
  background: rgb(30 41 59);
  border-color: rgba(255, 255, 255, 0.1);
}

.gcal-datetime-nav:hover {
  background: color-mix(in srgb, var(--brand-yellow, #ca8a04) 14%, #fff);
  border-color: color-mix(in srgb, var(--brand-yellow, #ca8a04) 45%, transparent);
  color: var(--brand-dark, #111827);
}

.gcal-datetime-nav svg {
  width: 0.65rem;
  height: 0.65rem;
}

.gcal-datetime-weekdays,
.gcal-datetime-grid {
  display: grid;
  grid-template-columns: repeat(7, 1.5rem);
  justify-content: center;
  gap: 0.125rem;
}

.gcal-datetime-weekdays {
  margin-bottom: 0.2rem;
}

.gcal-datetime-weekdays span {
  text-align: center;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-muted, #64748b);
}

.gcal-datetime-day {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--brand-dark, #111827);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  padding: 0;
}

.dark .gcal-datetime-day {
  color: #e2e8f0;
}

.gcal-datetime-day:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-yellow, #ca8a04) 16%, transparent);
}

.gcal-datetime-day--muted {
  color: #94a3b8;
}

.gcal-datetime-day--today:not(.gcal-datetime-day--selected) {
  color: var(--brand-dark, #111827);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-yellow, #ca8a04) 55%, transparent);
}

.gcal-datetime-day--selected {
  background: var(--brand-yellow, #ca8a04);
  color: var(--brand-on-accent, #111827) !important;
  box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--brand-yellow, #ca8a04) 55%, transparent);
}

.gcal-datetime-day--selected:hover {
  background: color-mix(in srgb, var(--brand-yellow, #ca8a04) 88%, #fff);
}

.gcal-datetime-day--disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gcal-datetime-time {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px solid color-mix(in srgb, var(--brand-border, #d6d3d1) 45%, transparent);
}

.dark .gcal-datetime-time {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.gcal-datetime-time-label {
  margin-right: 0.05rem;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-muted, #64748b);
}

.gcal-datetime-hour,
.gcal-datetime-minute,
.gcal-datetime-ampm {
  min-width: 2.35rem;
  min-height: 1.5rem;
  border-radius: 0.45rem;
  border: 1px solid color-mix(in srgb, var(--brand-border, #d6d3d1) 65%, transparent);
  background: #fff;
  color: var(--brand-dark, #111827);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  background-size: 0.55rem;
  padding-right: 1.1rem;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.dark .gcal-datetime-hour,
.dark .gcal-datetime-minute,
.dark .gcal-datetime-ampm {
  background-color: rgb(30 41 59);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.gcal-datetime-hour:focus,
.gcal-datetime-minute:focus,
.gcal-datetime-ampm:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--brand-yellow, #ca8a04) 65%, var(--brand-border, #d6d3d1));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-yellow, #ca8a04) 20%, transparent);
}

.gcal-datetime-time-sep {
  font-size: 0.625rem;
  font-weight: 800;
  color: var(--brand-muted, #64748b);
}

.gcal-datetime-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.35rem;
}

.gcal-datetime-footer-btn {
  border: 0;
  background: transparent;
  color: var(--brand-dark, #111827);
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.35rem;
  border-radius: 0.35rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.dark .gcal-datetime-footer-btn {
  color: #e2e8f0;
}

.gcal-datetime-footer-btn:hover {
  background: color-mix(in srgb, var(--brand-yellow, #ca8a04) 14%, transparent);
  color: var(--brand-dark, #111827);
}

@media (min-width: 420px) {
  .gcal-datetime-popover {
    width: 13.25rem;
  }
}

/* AdHello softphone — portaled above lead panel (z-400) when open */
#softphonePortal {
  position: fixed;
  inset: 0;
  z-index: 450;
  pointer-events: none;
}

/* Modal shell is full-viewport for layout only — must not block pipeline clicks behind it */
#softphonePortal #softphoneModal {
  pointer-events: none !important;
}

#softphonePortal #softphonePanel,
#softphonePortal #softphoneMobileBackdrop:not(.hidden) {
  pointer-events: auto;
}

#softphoneModal:not(.hidden) {
  z-index: 450 !important;
}
#softphoneModal:not(.hidden) #softphonePanel {
  z-index: 451 !important;
}
.softphone-calling-from--live {
  border-color: rgba(52, 211, 153, 0.65);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2);
}

.dark .softphone-calling-from--live {
  border-color: rgba(52, 211, 153, 0.45);
}

.softphone-caller-id-number {
  letter-spacing: 0.02em;
  word-break: break-word;
}

.softphone-caller-id-select {
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 1rem;
  padding-right: 1.35rem !important;
  text-overflow: clip;
  overflow: visible;
  white-space: nowrap;
}

.softphone-redial-btn:not(:disabled):hover {
  filter: brightness(1.03);
}

.softphone-panel {
  display: flex;
  flex-direction: column;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.softphone-body {
  flex: 1 1 auto;
  min-height: 0;
}

.softphone-panel--expanded {
  width: min(100vw - 1rem, 26rem) !important;
  height: min(820px, calc(100vh - 2rem)) !important;
  max-height: min(820px, calc(100vh - 2rem)) !important;
}

/* Focus mode — compact/minimized dialer bar (bottom-right strip) */
.softphone-panel.softphone-panel--compact {
  width: min(calc(100vw - 1.5rem), 22rem) !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 1rem !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16) !important;
}

.softphone-panel.softphone-panel--compact .softphone-chrome,
.softphone-panel.softphone-panel--compact .softphone-body,
.softphone-panel.softphone-panel--compact .softphone-bottom-nav {
  display: none !important;
}

.softphone-panel.softphone-panel--compact .softphone-compact-bar {
  display: flex;
}

.softphone-compact-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.softphone-compact-bar:active,
.softphone-panel.softphone-panel--compact-dragging .softphone-compact-bar {
  cursor: grabbing;
}

.dark .softphone-compact-bar {
  background: rgba(15, 23, 42, 0.96);
}

.softphone-compact-bar__name {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
}

.dark .softphone-compact-bar__name {
  color: #f8fafc;
}

.softphone-compact-bar__status {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgba(226, 232, 240, 0.9);
  color: #475569;
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dark .softphone-compact-bar__status {
  background: rgba(51, 65, 85, 0.85);
  color: #e2e8f0;
}

.softphone-compact-bar__status[data-state='dialing'] {
  background: rgba(251, 191, 36, 0.18);
  color: #b45309;
}

.softphone-compact-bar__status[data-state='in_call'] {
  background: rgba(52, 211, 153, 0.18);
  color: #047857;
}

.softphone-compact-bar__status[data-state='ended'] {
  background: rgba(244, 63, 94, 0.14);
  color: #be123c;
}

.softphone-compact-bar__timer {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #64748b;
}

.dark .softphone-compact-bar__timer {
  color: #94a3b8;
}

.softphone-compact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #fff;
  color: #334155;
  font-size: 0.625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dark .softphone-compact-btn {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.softphone-compact-btn:hover {
  background: #f8fafc;
}

.dark .softphone-compact-btn:hover {
  background: rgba(51, 65, 85, 0.95);
}

.softphone-compact-btn--danger {
  border-color: rgba(244, 63, 94, 0.45);
  background: rgba(244, 63, 94, 0.12);
  color: #be123c;
}

.dark .softphone-compact-btn--danger {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(127, 29, 29, 0.35);
  color: #fecdd3;
}

.softphone-compact-btn--danger:hover {
  background: rgba(244, 63, 94, 0.2);
}

.softphone-chrome-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.9);
  color: #64748b;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dark .softphone-chrome-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.softphone-chrome-btn:hover {
  background: #fff;
  color: #334155;
}

.softphone-chrome-btn--active {
  background: #e2e8f0;
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.45);
}

.softphone-bookmark-btn[data-saved='1'],
.softphone-bookmark-btn.softphone-chrome-btn--bookmarked {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--brand-on-accent);
}

.softphone-bookmark-btn[data-saved='1'] svg,
.softphone-bookmark-btn.softphone-chrome-btn--bookmarked svg {
  fill: currentColor;
}

.softphone-quicklog-bar .gcal-datetime-trigger {
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
}

.dark .softphone-bookmark-btn[data-saved='1'],
.dark .softphone-bookmark-btn.softphone-chrome-btn--bookmarked {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--brand-on-accent);
}

.softphone-settings-section {
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.dark .softphone-settings-section {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.55);
}

.softphone-soundcheck-meter {
  height: 0.45rem;
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.35);
}

.dark .softphone-soundcheck-meter {
  background: rgba(255, 255, 255, 0.12);
}

.softphone-soundcheck-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #fbbf24);
  transition: width 80ms linear;
}

.softphone-status-pill,
.softphone-timer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: rgba(226, 232, 240, 0.85);
  color: #475569;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dark .softphone-status-pill,
.dark .softphone-timer-pill {
  background: rgba(51, 65, 85, 0.85);
  color: #e2e8f0;
}

/* Keypad tab: first screen is the dialer; quick log + GHL sit below the fold */
.softphone-main-screen {
  display: flex;
  flex-direction: column;
  /* + the scroller's bottom padding so the quick log starts fully below the fold */
  min-height: calc(100% + 0.75rem);
}

.softphone-main-screen .softphone-keypad-dock {
  margin-top: auto;
}

/* --sp-key is set by softphoneFitKeypad() to fill the free height */
.softphone-keypad-dock.is-fit .softphone-keypad-grid {
  grid-template-columns: repeat(3, var(--sp-key));
  column-gap: calc(var(--sp-key) * 0.3);
  row-gap: calc(var(--sp-key) * 0.16);
  max-width: none;
  margin-top: 0.25rem;
}

.softphone-keypad-dock.is-fit .softphone-key {
  width: var(--sp-key);
  height: var(--sp-key);
}

.softphone-keypad-dock.is-fit .softphone-key-main {
  font-size: calc(var(--sp-key) * 0.38);
}

.softphone-keypad-dock.is-fit .softphone-key-sub {
  font-size: calc(var(--sp-key) * 0.13);
}

.softphone-keypad-dock.is-fit .softphone-call-row {
  gap: calc(var(--sp-key) * 0.35);
  margin-top: calc(var(--sp-key) * 0.2);
}

.softphone-keypad-dock.is-fit .softphone-call-btn {
  width: calc(var(--sp-key) * 0.97);
  height: calc(var(--sp-key) * 0.97);
}

.softphone-status-line {
  margin-bottom: 0.2rem;
  min-height: 1rem;
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.softphone-keypad-grid {
  /* Fixed columns (not 1fr) so keys stay clustered like a native dialer */
  display: grid;
  grid-template-columns: repeat(3, 4.5rem);
  column-gap: 1.15rem;
  row-gap: 0.7rem;
  justify-content: center;
  justify-items: center;
  max-width: 17.5rem;
  width: 100%;
  margin: 0.35rem auto 0;
}

.softphone-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 9999px;
  border: 0;
  background: #ececf1;
  color: #1f2937;
  transition: transform 0.12s ease, background 0.12s ease;
}

.dark .softphone-key {
  background: #334155;
  color: #f8fafc;
}

.softphone-key:hover {
  background: #e2e2ea;
}

.softphone-key:active {
  transform: scale(0.96);
}

.softphone-key-main {
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
}

.softphone-key-sub {
  margin-top: 0.1rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: #64748b;
}

.softphone-call-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 1.15rem;
  margin-bottom: 0.35rem;
}

.softphone-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.35rem;
  height: 4.35rem;
  border-radius: 9999px;
  border: 0;
  background: var(--brand-yellow);
  color: var(--brand-on-accent);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-yellow) 32%, transparent);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.softphone-call-btn:hover {
  filter: brightness(1.03);
}

.softphone-call-btn:active {
  transform: scale(0.96);
}

.softphone-call-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.softphone-backspace-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border: 0;
  background: transparent;
  color: #64748b;
}

.softphone-backspace-btn:hover {
  color: #334155;
}

.softphone-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0.1rem auto 0.35rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.dark .softphone-scroll-hint {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.softphone-scroll-hint:hover {
  color: #334155;
  border-color: rgba(148, 163, 184, 0.55);
}

.dark .softphone-scroll-hint:hover {
  color: #e2e8f0;
}

.softphone-scroll-hint:not(.hidden) {
  animation: softphone-scroll-hint-bounce 1.6s ease-in-out infinite;
}

@keyframes softphone-scroll-hint-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

.softphone-bottom-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.35rem;
  padding: 0.4rem 0.6rem 0.2rem;
  flex-shrink: 0;
}

/* Home-indicator clearance only: iOS can report a much larger bottom inset (toolbar area), which left a blank band under the tabs. */
#softphonePanel .softphone-bottom-nav {
  padding-bottom: max(0.35rem, min(env(safe-area-inset-bottom, 0px), 1.25rem));
}

.softphone-bottom-nav > .softphone-nav-btn {
  width: 100%;
  min-width: 0;
}

.softphone-nav-btn span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.softphone-queue-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.85);
}

.dark .softphone-queue-item {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.85);
}

.softphone-queue-dial {
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: var(--brand-yellow);
  color: var(--brand-on-accent);
  padding: 0.45rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.softphone-queue-dial:hover {
  filter: brightness(1.05);
}

.softphone-contact-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.7rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.85);
}

.dark .softphone-contact-row {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(30, 41, 59, 0.85);
}

.softphone-contact-row__body {
  min-width: 0;
  flex: 1 1 auto;
}

.softphone-contact-row__meta {
  margin-top: 0.15rem;
  font-size: 0.625rem;
  line-height: 1.25;
  color: #64748b;
}

.dark .softphone-contact-row__meta {
  color: #94a3b8;
}

.softphone-contact-row__call {
  flex-shrink: 0;
  align-self: center;
}

.softphone-lead-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.95);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  color: #334155;
}

.dark .softphone-lead-nav-btn {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.softphone-lead-nav-btn:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand-yellow) 55%, transparent);
}

.softphone-lead-nav-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 767px) {
  .softphone-keypad-grid {
    grid-template-columns: repeat(3, 3.65rem);
    column-gap: 0.85rem;
    row-gap: 0.4rem;
    max-width: 13.5rem;
    margin-top: 0.15rem;
  }

  .softphone-key {
    width: 3.65rem;
    height: 3.65rem;
  }

  .softphone-key-main {
    font-size: 1.45rem;
    font-weight: 600;
  }

  .softphone-key-sub {
    font-size: 0.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .softphone-call-btn {
    width: 3.65rem;
    height: 3.65rem;
  }

  .softphone-call-row {
    gap: 1.1rem;
    margin-top: 0.55rem;
  }

  .softphone-number-display {
    font-size: 1.2rem;
  }
}

@media (max-height: 720px) {
  .softphone-key {
    width: 3.35rem;
    height: 3.35rem;
  }

  .softphone-key-main {
    font-size: 1.3rem;
  }

  .softphone-call-btn {
    width: 3.35rem;
    height: 3.35rem;
  }

  .softphone-keypad-grid {
    grid-template-columns: repeat(3, 3.35rem);
    column-gap: 0.7rem;
    row-gap: 0.3rem;
    max-width: 12.5rem;
  }

  .softphone-call-row {
    margin-top: 0.45rem;
  }
}

.softphone-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.35rem 0.15rem;
  border: 0;
  border-radius: 0.85rem;
  background: transparent;
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 600;
}

.softphone-nav-btn svg {
  opacity: 0.85;
}

.softphone-nav-btn--active {
  background: rgba(226, 232, 240, 0.95);
  color: #0f172a;
}

.dark .softphone-nav-btn--active {
  background: rgba(51, 65, 85, 0.95);
  color: #f8fafc;
}

.softphone-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.85);
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dark .softphone-link-card {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.softphone-link-card:hover {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.45);
}

.softphone-ctrl-btn {
  border-radius: 0.75rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.45rem 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
}

.dark .softphone-ctrl-btn {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.softphone-ctrl-btn.softphone-ctrl-btn--danger {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

/* My device dialer: the call lives in the native phone app, so in-app controls are inert. */
.softphone-in-call--device .softphone-ctrl-btn--in-app,
.softphone-in-call--device .softphone-ctrl-row--secondary {
  display: none;
}

.softphone-in-call--device .softphone-ctrl-row--primary {
  grid-template-columns: minmax(0, 1fr);
}

.softphone-in-call--device .softphone-ctrl-btn--danger {
  padding: 0.7rem 0.5rem;
  font-size: 0.75rem;
}

/* Chained with .softphone-ctrl-btn so `.dark .softphone-ctrl-btn` can't flatten the fill */
.softphone-ctrl-btn.softphone-ctrl-btn--ghl {
  background: #f97316;
  border-color: #ea580c;
  color: #fff;
}

.softphone-ctrl-btn.softphone-ctrl-btn--ghl:hover {
  background: #ea580c;
}

.softphone-ctrl-btn--ghl:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.softphone-ctrl-btn.softphone-ctrl-btn--primary {
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--brand-on-accent);
}

.softphone-quick-log {
  border-radius: 9999px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #faf8f3;
  padding: 0.35rem 0.5rem;
  font-size: 0.5625rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1e293b;
  line-height: 1.2;
}

.dark .softphone-quick-log {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}

.softphone-quick-log:hover {
  border-color: color-mix(in srgb, var(--brand-yellow) 55%, transparent);
}

.softphone-quick-log[data-active='true'] {
  border-color: var(--brand-yellow);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-yellow) 35%, transparent);
  background: color-mix(in srgb, var(--brand-yellow) 14%, transparent);
}

.dark .softphone-quick-log[data-active='true'] {
  background: color-mix(in srgb, var(--brand-yellow) 18%, transparent);
}

.softphone-followup-preset[data-off='true'] {
  opacity: 0.45;
}

#softphoneFollowupStrip {
  border-color: color-mix(in srgb, var(--brand-yellow) 40%, transparent);
  background: color-mix(in srgb, var(--brand-yellow) 9%, transparent);
}

#softphoneFollowupEnable {
  accent-color: var(--brand-yellow);
}

#softphoneSyncGhlOnDone {
  accent-color: #f97316;
}

/* iOS zooms into focused fields under 16px */
@media (max-width: 767px) {
  #softphonePanel input:not([type='checkbox']):not([type='radio']):not([readonly]),
  #softphonePanel textarea,
  #softphonePanel select,
  #leadPanelSheet input:not([type='checkbox']):not([type='radio']),
  #leadPanelSheet textarea,
  #leadPanelSheet select {
    font-size: 16px;
  }
}

.softphone-action-btn {
  border-radius: 0.95rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.softphone-action-btn--vm {
  background: #7c3aed;
  color: #fff;
}

.softphone-action-btn--vm-outline {
  border: 1px solid rgba(124, 58, 237, 0.35);
  background: rgba(124, 58, 237, 0.08);
  color: #6d28d9;
}

.dark .softphone-action-btn--vm-outline {
  color: #ddd6fe;
}

.tag-filter-combobox-option.is-selected {
  background: rgba(250, 204, 21, 0.15);
}

.dark .tag-filter-combobox-option.is-selected {
  background: rgba(250, 204, 21, 0.12);
}

/* Pipeline toolbar — don't clip Table/Pipeline toggle focus rings */
.pipeline-actions-toolbar {
  overflow-y: visible;
}

[data-pipeline-menu-panel] {
  z-index: 10000 !important;
  background-color: #ffffff !important;
  background-image: none !important;
  background: #ffffff !important;
  color: var(--brand-dark);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: isolate;
  opacity: 1 !important;
}

.pipeline-import-export-menu-panel,
.pipeline-import-export-menu-panel__surface {
  background-color: #ffffff !important;
  background-image: none !important;
  background: #ffffff !important;
}

[data-pipeline-menu-panel].hidden,
[data-pipeline-menu-panel][hidden] {
  display: none !important;
}

.dark .pipeline-import-export-menu-panel,
.dark .pipeline-import-export-menu-panel__surface,
html.dark .pipeline-import-export-menu-panel,
html.dark .pipeline-import-export-menu-panel__surface {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f8fafc;
}

.dark [data-pipeline-menu-panel],
html.dark [data-pipeline-menu-panel] {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f8fafc;
}

[data-pipeline-menu-panel]:not(.hidden) {
  box-shadow:
    0 16px 40px -10px rgba(15, 23, 42, 0.18),
    0 6px 16px -6px rgba(15, 23, 42, 0.12);
}

.dark [data-pipeline-menu-panel]:not(.hidden) {
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.55);
}

.pipeline-view-toggle-wrap {
  overflow: visible;
}

.pipeline-search-card {
  overflow: visible !important;
}

.pipeline-search-card details,
.pipeline-search-card .tag-filter-combobox {
  overflow: visible;
}

.tag-filter-combobox-menu {
  min-width: 12rem;
  z-index: 10000 !important;
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: var(--brand-dark);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: isolate;
  opacity: 1 !important;
}

.dark .tag-filter-combobox-menu,
html.dark .tag-filter-combobox-menu {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f8fafc;
}

.tag-filter-combobox-menu [data-tag-filter-list],
.tag-filter-combobox-menu > .p-2 {
  background-color: inherit;
}

.tag-filter-combobox-option {
  background-color: transparent;
}

.tag-filter-combobox-menu:not(.hidden) {
  box-shadow:
    0 16px 40px -10px rgba(15, 23, 42, 0.18),
    0 6px 16px -6px rgba(15, 23, 42, 0.12);
}

.dark .tag-filter-combobox-menu:not(.hidden) {
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.55);
}

/* Direct Mail — preview zoom + saved library */
.dm-preview-btn:focus-visible {
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
}

.dm-preview-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-lightbox:not(.hidden) {
  display: flex;
  z-index: 9999;
}

.dm-saved-card {
  position: relative;
  border-radius: 0.65rem;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(250, 247, 237, 0.5);
  aspect-ratio: 2 / 3;
}

.dark .dm-saved-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.6);
}

.dm-saved-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-saved-slot-badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 2;
  padding: 0.15rem 0.4rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dark .dm-saved-slot-badge {
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
}

.dm-export-actions .dm-studio-topbtn {
  font-size: 10px;
}

.dm-post-copy-section {
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.dark .dm-post-copy-section {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.dm-post-copy-editor {
  font-size: 12px;
  line-height: 1.55;
  min-height: 7.5rem;
}

.dm-saved-card-actions {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.25rem;
  padding: 0.35rem;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.72), transparent 55%);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.dm-saved-card:hover .dm-saved-card-actions,
.dm-saved-card:focus-within .dm-saved-card-actions {
  opacity: 1;
}

/* Direct Mail Studio — Canva-style workspace */
.dm-studio-page {
  --dm-sidebar-w: 17.5rem;
  --dm-rail-w: 4.25rem;
  --dm-inspector-w: 18rem;
  --dm-canvas-bg: #e8e4dc;
  --dm-canvas-dot: rgba(17, 24, 39, 0.08);
}

.dark .dm-studio-page {
  --dm-canvas-bg: #1a1f2e;
  --dm-canvas-dot: rgba(255, 255, 255, 0.06);
}

.dm-studio-root {
  max-width: none;
  padding: 0;
}

.dm-studio-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.dark .dm-studio-topbar {
  background: rgba(15, 23, 42, 0.92);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dm-studio-eyebrow {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-muted, #6b7280);
  margin-bottom: 0.15rem;
}

.dm-studio-title {
  font-family: var(--font-display, inherit);
  font-weight: 800;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  letter-spacing: -0.02em;
  color: var(--brand-dark, #111827);
}

.dark .dm-studio-title {
  color: #fff;
}

.dm-studio-topbar-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
}

.dm-studio-format-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(250, 204, 21, 0.18);
  color: #854d0e;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.dark .dm-studio-format-pill {
  color: #fde68a;
}

.dm-studio-topbar-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dm-studio-badge {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.dm-studio-badge--ok {
  background: rgba(16, 185, 129, 0.15);
  color: #047857;
}

.dm-studio-model-picker {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.dm-studio-model-select {
  appearance: none;
  -webkit-appearance: none;
  max-width: 11.5rem;
  padding: 0.35rem 1.6rem 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background-color: rgba(16, 185, 129, 0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 12px;
  color: #047857;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  cursor: pointer;
}

.dark .dm-studio-model-select {
  background-color: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236ee7b7' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

.dm-studio-badge--warn {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

.dm-studio-topbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid rgba(17, 24, 39, 0.2);
  background: #fff;
  color: #111827 !important;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.dark .dm-studio-topbtn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc !important;
}

.dm-studio-topbtn:hover {
  background: rgba(17, 24, 39, 0.04);
  border-color: rgba(17, 24, 39, 0.35);
  opacity: 1;
  filter: none;
}

.dark .dm-studio-topbtn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
}

.dm-studio-topbtn--primary {
  background: var(--brand-yellow, #ffd644) !important;
  border-color: transparent !important;
  color: var(--brand-on-accent, #111827) !important;
}

.dm-studio-topbtn--primary:hover {
  background: color-mix(in srgb, var(--brand-yellow, #ffd644) 88%, #000) !important;
  border-color: transparent !important;
}

.dark .dm-studio-topbtn--primary {
  background: var(--brand-yellow, #ffd644) !important;
  border-color: transparent !important;
  color: var(--brand-on-accent, #111827) !important;
}

.dm-studio-topbtn--primary svg,
.dm-studio-topbtn--primary i {
  color: var(--brand-on-accent, #111827) !important;
  stroke: var(--brand-on-accent, #111827) !important;
}

.dm-studio-topbtn--match {
  background: transparent;
  border-color: rgba(17, 24, 39, 0.2);
  color: #111827 !important;
}

.dark .dm-studio-topbtn--match {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc !important;
}

.dm-lob-hover {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.dm-lob-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dm-lob-hover__panel {
  display: none !important;
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 80;
  width: min(20rem, 72vw);
  padding-top: 0.45rem;
  margin: 0;
  pointer-events: none;
}

.dm-lob-hover:hover .dm-lob-hover__panel {
  display: block !important;
  pointer-events: auto;
}

.dm-lob-hover__card {
  padding: 0.7rem 0.8rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.dm-lob-hover__card--warn {
  border-color: rgba(245, 158, 11, 0.4);
}

.dark .dm-lob-hover__card {
  background: #0f172a;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.dm-lob-hover__card .dm-lob-text + .dm-lob-text {
  margin-top: 0.35rem;
}

.dm-lob-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.dm-lob-dot--warn {
  background: #f59e0b;
}

.dm-lob-text {
  margin: 0;
  color: var(--brand-muted, #6b7280);
  line-height: 1.45;
  font-size: 0.75rem;
}

.dm-studio {
  display: grid;
  grid-template-columns: var(--dm-rail-w) var(--dm-sidebar-w) minmax(0, 1fr) var(--dm-inspector-w);
  min-height: min(78vh, 820px);
  height: min(78vh, 820px);
  margin: 0 1rem;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: #fff;
  box-shadow: 0 20px 50px -24px rgba(17, 24, 39, 0.25);
}

.dark .dm-studio {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.08);
}

.dm-studio-rail {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  padding: 0.65rem 0.4rem;
  background: #faf7ed;
  border-right: 1px solid rgba(17, 24, 39, 0.08);
}

.dark .dm-studio-rail {
  background: #111827;
  border-right-color: rgba(255, 255, 255, 0.06);
}

.dm-rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.55rem 0.25rem;
  border-radius: 0.65rem;
  border: none;
  background: transparent;
  color: var(--brand-muted, #6b7280);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dm-rail-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.dm-rail-btn span {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dm-rail-btn:hover,
.dm-rail-btn.is-active {
  background: rgba(250, 204, 21, 0.2);
  color: var(--brand-dark, #111827);
}

.dark .dm-rail-btn:hover,
.dark .dm-rail-btn.is-active {
  color: #fde68a;
}

.dm-studio-drawer {
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  padding: 1rem 0.85rem 1.25rem;
  background: #fff;
}

.dark .dm-studio-drawer {
  background: #0f172a;
  border-right-color: rgba(255, 255, 255, 0.06);
}

.dm-drawer-panel[hidden] {
  display: none !important;
}

.dm-drawer-title {
  font-family: var(--font-display, inherit);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--brand-dark, #111827);
  margin-bottom: 0.35rem;
}

.dark .dm-drawer-title {
  color: #fff;
}

.dm-drawer-desc {
  font-size: 0.6875rem;
  color: var(--brand-muted, #6b7280);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.dm-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.dm-format-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.55rem 0.5rem;
  border-radius: 0.65rem;
  border: 2px solid transparent;
  background: rgba(250, 247, 237, 0.65);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .dm-format-card {
  background: rgba(30, 41, 59, 0.55);
}

.dm-format-card:hover {
  border-color: rgba(250, 204, 21, 0.45);
}

.dm-format-card.is-selected {
  border-color: var(--brand-yellow, #facc15);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.dm-format-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: 0.15rem;
  color: var(--brand-muted, #6b7280);
}

.dm-format-card.is-selected .dm-format-icon,
.dm-format-card:hover .dm-format-icon {
  color: var(--brand-dark, #111827);
}

.dark .dm-format-card.is-selected .dm-format-icon,
.dark .dm-format-card:hover .dm-format-icon {
  color: #fde68a;
}

.dm-playbook-card:hover {
  border-color: rgba(250, 204, 21, 0.45);
}

.dm-playbook-card.is-selected {
  border-color: var(--brand-yellow, #facc15);
  background: rgba(250, 204, 21, 0.08);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.35);
}

.dm-format-icon-svg {
  width: 1.35rem;
  height: 1.35rem;
}

.dm-rail-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.72;
}

.dm-rail-btn.is-active svg,
.dm-rail-btn:hover svg {
  opacity: 1;
}

.dm-fullscreen-btn {
  gap: 0.35rem;
}

.dm-fullscreen-label {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dm-fullscreen-btn-canvas {
  width: auto;
  min-width: 1.85rem;
  padding: 0 0.35rem;
  margin-right: 0.25rem;
}

.dm-fullscreen-btn .hidden,
.dm-fullscreen-btn-canvas .hidden {
  display: none;
}

/* Marketing Studio: never trap the document scroll outside fullscreen */
html:has(body.dm-studio-page) {
  height: auto;
  overflow-y: auto;
}

body.dm-studio-page {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100dvh;
}

body.dm-studio-page .dm-studio-root,
body.dm-studio-page .dm-studio-shell {
  overflow: visible;
}

/* Full-screen studio mode */
body.dm-studio-fullscreen-active {
  overflow: hidden !important;
  height: 100dvh;
  max-height: 100dvh;
}

body.dm-studio-fullscreen-active #appSidebar,
body.dm-studio-fullscreen-active #appTopbar {
  display: none !important;
}

body.dm-studio-fullscreen-active.app-with-sidebar {
  grid-template-columns: 1fr !important;
}

body.dm-studio-fullscreen-active .app-shell-content {
  grid-column: 1 / -1;
  min-height: 0;
  height: 100dvh;
  overflow: hidden;
}

body.dm-studio-fullscreen-active .dm-studio-root {
  height: 100%;
  overflow: hidden;
}

body.dm-studio-fullscreen-active .dm-studio-shell {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--brand-bg, #faf7ed);
  padding: 0;
}

.dark body.dm-studio-fullscreen-active .dm-studio-shell {
  background: #0f172a;
}

body.dm-studio-fullscreen-active .dm-studio-topbar {
  position: relative;
  top: auto;
  flex: 0 0 auto;
  z-index: 2;
}

body.dm-studio-fullscreen-active .dm-studio {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0 0.5rem 0.5rem;
  overflow: hidden;
}

body.dm-studio-fullscreen-active .dm-studio-rail,
body.dm-studio-fullscreen-active .dm-studio-drawer,
body.dm-studio-fullscreen-active .dm-studio-inspector {
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.dm-studio-fullscreen-active .dm-studio-stage {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

body.dm-studio-fullscreen-active .dm-canvas-viewport {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

body.dm-studio-fullscreen-active .dm-prompt-dock {
  flex: 0 0 auto;
  max-height: min(42vh, 24rem);
  min-height: 12.5rem;
  overflow-y: auto;
}

body.dm-studio-fullscreen-active .dm-workflow-section {
  display: none !important;
}

@media (max-width: 1280px) {
  body.dm-studio-fullscreen-active .dm-studio-drawer {
    max-height: min(40vh, 16rem);
  }
}

.dm-format-label {
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--brand-dark, #111827);
}

.dark .dm-format-label {
  color: #f1f5f9;
}

.dm-format-sub {
  font-size: 0.5625rem;
  color: var(--brand-muted, #6b7280);
}

.dm-drawer-settings {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.dark .dm-drawer-settings {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.dm-field-label {
  display: block;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-muted, #6b7280);
  margin-bottom: 0.25rem;
}

.dm-select,
.dm-input {
  width: 100%;
  border-radius: 0.55rem;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  padding: 0.45rem 0.55rem;
  font-size: 0.8125rem;
  color: var(--brand-dark, #111827);
}

.dark .dm-select,
.dark .dm-input {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.dm-brand-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dm-brand-logo-row {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.dm-brand-logo-preview {
  width: 4rem;
  height: 4rem;
  border-radius: 0.55rem;
  border: 1px dashed rgba(17, 24, 39, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 0.5625rem;
  color: var(--brand-muted, #6b7280);
  background: rgba(250, 247, 237, 0.5);
}

.dm-brand-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.dm-brand-logo-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.dm-brand-save-status {
  font-size: 0.625rem;
  min-height: 1rem;
  color: var(--brand-muted, #6b7280);
}

.dm-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--brand-muted, #6b7280);
  cursor: pointer;
}

.dm-merge-preview {
  font-size: 0.6875rem;
  color: var(--brand-muted, #6b7280);
  margin-bottom: 0.65rem;
  min-height: 1rem;
  line-height: 1.4;
}

.dm-saved-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  max-height: 22rem;
  overflow-y: auto;
}

.dm-studio-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--dm-canvas-bg);
  background-image: radial-gradient(var(--dm-canvas-dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

.dm-stage-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(6px);
}

.dark .dm-stage-toolbar {
  background: rgba(15, 23, 42, 0.75);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dm-page-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 0.55rem;
  background: rgba(17, 24, 39, 0.06);
}

.dark .dm-page-tabs {
  background: rgba(255, 255, 255, 0.06);
}

.dm-page-tab {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  border-radius: 0.4rem;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-muted, #6b7280);
  cursor: pointer;
}

.dm-page-tab.is-active {
  background: #fff;
  color: var(--brand-dark, #111827);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.12);
}

.dark .dm-page-tab.is-active {
  background: #1e293b;
  color: #fff;
}

.dm-stage-toolbar-start {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.dm-canvas-hint-tip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.05rem;
}

.dm-stage-toolbar-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.dm-stage-hint {
  font-size: 0.6875rem;
  color: var(--brand-muted, #6b7280);
}

.dm-new-design-btn {
  font-size: 0.6875rem;
  padding: 0.35rem 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
}

.dm-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.15rem;
  border-radius: 0.55rem;
  background: rgba(17, 24, 39, 0.06);
}

.dark .dm-zoom-controls {
  background: rgba(255, 255, 255, 0.06);
}

.dm-zoom-btn {
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 0.35rem;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-dark, #111827);
  cursor: pointer;
}

.dark .dm-zoom-btn {
  color: #e2e8f0;
}

.dm-zoom-btn:hover {
  background: rgba(250, 204, 21, 0.25);
}

.dm-zoom-label {
  font-size: 0.625rem;
  font-weight: 800;
  min-width: 2.75rem;
  text-align: center;
  color: var(--brand-muted, #6b7280);
}

.dm-canvas-viewport {
  position: relative;
  flex: 1 1 auto;
  min-height: 8rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.dm-canvas-viewport.is-canvas-zoomed {
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.dm-canvas-scaler {
  transform-origin: center center;
  transition: zoom 0.15s ease, transform 0.15s ease;
  will-change: zoom, transform;
}

@supports not (zoom: 1) {
  .dm-canvas-scaler {
    transform: scale(var(--dm-zoom, 1));
  }
}

.dm-artboard-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-artboard {
  position: relative;
  width: min(22rem, 72vw);
  max-height: min(34rem, 62vh);
  border: none;
  padding: 0;
  border-radius: 0.35rem;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(17, 24, 39, 0.08),
    0 24px 48px -20px rgba(17, 24, 39, 0.35);
  cursor: zoom-in;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
}

.dm-artboard.has-image {
  cursor: zoom-in;
}

.dm-artboard.has-image:hover {
  box-shadow:
    0 0 0 2px rgba(250, 204, 21, 0.55),
    0 24px 48px -20px rgba(17, 24, 39, 0.35);
}

.dm-artboard-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dm-lob-zone {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  border: 2px dashed rgba(239, 68, 68, 0.85);
  background: repeating-linear-gradient(
    -45deg,
    rgba(254, 226, 226, 0.45),
    rgba(254, 226, 226, 0.45) 6px,
    rgba(255, 255, 255, 0.15) 6px,
    rgba(255, 255, 255, 0.15) 12px
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.dm-lob-zone--address {
  right: 4.4%;
  bottom: 5.9%;
  width: 52.5%;
  height: 55.9%;
}

.dm-lob-zone--qr {
  right: 5%;
  bottom: 7%;
  width: 12%;
  height: 18%;
}

.dm-lob-zone--safe {
  left: 4%;
  top: 5.9%;
  width: 92%;
  height: 88.2%;
  border-color: rgba(59, 130, 246, 0.75);
  background: transparent;
}

body:not(.dm-show-lob-zones) .dm-lob-zone {
  display: none;
}

.dark .dm-lob-zone {
  border-color: rgba(248, 113, 113, 0.9);
  background: repeating-linear-gradient(
    -45deg,
    rgba(127, 29, 29, 0.35),
    rgba(127, 29, 29, 0.35) 6px,
    rgba(15, 23, 42, 0.2) 6px,
    rgba(15, 23, 42, 0.2) 12px
  );
}

.dm-artboard-empty {
  font-size: 0.6875rem;
  color: var(--brand-muted, #6b7280);
  text-align: center;
  padding: 1rem;
  line-height: 1.45;
}

.dm-generating-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  pointer-events: all;
}

.dm-generating-overlay.hidden,
.dm-generating-overlay[hidden] {
  display: none !important;
}

.dm-generating-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  max-width: min(90%, 20rem);
  text-align: center;
}

.dm-generating-overlay__spinner {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: dm-spin 0.8s linear infinite;
}

@keyframes dm-spin {
  to { transform: rotate(360deg); }
}

.dm-generating-overlay__text {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.dm-generating-overlay__sub {
  margin: 0;
  font-size: 0.6875rem;
  color: rgba(248, 250, 252, 0.7);
  line-height: 1.4;
}

.dm-saved-prompts-wrap {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding-top: 0.75rem;
}

.dm-saved-prompts {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 9rem;
  overflow-y: auto;
}

.dm-saved-prompt-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.dark .dm-saved-prompt-row {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.1);
}

.dm-saved-prompt-row__title {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--brand-dark, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.dark .dm-saved-prompt-row__title {
  color: #f8fafc;
}

.dm-saved-prompt-row__del {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--brand-muted, #6b7280);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.15rem 0.25rem;
}

.dm-saved-prompt-row__del:hover {
  color: #dc2626;
}

.dm-artboard-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  left: auto;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(17, 24, 39, 0.65);
  color: #fff;
  pointer-events: none;
}

.dm-preview-zoom-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.dm-artboard:hover .dm-preview-zoom-badge {
  opacity: 1;
}

.dm-artboard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-artboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.35rem 0.75rem 0.5rem;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(17, 24, 39, 0.06);
}

.dark .dm-artboard-actions {
  background: rgba(15, 23, 42, 0.55);
  border-top-color: rgba(255, 255, 255, 0.05);
}

.dm-text-btn {
  border: none;
  background: none;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-yellow, #ca8a04);
  cursor: pointer;
}

.dm-prompt-resizer {
  flex-shrink: 0;
  height: 0.45rem;
  margin: 0 0.75rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.08);
  cursor: row-resize;
  position: relative;
  transition: background 0.15s ease;
}

.dm-prompt-resizer:hover,
.dm-prompt-resizer.is-dragging {
  background: rgba(250, 204, 21, 0.45);
}

.dm-prompt-resizer::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2.5rem;
  height: 0.2rem;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.2);
}

.dark .dm-prompt-resizer {
  background: rgba(255, 255, 255, 0.08);
}

.dark .dm-prompt-resizer::after {
  background: rgba(255, 255, 255, 0.25);
}

body.dm-prompt-resize-active {
  cursor: row-resize !important;
  user-select: none !important;
}

.dm-prompt-dock {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 12.5rem;
  max-height: min(52vh, 28rem);
  height: var(--dm-prompt-h, 14.5rem);
  padding: 0.65rem 0.75rem 0.75rem;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(17, 24, 39, 0.08);
  backdrop-filter: blur(8px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dark .dm-prompt-dock {
  background: rgba(15, 23, 42, 0.92);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.dm-chat-log {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  margin-bottom: 0.5rem;
  padding: 0.35rem;
  border-radius: 0.55rem;
  background: rgba(250, 247, 237, 0.45);
}

.dark .dm-chat-log {
  background: rgba(30, 41, 59, 0.45);
}

.dm-chat-prompt-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem 0.85rem 0.85rem 0.35rem;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dark .dm-chat-prompt-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.92);
}

.dm-chat-prompt-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.dm-chat-prompt-card__label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-muted, #6b7280);
}

.dm-chat-prompt-card__hint {
  font-size: 0.65rem;
  font-weight: 600;
  color: #059669;
}

.dark .dm-chat-prompt-card__hint {
  color: #34d399;
}

.dm-chat-prompt-card__body {
  margin: 0;
  max-height: 9.5rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--brand-dark, #111827);
}

.dark .dm-chat-prompt-card__body {
  color: #e2e8f0;
}

.dm-chat-prompt-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dm-chat-prompt-card__btn {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: rgba(250, 247, 237, 0.9);
  color: var(--brand-dark, #111827);
  border-radius: 0.45rem;
  padding: 0.28rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.dark .dm-chat-prompt-card__btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
}

.dm-chat-prompt-card__btn:hover,
.dm-chat-prompt-card__btn:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--brand-yellow, #facc15) 55%, rgba(17, 24, 39, 0.2));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-yellow, #facc15) 30%, transparent);
}

.dm-chat-post-card {
  border-color: rgba(202, 138, 4, 0.35);
  background: rgba(250, 204, 21, 0.08);
}

.dark .dm-chat-post-card {
  border-color: rgba(250, 204, 21, 0.28);
  background: rgba(250, 204, 21, 0.08);
}

.dm-chat-post-card .dm-chat-prompt-card__label {
  color: #a16207;
}

.dark .dm-chat-post-card .dm-chat-prompt-card__label {
  color: #facc15;
}

.dm-chat-copy-card {
  border-color: color-mix(in srgb, var(--brand-yellow) 45%, transparent);
  background: color-mix(in srgb, var(--brand-yellow) 10%, transparent);
}

.dm-chat-copy-card .dm-chat-prompt-card__label {
  color: var(--brand-yellow);
}

.dark .dm-chat-copy-card .dm-chat-prompt-card__label {
  color: color-mix(in srgb, var(--brand-yellow) 85%, white);
}

.dm-chat-welcome {
  font-size: 0.6875rem;
  color: var(--brand-muted, #6b7280);
  line-height: 1.45;
}

.dm-prompt-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
}

.dm-prompt-compose {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex-shrink: 0;
}

.dm-prompt-input-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 1.25rem;
}

.dm-prompt-input-head__status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.dm-prompt-input-head__help {
  margin-left: auto;
  flex-shrink: 0;
}

.dm-chat-thinking {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #4b5563;
  white-space: nowrap;
  line-height: 1.2;
}

.dark .dm-chat-thinking {
  color: #94a3b8;
}

.dm-chat-thinking__dots::after {
  content: '...';
  display: inline-block;
  width: 1.15em;
  overflow: hidden;
  vertical-align: bottom;
  animation: dm-chat-thinking-dots 1.15s steps(4, end) infinite;
}

@keyframes dm-chat-thinking-dots {
  0% { width: 0; }
  100% { width: 1.15em; }
}

@media (prefers-reduced-motion: reduce) {
  .dm-chat-thinking__dots::after {
    animation: none;
    width: 1.15em;
  }
}

/* Workspace Scripts — AI script coach thinking indicator */
.coach-thinking-dots::after {
  content: '...';
  display: inline-block;
  width: 1.15em;
  overflow: hidden;
  vertical-align: bottom;
  animation: coach-thinking-dots 1.15s steps(4, end) infinite;
}

@keyframes coach-thinking-dots {
  0% { width: 0; }
  100% { width: 1.15em; }
}

@media (prefers-reduced-motion: reduce) {
  .coach-thinking-dots::after {
    animation: none;
    width: 1.15em;
  }
}

/* Design studio status icon — color dot + hover tooltip */
.dm-status-tip {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  flex-shrink: 0;
}

.dm-status-tip.hidden {
  display: none !important;
}

.dm-status-tip__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border-radius: 0.45rem;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.95);
  cursor: default;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.dark .dm-status-tip__btn {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

.dm-status-tip__btn:hover,
.dm-status-tip__btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35);
}

.dm-status-tip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--dm-status-color, #9ca3af);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--dm-status-color, #9ca3af) 25%, transparent);
}

.dm-status-tip--idle {
  --dm-status-color: #9ca3af;
}

.dm-status-tip--info {
  --dm-status-color: #2563eb;
}

.dm-status-tip--ok {
  --dm-status-color: #059669;
}

.dm-status-tip--error {
  --dm-status-color: #e11d48;
}

.dm-status-tip--thinking .dm-status-tip__dot {
  animation: dm-alexa-think 1.8s ease-in-out infinite;
}

@keyframes dm-alexa-think {
  0%, 100% {
    background: #19d3ff;
    box-shadow: 0 0 0 3px rgba(25, 211, 255, 0.28), 0 0 12px rgba(25, 211, 255, 0.9);
  }
  33% {
    background: #5b6cff;
    box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.28), 0 0 12px rgba(91, 108, 255, 0.9);
  }
  66% {
    background: #d946ef;
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.28), 0 0 12px rgba(217, 70, 239, 0.85);
  }
}

@media (prefers-reduced-motion: reduce) {
  .dm-status-tip--thinking .dm-status-tip__dot {
    animation: none;
    background: #5b6cff;
    box-shadow: 0 0 0 3px rgba(91, 108, 255, 0.28);
  }
}

.dm-status-tip--warn {
  --dm-status-color: #d97706;
}

.dm-status-tip__panel {
  position: absolute;
  z-index: 60;
  min-width: 12rem;
  max-width: min(22rem, 70vw);
  padding: 0.45rem 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dm-status-tip--top .dm-status-tip__panel {
  bottom: calc(100% + 0.35rem);
  left: 0;
}

.dm-status-tip--bottom .dm-status-tip__panel {
  top: calc(100% + 0.35rem);
  left: 0;
}

.dm-status-tip--align-center .dm-status-tip__panel {
  left: 50%;
  transform: translateX(-50%) translateY(4px);
}

.dm-status-tip--align-end .dm-status-tip__panel {
  left: auto;
  right: 0;
}

.dm-status-tip--bottom.dm-status-tip--align-center .dm-status-tip__panel {
  transform: translateX(-50%) translateY(-4px);
}

.dm-status-tip:hover .dm-status-tip__panel,
.dm-status-tip:focus-within .dm-status-tip__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dm-status-tip--align-center:hover .dm-status-tip__panel,
.dm-status-tip--align-center:focus-within .dm-status-tip__panel {
  transform: translateX(-50%) translateY(0);
}

.dm-status-tip--bottom.dm-status-tip--align-center:hover .dm-status-tip__panel,
.dm-status-tip--bottom.dm-status-tip--align-center:focus-within .dm-status-tip__panel {
  transform: translateX(-50%) translateY(0);
}

.dm-status-tip__panel-inner {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(17, 24, 39, 0.1);
  background: #fff;
  color: var(--brand-dark, #111827);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
}

.dark .dm-status-tip__panel-inner {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.dm-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding-bottom: 0.15rem;
}

.dm-prompt-actions__secondary,
.dm-prompt-actions__primary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.dm-prompt-actions__primary {
  margin-left: auto;
}

.dm-prompt-input--stacked {
  width: 100%;
  flex: none;
  min-height: 3.25rem;
}

.dm-prompt-input {
  flex: 1;
  min-height: 2.65rem;
  max-height: 6rem;
  resize: vertical;
  border-radius: 0.75rem;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  background: #fff;
  color: var(--brand-dark, #111827);
}

.dark .dm-prompt-input {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.dm-prompt-btn {
  flex-shrink: 0;
  border: 1.5px solid rgba(17, 24, 39, 0.2) !important;
  border-radius: 0.75rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #fff !important;
  color: #111827 !important;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.dm-prompt-btn:hover:not(:disabled) {
  background: rgba(17, 24, 39, 0.04) !important;
  border-color: rgba(17, 24, 39, 0.35) !important;
}

.dm-prompt-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dark .dm-prompt-btn {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
}

.dark .dm-prompt-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

.dm-prompt-btn--secondary {
  background: #fff !important;
  border-color: rgba(17, 24, 39, 0.2) !important;
  color: #111827 !important;
}

.dark .dm-prompt-btn--secondary {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
}

.dm-prompt-btn--primary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--brand-yellow, #ffd644) !important;
  border-color: transparent !important;
  color: var(--brand-on-accent, #111827) !important;
  padding-inline: 1rem;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}

.dm-prompt-btn--primary:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-yellow, #ffd644) 88%, #000) !important;
  border-color: transparent !important;
  filter: none;
}

.dark .dm-prompt-btn--primary {
  background: var(--brand-yellow, #ffd644) !important;
  border-color: transparent !important;
  color: var(--brand-on-accent, #111827) !important;
}

.dm-prompt-btn--primary svg,
.dm-prompt-btn--primary i {
  color: var(--brand-on-accent, #111827) !important;
  stroke: var(--brand-on-accent, #111827) !important;
}

.dm-prompt-btn--primary:disabled {
  opacity: 0.75;
}

/* Generate: solid brand accent + paired on-accent text/icons from Branding. */
.dm-prompt-btn--generate {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--brand-yellow, #ffd644) !important;
  border-color: transparent !important;
  color: var(--brand-on-accent, #111827) !important;
  padding-inline: 0.95rem;
}

.dm-prompt-btn--generate:hover:not(:disabled) {
  background: color-mix(in srgb, var(--brand-yellow, #ffd644) 88%, #000) !important;
  border-color: transparent !important;
}

.dark .dm-prompt-btn--generate {
  background: var(--brand-yellow, #ffd644) !important;
  border-color: transparent !important;
  color: var(--brand-on-accent, #111827) !important;
}

.dm-prompt-btn--generate svg,
.dm-prompt-btn--generate i {
  color: var(--brand-on-accent, #111827) !important;
  stroke: var(--brand-on-accent, #111827) !important;
}

.dm-prompt-btn--generate.is-generating,
.dm-prompt-btn--generate:disabled.is-generating {
  background: var(--brand-yellow, #ffd644) !important;
  color: var(--brand-on-accent, #111827) !important;
  opacity: 1;
}

.dm-prompt-btn--both {
  background: transparent;
  border-color: rgba(17, 24, 39, 0.2);
  color: #111827 !important;
}

.dm-prompt-btn--both:hover:not(:disabled) {
  background: rgba(17, 24, 39, 0.04);
  border-color: rgba(17, 24, 39, 0.35);
}

.dark .dm-prompt-btn--both {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: #f8fafc !important;
}

.dark .dm-prompt-btn--both:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.4);
}


.dm-studio-inspector {
  border-left: 1px solid rgba(17, 24, 39, 0.08);
  padding: 1rem 0.85rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  background: #fff;
}

.dark .dm-studio-inspector {
  background: #0f172a;
  border-left-color: rgba(255, 255, 255, 0.06);
}

.dm-prompt-editor-wrap.hidden {
  display: none;
}

.dm-prompt-editor {
  min-height: 10rem;
  font-size: 0.75rem;
  line-height: 1.45;
}

.dm-slot-badge {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.2);
  color: #854d0e;
}

.dm-inspector-tips {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.dark .dm-inspector-tips {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.dm-workflow-section {
  padding: 1.25rem 1rem 2rem;
  max-width: none;
}

.dm-workflow-summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-dark, #111827);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  list-style: none;
}

.dark .dm-workflow-summary {
  color: #fff;
}

.dm-workflow-summary::-webkit-details-marker {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1280px) {
  .dm-studio {
    grid-template-columns: var(--dm-rail-w) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: min(85vh, 900px);
    min-height: min(85vh, 900px);
  }

  .dm-studio-drawer {
    grid-column: 2;
    grid-row: 1;
    max-height: 14rem;
    border-right: none;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  }

  .dm-studio-stage {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 0;
  }

  .dm-studio-inspector {
    display: none;
  }
}

@media (max-width: 768px) {
  .dm-studio {
    grid-template-columns: 1fr;
    margin: 0 0.5rem;
  }

  .dm-studio-rail {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  }

  .dm-rail-btn {
    min-width: 4rem;
  }

  .dm-studio-drawer {
    grid-column: 1;
  }
}

/* App-wide navbar lead search */
.nav-lead-search {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: none;
}

@media (min-width: 768px) {
  #appTopbar .app-topbar-inner {
    width: 100%;
    max-width: none;
  }

  #appTopbar .nav-lead-search {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
  }
}

.nav-lead-search-form {
  position: relative;
}

.nav-lead-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-lead-search-icon {
  position: absolute;
  left: 0.85rem;
  width: 1rem;
  height: 1rem;
  color: rgb(100 116 139);
  pointer-events: none;
}

.dark .nav-lead-search-icon {
  color: rgb(148 163 184);
}

.nav-lead-search-input {
  width: 100%;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0.55rem 4.25rem 0.55rem 2.35rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgb(15 23 42);
  transition: color 0.15s ease;
  box-shadow: none;
}

.dark .nav-lead-search-input {
  background: transparent;
  color: rgb(248 250 252);
}

.nav-lead-search-input::placeholder {
  color: rgb(100 116 139 / 0.85);
  font-weight: 500;
}

.dark .nav-lead-search-input::placeholder {
  color: rgb(148 163 184 / 0.85);
}

.nav-lead-search-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

.dark .nav-lead-search-input:focus {
  background: transparent;
}

.nav-lead-search-kbd {
  position: absolute;
  right: 2.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 0.375rem;
  border: none;
  background: rgb(243 244 246 / 0.9);
  color: rgb(156 163 175);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.dark .nav-lead-search-kbd {
  background: rgb(255 255 255 / 0.08);
  color: rgb(148 163 184);
}

.nav-lead-search-clear {
  position: absolute;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 9999px;
  color: rgb(100 116 139);
}

.nav-lead-search-clear:hover {
  background: rgb(241 245 249);
  color: rgb(51 65 85);
}

.dark .nav-lead-search-clear:hover {
  background: rgb(51 65 85);
  color: rgb(226 232 240);
}

/* Pavlex AI mode toggle — sits at the far right; clear + ⌘K shift left to make room. */
.nav-lead-search-input {
  padding-right: 6.25rem;
}

.nav-lead-search-input::-webkit-search-cancel-button,
.nav-lead-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.nav-lead-search--mobile .nav-lead-search-input {
  padding-right: 4.5rem;
  font-size: 16px;
}

.nav-lead-search-clear {
  right: 2.3rem;
}

.nav-lead-search-kbd {
  right: 4.1rem;
}

.nav-lead-search-ai-toggle {
  position: absolute;
  right: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 9999px;
  color: rgb(100 116 139);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-lead-search-ai-toggle:hover {
  background: rgb(241 245 249);
  color: var(--brand-dark, rgb(15 23 42));
}

.dark .nav-lead-search-ai-toggle {
  color: rgb(148 163 184);
}

.dark .nav-lead-search-ai-toggle:hover {
  background: rgb(51 65 85);
  color: rgb(226 232 240);
}

.nav-lead-search-form--ai .nav-lead-search-ai-toggle,
.nav-lead-search-form--ai .nav-lead-search-ai-toggle:hover {
  background: var(--brand-yellow, #facc15);
  color: #fff;
}

.nav-lead-search-form--ai .nav-lead-search-input-wrap {
  border-radius: 9999px;
  box-shadow: 0 0 0 2px var(--brand-yellow, #facc15);
}

.nav-lead-search-form--ai .nav-lead-search-kbd {
  display: none;
}

/* Alex voice input — mic shared by /chat, the floating chat, and the AI search bar (AI mode only). */
.alex-voice-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.alex-voice-btn[hidden] {
  display: none !important;
}

.alex-voice-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
}

.alex-voice-btn:focus-visible {
  outline: 2px solid var(--brand-yellow, #facc15);
  outline-offset: 2px;
}

.alex-voice-btn:disabled {
  cursor: progress;
}

.alex-voice-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.alex-voice-icon--stop,
.alex-voice-icon--spin {
  display: none;
}

.alex-voice-btn[data-state='listening'] .alex-voice-icon--mic,
.alex-voice-btn[data-state='transcribing'] .alex-voice-icon--mic {
  display: none;
}

.alex-voice-btn[data-state='listening'] .alex-voice-icon--stop {
  display: block;
  width: 1rem;
  height: 1rem;
}

.alex-voice-btn[data-state='transcribing'] .alex-voice-icon--spin {
  display: block;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 9999px;
  animation: alexVoiceSpin 0.75s linear infinite;
}

.alex-voice-btn[data-state='listening'] {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
  animation: alexVoicePulse 1.4s ease-out infinite;
}

.alex-voice-btn[data-state='transcribing'] {
  color: var(--brand-muted, rgb(100 116 139)) !important;
}

@keyframes alexVoicePulse {
  0% { box-shadow: 0 0 0 0 rgb(239 68 68 / 0.55); }
  70% { box-shadow: 0 0 0 10px rgb(239 68 68 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(239 68 68 / 0); }
}

@keyframes alexVoiceSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .alex-voice-btn[data-state='listening'] {
    animation: none;
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.35);
  }
  .alex-voice-btn[data-state='transcribing'] .alex-voice-icon--spin {
    animation-duration: 1.6s;
  }
}

/* Search-bar mic: only in Ask Alex mode, between clear and the AI toggle. */
.nav-lead-search-mic {
  position: absolute;
  right: 2.45rem;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  color: rgb(100 116 139);
}

.nav-lead-search-mic::after {
  width: 2.75rem;
  height: 2.75rem;
}

.nav-lead-search-mic .alex-voice-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.nav-lead-search-mic:hover {
  background: rgb(241 245 249);
  color: var(--brand-dark, rgb(15 23 42));
}

.dark .nav-lead-search-mic {
  color: rgb(148 163 184);
}

.dark .nav-lead-search-mic:hover {
  background: rgb(51 65 85);
  color: rgb(226 232 240);
}

.nav-lead-search-form:not(.nav-lead-search-form--ai) .nav-lead-search-mic {
  display: none !important;
}

.nav-lead-search-form--ai .nav-lead-search-input-wrap:has(.nav-lead-search-mic:not([hidden])) .nav-lead-search-clear {
  right: 4.75rem;
}

.nav-lead-search-form--ai .nav-lead-search-input-wrap:has(.nav-lead-search-mic:not([hidden])) .nav-lead-search-input {
  padding-right: 6.85rem;
}

/* Box props are !important: desktop `body.app-with-sidebar > :not(#appSidebar)…` crushes body children to height 0. */
.alex-voice-status {
  position: fixed;
  z-index: 2147483000;
  max-width: min(22rem, calc(100vw - 1rem));
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0.45rem 0.75rem !important;
  border-radius: 0.75rem;
  background: rgb(15 23 42);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 28px rgb(15 23 42 / 0.25);
  pointer-events: none;
}

.alex-voice-status[hidden] {
  display: none;
}

.alex-voice-status[data-kind='live']::before {
  content: '';
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.4rem;
  border-radius: 9999px;
  background: #ef4444;
  vertical-align: 0.05rem;
}

.alex-voice-status[data-kind='error'] {
  background: #b91c1c;
  color: #fff;
}

.dark .alex-voice-status:not([data-kind='error']) {
  background: rgb(248 250 252);
  color: rgb(15 23 42);
}

.nav-lead-search-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 130;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(255 255 255);
  box-shadow: 0 18px 40px rgb(15 23 42 / 0.14);
  max-height: min(22rem, calc(100vh - 7rem));
  overflow-y: auto;
}

.dark .nav-lead-search-dropdown {
  border-color: rgb(255 255 255 / 0.1);
  background: rgb(15 23 42);
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.45);
}

.nav-lead-search--mobile .nav-lead-search-dropdown {
  position: relative;
  top: 0.35rem;
  max-height: min(18rem, calc(100vh - 9rem));
}

.nav-lead-search-item,
.nav-lead-search-footer,
.nav-lead-search-empty,
.nav-lead-search-loading {
  display: block;
  width: 100%;
  text-align: left;
}

.nav-lead-search-item {
  padding: 0.65rem 0.9rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-lead-search-item:hover,
.nav-lead-search-item--active {
  background: rgb(254 249 195 / 0.55);
}

.dark .nav-lead-search-item:hover,
.dark .nav-lead-search-item--active {
  background: rgb(250 204 21 / 0.08);
}

.nav-lead-search-item-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgb(15 23 42);
  line-height: 1.25;
}

.dark .nav-lead-search-item-title {
  color: rgb(248 250 252);
}

.nav-lead-search-item-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(100 116 139);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .nav-lead-search-item-meta {
  color: rgb(148 163 184);
}

.nav-lead-search-footer {
  padding: 0.65rem 0.9rem;
  border: 0;
  border-top: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(161 98 7);
  cursor: pointer;
}

.dark .nav-lead-search-footer {
  border-top-color: rgb(255 255 255 / 0.08);
  background: rgb(30 41 59 / 0.65);
  color: rgb(250 204 21);
}

.nav-lead-search-empty,
.nav-lead-search-loading {
  padding: 0.85rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(100 116 139);
}

.dark .nav-lead-search-empty,
.dark .nav-lead-search-loading {
    color: rgb(148 163 184);
}

/* ========= App info tip (i) hover tooltips ========= */
.app-info-tip {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
    flex-shrink: 0;
}

.app-info-tip__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    padding: 0;
    border: 1px solid rgb(203 213 225 / 0.85);
    border-radius: 9999px;
    background: rgb(255 255 255 / 0.92);
    color: rgb(100 116 139);
    cursor: help;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dark .app-info-tip__btn {
    border-color: rgb(255 255 255 / 0.14);
    background: rgb(30 41 59 / 0.85);
    color: rgb(148 163 184);
}

.app-info-tip__btn:hover,
.app-info-tip__btn:focus-visible {
    color: rgb(234 179 8);
    border-color: rgb(234 179 8 / 0.55);
    background: rgb(254 252 232 / 0.95);
    box-shadow: 0 0 0 2px rgb(234 179 8 / 0.18);
    outline: none;
}

.dark .app-info-tip__btn:hover,
.dark .app-info-tip__btn:focus-visible {
    background: rgb(51 65 85 / 0.95);
    color: rgb(250 204 21);
}

.app-info-tip--sm .app-info-tip__btn {
    width: 1.15rem;
    height: 1.15rem;
}

.app-info-tip--lg .app-info-tip__btn {
    width: 1.5rem;
    height: 1.5rem;
}

.app-info-tip__icon {
    width: 0.72rem;
    height: 0.72rem;
}

.app-info-tip--sm .app-info-tip__icon {
    width: 0.62rem;
    height: 0.62rem;
}

.app-info-tip--lg .app-info-tip__icon {
    width: 0.82rem;
    height: 0.82rem;
}

.app-info-tip__panel {
    position: absolute;
    z-index: 60;
    margin-top: 0.4rem;
    padding: 0.65rem 0.85rem;
    max-width: min(calc(100vw - 2rem), 26rem);
    width: max-content;
    border-radius: 0.85rem;
    border: 1px solid var(--brand-border);
    background: var(--brand-card-bg);
    box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.14), 0 6px 14px -6px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.dark .app-info-tip__panel {
    box-shadow: 0 14px 32px -10px rgba(0, 0, 0, 0.5), 0 6px 14px -6px rgba(0, 0, 0, 0.28);
}

.app-info-tip--wide .app-info-tip__panel {
    max-width: min(calc(100vw - 2rem), 34rem);
}

.app-info-tip--bottom .app-info-tip__panel {
    top: 100%;
    bottom: auto;
}

.app-info-tip--top .app-info-tip__panel {
    bottom: 100%;
    top: auto;
    margin-top: 0;
    margin-bottom: 0.4rem;
    transform: translateY(-4px);
}

.app-info-tip--align-start .app-info-tip__panel {
    left: 0;
    right: auto;
}

.app-info-tip--align-center .app-info-tip__panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(4px);
}

.app-info-tip--align-end .app-info-tip__panel {
    left: auto;
    right: 0;
}

.app-info-tip--top.app-info-tip--align-center .app-info-tip__panel {
    transform: translateX(-50%) translateY(-4px);
}

.app-info-tip:hover .app-info-tip__panel,
.app-info-tip:focus-within .app-info-tip__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-info-tip--align-start:hover .app-info-tip__panel,
.app-info-tip--align-start:focus-within .app-info-tip__panel {
    transform: translateY(0);
}

.app-info-tip--align-end:hover .app-info-tip__panel,
.app-info-tip--align-end:focus-within .app-info-tip__panel {
    transform: translateY(0);
}

.app-info-tip--top.app-info-tip--align-start:hover .app-info-tip__panel,
.app-info-tip--top.app-info-tip--align-start:focus-within .app-info-tip__panel {
    transform: translateY(0);
}

.app-info-tip--top.app-info-tip--align-end:hover .app-info-tip__panel,
.app-info-tip--top.app-info-tip--align-end:focus-within .app-info-tip__panel {
    transform: translateY(0);
}

.app-info-tip--align-center:hover .app-info-tip__panel,
.app-info-tip--align-center:focus-within .app-info-tip__panel {
    transform: translateX(-50%) translateY(0);
}

.app-info-tip--top.app-info-tip--align-center:hover .app-info-tip__panel,
.app-info-tip--top.app-info-tip--align-center:focus-within .app-info-tip__panel {
    transform: translateX(-50%) translateY(0);
}

.app-info-tip__panel-inner {
    display: block;
    color: rgb(71 85 105);
    font-weight: 500;
}

.dark .app-info-tip__panel-inner {
    color: rgb(203 213 225);
}

.app-info-tip__panel-inner code {
    font-size: 0.68rem;
}

.app-info-tip__panel-inner ul {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    list-style: disc;
}

.app-info-tip__panel-inner li + li {
    margin-top: 0.25rem;
}

.page-heading-with-tip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

/* Find a contact popover — portaled to body; Tailwind CDN utilities alone left it transparent under table cells.
   Box props are !important: on desktop `body.app-with-sidebar > :not(#appSidebar)…` (ID specificity) crushes
   direct body children to height 0 / padding 0 / pointer-events none. */
.lead-find-contact-popover {
  position: fixed;
  z-index: 10060 !important;
  width: 20rem;
  max-width: calc(100vw - 24px);
  height: auto !important;
  min-height: 0 !important;
  max-height: 26rem !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  padding: 0.75rem !important;
  pointer-events: auto !important;
  border-radius: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  opacity: 1 !important;
  color: #111827;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
  isolation: isolate;
}
html.dark .lead-find-contact-popover {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

/* Opportunity board schedule/tag popup — solid over kanban (same treatment as other portaled pickers) */
.opp-pop,
.opp-pop.portaled-popover-surface {
  position: fixed !important;
  display: block !important;
  visibility: visible !important;
  pointer-events: auto !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  opacity: 1 !important;
  color: #111827 !important;
  z-index: 10060 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
  overflow: visible !important;
  padding: 0 !important;
  transform: none !important;
  clip: auto !important;
  clip-path: none !important;
  filter: none !important;
  max-height: none !important;
  min-width: 16rem;
}
.opp-pop::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: #ffffff !important;
  background-color: #ffffff !important;
  pointer-events: none;
}
.opp-pop__surface,
.opp-pop .adhello-mini-calendar__surface {
  position: relative;
  z-index: 1;
  display: block !important;
  visibility: visible !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111827 !important;
  padding: 0.85rem;
  min-height: 12rem;
}
.opp-pop .opp-cal,
.opp-pop .opp-cal-nav {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111827 !important;
}
.opp-pop .opp-cal button,
.opp-pop .opp-cal span,
.opp-pop h4,
.opp-pop .opp-pop-time,
.opp-pop .opp-pop-add {
  color: inherit !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html.dark .opp-pop,
html.dark .opp-pop.portaled-popover-surface,
html.dark .opp-pop::before,
html.dark .opp-pop__surface,
html.dark .opp-pop .adhello-mini-calendar__surface,
html.dark .opp-pop .opp-cal,
html.dark .opp-pop .opp-cal-nav {
  background: #0f172a !important;
  background-color: #0f172a !important;
  color: #f8fafc !important;
}

/* ─── Mobile / PWA shell ─────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Do NOT set overflow-x on body/html — it clips position:fixed popovers
   (opportunity calendar, tag picker, etc.) in Chromium. Constrain scroll on the shell instead. */
body {
  overscroll-behavior-x: none;
}

/* Installed app: use dynamic viewport + notch-safe padding */
@media all and (display-mode: standalone) {
  html,
  body {
    min-height: 100dvh;
  }
  body.app-with-sidebar {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #appTopbar {
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px)) !important;
  }
}

@media (max-width: 767px) {
  /* Touch-friendly tap targets in chrome */
  #mobileMenuBtn,
  #closeMobileMenu,
  #wsSwitcherBtn {
    min-width: 44px;
    min-height: 44px;
  }

  /* Wide pipeline / board surfaces: allow intentional horizontal scroll */
  .pipeline-board,
  .opp-board,
  .kanban-board,
  [data-pipeline-board] {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* Forms & inputs: 16px+ avoids iOS focus zoom */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
  select,
  textarea {
    font-size: max(16px, 1em);
  }

  /* Modals fill safe area on small screens */
  #manualLeadModal > .relative,
  [role="dialog"] .relative.max-w-lg,
  [role="dialog"] .relative.max-w-xl {
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 2rem);
  }

  /* Sticky bottom bars clear home indicator */
  .sticky.bottom-0,
  .fixed.bottom-0,
  [data-mobile-sticky-bottom] {
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }

  /* Topbar: keep actions usable when cramped */
  #appTopbar .app-topbar-inner {
    gap: 0.35rem;
  }

  #navFindLeadsBtn span:not(.sr-only) {
    max-width: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* Phones in any orientation (landscape is wider than 767px) and tablets.
   iOS Safari ignores body overflow-x:hidden for touch panning, so anything past
   the right edge — even visibility:hidden — lets the whole page slide sideways. */
@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  .app-shell-content,
  .app-shell-content > main {
    max-width: 100vw;
    overflow-x: clip;
  }

  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  /* (i) panels: out of layout until opened, then pinned inside the viewport */
  .app-info-tip:not(:hover):not(:focus-within) .app-info-tip__panel {
    display: none;
  }
  .app-info-tip .app-info-tip__panel,
  .app-info-tip--wide .app-info-tip__panel {
    position: fixed;
    left: 1rem !important;
    right: 1rem !important;
    top: auto !important;
    bottom: auto !important;
    width: auto;
    max-width: 34rem;
    margin: 1.75rem auto 0;
    transform: none !important;
  }
  .app-info-tip--top .app-info-tip__panel {
    margin-top: 0;
    transform: translateY(calc(-100% - 0.4rem)) !important;
  }
}


/* Opportunity cards — Opportunities board and pipeline Board & stages (opportunity-card-actions.js) */
.opp-card { position: relative; flex: 0 0 auto; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; background: #fff; border: 1px solid rgba(17, 24, 39, 0.08); border-radius: 0.8rem; padding: 0.65rem 0.7rem; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
html.dark .opp-card { background: #0f172a; border-color: rgba(255, 255, 255, 0.1); }
.opp-card.sortable-ghost { opacity: 0.45; cursor: grabbing; }
.opp-card.sortable-fallback,
.opp-card.sortable-drag,
.opp-card.sortable-chosen { cursor: grabbing; touch-action: none; }
/* Sortable's drag copy is a direct body child. The desktop shell rule `body.app-with-sidebar > :not(#appSidebar)… *`
   turns pointer events back on for its children, so hit-testing finds the copy instead of the column under it. */
body > .sortable-fallback,
body > .sortable-fallback * { pointer-events: none !important; }
body.app-with-sidebar > .opp-card.sortable-fallback { padding: 0.65rem 0.7rem !important; }
body.opp-sorting { cursor: grabbing; }
body.opp-sorting .opp-stage-cards { overflow-y: hidden; }
.opp-card-head { display: flex; align-items: flex-start; gap: 0.35rem; min-width: 0; }
.opp-card-title { display: block; flex: 1 1 auto; width: auto; min-width: 0; border: 0; background: transparent; padding: 0; text-align: left; font-weight: 800; font-size: 0.8125rem; line-height: 1.3; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.opp-card-title:hover { color: var(--brand-yellow, #ca8a04); }
.opp-card-pin { flex: none; color: #94a3b8; margin-top: 0.1rem; }
.opp-card-pin svg { width: 0.85rem; height: 0.85rem; display: block; }
.opp-card-category { margin: 0.2rem 0 0; min-width: 0; max-width: 100%; font-size: 0.625rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-card-status { margin: 0.28rem 0 0; min-width: 0; max-width: 100%; font-size: 0.72rem; font-weight: 600; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-card-note {
  margin: 0.2rem 0 0;
  min-width: 0;
  max-width: 100%;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.dark .opp-card-note { color: #94a3b8; }
.opp-card-reviews { margin: 0.22rem 0 0; min-width: 0; max-width: 100%; font-size: 0.68rem; font-weight: 600; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-card-reviews span { color: #d97706; }
.opp-card-value { margin: 0.2rem 0 0; min-width: 0; max-width: 100%; font-size: 0.75rem; font-weight: 800; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.dark .opp-card-value { color: #f8fafc; }
.opp-card-tools { position: relative; z-index: 2; display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 0.2rem 0.12rem; margin-top: 0.45rem; padding-top: 0.4rem; border-top: 1px solid rgba(17, 24, 39, 0.06); min-width: 0; max-width: 100%; }
html.dark .opp-card-tools { border-top-color: rgba(255, 255, 255, 0.08); }
.opp-card-tools a, .opp-card-tools button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 1.35rem; height: 1.35rem; border: 0; background: transparent; color: #64748b; border-radius: 0.3rem; padding: 0; cursor: pointer; text-decoration: none; }
.opp-card-tools a:hover, .opp-card-tools button:hover { color: #a16207; background: rgba(250, 204, 21, 0.22); }
.opp-card-tools svg { width: 0.88rem; height: 0.88rem; display: block; }
.opp-card-tools button.is-syncing svg { animation: opp-sync-spin 0.7s linear infinite; }
.opp-card-tools button.is-finding { color: #a16207; background: rgba(250, 204, 21, 0.22); cursor: progress; }
.opp-card-tools button.is-finding svg { animation: opp-find-pulse 0.9s ease-in-out infinite; }
.opp-card-tools button[data-opp-action="advance"] { margin-left: auto; color: #a16207; }
.opp-card-tools button[data-opp-action="advance"]:hover { color: #854d0e; background: rgba(250, 204, 21, 0.35); }
.opp-card-tools button[data-opp-action="advance"][hidden] { display: none !important; }
.opp-card-tools button.opp-card-call { width: 1.6rem; height: 1.6rem; color: #fff; background: #059669; border-radius: 999px; margin-right: 0.2rem; }
.opp-card-tools button.opp-card-call:hover { color: #fff; background: #047857; }
.opp-card-tools button.opp-card-call:disabled { background: rgba(100, 116, 139, 0.18); color: #94a3b8; cursor: not-allowed; }
@media (pointer: coarse) {
  .opp-card-tools button.opp-card-call { width: 2.1rem; height: 2.1rem; }
  .opp-card-tools button.opp-card-call svg { width: 1.05rem; height: 1.05rem; }
}
.opp-card-head .opp-card-remove { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.5rem; height: 1.5rem; margin: -0.2rem -0.3rem -0.2rem 0; padding: 0; border: 0; border-radius: 0.4rem; background: transparent; color: #94a3b8; cursor: pointer; }
.opp-card-head .opp-card-remove svg { width: 0.85rem; height: 0.85rem; display: block; }
.opp-card-head .opp-card-remove:hover,
.opp-card-head .opp-card-remove:focus-visible { color: #e11d48; background: rgba(244, 63, 94, 0.12); }
.opp-card-head .opp-card-remove:disabled { opacity: 0.45; cursor: not-allowed; }
html.dark .opp-card-head .opp-card-remove { color: #64748b; }
html.dark .opp-card-head .opp-card-remove:hover { color: #fb7185; background: rgba(244, 63, 94, 0.16); }
@media (pointer: coarse) {
  .opp-card-head .opp-card-remove { width: 2rem; height: 2rem; margin: -0.45rem -0.5rem -0.45rem 0; }
  .opp-card-head .opp-card-remove svg { width: 1rem; height: 1rem; }
}
.opp-stage-head-tools,
.kanban-column-tools { display: inline-flex; align-items: center; gap: 0.35rem; flex: none; }
button.opp-stage-call,
button.opp-stage-sms { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.6rem; height: 1.6rem; padding: 0; border: 0; border-radius: 999px; background: rgba(15, 39, 71, 0.07); color: #0f2747; cursor: pointer; }
button.opp-stage-call svg,
button.opp-stage-sms svg { width: 0.85rem; height: 0.85rem; display: block; }
button.opp-stage-call:hover:not(:disabled),
button.opp-stage-call:focus-visible,
button.opp-stage-sms:hover:not(:disabled),
button.opp-stage-sms:focus-visible { background: rgba(250, 204, 21, 0.35); color: #854d0e; }
button.opp-stage-call:disabled,
button.opp-stage-sms:disabled { opacity: 0.35; cursor: not-allowed; }
html.dark button.opp-stage-call,
html.dark button.opp-stage-sms { background: rgba(255, 255, 255, 0.08); color: #f8fafc; }
#oppBoard.is-editing .opp-stage-call,
#oppBoard.is-editing .opp-stage-sms { display: none; }
@media (pointer: coarse) {
  button.opp-stage-call,
  button.opp-stage-sms { width: 2rem; height: 2rem; }
  button.opp-stage-call svg,
  button.opp-stage-sms svg { width: 1rem; height: 1rem; }
}
@media (pointer: coarse) {
  .opp-card-tools button[data-opp-action="advance"] {
    width: 1.85rem;
    height: 1.85rem;
    background: rgba(250, 204, 21, 0.28);
    border-radius: 0.4rem;
  }
  .opp-card-tools button[data-opp-action="advance"] svg { width: 1.05rem; height: 1.05rem; }
}
.opp-move-list { display: flex; flex-direction: column; gap: 0.55rem; max-height: 16rem; overflow: auto; }
.opp-move-pipe { border: 1px solid rgba(17, 24, 39, 0.1); border-radius: 0.75rem; padding: 0.45rem 0.55rem; background: #fff; }
html.dark .opp-move-pipe { background: #1e293b; border-color: rgba(255, 255, 255, 0.12); }
.opp-move-pipe strong { display: block; font-size: 0.72rem; font-weight: 800; margin-bottom: 0.35rem; }
.opp-move-stages { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.opp-pop .opp-move-stage { border: 1px solid rgba(17, 24, 39, 0.12); background: #fff; border-radius: 999px; padding: 0.28rem 0.55rem; font-size: 0.68rem; font-weight: 700; cursor: pointer; color: inherit; }
html.dark .opp-move-stage { background: #0f172a; border-color: rgba(255, 255, 255, 0.14); color: #f8fafc; }
.opp-move-stage:hover { background: rgba(250, 204, 21, 0.35); border-color: rgba(202, 138, 4, 0.45); }
.opp-move-empty { margin: 0; font-size: 0.72rem; font-weight: 600; color: #64748b; }
@keyframes opp-sync-spin { to { transform: rotate(360deg); } }
@keyframes opp-find-pulse { 50% { transform: scale(0.78); opacity: 0.55; } }
.opp-pop {
  position: fixed;
  z-index: 10060;
  width: min(18rem, calc(100vw - 1.5rem));
  min-width: 16rem;
  padding: 0;
  margin: 0;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 1rem;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.28);
  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible;
}
.opp-pop::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: #ffffff !important;
  background-color: #ffffff !important;
  pointer-events: none;
}
.opp-pop__surface {
  position: relative;
  z-index: 1;
  padding: 0.85rem;
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111827 !important;
  min-height: 12rem;
}
html.dark .opp-pop,
html.dark .opp-pop::before,
html.dark .opp-pop__surface {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
}
.opp-pop h4 { margin: 0 0 0.55rem; font-size: 0.8rem; font-weight: 800; }
.opp-pop-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; max-height: 11rem; overflow: auto; }
.opp-pop .opp-pop-tag, .opp-pop .opp-pop-add { border: 1px solid rgba(17, 24, 39, 0.12); background: #fff; border-radius: 999px; padding: 0.28rem 0.6rem; font-size: 0.68rem; font-weight: 700; cursor: pointer; }
html.dark .opp-pop-tag, html.dark .opp-pop-add { background: #1e293b; border-color: rgba(255, 255, 255, 0.14); color: #f8fafc; }
.opp-pop-tag.is-on { background: rgba(250, 204, 21, 0.35); border-color: rgba(202, 138, 4, 0.45); }
.opp-pop-row { display: flex; gap: 0.35rem; margin-top: 0.55rem; }
.opp-pop-row input, .opp-pop-time { flex: 1; min-width: 0; border: 1px solid rgba(17, 24, 39, 0.12); border-radius: 0.7rem; padding: 0.4rem 0.55rem; font-size: 0.75rem; background: #fff; }
html.dark .opp-pop-row input, html.dark .opp-pop-time { background: #1e293b; border-color: rgba(255, 255, 255, 0.14); color: #f8fafc; }
.opp-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-radius: 0.5rem;
  padding: 0.15rem;
}
html.dark .opp-cal {
  background: #0f172a !important;
  background-color: #0f172a !important;
}
.opp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  background: #ffffff !important;
  background-color: #ffffff !important;
}
html.dark .opp-cal-nav {
  background: #0f172a !important;
  background-color: #0f172a !important;
}
.opp-cal button, .opp-cal span { height: 1.7rem; border: 0; background: transparent; border-radius: 0.4rem; font-size: 0.68rem; font-weight: 700; color: inherit; }
.opp-cal button { cursor: pointer; }
.opp-cal button:hover { background: rgba(17, 24, 39, 0.06); }
html.dark .opp-cal button:hover { background: rgba(255, 255, 255, 0.08); }
.opp-cal button.is-today { box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.25); }
.opp-cal button.is-selected { background: #FFDB3A; color: #111827; }
.opp-cal-nav button { border: 0; background: transparent; font-weight: 800; cursor: pointer; padding: 0.15rem 0.4rem; color: inherit; }

/* Alex chat widget (#ceoChatFloat) — same look as /chat. Accent tints use color-mix because the brand colors are CSS vars. */
#ceoChatFloat {
  --acw-accent-soft: color-mix(in srgb, var(--brand-yellow) 14%, transparent);
  --acw-accent-ring: color-mix(in srgb, var(--brand-yellow) 24%, transparent);
  --acw-accent-line: color-mix(in srgb, var(--brand-yellow) 60%, transparent);
  --acw-accent-ink: color-mix(in srgb, var(--brand-yellow) 48%, #111827);
  --acw-surface: #ffffff;
  --acw-shadow-soft: 0 1px 2px rgba(17, 24, 39, 0.04), 0 10px 30px -18px rgba(17, 24, 39, 0.25);
}
.dark #ceoChatFloat {
  --acw-accent-soft: color-mix(in srgb, var(--brand-yellow) 16%, transparent);
  --acw-accent-ink: color-mix(in srgb, var(--brand-yellow) 78%, #ffffff);
  --acw-surface: #0f172a;
  --acw-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -18px rgba(0, 0, 0, 0.6);
}

#ceoChatFloat .acw-panel {
  width: min(calc(100vw - 2rem), 400px);
  height: min(640px, calc(100dvh - 7.5rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--acw-surface);
  border: 1px solid var(--brand-border);
  border-radius: 1.75rem;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.06), 0 28px 70px -24px rgba(17, 24, 39, 0.38);
  transform-origin: bottom right;
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#ceoChatFloat .acw-panel.hidden { display: none; }
#ceoChatFloat .acw-panel.acw-panel--open { opacity: 1; transform: none; }
.dark #ceoChatFloat .acw-panel {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 28px 70px -24px rgba(0, 0, 0, 0.75);
}

#ceoChatFloat .acw-backdrop { display: none; }

/* Header */
#ceoChatFloat .acw-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.75rem 0.75rem 1rem;
  border-bottom: 1px solid var(--brand-border);
  background: color-mix(in srgb, var(--acw-surface) 85%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dark #ceoChatFloat .acw-header { border-bottom-color: rgba(255, 255, 255, 0.1); }
#ceoChatFloat .acw-header > .min-w-0 { margin-left: 0.25rem; }
#ceoChatFloat .acw-avatar { box-shadow: 0 0 0 2px var(--acw-surface), 0 0 0 4px var(--acw-accent-ring); }
#ceoChatFloat .acw-online-dot { border: 2px solid var(--acw-surface); }
#ceoChatFloat .acw-icon-btn {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--brand-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
#ceoChatFloat .acw-icon-btn[hidden] { display: none; }
#ceoChatFloat .acw-icon-btn:hover:not(:disabled) { background: var(--brand-cream); color: var(--brand-dark); }
.dark #ceoChatFloat .acw-icon-btn { color: #94a3b8; }
.dark #ceoChatFloat .acw-icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }
#ceoChatFloat .acw-icon-btn:disabled { opacity: 0.45; cursor: not-allowed; }
#ceoChatFloat .acw-full-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.25rem;
  padding: 0 0.8rem;
  border-radius: 9999px;
  border: 1px solid var(--brand-border);
  background: var(--acw-surface);
  color: var(--brand-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
#ceoChatFloat .acw-full-link:hover { border-color: var(--acw-accent-line); background: var(--acw-accent-soft); }
.dark #ceoChatFloat .acw-full-link { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: #fff; }
#ceoChatFloat .acw-icon-btn:focus-visible,
#ceoChatFloat .acw-full-link:focus-visible,
#ceoChatFloat .acw-fab:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--acw-accent-ring); }

/* Thread */
#ceoChatFloat .acw-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
}
#ceoChatFloat .acw-empty { position: relative; padding: 0.75rem 0.25rem 0.25rem; text-align: center; }
#ceoChatFloat .acw-empty[hidden],
#ceoChatFloat .acw-list[hidden] { display: none; }
#ceoChatFloat .acw-empty-glow {
  position: absolute;
  left: 50%;
  top: -3rem;
  width: 120%;
  height: 14rem;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-yellow) 22%, transparent), transparent);
  pointer-events: none;
}
#ceoChatFloat .acw-hero-avatar {
  box-shadow: 0 0 0 3px var(--acw-surface), 0 0 0 8px var(--acw-accent-ring), 0 16px 40px -12px color-mix(in srgb, var(--brand-yellow) 60%, transparent);
}
#ceoChatFloat .acw-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.5rem 0.875rem 0.5rem 0.5rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  background: var(--acw-surface);
  color: var(--brand-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dark #ceoChatFloat .acw-chip { border-color: rgba(255, 255, 255, 0.1); color: #f1f5f9; }
#ceoChatFloat .acw-chip:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--acw-accent-line); box-shadow: 0 12px 24px -16px rgba(17, 24, 39, 0.3); }
#ceoChatFloat .acw-chip:focus-visible { outline: none; border-color: var(--acw-accent-line); box-shadow: 0 0 0 4px var(--acw-accent-ring); }
#ceoChatFloat .acw-chip:disabled { opacity: 0.55; cursor: not-allowed; }
#ceoChatFloat .acw-chip-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--acw-accent-soft);
  color: var(--acw-accent-ink);
}

/* Messages */
#ceoChatFloat .acw-list { display: flex; flex-direction: column; gap: 1.1rem; }
#ceoChatFloat .acw-msg-user { display: flex; justify-content: flex-end; }
#ceoChatFloat .acw-bubble-user {
  max-width: 85%;
  padding: 0.55rem 0.95rem;
  border-radius: 1.35rem;
  background: var(--brand-yellow);
  color: var(--brand-on-accent, #111827);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
}
#ceoChatFloat .acw-msg-assistant { display: flex; align-items: flex-start; gap: 0.625rem; }
#ceoChatFloat .acw-md,
#ceoChatFloat .acw-error { min-width: 0; flex: 1 1 auto; font-size: 0.875rem; line-height: 1.6; overflow-wrap: anywhere; }
#ceoChatFloat .acw-md { padding-top: 0.2rem; color: var(--brand-dark); }
.dark #ceoChatFloat .acw-md { color: #f1f5f9; }
#ceoChatFloat .acw-md a {
  color: var(--acw-accent-ink);
  text-decoration-color: var(--acw-accent-line);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
#ceoChatFloat .acw-md a:hover { text-decoration-color: var(--brand-yellow); }
#ceoChatFloat .acw-md code { background: rgba(15, 23, 42, 0.06); border-radius: 0.4rem; }
.dark #ceoChatFloat .acw-md code { background: rgba(255, 255, 255, 0.1); }
#ceoChatFloat .acw-md pre { background: #0f172a; color: #e2e8f0; border-radius: 0.9rem; }
#ceoChatFloat .acw-md pre code { background: none; }
#ceoChatFloat .acw-md li::marker { color: var(--brand-muted); }
#ceoChatFloat .acw-error {
  padding: 0.6rem 0.9rem;
  border: 1px solid #fecaca;
  border-radius: 1.1rem;
  background: #fef2f2;
  color: #b91c1c;
}
.dark #ceoChatFloat .acw-error { border-color: rgba(239, 68, 68, 0.3); background: rgba(69, 10, 10, 0.3); color: #fca5a5; }

#ceoChatFloat .acw-typing { display: flex; align-items: center; gap: 0.625rem; padding-top: 1.1rem; }
#ceoChatFloat .acw-typing.hidden { display: none; }
#ceoChatFloat .acw-typing-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--brand-border);
  border-radius: 9999px;
  background: var(--acw-surface);
  color: var(--brand-muted);
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05);
}
.dark #ceoChatFloat .acw-typing-pill { border-color: rgba(255, 255, 255, 0.1); background: #1e293b; color: #94a3b8; }
#ceoChatFloat .acw-dot { width: 6px; height: 6px; border-radius: 9999px; background: currentColor; animation: acwDot 1.2s ease-in-out infinite; }
#ceoChatFloat .acw-dot:nth-child(2) { animation-delay: 0.15s; }
#ceoChatFloat .acw-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes acwDot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* Composer */
#ceoChatFloat .acw-composer-wrap { flex-shrink: 0; padding: 0.5rem 0.75rem 0.75rem; }
#ceoChatFloat .acw-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  padding: 0.3rem 0.3rem 0.3rem 1rem;
  border: 1px solid var(--brand-border);
  border-radius: 1.5rem;
  background: var(--acw-surface);
  box-shadow: var(--acw-shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dark #ceoChatFloat .acw-composer { border-color: rgba(255, 255, 255, 0.1); background: rgba(30, 41, 59, 0.9); }
#ceoChatFloat .acw-composer:focus-within { border-color: var(--acw-accent-line); box-shadow: 0 0 0 4px var(--acw-accent-ring), var(--acw-shadow-soft); }
#ceoChatFloat .acw-input {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  max-height: 8rem;
  resize: none;
  border: 0;
  background: transparent;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--brand-dark);
}
.dark #ceoChatFloat .acw-input { color: #fff; }
#ceoChatFloat .acw-input::placeholder { color: var(--brand-muted); font-weight: 400; }
#ceoChatFloat .acw-input:focus { outline: none; box-shadow: none; }
#ceoChatFloat .acw-mic,
#ceoChatFloat .acw-send { flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: 9999px; }
#ceoChatFloat .acw-mic { color: var(--brand-muted); }
#ceoChatFloat .acw-mic:hover { color: var(--brand-dark); background: var(--brand-cream); }
.dark #ceoChatFloat .acw-mic { color: #cbd5e1; }
.dark #ceoChatFloat .acw-mic:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
#ceoChatFloat .acw-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.1);
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
#ceoChatFloat .acw-send:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* Floating button */
#ceoChatFloat .acw-fab {
  position: relative;
  flex-shrink: 0;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-yellow);
  color: var(--brand-on-accent, #111827);
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.12), 0 12px 28px -10px color-mix(in srgb, var(--brand-yellow) 70%, transparent);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
#ceoChatFloat .acw-fab:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(17, 24, 39, 0.14), 0 18px 34px -12px color-mix(in srgb, var(--brand-yellow) 80%, transparent); }
#ceoChatFloat .acw-fab:active { transform: scale(0.96); }
#ceoChatFloat .acw-fab-icon {
  position: absolute;
  width: 1.625rem;
  height: 1.625rem;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#ceoChatFloat .acw-fab-icon--close { opacity: 0; transform: rotate(-90deg) scale(0.6); }
#ceoChatFloat.acw--open .acw-fab-icon:not(.acw-fab-icon--close) { opacity: 0; transform: rotate(90deg) scale(0.6); }
#ceoChatFloat.acw--open .acw-fab-icon--close { opacity: 1; transform: none; }
#ceoChatFloat .acw-fab-dot {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  width: 0.875rem;
  height: 0.875rem;
  border-radius: 9999px;
  background: #ef4444;
  border: 2px solid var(--brand-bg, #fff);
}
#ceoChatFloat .acw-fab-dot.hidden { display: none; }

/* Phone: near-full-screen sheet inside the visual viewport (keyboard-aware via --acw-vvh). */
@media (max-width: 640px) {
  html.acw-open, html.acw-open body { overflow: hidden; }
  #ceoChatFloat .acw-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .dark #ceoChatFloat .acw-backdrop:not([hidden]) { background: rgba(0, 0, 0, 0.6); }
  #ceoChatFloat .acw-panel {
    position: fixed;
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    top: calc(var(--acw-vv-top, 0px) + max(0.5rem, env(safe-area-inset-top, 0px)));
    width: auto;
    height: calc(var(--acw-vvh, 100dvh) - max(0.5rem, env(safe-area-inset-top, 0px)) - max(0.5rem, env(safe-area-inset-bottom, 0px)));
    border-radius: 1.5rem;
    transform-origin: bottom center;
    transform: translateY(24px);
  }
  #ceoChatFloat .acw-header { padding: 0.5rem 0.5rem 0.5rem 0.75rem; }
  #ceoChatFloat .acw-icon-btn,
  #ceoChatFloat .acw-full-link { height: 2.75rem; }
  #ceoChatFloat .acw-icon-btn { width: 2.75rem; }
  #ceoChatFloat .acw-chip { min-height: 3.25rem; font-size: 0.875rem; }
  #ceoChatFloat .acw-md,
  #ceoChatFloat .acw-error,
  #ceoChatFloat .acw-bubble-user { font-size: 0.9375rem; }
  #ceoChatFloat .acw-input { font-size: 16px; }
  #ceoChatFloat .acw-mic,
  #ceoChatFloat .acw-send { width: 2.75rem; height: 2.75rem; }
  #ceoChatFloat.acw--open .acw-fab { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #ceoChatFloat .acw-panel,
  #ceoChatFloat .acw-fab,
  #ceoChatFloat .acw-fab-icon,
  #ceoChatFloat .acw-chip { transition: opacity 0.15s ease; }
  #ceoChatFloat .acw-panel,
  #ceoChatFloat .acw-fab-icon,
  #ceoChatFloat.acw--open .acw-fab-icon:not(.acw-fab-icon--close),
  #ceoChatFloat .acw-fab-icon--close { transform: none; }
  #ceoChatFloat .acw-chip:hover:not(:disabled),
  #ceoChatFloat .acw-fab:hover { transform: none; }
  #ceoChatFloat .acw-dot { animation-duration: 2.4s; }
}
