:root {
    --cyan: #00ffe7;
    --cyan-dim: #00bfad;
    --cyan-dark: #007a6e;
    --cyan-glow: rgba(0,255,231,0.15);
    --cyan-glow2: rgba(0,255,231,0.05);
    --blue: #0af;
    --blue-glow: rgba(0,170,255,0.2);
    --bg: #010d13;
    --bg2: #020f1a;
    --bg3: #041522;
    --panel: rgba(0,30,45,0.85);
    --panel2: rgba(0,15,25,0.9);
    --red: #ff2244;
    --amber: #ffb700;
    --green: #00ff88;
    --text-main: #b0fff5;
    --text-dim: #4a8a80;
    --text-bright: #e0fffc;
    --corrupted: #ff3366;
    --border: rgba(0,255,231,0.25);
    --border-bright: rgba(0,255,231,0.6);
    --scan-speed: 3s;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--text-main);
    font-family: 'Share Tech Mono', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    cursor: crosshair;
  }
  body::before {
    content: '';
    position: fixed; inset: 0;
    background:
      radial-gradient(ellipse 60% 40% at 50% 50%, rgba(0,60,100,0.35) 0%, transparent 70%),
      radial-gradient(ellipse 80% 60% at 50% 50%, rgba(0,255,231,0.04) 0%, transparent 80%);
    pointer-events: none; z-index: 0;
  }
  body::after {
    content: '';
    position: fixed; inset: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.08) 2px,
      rgba(0,0,0,0.08) 4px
    );
    pointer-events: none; z-index: 100;
  }

  .stars {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    overflow: hidden;
  }
  .star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--d, 3s) ease-in-out infinite var(--delay, 0s);
  }
  @keyframes twinkle {
    0%, 100% { opacity: var(--min-op, 0.1); }
    50% { opacity: var(--max-op, 0.8); }
  }

  .hud-root {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    padding: 10px;
    min-height: 100vh;
  }

  /* TOP BAR */
  .top-bar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-bright);
    padding-bottom: 6px;
    position: relative;
  }
  .top-bar::after {
    content: '';
    position: absolute; bottom: -4px; left: 0; right: 0;
    height: 1px; background: var(--border);
  }

  .top-alert {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--red);
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: alert-pulse 1.4s ease-in-out infinite;
    position: relative;
  }
  .top-alert::before {
    content: '⬡ ';
    color: var(--red);
  }
  @keyframes alert-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 10px var(--red), 0 0 30px rgba(255,34,68,0.4); }
    50% { opacity: 0.7; text-shadow: none; }
  }

  .top-center {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 900;
    color: var(--cyan);
    letter-spacing: 5px;
    text-align: center;
    text-shadow: 0 0 20px var(--cyan), 0 0 40px rgba(0,255,231,0.3);
    position: relative;
  }
  .top-center span {
    font-size: 10px;
    display: block;
    font-weight: 400;
    letter-spacing: 8px;
    color: var(--text-dim);
    margin-top: 2px;
  }

  .top-right-cluster {
    display: flex; gap: 16px; align-items: center;
  }
  .mini-meter {
    display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  }
  .mini-meter-label { font-size: 9px; letter-spacing: 2px; color: var(--text-dim); }
  .mini-meter-bar {
    width: 80px; height: 4px;
    background: rgba(0,255,231,0.1);
    border: 1px solid var(--border);
    position: relative; overflow: hidden;
  }
  .mini-meter-bar::after {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    animation: meter-anim var(--speed, 2s) ease-in-out infinite alternate;
    width: var(--w, 70%);
  }
  @keyframes meter-anim {
    from { width: var(--w, 70%); }
    to { width: var(--w2, 85%); }
  }

  .top-coords {
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-align: right;
  }
  .top-coords strong { color: var(--cyan-dim); }

  /* PANELS */
  .panel {
    background: var(--panel);
    border: 1px solid var(--border);
    position: relative;
    backdrop-filter: blur(4px);
    overflow: hidden;
  }
  .panel::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(0,255,231,0.03) 0%, transparent 60%);
    pointer-events: none;
  }
  .panel-corner {
    position: absolute;
    width: 14px; height: 14px;
  }
  .panel-corner::before, .panel-corner::after {
    content: '';
    position: absolute;
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
  }
  .panel-corner.tl { top: 0; left: 0; }
  .panel-corner.tl::before { top: 0; left: 0; width: 14px; height: 2px; }
  .panel-corner.tl::after { top: 0; left: 0; width: 2px; height: 14px; }
  .panel-corner.tr { top: 0; right: 0; }
  .panel-corner.tr::before { top: 0; right: 0; width: 14px; height: 2px; }
  .panel-corner.tr::after { top: 0; right: 0; width: 2px; height: 14px; }
  .panel-corner.bl { bottom: 0; left: 0; }
  .panel-corner.bl::before { bottom: 0; left: 0; width: 14px; height: 2px; }
  .panel-corner.bl::after { bottom: 0; left: 0; width: 2px; height: 14px; }
  .panel-corner.br { bottom: 0; right: 0; }
  .panel-corner.br::before { bottom: 0; right: 0; width: 14px; height: 2px; }
  .panel-corner.br::after { bottom: 0; right: 0; width: 2px; height: 14px; }

  .panel-header {
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-dim);
    padding: 8px 12px 4px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    text-transform: uppercase;
  }
  .panel-header .badge {
    font-size: 8px;
    padding: 2px 6px;
    border: 1px solid;
    letter-spacing: 2px;
  }
  .badge-active { border-color: var(--green); color: var(--green); animation: badge-blink 2s step-end infinite; }
  @keyframes badge-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
  .badge-warn { border-color: var(--red); color: var(--red); }
  .badge-info { border-color: var(--cyan-dim); color: var(--cyan-dim); }

  .panel-body { padding: 10px 12px; }

  /* LEFT COLUMN */
  .left-col {
    display: flex; flex-direction: column; gap: 8px;
  }

  /* RADAR */
  .radar-panel { flex: 0 0 auto; }
  .radar-container {
    display: flex; justify-content: center;
    padding: 10px 0;
    position: relative;
  }
  .radar-svg { overflow: visible; }
  .radar-sweep {
    transform-origin: 110px 110px;
    animation: sweep 4s linear infinite;
  }
  @keyframes sweep { to { transform: rotate(360deg); } }

  /* INTERESTS PANEL */
  .interest-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0,255,231,0.07);
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    font-weight: 400;
  }
  .interest-item:last-child { border-bottom: none; }
  .interest-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    flex-shrink: 0; margin-top: 4px;
    animation: dot-pulse 2s ease-in-out infinite;
  }
  @keyframes dot-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

  .interests-header-text {
    font-family: 'Orbitron', monospace;
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
  }

  .warning-box {
    background: rgba(255,34,68,0.06);
    border: 1px solid rgba(255,34,68,0.3);
    padding: 10px;
    margin-top: 6px;
    position: relative;
  }
  .warning-box::before {
    content: '! WARNING !';
    position: absolute; top: -8px; left: 10px;
    font-family: 'Orbitron', monospace;
    font-size: 8px; letter-spacing: 3px;
    color: var(--red);
    background: var(--bg);
    padding: 0 4px;
  }
  .warning-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    line-height: 1.6;
    color: #ff8899;
    font-weight: 300;
  }
  .corrupted-text {
    font-family: 'VT323', monospace;
    font-size: 15px;
    color: var(--corrupted);
    letter-spacing: 1px;
    text-shadow: 0 0 8px var(--corrupted);
    animation: glitch 2.5s step-end infinite;
    display: inline;
  }
  @keyframes glitch {
    0%, 90%, 100% { transform: none; opacity: 1; }
    91% { transform: skewX(5deg) translateX(2px); opacity: 0.8; color: #ff0; }
    92% { transform: skewX(-5deg) translateX(-2px); opacity: 0.9; }
    93% { transform: none; color: #0ff; }
    94% { transform: skewX(2deg); color: var(--corrupted); }
    95% { transform: none; opacity: 1; }
  }

  /* CENTER COLUMN */
  .center-col {
    display: flex; flex-direction: column; gap: 8px;
    position: relative;
  }

  /* CENTER VISUAL */
  .center-visual {
    flex: 1;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    min-height: 300px;
  }
  .burst {
    position: absolute;
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
  }
  .burst-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid;
    animation: burst-expand var(--dur, 3s) ease-out infinite var(--delay2, 0s);
  }
  @keyframes burst-expand {
    0% { transform: scale(0.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 0; }
  }
  .burst-core {
    position: relative; z-index: 2;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
  }
  .core-inner {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 20px white, 0 0 50px var(--cyan), 0 0 100px rgba(0,255,231,0.5), 0 0 200px rgba(0,200,255,0.2);
    animation: core-pulse 2s ease-in-out infinite;
  }
  @keyframes core-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px white, 0 0 50px var(--cyan), 0 0 100px rgba(0,255,231,0.5); }
    50% { transform: scale(1.3); box-shadow: 0 0 30px white, 0 0 80px var(--cyan), 0 0 150px rgba(0,200,255,0.6), 0 0 250px rgba(0,150,255,0.3); }
  }
  .ray {
    position: absolute;
    width: 2px;
    background: linear-gradient(to top, transparent, rgba(0,255,231,0.3), transparent);
    transform-origin: center center;
    animation: ray-fade 3s ease-in-out infinite;
  }
  @keyframes ray-fade { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

  /* DATA CALLOUT BOXES BOTTOM CENTER */
  .bottom-center-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  /* AUDIO PANEL */
  .audio-panel {
    background: rgba(0,10,20,0.9);
    border: 1px solid rgba(255,183,0,0.3);
    position: relative;
  }
  .audio-panel::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(255,183,0,0.04) 0%, transparent 60%);
    pointer-events: none;
  }
  .audio-panel .panel-corner.tl::before,
  .audio-panel .panel-corner.tl::after,
  .audio-panel .panel-corner.tr::before,
  .audio-panel .panel-corner.tr::after,
  .audio-panel .panel-corner.bl::before,
  .audio-panel .panel-corner.bl::after,
  .audio-panel .panel-corner.br::before,
  .audio-panel .panel-corner.br::after {
    background: var(--amber);
    box-shadow: 0 0 6px var(--amber);
  }
  .audio-panel .panel-header { border-color: rgba(255,183,0,0.2); color: var(--amber); }
  .waveform-canvas { width: 100%; display: block; }
  .audio-label {
    font-family: 'Rajdhani', sans-serif;
    font-size: 11px;
    font-weight: 300;
    font-style: italic;
    color: rgba(255,183,0,0.7);
    line-height: 1.6;
    margin-top: 6px;
  }
  .audio-freq-row {
    display: flex; gap: 3px; align-items: flex-end;
    height: 30px; margin-top: 8px;
  }
  .freq-bar {
    flex: 1;
    background: var(--amber);
    opacity: 0.6;
    box-shadow: 0 0 4px var(--amber);
    animation: freq-anim var(--fd, 0.8s) ease-in-out infinite alternate;
    min-height: 3px;
  }
  @keyframes freq-anim {
    from { height: var(--fh1, 40%); opacity: 0.4; }
    to { height: var(--fh2, 80%); opacity: 0.8; }
  }

  /* RECOMMENDED PANEL */
  .recommend-panel {
    background: rgba(0,5,15,0.95);
    border: 1px solid rgba(0,255,136,0.3);
    position: relative;
  }
  .recommend-panel .panel-corner.tl::before,
  .recommend-panel .panel-corner.tl::after,
  .recommend-panel .panel-corner.tr::before,
  .recommend-panel .panel-corner.tr::after,
  .recommend-panel .panel-corner.bl::before,
  .recommend-panel .panel-corner.bl::after,
  .recommend-panel .panel-corner.br::before,
  .recommend-panel .panel-corner.br::after {
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
  }
  .recommend-panel .panel-header { border-color: rgba(0,255,136,0.2); color: var(--green); }
  .recommend-text {
    font-family: 'Exo 2', sans-serif;
    font-size: 11px;
    font-weight: 100;
    color: rgba(0,255,136,0.85);
    line-height: 1.7;
    font-style: italic;
  }
  .recommend-text strong {
    font-weight: 400;
    color: var(--green);
  }
  .recommend-or {
    font-family: 'Orbitron', monospace;
    font-size: 9px;
    letter-spacing: 3px;
    color: rgba(0,255,136,0.4);
    display: block;
    text-align: center;
    margin: 5px 0;
  }

  /* RIGHT COLUMN */
  .right-col {
    display: flex; flex-direction: column; gap: 8px;
  }

  /* DATA SOURCES PANEL */
  .sources-section-label {
    font-family: 'Orbitron', monospace;
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 6px;
    margin-top: 8px;
    display: flex; align-items: center; gap: 6px;
  }
  .sources-section-label::after {
    content: '';
    flex: 1; height: 1px;
    background: var(--border);
  }
  .sources-section-label:first-child { margin-top: 0; }

  .social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 4px;
  }
  .social-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    background: rgba(0,255,231,0.04);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
  }
  .social-btn:hover {
    background: rgba(0,255,231,0.1);
    border-color: var(--cyan-dim);
  }
  .social-btn:hover .social-icon { filter: drop-shadow(0 0 6px var(--cyan)); }
  .social-btn::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,255,231,0.08), transparent);
    transition: left 0.3s;
  }
  .social-btn:hover::before { left: 100%; }
  .social-icon { width: 22px; height: 22px; display: block; }
  .social-label {
    font-size: 8px;
    letter-spacing: 1px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-family: 'Share Tech Mono', monospace;
  }
  .social-btn:hover .social-label { color: var(--cyan-dim); }

  .pro-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .social-btn.pro {
    background: rgba(0,170,255,0.08);
    border-color: rgba(0,170,255,0.35);
    padding: 10px 6px;
  }
  .social-btn.pro:hover {
    background: rgba(0,170,255,0.18);
    border-color: var(--blue);
    box-shadow: 0 0 12px rgba(0,170,255,0.2);
  }
  .social-btn.pro::after {
    content: 'PRO';
    position: absolute; top: 3px; right: 4px;
    font-size: 6px; letter-spacing: 1px;
    color: var(--blue);
    font-family: 'Orbitron', monospace;
  }
  .social-btn.pro .social-label { color: rgba(0,170,255,0.6); }
  .social-btn.pro:hover .social-label { color: var(--blue); }

  /* VERTEX / STATS */
  .stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,255,231,0.07);
    font-size: 10px;
  }
  .stat-row:last-child { border-bottom: none; }
  .stat-label { color: var(--text-dim); font-size: 9px; letter-spacing: 1px; }
  .stat-val { color: var(--cyan); font-size: 10px; }
  .stat-bar-wrap { flex: 1; margin: 0 8px; }
  .stat-bar {
    height: 3px;
    background: rgba(0,255,231,0.1);
    position: relative;
  }
  .stat-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
    width: var(--w, 50%);
  }

  .arc-display {
    display: flex; justify-content: center; gap: 12px; padding: 8px 0;
  }

  /* ELEMENT DATA */
  .element-panel {
    background: rgba(0,8,20,0.9);
    border: 1px solid rgba(100,100,255,0.25);
  }
  .element-panel .panel-corner.tl::before, .element-panel .panel-corner.tl::after,
  .element-panel .panel-corner.tr::before, .element-panel .panel-corner.tr::after,
  .element-panel .panel-corner.bl::before, .element-panel .panel-corner.bl::after,
  .element-panel .panel-corner.br::before, .element-panel .panel-corner.br::after {
    background: #8888ff;
    box-shadow: 0 0 6px #8888ff;
  }
  .element-panel .panel-header { border-color: rgba(100,100,255,0.2); color: #8888ff; }
  .element-dots {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    padding: 6px 0;
  }
  .edot {
    width: 100%; aspect-ratio: 1;
    border: 1px solid rgba(100,100,255,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 8px;
    color: rgba(100,100,255,0.6);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
  }
  .edot.active {
    background: rgba(100,100,255,0.2);
    border-color: rgba(100,100,255,0.8);
    color: #aaaaff;
  }
  .edot:hover { background: rgba(100,100,255,0.15); }

  /* BOTTOM BAR */
  .bottom-bar {
    grid-column: 1 / -1;
    display: flex; align-items: center; justify-content: space-between;
    border-top: 1px solid var(--border);
    padding-top: 6px;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
  }
  .bottom-ticker {
    overflow: hidden; flex: 1; margin: 0 20px;
    border: 1px solid var(--border);
    padding: 3px 8px;
    position: relative;
  }
  .ticker-inner {
    display: flex; gap: 80px;
    animation: ticker 20s linear infinite;
    white-space: nowrap;
  }
  @keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  .ticker-item { color: var(--cyan-dim); }
  .ticker-item.red { color: var(--red); }
  .ticker-item.amber { color: var(--amber); }

  /* SCAN LINE */
  /* SCAN LINE (Scoped to Entity Core) */
  .scan-line {
    position: absolute; /* Changed from fixed */
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0,255,231,0.15), rgba(0,255,231,0.4), rgba(0,255,231,0.15), transparent);
    pointer-events: none;
    z-index: 10; /* Ensures it sits above background elements but below UI badges */
    animation: scan-down 4s linear infinite; /* Sped up slightly to fit a smaller box */
  }
  @keyframes scan-down {
    from { top: 0; opacity: 0.5; }
    to { top: 100%; opacity: 0.2; } /* Changed from 100vh to fit parent container container */
  }

  /* MISC UTILITY */
  .mono { font-family: 'Share Tech Mono', monospace; }
  .orb { font-family: 'Orbitron', monospace; }
  .spinner-ring {
    width: var(--sz, 50px); height: var(--sz, 50px);
    border-radius: 50%;
    border: 1px solid rgba(0,255,231,0.15);
    border-top-color: var(--cyan);
    animation: spin var(--spd, 3s) linear infinite;
    position: absolute;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .center-visual .spinner-ring { position: absolute; }

  .hbar {
    height: 1px; background: var(--border);
    margin: 6px 0;
  }

  /* Blinking cursor */
  .cursor::after {
    content: '▮';
    animation: blink 1s step-end infinite;
    font-size: 0.8em;
  }
  @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

  /* Hex readout */
  .hex-readout {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    color: rgba(0,255,231,0.3);
    letter-spacing: 1px;
    overflow: hidden;
    height: 14px;
    position: relative;
  }
  .hex-scroll {
    animation: hexscroll 8s linear infinite;
    white-space: nowrap;
  }
  @keyframes hexscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

  /* Segment count donut */
  .donut-wrap {
    display: flex; align-items: center; gap: 8px; padding: 6px 0;
  }
  .donut-label-col { flex: 1; display: flex; flex-direction: column; gap: 4px; }
  .donut-seg-label {
    font-size: 9px; color: var(--text-dim);
    display: flex; justify-content: space-between;
  }
  .donut-seg-label span { color: var(--cyan-dim); }

  .number-readout {
    font-family: 'Orbitron', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: 0 0 15px var(--cyan);
    animation: flicker 8s step-end infinite;
  }
  @keyframes flicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.3; }
    97% { opacity: 1; }
    98% { opacity: 0.5; }
    99% { opacity: 1; }
  }
  /*change_was_made*/
  
  /* =========================================
   DESKTOP / LAPTOP QoL TWEAKS (Concern #1)
   ========================================= */
@media (min-width: 1025px) {
  /* Increase baseline thickness */
  body { font-weight: 500; }
  
  /* Bump up specific font sizes for readability */
  .panel-header { font-size: 11px; font-weight: 900; }
  .interest-item { font-size: 13px; font-weight: 500; }
  .warning-text { font-size: 14px; font-weight: 400; }
  .stat-label, .donut-seg-label { font-size: 11px; }
  .stat-val { font-size: 12px; }
  .recommend-text { font-size: 13px; font-weight: 300; }
  .audio-label { font-size: 13px; font-weight: 400; }
  .top-center { font-size: 20px; }
  .hex-readout { font-size: 11px; height: 16px; }

  /* Slightly reduce the center visual height to give text more breathing room */
  .center-visual { min-height: 250px; }
}

/* =========================================
   MOBILE GRID REORDERING & FIXES (Updated)
   ========================================= */
@media (max-width: 1024px) {
  .radar-svg { width: 100%; height: auto; max-width: 220px; }
  .panel { min-width: 0; } 

  .hud-root {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto;
  }

  .left-col, .center-col, .right-col, .bottom-center-panels {
    display: contents;
  }

  .top-bar { order: 0; grid-column: 1 / -1; flex-wrap: wrap; gap: 10px; }
  .top-right-cluster { width: 100%; justify-content: space-between; }

  /* Issue #4: Reformat the Bottom Bar for Mobile */
  /* This stacks the system info and uptime on top, and gives the ticker a full-width row below them */
  .bottom-bar { 
    order: 100; 
    grid-column: 1 / -1; 
    display: grid !important; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px; 
    padding-bottom: 15px; /* Extra breathing room at the very bottom */
  }
  .bottom-bar > div:last-child { text-align: right; }
  .bottom-ticker { 
    grid-column: 1 / -1; /* Spans across both columns */
    margin: 0 !important; /* Removes the desktop side margins to maximize width */
  }

  /* PANEL REORDERING */
  .radar-panel { order: 1; }
  .data-sources-panel { order: 2; }
  .center-visual { order: 3; grid-column: 1 / -1; min-height: 220px; }
  .interests-panel { order: 4; }
  .vertex-panel { order: 5; }
  .audio-panel { order: 6; }
  .recommend-panel { order: 7; }
  .warning-panel { order: 8; }
  .element-panel { order: 9; }
}

/* =========================================
   VERY SMALL SCREEN FIXES (Issue #1, #2, #3)
   ========================================= */
@media (max-width: 450px) {
  .top-center span { font-size: 8px; letter-spacing: 4px; }
  .social-label { display: none; } 

  /* Issues #1 & #3: Prevent Badges from Cropping */
  .panel-header {
    flex-wrap: wrap; /* Allows text to wrap to a new line if it hits the badge */
    gap: 4px;
    line-height: 1.4;
  }
  .badge {
    flex-shrink: 0; /* Strictly forces the badge to maintain its full shape */
  }

  /* Issue #2: Prevent awkward "ENTITY ORIGIN \n UNKNOWN" wrapping */
  /* This forces the Entity Origin and Range text onto their own separate lines */
  .radar-panel .panel-body > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px;
  }

  /* Issue #3 (Audio Panel Stats): Prevent the 3 bottom elements from cropping */
  .audio-panel .panel-body > div:last-child {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
}