:root {
    --bg: #070d19;
    --bg-panel: #0d172a;
    --bg-panel-2: #111f38;
    --border: rgba(148, 163, 184, 0.16);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #38bdf8;
    --ir: #f43f5e;
    --emerald: #10b981;
    --amber: #f59e0b;
    --violet: #a78bfa;
    --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at 12% 0%, rgba(56, 189, 248, 0.12), transparent 42%),
                radial-gradient(circle at 88% 10%, rgba(244, 63, 94, 0.10), transparent 36%),
                var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.accent { color: var(--accent); }

.container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Top Bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(7, 13, 25, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.25);
}

.brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.proto-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(244, 63, 94, 0.16);
    border: 1px solid rgba(244, 63, 94, 0.45);
    color: #fda4af;
}

.brand-sub {
    font-size: 0.76rem;
    color: var(--muted);
}

.topbar-telemetry {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-pill, .room-pill, .peer-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    padding: 6px 11px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border);
}

.status-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

.status-pill.connected .dot {
    background: var(--emerald);
    box-shadow: 0 0 8px var(--emerald);
}

.peer-pill.has-phones {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(30, 41, 59, 0.85);
    color: var(--text);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { border-color: rgba(56, 189, 248, 0.5); background: rgba(30, 41, 59, 1); }
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 6px 11px; font-size: 0.79rem; }

.btn-primary {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    border-color: rgba(56, 189, 248, 0.5);
    color: #fff;
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.65);
    color: var(--text);
}

.btn-sound.active {
    border-color: rgba(16, 185, 129, 0.45);
    color: #6ee7b7;
}

/* ---------- Pair Banner (Phone Mode) ---------- */
.pair-banner {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.18), rgba(56, 189, 248, 0.16));
    border-bottom: 1px solid rgba(56, 189, 248, 0.35);
    padding: 10px 0;
}

.pair-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.86rem;
}

.pair-live-status {
    display: inline-block;
    margin-left: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #6ee7b7;
}

/* ---------- Main Layout ---------- */
.main-wrap { padding: 24px 20px 44px; }

.kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
}

.hero-bar {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 22px;
    align-items: center;
    margin-bottom: 24px;
}

.hero-bar h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    line-height: 1.15;
    margin: 6px 0 10px;
}

.hero-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 64ch;
}

.hero-quick-macros {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.macro-btn-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.btn-macro {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.28);
    color: #bae6fd;
}

.btn-macro-off {
    background: rgba(244, 63, 94, 0.14);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fda4af;
}

/* ---------- Stage Split ---------- */
.stage-grid {
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

/* Phone-Only Paired Mode */
body.phone-mode .desktop-only { display: none !important; }
body.phone-mode .stage-grid {
    grid-template-columns: minmax(0, 410px);
    justify-content: center;
}
body.phone-mode .main-wrap { padding-top: 16px; }
body.phone-mode .pocket-pc { width: 100%; max-width: 400px; }

/* ---------- 2000-Era Pocket PC Handheld Shell ---------- */
.handheld-col {
    display: flex;
    justify-content: center;
}

.pocket-pc {
    width: 344px;
    background: linear-gradient(160deg, #dde4ee 0%, #b8c4d4 45%, #8b99ad 100%);
    border-radius: 34px 34px 44px 44px;
    padding: 12px 16px 22px;
    box-shadow:
        inset 0 2px 3px rgba(255, 255, 255, 0.85),
        inset 0 -4px 10px rgba(15, 23, 42, 0.45),
        0 24px 60px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.25);
    color: #0f172a;
    position: relative;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Top IrDA Blaster Window */
.irda-bar {
    position: relative;
    display: flex;
    justify-content: center;
    margin-top: -16px;
    margin-bottom: 8px;
}

.irda-window {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #1b060d, #3b0b18);
    border: 1.5px solid #475569;
    border-radius: 999px;
    padding: 3px 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.irda-led {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #581224;
    transition: background 0.08s ease, box-shadow 0.08s ease;
}

.irda-window.firing .irda-led {
    background: #ff2a5f;
    box-shadow: 0 0 14px #ff2a5f, 0 0 26px #f43f5e;
}

.irda-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: #fda4af;
    letter-spacing: 0.08em;
}

.ir-waves {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
}

.ir-waves.firing {
    animation: irPulseBurst 0.42s ease-out;
}

.ir-waves span {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid #f43f5e;
    border-bottom: none;
    border-left-color: transparent;
    border-right-color: transparent;
    border-radius: 50%;
}

.ir-waves span:nth-child(1) { width: 28px; height: 14px; top: 6px; }
.ir-waves span:nth-child(2) { width: 48px; height: 22px; top: -2px; border-top-color: #fb7185; }
.ir-waves span:nth-child(3) { width: 70px; height: 30px; top: -10px; border-top-color: #38bdf8; }

@keyframes irPulseBurst {
    0% { opacity: 1; transform: translateX(-50%) scale(0.7); }
    100% { opacity: 0; transform: translateX(-50%) scale(1.35); }
}

.ppc-header-bezel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 8px;
}

.ppc-speaker {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: #475569;
}

.ppc-model {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #1e293b;
}

.ppc-pwr-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Pocket PC LCD Screen */
.ppc-lcd {
    background: #0c1628;
    border: 4px solid #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 3px 12px rgba(0, 0, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.65);
    color: #e2e8f0;
}

.wince-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, #0b4fa8 0%, #1d75d8 100%);
    color: #fff;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 700;
}

.wince-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.66rem;
    opacity: 0.92;
}

.lcd-telemetry {
    background: #06101e;
    border-bottom: 1px solid rgba(56, 189, 248, 0.22);
    padding: 6px 9px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.71rem;
    color: #38bdf8;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.device-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #0f1c33;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.dev-tab {
    background: transparent;
    border: none;
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    color: #94a3b8;
    padding: 8px 2px;
    font-size: 0.69rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.dev-tab:last-child { border-right: none; }
.dev-tab.active {
    background: rgba(56, 189, 248, 0.2);
    color: #ffffff;
    box-shadow: inset 0 -2px 0 #38bdf8;
}

.lcd-power-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 10px 10px 8px;
}

.ir-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 6px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    background: linear-gradient(180deg, #1d2d4a 0%, #121f36 100%);
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
    transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease;
}

.ir-btn span {
    font-size: 0.64rem;
    letter-spacing: 0.06em;
    color: #cbd5e1;
}

.ir-btn:hover { border-color: rgba(56, 189, 248, 0.65); }
.ir-btn:active, .ir-btn.pressed {
    transform: translateY(1px) scale(0.96);
    background: linear-gradient(180deg, #0ea5e9, #0284c7);
    color: #fff;
}

.ir-btn-power {
    background: linear-gradient(180deg, #be123c 0%, #881337 100%);
    border-color: rgba(251, 113, 133, 0.5);
    color: #fff;
}

.ir-btn-power span { color: #ffe4e6; }

.ir-btn-accent {
    background: linear-gradient(180deg, #0369a1 0%, #0c4a6e 100%);
    border-color: rgba(56, 189, 248, 0.45);
}

.lcd-pad {
    display: grid;
    grid-template-columns: 62px 1fr 62px;
    gap: 8px;
    padding: 4px 10px 10px;
    align-items: stretch;
}

.rocker-col {
    display: flex;
    flex-direction: column;
    background: #091222;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.rocker-label {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #38bdf8;
    padding: 4px 0 2px;
}

.ir-rocker-top, .ir-rocker-bot {
    flex: 1;
    border-radius: 0;
    border: none;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: none;
    font-size: 0.95rem;
    padding: 12px 0;
}

.center-pad {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
}

.center-pad .ir-btn {
    padding: 12px 6px;
    font-size: 0.76rem;
}

.lcd-macro-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    padding: 0 10px 10px;
}

.ir-mini {
    padding: 7px 3px;
    border-radius: 7px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.1);
    color: #bae6fd;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
}

.ir-mini:active { transform: scale(0.95); }

.ir-mini-off {
    border-color: rgba(244, 63, 94, 0.4);
    background: rgba(244, 63, 94, 0.15);
    color: #fda4af;
}

/* Physical Chrome D-Pad & Hardware Buttons */
.ppc-hardware {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 8px 2px;
}

.hw-side-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hw-btn {
    width: 46px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #64748b;
    background: linear-gradient(180deg, #f8fafc 0%, #94a3b8 100%);
    color: #0f172a;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.35), inset 0 1px 1px #fff;
}

.hw-btn:active { transform: translateY(1px) scale(0.96); }

.dpad {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f1f5f9, #94a3b8 65%, #64748b 100%);
    border: 2px solid #475569;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.45), inset 0 2px 3px #fff;
}

.dpad-dir {
    position: absolute;
    background: transparent;
    border: none;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    width: 34px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dpad-dir:active { color: #0284c7; transform: scale(0.9); }
.dpad-up { top: 2px; left: 50%; transform: translateX(-50%); }
.dpad-down { bottom: 2px; left: 50%; transform: translateX(-50%); }
.dpad-left { left: 2px; top: 50%; transform: translateY(-50%); }
.dpad-right { right: 2px; top: 50%; transform: translateY(-50%); }

.dpad-ok {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1.5px solid #334155;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #38bdf8;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.dpad-ok:active { transform: translate(-50%, -50%) scale(0.94); }

/* ---------- Panels & Living Room ---------- */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h2 {
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
}

.room-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.living-room {
    position: relative;
    overflow: hidden;
    background: #09111f;
    transition: box-shadow 0.4s ease;
}

.ambient-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    background: radial-gradient(circle at 50% 25%, rgba(251, 191, 36, 0.34), transparent 65%);
    transition: background 0.45s ease, opacity 0.45s ease;
}

.room-top-bar {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    font-size: 0.82rem;
}

.room-lights-readout {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.lamp-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 12px #fbbf24;
    transition: background 0.3s, box-shadow 0.3s;
}

.room-status-banner {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    color: #bae6fd;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
}

/* Smart TV */
.tv-frame {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tv-bezel {
    position: relative;
    width: 100%;
    background: #050810;
    border: 8px solid #1e293b;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#tvCanvas {
    width: 100%;
    height: auto;
    aspect-ratio: 760 / 320;
    display: block;
}

.tv-osd {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(7, 13, 25, 0.86);
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: #e0f2fe;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.tv-standby-led {
    position: absolute;
    bottom: 6px;
    right: 14px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.tv-standby-led.off {
    background: #f43f5e;
    box-shadow: 0 0 8px #f43f5e;
}

.tv-stand {
    width: 160px;
    height: 10px;
    background: linear-gradient(180deg, #334155, #1e293b);
    border-radius: 0 0 8px 8px;
    margin-bottom: 12px;
}

/* AV Receiver Deck */
.receiver-deck {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    background: linear-gradient(180deg, #172033 0%, #0b111e 100%);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    padding: 12px 16px;
}

.rcv-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rcv-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: #cbd5e1;
}

.rcv-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
}

.rcv-led.off {
    background: #f43f5e;
    box-shadow: 0 0 6px #f43f5e;
}

.rcv-vfd {
    background: #040914;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 8px;
    padding: 7px 12px;
    font-family: 'JetBrains Mono', monospace;
}

.vfd-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.74rem;
    color: #38bdf8;
    font-weight: 700;
}

.vfd-track {
    font-size: 0.72rem;
    color: #6ee7b7;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.receiver-deck.standby .rcv-vfd {
    opacity: 0.35;
}

.rcv-eq {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 30px;
}

.rcv-eq span {
    width: 4px;
    height: 6px;
    border-radius: 2px;
    background: linear-gradient(180deg, #38bdf8, #10b981);
    transition: height 0.12s ease;
}

/* ---------- Oscilloscope + QR Lower Row ---------- */
.lower-tools-grid {
    display: grid;
    grid-template-columns: 1.35fr 0.85fr;
    gap: 20px;
}

.hex-pill, .code-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(244, 63, 94, 0.14);
    border: 1px solid rgba(244, 63, 94, 0.38);
    color: #fda4af;
}

.code-badge {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

.scope-canvas-wrap {
    background: #040914;
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 10px;
    overflow: hidden;
    height: 112px;
    margin-bottom: 10px;
}

#scopeCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.ir-log {
    max-height: 112px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ir-log-empty {
    font-size: 0.78rem;
    color: var(--muted);
    padding: 8px 4px;
}

.ir-log-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 9px;
}

.ir-log-item .src-tag {
    color: #6ee7b7;
}

/* QR Pair Panel */
.qr-box {
    display: flex;
    justify-content: center;
    padding: 10px;
    background: #ffffff;
    border-radius: 12px;
    width: fit-content;
    margin: 0 auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.qr-box img {
    display: block;
    width: 148px;
    height: 148px;
}

.pair-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Heritage & API Grid ---------- */
.arch-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    margin-top: 22px;
}

.heritage-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.code-box {
    margin: 0;
    padding: 14px;
    border-radius: 12px;
    background: #040914;
    border: 1px solid rgba(56, 189, 248, 0.22);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #bae6fd;
    overflow-x: auto;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 18px 0 28px;
    color: var(--muted);
    font-size: 0.82rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
    .hero-bar,
    .stage-grid,
    .lower-tools-grid,
    .arch-grid {
        grid-template-columns: 1fr;
    }

    .pocket-pc {
        width: 100%;
        max-width: 370px;
    }
}

@media (max-width: 640px) {
    .receiver-deck {
        grid-template-columns: 1fr;
    }

    .rcv-eq {
        justify-content: center;
    }
}
