/**
 * Intelligence Briefing Section
 * 
 * War room aesthetic with Bloomberg Terminal meets military intel styling.
 * Morphing query-to-results panel with streaming data reveal.
 */

/* ============================================
   SECTION FOUNDATION
   ============================================ */
.intel-section {
    position: relative;
    background:
        /* Teal terminal glow over deep slate */
        radial-gradient(circle at top center, rgba(56, 189, 248, 0.22) 0%, transparent 60%),
        linear-gradient(180deg, #020617 0%, #020617 100%);
    overflow: hidden;
}

/* Scan-line texture overlay */
.intel-section::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.04) 2px,
            rgba(0, 0, 0, 0.04) 4px);
    z-index: 1;
}

/* Subtle grid pattern */
.intel-section::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
}

[data-theme="light"] .intel-section {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

[data-theme="light"] .intel-section::before {
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 2px,
            rgba(0, 0, 0, 0.01) 4px);
}

[data-theme="light"] .intel-section::after {
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
}

/* ============================================
   SECTION HEADER
   ============================================ */
.intel-section .section-kicker {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    /* Matched to Benchmark/Security Clearance */
    color: #22c55e;
    letter-spacing: 0.2em;
}

.intel-section .section-title {
    color: #f1f5f9;
}

.intel-section .section-lead {
    color: #94a3b8;
}

[data-theme="light"] .intel-section .section-kicker {
    color: #16a34a;
}

[data-theme="light"] .intel-section .section-title {
    color: #0f172a;
}

[data-theme="light"] .intel-section .section-lead {
    color: #64748b;
}

/* ============================================
   INTEL CONTAINER & PANEL
   ============================================ */
.intel-container {
    position: relative;
    z-index: 2;
    margin-top: 2.5rem;
    /* Increased separation on mobile */
}

@media (min-width: 768px) {
    .intel-container {
        margin-top: 4rem;
    }
}

.intel-panel {
    position: relative;
    display: grid;
    grid-template-areas: "content";
    border-width: 1px 0;
    border-style: solid;
    border-color: rgba(56, 189, 248, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(148, 163, 184, 0.1);
    overflow: hidden;
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

@media (min-width: 768px) {
    .intel-panel {
        border-radius: 0.5rem;
        border-width: 1px;
    }
}

[data-theme="light"] .intel-panel {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-color: rgba(15, 23, 42, 0.06);
    box-shadow:
        inset 0 1px 0 rgba(148, 163, 184, 0.06);
}

/* State-based border glow */
.intel-panel[data-state="processing"] {
    border-color: rgba(56, 189, 248, 0.32);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.28),
        0 0 10px 0 rgba(56, 189, 248, 0.22),
        inset 0 1px 0 rgba(148, 163, 184, 0.12);
}

.intel-panel[data-state="streaming"],
.intel-panel[data-state="complete"] {
    border-color: rgba(34, 197, 94, 0.26);
    box-shadow:
        0 0 0 1px rgba(34, 197, 94, 0.25),
        0 0 9px 0 rgba(34, 197, 94, 0.18),
        inset 0 1px 0 rgba(148, 163, 184, 0.12);
}


/* ============================================
   PROCESSING OVERLAY
   ============================================ */
.intel-processing {
    position: absolute;
    inset: 0;
    background: rgba(10, 15, 26, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    transition: opacity 0.3s ease;
}

.intel-processing.is-active {
    opacity: 1;
    pointer-events: auto;
}

[data-theme="light"] .intel-processing {
    background: rgba(248, 250, 252, 0.95);
}

.intel-processing__scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(56, 189, 248, 0.6) 20%,
            rgba(34, 197, 94, 0.8) 50%,
            rgba(56, 189, 248, 0.6) 80%,
            transparent 100%);
    box-shadow: 0 0 14px 1px rgba(56, 189, 248, 0.28);
    top: 0;
    opacity: 0;
    transform: scaleX(0.8);
}

.intel-processing.is-active .intel-processing__scanline {
    animation: scanline-sweep 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes scanline-sweep {
    0% {
        top: 0;
        opacity: 0;
        transform: scaleX(0.8);
    }

    10% {
        opacity: 1;
        transform: scaleX(1);
    }

    90% {
        opacity: 1;
        transform: scaleX(1);
    }

    100% {
        top: 100%;
        opacity: 0;
        transform: scaleX(0.8);
    }
}

.intel-processing__status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: #38bdf8;
    letter-spacing: 0.05em;
    opacity: 0;
    transform: translateY(5px);
}

.intel-processing.is-active .intel-processing__status {
    animation: status-appear 0.3s ease-out 0.1s forwards;
}

@keyframes status-appear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="light"] .intel-processing__status {
    color: #0284c7;
}

.intel-processing__dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: processing-pulse 0.6s ease-in-out infinite;
    box-shadow: 0 0 7px rgba(34, 197, 94, 0.45);
}

@keyframes processing-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.3;
        transform: scale(0.7);
    }
}

.intel-processing__text {
    position: relative;
}

.intel-processing__text::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 50%;
    width: 2px;
    height: 1em;
    background: #38bdf8;
    transform: translateY(-50%);
    animation: cursor-blink 0.5s step-end infinite;
}

@keyframes cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

[data-theme="light"] .intel-processing__text::after {
    background: #0284c7;
}

/* ============================================
   QUERY STATE
   ============================================ */
.intel-query-state {
    grid-area: content;
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.intel-query-state.is-hidden {
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 768px) {
    .intel-query-state {
        padding: 2.5rem 3rem;
    }
}

@media (min-width: 1024px) {
    .intel-query-state {
        padding: 3rem 4rem;
    }
}

.intel-query {
    width: 100%;
}

.intel-query__row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .intel-query__row {
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }
}

@media (min-width: 768px) {
    .intel-query__row {
        gap: 2rem;
    }
}

.intel-query__content {
    flex: 1;
    min-width: 0;
}

.intel-query__text {
    font-size: 1.05rem;
    font-weight: 500;
    color: #e2e8f0;
    line-height: 1.6;
    margin-bottom: 0.875rem;
}

@media (min-width: 768px) {
    .intel-query__text {
        font-size: 1.125rem;
    }
}

[data-theme="light"] .intel-query__text {
    color: #1e293b;
}

.intel-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #22c55e;
    margin-left: 2px;
    animation: blink-cursor 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.intel-query__params {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.intel-query__param {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    /* Increased for mobile legibility */
    padding: 0.35rem 0.6rem;
    background-color: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 0.25rem;
    color: #7dd3fc;
}

[data-theme="light"] .intel-query__param {
    background-color: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.15);
    color: #0369a1;
}

/* ============================================
   EXECUTE BUTTON (Inline)
   ============================================ */
.intel-execute {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    /* Increased for mobile legibility */
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7dd3fc;
    background:
        linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(56, 189, 248, 0.3);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-height: 44px;
    /* Mobile touch target standard */
}

.intel-execute:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(34, 197, 94, 0.12) 100%);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.intel-execute:active {
    transform: translateY(0);
}

.intel-execute:disabled {
    cursor: default;
    opacity: 0.6;
}

[data-theme="light"] .intel-execute {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0%, rgba(34, 197, 94, 0.08) 100%);
    border-color: rgba(56, 189, 248, 0.35);
    color: #0284c7;
}

[data-theme="light"] .intel-execute:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(34, 197, 94, 0.12) 100%);
    border-color: rgba(56, 189, 248, 0.5);
}

.intel-execute__icon {
    color: #22c55e;
    font-size: 0.75rem;
}

.intel-execute__text {
    color: inherit;
}

.intel-execute__timer {
    font-size: 0.65rem;
    color: #4ade80;
    min-width: 1.25rem;
}

[data-theme="light"] .intel-execute__timer {
    color: #16a34a;
}

.intel-execute__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    /* Slightly thicker for visibility */
    width: 0%;
    background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%);
    transition: width 0.05s linear;
}

/* Countdown state */
.intel-panel[data-state="countdown"] .intel-execute {
    animation: execute-pulse 1.5s ease-in-out infinite;
}

@keyframes execute-pulse {

    0%,
    100% {
        border-color: rgba(34, 197, 94, 0.4);
    }

    50% {
        border-color: rgba(34, 197, 94, 0.7);
        box-shadow: 0 0 9px -3px rgba(34, 197, 94, 0.25);
    }
}

/* Paused state - hover to pause */
.intel-execute.is-paused {
    animation: none;
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 10px -3px rgba(251, 191, 36, 0.22);
}

.intel-execute.is-paused .intel-execute__progress {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 0 5px rgba(251, 191, 36, 0.35);
}

.intel-execute.is-paused .intel-execute__timer {
    color: #fbbf24;
}

.intel-execute.is-paused::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(251, 191, 36, 0.1) 50%,
            transparent 100%);
    animation: pause-scan 1.5s ease-in-out infinite;
}

@keyframes pause-scan {

    0%,
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }

    50% {
        transform: translateX(100%);
        opacity: 1;
    }
}

[data-theme="light"] .intel-execute.is-paused {
    border-color: rgba(217, 119, 6, 0.5);
    box-shadow: 0 0 9px -3px rgba(217, 119, 6, 0.2);
}

[data-theme="light"] .intel-execute.is-paused .intel-execute__timer {
    color: #d97706;
}

[data-theme="light"] .intel-execute.is-paused .intel-execute__progress {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

/* Accelerating state - resuming from pause */
.intel-execute.is-accelerating {
    animation: accel-pulse 0.2s ease-out;
}

.intel-execute.is-accelerating .intel-execute__progress {
    transition: none;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
}

@keyframes accel-pulse {
    0% {
        border-color: rgba(251, 191, 36, 0.5);
        box-shadow: 0 0 12px -4px rgba(251, 191, 36, 0.32);
    }

    100% {
        border-color: rgba(34, 197, 94, 0.6);
        box-shadow: 0 0 10px -4px rgba(34, 197, 94, 0.26);
    }
}

/* ============================================
   RESULTS STATE
   ============================================ */
.intel-results-state {
    grid-area: content;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 5;
}

.intel-results-state.is-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ============================================
   INTEL REPORT
   ============================================ */
.intel-report {
    display: flex;
    flex-direction: column;
}

.intel-report__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

@media (min-width: 768px) {
    .intel-report__header {
        padding: 1rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .intel-report__header {
        padding: 0.875rem 1.75rem;
        /* Balanced alignment */
    }
}

[data-theme="light"] .intel-report__header {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.intel-report__status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.intel-report__live {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: #22c55e;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.intel-report__live-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: live-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

@keyframes live-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

/* Transmitting state: faster pulse */
.intel-panel[data-state="streaming"] .intel-report__live-dot {
    animation: transmit-pulse 0.4s ease-in-out infinite;
}

@keyframes transmit-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.intel-report__title {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

[data-theme="light"] .intel-report__title {
    color: #64748b;
}

.intel-report__timestamp {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    color: #64748b;
}

[data-theme="light"] .intel-report__timestamp {
    color: #94a3b8;
}

.intel-report__body {
    padding: 0.875rem 1.25rem 0.5rem;
}

@media (min-width: 768px) {
    .intel-report__body {
        padding: 1rem 1.5rem 0.625rem;
    }
}

/* ============================================
   TARGET PROFILE (Compact)
   ============================================ */
.intel-target {
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.intel-target.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.intel-target__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.intel-target__identity {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.intel-target__name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f1f5f9;
}

[data-theme="light"] .intel-target__name {
    color: #0f172a;
}

.intel-target__meta {
    font-size: 0.8rem;
    color: #64748b;
}

.intel-target__funding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.intel-target__round {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    /* Mobile legible */
    font-weight: 500;
    padding: 0.35rem 0.65rem;
    background-color: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 0.25rem;
    color: #38bdf8;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.25s ease;
}

.intel-target__round.is-visible {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="light"] .intel-target__round {
    background-color: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.2);
    color: #0284c7;
}

/* ============================================
   COMPARABLE TRANSACTIONS
   ============================================ */
.intel-comps {
    margin-bottom: 0;
}

.intel-comps__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.intel-comps__label {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

[data-theme="light"] .intel-comps__label {
    color: #475569;
}

.intel-comps__count {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    color: #64748b;
    transition: color 0.2s ease;
}

.intel-comps__list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* ============================================
   COMP ITEM (Compact)
   ============================================ */
.intel-comp {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: rgba(30, 41, 59, 0.35);
    border: 1px solid rgba(56, 189, 248, 0.06);
    border-radius: 0.25rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.intel-comp.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.intel-comp:hover {
    background: rgba(30, 41, 59, 0.42);
    border-color: rgba(56, 189, 248, 0.1);
}

[data-theme="light"] .intel-comp {
    background: rgba(248, 250, 252, 0.7);
    border-color: rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .intel-comp:hover:not([data-intel-comp="1"]) {
    background: rgba(248, 250, 252, 0.78);
    border-color: rgba(15, 23, 42, 0.08);
}

/* First comp (hidden competitor) has special highlight */
.intel-comp[data-intel-comp="1"] {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.06) 0%, rgba(30, 41, 59, 0.4) 100%);
    border-color: rgba(251, 191, 36, 0.2);
}

.intel-comp[data-intel-comp="1"]:hover {
    border-color: rgba(251, 191, 36, 0.28);
}

[data-theme="light"] .intel-comp[data-intel-comp="1"] {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-color: rgba(217, 119, 6, 0.2);
}

[data-theme="light"] .intel-comp[data-intel-comp="1"]:hover {
    border-color: rgba(217, 119, 6, 0.28);
}

.intel-comp__rank {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: #475569;
    width: 1.5rem;
}

.intel-comp[data-intel-comp="1"] .intel-comp__rank {
    color: #fbbf24;
}

[data-theme="light"] .intel-comp[data-intel-comp="1"] .intel-comp__rank {
    color: #d97706;
}

.intel-comp__info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.intel-comp__name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: #e2e8f0;
}

[data-theme="light"] .intel-comp__name {
    color: #1e293b;
}

.intel-comp__detail {
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.3;
}

.intel-comp__funding {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

@media (max-width: 640px) {
    .intel-comp {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    .intel-comp__rank {
        display: none;
    }

    .intel-comp__funding {
        justify-content: flex-start;
    }
}

/* ============================================
   BADGES & CHIPS
   ============================================ */
.intel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.5rem;
    font-weight: 600;
    padding: 0.15rem 0.35rem;
    border-radius: 0.15rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.intel-badge--hidden {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

[data-theme="light"] .intel-badge--hidden {
    background: rgba(251, 191, 36, 0.12);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.3);
}

.intel-badge__icon {
    width: 0.6rem;
    height: 0.6rem;
}

.intel-chip {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.2rem;
    background-color: rgba(14, 165, 233, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.15);
    white-space: nowrap;
}

[data-theme="light"] .intel-chip {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.25);
}

.intel-chip--highlight {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="light"] .intel-chip--highlight {
    background-color: rgba(22, 163, 74, 0.1);
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
}

.intel-chip--progress {
    background-color: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.25);
}

[data-theme="light"] .intel-chip--progress {
    background-color: rgba(217, 119, 6, 0.1);
    color: #b45309;
    border-color: rgba(217, 119, 6, 0.25);
}

.intel-chip,
.intel-query__param {
    transition:
        background-color 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {

    .intel-chip:hover,
    .intel-query__param:hover {
        background-color: rgba(14, 165, 233, 0.16);
        border-color: rgba(56, 189, 248, 0.28);
        box-shadow:
            inset 0 1px 0 rgba(148, 163, 184, 0.08),
            0 10px 18px -14px rgba(56, 189, 248, 0.55);
        transform: translateY(-1px);
    }

    .intel-chip--highlight:hover {
        background-color: rgba(34, 197, 94, 0.2);
        border-color: rgba(34, 197, 94, 0.4);
        box-shadow:
            inset 0 1px 0 rgba(148, 163, 184, 0.08),
            0 10px 18px -14px rgba(34, 197, 94, 0.6);
    }

    .intel-chip--progress:hover {
        background-color: rgba(251, 191, 36, 0.16);
        border-color: rgba(251, 191, 36, 0.4);
        box-shadow:
            inset 0 1px 0 rgba(148, 163, 184, 0.08),
            0 10px 18px -14px rgba(251, 191, 36, 0.6);
    }

    .intel-target__round.is-visible:hover {
        background-color: rgba(14, 165, 233, 0.16);
        border-color: rgba(56, 189, 248, 0.28);
        box-shadow:
            inset 0 1px 0 rgba(148, 163, 184, 0.08),
            0 10px 18px -14px rgba(56, 189, 248, 0.55);
        transform: translateX(0) translateY(-1px);
    }
}

@media (prefers-reduced-motion: reduce) {

    .intel-chip,
    .intel-target__round,
    .intel-query__param {
        transform: none !important;
    }
}

/* ============================================
   INTEL SUMMARY (Compact)
   ============================================ */
.intel-summary {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 0;
    border-top: 1px solid rgba(56, 189, 248, 0.08);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease 0.15s, transform 0.3s ease 0.15s;
}

.intel-summary.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 480px) {
    .intel-summary {
        flex-wrap: wrap;
    }
}

.intel-summary__stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 0.25rem;
}

[data-theme="light"] .intel-summary__stat {
    background: rgba(22, 163, 74, 0.05);
    border-color: rgba(22, 163, 74, 0.12);
}

.intel-summary__value {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: #22c55e;
}

[data-theme="light"] .intel-summary__value {
    color: #16a34a;
}

.intel-summary__label {
    font-size: 0.65rem;
    color: #64748b;
}

/* ============================================
   REPORT FOOTER / SOURCES BAR
   ============================================ */
.intel-report__footer {
    padding: 0.625rem 1.25rem;
    background: rgba(15, 23, 42, 0.6);
    border-top: 1px solid rgba(56, 189, 248, 0.08);
    opacity: 0;
    transition: opacity 0.4s ease 0.3s;
}

@media (min-width: 768px) {
    .intel-report__footer {
        padding: 0.625rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .intel-report__footer {
        padding: 0.625rem 1.75rem;
        /* Balanced alignment */
    }
}

.intel-report__footer.is-visible {
    opacity: 1;
}

[data-theme="light"] .intel-report__footer {
    background: rgba(241, 245, 249, 0.8);
    border-top-color: rgba(15, 23, 42, 0.06);
}

.intel-sources-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.intel-sources-bar__label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.intel-sources-bar__icon {
    width: 0.8rem;
    height: 0.8rem;
    opacity: 0.7;
}

.intel-sources-bar__list {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.65rem;
    color: #94a3b8;
}

[data-theme="light"] .intel-sources-bar__list {
    color: #64748b;
}

/* ============================================
   FLOATING PROMPT HINT
   ============================================ */
.intel-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.intel-panel[data-state="complete"]:not(.is-fading)~.intel-prompt {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.intel-prompt__cursor {
    font-size: 0.6rem;
    color: #22c55e;
    animation: prompt-pulse 1.5s ease-in-out infinite;
}

@keyframes prompt-pulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

.intel-prompt__text {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    color: #64748b;
    letter-spacing: 0.02em;
}

[data-theme="light"] .intel-prompt__text {
    color: #7b8794;
}

[data-theme="light"] .intel-prompt__cursor {
    color: #16a34a;
}

/* ============================================
   COMP STREAMING FLASH EFFECT (Subtle)
   ============================================ */
.intel-comp.is-visible {
    animation: comp-flash 0.3s ease-out;
}

@keyframes comp-flash {
    0% {
        background: rgba(56, 189, 248, 0.1);
        border-color: rgba(56, 189, 248, 0.25);
    }

    100% {
        background: rgba(30, 41, 59, 0.35);
        border-color: rgba(56, 189, 248, 0.06);
    }
}

/* First comp (hidden competitor) subtle highlight flash */
.intel-comp[data-intel-comp="1"].is-visible {
    animation: hidden-flash 0.4s ease-out;
}

@keyframes hidden-flash {
    0% {
        background: rgba(251, 191, 36, 0.15);
        border-color: rgba(251, 191, 36, 0.4);
    }

    100% {
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.06) 0%, rgba(30, 41, 59, 0.4) 100%);
        border-color: rgba(251, 191, 36, 0.2);
    }
}

/* ============================================
   COMPLETE STATE FLASH
   ============================================ */
.intel-panel[data-state="complete"] {
    animation: complete-flash 0.6s ease-out;
}

@keyframes complete-flash {
    0% {
        border-color: rgba(34, 197, 94, 0.48);
        box-shadow:
            0 0 0 1px rgba(34, 197, 94, 0.3),
            0 0 12px 0 rgba(34, 197, 94, 0.26);
    }

    100% {
        border-color: rgba(34, 197, 94, 0.35);
        box-shadow:
            0 0 0 1px rgba(34, 197, 94, 0.25),
            0 0 8px 0 rgba(34, 197, 94, 0.18);
    }
}

/* Complete state: update live indicator style */
.intel-panel[data-state="complete"] .intel-report__live {
    color: #4ade80;
}

.intel-panel[data-state="complete"] .intel-report__live-dot {
    background: #4ade80;
    animation: none;
    box-shadow: 0 0 7px rgba(74, 222, 128, 0.35);
}

/* ============================================
   FADE STATE (Reset Transition)
   ============================================ */
.intel-panel.is-fading .intel-results-state {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.intel-panel.is-fading {
    border-color: rgba(100, 116, 139, 0.2) !important;
    box-shadow:
        0 0 0 1px rgba(100, 116, 139, 0.25) !important;
    transition: all 0.4s ease;
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {

    .intel-processing__scanline,
    .intel-processing__dot,
    .intel-report__live-dot,
    .intel-cursor,
    .intel-processing__text::after,
    .intel-execute.is-paused::before,
    .intel-prompt__cursor {
        animation: none;
    }

    .intel-processing.is-active .intel-processing__status {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .intel-panel[data-state="countdown"] .intel-execute,
    .intel-panel[data-state="complete"],
    .intel-comp.is-visible,
    .intel-comp[data-intel-comp="1"].is-visible {
        animation: none;
    }

    .intel-target,
    .intel-target__round,
    .intel-comp,
    .intel-report__footer {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* ============================================
   LIGHT MODE FLASH ADJUSTMENTS
   ============================================ */
[data-theme="light"] .intel-comp.is-visible {
    animation: comp-flash-light 0.3s ease-out;
}

@keyframes comp-flash-light {
    0% {
        background: rgba(14, 165, 233, 0.1);
        border-color: rgba(14, 165, 233, 0.25);
    }

    100% {
        background: rgba(248, 250, 252, 0.7);
        border-color: rgba(15, 23, 42, 0.05);
    }
}

[data-theme="light"] .intel-comp[data-intel-comp="1"].is-visible {
    animation: hidden-flash-light 0.4s ease-out;
}

@keyframes hidden-flash-light {
    0% {
        background: rgba(251, 191, 36, 0.15);
        border-color: rgba(217, 119, 6, 0.35);
    }

    100% {
        background: linear-gradient(135deg, rgba(251, 191, 36, 0.08) 0%, rgba(255, 255, 255, 0.9) 100%);
        border-color: rgba(217, 119, 6, 0.2);
    }
}

[data-theme="light"] .intel-panel[data-state="complete"] {
    animation: complete-flash-light 0.5s ease-out;
}

@keyframes complete-flash-light {
    0% {
        border-color: rgba(22, 163, 74, 0.38);
        box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.04),
            0 0 12px -4px rgba(22, 163, 74, 0.16);
    }

    100% {
        border-color: rgba(22, 163, 74, 0.24);
        box-shadow:
            0 0 0 1px rgba(15, 23, 42, 0.04),
            0 0 9px -4px rgba(22, 163, 74, 0.08);
    }
}

[data-theme="light"] .intel-panel[data-state="complete"] .intel-report__live {
    color: #16a34a;
}

[data-theme="light"] .intel-panel[data-state="complete"] .intel-report__live-dot {
    background: #16a34a;
    box-shadow: 0 0 5px rgba(22, 163, 74, 0.25);
}