/* ══════════════════════════════════════════════
   TeamWeb AI — Design System
   Aesthetic: Warm Editorial SaaS
   ══════════════════════════════════════════════ */

/* ── Light Theme Tokens ── */
:root, [data-bs-theme="light"] {
    /* Layout */
    --sidebar-width: 220px;
    --topbar-height: 56px;

    /* Palette — warm & intentional */
    --color-bg: #f8f7f4;
    --color-bg-card: #ffffff;
    --color-bg-subtle: #f1efe9;
    --color-text: #2c2c2e;
    --color-text-muted: #7a7a80;
    --color-border: #e8e5df;

    /* Primary: deep teal */
    --color-primary: #0d7377;
    --color-primary-hover: #0a5c5f;
    --color-primary-light: #e6f4f4;
    --color-primary-subtle: rgba(13, 115, 119, 0.08);

    /* Accent: warm amber */
    --color-accent: #d4860a;
    --color-accent-light: #fef7ec;

    /* Status */
    --color-success: #2d8a4e;
    --color-warning: #c4860c;
    --color-danger: #c4382a;
    --color-info: #2b7ab8;

    /* Topbar */
    --color-bg-topbar: #0d7377;
    --color-text-topbar: #ffffff;

    /* Sidebar — light */
    --color-bg-sidebar: var(--color-bg);
    --color-bg-sidebar-hover: rgba(13, 115, 119, 0.06);
    --color-bg-sidebar-active: rgba(13, 115, 119, 0.10);
    --color-text-sidebar: var(--color-text-muted);
    --color-text-sidebar-hover: var(--color-text);
    --color-text-sidebar-active: var(--color-primary);
    --color-sidebar-indicator: var(--color-primary);
    --color-sidebar-border: var(--color-border);
    --color-sidebar-section: var(--color-text-muted);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 6px 20px rgba(13, 115, 119, 0.10);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ── Dark Theme Tokens ── */
[data-bs-theme="dark"] {
    --color-bg: #15181e;
    --color-bg-card: #1c2028;
    --color-bg-subtle: #21252d;
    --color-text: #e0e0e4;
    --color-text-muted: #8b8fa3;
    --color-border: #2d3240;

    --color-primary: #1ba3a7;
    --color-primary-hover: #22c4c9;
    --color-primary-light: rgba(27, 163, 167, 0.12);
    --color-primary-subtle: rgba(27, 163, 167, 0.08);

    --color-accent: #e6a32e;
    --color-accent-light: rgba(230, 163, 46, 0.12);

    --color-success: #3cb06a;
    --color-warning: #daa520;
    --color-danger: #e05545;
    --color-info: #4a9fd8;

    --color-bg-topbar: #1c2028;
    --color-text-topbar: #e0e0e4;

    --color-bg-sidebar: #1c2028;
    --color-bg-sidebar-hover: rgba(27, 163, 167, 0.08);
    --color-bg-sidebar-active: rgba(27, 163, 167, 0.15);
    --color-text-sidebar: #8b8fa3;
    --color-text-sidebar-hover: #c4c7d4;
    --color-text-sidebar-active: #1ba3a7;
    --color-sidebar-indicator: #1ba3a7;
    --color-sidebar-border: #2d3240;
    --color-sidebar-section: #5a5e70;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-card-hover: 0 6px 20px rgba(27, 163, 167, 0.15);
}

/* ── Base ── */
body {
    font-family: "Inter", system-ui, sans-serif;
    font-size: 1rem;
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

h1, .h1 { font-weight: 800; letter-spacing: -0.02em; }

a {
    color: var(--color-primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* ── Bootstrap Overrides ── */
.btn {
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    box-shadow: 0 2px 8px rgba(13, 115, 119, 0.25);
}

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(13, 115, 119, 0.20);
}

.btn-outline-danger {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-outline-secondary {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.btn-outline-light {
    border-radius: var(--radius-sm);
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    background-color: var(--color-bg-card);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
    background-color: var(--color-bg-card);
    color: var(--color-text);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ── Layout: Top Bar ── */
.topbar {
    height: var(--topbar-height);
    z-index: 1050;
    background: var(--color-bg-topbar) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.topbar .navbar-brand {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    color: var(--color-text-topbar) !important;
}

.topbar .text-topbar {
    color: var(--color-text-topbar);
}

/* ── Layout: Sidebar ── */
.sidebar {
    background-color: var(--color-bg-sidebar) !important;
    border-right: 1px solid var(--color-sidebar-border);
}

@media (min-width: 992px) {
    .sidebar {
        position: fixed !important;
        top: var(--topbar-height);
        bottom: 0;
        left: 0;
        width: var(--sidebar-width);
        z-index: 1040;
        overflow-y: auto;
    }
}

/* Sidebar section label */
.sidebar-section-label {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-sidebar-section);
    padding: 0.75rem 1.25rem 0.35rem;
}

.sidebar .nav {
    padding: 0;
    width: 100%;
}

.sidebar .nav-link {
    color: var(--color-text-sidebar);
    padding: 0.5rem 1.25rem;
    margin: 0;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

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

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

.sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background-color: var(--color-sidebar-indicator);
}

.sidebar .nav-link i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.7;
}

.sidebar .nav-link.active i {
    opacity: 1;
}

/* ── Theme Toggle ── */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-text-topbar);
    opacity: 0.8;
    transition: opacity var(--transition-fast);
    font-size: 1.1rem;
    line-height: 1;
}

.theme-toggle:hover {
    opacity: 1;
}

/* ── Layout: Main Content ── */
.main-content {
    padding: 2rem;
    margin-top: var(--topbar-height);
    animation: fadeInContent 0.3s ease;
}

@media (min-width: 992px) {
    .has-sidebar .main-content {
        margin-left: var(--sidebar-width);
    }
}

@media (max-width: 576px) {
    .main-content {
        padding: 1.25rem;
    }
}

/* ── Cards ── */
.card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    background: var(--color-bg-card);
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 0.85rem 1.25rem;
}

.card-header h5 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    font-weight: 700;
}

.card-body {
    padding: 1.25rem;
}

/* Clickable cards for list pages */
.card-clickable {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    border: 1px solid var(--color-border);
}

.card-clickable:hover {
    color: inherit;
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
    border-color: var(--color-primary);
}

.card-clickable:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.card-clickable .card-title {
    color: var(--color-primary);
    transition: color var(--transition-fast);
}

.card-clickable:hover .card-title {
    color: var(--color-primary-hover);
}

/* ── Badges & Tags ── */
.badge {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    border-radius: 4px;
    padding: 0.3em 0.55em;
}

.badge.bg-success { background-color: var(--color-success) !important; }
.badge.bg-warning { background-color: var(--color-warning) !important; color: #fff !important; }
.badge.bg-danger { background-color: var(--color-danger) !important; }
.badge.bg-info { background-color: var(--color-info) !important; }
.badge.bg-secondary { background-color: #6b7080 !important; }
.badge.bg-primary { background-color: var(--color-primary) !important; }

/* Tag style - softer, pill-shaped */
.tag {
    display: inline-block;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 999px;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    letter-spacing: 0.01em;
}

/* ── Tables ── */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--color-text);
    font-size: 1rem;
}

.table thead th {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom-width: 1px;
    border-color: var(--color-border);
    padding: 0.75rem 1rem;
}

.table thead th.text-end {
    text-align: right !important;
}

.table tbody th,
.table tbody td {
    padding: 0.75rem 1rem;
    border-color: var(--color-border);
    vertical-align: top;
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: var(--color-primary-subtle);
    background-color: var(--color-primary-subtle);
}

/* Right-align actions column */
.col-actions {
    text-align: right;
}

/* ── Nav Tabs (project detail etc.) ── */
.nav-tabs {
    border-bottom: 2px solid var(--color-border);
}

.nav-tabs .nav-link {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.65rem 1rem;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-tabs .nav-link:hover {
    color: var(--color-text);
    border-bottom-color: var(--color-border);
}

.nav-tabs .nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: transparent;
}

.nav-tabs .nav-link .badge {
    font-size: 0.75rem;
    vertical-align: middle;
}

/* ── Breadcrumbs ── */
.breadcrumb {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--color-text-muted);
}

/* ── Alerts ── */
.alert {
    border-radius: var(--radius-md);
    border: none;
    font-size: 1rem;
    animation: slideDown 0.3s ease;
}

/* ── Definition Lists (detail pages) ── */
dl.row dt {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

dl.row dd {
    font-size: 1rem;
}

/* ── Empty States ── */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state > i {
    font-size: 3rem;
    color: var(--color-border);
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    color: var(--color-text-muted);
    max-width: 360px;
    margin: 0 auto 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* ── Dashboard Stat Cards ── */
.stat-card .stat-value {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-card .stat-label {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

/* ── Form Switches ── */
.form-switch .form-check-input {
    border-radius: 999px;
}

/* ── Status Colors (utility) ── */
.status-pending { color: var(--color-text-muted); }
.status-running { color: var(--color-warning); }
.status-completed { color: var(--color-success); }
.status-failed { color: var(--color-danger); }
.status-awaiting_review { color: var(--color-info); }
.status-paused { color: var(--color-warning); }
.status-cancelled { color: var(--color-secondary); }

/* ── Knowledge Source Labels ── */
.context-label {
    font-size: 0.85em;
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    background-color: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
}

/* ── HTMX Loading Indicator ── */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* ── Animations ── */
@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered card entrance */
.card-enter {
    animation: fadeInContent 0.35s ease both;
}

.card-enter:nth-child(1) { animation-delay: 0s; }
.card-enter:nth-child(2) { animation-delay: 0.05s; }
.card-enter:nth-child(3) { animation-delay: 0.1s; }
.card-enter:nth-child(4) { animation-delay: 0.15s; }
.card-enter:nth-child(5) { animation-delay: 0.2s; }
.card-enter:nth-child(6) { animation-delay: 0.25s; }

/* ── Login Page ── */
.auth-container {
    max-width: 400px;
    margin: 5rem auto;
}

.auth-container .card {
    border: none;
    box-shadow: var(--shadow-lg);
}

/* ── Scrollbar (sidebar) ── */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}


/* ══════════════════════════════════════════════
   Chat Interface
   ══════════════════════════════════════════════ */

.chat-container {
    height: calc(100vh - var(--topbar-height));
    display: flex;
    gap: 0;
}

.chat-canvas {
    flex: 1 1 58%;
    position: relative;
    overflow: hidden;
    background: var(--color-bg-subtle);
    border-right: 1px solid var(--color-border);
}

.chat-transcript {
    flex: 0 0 420px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--color-bg-card);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.chat-input-area {
    border-top: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    flex-shrink: 0;
}

.chat-input-area textarea {
    resize: none;
    max-height: 120px;
    min-height: 38px;
}

/* ── Chat Bubbles ── */

.chat-bubble {
    max-width: 88%;
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.85rem;
    border-radius: 1rem;
    animation: chatFadeIn 0.25s ease;
    position: relative;
    word-break: break-word;
}

.chat-bubble .content-body { font-size: 0.9rem; }
.chat-bubble .content-body p:last-child { margin-bottom: 0; }

.chat-user {
    align-self: flex-end;
    background: var(--color-primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-user .content-body a { color: #cef5f6; }

.chat-assistant {
    align-self: flex-start;
    background: var(--color-bg-subtle);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.chat-bubble-time {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    opacity: 0.6;
}

.chat-source-icon {
    font-size: 0.7rem;
    opacity: 0.5;
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Thinking / Typing Indicator ── */

.chat-thinking {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    flex-shrink: 0;
}

.chat-thinking-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-bg-subtle, #f1efe9);
    padding: 10px 16px;
    border-radius: 18px 18px 18px 4px;
}

.chat-thinking-bubble .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-text-muted);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-thinking-bubble .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking-bubble .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chat-thinking-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-left: 4px;
}

/* Timeout warning shown when processing takes > 60s */
.chat-timeout-warning {
    font-size: 0.78rem;
    color: var(--color-warning, #c4860c);
    padding: 0.25rem 1rem;
    flex-shrink: 0;
}

.chat-error {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--color-danger);
    flex-shrink: 0;
}

/* Send button "Sending..." state */
.chat-send-sending .bi-send { display: none; }
.chat-send-sending::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: sendSpin 0.6s linear infinite;
    display: inline-block;
}

@keyframes sendSpin {
    to { transform: rotate(360deg); }
}

.chat-tool-status {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
}

.spin {
    animation: spinGear 1.5s linear infinite;
}

@keyframes spinGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Canvas ── */

.canvas-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.canvas-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    opacity: 0.3;
}

#canvas-area {
    position: absolute;
    inset: 0;
    padding: 1rem;
}

.canvas-card-set {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    width: calc(100% - 2rem);
    max-width: 700px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Single card: full width, no grid */
.canvas-card-set:has(.canvas-card:only-child) {
    grid-template-columns: 1fr;
    max-width: 480px;
}

/* Two cards: two columns but larger */
.canvas-card-set:has(.canvas-card:nth-child(2):last-child) {
    max-width: 600px;
}

/* 3+ cards: standard 2-col grid */

.canvas-card-set.receded {
    opacity: 0.12;
    transform: translate(-50%, -50%) scale(0.97);
    pointer-events: none;
}

.canvas-card {
    overflow: visible;
    position: relative;
}

/* Animate cards only on sets explicitly marked as entering —
   not on the live-updating current set, and not on sets that
   were just finalized (which are already visible). */
.canvas-card-set.entering .canvas-card {
    animation: canvasCardIn 0.35s ease both;
}
.canvas-card-set.entering .canvas-card:nth-child(2) {
    animation-delay: 0.08s;
}
.canvas-card-set.entering .canvas-card:nth-child(3) {
    animation-delay: 0.16s;
}
.canvas-card-set.entering .canvas-card:nth-child(4) {
    animation-delay: 0.24s;
}

.canvas-card-img {
    object-fit: cover;
    cursor: pointer;
    max-height: 180px;
}

/* Larger images for fewer cards */
.canvas-card-set:has(.canvas-card:only-child) .canvas-card-img {
    max-height: 320px;
}
.canvas-card-set:has(.canvas-card:nth-child(2):last-child) .canvas-card-img {
    max-height: 240px;
}

.canvas-card-number {
    position: absolute;
    top: -0.6rem;
    left: -0.6rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.canvas-card-body {
    max-height: 120px;
    overflow: hidden;
    mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

@keyframes canvasCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Canvas: empty current-set placeholder ── */

#canvas-current-set:empty {
    display: none;
}

/* ── No-canvas variant: transcript takes full width ── */
.chat-container--no-canvas .chat-transcript {
    flex: 1 1 100%;
}

/* ── Responsive: stack on mobile ── */

@media (max-width: 991.98px) {
    .chat-container {
        flex-direction: column;
    }
    .chat-canvas {
        flex: none;
        height: 35vh;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    .chat-transcript {
        flex: 1;
        min-height: 0;
    }
}

/* ── Notification dropdown ── */
.notification-dropdown { width: 360px; max-height: 420px; overflow-y: auto; }
.notification-item { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-border); white-space: normal; }
.notification-item.unread { background: var(--color-primary-subtle, rgba(13, 115, 119, 0.06)); }
.notification-item:hover { background: var(--color-bg-subtle); }
.notification-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); display: inline-block; }
