/* NEXUS AI Subscription Button & Panel */
.chat-header-btn.nexus-sub-btn {
    width: auto;
    padding: 0 10px;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    position: relative;
}
.nexus-sub-text {
    color: inherit;
}
.nexus-sub-text.premium {
    color: #00ff88;
}
.nexus-sub-text.covered {
    color: var(--blue-status, #3b82f6);   /* a plan label: status blue (TASK 105 item 3) */
}
/* Light (TASK 105 item 2): the NEXUS badge had no light rule, so it painted the dark
   values on the white header — #00ff88 is 1.34:1, #3b82f6 3.68:1. #047857 is 5.48:1;
   --blue-status is #1d4ed8 in light, 6.70:1. */
[data-theme="light"] .nexus-sub-text.premium {
    color: #047857;
}
[data-theme="light"] .nexus-sub-text.covered {
    color: var(--blue-status, #1d4ed8);
}
.nexus-sub-panel {
    position: fixed;
    top: 60px;
    right: 60px;
    width: 320px;
    background: rgba(10, 14, 23, 0.97);
    border: 1px solid rgba(0, 207, 255, 0.2);
    border-radius: var(--panel-radius);
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    overflow: hidden;
}
.nexus-sub-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--panel-border);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #00cfff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nexus-sub-close {
    background: none;
    border: none;
    color: rgba(0,207,255,0.72);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nexus-sub-close:hover { color: #fff; }
.nexus-sub-panel-body {
    padding: 16px;
}
.nexus-sub-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nexus-sub-tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: center;
}
.nexus-sub-tier-badge.premium {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.2);
}
.nexus-sub-tier-badge.payperuse {
    background: rgba(0, 207, 255, 0.1);
    color: #00cfff;
    border: 1px solid rgba(0, 207, 255, 0.2);
}
.nexus-sub-tier-badge.free {
    background: rgba(155, 163, 168, 0.1);
    color: rgba(0,207,255,0.72);
    border: 1px solid rgba(155, 163, 168, 0.2);
}
.nexus-sub-tier-badge.covered {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-status, #3b82f6);   /* tier label: status blue */
    border: 1px solid rgba(59, 130, 246, 0.2);
}
.nexus-sub-detail {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: rgba(0,207,255,0.72);
    font-family: 'JetBrains Mono', monospace;
}
.nexus-sub-detail span:last-child {
    color: #f9fafb;
    font-weight: 500;
}
.nexus-sub-note {
    font-size: 12px;
    color: rgba(0,207,255,0.72);
    line-height: 1.5;
    margin: 4px 0 0;
}
.nexus-sub-upgrade {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nexus-sub-price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 700;
    color: #00ff88;
    text-align: center;
    margin: 4px 0;
}
.nexus-sub-price span {
    font-size: 14px;
    color: rgba(0,207,255,0.72);
    font-weight: 400;
}
.nexus-sub-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nexus-sub-features li {
    font-size: 12px;
    color: rgba(0,207,255,0.72);
    padding-left: 18px;
    position: relative;
}
.nexus-sub-features li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #00ff88;
    font-weight: 700;
}
.nexus-sub-action-btn {
    display: block;
    width: 100%;
    padding: 12px;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s;
}
.nexus-sub-action-btn.subscribe {
    background: #00ff88;
    color: #000;
}
.nexus-sub-action-btn.subscribe:hover {
    background: #00e67a;
    box-shadow: 0 0 16px rgba(0, 255, 136, 0.3);
}
.nexus-sub-action-btn.subscribe:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.nexus-sub-action-btn.cancel {
    background: transparent;
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
    margin-top: 4px;
}
.nexus-sub-action-btn.cancel:hover {
    background: rgba(255, 68, 68, 0.1);
}
.nexus-sub-warn {
    font-size: 12px;
    color: #ff4444;
    text-align: center;
    margin: 4px 0 0;
}
.nexus-sub-error {
    font-size: 12px;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.08);
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}
.nexus-sub-loading {
    text-align: center;
    color: rgba(0,207,255,0.72);
    font-size: 13px;
    padding: 20px 0;
}
@media (max-width: 768px) {
    .nexus-sub-panel {
        right: 8px;
        width: calc(100vw - 16px);
        max-width: 320px;
        max-height: 80vh;
        overflow-y: auto;
    }
    .chat-header .nexus-sub-btn .nexus-sub-text {
        display: none;
    }
}
@media (max-width: 400px) {
    .nexus-sub-panel {
        right: 4px;
        left: 4px;
        width: auto;
        max-width: none;
    }
    .nexus-sub-price {
        font-size: 24px;
    }
}

/* ── NEXUS build plans: usage bars, breakdown, plan cards (2026-09-25) ────── */
.nexus-sub-tier-badge.plan-free { background: rgba(0,207,255,0.06); color: rgba(0,207,255,0.72); border: 1px solid rgba(0,207,255,0.18); }
.nexus-sub-tier-badge.plan-pro { background: rgba(0,207,255,0.1); color: #00cfff; border: 1px solid rgba(0,207,255,0.2); }
.nexus-sub-tier-badge.plan-max5 { background: rgba(59,130,246,0.12); color: var(--blue-status, #3b82f6); border: 1px solid rgba(59,130,246,0.25); }
.nexus-sub-tier-badge.plan-max20 { background: rgba(0,255,136,0.1); color: #00ff88; border: 1px solid rgba(0,255,136,0.2); }
.nxu-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nxu-price { color: #f9fafb; font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; }
.nxu-pending { color: rgba(0,207,255,0.72); font-size: 12px; }
.nxu-row { display: flex; flex-direction: column; gap: 5px; }
.nxu-row-head, .nxu-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: 'JetBrains Mono', monospace; }
.nxu-row-head { font-size: 12px; }
.nxu-label { color: rgba(0,207,255,0.72); text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; }
.nxu-pct { color: #f9fafb; font-weight: 600; }
.nxu-pct.warn, .nxu-pct.crit { color: #ff4444; }
.nxu-bar { height: 8px; border-radius: 999px; background: rgba(0,150,255,0.12); overflow: hidden; }
.nxu-fill { height: 100%; border-radius: 999px; background: #00cfff; transition: width .4s ease; }
.nxu-fill.warn, .nxu-fill.crit { background: #ff4444; }
.nxu-foot { font-size: 11px; color: rgba(0,207,255,0.6); }
.nxu-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #f9fafb; font-family: 'JetBrains Mono', monospace; }
.nxu-actions { display: flex; gap: 6px; }
.nxu-mini { min-height: 32px; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(0,207,255,0.35); background: transparent; color: #00cfff; font-size: 11px; font-weight: 600; cursor: pointer; }
.nxu-mini:hover { background: rgba(0,207,255,0.1); }
.nxu-mini:disabled { opacity: .4; cursor: default; }
.nxu-bd { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; border-top: 1px solid var(--panel-border); }
.nxu-toggle { display: inline-flex; border: 1px solid rgba(0,207,255,0.25); border-radius: 6px; overflow: hidden; }
.nxu-tab { background: transparent; border: 0; color: rgba(0,207,255,0.72); font-size: 11px; padding: 4px 10px; min-height: 28px; cursor: pointer; }
.nxu-tab.on { background: rgba(0,207,255,0.15); color: #00cfff; }
.nxu-bd-row { display: grid; grid-template-columns: 1fr 90px 40px; align-items: center; gap: 8px; font-size: 12px; color: #f9fafb; }
.nxu-bd-bar { height: 6px; border-radius: 999px; background: rgba(0,150,255,0.12); overflow: hidden; display: block; }
.nxu-bd-bar span { display: block; height: 100%; background: var(--blue-data, #3b82f6); border-radius: 999px; }
.nxu-bd-pct { text-align: right; font-family: 'JetBrains Mono', monospace; color: rgba(0,207,255,0.72); }
.nxu-muted { color: rgba(0,207,255,0.6); font-size: 12px; margin: 0; line-height: 1.5; }
/* ET-32414: what a plan bills now for this account, and the shortfall if any */
.nxu-plan-now { margin: 2px 0 6px; }
.nxu-short { color: var(--text-heading); font-weight: 600; }
.nxu-stale { font-size: 11px; color: #ff4444; }
.nxu-link { background: none; border: 0; color: #00cfff; font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.nxu-more { display: block; text-align: right; }
.nxu-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 10px; border-top: 1px solid var(--panel-border); }
.nxu-plan-card { background: rgba(17,24,39,0.6); border: 1px solid rgba(0,150,255,0.15); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.nxu-plan-card.on { border-color: rgba(0,207,255,0.5); }
.nxu-plan-name { color: #f9fafb; font-weight: 700; font-size: 13px; display: flex; justify-content: space-between; }
.nxu-mult { color: rgba(0,207,255,0.72); font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.nxu-plan-price { color: #00cfff; font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.nxu-current { color: #00ff88; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.nxu-plan-btn { margin-top: auto; font-size: 11px; padding: 6px 8px; }
.nxu-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: rgba(10,14,23,0.97); color: #f9fafb; border: 1px solid rgba(0,207,255,0.35); border-radius: 8px; padding: 10px 14px; font-size: 13px; z-index: 10001; box-shadow: 0 8px 32px rgba(0,0,0,.5); transition: opacity .3s, transform .3s; max-width: calc(100vw - 32px); }
.nxu-toast.show { opacity: 1; transform: translate(-50%, 0); }
.nxu-toast.crit { border-color: #ff4444; }
@media (max-width: 400px) { .nxu-plans { grid-template-columns: 1fr; } }

/* ET-27425: itemised usage under the breakdown */
.nxu-bd-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.45; }
.nxu-items { margin-top: 10px; border-top: 1px solid rgba(0,150,255,0.15); padding-top: 8px; }
.nxu-item { display: grid; grid-template-columns: 1fr auto 60px; gap: 8px; align-items: center; font-size: 12px; color: #f9fafb; padding: 3px 0; }
.nxu-item a { color: #00cfff; text-decoration: none; }
.nxu-item a:hover { text-decoration: underline; }
