/* ============================================================
   BOB'S SLEEP TRACKER — Master Stylesheet
   Brand: Black bg, deep blue + red 3D text, neon blue accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Core Brand Colors */
  --bg:           #000000;
  --bg2:          #050810;
  --bg3:          #080d1a;
  --panel:        #0a0f1e;
  --panel2:       #0d1526;
  --panel3:       #111c35;
  --line:         #1a2a4a;
  --line2:        #243558;

  /* Neon Blue Palette */
  --blue:         #00aaff;
  --blue-bright:  #33ccff;
  --blue-dim:     #0066bb;
  --blue-glow:    rgba(0, 170, 255, 0.35);
  --blue-glow2:   rgba(0, 170, 255, 0.12);
  --blue-neon:    #00d4ff;

  /* Red Accent (BOB'S logo red) */
  --red:          #cc2200;
  --red-bright:   #ff3311;
  --red-glow:     rgba(204, 34, 0, 0.4);

  /* Text */
  --text:         #e8f4ff;
  --text2:        #a8c8e8;
  --muted:        #4a6a8a;
  --muted2:       #6a8aaa;

  /* Status Colors */
  --good:         #00ff88;
  --good-dim:     rgba(0,255,136,0.15);
  --warn:         #ffaa00;
  --warn-dim:     rgba(255,170,0,0.15);
  --bad:          #ff4455;
  --bad-dim:      rgba(255,68,85,0.15);
  --unknown:      #aa88ff;
  --unknown-dim:  rgba(170,136,255,0.15);

  /* Sizing */
  --radius:       16px;
  --radius-sm:    10px;
  --radius-lg:    24px;
  --transition:   0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Rajdhani', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================================
   ANIMATED BACKGROUND
   ============================================================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(0,80,180,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 20% 50%, rgba(0,50,120,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 30% 40% at 80% 80%, rgba(0,30,80,0.10) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* ============================================================
   HEADER / BRAND
   ============================================================ */
.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(0,10,30,0.95) 0%, rgba(5,15,40,0.95) 100%);
  border: 1px solid var(--line2);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: 0 0 40px rgba(0,100,200,0.15), 0 8px 32px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
}

.brand-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--blue-neon), var(--red-bright), var(--blue-neon), transparent);
  animation: headerGlow 4s linear infinite;
}

@keyframes headerGlow {
  0%   { opacity: 0.4; }
  50%  { opacity: 1; }
  100% { opacity: 0.4; }
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-wrap {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--blue);
  box-shadow: 0 0 16px var(--blue-glow), 0 0 32px rgba(0,100,200,0.2);
  flex-shrink: 0;
}

.brand-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #ff4422 0%, #cc1100 40%, #ff6644 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  letter-spacing: 0.06em;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(200,30,0,0.5));
}

.brand-sub {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.9;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--blue);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 2px;
}

.brand-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================================
   ONLINE TOGGLE
   ============================================================ */
.mode-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,20,50,0.7);
  border: 1px solid var(--line2);
  border-radius: 999px;
  padding: 8px 16px;
}

.mode-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  transition: color var(--transition);
}

.mode-label.active { color: var(--blue-bright); }

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--panel3);
  border: 1px solid var(--line2);
  transition: background var(--transition), box-shadow var(--transition);
}

.toggle-switch input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--blue-dim), var(--blue));
  box-shadow: 0 0 12px var(--blue-glow);
  border-color: var(--blue);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform var(--transition), background var(--transition);
  pointer-events: none;
}

.toggle-switch input:checked ~ .toggle-thumb {
  transform: translateX(24px);
  background: #fff;
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background var(--transition), box-shadow var(--transition);
}

.online-dot.active {
  background: var(--good);
  box-shadow: 0 0 8px rgba(0,255,136,0.6);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px rgba(0,255,136,0.5); }
  50%       { box-shadow: 0 0 14px rgba(0,255,136,0.9); }
}

/* ============================================================
   OFFLINE VIEW (original tracker styled)
   ============================================================ */
#offlineView {
  display: block;
}

#onlineView {
  display: none;
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,170,255,0.3), transparent);
}

.card-glow {
  box-shadow: 0 0 24px var(--blue-glow2), 0 8px 32px rgba(0,0,0,0.4);
  border-color: var(--line2);
}

.panel-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-bright);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-title .icon {
  font-size: 1rem;
  filter: drop-shadow(0 0 6px var(--blue));
}

/* ============================================================
   METRICS GRID
   ============================================================ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric-card {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.metric-card:hover {
  border-color: var(--blue-dim);
  box-shadow: 0 0 20px var(--blue-glow2);
}

.metric-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--blue-dim), var(--blue));
  opacity: 0;
  transition: opacity var(--transition);
}

.metric-card:hover::after { opacity: 1; }

.metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted2);
}

.metric-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--blue-bright);
  margin-top: 6px;
  text-shadow: 0 0 12px var(--blue-glow);
}

.metric-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
button, input, textarea, select { font: inherit; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  background: var(--panel3);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover { filter: brightness(1.18); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #003366, var(--blue-dim));
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 0 12px var(--blue-glow2);
}

.btn-primary:hover { box-shadow: 0 0 20px var(--blue-glow); }

.btn-success {
  background: linear-gradient(135deg, #003322, #005533);
  border-color: var(--good);
  color: var(--good);
}

.btn-danger {
  background: transparent;
  border-color: rgba(255,68,85,0.4);
  color: var(--bad);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted2);
}

.btn-full { width: 100%; }

.btn-lg {
  padding: 14px 24px;
  font-size: 1rem;
  border-radius: var(--radius);
}

/* Hour buttons */
.hours-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 7px;
  margin-top: 12px;
}

.hour-btn {
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  cursor: pointer;
  background: var(--panel3);
  color: var(--text2);
  font-weight: 700;
  font-size: 0.88rem;
  transition: all var(--transition);
  text-align: center;
}

.hour-btn:hover { border-color: var(--blue-dim); color: var(--blue); }

.hour-btn.selected {
  background: linear-gradient(135deg, #002244, #003366);
  border-color: var(--blue);
  color: var(--blue-bright);
  box-shadow: 0 0 10px var(--blue-glow2);
}

.zero-btn.selected {
  background: linear-gradient(135deg, #2b0505, #440808);
  border-color: var(--bad);
  color: var(--bad);
  box-shadow: 0 0 10px rgba(255,68,85,0.25);
}

.unknown-btn.selected {
  background: linear-gradient(135deg, #150b2b, #221440);
  border-color: var(--unknown);
  color: var(--unknown);
  box-shadow: 0 0 10px rgba(170,136,255,0.25);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
textarea, input[type="text"], input[type="password"] {
  width: 100%;
  background: #050810;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
}

textarea:focus, input:focus {
  outline: none;
  border-color: var(--blue-dim);
  box-shadow: 0 0 12px var(--blue-glow2);
}

.entry-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,100,180,0.15);
  border: 1px solid var(--blue-dim);
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--blue-bright);
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 12px;
}

/* ============================================================
   TABLE
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.data-table th {
  padding: 10px 10px;
  background: #060912;
  color: var(--muted2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line2);
  text-align: left;
}

.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text2);
}

.data-table tr:hover td { background: rgba(0,100,200,0.05); }

/* ============================================================
   TAGS / STATUS BADGES
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag.sleep   { background: var(--good-dim);    color: var(--good);    border: 1px solid rgba(0,255,136,0.2); }
.tag.none    { background: var(--bad-dim);     color: var(--bad);     border: 1px solid rgba(255,68,85,0.2); }
.tag.unknown { background: var(--unknown-dim); color: var(--unknown); border: 1px solid rgba(170,136,255,0.2); }
.tag.full    { background: var(--blue-glow2);  color: var(--blue-bright); border: 1px solid rgba(0,170,255,0.2); }

/* ============================================================
   NOTICE / ALERT BOXES
   ============================================================ */
.notice {
  border-left: 3px solid var(--warn);
  background: var(--warn-dim);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff5cc;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 14px;
}

.notice-blue {
  border-left: 3px solid var(--blue);
  background: var(--blue-glow2);
  color: var(--text2);
}

.notice-good {
  border-left: 3px solid var(--good);
  background: var(--good-dim);
  color: #ccffee;
}

/* ============================================================
   FORMULA BOX
   ============================================================ */
.formula-box {
  background: #030508;
  border: 1px solid var(--line2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: 'Rajdhani', ui-monospace, monospace;
  font-size: 0.88rem;
  color: var(--blue-bright);
  line-height: 1.7;
  overflow-x: auto;
}

/* ============================================================
   ONLINE MODE — AGENT SYSTEM
   ============================================================ */

/* Agent Status Bar */
.agent-status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.agent-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: all var(--transition);
}

.agent-pill.active {
  border-color: var(--blue-dim);
  box-shadow: 0 0 10px var(--blue-glow2);
}

.agent-pill.thinking {
  border-color: var(--warn);
  box-shadow: 0 0 10px rgba(255,170,0,0.2);
}

.agent-pill.speaking {
  border-color: var(--good);
  box-shadow: 0 0 10px rgba(0,255,136,0.2);
}

.agent-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}

.agent-pill.active   .agent-dot { background: var(--blue);  box-shadow: 0 0 6px var(--blue); animation: pulse-dot 2s infinite; }
.agent-pill.thinking .agent-dot { background: var(--warn);  box-shadow: 0 0 6px var(--warn); animation: pulse-dot 1s infinite; }
.agent-pill.speaking .agent-dot { background: var(--good);  box-shadow: 0 0 6px var(--good); animation: pulse-dot 0.6s infinite; }

.agent-name {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  line-height: 1.2;
}

.agent-status-text {
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 1px;
}

/* Voice Interface */
.voice-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
}

.voice-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 60px;
  background: #030508;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.voice-bar {
  width: 4px;
  border-radius: 2px;
  background: var(--blue-dim);
  transition: height 0.1s ease;
  animation: none;
}

.voice-visualizer.active .voice-bar {
  animation: voiceWave 0.8s ease-in-out infinite alternate;
}

.voice-bar:nth-child(1)  { animation-delay: 0.0s; }
.voice-bar:nth-child(2)  { animation-delay: 0.07s; }
.voice-bar:nth-child(3)  { animation-delay: 0.14s; }
.voice-bar:nth-child(4)  { animation-delay: 0.21s; }
.voice-bar:nth-child(5)  { animation-delay: 0.28s; }
.voice-bar:nth-child(6)  { animation-delay: 0.35s; }
.voice-bar:nth-child(7)  { animation-delay: 0.42s; }
.voice-bar:nth-child(8)  { animation-delay: 0.35s; }
.voice-bar:nth-child(9)  { animation-delay: 0.28s; }
.voice-bar:nth-child(10) { animation-delay: 0.21s; }
.voice-bar:nth-child(11) { animation-delay: 0.14s; }
.voice-bar:nth-child(12) { animation-delay: 0.07s; }

@keyframes voiceWave {
  from { height: 6px;  background: var(--blue-dim); }
  to   { height: 48px; background: var(--blue-bright); }
}

.voice-transcript-box {
  background: #030508;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  min-height: 80px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text2);
}

.voice-transcript-box .user-line {
  color: var(--blue-bright);
  font-weight: 600;
}

.voice-transcript-box .bob-line {
  color: var(--good);
}

.voice-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mic-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid var(--blue-dim);
  background: linear-gradient(135deg, #001830, #002a50);
  color: var(--blue-bright);
  font-size: 1.4rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mic-btn:hover { box-shadow: 0 0 20px var(--blue-glow); transform: scale(1.05); }
.mic-btn.recording {
  border-color: var(--bad);
  background: linear-gradient(135deg, #1a0000, #330000);
  color: var(--bad);
  box-shadow: 0 0 20px rgba(255,68,85,0.4);
  animation: micPulse 1s infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255,68,85,0.4); }
  50%       { box-shadow: 0 0 28px rgba(255,68,85,0.7); }
}

/* Chat / Q&A Display */
.chat-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}

.chat-bubble {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.chat-bubble.user { flex-direction: row-reverse; }

.bubble-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: var(--panel3);
}

.bubble-content {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-bubble.bob .bubble-content {
  background: linear-gradient(135deg, #001830, #002244);
  border: 1px solid var(--blue-dim);
  color: var(--text);
  border-top-left-radius: 4px;
}

.chat-bubble.user .bubble-content {
  background: linear-gradient(135deg, #001a10, #002a18);
  border: 1px solid rgba(0,255,136,0.2);
  color: var(--text);
  border-top-right-radius: 4px;
}

.bubble-meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0,255,136,0.1);
  border: 1px solid rgba(0,255,136,0.2);
  color: var(--good);
  font-weight: 700;
}

/* Analysis Panel */
.analysis-section {
  background: #030508;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 10px;
}

.analysis-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.analysis-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text2);
}

.insight-item {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.5;
}

.insight-item:last-child { border-bottom: none; }

.insight-icon { font-size: 1rem; flex-shrink: 0; }

/* QR Code Panel */
.qr-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px;
}

.qr-frame {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 0 24px var(--blue-glow);
}

.qr-frame canvas, .qr-frame img {
  display: block;
  width: 180px !important;
  height: 180px !important;
}

.qr-instructions {
  font-size: 0.82rem;
  color: var(--muted2);
  text-align: center;
  line-height: 1.5;
  max-width: 280px;
}

.qr-upload-zone {
  border: 2px dashed var(--line2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--muted2);
  font-size: 0.88rem;
}

.qr-upload-zone:hover {
  border-color: var(--blue-dim);
  background: var(--blue-glow2);
  color: var(--blue);
}

/* Transcript Log */
.transcript-log {
  background: #020407;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  font-family: 'Rajdhani', ui-monospace, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--muted2);
}

.transcript-entry { margin-bottom: 4px; }
.transcript-entry .ts { color: var(--muted); margin-right: 6px; font-size: 0.72rem; }
.transcript-entry .speaker-bob  { color: var(--blue-bright); font-weight: 700; }
.transcript-entry .speaker-user { color: var(--good); font-weight: 700; }
.transcript-entry .speaker-sys  { color: var(--warn); font-weight: 700; }

/* Guardian Status */
.guardian-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guardian-item {
  background: #030508;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.guardian-item-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue-dim);
  margin-bottom: 6px;
}

.guardian-item-value {
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: 90px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--blue-dim), var(--blue));
  color: #fff;
  box-shadow: 0 0 12px var(--blue-glow2);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* API Key Setup */
.api-setup-box {
  background: linear-gradient(135deg, #050810, #080d1a);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.api-setup-box h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: var(--blue-bright);
  margin-bottom: 8px;
}

.api-setup-box p {
  color: var(--muted2);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.api-key-row {
  display: flex;
  gap: 8px;
  max-width: 500px;
  margin: 0 auto;
}

/* Loading Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--line2);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-dim); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .brand-name { font-size: 1.2rem; }
  .brand-sub  { font-size: 0.6rem; }
  .brand-logo-wrap { width: 48px; height: 48px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .guardian-panel { grid-template-columns: 1fr; }
  .agent-status-bar { grid-template-columns: repeat(2, 1fr); }
  .tab-btn { font-size: 0.68rem; padding: 7px 10px; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted  { color: var(--muted2); font-size: 0.85rem; }
.hidden      { display: none !important; }
.w-full      { width: 100%; }
/* Neutralize any auto-injected platform branding badges */
[id*="ninja"], [class*="ninja"], [id*="daytona"], [class*="daytona"],
[id*="made-by"], [class*="made-by"], [id*="powered-by"], [class*="powered-by"],
a[href*="method-media"], a[href*="method-media"], a[href*="ninjatech"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  z-index: -9999 !important;
}
