/* ═══════════════════════════════════════════════════
   Electric Research System — CSS
   Prefix: er- (all classes)
   Works within admin sidebar layout (light theme)
   ALL font-sizes in px — no rem.
   ═══════════════════════════════════════════════════ */


/* ── Base ────────────────────────────────────────── */
.admin-layout .admin-content {
    font-size: 13px;
    line-height: 1.6;
}

/* ── Project List ────────────────────────────────── */
.er-project-list {}

.er-project-card {
    transition: border-color 0.15s, transform 0.1s;
    border: 1px solid #dee2e6;
}

.er-project-card:hover {
    border-color: var(--bs-primary, #0d6efd);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    color: inherit;
}

.er-project-card .card-title {
    color: #212529;
}

.er-project-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.er-stat {
    font-size: 15px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}


/* ── Empty State ─────────────────────────────────── */
.er-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6c757d;
}

.er-empty-state > i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}

.er-empty-state h5 {
    color: #495057;
    margin-bottom: 8px;
}

.er-empty-state code {
    display: inline-block;
    margin-top: 12px;
    font-size: 15px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}


/* ── Stat Cards ──────────────────────────────────── */
.er-stat-card {
    border: 1px solid #dee2e6;
}

.er-stat-number {
    font-size: 26px;
    font-weight: 700;
    color: var(--bs-primary, #0d6efd);
}

.er-tree-heading {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.er-tree-heading-project {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 12px;
    font-weight: 500;
    color: #6366f1;
    background: #eef2ff;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.01em;
    text-transform: none;
}
.er-linked-tree {
    padding-top: 16px;
    border-top: 1px dashed #e5e7eb;
}

.er-stat-label {
    font-size: 14px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Compact inline stats strip — condensed alternative to the four-card row.
   A single pill row instead of full-height Bootstrap cards, to reclaim the
   vertical space the stat cards ate up. */
.er-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}
.er-stat-pill {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    background: #f8f9fa;
    line-height: 1.2;
}
.er-stat-pill-num {
    font-size: 15px;
    font-weight: 700;
    color: var(--bs-primary, #0d6efd);
}
.er-stat-pill-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── "Under the Hood" tech card ───────────────────── */
.er-tech-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    padding: 14px 16px;
}
.er-tech-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.er-tech-card-head::-webkit-details-marker { display: none; }
.er-tech-card-head::marker { content: ""; }
.er-tech-card[open] .er-tech-card-head { margin-bottom: 10px; }
.er-tech-card-title {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.er-tech-chev {
    font-size: 11px;
    color: #9ca3af;
    margin-right: 6px;
    transition: transform 0.15s;
}
.er-tech-card[open] .er-tech-chev { transform: rotate(90deg); color: #6366f1; }
.er-tech-badge {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 600;
    color: #4338ca;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}
.er-tech-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.er-tech-chip {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 4px;
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}
.er-tech-chip-admin {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}
.er-tech-chip-era {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}
.er-tech-list {
    list-style: none;
    margin: 0;
    padding: 0;
    /* Two columns to halve the card height — saves vertical space. */
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
    row-gap: 2px;
}
.er-tech-list li {
    position: relative;
    padding: 4px 0 4px 14px;
    font-size: 12px;
    line-height: 1.4;
    color: #374151;
}
.er-tech-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6366f1;
}
/* Collapse back to a single column when the card is too narrow. */
@media (max-width: 575.98px) {
    .er-tech-list { grid-template-columns: 1fr; }
}
.er-tech-list code {
    background: #eef2ff;
    color: #4338ca;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 11px;
}


/* ── Public Tree ─────────────────────────────────── */
.er-pub-tree, .er-pub-tree-root {
    list-style: none;
    padding: 0;
    margin: 0;
}

.er-pub-tree .er-pub-tree {
    padding-left: 24px;
}

.er-pub-item {
    margin-bottom: 2px;
}

.er-pub-item.er-collapsed > .er-pub-tree {
    display: none;
}

.er-pub-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 0px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.er-pub-row:hover {
    background: rgba(0,0,0,0.03);
}

.er-pub-toggle {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px;
    margin-top: 3px;
    font-size: 15px;
    transition: transform 0.15s;
    width: 22px;
    text-align: center;
}

.er-expanded > .er-pub-row > .er-pub-toggle > i {
    transform: rotate(90deg);
    display: inline-block;
}

.er-pub-toggle-spacer {
    width: 22px;
    display: inline-block;
    margin-top: 3px;
}

.er-pub-tree-root > .er-pub-item > .er-pub-row > .er-pub-title {
    color: #0f172a;
    font-size: 17px;
    font-weight: 600;
}

.er-pub-tree .er-pub-tree .er-pub-tree .er-pub-title {
    color: #495057;
    font-size: 16px;
    font-weight: 400;
}

.er-pub-title {
    color: #212529;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    user-select: text;
    cursor: text;
}

.er-pub-go {
    color: #0d6efd;
    text-decoration: none;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 3px;
    margin-left: 8px;
    transition: color 0.15s;
}

.er-pub-go:hover {
    color: #0a58ca;
}

.er-pub-node-id {
    font-size: 14px;
    font-weight: 700;
    color: #495057;
    font-family: monospace;
    margin-top: 3px;
}

.er-pub-uuid {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    font-family: 'Courier New', monospace;
    background: rgba(100, 116, 139, 0.12);
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    cursor: pointer;
    user-select: none;
}
.er-pub-uuid:hover,
.er-pub-uuid:focus {
    background: rgba(100, 116, 139, 0.22);
    outline: none;
}

/* UUID popover — position:fixed so it overlays content without shifting layout.
   JS sets top/left at click time. */
.er-uuid-popover {
    position: fixed;
    z-index: 9999;
    background: #1f2937;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.er-uuid-popover input {
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: inherit;
    width: 280px;
    padding: 0;
    outline: none;
    user-select: all;
}
.er-uuid-popover button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}
.er-uuid-popover button:hover { background: rgba(255, 255, 255, 0.25); }
.er-uuid-popover::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 14px;
    width: 10px;
    height: 10px;
    background: #1f2937;
    transform: rotate(45deg);
}

.er-pub-go:hover .er-pub-node-id {
    color: var(--bs-primary, #0d6efd);
}

.er-pub-count {
    font-size: 14px;
    background: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary, #0d6efd);
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 15px;
    font-weight: 600;
}

.er-pub-count-docs {
    font-size: 14px;
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 6px;
}

.er-pub-count-words {
    font-size: 14px;
    background: rgba(16, 163, 74, 0.1);
    color: #16a34a;
    padding: 3px 10px;
    border-radius: 10px;
    margin-left: 6px;
    font-weight: 500;
}

/* Tree Key */
.er-tree-key {
    padding: 14px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    display: inline-block;
}

.er-tree-key-title {
    font-size: 15px;
    font-weight: 600;
    color: #495057;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.er-tree-key-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.er-tree-key-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #6c757d;
}

.er-tree-key-item i {
    font-size: 13px;
    color: #adb5bd;
    width: 20px;
    text-align: center;
}

.er-tree-key .er-pub-count,
.er-tree-key .er-pub-count-docs,
.er-tree-key .er-pub-count-words {
    margin-left: 0;
}

.er-pub-item.er-active > .er-pub-row {
    background: rgba(13, 110, 253, 0.06);
}

/* Potential Topics */
.er-potential-topics {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    opacity: 0.75;
}

.er-potential-topics:hover {
    opacity: 1;
}

.er-potential-divider {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 8px;
}

.er-potential-divider-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2a308 20%, #f59e0b 50%, #e2a308 80%, transparent);
    border-radius: 2px;
}

.er-potential-divider-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 50%;
    color: #b45309;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
    flex-shrink: 0;
}

.er-potential-title {
    text-align: center;
    color: #92400e;
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.er-potential-subtitle {
    text-align: center;
    color: #a3a3a3;
    font-size: 14px;
    margin-bottom: 20px;
}

.er-potential-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.er-potential-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    transition: background 0.15s;
}

.er-potential-row:hover {
    background: rgba(0,0,0,0.03);
    color: #212529;
}

.er-potential-path {
    color: #adb5bd;
    font-size: 15px;
}

.er-potential-sep {
    color: #ced4da;
    font-size: 14px;
}

.er-potential-name {
    font-size: 16px;
    font-weight: 500;
}

.er-pub-item.er-active > .er-pub-row > .er-pub-title {
    color: var(--bs-primary, #0d6efd);
}


/* ── Breadcrumb ──────────────────────────────────── */
.er-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.er-breadcrumb-item {
    color: #6c757d;
    text-decoration: none;
    font-size: 15px;
}

a.er-breadcrumb-item:hover {
    color: var(--bs-primary, #0d6efd);
}

.er-breadcrumb-current {
    color: #212529;
    font-weight: 500;
}

.er-breadcrumb-id {
    font-size: 12px;
    color: #868e96;
    font-weight: 400;
    margin-left: 3px;
}

.er-breadcrumb-sep {
    color: #adb5bd;
    font-size: 13px;
}


/* ── Node Detail ─────────────────────────────────── */
.er-node-detail {}
.er-node-timestamp { font-size: 0.8rem; color: #6b7280; margin: -0.25rem 0 0.75rem; }
.er-node-timestamp i { margin-right: 4px; font-size: 0.75rem; }
/* Legacy — kept for any caller not yet on the inline-breadcrumb-uuid pattern. */
.er-node-uuid { font-size: 0.8rem; color: #6b7280; margin: -0.25rem 0 0.75rem; }
.er-node-uuid i { margin-right: 4px; font-size: 0.75rem; }
.er-node-uuid code { background: rgba(220, 53, 69, 0.1); padding: 2px 6px; border-radius: 3px; color: #dc3545; }

/* UUID stamp appended inside the breadcrumb wrapper (passed via the
   renderer's $trailingHtml param). Mono-monospace + muted so it reads as
   an identity stamp, not a breadcrumb step. */
.er-breadcrumb-uuid {
    margin-left: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: #64748b;
    background: rgba(100, 116, 139, 0.08);
    border-radius: 4px;
    letter-spacing: 0.01em;
}
.er-breadcrumb-uuid i {
    margin-right: 4px;
    font-size: 11px;
    opacity: 0.7;
}

.er-child-card {
    transition: border-color 0.15s;
    border: 1px solid #dee2e6;
}

.er-child-card:hover {
    border-color: var(--bs-primary, #0d6efd);
    color: inherit;
}

.er-child-card .card-title {
    color: #212529;
}

.er-child-stats {
    display: flex;
    gap: 12px;
}


/* ── Document Viewer ─────────────────────────────── */
.er-doc-viewer {
    max-width: 1000px;
}

.er-doc-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #dee2e6;
}

.er-doc-meta-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.er-doc-content {
    color: #374151;
    font-size: 17px;
    line-height: 1.8;
}

.er-doc-content h1,
.er-doc-content h2,
.er-doc-content h3,
.er-doc-content h4 {
    color: #1e293b;
    margin-top: 28px;
    margin-bottom: 10px;
}

.er-doc-content h1 { font-size: 24px; }
.er-doc-content h2 { font-size: 21px; }
.er-doc-content h3 { font-size: 18px; }

.er-doc-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 24px 0;
}

.er-doc-content pre {
    background: #f8fafc;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 15px;
    border: 1px solid #e5e7eb;
}

.er-doc-content code {
    background: #f1f5f9;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
    color: #0f766e;
}

.er-doc-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.er-doc-content a {
    color: #0d9488;
    text-decoration: underline;
    text-decoration-color: rgba(13, 148, 136, 0.3);
    text-underline-offset: 2px;
}

.er-doc-content a:hover {
    color: #0f766e;
    text-decoration-color: #0f766e;
}

.er-doc-content strong { color: #1e293b; }

.er-doc-content ul {
    padding-left: 20px;
}

.er-doc-content li {
    margin-bottom: 4px;
}

.er-doc-content table,
.er-doc-content .md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 15px;
}

.er-doc-content table th,
.er-doc-content table td,
.er-doc-content .md-table th,
.er-doc-content .md-table td {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.er-doc-content table th,
.er-doc-content .md-table th {
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
}

.er-doc-content table td a,
.er-doc-content .md-table td a {
    color: #0d9488;
    text-decoration: none;
    word-break: break-all;
}

.er-doc-content table td a:hover,
.er-doc-content .md-table td a:hover {
    color: #0f766e;
    text-decoration: underline;
}


/* ── Document List ───────────────────────────────── */
.er-doc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.er-doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 6px;
    transition: background 0.15s;
}

.er-doc-item:hover {
    background: rgba(0,0,0,0.02);
}

.er-doc-info {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.er-doc-icon {
    color: #6c757d;
    font-size: 18px;
    margin-top: 2px;
}

.er-doc-meta {}

.er-doc-title {
    color: #212529;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    display: block;
}

.er-doc-title:hover {
    color: var(--bs-primary, #0d6efd);
}

.er-doc-details {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 3px;
}

.er-doc-filename {
    font-size: 14px;
    color: #adb5bd;
    font-family: monospace;
}

.er-doc-badge {
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 10px;
}

.er-doc-type {
    font-size: 14px;
    color: #6c757d;
}

.er-doc-words {
    font-size: 14px;
    color: #adb5bd;
}

.er-doc-controls {
    display: flex;
    gap: 4px;
}


/* ── Status & Confidence Badges ──────────────────── */
.er-status-draft { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.er-status-review { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.er-status-final { background: rgba(16, 185, 129, 0.12); color: #059669; }
.er-status-archived { background: rgba(107, 114, 128, 0.12); color: #6b7280; }

.er-conf-high { background: rgba(16, 185, 129, 0.12); color: #059669; }
.er-conf-medium { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.er-conf-low { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.er-conf-unverified { background: rgba(107, 114, 128, 0.12); color: #6b7280; }


/* ── Entity Links ────────────────────────────────── */
.er-entity-link {
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
    border-bottom: 1px dotted var(--bs-primary, #0d6efd);
}

.er-entity-link:hover {
    color: #0a58ca;
    border-bottom-style: solid;
}


/* ── Tree Controls (admin) ───────────────────────── */
.er-tree-list, .er-tree-root {
    list-style: none;
    padding: 0;
    margin: 0;
}

.er-tree-list .er-tree-list {
    padding-left: 24px;
}

.er-tree-item {
    margin-bottom: 2px;
}

.er-tree-item.er-collapsed > .er-tree-list {
    display: none;
}

.er-node-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
}

.er-node-row:hover {
    background: rgba(0,0,0,0.03);
}

.er-toggle {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 2px;
    font-size: 15px;
    width: 22px;
    text-align: center;
}

.er-expanded > .er-node-row > .er-toggle > i {
    transform: rotate(90deg);
    display: inline-block;
}

.er-toggle-spacer {
    width: 22px;
    display: inline-block;
}

.er-node-icon {
    color: #6c757d;
    font-size: 15px;
}

.er-node-title {
    color: #212529;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

.er-node-title:hover {
    color: var(--bs-primary, #0d6efd);
}

.er-badge {
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
}

.er-badge-docs {
    background: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary, #0d6efd);
}

.er-badge-children {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.er-badge-uuid {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: help;
}

.er-controls {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.er-node-row:hover .er-controls {
    opacity: 1;
}

.er-btn {
    background: none;
    border: none;
    color: #adb5bd;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 15px;
}

.er-btn:hover {
    color: var(--bs-primary, #0d6efd);
    background: rgba(0,0,0,0.04);
}

.er-btn-delete:hover {
    color: #dc3545;
}


/* ── Depth Badges ────────────────────────────────── */
.er-depth-badge {
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 8px;
    margin-left: 4px;
}

.er-depth-nodes {
    background: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary, #0d6efd);
}

.er-depth-docs {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}


/* ── Empty states ────────────────────────────────── */
.er-empty {
    color: #adb5bd;
    font-size: 15px;
    padding: 12px 0;
}


/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
    .er-project-stats { gap: 10px; }
    .er-doc-meta-bar { gap: 4px; }
}


/* ═══════════════════════════════════════════════════
   Research Requests
   ═══════════════════════════════════════════════════ */

/* ── Section Heading Status Chips (passive) ──────── */

.er-section-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
    cursor: default;
}

.er-section-chip-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
    cursor: pointer;
}

.er-section-chip-progress {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    cursor: pointer;
}

.er-section-chip-complete {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.er-section-chip-complete:hover {
    color: #047857;
    background: rgba(16, 185, 129, 0.18);
}


/* ── Depth Selector ───────────────────────────────── */

.er-depth-selector {
    display: flex;
    gap: 6px;
}

.er-depth-btn {
    flex: 1;
    padding: 8px 10px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}

.er-depth-btn strong {
    display: block;
    font-size: 13px;
    color: #374151;
}

.er-depth-btn span {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

.er-depth-btn:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.er-depth-btn.er-depth-active {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.06);
}

.er-depth-btn.er-depth-active strong {
    color: #0d6efd;
}

.er-depth-btn-compact {
    flex: 0;
    padding: 6px 16px;
}

.er-depth-btn-compact strong {
    font-size: 13px;
}

.er-depth-btn-compact span {
    display: none;
}


/* ── Request Cards (list page) ────────────────────── */

.er-request-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 20px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.er-request-card:hover {
    border-color: #c7cdd3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.er-request-type-icon {
    font-size: 18px;
    color: #9ca3af;
}

.er-request-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.er-request-instructions {
    font-size: 16px;
    color: #495057;
    margin-top: 6px;
    line-height: 1.6;
}

.er-request-instructions a {
    color: #0d6efd;
    text-decoration: none;
    font-size: 14px;
}

.er-delete-request-btn:hover {
    color: #dc2626 !important;
}

.er-request-meta {
    font-size: 14px;
    color: #9ca3af;
    margin-top: 8px;
}

/* ── Completed card sections ── */

.er-card-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.er-card-section-label {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-bottom: 10px;
    padding-bottom: 4px;
}

.er-output-table {
    width: 100%;
    font-size: 15px;
    border-collapse: collapse;
}

.er-output-table td {
    padding: 6px 0;
    vertical-align: top;
    border-bottom: 1px solid #f8f8f8;
}

.er-output-table tr:last-child td {
    border-bottom: none;
}

.er-output-title {
    width: 40%;
    padding-right: 16px;
    font-weight: 500;
}

.er-output-title a {
    color: #1e293b;
    text-decoration: none;
}

.er-output-title a:hover {
    color: #0d6efd;
}

.er-output-desc {
    color: #6b7280;
    font-size: 14px;
}

/* ── Asset download chips ── */

.er-asset-chip {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #059669;
    background: rgba(5,150,105,0.08);
    padding: 4px 14px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid rgba(5,150,105,0.15);
    transition: background 0.15s, border-color 0.15s;
}

.er-asset-chip:hover {
    background: rgba(5,150,105,0.15);
    border-color: rgba(5,150,105,0.3);
    color: #047857;
}

.er-asset-chip-sm {
    font-size: 11px;
    padding: 2px 8px;
    vertical-align: middle;
}

/* ── Lead table link ── */

.er-lead-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(124,58,237,0.06);
    color: #a78bfa;
    font-size: 15px;
    text-decoration: none;
    margin-right: 8px;
    transition: background 0.15s, transform 0.15s;
}

.er-lead-link:hover {
    background: rgba(124,58,237,0.12);
    color: #7c3aed;
    transform: scale(1.1);
}

.er-convo-thread {
    margin-top: 10px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    max-height: 400px;
    overflow-y: auto;
}

.er-convo-msg {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.er-convo-msg:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.er-convo-msg-header {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.er-convo-msg-header span {
    color: #9ca3af;
    margin-left: 6px;
}

.er-convo-msg-body {
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
}

.er-convo-msg-user .er-convo-msg-header strong {
    color: #0d6efd;
}

.er-convo-msg-assistant .er-convo-msg-header strong {
    color: #059669;
}


/* ── Request Filters ──────────────────────────────── */

.er-request-filters .nav-link {
    font-size: 14px;
    color: #6b7280;
    padding: 6px 14px;
    border-radius: 6px;
}

.er-request-filters .nav-link.active {
    background: #0d6efd;
    color: #fff;
}

.er-request-filters .badge {
    font-size: 11px;
}


/* ── Help Section ─────────────────────────────────── */

.er-request-help {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 20px 24px;
}

.er-help-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    min-width: 22px;
    background: #0d6efd;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 50%;
    margin-top: 2px;
}


/* ── Floating Action Button ───────────────────────── */

.er-fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    border: none;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
    transition: background 0.15s, transform 0.15s;
    z-index: 1030;
}

.er-fab:hover {
    background: #0b5ed7;
    transform: scale(1.06);
}


/* ── Node Page Slide-out Chat ─────────────────────── */

.er-node-chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 725px;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: #fff;
    border-left: 1px solid #e5e7eb;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
}

.er-node-chat-panel.er-open {
    transform: translateX(0);
}

.er-node-chat-panel .er-chat-header {
    flex-shrink: 0;
}

.er-node-chat-panel .er-chat-messages {
    flex: 1;
    height: auto;
}

.er-node-chat-panel .er-chat-input-area {
    flex-shrink: 0;
}

.er-node-chat-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.15);
    z-index: 1040;
}

.er-node-chat-overlay.er-open {
    display: block;
}

@media (max-width: 768px) {
    .er-node-chat-panel {
        width: 100%;
    }
}


/* ── Research Assistant Chat (shared) ─────────────── */

.er-chat-panel {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.er-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    min-height: 56px;
}
/* Project badge now sits as a full-width strip directly below the header,
   not crammed into the agent-info column. Gives the selector + UUID chips
   room to breathe. */
.er-chat-project-badge {
    display: block;
    padding: 6px 16px;
    font-size: 11px;
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: #4338ca;
    background: #eef2ff;
    border-bottom: 1px solid #e5e7eb;
    letter-spacing: 0.01em;
    line-height: 1.5;
    /* Wrap to 2+ lines when "Tree: X • Viewing: Y [N]" exceeds panel width.
       Ellipsising the node title would defeat the purpose of showing it. */
    white-space: normal;
    word-break: break-word;
}
.er-chat-project-badge .er-chat-badge-sep {
    color: #9ca3af;
    margin: 0 2px;
}

.er-chat-header-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.er-chat-header-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #9ca3af;
}

.er-chat-close-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Accent variant — same shape as the regular header buttons, but tinted
   so the user's eye reads it as "more important / state-changing." Used
   for the Work-mode toggle (`#erChatWorkModeBtn`). */
.er-chat-header-btn--accent {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4f46e5;
}
.er-chat-header-btn--accent:hover {
    background: #e0e7ff;
    border-color: #818cf8;
    color: #4338ca;
}
.er-chat-header-btn--accent.is-active {
    background: #4f46e5;
    border-color: #4338ca;
    color: #fff;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* ── Agent switcher (multi-agent chat) ─────────────── */
.er-chat-header-agent {
    position: relative;
    min-width: 0;
    flex: 1;
}

.er-chat-agent-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    margin: -4px -8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.er-chat-agent-switcher-btn:hover {
    background: #fff;
    border-color: #d1d5db;
}

.er-chat-agent-switcher-btn[aria-expanded="true"] {
    background: #fff;
    border-color: #9ca3af;
}

.er-chat-agent-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    max-width: 380px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1100;
    overflow: hidden;
    padding: 4px;
}

.er-chat-agent-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.er-chat-agent-option:hover {
    background: #f3f4f6;
}

.er-chat-agent-option.is-active {
    background: #eef2ff;
}

.er-chat-agent-option-name {
    font-weight: 600;
    font-size: 13px;
    color: #111827;
    line-height: 1.3;
}

.er-chat-agent-id {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    font-family: 'JetBrains Mono', Consolas, monospace;
}

.er-chat-agent-id-inline {
    margin-left: 6px;
    font-size: 10px;
    font-weight: 400;
    color: #9ca3af;
    font-family: 'JetBrains Mono', Consolas, monospace;
}

/* UUID-tail chip — sits right after the widget_type chip. Last 5 chars of
   the agent's uuid, for cross-env debug discrimination. Muted further than
   the widget_type so the slug stays the primary identifier. */
.er-chat-agent-uuid {
    margin-left: 4px;
    font-size: 10px;
    font-weight: 400;
    color: #6b7280;
    font-family: 'JetBrains Mono', Consolas, monospace;
}
.er-chat-agent-uuid-inline {
    margin-left: 4px;
    font-size: 10px;
    font-weight: 400;
    color: #6b7280;
    font-family: 'JetBrains Mono', Consolas, monospace;
}

/* ── Scope intro — shown on chat open + agent switch ──────
   Replaces the old auto-greeting. Inert info card listing the trees
   this agent can read (org-derived + agent-explicit, see
   ChatbotService::getAgentAccessibleProjects). User reads it, then
   types — no Claude call on open. */
.er-chat-scope-intro {
    padding: 16px 16px 14px;
    margin: 8px 4px 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}
.er-chat-scope-label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.er-chat-scope-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}
.er-chat-scope-chip {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 14px;
    font-family: 'JetBrains Mono', Consolas, monospace;
}
.er-chat-scope-hint {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

/* Loaded-nodes chip strip — sits directly under a user message that
   triggered a server-side node-content injection. Lets the user see
   (especially after refresh) exactly what the agent had loaded for
   that turn. Clicking re-loads the node in a new turn. */
.er-chat-msg-loaded {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.er-chat-loaded-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    color: #334155;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    font-family: inherit;
    line-height: 1.3;
}
.er-chat-loaded-chip:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}
.er-chat-loaded-chip i {
    color: #6366f1;
    font-size: 12px;
}
.er-chat-loaded-chip strong {
    font-weight: 600;
}
.er-chat-loaded-chip-tail {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 10px;
    color: #64748b;
}

/* Annotation chips — appear when a user message carries [ann:UUID] markers.
   Click → scroll-to + flash the matching highlight in the doc. Distinct
   yellow-amber palette so they don't get confused with node-load chips
   (those are slate). */
.er-chat-msg-loaded-ann {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.er-chat-loaded-ann-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    color: #78350f;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    font-family: inherit;
    line-height: 1.3;
    max-width: 320px;
}
.er-chat-loaded-ann-chip:hover {
    background: #fde68a;
    border-color: #f59e0b;
}
.er-chat-loaded-ann-chip i {
    color: #d97706;
    font-size: 12px;
}
.er-chat-loaded-ann-chip em {
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}
.er-chat-loaded-ann-note-flag {
    color: #b45309;
    font-weight: 700;
}

/* Flash animation when a chip click scrolls to a highlight — pulses the
   yellow background briefly so the eye lands on the right passage. */
mark.er-ann-flash {
    animation: er-ann-flash-kf 1.4s ease-out;
}
@keyframes er-ann-flash-kf {
    0%   { background: #fef3c7; box-shadow: 0 0 0 0   rgba(245, 158, 11, 0.7); }
    35%  { background: #fde68a; box-shadow: 0 0 0 10px rgba(245, 158, 11, 0.0); }
    100% { background: #fef08a; box-shadow: 0 0 0 0   rgba(245, 158, 11, 0.0); }
}

/* "Read this node" CTA — appears in the scope intro when the user is on a
   specific tree-view URL. Click sends a `Read node <id>` message that the
   server-side referenced-nodes detector picks up + injects content. */
.er-chat-scope-cta-row {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}
.er-chat-read-node-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: #312e81;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
    line-height: 1.3;
}
.er-chat-read-node-btn:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}
.er-chat-read-node-btn:active {
    background: #c7d2fe;
}
.er-chat-read-node-btn i {
    color: #6366f1;
    font-size: 14px;
}
.er-chat-read-node-btn strong {
    font-weight: 600;
    color: #1e1b4b;
}
.er-chat-read-node-tail {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 11px;
    color: #6366f1;
    margin-left: 4px;
}

/* Bracketed widget_type chip rendered in the per-message label —
   matches the chat-header chip style (mono, muted) so the cross-env
   stable id is visible alongside the human display name. */
.er-chat-msg-agent-id {
    font-size: 11px;
    color: #6b7280;
    font-family: 'JetBrains Mono', Consolas, monospace;
    margin-right: 4px;
}

.er-chat-agent-option-desc {
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

.er-chat-agent-info {
    padding: 10px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 12px;
    color: #4b5563;
    line-height: 1.5;
}

.er-chat-agent-info-desc {
    margin-bottom: 4px;
}

.er-chat-agent-info-meta {
    font-size: 11px;
    color: #6b7280;
}

.er-chat-messages {
    height: 420px;
    overflow-y: auto;
    padding: 16px;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.er-chat-messages::before {
    content: '';
    flex: 1;
}

.er-chat-welcome {
    background: #f0f4ff;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 16px;
    color: #1e293b;
    line-height: 1.6;
}

.er-chat-welcome p:last-child {
    margin-bottom: 0;
}

.er-chat-mode-selector {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.er-chat-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.er-chat-mode-btn:hover {
    border-color: #93c5fd;
    background: #f8faff;
}

.er-chat-mode-btn i {
    font-size: 16px;
    color: #6b7280;
}

.er-chat-mode-btn strong {
    font-size: 13px;
    color: #374151;
}

.er-chat-mode-btn span {
    display: none;
}

.er-chat-mode-picker {
    padding: 0 0 10px;
}

.er-chat-mode-active {
    border-color: #0d6efd !important;
    background: rgba(13, 110, 253, 0.06) !important;
}

.er-chat-mode-active strong {
    color: #0d6efd;
}

.er-chat-msg {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.er-chat-msg-user {
    align-items: flex-end;
}

.er-chat-msg-assistant {
    align-items: flex-start;
}

.er-chat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #9ca3af;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.er-chat-time {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: #9ca3af;
}

.er-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.er-chat-msg-user .er-chat-bubble {
    background: #0d6efd;
    color: #fff;
    border-bottom-right-radius: 3px;
}

.er-chat-msg-assistant .er-chat-bubble {
    background: #f3f4f6;
    color: #1e293b;
    border-bottom-left-radius: 3px;
}

.er-chat-msg-assistant .er-chat-bubble strong {
    font-weight: 600;
}

.er-chat-msg-assistant .er-chat-bubble code {
    background: rgba(0,0,0,0.06);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 15px;
}

.er-chat-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: #f3f4f6;
    border-radius: 10px;
    border-bottom-left-radius: 3px;
    max-width: 70px;
}

.er-chat-typing-dot {
    width: 7px;
    height: 7px;
    background: #9ca3af;
    border-radius: 50%;
    animation: er-typing-bounce 1.2s infinite;
}

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

@keyframes er-typing-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
}

.er-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.er-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.er-chat-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
    min-height: 44px;
    max-height: 400px;
    overflow-y: auto;
}

.er-chat-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.1);
}

.er-chat-send {
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.er-chat-send:hover {
    background: #0b5ed7;
}

.er-chat-send:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Submit request block that appears in chat */
.er-chat-submit-block {
    margin-top: 12px;
    padding: 14px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
}

.er-chat-submit-block h6 {
    font-size: 14px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 8px;
}

.er-chat-submit-block pre {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.er-chat-submit-btn {
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.er-chat-submit-btn:hover {
    background: #047857;
}

.er-chat-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Scrollbar — let the chat use the browser's native scrollbar so it's
   visually consistent with the doc-column scrollbar in work mode. */


/* ── Responsive ───────────────────────────────────── */

@media (max-width: 768px) {
    .er-popover-form {
        min-width: 280px;
    }

    .er-depth-selector {
        flex-direction: column;
    }

    .er-depth-btn {
        text-align: left;
        padding: 6px 10px;
    }

    .er-depth-btn strong,
    .er-depth-btn span {
        display: inline;
    }

    .er-depth-btn span {
        margin-top: 0;
        margin-left: 4px;
    }
}
