/* =============================================================
   bada.city - Military Command Terminal / Field Ops Dossier
   Palette: #E8DCC8 #1A1610 #A0522D #D4A050 #3B2F20 #8B7355 #8B3A2A
            #C4A97D #B8A888 #D4C8A8
   Typography: Bebas Neue (display), IBM Plex Mono (body/data),
               Space Grotesk (labels), Inter (UI)
   ============================================================= */

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: #1A1610;
    color: #3B2F20;
    font-family: 'IBM Plex Mono', 'Inter', monospace;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    cursor: crosshair;
}

body {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(139, 115, 85, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(160, 82, 45, 0.05) 0%, transparent 60%),
        #1A1610;
}

/* =================== CRT SCANLINE OVERLAY =================== */
#crt-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.06) 3px,
            rgba(0, 0, 0, 0.06) 3px
        );
    mix-blend-mode: multiply;
    opacity: 0.45;
}

#crt-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(26, 22, 16, 0.35) 100%);
    pointer-events: none;
}

/* =================== BRAND ANCHOR (TOP-LEFT) =================== */
#brand-anchor {
    position: fixed;
    top: 20px;
    left: 28px;
    z-index: 120;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
    background: rgba(26, 22, 16, 0.85);
    border: 1px solid #A0522D;
    border-left: 3px solid #D4A050;
}

.brand-mark {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.18em;
    color: #D4A050;
    line-height: 1;
}

.brand-sub {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-size: 9px;
    letter-spacing: 0.24em;
    color: #8B7355;
    text-transform: uppercase;
}

/* =================== STATUS READOUT (TOP-RIGHT) =================== */
#status-readout {
    position: fixed;
    top: 20px;
    right: 28px;
    z-index: 120;
    padding: 10px 16px;
    background: rgba(26, 22, 16, 0.85);
    border: 1px solid #3B2F20;
    border-right: 3px solid #A0522D;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
    min-width: 220px;
}

.status-row {
    display: grid;
    grid-template-columns: 60px 12px 1fr;
    gap: 4px;
    color: #8B7355;
}

.status-key {
    color: #8B7355;
    letter-spacing: 0.12em;
}

.status-sep {
    color: #A0522D;
    text-align: center;
}

.status-val {
    color: #D4C8A8;
    letter-spacing: 0.05em;
}

.status-ok {
    color: #D4A050;
}

/* =================== SCROLL HINT (RIGHT EDGE) =================== */
#scroll-hint {
    position: fixed;
    right: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 115;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

#scroll-hint.visible {
    opacity: 1;
    animation: hint-pulse 2s ease-in-out infinite;
}

#scroll-hint.hidden {
    opacity: 0 !important;
}

.hint-arrow {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    line-height: 0.8;
    color: #A0522D;
    transform: rotate(90deg);
    letter-spacing: 0;
}

.hint-arrow:nth-child(1) { animation: hint-travel 1.4s ease-in-out infinite 0s; color: #8B3A2A; }
.hint-arrow:nth-child(2) { animation: hint-travel 1.4s ease-in-out infinite 0.15s; color: #A0522D; }
.hint-arrow:nth-child(3) { animation: hint-travel 1.4s ease-in-out infinite 0.3s; color: #D4A050; }

.hint-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.28em;
    color: #8B7355;
    writing-mode: vertical-rl;
    margin-top: 8px;
}

@keyframes hint-travel {
    0%, 100% { transform: rotate(90deg) translateY(0); opacity: 0.4; }
    50%      { transform: rotate(90deg) translateY(8px); opacity: 1; }
}

@keyframes hint-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(212, 160, 80, 0.1)); }
    50%      { filter: drop-shadow(0 0 6px rgba(212, 160, 80, 0.35)); }
}

/* =================== PIP NAVIGATION =================== */
#panel-nav {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    display: flex;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(26, 22, 16, 0.85);
    border: 1px solid #3B2F20;
    border-top: 2px solid #A0522D;
}

.pip {
    position: relative;
    width: 12px;
    height: 12px;
    border: 1.5px solid #8B7355;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.pip:hover {
    border-color: #A0522D;
    background: rgba(160, 82, 45, 0.3);
}

.pip.active {
    width: 36px;
    border-radius: 8px;
    background: #A0522D;
    border-color: #D4A050;
    box-shadow: 0 0 10px rgba(212, 160, 80, 0.45);
}

.pip::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: #8B7355;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
}

.pip:hover::after,
.pip.active::after {
    opacity: 1;
    color: #D4A050;
}

/* =================== PROGRESS BAR =================== */
#progress-bar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: rgba(59, 47, 32, 0.5);
    z-index: 110;
}

#progress-fill {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #A0522D 0%, #D4A050 100%);
    box-shadow: 0 0 8px rgba(212, 160, 80, 0.4);
    transition: width 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =================== SCROLL CONTAINER =================== */
#scroll-container {
    display: flex;
    width: 500vw;
    height: 100vh;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.panel {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    padding: 68px 72px 60px 72px;
    position: relative;
    overflow: hidden;
}

.panel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 40px 48px;
    overflow: hidden;
}

/* =================== AGED PAPER TEXTURE =================== */
.aged-paper {
    background-color: #E8DCC8;
    background-image:
        radial-gradient(circle at 12% 22%, rgba(196, 169, 125, 0.22) 0%, transparent 18%),
        radial-gradient(circle at 78% 14%, rgba(196, 169, 125, 0.18) 0%, transparent 14%),
        radial-gradient(circle at 64% 62%, rgba(196, 169, 125, 0.14) 0%, transparent 20%),
        radial-gradient(circle at 32% 84%, rgba(196, 169, 125, 0.18) 0%, transparent 16%),
        radial-gradient(circle at 88% 72%, rgba(196, 169, 125, 0.12) 0%, transparent 15%),
        radial-gradient(circle at 48% 44%, rgba(196, 169, 125, 0.08) 0%, transparent 22%),
        repeating-linear-gradient(
            3deg,
            transparent 0px,
            transparent 2px,
            rgba(212, 200, 168, 0.18) 2px,
            rgba(212, 200, 168, 0.18) 3px
        ),
        repeating-linear-gradient(
            93deg,
            transparent 0px,
            transparent 140px,
            rgba(184, 168, 136, 0.12) 140px,
            rgba(184, 168, 136, 0.12) 141px
        );
    box-shadow:
        inset 0 0 60px rgba(59, 47, 32, 0.28),
        inset 0 0 160px rgba(59, 47, 32, 0.12),
        0 0 0 1px #C4A97D,
        0 18px 48px rgba(0, 0, 0, 0.55);
    color: #3B2F20;
    border-radius: 2px;
}

.aged-paper::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0%, rgba(184, 168, 136, 0.3) 0.3%, transparent 0.6%) no-repeat,
        linear-gradient(90deg, transparent 40%, rgba(184, 168, 136, 0.22) 40.2%, transparent 40.5%) no-repeat,
        linear-gradient(180deg, transparent 0%, rgba(184, 168, 136, 0.25) 0.2%, transparent 0.5%) no-repeat;
    background-position: 18% 0, 0 0, 0 62%;
    mix-blend-mode: multiply;
    opacity: 0.8;
}

.aged-paper-heavy {
    filter: saturate(0.9);
}

/* Tech grid underlay (on top of aged paper) */
.tech-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(0deg, transparent 0, transparent 47px, rgba(196, 169, 125, 0.25) 48px, transparent 48px),
        repeating-linear-gradient(90deg, transparent 0, transparent 47px, rgba(196, 169, 125, 0.25) 48px, transparent 48px);
    mix-blend-mode: multiply;
    opacity: 0.5;
}

/* =================== PANEL HEADER (SHARED) =================== */
.panel-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding-bottom: 14px;
    margin-bottom: 28px;
    border-bottom: 2px solid #A0522D;
    position: relative;
    z-index: 2;
}

.panel-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 1px;
    background: #A0522D;
    opacity: 0.35;
}

.classification-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #E8DCC8;
    background: #8B3A2A;
    padding: 5px 12px;
    text-transform: uppercase;
    align-self: center;
}

.panel-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 88px;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: #3B2F20;
    line-height: 0.9;
    text-transform: uppercase;
}

.panel-ref {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: #8B7355;
    margin-left: auto;
    text-transform: uppercase;
}

/* Decorative classification stamps */
.classification-stamp-decor {
    position: absolute;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 34px;
    letter-spacing: 0.1em;
    color: #8B3A2A;
    padding: 4px 16px;
    border: 3px double #8B3A2A;
    transform: rotate(-4deg);
    opacity: 0.35;
    pointer-events: none;
    text-transform: uppercase;
    z-index: 3;
}

.classification-stamp-decor.stamp-burn {
    opacity: 0.3;
    border-color: #A0522D;
    color: #A0522D;
    transform: rotate(3deg);
}

/* =================== PANEL 0: BOOT SEQUENCE =================== */
.panel-boot {
    background: #0C0A06;
}

.panel-boot .panel-inner {
    padding: 0;
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boot-crossfade {
    position: absolute;
    inset: 0;
    background: #E8DCC8;
    opacity: 0;
    transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}

.boot-crossfade.crossfading {
    opacity: 0.08;
}

.boot-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 820px;
    padding: 0 40px;
}

.boot-terminal {
    border: 1px solid rgba(212, 160, 80, 0.25);
    background: rgba(12, 10, 6, 0.85);
    padding: 0;
    position: relative;
    box-shadow: 0 0 80px rgba(212, 160, 80, 0.08), inset 0 0 120px rgba(212, 160, 80, 0.04);
}

.boot-terminal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(212, 160, 80, 0.03) 1px,
        rgba(212, 160, 80, 0.03) 2px
    );
    pointer-events: none;
}

.boot-header {
    display: flex;
    justify-content: space-between;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(212, 160, 80, 0.2);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #8B7355;
    text-transform: uppercase;
}

.boot-content {
    padding: 24px 28px 32px 28px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    line-height: 1.85;
    color: #D4A050;
    min-height: 420px;
    position: relative;
}

.boot-line {
    display: block;
    white-space: pre-wrap;
    color: #D4A050;
    text-shadow: 0 0 6px rgba(212, 160, 80, 0.25);
}

.boot-line.ok { color: #D4A050; }
.boot-line.warn { color: #8B3A2A; }
.boot-line.success { color: #8FAE5A; }

.boot-final {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 18px;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 48px;
    letter-spacing: 0.1em;
    color: #D4A050;
    border: 2px solid #D4A050;
    text-shadow: 0 0 12px rgba(212, 160, 80, 0.45);
    animation: final-flash 0.4s ease-in-out 0s 3;
}

@keyframes final-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.boot-cursor {
    display: inline-block;
    width: 9px;
    height: 16px;
    background: #D4A050;
    vertical-align: text-bottom;
    margin-left: 2px;
    animation: cursor-blink 1s steps(2, start) infinite;
    box-shadow: 0 0 6px rgba(212, 160, 80, 0.6);
}

@keyframes cursor-blink {
    to { visibility: hidden; }
}

/* =================== PANEL 1: TERRAIN =================== */
.panel-terrain .panel-inner {
    display: flex;
    flex-direction: column;
}

.terrain-container {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    min-height: 0;
    position: relative;
    z-index: 2;
}

.topo-map {
    position: relative;
    background: rgba(232, 220, 200, 0.2);
    border: 1px solid rgba(139, 115, 85, 0.5);
    box-shadow: inset 0 0 24px rgba(59, 47, 32, 0.15);
    overflow: hidden;
}

.topo-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.contour-drift {
    animation: contour-drift 28s linear infinite;
    transform-origin: center;
}

@keyframes contour-drift {
    0% { transform: translateX(0); }
    50% { transform: translateX(14px); }
    100% { transform: translateX(0); }
}

.loc-marker {
    cursor: pointer;
    outline: none;
}

.loc-marker circle:first-child {
    transition: r 0.3s ease, stroke-width 0.3s ease;
    transform-origin: center;
}

.loc-marker.pulse-ring,
.loc-marker .pulse-ring {
    animation: ring-pulse 2.2s ease-in-out infinite;
    transform-origin: 416px 256px;
}

@keyframes ring-pulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(1.4); }
}

.loc-marker:hover text {
    fill: #D4A050;
}

.map-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(26, 22, 16, 0.95);
    border: 1px solid #A0522D;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(212, 160, 80, 0.25);
    padding: 14px 16px;
    width: 260px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #D4C8A8;
    clip-path: circle(4px at 50% 50%);
    opacity: 0;
    transition:
        clip-path 0.55s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.4s ease,
        left 0.2s ease,
        top 0.2s ease;
    z-index: 10;
}

.map-tooltip.visible {
    clip-path: inset(0 round 4px);
    opacity: 1;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(212, 160, 80, 0.3);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: #8B7355;
    text-transform: uppercase;
}

.tooltip-tag {
    color: #8B3A2A;
}

.tooltip-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: #D4A050;
    letter-spacing: 0.06em;
    line-height: 1.05;
    margin-bottom: 8px;
}

.tooltip-body {
    color: #D4C8A8;
    line-height: 1.55;
    margin-bottom: 10px;
    font-size: 11px;
}

.tooltip-foot {
    display: flex;
    justify-content: space-between;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.16em;
    color: #8B7355;
    text-transform: uppercase;
    padding-top: 6px;
    border-top: 1px solid rgba(212, 160, 80, 0.2);
}

.tooltip-blink {
    color: #D4A050;
    animation: blink-subtle 1.2s ease-in-out infinite;
}

@keyframes blink-subtle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* Terrain sidebar */
.terrain-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    overflow: hidden;
}

.sidebar-stamp {
    padding: 14px 16px;
    background: rgba(160, 82, 45, 0.08);
    border: 1px solid #A0522D;
    border-left-width: 4px;
}

.sidebar-title {
    display: block;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px;
    letter-spacing: 0.1em;
    color: #8B3A2A;
    margin-bottom: 6px;
}

.sidebar-lede {
    font-size: 12px;
    line-height: 1.65;
    color: #3B2F20;
}

.data-group {
    padding: 14px 16px;
    background: rgba(232, 220, 200, 0.3);
    border: 1px solid rgba(139, 115, 85, 0.35);
}

.data-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: #A0522D;
    margin-bottom: 10px;
    text-transform: uppercase;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(160, 82, 45, 0.4);
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    padding: 4px 0;
    color: #3B2F20;
}

.data-row span:first-child {
    color: #8B7355;
    letter-spacing: 0.12em;
    font-size: 10px;
    align-self: center;
}

.assessment-text {
    font-size: 12px;
    line-height: 1.65;
    color: #3B2F20;
}

.highlight-coord {
    color: #A0522D;
    font-weight: 500;
    background: rgba(212, 160, 80, 0.15);
    padding: 1px 4px;
}

/* =================== PANEL 2: DOSSIER STRIP =================== */
.panel-dossier .panel-inner {
    display: flex;
    flex-direction: column;
}

.dossier-strip {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 8px;
    min-height: 0;
}

.dossier-fragment {
    position: relative;
    background: #E8DCC8;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(196, 169, 125, 0.28) 0%, transparent 22%),
        radial-gradient(circle at 78% 72%, rgba(196, 169, 125, 0.18) 0%, transparent 18%),
        repeating-linear-gradient(
            2deg,
            transparent 0,
            transparent 2px,
            rgba(212, 200, 168, 0.2) 2px,
            rgba(212, 200, 168, 0.2) 3px
        );
    border: 1px solid rgba(139, 115, 85, 0.45);
    box-shadow:
        inset 0 0 40px rgba(59, 47, 32, 0.18),
        0 6px 18px rgba(0, 0, 0, 0.25);
    padding: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
}

.dossier-fragment:nth-child(1) { transform: rotate(-0.5deg); }
.dossier-fragment:nth-child(2) { transform: rotate(0.3deg); }
.dossier-fragment:nth-child(3) { transform: rotate(-0.2deg); }

.dossier-fragment:hover {
    transform: rotate(0) translateY(-6px);
    box-shadow:
        inset 0 0 40px rgba(59, 47, 32, 0.18),
        0 14px 32px rgba(0, 0, 0, 0.45);
}

.fragment-edge {
    height: 12px;
    background:
        linear-gradient(180deg, transparent 0%, rgba(139, 115, 85, 0.3) 100%),
        repeating-linear-gradient(90deg,
            #E8DCC8 0px, #E8DCC8 8px,
            transparent 8px, transparent 10px,
            #E8DCC8 10px, #E8DCC8 16px,
            transparent 16px, transparent 19px,
            #E8DCC8 19px, #E8DCC8 24px,
            transparent 24px, transparent 26px);
}

.fragment-edge-top {
    background:
        linear-gradient(0deg, transparent 0%, rgba(139, 115, 85, 0.3) 100%),
        repeating-linear-gradient(90deg,
            #E8DCC8 0px, #E8DCC8 8px,
            transparent 8px, transparent 10px,
            #E8DCC8 10px, #E8DCC8 16px,
            transparent 16px, transparent 19px,
            #E8DCC8 19px, #E8DCC8 24px,
            transparent 24px, transparent 26px);
    clip-path: polygon(0 100%, 3% 30%, 8% 80%, 14% 20%, 22% 70%, 30% 25%, 38% 65%, 46% 30%, 56% 75%, 64% 20%, 74% 60%, 82% 25%, 90% 75%, 96% 30%, 100% 75%, 100% 100%);
}

.fragment-edge-bottom {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 96% 70%, 90% 25%, 82% 75%, 74% 40%, 64% 80%, 56% 25%, 46% 70%, 38% 35%, 30% 75%, 22% 30%, 14% 80%, 8% 20%, 3% 70%, 0 0);
}

.fragment-content {
    flex: 1;
    padding: 20px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.fragment-stamp {
    align-self: flex-start;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 14px;
    letter-spacing: 0.18em;
    padding: 3px 10px;
    border: 2px solid;
    text-transform: uppercase;
    transform: rotate(-2deg);
    transition: box-shadow 0.3s ease, border-width 0.3s ease, transform 0.3s ease;
}

.fragment-stamp:hover {
    transform: rotate(-1deg);
    box-shadow: 0 0 12px 2px rgba(139, 58, 42, 0.15);
}

.stamp-declassified {
    color: #8B3A2A;
    border-color: rgba(139, 58, 42, 0.55);
}

.stamp-field {
    color: #A0522D;
    border-color: rgba(160, 82, 45, 0.55);
}

.stamp-intercept {
    color: #D4A050;
    border-color: rgba(212, 160, 80, 0.65);
    background: rgba(26, 22, 16, 0.08);
}

.fragment-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 46px;
    letter-spacing: 0.06em;
    line-height: 0.95;
    color: #3B2F20;
    text-transform: uppercase;
}

.fragment-descriptor {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #3B2F20;
}

.fragment-meta {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed rgba(139, 115, 85, 0.5);
    display: flex;
    justify-content: space-between;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: #8B7355;
    text-transform: uppercase;
}

.fragment-seal {
    position: absolute;
    right: 16px;
    bottom: 44px;
    width: 56px;
    height: 56px;
    opacity: 0.55;
}

.fragment-seal svg {
    width: 100%;
    height: 100%;
}

.dossier-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 115, 85, 0.35);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.22em;
    color: #8B7355;
    text-transform: uppercase;
}

/* Inline redacted blocks on any paper panel */
.redacted-inline {
    background: #1A1610;
    color: #1A1610;
    padding: 1px 4px;
    cursor: pointer;
    transition: all 0.35s ease;
    letter-spacing: -0.05em;
    border-radius: 1px;
}

.redacted-inline:hover {
    background: rgba(212, 160, 80, 0.15);
    color: #8B3A2A;
    letter-spacing: normal;
}

/* =================== PANEL 3: SIGNAL FEED =================== */
.panel-signal .panel-inner {
    display: flex;
    flex-direction: column;
}

.signal-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 28px;
    min-height: 0;
}

/* Terminal inset window */
.terminal-inset {
    background: #1A1610;
    border: 1px solid #3B2F20;
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.terminal-inset::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(212, 160, 80, 0.04) 1px,
        rgba(212, 160, 80, 0.04) 2px
    );
    z-index: 2;
}

.terminal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid #3B2F20;
    background: rgba(26, 22, 16, 0.95);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #8B7355;
    letter-spacing: 0.12em;
    position: relative;
    z-index: 3;
}

.term-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3B2F20;
    border: 1px solid #8B7355;
}

.term-dot-amber { background: #D4A050; border-color: #D4A050; }
.term-dot-red   { background: #8B3A2A; border-color: #8B3A2A; }

.term-path {
    color: #D4C8A8;
    margin-left: 10px;
}

.term-mode {
    margin-left: auto;
    color: #D4A050;
    animation: blink-subtle 1.5s ease-in-out infinite;
}

.terminal-body {
    flex: 1;
    padding: 14px 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 3;
}

.signal-feed {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #D4A050;
}

.signal-entry {
    display: grid;
    grid-template-columns: 90px 110px 1fr 100px;
    gap: 10px;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(212, 160, 80, 0.1);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    white-space: nowrap;
    overflow: hidden;
}

.signal-entry.live {
    opacity: 1;
    transform: translateY(0);
}

.signal-entry.aged {
    opacity: 0.4;
}

.sig-time { color: #8B7355; letter-spacing: 0.04em; }
.sig-freq { color: #D4A050; }
.sig-type { color: #D4C8A8; letter-spacing: 0.08em; }
.sig-status { text-align: right; letter-spacing: 0.1em; font-weight: 500; }

.sig-intercept { color: #D4A050; }
.sig-decrypt   { color: #8FAE5A; }
.sig-alert     { color: #8B3A2A; animation: blink-subtle 1.2s ease-in-out infinite; }

.terminal-prompt {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgba(212, 160, 80, 0.15);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #D4A050;
}

.term-user {
    color: #8FAE5A;
    margin-right: 8px;
}

.term-cursor {
    display: inline-block;
    background: #D4A050;
    color: #1A1610;
    width: 8px;
    height: 14px;
    vertical-align: baseline;
    animation: cursor-blink 1s steps(2, start) infinite;
    margin-left: 4px;
}

/* Right side telemetry */
.signal-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
}

.waveform-card {
    background: #1A1610;
    border: 1px solid #3B2F20;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.waveform-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(212, 160, 80, 0.04) 1px,
        rgba(212, 160, 80, 0.04) 2px
    );
}

.wave-head {
    display: flex;
    justify-content: space-between;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8B7355;
}

.wave-live {
    color: #8B3A2A;
    animation: blink-subtle 1.4s ease-in-out infinite;
}

#waveform-canvas {
    width: 100%;
    height: 150px;
    display: block;
    position: relative;
    z-index: 2;
}

.wave-foot {
    display: flex;
    justify-content: space-between;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #D4A050;
    letter-spacing: 0.08em;
    padding-top: 6px;
    border-top: 1px solid rgba(212, 160, 80, 0.15);
}

.signal-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.stat-box {
    background: rgba(232, 220, 200, 0.4);
    border: 1px solid rgba(139, 115, 85, 0.4);
    border-top: 3px solid #A0522D;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.stat-box:hover {
    background: rgba(232, 220, 200, 0.6);
    border-top-color: #D4A050;
}

.stat-value {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 44px;
    letter-spacing: 0.06em;
    color: #3B2F20;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-alert {
    color: #8B3A2A;
    font-size: 28px;
}

.stat-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.22em;
    color: #8B7355;
    text-transform: uppercase;
}

/* =================== PANEL 4: TRANSMISSION END =================== */
.panel-end .panel-inner {
    padding: 0;
    overflow: hidden;
}

.aged-paper-heavy {
    background-color: #DDCFB6;
    background-image:
        radial-gradient(circle at 14% 22%, rgba(139, 58, 42, 0.22) 0%, transparent 14%),
        radial-gradient(circle at 82% 72%, rgba(59, 47, 32, 0.25) 0%, transparent 16%),
        radial-gradient(circle at 48% 52%, rgba(196, 169, 125, 0.25) 0%, transparent 40%),
        repeating-linear-gradient(3deg, transparent 0, transparent 2px, rgba(212, 200, 168, 0.2) 2px, rgba(212, 200, 168, 0.2) 3px);
    box-shadow:
        inset 0 0 80px rgba(59, 47, 32, 0.32),
        inset 0 0 220px rgba(59, 47, 32, 0.2),
        0 18px 48px rgba(0, 0, 0, 0.55);
}

.burn-mark {
    position: absolute;
    width: 240px;
    height: 240px;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.burn-tl {
    top: -40px;
    left: -40px;
    background: radial-gradient(ellipse at center,
        rgba(59, 47, 32, 0.85) 0%,
        rgba(139, 58, 42, 0.55) 25%,
        rgba(160, 82, 45, 0.25) 55%,
        transparent 75%);
}

.burn-br {
    bottom: -40px;
    right: -40px;
    background: radial-gradient(ellipse at center,
        rgba(59, 47, 32, 0.8) 0%,
        rgba(139, 58, 42, 0.45) 30%,
        rgba(160, 82, 45, 0.2) 60%,
        transparent 80%);
}

.fold-crease {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 40px;
    transform: translateX(-50%);
    background:
        linear-gradient(90deg,
            transparent 0%,
            rgba(139, 115, 85, 0.0) 40%,
            rgba(139, 115, 85, 0.35) 50%,
            rgba(139, 115, 85, 0.0) 60%,
            transparent 100%);
    pointer-events: none;
    mix-blend-mode: multiply;
}

.end-content {
    position: relative;
    z-index: 4;
    width: 100%;
    height: 100%;
    padding: 56px 64px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.end-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.22em;
    color: #8B7355;
    text-transform: uppercase;
}

.end-ref {
    color: #A0522D;
}

.end-core {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 48px;
    align-items: center;
    padding: 24px 0;
}

.radar-sweep {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.radar-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 12px rgba(160, 82, 45, 0.25));
}

.sweep-rotate {
    transform-origin: 150px 150px;
    animation: sweep 4s linear infinite;
}

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

.radar-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    letter-spacing: 0.28em;
    color: #A0522D;
    text-transform: uppercase;
}

.end-telemetry {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 28px;
    border-left: 3px solid #A0522D;
    background: rgba(232, 220, 200, 0.45);
    border-top: 1px solid rgba(139, 115, 85, 0.35);
    border-right: 1px solid rgba(139, 115, 85, 0.35);
    border-bottom: 1px solid rgba(139, 115, 85, 0.35);
}

.telem-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 16px;
    align-items: center;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(139, 115, 85, 0.35);
}

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

.telem-key {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: #8B7355;
    text-transform: uppercase;
}

.telem-val {
    color: #3B2F20;
    letter-spacing: 0.06em;
}

.end-sign-off {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 42px;
    letter-spacing: 0.12em;
    color: #8B3A2A;
    line-height: 1;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 1100px) {
    .panel {
        padding: 56px 32px 48px 32px;
    }
    .panel-inner {
        padding: 24px 28px;
    }
    .panel-title {
        font-size: 56px;
    }
    .terrain-container {
        grid-template-columns: 1fr;
    }
    .terrain-sidebar {
        flex-direction: row;
        overflow-x: auto;
    }
    .data-group { min-width: 220px; }
    .sidebar-stamp { min-width: 260px; }
    .signal-grid {
        grid-template-columns: 1fr;
    }
    .dossier-strip {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .end-core {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .radar-svg { max-width: 260px; }
    #status-readout { display: none; }
}

@media (max-width: 720px) {
    .panel { padding: 56px 16px 48px 16px; }
    .panel-inner { padding: 18px 20px; }
    .panel-header { flex-wrap: wrap; gap: 8px; }
    .panel-ref { margin-left: 0; }
    .panel-title { font-size: 44px; }
    .signal-entry { grid-template-columns: 70px 90px 1fr 80px; font-size: 10px; gap: 6px; }
    .boot-content { font-size: 12px; min-height: 320px; }
    .boot-final { font-size: 34px; }
    #scroll-hint { display: none; }
}
