:root {
  --bg: #050a12;
  --panel: rgba(11, 21, 36, 0.78);
  --border: rgba(56, 189, 248, 0.28);
  --cyan: #38bdf8;
  --cyan-glow: rgba(56, 189, 248, 0.45);
  --amber: #f59e0b;
  --red: #ef4444;
  --text: #e2e8f0;
  --muted: #64748b;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, monospace;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

.hidden { display: none !important; }

/* LOCK SCREEN */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.hud-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 40px rgba(2, 132, 199, 0.18);
  text-align: center;
}

.arc-ring {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow), inset 0 0 14px var(--cyan-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseRing 3s infinite ease-in-out;
}

.arc-core {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #e0f2fe 10%, var(--cyan) 70%);
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.06); opacity: 1; }
}

.sys-tag { font-size: 11px; letter-spacing: 1.8px; color: var(--cyan); margin-bottom: 6px; }
h1 { font-size: 22px; letter-spacing: 2px; margin-bottom: 4px; }
.subtext { font-size: 12px; color: var(--muted); margin-bottom: 22px; }

.input-group { text-align: left; margin-bottom: 14px; }
.input-group label { display: block; font-size: 10px; letter-spacing: 1.5px; color: var(--cyan); margin-bottom: 6px; }
.input-group input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(5, 10, 18, 0.85);
  color: #fff;
  font-size: 16px;
  outline: none;
}
.input-group input:focus { border-color: var(--cyan); box-shadow: 0 0 12px rgba(56, 189, 248, 0.25); }
#pin-input { text-align: center; letter-spacing: 8px; font-size: 20px; }

.primary-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  color: #04101d;
  font-weight: 700;
  letter-spacing: 1.5px;
  cursor: pointer;
}
.error-msg { color: var(--red); font-size: 12px; margin-top: 12px; min-height: 16px; }

/* CONSOLE UI */
.console-container {
  width: 100%;
  max-width: 880px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 12px; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.pulse-dot.offline { background: var(--red); box-shadow: 0 0 10px var(--red); }
.title { font-weight: 700; letter-spacing: 2px; color: var(--cyan); }
.meta { font-size: 11px; color: var(--muted); }

.header-actions { display: flex; gap: 8px; }
.icon-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
}
.icon-btn.danger:hover { border-color: var(--red); color: var(--red); }

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { display: flex; flex-direction: column; max-width: 82%; }
.msg.user { align-self: flex-end; }
.msg.jarvis, .msg.system { align-self: flex-start; }

.bubble {
  padding: 12px 15px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 14px;
  white-space: pre-wrap;
}
.msg.user .bubble { background: rgba(2, 132, 199, 0.25); border: 1px solid rgba(56, 189, 248, 0.45); }
.msg.jarvis .bubble, .msg.system .bubble { background: rgba(15, 23, 42, 0.92); border: 1px solid rgba(148, 163, 184, 0.2); }
.badge { font-size: 10px; color: var(--amber); margin-top: 4px; letter-spacing: 1px; }

.hud-footer { display: flex; flex-direction: column; gap: 8px; }
.quick-chips { display: flex; gap: 8px; overflow-x: auto; }
.chip {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  color: var(--cyan);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.composer { display: flex; gap: 8px; }
.composer input {
  flex: 1;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: #fff;
  font-size: 15px;
  outline: none;
}
.mic-btn, .send-btn {
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--cyan);
  font-weight: 700;
  cursor: pointer;
}
.send-btn { background: var(--cyan); color: #04101d; }
.mic-btn.listening { border-color: var(--red); color: var(--red); animation: pulseRing 1s infinite; }
