@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');
/* ============================================================
   IDA v2.0.0 — NAVY BLUE TEMPLATE
   Dark navy blue. Off-white text. OS-like. Nothing fancy.
   The live terminal is the centerpiece — Ida working in real time.

   Palette:
     Backgrounds: #060c18 (base), #0c1526 (card), #101a2c (elevated)
     Text: #dbe6f2 (primary), #93a3ba (dim), #55637d (dimmer)
     Accent GOLD: #f4c542 (primary), #b8932f (dim)
     Accent cyan: #4fc3d9 (SECONDARY: scanner, sub-headings)
     Status: #3aaa6a (green/OK), #c94a4a (red/alert), #d4a44a (warn)
     Borders: #1c2c44 (all)
   ============================================================ */

/* ---- ROOT TOKENS ---- */
:root {
    --bg: #060c18;
    --bg-slightly: #0a1120;
    --bg-card: #0c1526;
    --bg-elevated: #101a2c;

    --text: #dbe6f2;
    --text-dim: #93a3ba;
    --text-dimmer: #55637d;

    --accent: #f4c542;
    --accent-bright: #f4c542;
    --accent-dim: #b8932f;

    --cyan: #4fc3d9;
    --cyan-dim: #3a8a96;
    --cyan-glow: rgba(79, 195, 217, 0.06);

    --green: #3aaa6a;
    --red: #c94a4a;
    --warn: #d4a44a;

    --border: #1c2c44;
    --border-bright: #1c2c44;
    --border-accent: #26364f;

    --mono: 'IBM Plex Mono', 'Courier New', 'Courier', monospace;
    --sans: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

    /* ---- NAVY GOLD HYBRID: gold accent layer ---- */
    --gold: #f4c542;
    --gold-dim: #b8932f;
    --gold-glow: rgba(244, 197, 66, 0.45);

    --scan-line: rgba(10, 20, 40, 0.2);
    --crt-flicker: 0.998;
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
}

/* ---- CRT EFFECT OVERLAY (subtle — navy, not black) ---- */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: none;
    opacity: 0;
}

.crt-overlay::after {
    content: none;
}

/* ---- SCREEN FLICKER (very subtle) ---- */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: var(--crt-flicker); }
}

#screen {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   PAGE 1 — BOOT / LOGIN TERMINAL
   ============================================================ */

#terminal {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 8px 24px;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
    text-align: left;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
}

#terminal::-webkit-scrollbar { width: 6px; }
#terminal::-webkit-scrollbar-track { background: transparent; }
#terminal::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

.boot-line { color: var(--text); margin-bottom: 1px; text-align: left; }
.boot-line-dim { color: var(--text-dim); }
.boot-line-ok { color: var(--cyan); }
.boot-line-warn { color: var(--warn); }
.boot-line-alert { color: var(--red); }

/* ---- INPUT LINE ---- */
#input-line {
    display: none;
    padding: 4px 24px 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-slightly);
    flex-shrink: 0;
}

#input-line.visible {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

#input-prompt {
    color: var(--cyan);
    font-family: var(--mono);
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}

#input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    caret-color: var(--cyan);
    -webkit-text-fill-color: var(--text);
}

#input-field::placeholder {
    color: var(--text-dimmer);
    -webkit-text-fill-color: var(--text-dimmer);
}

/* ============================================================
   PAGE 2 — IDA (PRIMARY OBJECTIVE + LIVE TERMINAL)
   ============================================================ */

#ida-page {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}

#ida-page.visible {
    display: flex;
}

/* ---- IDA HEADER ---- */
.ida-header {
    padding: 0 24px;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-slightly);
    box-shadow: 0 1px 0 var(--gold-glow);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* ---- LEFT: BPHEN operating system (takes visual priority) ---- */
.brand-os {
    display: flex;
    align-items: center;
    gap: 14px;
    line-height: 1;
}

.brand-os .os-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text);
    font-family: var(--sans);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.brand-os .os-sep {
    font-size: 22px;
    font-weight: 300;
    color: var(--text-dim);
    opacity: 0.35;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.brand-os .os-sub {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    font-family: var(--sans);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ---- RIGHT: IDA branding ---- */
.brand-ida {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.brand-ida .brand-ida-name {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text);
    font-family: var(--sans);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.brand-ida .brand-ida-by {
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text);
    font-family: var(--sans);
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ---- THE LAYOUT: REPORT + LIVE TERMINAL SIDE BY SIDE ---- */
.ida-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* The report area — scrolls */
.ida-report-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 120px 24px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
}

.ida-report-wrap::-webkit-scrollbar { width: 6px; }
.ida-report-wrap::-webkit-scrollbar-track { background: transparent; }
.ida-report-wrap::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

.ida-report {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================================
   THE LIVE TERMINAL — IDA WORKING IN REAL TIME
   This is the centerpiece. Ida's activity stream.
   ============================================================ */
.ida-live {
    width: 380px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    background: var(--bg-slightly);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* ---- RIGHT PANEL TABS: IDA LIVE / WORKSPACE ---- */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

.panel-tab {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-dimmer);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    user-select: none;
}

.panel-tab:hover { color: var(--text-dim); }

.panel-tab.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
    background: rgba(244, 197, 66, 0.04);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    display: none;
    flex-direction: column;
}

.panel-content.active { display: flex; }

.ida-live-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ida-live-title {
    font-size: 11px;
    font-weight: bold;
    color: var(--text-dim);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ida-live-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: pulse-dot 2s infinite;
}

.ida-live-status-dot.stale {
    background: var(--warn);
    box-shadow: 0 0 6px var(--warn);
}

.ida-live-status-dot.dead {
    background: var(--red);
    box-shadow: 0 0 6px var(--red);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.ida-live-status-text {
    font-size: 10px;
    color: var(--text-dimmer);
    letter-spacing: 1px;
}

/* The live terminal stream — where activity appears */
.ida-live-stream {
    flex: 1;
    overflow-y: auto;
    padding: 8px 14px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.6;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
}

.ida-live-stream::-webkit-scrollbar { width: 4px; }
.ida-live-stream::-webkit-scrollbar-track { background: transparent; }
.ida-live-stream::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

/* Individual activity lines */
.live-line {
    margin-bottom: 2px;
    white-space: pre-wrap;
    word-break: break-word;
    opacity: 0;
    animation: live-fade-in 0.3s ease forwards;
}

@keyframes live-fade-in {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.live-ts {
    color: var(--text-dimmer);
    font-size: 10px;
}

.live-action {
    color: var(--cyan);
}

.live-action-feed { color: var(--text-dim); }
.live-action-classify { color: var(--accent); }
.live-action-store { color: var(--green); }
.live-action-skip { color: var(--text-dimmer); }
.live-action-scan { color: var(--cyan); }
.live-action-heartbeat { color: var(--text-dim); }
.live-action-alert { color: var(--red); }
.live-action-warn { color: var(--warn); }

.live-record-title {
    color: var(--text);
    font-size: 11px;
}

.live-record-source {
    color: var(--text-dim);
    font-size: 10px;
}

.live-record-cycle {
    color: var(--accent-bright);
    font-size: 10px;
    letter-spacing: 1px;
}

/* The heartbeat bar at bottom of live terminal */
.ida-live-heartbeat {
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
    font-size: 10px;
    font-family: var(--mono);
}

.heartbeat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.heartbeat-label {
    color: var(--text-dimmer);
    letter-spacing: 1px;
}

.heartbeat-value {
    color: var(--text-dim);
}

.heartbeat-value.ok { color: var(--green); }
.heartbeat-value.stale { color: var(--warn); }
.heartbeat-value.dead { color: var(--red); }

/* ============================================================
   WORKSPACE TAB — Archive button, Project folders, DIS audit
   ============================================================ */
.workspace-panel {
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.ws-section-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--text-dimmer);
    font-weight: 700;
    margin-bottom: 8px;
}

.ws-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--gold);
    color: #0a0a0a;
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    padding: 11px;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.ws-btn-primary:hover { background: #ffd54a; }

.ws-archive-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.ws-archive-btn:hover { border-color: var(--cyan-dim); }

.ws-archive-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(79, 195, 217, 0.1);
    border: 1px solid var(--cyan-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    font-size: 15px;
    flex-shrink: 0;
}

.ws-archive-text { flex: 1; min-width: 0; }
.ws-archive-title { font-size: 13px; font-weight: 700; color: var(--text); }
.ws-archive-sub { font-size: 10.5px; color: var(--text-dimmer); margin-top: 1px; }

.ws-archive-count {
    background: rgba(79, 195, 217, 0.1);
    color: var(--cyan);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid var(--cyan-dim);
    flex-shrink: 0;
}

.ws-folder-list { display: flex; flex-direction: column; gap: 8px; }

.ws-folder {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.ws-folder:hover { border-color: var(--gold-dim); background: var(--bg-elevated); }

.ws-folder-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(244, 197, 66, 0.08);
    border: 1px solid var(--gold-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 13px;
    flex-shrink: 0;
}

.ws-folder-text { flex: 1; min-width: 0; }
.ws-folder-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ws-folder-meta { font-size: 10px; color: var(--text-dimmer); margin-top: 1px; }
.ws-folder-chevron { color: var(--text-dimmer); font-size: 12px; flex-shrink: 0; }

.ws-audit-badge {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 10.5px;
    color: var(--text-dimmer);
    line-height: 1.5;
}

.ws-audit-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 5px var(--green);
    flex-shrink: 0;
    margin-top: 2px;
}

.ws-audit-badge strong { color: var(--text-dim); }

/* ============================================================
   CHAT WITH IDA — bubble-style log (Ask Ida area)
   ============================================================ */
.chat-log {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    overflow-y: auto;
    padding: 18px 24px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) transparent;
}

.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

.chat-log:empty::before {
    content: 'Ask Ida to check a status, pull records, draft a section, or work a project folder — everything routes through here.';
    color: var(--text-dimmer);
    font-size: 13px;
    font-style: italic;
    margin: auto;
    text-align: center;
    max-width: 480px;
}

/* Folder-overlay chat logs stay compact (not the main operational chat) */
#folder-chat-log.chat-log {
    max-height: 320px;
    flex: none;
    padding: 0;
    margin-bottom: 12px;
}

.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.chat-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
    font-family: var(--sans);
}

.chat-avatar.ida { background: var(--gold); color: #0a0a0a; }
.chat-avatar.user { background: var(--cyan); color: #0a0a0a; }

.chat-bubble {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
}

.chat-msg.ida .chat-bubble {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-top-left-radius: 2px;
}

.chat-msg.user .chat-bubble {
    background: rgba(79, 195, 217, 0.1);
    border: 1px solid var(--cyan-dim);
    color: var(--text);
    border-top-right-radius: 2px;
}

.chat-name {
    font-size: 10px;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 3px;
    font-family: var(--sans);
}

.chat-msg.ida .chat-name { color: var(--gold); }
.chat-msg.user .chat-name { color: var(--cyan); }

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

.chat-input-row input {
    flex: 1;
}

.chat-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 14px;
    transition: color 0.15s, border-color 0.15s;
}

.chat-btn.mic:hover { color: var(--cyan); border-color: var(--cyan-dim); }
.chat-btn.mic.recording { color: var(--red); border-color: var(--red); box-shadow: 0 0 0 3px rgba(201, 74, 74, 0.15); }
.chat-btn.send { background: var(--gold); color: #0a0a0a; border-color: var(--gold-dim); }
.chat-btn.send:hover { background: #ffd54a; }

/* ============================================================
   OVERLAYS — Archive browser + Project folder chat threads
   Open in-page, same domain, no navigation away.
   ============================================================ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 16, 0.88);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.overlay.active { display: flex; }

.overlay-panel {
    background: var(--bg-slightly);
    border: 1px solid var(--border-bright);
    border-radius: 12px;
    width: 100%;
    max-width: 780px;
    max-height: 100%;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
}

.overlay-title { font-size: 14px; font-weight: 800; color: var(--gold); letter-spacing: 1px; }
.overlay-sub { font-size: 11px; color: var(--text-dimmer); margin-top: 3px; }

.overlay-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

.overlay-body { padding: 18px 20px; }

.archive-group { margin-bottom: 20px; }

.archive-group-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--cyan);
    font-weight: 700;
    margin-bottom: 10px;
}

.archive-folder-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.archive-folder {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
}

.archive-folder:hover { border-color: var(--gold-dim); }
.archive-folder-name { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.archive-folder-count { font-size: 10.5px; color: var(--text-dimmer); }
.archive-folder-name .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

.pf-breadcrumb { font-size: 10.5px; color: var(--text-dimmer); margin-bottom: 4px; letter-spacing: 0.5px; }
.pf-breadcrumb strong { color: var(--gold); }

/* ============================================================
   STATUS BAR (bottom)
   ============================================================ */
#status-bar {
    display: none;
    padding: 6px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 11px;
    color: var(--text-dim);
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 1px;
}

#status-bar.visible {
    display: flex;
}

/* ---- COPYRIGHT FOOTER ---- */
#ida-copyright {
    display: none;
    padding: 8px 24px;
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text);
    background: var(--bg-slightly);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#ida-copyright.visible {
    display: block;
}

.status-left, .status-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.status-framework {
    color: var(--gold);
    white-space: nowrap;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 5px var(--cyan);
    margin-right: 4px;
    animation: pulse-dot 2s infinite;
}

/* ============================================================
   REPORT SECTIONS — shared styling
   ============================================================ */
.report-section {
    margin-bottom: 32px;
}

.report-section-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--accent-bright);
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.section-tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
}

.section-tag-macro {
    color: var(--cyan);
    border: 1px solid var(--cyan);
}

.section-tag-micro {
    color: var(--gold);
    border: 1px solid var(--gold);
}

.report-subsection-title {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin: 16px 0 8px 0;
}

.report-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
}

.report-dim {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
}

.report-dim strong {
    color: var(--text);
}

/* ---- ANCHORS SECTION ---- */
/* ---- MISSION STATEMENT (Javelion Analytics) ---- */
.mission-section {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.mission-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.mission-text {
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.6;
}

.anchors-section { }

.anchors-label {
    font-size: 13px;
    font-weight: bold;
    color: var(--accent-bright);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.anchors-intro {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 16px;
    font-style: italic;
}

.anchor-block {
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-left: 3px solid var(--accent);
    border-radius: 0 4px 4px 0;
}

.anchor-block-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--cyan);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.anchor-detail {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.6;
}

/* ---- ACCELERATION SECTION ---- */
.acceleration-section { }

.acceleration-label {
    font-size: 13px;
    font-weight: bold;
    color: var(--accent-bright);
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.acceleration-grid {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.acceleration-cell {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 10px;
    background: var(--gold);
    border: 1px solid var(--gold-dim);
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(244, 197, 66, 0.15);
}

/* The number + "YEARS" + era name are locked together as one group
   (the same idea as grouping/linking layers in Photoshop). All three
   pieces are sized in em relative to this single font-size below, in
   the exact same proportions as before -- so changing ONE number here
   (the master scale) enlarges all three pieces together, as one
   locked unit, without anything stretching out of proportion. */
.acceleration-content-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.65px; /* MASTER SCALE for the whole locked group (was 11px) */
}

.acceleration-num {
    font-size: 2.1818em;   /* = 24px at the original 11px base */
    font-weight: 700;
    color: #0a0a0a;
    font-family: var(--sans);
    line-height: 1;
    flex-shrink: 0;
}

.acceleration-txt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    min-width: 0;
}

.acceleration-unit {
    font-size: 0.8636em;   /* = 9.5px at the original 11px base */
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #0a0a0a;
    opacity: 0.6;
    font-family: var(--sans);
}

.acceleration-era {
    font-size: 1em;        /* = 11px at the original 11px base */
    font-weight: 800;
    color: #0a0a0a;
    letter-spacing: 0.3px;
    font-family: var(--sans);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acceleration-arrow {
    color: var(--gold);
    font-size: 18px;
    opacity: 0.5;
    flex-shrink: 0;
}

.acceleration-caption {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
    margin-top: 18px;
}

.acceleration-caption strong {
    color: var(--text);
}

/* ---- ERAS TABLE ---- */
.eras-section { }

.eras-intro {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 14px;
}

.eras-table {
    border: 1px solid var(--border-bright);
    border-radius: 6px;
    overflow: hidden;
}

.era-row {
    display: grid;
    grid-template-columns: 70px 1fr 110px 2fr;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    align-items: center;
}

.era-row:last-child { border-bottom: none; }

.era-row:nth-child(odd) {
    background: var(--bg-slightly);
}

.era-anchor-cell {
    color: var(--text-dimmer);
    font-size: 10px;
    letter-spacing: 1px;
}

.era-num-cell {
    color: var(--accent);
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 1px;
}

.era-name-cell {
    color: var(--text);
    font-weight: bold;
    font-size: 12px;
}

.era-years-cell {
    color: var(--text-dim);
    font-size: 11px;
    text-align: center;
}

.era-note-cell {
    color: var(--text-dim);
    font-size: 11px;
    line-height: 1.5;
}

.current-era {
    background: rgba(244, 197, 66, 0.07);
    border-left: 3px solid var(--gold);
    box-shadow: inset 0 0 18px rgba(244, 197, 66, 0.05);
}

.current-era .era-num-cell { color: var(--gold); }
.current-era .era-name-cell { color: var(--gold); }

/* ---- CURRENT CYCLE ---- */
.current-cycle-section { }

.current-cycle-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--cyan);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.current-cycle-detail {
    margin-bottom: 14px;
}

/* ---- RECORDS ---- */
.records-section { }

.records-intro {
    color: var(--text-dim);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 14px;
}

.cycle-section {
    margin-bottom: 20px;
}

.cycle-label {
    color: var(--gold);
    font-size: 12px;
    letter-spacing: 1px;
}

.cycle-items {
    margin-left: 12px;
}

.current-cycle-records {
    border-left: 3px solid var(--cyan);
    padding-left: 12px;
}

/* Year subheaders in records */
.year-subheader {
    color: var(--text-dim);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    margin: 12px 0 6px 0;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
}

.year-records { }

/* ---- ARCHIVE ITEM (individual record card) ---- */
.archive-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.archive-item:hover {
    border-color: var(--accent-dim);
    background: var(--bg-elevated);
}

.archive-item-title {
    color: var(--text);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 3px;
    line-height: 1.4;
}

.archive-item-meta {
    color: var(--text-dim);
    font-size: 11px;
    margin-bottom: 4px;
}

.archive-item-snippet {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.phenomenon-flag, .cycle-flag {
    display: inline-block;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 1px;
    margin-right: 4px;
}

.phenomenon-flag {
    background: rgba(201, 74, 74, 0.2);
    color: var(--red);
    border: 1px solid rgba(201, 74, 74, 0.3);
}

.cycle-flag {
    background: rgba(244, 197, 66, 0.12);
    color: var(--accent);
    border: 1px solid rgba(244, 197, 66, 0.30);
}

/* ---- ITEM DETAIL (full record overlay) ---- */
.item-detail {
    background: var(--bg-elevated);
    border: 1px solid var(--border-bright);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 24px;
    position: relative;
}

.item-detail-close {
    position: absolute;
    top: 12px;
    right: 16px;
    color: var(--text-dim);
    font-size: 11px;
    cursor: pointer;
    letter-spacing: 1px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.item-detail-close:hover {
    color: var(--text);
    background: var(--bg-card);
}

.item-detail h3 {
    color: var(--text);
    font-size: 16px;
    margin-bottom: 8px;
    padding-right: 80px;
    line-height: 1.4;
}

.detail-meta {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 4px;
}

.detail-text {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    margin: 12px 0;
}

.detail-receipt {
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 12px;
}

.detail-receipt a {
    color: var(--accent-bright);
    text-decoration: none;
}

.detail-receipt a:hover {
    text-decoration: underline;
}

/* ---- PHENOMENON ---- */
.phenomenon-section { }

.phenomenon-entry {
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-left: 3px solid var(--red);
    border-radius: 0 4px 4px 0;
}

.phenomenon-name {
    color: var(--red);
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

/* ---- STATS GRID ---- */
.stats-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.stat-box .num {
    font-size: 24px;
    font-weight: bold;
    color: var(--gold);
    font-family: var(--mono);
}

.stat-box .label {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ---- ARCHIVE COUNT BREAKDOWN ---- */
.archive-count-breakdown {
    margin-top: 10px;
    border: 1px solid var(--border-bright);
    border-radius: 6px;
    overflow: hidden;
}

.archive-count-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.archive-count-row:last-child { border-bottom: none; }
.archive-count-row:nth-child(odd) { background: var(--bg-slightly); }

.archive-count-cycle {
    color: var(--text-dim);
}

.archive-count-num {
    color: var(--gold);
    font-weight: bold;
}

/* ---- SOURCES ---- */
.sources-list {
    margin-top: 10px;
}

.source-entry {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.source-name {
    color: var(--text);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.source-domain {
    color: var(--accent);
    font-size: 11px;
    margin-bottom: 4px;
}

.source-desc {
    font-size: 12px;
    line-height: 1.5;
}

/* ---- IDA RESPONSE (Ask Ida output) ---- */
.ida-response {
    color: var(--text);
    font-size: 14px;
    line-height: 1.7;
    padding: 12px 16px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border-left: 3px solid var(--cyan);
    border-radius: 0 4px 4px 0;
}

.ida-response-dim {
    color: var(--text-dim);
    border-left-color: var(--text-dim);
    background: var(--bg-slightly);
}

.ida-loading {
    color: var(--text-dim);
    font-size: 13px;
    font-style: italic;
    padding: 8px 16px;
}

/* ---- REPORT EVENTS (historical) ---- */
.report-event {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: var(--bg-card);
    border-left: 3px solid var(--accent-dim);
    border-radius: 0 4px 4px 0;
}

.report-event-date {
    color: var(--accent);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.report-event-title {
    color: var(--text);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.report-event-detail {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.5;
}

/* ============================================================
   RESPONSIVE — mobile layout
   On small screens, the live terminal moves below the report
   ============================================================ */
@media (max-width: 900px) {
    .ida-body {
        flex-direction: column;
    }

    .ida-live {
        width: 100%;
        height: 280px;
        border-left: none;
        border-top: 1px solid var(--border);
        order: -1; /* live terminal on top for mobile — see Ida working first */
    }

    .panel-tab { font-size: 9.5px; padding: 10px 4px; }
    .overlay { padding: 12px; }
    .archive-folder-grid { grid-template-columns: 1fr; }
    .chat-msg { max-width: 92%; }

    .ida-report-wrap {
        padding-bottom: 100px;
    }

    .ida-title { font-size: 22px; letter-spacing: 4px; }
    .ida-subtitle { font-size: 10px; }

    .acceleration-cell { padding: 9px; gap: 6px; }
    .acceleration-content-group { font-size: 9.5px; } /* mobile master scale, group stays locked */
    .acceleration-grid { gap: 6px; }
    .acceleration-arrow { font-size: 14px; }

    .era-row {
        grid-template-columns: 60px 1fr;
        font-size: 11px;
    }
    .era-row .era-years-cell,
    .era-row .era-note-cell {
        grid-column: 2;
        text-align: left;
    }


    .stats-grid { flex-direction: column; }

    .status-left, .status-right { gap: 8px; font-size: 9px; }
    .status-left { flex-wrap: wrap; }
    .status-framework { flex-basis: 100%; white-space: normal; }
    #status-bar { padding: 4px 12px; }

    #terminal, .ida-report-wrap { padding-left: 14px; padding-right: 14px; }
    #input-line { padding-left: 14px; padding-right: 14px; }
    .chat-log { padding: 14px; }
    .ida-header { padding: 12px 14px 10px 14px; }
}

@media (max-width: 500px) {
    body { font-size: 14px; }
    .ida-live { height: 200px; }
    #terminal { font-size: 13px; }
    .ida-live-stream { font-size: 11px; }
    .chat-msg { max-width: 96%; }
}

/* ---- SELECTION (subtle, navy) ---- */
::selection {
    background: var(--accent-dim);
    color: var(--text);
}


/* ---- CRT restricted to the boot/terminal screen only ----
   The approved template has a clean, flat, vibrant surface.
   The CRT texture belongs to the boot sequence, not the dashboard. */
body.booting .crt-overlay {
    opacity: 1;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0) 0px,
        rgba(0,0,0,0) 2px,
        rgba(0,0,0,0.08) 3px,
        rgba(0,0,0,0) 4px
    );
}
