:root {
    --ai-bg: #f4f5f1;
    --ai-surface: #fff;
    --ai-border: #e1e6e2;
    --ai-primary: #17695d;
    --ai-text: #192e35;
    --ai-muted: #60716f;
    --ai-radius: 18px;
    --bs-primary: #17695d;
    --bs-primary-rgb: 23, 105, 93;
    --bs-link-color: #17695d;
    --bs-link-color-rgb: 23, 105, 93;
    --bs-link-hover-color-rgb: 13, 76, 67;
    --bs-link-hover-color: #0d4c43;
    --bs-body-color: #192e35;
    --bs-body-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { min-height: 100vh; background: var(--ai-bg); color: var(--ai-text); font-size: .925rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .h3, .h4, .h5 { letter-spacing: -.025em; }
h1.h3 { font-size: clamp(1.65rem, 2.4vw, 2.2rem); font-weight: 650; }
h2.h5 { font-size: 1.05rem; font-weight: 650; }
.ui-icon { width: 20px; height: 20px; flex-shrink: 0; }
.app-topbar { min-height: 78px; background: #fff; border-bottom: 1px solid var(--ai-border); }
.app-topbar > .container-fluid { padding-inline: 28px !important; }
.navbar-brand { display: inline-flex; align-items: center; gap: 11px; margin-right: 36px; color: var(--ai-text); }
.brand-wordmark { display: flex; flex-direction: column; font-size: 1.15rem; letter-spacing: -.045em; font-weight: 750; line-height: 1; }
.brand-wordmark > span { font-size: .71rem; font-weight: 500; letter-spacing: .2em; margin-top: 5px; }
.brand-symbol { display: flex; align-items: center; justify-content: center; gap: 3px; width: 38px; height: 38px; background: var(--ai-primary); border-radius: 12px 12px 12px 3px; transform: rotate(-4deg); }
.brand-symbol i { width: 3px; height: 12px; background: #d8efac; border-radius: 5px; }
.brand-symbol i:nth-child(2) { height: 23px; }
.brand-symbol i:nth-child(3) { height: 17px; }
.brand-symbol i:nth-child(4) { height: 8px; }
.topbar-section { border-left: 1px solid var(--ai-border); padding-left: 28px; font-size: .8rem; color: var(--ai-muted); }
.user-menu { font-size: .8rem; }
.user-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #e9efde; color: #385043; font-weight: 700; }
.workspace-container { padding: 0; }
.app-shell { display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.sidebar { background: #172f36 !important; color: #e7f0eb; padding: 24px 15px; border: 0; }
.sidebar .offcanvas-body { min-height: calc(100vh - 126px); }
.tenant-box { margin: 0 0 8px; padding: 16px; background: #ffffff07; border: 1px solid #ffffff16; border-radius: 12px; overflow-wrap: anywhere; }
.workspace-label { font-size: .62rem; text-transform: uppercase; letter-spacing: .14em; color: #a0b6b9; }
.tenant-box .fw-semibold { font-size: .84rem; line-height: 1.45; }
.nav-group-label { padding: 24px 14px 9px; font-size: .62rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: #9cb3b8; }
.sidebar .nav-link { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin: 2px 0; font-size: .83rem; border-radius: 9px; color: #c0d0d2; transition: color .15s, background .15s; }
.sidebar .nav-link:hover { background: #ffffff0d; color: white; }
.sidebar .nav-link.active { background: #ddefbf; color: #1c3934; font-weight: 650; }
.sidebar-note { margin: auto 12px 0; padding-top: 52px; }
.sidebar-note-mark { display: block; color: #ddefbf; font-size: 1.5rem; margin-bottom: 9px; }
.sidebar-note p { font-size: 1rem; line-height: 1.45; color: #d3e1df; font-weight: 300; }
.sidebar-note strong { font-weight: 600; }
.sidebar-note small { display: block; color: #99b0b5; font-size: .7rem; line-height: 1.6; max-width: 150px; }
.main-panel { min-width: 0; padding: 28px 32px 48px; max-width: 1680px; width: 100%; margin-inline: auto; }
.card, .dashboard-card, .summary-card, .section-card, .insight-card {
    background: var(--ai-surface); border: 1px solid var(--ai-border) !important;
    border-radius: var(--ai-radius); box-shadow: 0 3px 6px #203b3203, 0 14px 32px #203b3203 !important;
}
.card-body { padding: 24px; }
.card .card { box-shadow: none !important; }
.main-panel > .card:first-child:not(.coverage-card) { border-top: 3px solid #aac9ba !important; }
.main-panel .text-uppercase.small { font-size: .66rem !important; letter-spacing: .14em; font-weight: 650; }
.dashboard-hero { position: relative; overflow: hidden; background: #e9eee4; border-color: #dfe5d9 !important; }
.dashboard-hero::after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid #adc0aa; border-radius: 50%; right: 70px; top: -180px; box-shadow: 0 0 0 26px #ffffff20, 0 0 0 27px #bacbb255, 0 0 0 53px #ffffff10, 0 0 0 54px #bacbb244; pointer-events: none; }
.dashboard-hero .card-body { position: relative; z-index: 1; padding: 30px 32px !important; }
.dashboard-hero h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.7rem, 2.7vw, 2.75rem); font-weight: 400; letter-spacing: -.045em; }
.hero-organization { font-size: .85rem; font-weight: 600; }
.hero-role { font-size: .68rem; background: #ffffffb8; border: 1px solid #d7dfd1; border-radius: 30px; padding: 6px 12px; }
.dashboard-hero .metric-dot { width: 6px; height: 6px; border-radius: 50%; background: #17695d; }
.summary-card { position: relative; overflow: hidden; }
.summary-card::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 3px; background: #a4c4b7; border-radius: 0 0 5px 5px; }
.summary-card .metric-dot { display: none; }
.summary-card .card-body { padding: 22px; }
.summary-card .h4 { font-size: clamp(1.6rem, 2.2vw, 2.3rem); font-weight: 650; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.summary-card .small { font-size: .75rem; }
.decision-summary { background: #edf3ea; border-color: #d6e3d2 !important; border-left: 4px solid #62927b !important; }
.decision-summary h2 { color: #38634f; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.decision-summary p.mb-1 { font-weight: 600; }
.coverage-card { background: #f8faf6; box-shadow: none !important; }
.coverage-card h2 { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ai-muted); }
.coverage-card .fw-semibold { font-size: .8rem; }
.coverage-card .coverage-track { height: 5px; width: 100%; margin: 12px 0 8px; background: #e0e8de; border-radius: 10px; overflow: hidden; }
.coverage-track > span { display: block; height: 100%; background: #679780; border-radius: inherit; }
.coverage-card p.small { font-size: .72rem; line-height: 1.65; border-top: 1px solid #e1e8de; padding-top: 12px; }
.text-muted { color: var(--ai-muted) !important; }
.text-primary { color: var(--ai-primary) !important; }
.text-success { color: #216647 !important; }
.text-danger { color: #ab3f4c !important; }
.text-warning { color: #805d0a !important; }
.bg-primary { background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important; }
.bg-success-subtle { background-color: #e5f1e8 !important; }
.bg-danger-subtle { background-color: #fae8e9 !important; }
.bg-warning-subtle { background-color: #f7efcf !important; }
.bg-light { background-color: #f3f5ef !important; }
.badge { border-radius: 6px; font-weight: 550; padding: 6px 9px; line-height: 1.2; white-space: normal; }
.alert { border-radius: 12px; font-size: .84rem; line-height: 1.65; }
.alert-success { background: #eaf3e9; border-color: #d2e4d0; color: #2c5539; }
.alert-warning { background: #faf3dd; border-color: #e9dfba; color: #715920; }
.alert-danger { background: #fbebec; border-color: #eccfd2; color: #973b47; }
.alert-light { background: #fafbf8; border-color: var(--ai-border); color: var(--ai-text); }
.btn { border-radius: 9px; font-size: .8rem; font-weight: 600; padding: .65rem 1rem; transition: background .15s, box-shadow .15s; }
.btn-sm { padding: .48rem .8rem; font-size: .75rem; }
.btn-lg { padding: .9rem 1.25rem; font-size: .95rem; }
.btn-primary { --bs-btn-bg: #17695d; --bs-btn-border-color: #17695d; --bs-btn-hover-bg: #10564b; --bs-btn-hover-border-color: #10564b; --bs-btn-active-bg: #0a463c; --bs-btn-active-border-color: #0a463c; --bs-btn-disabled-bg: #17695d; --bs-btn-disabled-border-color: #17695d; --bs-btn-focus-shadow-rgb: 23,105,93; box-shadow: 0 3px 6px #17695d18; }
.btn-outline-primary { --bs-btn-color: #17695d; --bs-btn-border-color: #abc9bb; --bs-btn-hover-bg: #17695d; --bs-btn-hover-border-color: #17695d; --bs-btn-active-bg: #10564b; --bs-btn-active-border-color: #10564b; }
.btn-success { --bs-btn-bg: #345e49; --bs-btn-border-color: #345e49; --bs-btn-hover-bg: #254735; --bs-btn-hover-border-color: #254735; }
.btn-outline-secondary { --bs-btn-color: #526663; --bs-btn-border-color: #d5ded9; --bs-btn-hover-bg: #eaf0e9; --bs-btn-hover-color: #192e35; --bs-btn-hover-border-color: #b4c5bb; }
.form-label { font-size: .75rem; font-weight: 600; color: #465e58; margin-bottom: .45rem; }
.form-control, .form-select { min-width: 0; border: 1px solid #d5ded7; border-radius: 9px; font-size: .85rem; min-height: 42px; background-color: #fcfdfa; }
.form-control:focus, .form-select:focus { border-color: #659986; box-shadow: 0 0 0 3px #17695d14; background-color: white; }
.form-text { font-size: .75rem; color: var(--ai-muted); }
input[type="checkbox"] { accent-color: #17695d; }
.table { --bs-table-color: #334942; --bs-table-border-color: #e9eee8; font-size: .81rem; margin-bottom: 0; }
.table > thead > tr > th { background: #f5f7f2; color: #5d7169; font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; padding: 13px 14px; border-bottom-width: 1px; white-space: nowrap; }
.table > tbody > tr > td { padding: 15px 14px; }
.table > tbody > tr:hover > td { background-color: #f9fbf7; }
.table > tbody > tr:last-child > td { border-bottom-width: 0; }
.table-responsive { border: 1px solid #e9eee8; border-radius: 12px; overscroll-behavior-x: contain; }
.list-group-item { border-color: var(--ai-border); background: transparent; }
details { border-top: 1px solid var(--ai-border); padding-top: 20px; }
summary { color: var(--ai-primary); font-size: .86rem; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #629b85; outline-offset: 3px; }
.skip-link { position: absolute; z-index: 2000; background: white; padding: .75rem; }
canvas { max-width: 100%; }
.auth-page { background: #f2f4ed; }
.auth-page .app-topbar { background: transparent; border: 0; }
.auth-page .navbar-brand { gap: 11px; }
.auth-card { border-radius: 24px; box-shadow: 0 20px 70px #193c3210 !important; }
.auth-story { position: relative; background: #193b3c; overflow: hidden; }
.auth-story::after { content: ""; position: absolute; width: 340px; height: 340px; right: -230px; top: 90px; border: 1px solid #8eb19a55; border-radius: 50%; box-shadow: 0 0 0 40px #8eb19a11, 0 0 0 41px #8eb19a22, 0 0 0 80px #8eb19a08; pointer-events: none; }
.auth-story > div { position: relative; z-index: 1; }
.auth-story h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400 !important; font-size: 2.8rem; line-height: 1.12; letter-spacing: -.04em; }
.auth-story .lead { font-size: .95rem; line-height: 1.8; color: #c6dcd2; }
.auth-story .text-white-50 { color: #b9d0c8 !important; }
.auth-story .bg-white { background-color: #ffffff0a !important; }
.auth-story .badge { background: #ddefbf !important; color: #29483e !important; }
@media (min-width: 768px) {
    .sidebar { min-height: calc(100vh - 78px); position: sticky; top: 0; align-self: start; }
}
@media (max-width: 1100px) and (min-width: 768px) {
    .app-shell { grid-template-columns: 198px minmax(0, 1fr); }
    .main-panel { padding: 24px 20px; }
    .sidebar { padding-inline: 10px; }
}
@media (max-width: 767.98px) {
    .app-shell { display: block; }
    .app-topbar { min-height: 70px; }
    .app-topbar > .container-fluid { padding-inline: 16px !important; }
    .navbar-brand { margin-right: 0; gap: 8px; }
    .brand-symbol { width: 30px; height: 32px; }
    .brand-wordmark { font-size: .97rem; }
    .brand-wordmark > span { font-size: .6rem; }
    .user-name, .user-avatar { display: none; }
    .sidebar.offcanvas-md { width: min(85vw, 300px); min-height: 0; padding: 12px 15px; }
    .sidebar .offcanvas-body { min-height: auto; }
    .sidebar .btn-close { filter: invert(1); }
    .sidebar-note { margin-top: 16px; padding-top: 20px; padding-bottom: 20px; }
    .main-panel { padding: 18px 16px 32px; }
    .card-body, .card-body.p-4 { padding: 18px !important; }
    .dashboard-hero .card-body { padding: 23px !important; }
    .dashboard-hero::after { right: -120px; }
    .dashboard-hero h1 { font-size: 2rem; max-width: 280px; }
    .hero-role { display: none; }
    .summary-card .h4 { font-size: 1.75rem; }
    .user-menu { gap: .4rem !important; }
    .table-responsive { border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Analysis detail uses the same surfaces as the rest of the workspace. */
.deep-summary-card { background: #f8faf6; }
.deep-metric-value { font-size: 1.65rem; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.deep-chip { display: inline-flex; align-items: center; padding: .35rem .7rem; border-radius: 7px; background: #eaf0e7; color: #38574a; font-size: .8rem; margin: 0 .35rem .35rem 0; }
@media (max-width: 767.98px) {
    .form-control, .form-select { font-size: 1rem; }
    .summary-card .card-body { padding: 16px !important; }
    .summary-card .card-body > .d-flex:first-child { min-height: 34px; }
}

/* Conversation analysis: source context and classification remain visually distinct. */
.analysis-coverage { background: #f0f5f2; border: 1px solid #cddfd6; border-inline-start: 4px solid #17695d; border-radius: .75rem; }
.conversation-category { background: #fff; border: 1px solid #dce4df; border-top: 4px solid #17695d; border-radius: .75rem; }
.conversation-category.category-off_topic { border-top-color: #9b6b24; }
.conversation-category.category-indeterminate { border-top-color: #64748b; }
.conversation-percentage { font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.conversation-meter { background: #edf0ed; height: .4rem; border-radius: 1rem; overflow: hidden; }
.conversation-meter span { display: block; height: 100%; background: #17695d; }
.category-off_topic .conversation-meter span { background: #9b6b24; }
.category-indeterminate .conversation-meter span { background: #64748b; }
.conversation-distribution summary { cursor: pointer; }
.conversation-distribution summary:focus-visible { outline: 2px solid #17695d; outline-offset: 4px; }
.conversation-distribution, .analysis-coverage { overflow-wrap: anywhere; }

/* Project tabs: Bootstrap cards/nav have explicit display values. */
[data-project-panel][hidden],
#project-tabs[hidden] {
    display: none !important;
}
#project-tabs {
    --bs-nav-pills-link-active-bg: var(--ai-primary);
    --bs-nav-pills-border-radius: 10px;
}
#project-tabs .nav-link:focus-visible {
    box-shadow: 0 0 0 .2rem #17695d30;
}
