:root {
  --bg: #070a10;
  --panel: rgba(18, 26, 36, 0.55);
  --panel-border: rgba(120, 200, 255, 0.12);
  --text: #d8e6f2;
  --text-dim: #7d93a8;
  --emerald: #38f2a3;
  --amber: #ffb648;
  --crimson: #ff4d6a;
  --accent: #6ee7ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden;
}

#hud-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  grid-template-rows: 64px 1fr;
  height: 100vh;
  gap: 16px;
  padding: 16px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.brand small { color: var(--text-dim); letter-spacing: 0.05em; text-transform: none; margin-left: 8px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(56, 242, 163, 0.08);
  border: 1px solid rgba(56, 242, 163, 0.35);
  color: var(--emerald);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.main-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.event-log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  font-size: 12px;
}

.event-row {
  display: grid;
  grid-template-columns: 14px 70px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}
.event-row .dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.event-row .src { color: var(--text-dim); font-size: 10px; text-transform: uppercase; }
.event-row .msg { color: var(--text); word-break: break-word; }
.sev-info .dot { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.sev-warn .dot { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.sev-critical .dot { background: var(--crimson); box-shadow: 0 0 6px var(--crimson); }

.event-row { cursor: pointer; }
.event-row:hover, .event-row.selected { background: rgba(255,255,255,0.06); }

.ai-drawer {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 3;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(18, 26, 36, 0.9);
  border: 1px solid rgba(120, 200, 255, 0.25);
  border-radius: 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.ai-drawer[hidden] { display: none; }
.ai-avatar {
  flex: none; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(110,231,255,0.12);
  border: 1px solid rgba(110,231,255,0.3); font-size: 15px;
}
.ai-content { flex: 1; min-width: 0; }
.ai-content .ai-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.ai-content .ai-label #ai-model-tag { color: var(--text-dim); font-weight: 400; text-transform: none; letter-spacing: 0; }
.ai-content .ai-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.ai-close {
  flex: none; background: transparent; border: 1px solid var(--panel-border);
  color: var(--text-dim); width: 26px; height: 26px; padding: 0;
  border-radius: 6px; font-size: 13px; line-height: 1;
}
.ai-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.heatmap-controls { display: flex; gap: 8px; margin-bottom: 10px; }
input[type=text] {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
}
button {
  background: rgba(110, 231, 255, 0.1);
  border: 1px solid rgba(110, 231, 255, 0.4);
  color: var(--accent);
  padding: 8px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
button:hover { background: rgba(110, 231, 255, 0.18); }

.heatmap-list { flex: 1; overflow-y: auto; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.heat-row { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 6px; }
.heat-stable { background: rgba(56,242,163,0.06); color: var(--emerald); }
.heat-stale { background: rgba(255,182,72,0.08); color: var(--amber); }
.heat-vulnerable { background: rgba(255,77,106,0.1); color: var(--crimson); }
.heat-row .score { opacity: 0.7; }

/* --- Fluid Shield payment widget --- */
.fluid-shield {
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(160deg, rgba(56,242,163,0.06), rgba(18,26,36,0.5));
  border: 1px solid rgba(56, 242, 163, 0.25);
  position: relative;
}
.shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--emerald);
  margin-bottom: 10px;
}
.shield-badge .ring {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--emerald);
  position: relative;
}
.shield-badge .ring::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--emerald);
  opacity: 0;
}
.shield-badge.pulse .ring::after {
  animation: shield-wave 0.6s ease-out;
}
@keyframes shield-wave {
  from { opacity: 0.8; transform: scale(0.6); }
  to { opacity: 0; transform: scale(1.8); }
}
.card-field {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
}
.card-field input {
  width: 100%; border: none; background: transparent; color: var(--text);
  font: inherit; font-size: 13px; outline: none;
}
.shield-note { font-size: 10px; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }
