/* CHEMIX — supplemental styles layered on top of the shared Tailwind/global.css shell */
.chemix-scope {
    --cx-green: #10B981;
    --cx-amber: #F59E0B;
    --cx-red: #EF4444;
    font-family: 'Inter', sans-serif;
}

.chemix-scope .cx-mono {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

/* ── Status dots (reserved for live values only) ── */
.chemix-scope .cx-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.chemix-scope .cx-status-normal { background: var(--cx-green); }
.chemix-scope .cx-status-warning { background: var(--cx-amber); }
.chemix-scope .cx-status-alarm { background: var(--cx-red); }
.chemix-scope .cx-status-unknown { background: #CBD5E1; }

.chemix-scope .cx-text-normal { color: var(--cx-green); }
.chemix-scope .cx-text-warning { color: var(--cx-amber); }
.chemix-scope .cx-text-alarm { color: var(--cx-red); }

/* ── KPI tile card (appix/uems idiom: white card, colored left rail) ── */
.chemix-scope .cx-tile {
    position: relative;
    background: #fff;
    border: 1px solid #F1F5F9;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.04);
    padding: 1.25rem 1.5rem;
    overflow: hidden;
}

.chemix-scope .cx-tile-rail {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 5px;
}

/* ── Reports table (VantagePoint-style grouped report) ── */
.chemix-scope .cx-report-wrap {
    overflow: auto;
    border: 1px solid #E2E8F0;
    border-radius: 1rem;
    background: #fff;
    max-height: 70vh;
}

.chemix-scope .cx-report-table {
    border-collapse: collapse;
    width: 100%;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    white-space: nowrap;
}

.chemix-scope .cx-report-table th,
.chemix-scope .cx-report-table td {
    border: 1px solid #E2E8F0;
    padding: 0.4rem 0.65rem;
    text-align: right;
}

.chemix-scope .cx-report-table thead th {
    background: #ECFDF5;
    color: #047857;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 2;
}

.chemix-scope .cx-report-table thead tr.cx-group-row th {
    text-align: center;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.chemix-scope .cx-report-table td.cx-ts,
.chemix-scope .cx-report-table th.cx-ts-head {
    text-align: left;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
}

.chemix-scope .cx-report-table thead th.cx-ts-head {
    background: #ECFDF5;
    z-index: 3;
}

.chemix-scope .cx-report-table tfoot td {
    font-weight: 700;
    background: #F8FAFC;
    position: sticky;
    bottom: 0;
}

.chemix-scope .cx-report-table tfoot tr.cx-avg td { color: #047857; }
.chemix-scope .cx-report-table tfoot tr.cx-max td { color: #DC2626; }
.chemix-scope .cx-report-table tfoot tr.cx-min td { color: #0891B2; }

/* ── Chat ── */
.chemix-scope .cx-chat-window {
    height: 56vh;
    min-height: 340px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.25rem 0.1rem;
}

.chemix-scope .cx-msg {
    max-width: 72%;
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.chemix-scope .cx-msg.cx-msg-user {
    align-self: flex-end;
    background: #047857;
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chemix-scope .cx-msg.cx-msg-bot {
    align-self: flex-start;
    background: #ECFDF5;
    color: #064E3B;
    border-bottom-left-radius: 0.25rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
}

/* ── Node-flow diagram (architecture page): reuses architecture.css node/svg classes ── */
.chemix-scope .cx-arch-canvas {
    position: relative;
    width: 100%;
}

.chemix-scope .cx-node-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.chemix-scope .cx-badge-eol { background: #FEE2E2; color: #B91C1C; }
.chemix-scope .cx-badge-live { background: #D1FAE5; color: #047857; }

.chemix-scope .arch-container .node-legacy .node-circle {
    opacity: 0.55;
    border-style: dashed;
    filter: grayscale(0.4);
}
.chemix-scope .arch-container .node-legacy .node-label,
.chemix-scope .arch-container .node-legacy .node-sublabel {
    opacity: 0.6;
}
.chemix-scope .arch-container .path-legacy {
    stroke-dasharray: 4 5;
    opacity: 0.45;
}

/* ── Print (Reports "Export PDF") ── */
@media print {
    #chemix-sidebar,
    #chemix-mobile-menu-btn,
    #chemix-mobile-overlay,
    #global-header,
    #global-subheader,
    #global-footer,
    .cx-no-print {
        display: none !important;
    }
    #chemix-root, #main-content {
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    .cx-report-wrap {
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
    }
    .cx-report-table thead th {
        position: static !important;
    }
    body {
        overflow: visible !important;
    }
}
