/* ============================================================
   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:
     Navy backgrounds: #0a1428 (base), #0d1b30 (card), #11203a (elevated)
     Off-white text: #e0e6f0 (primary), #9aa8c0 (dim), #5a6885 (dimmer)
     Accent blue: #4a90d9 (links, active), #2a6bb8 (hover)
     Accent cyan: #5fc7d4 (scanner activity, live status)
     Status: #3aaa6a (green/OK), #c94a4a (red/alert), #d4a44a (warn)
     Borders: #1a2a48 (base), #243a60 (elevated)
   ============================================================ */

/* ---- ROOT TOKENS ---- */
:root {
    --bg: #0a1428;
    --bg-slightly: #0d1b30;
    --bg-card: #11203a;
    --bg-elevated: #16284a;

    --text: #e0e6f0;
    --text-dim: #9aa8c0;
    --text-dimmer: #5a6885;

    --accent: #4a90d9;
    --accent-bright: #6ab0f9;
    --accent-dim: #2a6bb8;

    --cyan: #5fc7d4;
    --cyan-dim: #3a8a96;
    --cyan-glow: rgba(95, 199, 212, 0.06);

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

    --border: #1a2a48;
    --border-bright: #243a60;
    --border-accent: #2a4a78;

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

    --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(--mono);
    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: 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
    );
}

.crt-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        transparent 65%,
        rgba(5, 10, 20, 0.5) 100%
    );
}

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

#screen {
    animation: flicker 4s infinite;
    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;
}

#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; }
.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;
}

#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: 16px 24px 12px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-slightly);
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    gap: 16px;
}

.ida-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--text);
    letter-spacing: 6px;
    font-family: var(--mono);
}

.ida-subtitle {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

/* ---- 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: 360px;
    flex-shrink: 0;
    border-left: 1px solid var(--border);
    background: var(--bg-slightly);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.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); }

/* ============================================================
   ASK IDA — the input at the bottom
   ============================================================ */
.ida-ask {
    display: none;
    padding: 12px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-slightly);
    flex-shrink: 0;
}

.ida-ask.visible {
    display: block;
}

.ida-ask-prompt {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.ida-ask-icon {
    color: var(--cyan);
    font-size: 14px;
}

.ida-ask-label {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.ida-ask-input-wrap input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: 4px;
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    outline: none;
    caret-color: var(--cyan);
    transition: border-color 0.2s;
}

.ida-ask-input-wrap input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-dim);
}

.ida-ask-input-wrap input::placeholder {
    color: var(--text-dimmer);
}

/* ============================================================
   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;
}

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

.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);
}

.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 ---- */
.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(--accent-bright);
    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;
    gap: 12px;
    margin-bottom: 12px;
}

.acceleration-cell {
    flex: 1;
    text-align: center;
    padding: 16px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: 6px;
}

.acceleration-years {
    font-size: 28px;
    font-weight: bold;
    color: var(--cyan);
    font-family: var(--mono);
}

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

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

.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: var(--bg-elevated) !important;
    border-left: 3px solid var(--cyan);
}

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

/* ---- 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;
}

.cycle-progression {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border);
}

.cycle-step {
    padding: 6px 0;
    font-size: 12px;
    color: var(--text-dim);
}

.cycle-step.completed {
    color: var(--text-dimmer);
    text-decoration: line-through;
}

.cycle-step.current {
    color: var(--cyan);
    font-weight: bold;
    border-left: 3px solid var(--cyan);
    padding-left: 10px;
    margin-left: -10px;
}

.cycle-arrow {
    color: var(--text-dimmer);
    text-align: center;
    font-size: 14px;
}

/* ---- CYCLE ARC ---- */
.cycle-arc-section { }

.cycle-arc-display {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.cycle-arc-node {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 14px 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: 6px;
}

.cycle-arc-num {
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.cycle-arc-name {
    font-size: 12px;
    color: var(--text);
    font-weight: bold;
    margin-bottom: 4px;
}

.cycle-arc-duration {
    font-size: 10px;
    color: var(--text-dimmer);
}

.cycle-arc-connector {
    color: var(--text-dim);
    font-size: 18px;
    align-self: center;
    padding: 0 2px;
}

.cycle-arc-return {
    text-align: center;
    color: var(--cyan);
    font-size: 12px;
    font-weight: bold;
    margin: 10px 0;
    letter-spacing: 1px;
}

.cycle-arc-note {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.7;
}

.cycle-arc-note strong {
    color: var(--text);
}

/* ---- 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(--accent);
    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(74, 144, 217, 0.15);
    color: var(--accent);
    border: 1px solid rgba(74, 144, 217, 0.25);
}

/* ---- 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-bright);
    border-radius: 6px;
}

.stat-box .num {
    font-size: 24px;
    font-weight: bold;
    color: var(--cyan);
    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(--cyan);
    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: 240px;
        border-left: none;
        border-top: 1px solid var(--border);
        order: -1; /* live terminal on top for mobile — see Ida working first */
    }

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

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

    .acceleration-grid { flex-direction: column; }
    .acceleration-cell { padding: 12px; }
    .acceleration-years { font-size: 22px; }

    .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;
    }

    .cycle-arc-display { flex-direction: column; }
    .cycle-arc-connector {
        transform: rotate(90deg);
        text-align: center;
    }

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

    .status-left, .status-right { gap: 8px; font-size: 9px; }
    #status-bar { padding: 4px 12px; }

    #terminal, .ida-report-wrap { padding-left: 14px; padding-right: 14px; }
    #input-line { padding-left: 14px; padding-right: 14px; }
    .ida-ask { padding: 10px 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; }
}

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