:root {
    --bg-0: #050816;
    --bg-1: #08101f;
    --bg-2: #0d172b;
    --bg-3: #101f38;
    --panel: rgba(9, 20, 38, 0.82);
    --panel-strong: rgba(10, 24, 46, 0.92);
    --line: rgba(77, 163, 255, 0.24);
    --line-strong: rgba(88, 194, 255, 0.55);
    --text-1: #e8f6ff;
    --text-2: #97adca;
    --text-3: #5f7493;
    --cyan: #62d8ff;
    --teal: #34ffd2;
    --blue: #5aa8ff;
    --gold: #ffd166;
    --magenta: #c87bff;
    --red: #ff6b7a;
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 10px 32px rgba(0, 0, 0, 0.35);
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    min-height: 100%;
}

body {
    font-family: Inter, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
    background:
        radial-gradient(circle at top center, rgba(63, 121, 255, 0.24), transparent 32%),
        radial-gradient(circle at 15% 20%, rgba(0, 255, 209, 0.12), transparent 28%),
        linear-gradient(180deg, #060b17 0%, #081221 32%, #050915 100%);
    color: var(--text-1);
    overflow-x: hidden;
    overflow-y: auto;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(rgba(98, 216, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(98, 216, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 45%, transparent 100%);
}

#app {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 18px;
    gap: 14px;
}

.hud-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 80% 18%, rgba(98, 216, 255, 0.08), transparent 18%),
        radial-gradient(circle at 20% 78%, rgba(200, 123, 255, 0.10), transparent 22%);
}

.top-shell {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 22px 24px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(10, 22, 42, 0.96), rgba(8, 16, 30, 0.92));
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

.top-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 15%, rgba(98,216,255,0.10), transparent 30%);
    pointer-events: none;
}

.top-shell::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(98, 216, 255, 0.7), transparent);
}

.brand-block {
    position: relative;
    z-index: 1;
}

.brand-block::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -14px;
    width: 180px;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), transparent);
    opacity: 0.8;
}

.brand-kicker {
    color: var(--cyan);
    letter-spacing: 0.22em;
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.brand-title {
    font-size: clamp(30px, 4vw, 54px);
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #f4fbff;
    text-shadow: 0 0 24px rgba(98, 216, 255, 0.25);
}

.brand-subtitle {
    color: var(--text-2);
    margin-top: 10px;
    max-width: 760px;
    font-size: 14px;
}

.top-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    max-width: 420px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(98, 216, 255, 0.18);
    background: rgba(8, 16, 30, 0.82);
    color: var(--text-2);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-chip strong {
    color: var(--text-1);
    font-weight: 700;
}

.meta-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--teal);
    box-shadow: 0 0 12px var(--teal);
    animation: pulseDot 1.8s infinite ease-in-out;
}

.meta-chip.live.is-syncing {
    border-color: rgba(255, 209, 102, 0.55);
    box-shadow: 0 0 18px rgba(255, 209, 102, 0.12);
}
.meta-chip.live.is-syncing .meta-dot {
    background: var(--gold);
    box-shadow: 0 0 14px var(--gold);
}
.meta-chip.live.is-online {
    border-color: rgba(52, 255, 210, 0.45);
    box-shadow: 0 0 20px rgba(52, 255, 210, 0.14);
}
.meta-chip.live.is-online .meta-dot {
    background: var(--teal);
    box-shadow: 0 0 14px var(--teal);
}
.meta-chip.live.is-offline {
    border-color: rgba(255, 107, 122, 0.45);
    box-shadow: 0 0 20px rgba(255, 107, 122, 0.12);
}
.meta-chip.live.is-offline .meta-dot {
    background: var(--red);
    box-shadow: 0 0 14px var(--red);
}

@keyframes pulseDot {
    0%, 100% { transform: scale(0.9); opacity: 0.65; }
    50% { transform: scale(1.15); opacity: 1; }
}

.tab-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.tab-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: 16px;
    border: 1px solid rgba(98, 216, 255, 0.16);
    background: rgba(7, 14, 27, 0.75);
    color: var(--text-2);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s ease;
}

.tab-btn::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 6px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(98,216,255,0.92), transparent);
    transform: scaleX(0.25);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.tab-btn:hover,
.tab-btn.active {
    color: var(--text-1);
    border-color: rgba(98, 216, 255, 0.6);
    background: linear-gradient(180deg, rgba(18, 39, 74, 0.95), rgba(10, 22, 42, 0.85));
    box-shadow: inset 0 0 0 1px rgba(98, 216, 255, 0.16), 0 0 24px rgba(98, 216, 255, 0.12);
}

.tab-btn.active::after,
.tab-btn:hover::after {
    transform: scaleX(1);
    opacity: 1;
}

.tab-icon {
    color: var(--cyan);
}

.dashboard-content {
    flex: 1;
    overflow-y: visible;
    overflow-x: hidden;
    padding-right: 6px;
    padding-bottom: 20px;
}

.dashboard-content::-webkit-scrollbar {
    width: 10px;
}

.dashboard-content::-webkit-scrollbar-thumb {
    background: rgba(98, 216, 255, 0.18);
    border-radius: 999px;
}

.tab-content { display: none; opacity: 0; transform: translateY(10px); }
.tab-content.active { display: block !important; opacity: 1 !important; transform: translateY(0) !important; 
    display: block;
    animation: fadeIn 0.24s ease;
}

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

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.85fr);
    gap: 16px;
    margin-bottom: 18px;
}

.hero-panel,
.panel,
.stat-card,
.metric-card,
.cost-card,
.agent-mini-card,
.agent-detail-card,
.mission-item,
.cron-item,
.trivia-card,
.agent-stat {
    position: relative;
    background: linear-gradient(180deg, rgba(11, 24, 45, 0.94), rgba(7, 14, 28, 0.90));
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.hero-panel::before,
.panel::before,
.stat-card::before,
.metric-card::before,
.cost-card::before,
.agent-mini-card::before,
.agent-detail-card::before,
.mission-item::before,
.cron-item::before,
.trivia-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(98, 216, 255, 0.08), transparent 30%, transparent 70%, rgba(52, 255, 210, 0.06));
    pointer-events: none;
}

.command-panel {
    padding: 24px;
    min-height: clamp(320px, 42vh, 430px);
}

.signal-panel {
    padding: 22px;
    min-height: clamp(320px, 42vh, 430px);
}

.panel-eyebrow {
    color: var(--cyan);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    margin-bottom: 14px;
}

.hero-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 16px;
    align-items: center;
}

.hero-title {
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1.05;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.hero-copy {
    color: var(--text-2);
    max-width: 62ch;
    font-size: 15px;
    line-height: 1.7;
}

.hero-ring {
    position: relative;
    width: 160px;
    height: 160px;
    margin-inline: auto;
    border-radius: 50%;
    border: 1px solid rgba(98, 216, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(98,216,255,0.06), rgba(98,216,255,0.01) 60%, transparent 70%);
    box-shadow: inset 0 0 24px rgba(98, 216, 255, 0.1), 0 0 32px rgba(98, 216, 255, 0.08);
}

.hero-ring::before,
.hero-ring::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    inset: 12px;
    border: 1px dashed rgba(98, 216, 255, 0.22);
    animation: spinSlow 16s linear infinite;
}

.hero-ring::after {
    inset: 28px;
    border-style: solid;
    border-color: rgba(52, 255, 210, 0.18);
    animation-direction: reverse;
    animation-duration: 12s;
}

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

.hero-ring-core {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(98, 216, 255, 0.95), rgba(98, 216, 255, 0.18) 70%, transparent 72%);
    box-shadow: 0 0 30px rgba(98, 216, 255, 0.45);
}

.hero-ring-core::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 1px solid rgba(98,216,255,0.18);
    animation: pulseHalo 2.8s ease-in-out infinite;
}

@keyframes pulseHalo {
    0%, 100% { transform: scale(0.92); opacity: 0.4; }
    50% { transform: scale(1.08); opacity: 1; }
}

.hero-ring-label {
    position: absolute;
    bottom: 18px;
    font-size: 12px;
    letter-spacing: 0.28em;
    color: var(--cyan);
}

.hero-panel.command-panel::after {
    content: "";
    position: absolute;
    inset: auto 24px 18px 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(98,216,255,0.55), rgba(52,255,210,0.55), transparent);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.command-metrics {
    margin-top: 24px;
}

.command-metrics .stat-card {
    backdrop-filter: blur(10px);
}

.stat-card {
    padding: 18px;
    min-height: 150px;
}

.card-header,
.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header { margin-bottom: 14px; }

.card-icon,
.panel-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    border: 1px solid rgba(98, 216, 255, 0.24);
    background: rgba(98, 216, 255, 0.07);
}

.card-title,
.panel-title,
.metric-label,
.agent-stat-label {
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
}

.card-value {
    font-size: clamp(34px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}

.card-sub,
.card-status,
.panel-description,
.mission-meta,
.cron-schedule,
.trivia-card p,
.trivia-card-header,
.trivia-source,
.status-item,
.log-entry .maintenance-line,
.info-note,
.agent-mini-card .agent-name,
.agent-mini-card .agent-tokens {
    color: var(--text-2);
}

.card-status {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(98,216,255,0.14);
}

.accent-teal .card-value { color: var(--teal); }
.accent-blue .card-value { color: var(--cyan); }
.accent-gold .card-value { color: var(--gold); }
.accent-magenta .card-value { color: var(--magenta); }

.signal-stack {
    display: grid;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.signal-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(98, 216, 255, 0.14);
    background: rgba(5, 12, 24, 0.56);
}

.signal-label {
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 11px;
}

.signal-value {
    color: var(--text-1);
    font-weight: 700;
    text-align: right;
}

.signal-scanline {
    position: absolute;
    left: 0;
    right: 0;
    top: 22px;
    height: 56px;
    background: linear-gradient(180deg, transparent, rgba(52, 255, 210, 0.08), transparent);
    animation: scanMove 4.4s linear infinite;
    pointer-events: none;
}

@keyframes scanMove {
    0% { transform: translateY(0); opacity: 0.2; }
    50% { opacity: 1; }
    100% { transform: translateY(280px); opacity: 0.15; }
}

.command-brief-grid,
.posture-ribbon,
.stats-grid,
.cost-summary,
.agent-detail-stats {
    display: grid;
    gap: 16px;
}

.command-brief-grid,
.posture-ribbon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.brief-panel { min-height: 100%; }

.brief-list,
.agent-grid,
.agent-list,
.cost-breakdown,
.mission-list,
.cron-list,
.log-viewer {
    padding: 0 20px 20px;
}

.brief-list {
    display: grid;
    gap: 12px;
}

.brief-item {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(98, 216, 255, 0.12);
    background: rgba(6, 13, 24, 0.55);
}

.brief-label {
    color: var(--text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.brief-value {
    color: var(--text-1);
    line-height: 1.6;
    font-size: 14px;
}

.brief-panel:nth-child(1) { border-color: rgba(98, 216, 255, 0.22); }
.brief-panel:nth-child(2) { border-color: rgba(255, 209, 102, 0.18); }
.brief-panel:nth-child(3) { border-color: rgba(200, 123, 255, 0.18); }
.brief-panel .panel-icon { font-weight: 800; }
#alert-summary .brief-item {
    border-color: rgba(255, 209, 102, 0.14);
    background: linear-gradient(180deg, rgba(28, 24, 8, 0.18), rgba(6, 13, 24, 0.52));
}
#mission-snapshot .brief-item {
    border-color: rgba(200, 123, 255, 0.14);
    background: linear-gradient(180deg, rgba(20, 10, 32, 0.16), rgba(6, 13, 24, 0.52));
}
#brief-list .brief-item {
    background: linear-gradient(180deg, rgba(10, 26, 42, 0.32), rgba(6, 13, 24, 0.52));
}

.posture-pill {
    position: relative;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(98, 216, 255, 0.14);
    background: linear-gradient(180deg, rgba(8, 18, 34, 0.92), rgba(6, 12, 24, 0.84));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
    overflow: hidden;
}

.posture-pill::after {
    content: "";
    position: absolute;
    inset: auto 16px 0 16px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(98, 216, 255, 0.7), transparent);
    opacity: 0.72;
}

.posture-pill:hover {
    border-color: rgba(98,216,255,0.32);
    box-shadow: 0 0 18px rgba(98,216,255,0.08), inset 0 0 0 1px rgba(255,255,255,0.02);
}

.posture-label {
    display: block;
    color: var(--text-3);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.posture-value {
    display: block;
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 700;
}

body.status-normal #posture-state { color: var(--teal); }
body.status-watch #posture-state { color: var(--cyan); }
body.status-warning #posture-state { color: var(--gold); }
body.status-critical #posture-state { color: var(--red); }

.panel {
    padding: 0;
    margin-bottom: 16px;
}

.overview-stack .section-panel { margin-bottom: 0; }
.panel.section-panel {
    background: linear-gradient(180deg, rgba(11, 24, 45, 0.96), rgba(6, 12, 24, 0.92));
}
.panel-header {
    padding: 18px 20px 12px;
}
.panel-description {
    padding: 0 20px 12px;
    font-size: 13px;
    line-height: 1.6;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.agent-mini-card {
    padding: 16px;
    text-align: center;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.agent-mini-card .agent-name {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
}

.agent-mini-card .agent-status { font-size: 28px; }
.agent-avatar {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 0 10px rgba(98,216,255,0.28));
}
.agent-mini-card .agent-tokens { color: var(--cyan); font-weight: 700; }
.agent-state-label {
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
}

.agent-mini-card.status-active,
.agent-mini-card.status-running {
    border-color: rgba(52, 255, 210, 0.32);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(52, 255, 210, 0.08), 0 0 24px rgba(52, 255, 210, 0.12);
}

.agent-mini-card.status-active::after,
.agent-mini-card.status-running::after {
    content: "";
    position: absolute;
    inset: auto 14px 10px 14px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--teal), transparent);
    animation: pulseLine 1.8s ease-in-out infinite;
}

.agent-mini-card.status-idle {
    border-color: rgba(151, 173, 202, 0.20);
}

.agent-mini-card.status-idle .agent-status,
.agent-mini-card.status-idle .agent-state-label {
    color: var(--text-2);
}

.agent-mini-card.status-active .agent-status,
.agent-mini-card.status-running .agent-status,
.agent-mini-card.status-active .agent-state-label,
.agent-mini-card.status-running .agent-state-label {
    color: var(--teal);
}

@keyframes pulseLine {
    0%, 100% { opacity: 0.25; transform: scaleX(0.72); }
    50% { opacity: 1; transform: scaleX(1); }
}

.agent-detail-card {
    padding: 18px;
    margin-bottom: 14px;
}

.agent-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.agent-detail-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
}

.agent-detail-status,
.trivia-status,
.log-entry .log-level {
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-grid,
.cost-summary,
.agent-detail-stats {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.metric-card,
.cost-card,
.agent-stat {
    padding: 16px;
    background: linear-gradient(180deg, rgba(9,20,38,0.88), rgba(7,14,28,0.88));
    border: 1px solid rgba(98,216,255,0.10);
    border-radius: 14px;
}

.agent-stat-value,
.metric-value,
.cost-card .cost-value {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-1);
}

.metric-bar {
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
    background: rgba(255,255,255,0.06);
}

.metric-bar-fill {
    height: 100%;
    border-radius: inherit;
    transition: width 0.35s ease;
}

.chart-wrap {
    padding: 6px 20px 20px;
    height: 260px;
}
.chart-wrap.compact { height: 220px; }

.cost-card .cost-value { color: var(--gold); }
.cost-card .cost-label {
    margin-top: 8px;
    color: var(--text-2);
    font-size: 12px;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(98,216,255,0.08);
}
.cost-item:last-child { border-bottom: 0; }

.mission-item,
.cron-item,
.trivia-card {
    padding: 16px;
    margin-bottom: 12px;
}

.mission-item,
.cron-item {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mission-status,
.cron-status {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.mission-status.pending { background: var(--gold); color: var(--gold); }
.mission-status.active { background: var(--teal); color: var(--teal); }
.mission-status.completed { background: var(--blue); color: var(--blue); }
.cron-status.running { background: var(--teal); color: var(--teal); }
.cron-status.idle { background: var(--text-3); color: var(--text-3); }
.cron-status.error { background: var(--red); color: var(--red); }

.mission-info,
.cron-info { flex: 1; }
.mission-name,
.cron-name,
.trivia-card h4 { font-size: 15px; font-weight: 700; }

.log-viewer {
    max-height: 320px;
    overflow-y: auto;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
    font-size: 12px;
    line-height: 1.8;
}

.log-entry {
    padding: 10px 0;
    border-bottom: 1px solid rgba(98,216,255,0.08);
}
.log-entry:last-child { border-bottom: 0; }
.log-entry .log-time { color: var(--cyan); margin-right: 10px; }
.log-entry .log-level.running { background: rgba(52,255,210,0.18); color: var(--teal); }
.log-entry .log-level.idle { background: rgba(255,255,255,0.08); color: var(--text-2); }
.log-entry .log-level.missing { background: rgba(255,107,122,0.18); color: var(--red); }

.trivia-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    padding: 0 20px 20px;
}

.trivia-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 220px;
}

.trivia-card-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
}

.trivia-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trivia-tag {
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(98,216,255,0.14);
    background: rgba(255,255,255,0.04);
    font-size: 12px;
    color: var(--text-2);
}

.trivia-actions { margin-top: auto; }
.trivia-actions a {
    color: var(--cyan);
    text-decoration: none;
    font-weight: 700;
}
.trivia-actions a:hover { color: var(--teal); }

.mission-empty,
.mission-error,
.trivia-empty,
.trivia-error {
    padding: 0 20px 20px;
}

.hidden { display: none !important; }

.status-bar {
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 16px;
    border: 1px solid rgba(98, 216, 255, 0.14);
    background: rgba(8, 16, 30, 0.84);
    color: var(--text-2);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.status-bar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(98,216,255,0.04), transparent);
    transform: translateX(-100%);
    animation: statusSweep 7s linear infinite;
}

@keyframes statusSweep {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.info-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(98,216,255,0.25);
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(16, 42, 78, 0.96), rgba(8, 18, 34, 0.9));
    color: var(--cyan);
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(0,0,0,0.35), 0 0 28px rgba(98,216,255,0.12);
    z-index: 20;
}

.info-panel {
    position: fixed;
    right: 24px;
    bottom: 88px;
    width: min(360px, calc(100vw - 32px));
    border-radius: 18px;
    border: 1px solid rgba(98,216,255,0.16);
    background: rgba(8, 16, 30, 0.96);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: 0.2s ease;
    z-index: 20;
}

.info-panel.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.info-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.info-panel-inner h3 { font-size: 18px; }
.info-panel-inner ul { list-style: none; display: grid; gap: 8px; }
.close-info {
    align-self: flex-end;
    background: transparent;
    border: 0;
    color: var(--text-2);
    font-size: 22px;
    cursor: pointer;
}

.command-metrics .stat-card:hover,
.brief-item:hover,
.agent-mini-card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.hero-panel,
.panel,
.stat-card,
.agent-mini-card,
.brief-item {
    transition: box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

body.status-normal .top-shell,
body.status-normal .hero-panel,
body.status-normal .panel {
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(52, 255, 210, 0.05);
}
body.status-watch .top-shell,
body.status-watch .hero-panel,
body.status-watch .panel {
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(98, 216, 255, 0.08), 0 0 20px rgba(98, 216, 255, 0.06);
}
body.status-warning .top-shell,
body.status-warning .hero-panel,
body.status-warning .panel {
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 209, 102, 0.08), 0 0 22px rgba(255, 209, 102, 0.08);
}
body.status-warning .brand-title,
body.status-warning .panel-eyebrow,
body.status-warning .signal-value {
    text-shadow: 0 0 16px rgba(255, 209, 102, 0.12);
}
body.status-critical .top-shell,
body.status-critical .hero-panel,
body.status-critical .panel {
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 107, 122, 0.08), 0 0 24px rgba(255, 107, 122, 0.10);
}
body.status-critical .brand-title,
body.status-critical .panel-eyebrow,
body.status-critical .signal-value {
    text-shadow: 0 0 18px rgba(255, 107, 122, 0.16);
}
body.status-critical .signal-scanline {
    background: linear-gradient(180deg, transparent, rgba(255, 107, 122, 0.10), transparent);
}

@media (max-width: 1180px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-title-row { grid-template-columns: 1fr; }
    .hero-ring { width: 130px; height: 130px; }
}

@media (max-width: 1080px) {
    .command-brief-grid,
    .posture-ribbon {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .tab-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .top-shell { flex-direction: column; }
    .top-meta { justify-content: flex-start; }
}

@media (max-width: 900px), (max-height: 860px) {
    .top-shell {
        padding: 18px 18px;
    }
    .brand-title {
        font-size: clamp(26px, 3.4vw, 40px);
    }
    .command-panel,
    .signal-panel {
        min-height: auto;
    }
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .hero-title-row {
        align-items: start;
    }
}

@media (max-width: 640px), (max-height: 720px) {
    body { overflow: auto; }
    #app { padding: 12px; }
    .brand-title { font-size: 28px; line-height: 1.1; }
    .tab-nav,
    .card-grid,
    .agent-detail-stats,
    .stats-grid,
    .cost-summary {
        grid-template-columns: 1fr;
    }
    .tab-btn { padding: 12px 10px; font-size: 12px; }
    .status-bar { flex-direction: column; align-items: flex-start; }
}

.overview-dual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.tactical-panel {
    min-height: 100%;
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 20px 20px;
}

.focus-item,
.command-note-item {
    border-radius: 14px;
    border: 1px solid rgba(98, 216, 255, 0.12);
    background: linear-gradient(180deg, rgba(8, 18, 34, 0.82), rgba(6, 12, 24, 0.68));
}

.focus-item {
    padding: 14px 16px;
}

.focus-value {
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.6;
    font-weight: 700;
}

.command-note-list {
    display: grid;
    gap: 12px;
    padding: 0 20px 20px;
}

.command-note-item {
    position: relative;
    padding: 14px 16px 14px 40px;
    color: var(--text-2);
    line-height: 1.7;
}

.command-note-item::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 14px rgba(98, 216, 255, 0.65);
}

.mission-empty,
.mission-error,
.trivia-empty,
.trivia-error {
    margin: 0 20px 20px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px dashed rgba(98, 216, 255, 0.20);
    background: rgba(7, 14, 28, 0.65);
    color: var(--text-2);
    line-height: 1.7;
}

@media (max-width: 1080px) {
    .overview-dual-grid,
    .focus-grid {
        grid-template-columns: 1fr;
    }
}

.tab-intro {
    margin-bottom: 16px;
    padding: 18px 20px;
    border-radius: 18px;
    border: 1px solid rgba(98, 216, 255, 0.14);
    background: linear-gradient(180deg, rgba(10, 22, 42, 0.86), rgba(7, 14, 28, 0.76));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.tab-intro-kicker {
    color: var(--cyan);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.tab-intro-title {
    color: var(--text-1);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.tab-intro-copy {
    color: var(--text-2);
    line-height: 1.7;
    max-width: 72ch;
}

.agent-list,
.metrics-list,
.cost-breakdown,
.mission-list,
.cron-list,
.log-viewer {
    display: grid;
    gap: 12px;
}

.cost-item-label span,
.cron-last,
.log-msg {
    color: var(--text-1);
}

.cost-item,
.mission-item,
.cron-item,
.log-entry {
    border-radius: 14px;
    border: 1px solid rgba(98,216,255,0.10);
    background: linear-gradient(180deg, rgba(8,18,34,0.72), rgba(6,12,24,0.62));
    padding-left: 14px;
    padding-right: 14px;
}

@media (max-width: 640px) {
    .tab-intro-title { font-size: 20px; }
}

/* Phase B Alert Center Styles */
.alert-level-warning {
    border-left: 4px solid #ffd166 !important;
    background: linear-gradient(90deg, rgba(255, 209, 102, 0.1), transparent) !important;
}
.alert-level-critical {
    border-left: 4px solid #ff6b7a !important;
    background: linear-gradient(90deg, rgba(255, 107, 122, 0.1), transparent) !important;
}
.alert-level-info {
    border-left: 4px solid #62d8ff !important;
    background: linear-gradient(90deg, rgba(98, 216, 255, 0.1), transparent) !important;
}
.alert-level-ok {
    border-left: 4px solid #34ffd2 !important;
    background: linear-gradient(90deg, rgba(52, 255, 210, 0.1), transparent) !important;
}
/* Importing Phase C animations natively instead of JS injection for reliability */


/* Pulse of Reason - Creative Feature (Restored) */
@keyframes thinking-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 255, 210, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(52, 255, 210, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 255, 210, 0); }
}

.agent-mini-card.status-active, .agent-mini-card.status-running {
    border-color: #34ffd2 !important;
    animation: thinking-pulse 2s infinite !important;
}

.agent-mini-card.status-active .agent-status, .agent-mini-card.status-running .agent-status {
    color: #34ffd2 !important;
    text-shadow: 0 0 8px #34ffd2 !important;
}
/* Phase C - Live Command Feel */

/* 1. Breathing Glow for Core Metrics */
@keyframes core-pulse-normal {
    0% { text-shadow: 0 0 10px rgba(52, 255, 210, 0.4); }
    50% { text-shadow: 0 0 25px rgba(52, 255, 210, 0.8), 0 0 5px #34ffd2; }
    100% { text-shadow: 0 0 10px rgba(52, 255, 210, 0.4); }
}
@keyframes core-pulse-watch {
    0% { text-shadow: 0 0 10px rgba(98, 216, 255, 0.4); }
    50% { text-shadow: 0 0 25px rgba(98, 216, 255, 0.8), 0 0 5px #62d8ff; }
    100% { text-shadow: 0 0 10px rgba(98, 216, 255, 0.4); }
}
@keyframes core-pulse-warning {
    0% { text-shadow: 0 0 10px rgba(255, 209, 102, 0.4); }
    50% { text-shadow: 0 0 25px rgba(255, 209, 102, 0.8), 0 0 5px #ffd166; }
    100% { text-shadow: 0 0 10px rgba(255, 209, 102, 0.4); }
}
@keyframes core-pulse-critical {
    0% { text-shadow: 0 0 10px rgba(255, 107, 122, 0.4); }
    50% { text-shadow: 0 0 35px rgba(255, 107, 122, 0.9), 0 0 8px #ff6b7a; }
    100% { text-shadow: 0 0 10px rgba(255, 107, 122, 0.4); }
}

body.status-normal #ghs-value { animation: core-pulse-normal 3s infinite ease-in-out; }
body.status-watch #ghs-value { animation: core-pulse-watch 2.5s infinite ease-in-out; }
body.status-warning #ghs-value { animation: core-pulse-warning 1.5s infinite ease-in-out; }
body.status-critical #ghs-value { animation: core-pulse-critical 0.8s infinite ease-in-out; color: #fff !important; }

/* 2. Module Refresh Feedback */
@keyframes data-flash {
    0% { opacity: 0.8; border-color: rgba(98, 216, 255, 0.8); background-color: rgba(98, 216, 255, 0.1); transform: scale(0.99); }
    100% { opacity: 1; border-color: transparent; background-color: transparent; transform: scale(1); }
}

.is-updating {
    animation: data-flash 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 3. Subtle Scanning Line Background for Hero */
.hero-panel.command-panel {
    position: relative;
    overflow: hidden;
}
.hero-panel.command-panel::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent, rgba(98, 216, 255, 0.05), transparent);
    animation: scanner-sweep 6s linear infinite;
    pointer-events: none;
    z-index: 0;
}
@keyframes scanner-sweep {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(300%); }
}

/* 4. Connection Dot Blinking */
@keyframes blink-live {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; box-shadow: 0 0 8px currentColor; }
}
.meta-chip.is-online .meta-dot { animation: blink-live 1.5s infinite; }
.meta-chip.is-syncing .meta-dot { animation: blink-live 0.5s infinite; }
.meta-chip.is-offline .meta-dot { animation: blink-live 0.5s infinite; background: #ff6b7a; color: #ff6b7a; }

/* 5. Live Stream Visual Indicator */
#connection-echo.ws-live {
    color: #34ffd2;
    text-shadow: 0 0 5px rgba(52, 255, 210, 0.5);
}
/* Phase C - Boot Sequence & Intro Animations */

/* 1. Base hidden state before boot */
.dashboard-content, .top-shell, .tab-nav, .status-bar, .info-button {
    opacity: 1;
    visibility: visible;
}

/* 2. Boot Overlay */
#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #060d18;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #62d8ff;
    font-family: 'SF Mono', 'Fira Code', monospace;
    transition: opacity 0.8s ease-in-out;
}

.boot-logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(98, 216, 255, 0.5);
    position: relative;
}

.boot-logo::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0%;
    height: 2px;
    background: #34ffd2;
    animation: boot-line 1.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.boot-log {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 15px;
    height: 60px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.boot-log-line {
    margin: 2px 0;
    animation: fade-in-up 0.2s ease-out forwards;
}

@keyframes boot-line {
    0% { width: 0%; }
    100% { width: 120%; }
}

@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 3. Reveal Animations */
.boot-complete .dashboard-content, 
.boot-complete .top-shell, 
.boot-complete .tab-nav, 
.boot-complete .status-bar,
.boot-complete .info-button {
    visibility: visible;
}

.boot-complete .top-shell { animation: reveal-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.boot-complete .tab-nav { animation: reveal-down 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards; }
.boot-complete .status-bar { animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards; }
.boot-complete .info-button { animation: reveal-fade 1s ease-out 0.8s forwards; }

.boot-complete .hero-panel.command-panel { animation: reveal-scale 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; opacity: 0; }
.boot-complete .hero-panel.signal-panel { animation: reveal-scale 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards; opacity: 0; }
.boot-complete .brief-panel:nth-child(1) { animation: reveal-slide-right 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards; opacity: 0; }
.boot-complete .brief-panel:nth-child(2) { animation: reveal-slide-right 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards; opacity: 0; }
.boot-complete .brief-panel:nth-child(3) { animation: reveal-slide-right 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards; opacity: 0; }
.boot-complete .posture-ribbon { animation: reveal-fade 0.8s ease-out 0.7s forwards; opacity: 0; }
.boot-complete .overview-stack > div:nth-child(1) { animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards; opacity: 0; }
.boot-complete .tactical-panel:nth-child(1) { animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s forwards; opacity: 0; }
.boot-complete .tactical-panel:nth-child(2) { animation: reveal-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards; opacity: 0; }

@keyframes reveal-down { 0% { opacity: 0; transform: translateY(-20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes reveal-up { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes reveal-scale { 0% { opacity: 0; transform: scale(0.97); } 100% { opacity: 1; transform: scale(1); } }
@keyframes reveal-slide-right { 0% { opacity: 0; transform: translateX(-20px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes reveal-fade { 0% { opacity: 0; } 100% { opacity: 1; } }

/* 4. Tab Transition Animation */
.tab-content {
    transition: opacity 0.3s ease-out, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.tab-content.active { display: block !important; opacity: 1 !important; transform: translateY(0) !important; 
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Agent Legends + Nexus Evolution */
.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}
.legend-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    align-items: center;
}
.agent-hero-wrap {
    position: relative;
    width: 108px;
    height: 108px;
    margin: 0 auto;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--hero-color) 40%, transparent);
    background: radial-gradient(circle at 40% 30%, color-mix(in srgb, var(--hero-color) 22%, transparent), rgba(6,12,24,0.8));
    display: grid;
    place-items: center;
    overflow: hidden;
}
.agent-hero-avatar {
    font-size: 44px;
    z-index: 2;
    filter: drop-shadow(0 0 12px color-mix(in srgb, var(--hero-color) 65%, transparent));
}
.agent-hero-glow {
    position: absolute;
    width: 120%;
    height: 10px;
    bottom: 14px;
    left: -10%;
    background: linear-gradient(90deg, transparent, var(--hero-color), transparent);
    opacity: 0.85;
}
.agent-role-line { color: var(--cyan); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.agent-task-line { color: var(--text-1); font-size: 14px; margin-bottom: 6px; }
.agent-lore-line { color: var(--text-2); line-height: 1.6; margin-bottom: 10px; }

.nexus-scene {
    margin: 0 20px 20px;
    min-height: 280px;
    border-radius: 18px;
    border: 1px solid rgba(98,216,255,0.18);
    background:
      radial-gradient(circle at 50% 55%, rgba(98,216,255,0.1), transparent 38%),
      repeating-linear-gradient(0deg, rgba(98,216,255,.06) 0 1px, transparent 1px 26px),
      repeating-linear-gradient(90deg, rgba(98,216,255,.05) 0 1px, transparent 1px 26px),
      linear-gradient(180deg, rgba(9,20,38,.95), rgba(6,12,24,.95));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
}
.nexus-agent {
    position: relative;
    border: 1px solid rgba(98,216,255,.16);
    border-radius: 14px;
    background: rgba(7,14,28,.65);
    display: grid;
    place-items: center;
    gap: 4px;
    padding: 10px;
    overflow: hidden;
}
.nexus-avatar { font-size: 32px; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--hero-color) 70%, transparent)); }
.nexus-label { font-size: 11px; color: var(--text-1); letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.nexus-action { font-size: 11px; color: var(--text-2); }
.nexus-beam {
    position: absolute;
    inset: auto 10% 0 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--hero-color), transparent);
}
.nexus-agent.is-active { border-color: color-mix(in srgb, var(--hero-color) 60%, #34ffd2); animation: nexus-run 1.2s ease-in-out infinite; }
.nexus-agent.is-idle { opacity: .85; }
.nexus-agent.is-alert { border-color: #ff6b7a; animation: nexus-alert .8s linear infinite; }

@keyframes nexus-run {
    0%,100% { transform: translateY(0); box-shadow: 0 0 0 rgba(52,255,210,0); }
    50% { transform: translateY(-2px); box-shadow: 0 0 18px rgba(52,255,210,.22); }
}
@keyframes nexus-alert {
    0%,100% { box-shadow: 0 0 0 rgba(255,107,122,0); }
    50% { box-shadow: 0 0 18px rgba(255,107,122,.3); }
}

@media (max-width: 900px) {
  .legend-card { grid-template-columns: 1fr; }
  .nexus-scene { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .nexus-scene { grid-template-columns: 1fr; }
}

/* SVG Hero Upgrade */
.hero-svg { width: 100%; height: 100%; }

.hero-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display:block; }
.agent-status.svg-mini .hero-img { filter: drop-shadow(0 0 8px rgba(98,216,255,.35)); }
.agent-hero-avatar .hero-img { animation: hero-breathe 2.4s ease-in-out infinite; }
.nexus-avatar .hero-img { animation: nexus-float 1.8s ease-in-out infinite; border-radius: 10px; }
.nexus-agent.is-active .nexus-avatar .hero-img { animation-duration: 1s; }
.nexus-agent.is-idle .nexus-avatar .hero-img { opacity: .85; }

.hero-img-bust { object-fit: cover; object-position: 50% 26%; }
.hero-img-action { object-fit: cover; object-position: 50% 42%; }

/* per-agent fine tune */
.agent-img-main { object-position: 50% 24%; }
.agent-img-planner { object-position: 50% 23%; }
.agent-img-executor { object-position: 50% 28%; }
.agent-img-memory { object-position: 50% 22%; }
.agent-img-trivia-kun { object-position: 50% 27%; }
.agent-status.svg-mini { width: 72px; height: 72px; margin: 0 auto; }
.agent-status.svg-mini .hero-svg { filter: drop-shadow(0 0 8px rgba(98,216,255,.35)); }

.agent-hero-avatar { width: 104px; height: 104px; }
.agent-hero-avatar .hero-svg { animation: hero-breathe 2.4s ease-in-out infinite; }

.nexus-avatar { width: 72px; height: 72px; }
.nexus-avatar .hero-svg { animation: nexus-float 1.8s ease-in-out infinite; }
.nexus-agent.is-active .nexus-avatar .hero-svg { animation-duration: 1s; }
.nexus-agent.is-idle .nexus-avatar .hero-svg { opacity: .8; }

.nexus-hotspot {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.4;
  max-width: 95%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nexus-agent::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 130%, color-mix(in srgb, var(--hero-color) 20%, transparent), transparent 45%);
  opacity: .9;
}

@keyframes hero-breathe {
  0%,100% { transform: scale(1); opacity: .9; }
  50% { transform: scale(1.05); opacity: 1; }
}
@keyframes nexus-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
