/* Lead CRM look & feel — layered on top of Filament's compiled styles. */
:root { --crm-radius: 16px; --crm-ink: #0f172a; --crm-muted: #64748b; --crm-line: rgba(15, 23, 42, .07); --crm-accent: #4f46e5; }

/* ---- canvas ---- */
html:not(.dark) body.fi-body { background: #f4f5fb; }
html:not(.dark) .fi-layout { background:
    radial-gradient(900px 420px at 100% -10%, rgba(79, 70, 229, .09), transparent 60%),
    radial-gradient(700px 380px at 20% -20%, rgba(14, 165, 233, .07), transparent 60%); }
.fi-header-heading { letter-spacing: -.025em; font-weight: 800 !important; }
.fi-main { padding-bottom: 3rem; }

/* ---- sidebar ---- */
html:not(.dark) .fi-sidebar { background: #fff; border-right: 1px solid var(--crm-line); }
html:not(.dark) .fi-sidebar-header { background: #fff !important; box-shadow: none !important; border-bottom: 1px solid var(--crm-line); }
.fi-sidebar-header .fi-logo { font-weight: 800; letter-spacing: -.03em; font-size: 1.15rem; display: flex; align-items: center; gap: .6rem; }
.fi-logo::before { content: ""; width: 1.75rem; height: 1.75rem; border-radius: .6rem; flex: none;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9); box-shadow: 0 6px 14px -4px rgba(79, 70, 229, .55); }
.fi-sidebar-item-button { border-radius: 12px !important; padding-block: .6rem !important; transition: background .15s, transform .15s; }
.fi-sidebar-item-button:hover { transform: translateX(2px); }
html:not(.dark) .fi-sidebar-item-active > .fi-sidebar-item-button { background: linear-gradient(90deg, rgba(79, 70, 229, .12), rgba(79, 70, 229, .04)) !important; }
.fi-sidebar-item-active .fi-sidebar-item-label { font-weight: 700 !important; }
.fi-sidebar-group-label { text-transform: uppercase; font-size: .68rem !important; letter-spacing: .09em; color: var(--crm-muted) !important; }

/* ---- topbar ---- */
html:not(.dark) .fi-topbar > nav { background: rgba(255, 255, 255, .78) !important; backdrop-filter: blur(12px); box-shadow: none !important; border-bottom: 1px solid var(--crm-line); }

/* ---- cards, tables, sections ---- */
.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat, .fi-wi-chart > .fi-section { border-radius: var(--crm-radius) !important; }
html:not(.dark) .fi-section, html:not(.dark) .fi-ta-ctn, html:not(.dark) .fi-wi-stats-overview-stat {
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -18px rgba(15, 23, 42, .18) !important; --tw-ring-color: var(--crm-line) !important; }
.fi-ta-ctn { overflow: hidden; }
html:not(.dark) .fi-ta-header-cell { background: #fafbff; }
.fi-ta-header-cell-label { text-transform: uppercase; font-size: .68rem !important; letter-spacing: .07em; color: var(--crm-muted) !important; }
html:not(.dark) .fi-ta-row:hover { background: #f8f9ff !important; }
.fi-badge { border-radius: 999px !important; font-weight: 600; }
.fi-btn { border-radius: 11px !important; font-weight: 600 !important; }
.fi-btn.fi-color-primary:not(.fi-btn-outlined) { box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .7) !important; }
.fi-input-wrp, .fi-select-input, .fi-fo-rich-editor { border-radius: 11px !important; }
.fi-modal-window { border-radius: 20px !important; }
.fi-tabs { border-radius: 14px !important; }
.fi-tabs-item { border-radius: 10px !important; }

/* ---- stats ---- */
.fi-wi-stats-overview-stat { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.fi-wi-stats-overview-stat:hover { transform: translateY(-2px); }
.fi-wi-stats-overview-stat-value { font-weight: 800 !important; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.fi-wi-stats-overview-stat-label { font-weight: 600 !important; }

/* ---- login ---- */
html:not(.dark) .fi-simple-layout { background:
    radial-gradient(800px 500px at 15% 10%, rgba(79, 70, 229, .22), transparent 60%),
    radial-gradient(700px 500px at 90% 90%, rgba(14, 165, 233, .2), transparent 60%), #eef0fb; }
.fi-simple-main { border-radius: 24px !important; box-shadow: 0 30px 70px -30px rgba(30, 27, 75, .45) !important; }
.fi-simple-header .fi-logo { justify-content: center; font-size: 1.4rem; font-weight: 800; }

/* ---- reports + custom views ---- */
.crm-stack { display: grid; gap: 1.5rem; }
.crm-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.crm-presets { display: flex; flex-wrap: wrap; gap: .4rem; }
.crm-chip { padding: .45rem .9rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #fff; color: var(--crm-ink);
    border: 1px solid var(--crm-line); transition: all .15s; }
.crm-chip:hover { border-color: var(--crm-accent); color: var(--crm-accent); }
.crm-dates { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--crm-muted); }
.crm-input { border-radius: 11px; border: 1px solid var(--crm-line); padding: .45rem .7rem; font-size: .85rem; background: #fff; color: var(--crm-ink); }
.crm-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; transition: opacity .15s; }
.crm-loading { opacity: .5; }
.crm-card { background: #fff; border: 1px solid var(--crm-line); border-radius: var(--crm-radius); padding: 1rem 1.1rem;
    box-shadow: 0 12px 32px -20px rgba(15, 23, 42, .2); }
.crm-card-label { font-size: .75rem; font-weight: 600; color: var(--crm-muted); }
.crm-card-value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; color: var(--crm-ink); font-variant-numeric: tabular-nums; margin-top: .15rem; }
.crm-grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.crm-table-wrap { overflow-x: auto; margin: -.25rem; }
.crm-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.crm-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--crm-muted); padding: .55rem .75rem; white-space: nowrap; }
.crm-table td { padding: .65rem .75rem; border-top: 1px solid var(--crm-line); font-variant-numeric: tabular-nums; }
.crm-table td small { color: var(--crm-muted); margin-left: .35rem; }
.crm-empty { text-align: center; color: var(--crm-muted); padding: 1.5rem !important; }
.crm-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .5rem; }
.crm-bar-row { display: grid; grid-template-columns: 9rem 1fr 2.5rem; align-items: center; gap: .75rem; padding: .4rem 0; font-size: .875rem; }
.crm-bar { height: .6rem; background: rgba(100, 116, 139, .14); border-radius: 999px; overflow: hidden; }
.crm-bar > span { display: block; height: 100%; border-radius: 999px; min-width: 2px; }
.crm-bar-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.crm-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: rgba(79, 70, 229, .08); color: #3730a3;
    padding: .25rem .5rem; border-radius: 8px; word-break: break-all; user-select: all; }
.crm-setup { display: grid; gap: .6rem; font-size: .875rem; line-height: 1.55; }
.crm-setup h4 { font-weight: 700; margin-top: .6rem; }
.crm-setup code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.crm-pre { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: .9rem 1rem; font-size: .78rem; line-height: 1.5; overflow-x: auto;
    white-space: pre; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }

.dark .crm-chip, .dark .crm-input, .dark .crm-card { background: rgba(255, 255, 255, .05); color: #e5e7eb; border-color: rgba(255, 255, 255, .1); }
.dark .crm-card-value { color: #fff; }
.dark .crm-table td { border-color: rgba(255, 255, 255, .08); }
.dark .crm-code { background: rgba(129, 140, 248, .15); color: #c7d2fe; }
@media (max-width: 900px) { .crm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .crm-bar-row { grid-template-columns: 6rem 1fr 2rem; } }

/* ---- dashboard hero ---- */
.crm-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between;
    padding: 1.75rem 2rem; border-radius: 24px; color: #fff;
    background: radial-gradient(600px 300px at 95% -20%, rgba(56, 189, 248, .55), transparent 60%),
        radial-gradient(500px 300px at -5% 120%, rgba(236, 72, 153, .35), transparent 60%), linear-gradient(120deg, #4338ca, #6d28d9);
    box-shadow: 0 24px 50px -24px rgba(67, 56, 202, .7); }
.crm-hero-date { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.crm-hero-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; margin: .25rem 0 .35rem; }
.crm-hero-sub { font-size: .95rem; opacity: .9; max-width: 34rem; line-height: 1.5; }
.crm-hero-chips { display: grid; grid-template-columns: repeat(3, minmax(6.5rem, 1fr)); gap: .6rem; }
.crm-hero-chip { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; align-items: center; padding: .7rem .9rem; border-radius: 16px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(8px); }
.crm-hero-chip svg { opacity: .85; grid-row: span 2; }
.crm-hero-num { font-size: 1.35rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.crm-hero-label { font-size: .72rem; font-weight: 600; opacity: .85; white-space: nowrap; }
@media (max-width: 640px) { .crm-hero { padding: 1.25rem; } .crm-hero-chips { width: 100%; grid-template-columns: repeat(2, 1fr); } }

/* ---- small pieces ---- */
.crm-theme { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 999px; color: var(--crm-muted); transition: background .15s, color .15s; }
.crm-theme:hover { background: rgba(100, 116, 139, .14); color: var(--crm-accent); }
.crm-theme svg { width: 1.25rem; height: 1.25rem; }
.crm-theme .crm-sun, .dark .crm-theme .crm-moon { display: none; }
.dark .crm-theme .crm-sun { display: block; }
.dark .crm-theme { color: #cbd5e1; }
.crm-chip-on { background: var(--crm-accent) !important; color: #fff !important; border-color: var(--crm-accent) !important; }
.crm-avatar { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-right: .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
    color: #fff; background: linear-gradient(135deg, #6366f1, #0ea5e9); }
.crm-pill { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: rgba(100, 116, 139, .16); color: var(--crm-muted); }
.crm-pill-ok { background: rgba(16, 185, 129, .16); color: #047857; }
.crm-pill-bad { background: rgba(239, 68, 68, .14); color: #b91c1c; }
.dark .crm-pill-ok { color: #6ee7b7; } .dark .crm-pill-bad { color: #fca5a5; }
.crm-muted { color: var(--crm-muted); font-size: .875rem; }

/* ---- projects ---- */
.crm-cover { width: 100% !important; object-fit: cover; border-radius: 12px; }
.crm-project { display: grid; gap: 1.5rem; }
.crm-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.crm-gallery a { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: rgba(100, 116, 139, .12); }
.crm-gallery-main { grid-column: span 4; aspect-ratio: 16 / 8 !important; }
.crm-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.crm-gallery a:hover img { transform: scale(1.03); }
.crm-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.crm-fact-wide { grid-column: 1 / -1; }
.crm-facts dt, .crm-sub { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--crm-muted); margin-bottom: .2rem; }
.crm-facts dd { font-size: .92rem; overflow-wrap: anywhere; }
.crm-facts a { color: var(--crm-accent); font-weight: 600; }
.crm-sub { margin-bottom: .6rem; }
.crm-doc { display: flex; align-items: center; gap: .6rem; padding: .65rem .85rem; margin-bottom: .45rem; border-radius: 12px; border: 1px solid var(--crm-line);
    font-size: .875rem; font-weight: 600; transition: border-color .15s, color .15s; }
.crm-doc span { flex: 1; overflow-wrap: anywhere; }
.crm-doc:hover { border-color: var(--crm-accent); color: var(--crm-accent); }
.crm-person { display: inline-block; margin: 0 .35rem .35rem 0; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: rgba(79, 70, 229, .1); color: #4338ca; }
.dark .crm-doc { border-color: rgba(255, 255, 255, .12); } .dark .crm-person { background: rgba(129, 140, 248, .18); color: #c7d2fe; }
.dark .crm-facts a { color: #a5b4fc; }

/* ---- dark theme polish ---- */
.dark body.fi-body { background: #0b0f1a; }
.dark .fi-layout { background: radial-gradient(900px 420px at 100% -10%, rgba(99, 102, 241, .16), transparent 60%), radial-gradient(700px 380px at 15% -20%, rgba(14, 165, 233, .1), transparent 60%); }
.dark .fi-sidebar, .dark .fi-sidebar-header { background: #0d1220 !important; }
.dark .fi-sidebar { border-right: 1px solid rgba(255, 255, 255, .06); }
.dark .fi-topbar > nav { background: rgba(11, 15, 26, .8) !important; backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.dark .fi-section, .dark .fi-ta-ctn, .dark .fi-wi-stats-overview-stat { background: #121829 !important; --tw-ring-color: rgba(255, 255, 255, .07) !important; }
.dark .fi-sidebar-item-active > .fi-sidebar-item-button { background: linear-gradient(90deg, rgba(129, 140, 248, .22), rgba(129, 140, 248, .05)) !important; }

/* ---- project cards ---- */
.crm-pcard { width: 100%; }
.crm-pcard-cover { position: relative; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, rgba(99, 102, 241, .22), rgba(14, 165, 233, .18)); }
.crm-pcard-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.fi-ta-record:hover .crm-pcard-cover img { transform: scale(1.04); }
.crm-pcard-empty { display: grid; place-items: center; height: 100%; color: #6366f1; opacity: .7; }
.crm-pcard-status, .crm-pcard-live { position: absolute; top: .6rem; padding: .22rem .7rem; border-radius: 999px; font-size: .7rem; font-weight: 700; backdrop-filter: blur(8px); }
.crm-pcard-status { left: .6rem; background: rgba(15, 23, 42, .68); color: #fff; }
.crm-pcard-live { right: .6rem; background: rgba(16, 185, 129, .92); color: #fff; }
.crm-pcard-body { padding: .85rem .15rem 0; }
.crm-pcard-title { font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.crm-pcard-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem; margin-top: .65rem; }
.crm-pcard-facts dt { font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--crm-muted); }
.crm-pcard-facts dd { font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.crm-pcard-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .8rem; padding-top: .7rem;
    border-top: 1px solid var(--crm-line); font-size: .75rem; color: var(--crm-muted); }
.dark .crm-pcard-foot { border-color: rgba(255, 255, 255, .08); }
.crm-avatar-sm { width: 1.5rem; height: 1.5rem; font-size: .65rem; margin: 0 0 0 -.35rem; border: 2px solid #fff; }
.dark .crm-avatar-sm { border-color: #121829; }
.fi-ta-content-grid .fi-ta-record { border-radius: 18px !important; transition: transform .18s, box-shadow .18s; }
.fi-ta-content-grid .fi-ta-record:hover { transform: translateY(-2px); }
.fi-ta-content-grid .fi-ta-actions { flex-wrap: wrap; row-gap: .4rem; }

/* ---- project table cards ---- */
.crm-tcard { display: flex; align-items: flex-start; gap: .9rem; width: 100%; }
.crm-tcard-icon { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 14px; color: #fff;
    background: linear-gradient(135deg, #4f46e5, #0ea5e9); box-shadow: 0 10px 20px -10px rgba(79, 70, 229, .8); }
.crm-tcard-main { flex: 1; min-width: 0; }
.crm-tcard-cols { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.crm-tcard-cols span { padding: .15rem .6rem; border-radius: 999px; font-size: .7rem; font-weight: 600; background: rgba(100, 116, 139, .13); color: var(--crm-muted); }
.crm-tcard-go { flex: none; color: var(--crm-muted); margin-top: .9rem; transition: transform .15s, color .15s; }
.fi-ta-record:hover .crm-tcard-go { transform: translateX(3px); color: var(--crm-accent); }

/* ---- gallery lightbox + share bar ---- */
.crm-gallery button { display: block; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: rgba(100, 116, 139, .12); cursor: zoom-in; }
.crm-gallery button:hover img { transform: scale(1.03); }
.crm-lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(2, 6, 23, .93); }
.crm-lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 12px; }
.crm-lb-btn { position: absolute; width: 2.9rem; height: 2.9rem; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.6rem; line-height: 1; }
.crm-lb-btn:hover { background: rgba(255, 255, 255, .26); }
.crm-lb-prev { left: .75rem; top: 50%; } .crm-lb-next { right: .75rem; top: 50%; } .crm-lb-close { right: 1rem; top: 1rem; }
.crm-lb-count { position: absolute; bottom: 1.1rem; color: #cbd5e1; font-size: .8rem; }
.crm-sharebar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 14px; background: rgba(16, 185, 129, .08); border: 1px solid rgba(16, 185, 129, .25); }
.crm-sharebar .crm-code { flex: 1; min-width: 12rem; }
.crm-link { font-size: .8rem; font-weight: 700; color: var(--crm-accent); white-space: nowrap; }
.dark .crm-link { color: #a5b4fc; }
[x-cloak] { display: none !important; }

/* ---- mobile ---- */
@media (max-width: 640px) {
    .fi-header { gap: .75rem !important; }
    .fi-header-heading { font-size: 1.4rem !important; }
    .fi-ac { flex-wrap: wrap; gap: .5rem !important; }
    .fi-ac .fi-btn { flex: 1 1 auto; }
    .crm-facts { grid-template-columns: 1fr; }
    .crm-gallery { grid-template-columns: repeat(2, 1fr); } .crm-gallery-main { grid-column: span 2; }
    .crm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crm-hero-title { font-size: 1.45rem; }
    .crm-sharebar .crm-code { min-width: 100%; }
}

/* ---- AI coach on the dashboard ---- */
.crm-coach { display: flex; gap: .65rem; align-items: flex-start; margin-top: 1rem; padding: .8rem 1rem; max-width: 38rem; border-radius: 16px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px); }
.crm-coach-icon { flex: none; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 999px; background: #fff; color: #6d28d9; }
.crm-coach-text { font-size: .92rem; font-weight: 600; line-height: 1.45; }
.crm-coach-wait { opacity: .75; animation: crm-pulse 1.2s ease-in-out infinite; }
.crm-coach-calls { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .55rem; font-size: .78rem; }
.crm-coach-calls span { opacity: .8; font-weight: 600; }
.crm-coach-calls a { padding: .2rem .65rem; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #312e81; font-weight: 700; }
.crm-coach-calls a b { margin-left: .3rem; padding: 0 .35rem; border-radius: 999px; background: #10b981; color: #fff; font-size: .68rem; }
.crm-coach-calls a.crm-coach-all { background: transparent; color: #fff; text-decoration: underline; padding-inline: .2rem; }
@keyframes crm-pulse { 50% { opacity: .4; } }

/* ---- AI assistant chat ---- */
.crm-chat { display: flex; flex-direction: column; height: calc(100dvh - 13rem); min-height: 26rem; border-radius: 22px; overflow: hidden;
    background: #fff; border: 1px solid var(--crm-line); box-shadow: 0 12px 32px -18px rgba(15, 23, 42, .18); }
.dark .crm-chat { background: #121829; border-color: rgba(255, 255, 255, .07); }
.crm-chat-log { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.crm-chat-empty { margin: auto; text-align: center; max-width: 40rem; }
.crm-chat-empty h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; margin: 1rem 0 .3rem; }
.crm-chat-empty p { color: var(--crm-muted); font-size: .92rem; }
.crm-chat-orb { display: inline-grid; place-items: center; width: 4rem; height: 4rem; border-radius: 1.4rem; color: #fff;
    background: linear-gradient(135deg, #4f46e5, #a855f7 55%, #0ea5e9); box-shadow: 0 18px 36px -14px rgba(109, 40, 217, .8); }
.crm-chat-suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 1.4rem; }
.crm-chat-suggest button { padding: .55rem .95rem; border-radius: 999px; font-size: .82rem; font-weight: 600; border: 1px solid var(--crm-line); transition: all .15s; text-align: left; }
.crm-chat-suggest button:hover { border-color: var(--crm-accent); color: var(--crm-accent); transform: translateY(-1px); }
.dark .crm-chat-suggest button { border-color: rgba(255, 255, 255, .14); }
.crm-msg { display: flex; gap: .6rem; align-items: flex-start; max-width: min(100%, 52rem); }
.crm-msg-me { align-self: flex-end; }
.crm-msg-ai { flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 999px; color: #fff; background: linear-gradient(135deg, #4f46e5, #a855f7); }
.crm-bubble { padding: .7rem 1rem; border-radius: 18px; font-size: .92rem; line-height: 1.55; background: rgba(100, 116, 139, .1); overflow-wrap: anywhere; min-width: 0; }
.crm-msg-me .crm-bubble { background: linear-gradient(120deg, #4f46e5, #6d28d9); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.crm-msg:not(.crm-msg-me) .crm-bubble { border-top-left-radius: 6px; }
.crm-prose > * + * { margin-top: .6rem; }
.crm-prose ul, .crm-prose ol { padding-left: 1.2rem; list-style: disc; } .crm-prose ol { list-style: decimal; }
.crm-prose strong { font-weight: 700; } .crm-prose code { font-size: .82em; padding: .1rem .3rem; border-radius: 6px; background: rgba(100, 116, 139, .18); }
.crm-prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.crm-prose th, .crm-prose td { padding: .4rem .7rem; border-bottom: 1px solid var(--crm-line); text-align: left; white-space: nowrap; }
.dark .crm-prose th, .dark .crm-prose td { border-color: rgba(255, 255, 255, .1); }
.crm-prose th { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--crm-muted); }
.crm-typing { display: flex; gap: .3rem; padding: .95rem 1rem; }
.crm-typing i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--crm-muted); animation: crm-bounce 1s infinite; }
.crm-typing i:nth-child(2) { animation-delay: .15s; } .crm-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes crm-bounce { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.crm-chat-bar { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-top: 1px solid var(--crm-line); }
.dark .crm-chat-bar { border-color: rgba(255, 255, 255, .08); }
.crm-chat-bar input { flex: 1; min-width: 0; padding: .8rem 1.1rem; border-radius: 999px; border: 1px solid var(--crm-line); background: rgba(100, 116, 139, .07); font-size: .95rem; color: inherit; }
.crm-chat-bar input:focus { outline: 2px solid var(--crm-accent); outline-offset: 1px; border-color: transparent; box-shadow: none; }
.dark .crm-chat-bar input { border-color: rgba(255, 255, 255, .12); }
.crm-chat-send { flex: none; display: grid; place-items: center; width: 2.9rem; height: 2.9rem; border-radius: 999px; color: #fff;
    background: linear-gradient(120deg, #4f46e5, #6d28d9); box-shadow: 0 10px 20px -10px rgba(79, 70, 229, .9); transition: transform .15s; }
.crm-chat-send:hover:not(:disabled) { transform: scale(1.06); }
.crm-chat-send:disabled, .crm-chat-bar input:disabled { opacity: .5; cursor: not-allowed; }
.crm-chat-clear { font-size: .78rem; font-weight: 700; color: var(--crm-muted); white-space: nowrap; }
.crm-chat-clear:hover { color: var(--crm-accent); }
.crm-advice { display: grid; gap: 1.1rem; font-size: .92rem; line-height: 1.55; }
.crm-advice-next { padding: .85rem 1rem; border-radius: 14px; background: rgba(79, 70, 229, .08); border: 1px solid rgba(79, 70, 229, .2); }
.crm-advice-msg { padding: .85rem 1rem; border-radius: 14px; background: rgba(16, 185, 129, .09); white-space: pre-line; }
.crm-advice-actions { display: flex; gap: 1rem; margin-top: .5rem; }
@media (max-width: 640px) { .crm-chat { height: calc(100dvh - 11rem); border-radius: 16px; } .crm-chat-log { padding: 1rem; } .crm-chat-clear { display: none; } }
@media (prefers-reduced-motion: reduce) { .crm-typing i, .crm-coach-wait { animation: none; } }
