.topbar{
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
  padding: 14px 16px; border:1px solid var(--border);
  background: rgba(18,26,35,.85); border-radius: var(--r); box-shadow: var(--shadow);
  position: sticky; top: 0; backdrop-filter: blur(10px); z-index: 10;
  transition: background 0.3s ease, border-color 0.3s ease;
}
[data-theme="light"] .topbar{
  background: rgba(255,255,255,.9);
  border-color: var(--border);
}
.brand{ display:flex; align-items:center; gap: 14px; min-width: 260px; }
.logo{
  width: 54px; height: 54px; border-radius: 16px;
  background: rgba(11,15,20,.35);
  border: 1px solid rgba(36,48,65,.95);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.logo svg{ width: 40px; height: 40px; display:block; }
.logo .stroke{ stroke: rgba(231,237,245,.92); stroke-width: 2; fill: none; }
.logo .fill{ fill: rgba(231,237,245,.92); }
.logo .mutedFill{ fill: rgba(154,167,181,.95); }
.logo .accentStroke{ stroke: rgba(255,138,0,.85); stroke-width: 2; fill: none; }
.logo .accentFill{ fill: rgba(255,138,0,.65); }
.logo .spectrumLine{ stroke: rgba(168,85,247,.75); stroke-width: 1.5; fill: none; }

/* Light mode logo colors */
[data-theme="light"] .logo .stroke{ stroke: rgba(26,32,44,.85); }
[data-theme="light"] .logo .fill{ fill: rgba(26,32,44,.85); }
[data-theme="light"] .logo .mutedFill{ fill: rgba(100,116,139,.8); }
.brand h1{ margin:0; font-size: 36px; letter-spacing:.4px; line-height: 1.05; font-weight: 900; }
@media (max-width: 520px){ .brand h1{ font-size: 32px; } }
.brand .sub{ font-size: 18px; color: var(--muted); margin-top: 4px; font-weight: 600; }

.status{ display:flex; align-items:center; gap: 10px; flex-wrap: wrap; justify-content:flex-end; }
.pill{
  display:flex; align-items:center; gap: 8px; padding: 8px 12px;
  border:1px solid var(--border); border-radius: 999px;
  background: rgba(11,15,20,.6); font-size: 18px; color: var(--muted); white-space: nowrap;
}
[data-theme="light"] .pill{
  background: rgba(248,250,252,.9);
}

.dot{ width: 12px; height:12px; border-radius:999px; background: var(--muted); }
.dot.low{ background: var(--bad); } .dot.med{ background: var(--warn); } .dot.high{ background: var(--good); }

.toggle{
  display:flex; align-items:center; gap: 8px; padding: 6px;
  border: 1px solid var(--border); border-radius: 999px; background: rgba(11,15,20,.55);
}
.toggle button{
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 12px; border-radius: 999px; cursor:pointer;
  font-size: 18px; font-weight: 600; letter-spacing:.2px;
}
.toggle button.active{
  background: rgba(231,237,245,.10); color: var(--text);
  border:1px solid rgba(231,237,245,.12);
}

.banner{
  margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r);
  border: 1px solid rgba(239,68,68,.35); background: rgba(239,68,68,.08);
  color: rgba(231,237,245,.92); font-size: 18px; line-height:1.35;
}
.banner strong{ color: var(--bad); letter-spacing: .2px; }

.grid{ display:grid; grid-template-columns: 1fr; gap: 14px; }

/* Two-column layout with right sidebar */
.contentGrid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
  margin-top: 14px;
  align-items: start;
  width: 100%;
  max-width: none;
}

.mainContent {
  min-width: 0;
  margin-top: 0;
  grid-column: 1;
}

.rightPanel {
  position: sticky;
  top: 160px;
  overflow-x: hidden;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  height: fit-content;
  grid-column: 2;
}

@media (max-width: 980px){
  .brand{ min-width: unset; }
  .contentGrid {
    grid-template-columns: 1fr 360px;
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .contentGrid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .rightPanel {
    position: relative;
    top: auto;
    max-width: none;
    grid-column: 1;
  }
}

@media (max-width: 520px) {
  .contentGrid {
    gap: 10px;
  }
}

.card{
  background: rgba(18,26,35,.82); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow); overflow:hidden;
  transition: background 0.3s ease, border-color 0.3s ease;
}
[data-theme="light"] .card{
  background: var(--card);
  border-color: var(--border);
}
.card .hd{
  padding: 14px 16px; border-bottom: 1px solid rgba(36,48,65,.7);
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
}
[data-theme="light"] .card .hd{
  border-bottom-color: var(--border);
}
.card .hd h2{ margin:0; font-size: 18px; letter-spacing:.3px; }
.card .hd .hint{ font-size: 18px; color: var(--muted); }
.card .bd{ padding: 14px 16px; }

.inputGrid{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px){ .inputGrid{ grid-template-columns: 1fr; } }

/* ============================================
   HUD / TACTICAL OVERLAY — Layout
   ============================================ */

/* Topbar: cyan border tint + ambient glow */
.topbar {
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: var(--shadow), 0 0 40px rgba(0, 212, 255, 0.04), inset 0 -1px 0 rgba(0, 212, 255, 0.08);
}
[data-theme="light"] .topbar {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

/* Logo: cyan border + pulsing ring */
.logo {
  border-color: rgba(0, 212, 255, 0.22);
  animation: ring-pulse 4s ease-in-out infinite;
}
[data-theme="light"] .logo {
  animation: none;
  border-color: var(--border);
}

/* Brand title: white-to-cyan gradient text */
.brand h1 {
  background: linear-gradient(115deg, var(--text) 50%, rgba(0, 212, 255, .8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .brand h1 {
  background: none;
  -webkit-text-fill-color: currentColor;
  background-clip: unset;
}

/* Subtitle: monospace tactical style */
.brand .sub {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  font-family: var(--mono);
}

/* Confidence pill: cyan border tint */
.pill {
  border-color: rgba(0, 212, 255, 0.14);
}
[data-theme="light"] .pill {
  border-color: var(--border);
}

/* Active tab: cyan highlight */
.toggle button.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  border-color: rgba(0, 212, 255, 0.28);
}
[data-theme="light"] .toggle button.active {
  background: rgba(231,237,245,.10);
  color: var(--text);
  border-color: rgba(231,237,245,.12);
}

.field{ padding: 16px; border: 1px solid rgba(36,48,65,.9); border-radius: 14px; background: rgba(11,15,20,.45); }
[data-theme="light"] .field{
  background: rgba(248,250,252,.8);
  border-color: var(--border);
}

.labelRow{ display:flex; align-items:center; justify-content:space-between; gap: 8px; margin-bottom: 10px; }
.label{ font-size: 18px; font-weight: 800; color: rgba(231,237,245,.95); letter-spacing:.4px; text-transform: uppercase; white-space: normal; word-wrap: break-word; }
[data-theme="light"] .label{
  color: rgba(15,23,42,.92);
}
.valueTag{ font-family: var(--mono); font-size: 18px; font-weight:700; color: rgba(231,237,245,.92); background: rgba(231,237,245,.10); border:1px solid rgba(231,237,245,.16); padding: 8px 14px; border-radius: 999px; }
[data-theme="light"] .valueTag{
  color: rgba(26,32,44,.88);
  background: rgba(100,116,139,.12);
  border-color: rgba(100,116,139,.25);
}
