:root {
    --bg: #0b1220;
    --card: #111827;
    --card2: #0d1728;
    --line: #1f2937;
    --line2: #20304a;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --blue: #2563eb;
    --green: #059669;
    --amber: #b45309;
    --red: #b91c1c;
    --violet: #8b5cf6;
    --cyan: #0891b2;
}

* { box-sizing: border-box; }

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 18px;
    transition: border-top 0.25s ease;
}

body.sim-mode { border-top: 4px solid var(--violet); }

h1 { margin: 0 0 6px; font-size: 32px; }
h2 { margin: 0 0 10px; font-size: 18px; }
h3 { margin: 0 0 10px; font-size: 15px; color: #cbd5e1; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.sticky {
    position: sticky;
    top: 0;
    background: rgba(11, 18, 32, 0.96);
    padding-bottom: 8px;
    z-index: 10;
}

.header-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pill {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
}

.ok { background: #14532d; color: #bbf7d0; }
.warn { background: #78350f; color: #fde68a; }
.bad { background: #7f1d1d; color: #fecaca; }
.info { background: #1e3a8a; color: #bfdbfe; }

.positive { color: #34d399; }
.negative { color: #f87171; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

.card-kpi { min-height: 112px; }

.accent-green { border-left: 3px solid #10b981; }
.accent-amber { border-left: 3px solid #f59e0b; }
.accent-violet { border-left: 3px solid #8b5cf6; }
.accent-blue { border-left: 3px solid #3b82f6; }
.accent-cyan { border-left: 3px solid #06b6d4; }

.ai-card {
    border: 1px solid rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.06);
}

.warning-card {
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.05);
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.compact-gap { gap: 12px; }

.value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 6px;
}

.value-small {
    font-size: 18px;
    font-weight: 700;
}

.muted,
.status-line {
    color: var(--muted);
    font-size: 12px;
}

.command-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.mini-stat {
    background: var(--card2);
    border: 1px solid var(--line2);
    border-radius: 12px;
    padding: 10px;
}

.mini-stat span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 4px;
}

.mini-stat strong { font-size: 16px; }

.btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btns.compact {
    margin-top: 0;
    justify-content: flex-end;
}

button {
    background: var(--blue);
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

button:hover { filter: brightness(1.08); }

button.alt { background: #475569; }
button.warn { background: var(--amber); }
button.bad { background: var(--red); }
button.save { background: var(--green); }
button.tap-export-json {
    background: #4f46e5;
    border: 1px solid #7c3aed;
}
button.tap-export-csv {
    background: #047857;
    border: 1px solid #0891b2;
}
button.tap-dryrun-reduce {
    background: #b45309;
    border: 1px solid #f59e0b;
}
button.tap-dryrun-block {
    background: #7f1d1d;
    border: 1px solid #ef4444;
}
button.tap-real-reduce {
    background: #92400e;
    border: 1px solid #f97316;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.18);
}
button.tap-real-block {
    background: #450a0a;
    border: 1px solid #dc2626;
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.22);
}
button.tap-revert {
    background: #334155;
    border: 1px solid #38bdf8;
}
button.tap-cleanup-dryrun {
    background: #155e75;
    border: 1px solid #22d3ee;
}
button.tap-cleanup-real {
    background: #7c2d12;
    border: 1px solid #fb923c;
}
.tap-real-label {
    margin-left: 4px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
}
.tap-dryrun-cell {
    min-width: 190px;
    display: grid;
    gap: 6px;
}
.tap-real-apply {
    display: grid;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.tap-magic-resolved {
    font-size: 11px;
    color: #bae6fd;
    font-weight: 800;
}
.tap-magic-unresolved {
    font-size: 11px;
    color: #fcd34d;
    line-height: 1.3;
}
.tap-dryrun-badge {
    width: fit-content;
    padding: 3px 8px;
}
.tap-dryrun-result {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.35;
}
.tap-real-result {
    font-size: 11px;
    color: #e2e8f0;
    line-height: 1.35;
    display: grid;
    gap: 4px;
}
.tap-real-applied {
    background: rgba(20, 83, 45, 0.55);
    color: #bbf7d0;
}
.tap-reverted {
    background: rgba(14, 116, 144, 0.45);
    color: #a5f3fc;
}
.tap-real-changed {
    background: rgba(120, 53, 15, 0.48);
    color: #fdba74;
}
.tap-real-skipped {
    background: rgba(113, 63, 18, 0.45);
    color: #fde68a;
}
.tap-real-audit-card .table-wrap {
    max-height: 520px;
    overflow: auto;
}
.tap-active-card .table-wrap {
    max-height: 460px;
    overflow: auto;
}
.tap-active-actions {
    min-width: 150px;
}
.tap-active-result {
    margin-top: 6px;
    display: grid;
    gap: 4px;
    font-size: 11px;
    color: #cbd5e1;
}
.tap-active-cleanup-result {
    font-size: 12px;
}
.tap-active-state-active {
    background: rgba(20, 83, 45, 0.55);
    color: #bbf7d0;
}
.tap-active-state-soon {
    background: rgba(113, 63, 18, 0.48);
    color: #fde68a;
}
.tap-active-state-expired {
    background: rgba(120, 53, 15, 0.55);
    color: #fdba74;
}
.tap-active-state-changed {
    background: rgba(127, 29, 29, 0.5);
    color: #fecaca;
}

.neural-brain-card {
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
    margin-top: 16px;
}

.neural-brain-shadow-card {
    border: 1px solid rgba(34, 211, 238, 0.38);
    background: linear-gradient(180deg, rgba(16, 24, 40, 0.98), rgba(19, 28, 48, 0.98));
}

.telemetry-shadow-patcher-card {
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: linear-gradient(180deg, rgba(15, 32, 28, 0.98), rgba(17, 28, 38, 0.98));
}

.ts-patcher-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ts-patcher-wide {
    grid-column: 1 / -1;
}

.ts-patcher-warnings {
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 8px;
    padding: 8px 10px;
    background: rgba(120, 53, 15, 0.15);
}

.ts-patcher-safety {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ts-patcher-unavailable {
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 8px;
    padding: 10px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.25);
}

.ts-patcher-drilldown {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(52, 211, 153, 0.18);
}

.ts-patcher-drilldown h3 {
    margin-bottom: 8px;
    color: #6ee7b7;
}

.ts-patcher-drilldown h4 {
    margin: 12px 0 6px;
    font-size: 13px;
    color: #94a3b8;
}

.ts-patcher-note {
    border-left: 3px solid rgba(52, 211, 153, 0.45);
    padding: 8px 10px;
    background: rgba(15, 32, 28, 0.35);
    border-radius: 4px;
}

.nb-shadow-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 700px;
}

.nb-shadow-chip {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.35);
    color: #dbeafe;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
}

.nb-shadow-safety {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.nb-shadow-ea-box {
    margin-top: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.45);
}

.nb-shadow-ea-btn {
    margin-top: 4px;
    border: 1px solid rgba(45, 212, 191, 0.45);
    background: rgba(15, 118, 110, 0.22);
    color: #99f6e4;
    font-size: 11px;
    padding: 4px 8px;
}

.nb-shadow-ea-btn:hover {
    background: rgba(15, 118, 110, 0.34);
}

.nb-shadow-ea-btn[disabled] {
    cursor: not-allowed;
    opacity: 0.7;
    background: rgba(51, 65, 85, 0.45);
    border-color: rgba(148, 163, 184, 0.45);
    color: #cbd5e1;
}

.neural-shadow-only {
    display: inline-block;
    font-size: 11px;
    color: #94a3b8;
}

.neural-shadow-mode {
    font-size: 10px;
}

.neural-shadow-warn {
    margin-top: 4px;
    font-size: 11px;
    color: #fbbf24;
}

.nb-shadow-consensus-box {
    margin-top: 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.32);
}

.nb-consensus-cards {
    margin-top: 8px;
}

.nb-shadow-score-box {
    margin-top: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    padding: 10px;
    background: rgba(15, 23, 42, 0.32);
}

.nb-consensus-table td,
.nb-consensus-table th {
    font-size: 12px;
}

.nb-consensus-table .nb-shadow-chip {
    margin-right: 6px;
    margin-bottom: 4px;
}

.nb-consensus-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.nb-consensus-defensive {
    background: rgba(180, 83, 9, 0.16);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
}

.nb-consensus-strong {
    background: rgba(127, 29, 29, 0.22);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.5);
}

.nb-consensus-monitor {
    background: rgba(30, 58, 138, 0.2);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, 0.45);
}

.nb-consensus-disagreement {
    background: rgba(161, 98, 7, 0.2);
    color: #fde68a;
    border-color: rgba(250, 204, 21, 0.45);
}

.nb-consensus-insufficient {
    background: rgba(100, 116, 139, 0.2);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.45);
}

.neural-brain-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.neural-brain-card .card-header h2,
.neural-brain-card .card-header p {
    margin: 0;
}

.nb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nb-select {
    background: rgba(15, 23, 42, 0.95);
    color: var(--text, #e2e8f0);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
}

.nb-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
}

.nb-item {
    background: rgba(2, 6, 23, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    padding: 10px;
    min-height: 58px;
}

.nb-wide {
    grid-column: span 2;
}

.nb-label {
    display: block;
    font-size: 11px;
    color: var(--muted, #94a3b8);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nb-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}

.evidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    margin-right: 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid transparent;
    vertical-align: middle;
}

.state-ok { background: rgba(5,150,105,.18); color: #34d399; border-color: rgba(52,211,153,.35); }
.state-zero-real { background: rgba(3,105,161,.18); color: #7dd3fc; border-color: rgba(125,211,252,.35); }
.state-no-evidence { background: rgba(148,163,184,.16); color: #cbd5e1; border-color: rgba(203,213,225,.25); }
.state-scope-filtered { background: rgba(234,179,8,.14); color: #fde68a; border-color: rgba(253,230,138,.35); }
.state-shadow { background: rgba(99,102,241,.18); color: #c7d2fe; border-color: rgba(199,210,254,.35); }
.state-fallback { background: rgba(14,116,144,.18); color: #a5f3fc; border-color: rgba(165,243,252,.35); }
.state-error { background: rgba(185,28,28,.18); color: #fca5a5; border-color: rgba(252,165,165,.35); }
.state-runtime-conflict { background: rgba(120,53,15,.2); color: #fdba74; border-color: rgba(253,186,116,.35); }
.state-high-risk { background: rgba(127,29,29,.24); color: #fecaca; border-color: rgba(252,165,165,.45); }
.state-not-implemented { background: rgba(71,85,105,.25); color: #e2e8f0; border-color: rgba(226,232,240,.3); }

.high-risk-action {
    position: relative;
    outline: 1px solid rgba(252, 165, 165, 0.45);
}

.high-risk-action .risk-tag {
    margin-left: 6px;
}

.nb-ok {
    background: rgba(5, 150, 105, 0.16);
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.35);
}

.nb-warning {
    background: rgba(180, 83, 9, 0.16);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
}

.nb-danger {
    background: rgba(185, 28, 28, 0.16);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.35);
}

.nb-info {
    background: rgba(37, 99, 235, 0.16);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.35);
}

.nb-unknown {
    background: rgba(100, 116, 139, 0.16);
    color: #cbd5e1;
    border-color: rgba(203, 213, 225, 0.25);
}

.nb-decision-box {
    margin-top: 14px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.45);
}

.nb-decision-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 700;
}

.nb-reasons {
    margin-top: 12px;
}

.nb-reasons ul {
    margin: 6px 0 0 18px;
    padding: 0;
    color: var(--text, #e2e8f0);
}

.nb-history {
    margin-top: 14px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 12px;
}

.nb-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 700;
    gap: 10px;
}

.nb-history-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 8px;
}

.nb-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.nb-history-table th,
.nb-history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
    text-align: left;
    white-space: nowrap;
}

.nb-history-table th {
    color: var(--muted, #94a3b8);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(2, 6, 23, 0.28);
}

.nb-history-table tr:last-child td {
    border-bottom: none;
}

.nb-history-action {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.nb-history-action.nb-ok {
    background: rgba(5, 150, 105, 0.16);
    color: #34d399;
}

.nb-history-action.nb-warning {
    background: rgba(180, 83, 9, 0.16);
    color: #fbbf24;
}

.nb-history-action.nb-danger {
    background: rgba(185, 28, 28, 0.16);
    color: #f87171;
}

.nb-history-action.nb-info {
    background: rgba(37, 99, 235, 0.16);
    color: #60a5fa;
}

.nb-history-action.nb-unknown {
    background: rgba(100, 116, 139, 0.16);
    color: #cbd5e1;
}

.nb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    font-size: 12px;
}

.neural-live-scan-card {
    border: 1px solid rgba(14, 165, 233, 0.35);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
    margin-top: 16px;
}

.neural-live-scan-card .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.neural-live-scan-card .card-header h2,
.neural-live-scan-card .card-header p {
    margin: 0;
}

.nb-live-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nb-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text, #e2e8f0);
}

.nb-live-research-note {
    margin: 0 0 12px;
    font-size: 12px;
}

.nb-input {
    background: rgba(15, 23, 42, 0.95);
    color: var(--text, #e2e8f0);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    min-width: 220px;
}

.nb-small {
    min-width: 80px;
    width: 90px;
}

.nb-live-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.nb-live-mini-summary {
    display: grid;
    grid-template-columns: repeat(8, minmax(120px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.nb-live-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 8px;
}

.nb-live-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.nb-live-table th,
.nb-live-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.10);
    text-align: left;
    white-space: nowrap;
}

.nb-live-table th {
    color: var(--muted, #94a3b8);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(2, 6, 23, 0.28);
}

.nb-live-table tr:last-child td {
    border-bottom: none;
}

.sentinel-admin-card,
.sentinel-ops-audit-card,
.sentinel-runtime-card {
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(15, 23, 42, 0.7);
}

.runtime-json-policy-card {
    border-color: rgba(14, 165, 233, 0.36);
}

.runtime-dry-run-warning {
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 8px;
    color: #fde68a;
    background: rgba(120, 53, 15, 0.18);
    font-size: 12px;
    font-weight: 700;
}

.ea-fleet-card {
    border: 1px solid rgba(34, 197, 94, 0.28);
    background: rgba(15, 23, 42, 0.74);
    margin-top: 16px;
}

.ea-fleet-table td,
.ea-fleet-table th {
    font-size: 11px;
}

.ea-fleet-status {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ea-fleet-status.ok {
    background: rgba(5, 150, 105, 0.16);
    color: #34d399;
}

.ea-fleet-status.warning {
    background: rgba(180, 83, 9, 0.16);
    color: #fbbf24;
}

.ea-fleet-status.danger {
    background: rgba(185, 28, 28, 0.16);
    color: #f87171;
}

.ea-fleet-status.legacy {
    background: rgba(124, 58, 237, 0.16);
    color: #c4b5fd;
}

.ea-fleet-status.info {
    background: rgba(37, 99, 235, 0.16);
    color: #93c5fd;
}

.ea-fleet-status.unknown {
    background: rgba(100, 116, 139, 0.16);
    color: #cbd5e1;
}

.ea-fleet-actions {
    display: inline-flex;
    gap: 6px;
}

.ea-fleet-actions button {
    padding: 4px 7px;
    font-size: 10px;
    border-radius: 6px;
}

.sentinel-admin-card code {
    color: #93c5fd;
}

.sentinel-ops-audit-card table td,
.sentinel-runtime-card table td {
    font-size: 11px;
}

.runtime-json-policy-card td {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1100px) {
    .nb-live-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .nb-live-mini-summary {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }
}

@media (max-width: 900px) {
    .nb-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .nb-wide {
        grid-column: span 2;
    }

    .neural-brain-card .card-header,
    .neural-live-scan-card .card-header,
    .nb-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
button.remove {
    background: #7f1d1d;
    padding: 6px 10px;
    font-size: 12px;
}
button.compact {
    padding: 6px 8px;
    font-size: 12px;
}
button.violet {
    border: 1px solid var(--violet);
    color: #d8b4fe;
}

.sim-off {
    border: 1px dashed var(--violet);
    background: transparent;
    color: #c4b5fd;
}

.sim-on {
    background: var(--violet);
    color: white;
}

.btn-panic {
    background: #ef4444;
    color: white;
    border: 2px solid #b91c1c;
    animation: pulse 2s infinite;
}

.btn-news {
    background: #f59e0b;
    color: #1e293b;
    border: 2px solid #d97706;
}

.btn-news.active {
    animation: pulseNews 1.5s infinite;
}

.btn-ai {
    background: var(--violet);
    color: white;
    border: 2px solid #6d28d9;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.35);
}

.btn-ai-mini {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
    background: var(--violet);
    color: #fff;
    border: 1px solid #6d28d9;
    box-shadow: none;
}

.input-mini {
    width: 90px;
    padding: 9px 10px;
    background: #0b1220;
    color: var(--text);
    border: 1px solid #334155;
    border-radius: 10px;
}

.input-mini.wide { width: 180px; }

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.tap-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.tap-summary-grid .nb-wide {
    grid-column: 1 / -1;
}

.tap-summary-grid div {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px 14px;
}

.tap-summary-grid .muted {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
}

.tap-summary-grid strong {
    font-size: 1.1rem;
    display: block;
    margin-top: 4px;
}

.tap-status-pill {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    display: inline-block;
}

.tap-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
}

.nb-check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b6c2d9;
}

.tap-filter-btn {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.tap-filter-btn:hover {
    border-color: #64748b;
    color: #cbd5e1;
}

.tap-filter-btn.active {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
    font-weight: 600;
}

.tap-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tap-monitor {
    background: rgba(30, 58, 138, 0.4);
    color: #93c5fd;
}

.tap-reduce {
    background: rgba(120, 53, 15, 0.45);
    color: #fed7aa;
}

.tap-block {
    background: rgba(127, 29, 29, 0.5);
    color: #fca5a5;
}

.tap-promote {
    background: rgba(20, 83, 45, 0.45);
    color: #86efac;
}

.tap-reject {
    background: rgba(127, 29, 29, 0.6);
    color: #fecaca;
    font-weight: 800;
}

.tap-state-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.tap-state-healthy {
    background: rgba(20, 83, 45, 0.5);
    color: #86efac;
}

.tap-state-watch {
    background: rgba(66, 32, 6, 0.5);
    color: #fed7aa;
}

.tap-state-degrading {
    background: rgba(67, 20, 7, 0.5);
    color: #fca5a5;
}

.tap-state-critical {
    background: rgba(127, 29, 29, 0.5);
    color: #fecaca;
}

.tap-state-recovering {
    background: rgba(26, 46, 5, 0.5);
    color: #a3e635;
}

.tap-state-neutral {
    background: rgba(30, 41, 59, 0.4);
    color: #94a3b8;
}

/* TAP Source Selector & Badges */
.tap-source-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tap-source-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #334155;
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
}

.tap-source-btn:hover {
    border-color: #64748b;
    color: #cbd5e1;
}

.tap-source-btn.active {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
    font-weight: 600;
}

.tap-source-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tap-source-tb {
    background: rgba(30, 58, 138, 0.5);
    color: #93c5fd;
}

.tap-source-hc {
    background: rgba(88, 28, 135, 0.5);
    color: #d8b4fe;
}

.small-wrap {
    max-height: 250px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 9px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
    vertical-align: top;
}

th {
    color: #93c5fd;
    position: sticky;
    top: 0;
    background: rgba(17, 24, 39, 0.96);
}

ul {
    margin: 0;
    padding-left: 18px;
}

input,
select {
    width: 100%;
    padding: 8px;
    background: #0b1220;
    color: var(--text);
    border: 1px solid #334155;
    border-radius: 8px;
    margin-top: 4px;
}

label {
    display: block;
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 10px;
}

.formgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.formgrid-3 { grid-template-columns: repeat(3, 1fr); }
.span-3 { grid-column: span 3; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.mini-info-card { padding: 12px 16px; }

.mini-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    color: #cbd5e1;
    font-size: 13px;
}

.inline-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.ai-summary {
    font-size: 15px;
    font-weight: 700;
    color: #ddd6fe;
    margin-bottom: 8px;
}

.ai-summary strong { color: #fff; }

.ai-report {
    white-space: pre-wrap;
    line-height: 1.5;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.text-center { text-align: center; color: var(--muted); }

#heartbeat {
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes pulseNews {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.heat-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.heat-grid-days {
    grid-template-columns: repeat(4, 1fr);
}

.heat-cell {
    border: 1px solid var(--line2);
    border-radius: 12px;
    padding: 10px;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.9);
}

.heat-cell strong { font-size: 18px; }
.heat-cell small { color: var(--muted); }

.heat-label {
    font-size: 12px;
    color: #cbd5e1;
    font-weight: 700;
}

.heat-hot {
    background: rgba(22, 101, 52, 0.45);
    border-color: rgba(34, 197, 94, 0.45);
}

.heat-warm {
    background: rgba(3, 105, 161, 0.35);
    border-color: rgba(56, 189, 248, 0.40);
}

.heat-cool {
    background: rgba(120, 53, 15, 0.35);
    border-color: rgba(251, 191, 36, 0.35);
}

.heat-cold {
    background: rgba(127, 29, 29, 0.45);
    border-color: rgba(248, 113, 113, 0.40);
}

.heat-empty { opacity: 0.65; }

.phase-table-wrap { max-height: 360px; }

.sparkline {
    width: 120px;
    height: 32px;
    display: block;
}

.sparkline polyline { stroke: #60a5fa; }
.sparkline.spark-up polyline { stroke: #34d399; }
.sparkline.spark-down polyline { stroke: #f87171; }

.chart-tooltip {
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
}

.badge-subtle { opacity: 0.8; }
.phase-table-wrap table td { white-space: nowrap; }
.phase-table-wrap table td:last-child { white-space: normal; }

.multi-account-card {
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: rgba(37, 99, 235, 0.04);
}

.multi-account-grid {
    grid-template-columns: repeat(6, 1fr);
    margin-bottom: 14px;
}

.account-select-label {
    min-width: 260px;
    margin-bottom: 0;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.account-card {
    background: var(--card2);
    border: 1px solid var(--line2);
    border-radius: 12px;
    padding: 12px;
}

.account-card.selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.account-card.online { border-left: 4px solid #10b981; }
.account-card.stale { border-left: 4px solid #f59e0b; }
.account-card.offline {
    border-left: 4px solid #ef4444;
    opacity: 0.82;
}

.account-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.account-card-title {
    font-weight: 700;
    color: #e2e8f0;
}

.account-card-meta {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.account-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    font-size: 12px;
    margin-top: 8px;
}

.account-warnings {
    margin-top: 8px;
    color: #fdba74;
    font-size: 12px;
}

.account-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.account-actions button {
    padding: 6px 8px;
    font-size: 12px;
}

.account-badge-monitor { background: #14532d; color: #bbf7d0; }
.account-badge-reduce { background: #78350f; color: #fde68a; }
.account-badge-block { background: #7f1d1d; color: #fecaca; }
.account-badge-stale { background: #78350f; color: #fde68a; }
.account-badge-offline { background: #7f1d1d; color: #fecaca; }

.ai-toolbar { align-items: center; }
.ai-top-grid .ai-metric { min-height: 98px; }
.ai-metric small { display: block; margin-top: 6px; }

.ai-stack-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--line2);
    border-radius: 12px;
}

.ai-stack-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}

.ai-stack-list li { color: #dbe4f0; }

.ai-history-card {
    margin-top: 12px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.compact-head { margin-bottom: 8px; }

.ai-metric strong.pill-like {
    display: inline-block;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
}

.ai-inline-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    width: fit-content;
}

.ai-inline-pill.ok { background: rgba(5, 150, 105, 0.2); color: #86efac; }
.ai-inline-pill.info { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
.ai-inline-pill.warn { background: rgba(180, 83, 9, 0.22); color: #fcd34d; }
.ai-inline-pill.bad { background: rgba(185, 28, 28, 0.24); color: #fca5a5; }

.ai-sample-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.ai-sample-grid > div {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    padding: 10px 12px;
}

.ai-sample-grid strong {
    display: block;
    font-size: 12px;
    color: #cbd5e1;
    margin-bottom: 4px;
}

.ai-sample-grid div div {
    font-size: 18px;
    font-weight: 800;
    color: #f8fafc;
}

.ai-sample-narrative {
    margin-top: 12px;
    line-height: 1.45;
}

.ai-why-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.ai-why-pill.ok { background: rgba(5, 150, 105, 0.18); color: #86efac; }
.ai-why-pill.info { background: rgba(37, 99, 235, 0.18); color: #93c5fd; }
.ai-why-pill.warn { background: rgba(180, 83, 9, 0.22); color: #fcd34d; }
.ai-why-pill.bad { background: rgba(185, 28, 28, 0.22); color: #fca5a5; }

.ai-audit-grid { margin-top: 10px; }

.ai-sandbox-card {
    margin-bottom: 12px;
    border: 1px solid rgba(16, 185, 129, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

.sandbox-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sandbox-controls label {
    display: grid;
    gap: 4px;
    color: #cbd5e1;
    font-size: 12px;
}

.sandbox-controls input[type="range"] {
    width: 120px;
    accent-color: #8b5cf6;
}

/* --- ESTILOS DE LA VENTANA MODAL IA --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.72);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100001;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal-content.ai-modal-theme {
    background-color: #1e222d;
    border: 1px solid #363c4e;
    border-radius: 12px;
    width: min(90%, 720px);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    color: #d1d4dc;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid #363c4e;
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #fff;
}

.close-modal {
    background: transparent;
    border: none;
    color: #8c909e;
    font-size: 1.6rem;
    line-height: 1;
    padding: 0;
    margin: 0;
    cursor: pointer;
    box-shadow: none;
    min-width: auto;
}

.close-modal:hover {
    color: #ef5350;
    filter: none;
}

.modal-body {
    padding: 20px;
    max-height: calc(85vh - 130px);
    overflow-y: auto;
    line-height: 1.55;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #363c4e;
    text-align: right;
    background: rgba(255, 255, 255, 0.02);
}

.btn {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    border: none;
}

.btn-secondary {
    background-color: #363c4e;
    color: #d1d4dc;
}

.btn-secondary:hover {
    background-color: #4b5263;
}

#aiLoadingIndicator {
    color: #cbd5e1;
    font-size: 14px;
}

.ai-rec-promote { color: #26a69a; font-weight: 700; }
.ai-rec-reduce  { color: #ffca28; font-weight: 700; }
.ai-rec-block   { color: #ef5350; font-weight: 700; }
.ai-rec-hold    { color: #8c909e; font-weight: 700; }

@media (max-width: 1400px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .command-bar { grid-template-columns: repeat(2, 1fr); }
    .formgrid-3 { grid-template-columns: repeat(2, 1fr); }
    .span-3 { grid-column: span 2; }
}

@media (max-width: 1200px) {
    .heat-grid { grid-template-columns: repeat(4, 1fr); }
    .heat-grid-days { grid-template-columns: repeat(3, 1fr); }
    .multi-account-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .grid-2,
    .grid-3,
    .grid-4,
    .command-bar,
    .formgrid,
    .formgrid-3,
    .mini-info-grid {
        grid-template-columns: 1fr;
    }

    .span-3 { grid-column: span 1; }
    body { padding: 12px; }
    h1 { font-size: 26px; }
    .section-head { flex-direction: column; }
    .heat-grid,
    .heat-grid-days { grid-template-columns: repeat(2, 1fr); }
    .sparkline { width: 90px; }
    .phase-table-wrap { max-height: none; }
    .account-select-label { min-width: 100%; }
    .ai-top-grid { grid-template-columns: 1fr 1fr; }
    .ai-sample-grid { grid-template-columns: 1fr; }
    .sandbox-controls { width: 100%; }
    .sandbox-controls label { width: 100%; }
}

@media (max-width: 768px) {
    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-content.ai-modal-theme {
        width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .modal-body {
        max-height: calc(90vh - 130px);
    }
}

.health-settings-card {
    margin-top: 8px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

.health-settings-grid label {
    margin-bottom: 0;
}

#healthCopilotSettingsMeta {
    margin-top: 8px;
}

.panel-state {
    margin: 10px 0 12px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    font-size: 12px;
}

.panel-state-error {
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.18);
}

.panel-state-ok {
    border-color: rgba(52, 211, 153, 0.35);
    color: #bbf7d0;
    background: rgba(6, 78, 59, 0.18);
}

.panel-state-loading,
.panel-state-empty {
    border-color: rgba(96, 165, 250, 0.28);
    color: #bfdbfe;
}

.market-oracle-panel .market-oracle-grid {
    margin-top: 12px;
}

.market-oracle-header .header-badges {
    margin-top: 8px;
}

.market-oracle-card {
    min-height: 170px;
}

.oracle-gauge-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.oracle-gauge {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: conic-gradient(#60a5fa 0deg, #1f2937 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    font-weight: 700;
    color: #e2e8f0;
}

.oracle-gauge::after {
    content: "";
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #0b1220;
}

.oracle-gauge span {
    position: relative;
    z-index: 1;
    font-size: 12px;
}

.market-oracle-bars {
    display: grid;
    gap: 8px;
}

.market-oracle-flow {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
}

.market-oracle-flow > div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

.market-oracle-compact .market-oracle-detail-only {
    display: none;
}

.market-oracle-extended-strip {
    margin-top: 14px;
    border: 1px solid rgba(56, 189, 248, 0.28);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(17, 24, 39, 0.98));
}

.market-oracle-extended-strip .card {
    margin-bottom: 10px;
}

.market-oracle-extended-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
}

.frontend-performance-card {
    border: 1px solid rgba(34, 211, 238, 0.28);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.98));
}

.frontend-perf-grid {
    margin-bottom: 12px;
}

.frontend-perf-list {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    padding: 10px;
    background: rgba(2, 6, 23, 0.25);
}

.frontend-perf-list h3 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #e2e8f0;
}

.frontend-perf-scroll {
    max-height: 150px;
    overflow: auto;
    font-size: 12px;
    line-height: 1.55;
}

.sentinel-authority-card {
    border: 1px solid rgba(239, 68, 68, 0.22);
    background: rgba(15, 23, 42, 0.76);
}

.sentinel-conflict-policy-card {
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(15, 23, 42, 0.72);
}

.authority-warnings-list {
    margin: 8px 0 0 18px;
    padding: 0;
    color: #f1f5f9;
    font-size: 12px;
}

.authority-warnings-list li {
    margin-bottom: 4px;
}

.sentinel-workspace-nav {
    position: sticky;
    top: 82px;
    z-index: 80;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(10px);
}

.sentinel-workspace-nav button,
.sentinel-panel-actions button {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.9);
    color: #e2e8f0;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.sentinel-workspace-nav button:hover,
.sentinel-panel-actions button:hover {
    border-color: rgba(96, 165, 250, 0.6);
}

.sentinel-workspace-spacer {
    flex: 1 1 auto;
}

.sentinel-collapsible-panel > .section-head,
.sentinel-collapsible-panel > .card-header {
    cursor: default;
}

.sentinel-panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}

.sentinel-panel-collapsed > .sentinel-panel-body {
    display: none;
}

.sentinel-panel-collapsed {
    padding-bottom: 12px;
}

.sentinel-compact-mode table td,
.sentinel-compact-mode table th {
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 11px;
}

.sentinel-compact-mode .tap-magic-unresolved,
.sentinel-compact-mode .tap-magic-resolved,
.sentinel-compact-mode .nb-shadow-reasons,
.sentinel-compact-mode .muted[style*="margin-top:6px"] {
    display: none;
}

.ea-compact-detail-btn {
    display: none;
}

.sentinel-compact-mode .ea-compact-detail-btn {
    display: inline-flex;
}

.sentinel-compact-mode [data-ea-row="1"] button:not(.ea-compact-detail-btn):not(.nb-shadow-ea-btn) {
    max-height: 24px;
}

.ea-explorer-modal[hidden] {
    display: none;
}

.ea-explorer-modal {
    position: fixed;
    inset: 18px;
    z-index: 3000;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(8px);
}

.ea-explorer-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
    background: #0b1120;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.ea-explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.ea-explorer-header h2 {
    margin: 0;
}

.ea-explorer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.ea-explorer-main {
    min-height: 0;
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.ea-explorer-table-wrap {
    min-width: 0;
    overflow: auto;
    padding: 12px;
}

.ea-explorer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ea-explorer-table th,
.ea-explorer-table td {
    padding: 8px 9px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    white-space: nowrap;
    text-align: left;
}

.ea-explorer-detail {
    border-left: 1px solid rgba(148, 163, 184, 0.14);
    padding: 12px;
    overflow: auto;
    background: rgba(15, 23, 42, 0.72);
}

.ea-explorer-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

.ea-explorer-detail-grid div {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 7px;
    padding: 8px;
    background: rgba(2, 6, 23, 0.28);
}

.ea-explorer-detail-grid span {
    display: block;
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
}

.ea-explorer-json {
    margin-top: 10px;
    max-height: 280px;
    overflow: auto;
    padding: 10px;
    border-radius: 7px;
    background: rgba(2, 6, 23, 0.55);
    color: #cbd5e1;
    font-size: 11px;
}

.ea-explorer-pager {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 10px;
}

body.ea-explorer-open {
    overflow: hidden;
}

@media (max-width: 1000px) {
    .ea-explorer-modal {
        inset: 8px;
    }

    .ea-explorer-main {
        grid-template-columns: 1fr;
    }

    .ea-explorer-detail {
        border-left: none;
        border-top: 1px solid rgba(148, 163, 184, 0.14);
        max-height: 40vh;
    }
}
