:root {
  --bg-color: #030308;
  --panel-bg: rgba(10, 10, 22, 0.72);
  --border-glow: rgba(0, 255, 204, 0.15);
  --neon-cyan: #00ffcc;
  --neon-purple: #bd00ff;
  --neon-green: #39ff14;
  --neon-orange: #ff5e00;
  --neon-red: #ff0055;
  --text-primary: #f0f0ff;
  --text-secondary: #8c8cbe;
  --glow-shadow-cyan: 0 0 10px rgba(0, 255, 204, 0.4), 0 0 20px rgba(0, 255, 204, 0.2);
  --glow-shadow-purple: 0 0 10px rgba(189, 0, 255, 0.4), 0 0 20px rgba(189, 0, 255, 0.2);
  --glow-shadow-green: 0 0 10px rgba(57, 255, 20, 0.4), 0 0 20px rgba(57, 255, 20, 0.2);
  --font-cyber: 'Share Tech Mono', monospace;
  --font-main: 'Outfit', sans-serif;
  --safe-top: env(safe-area-inset-top, 15px);
  --safe-bottom: env(safe-area-inset-bottom, 15px);
  --safe-left: env(safe-area-inset-left, 20px);
  --safe-right: env(safe-area-inset-right, 20px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* Disable iOS callout menu on long press */
  -webkit-text-size-adjust: none; /* Disable iOS auto text resize */
}

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  overflow: hidden;
  position: fixed; /* Prevent bouncy scrolling on iOS */
  touch-action: none; /* Prevent iOS gesture zooms */
}

/* Spectacular Background Canvas */
#cyber-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Scanlines overlay for retro-cyber feel */
body::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.25) 50%
  );
  background-size: 100% 4px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.35;
}

/* Scanning Sweep Laser Line */
#screen-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  box-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan);
  opacity: 0;
  pointer-events: none;
  z-index: 10000;
}

.scan-active {
  animation: scanSweep 1.5s ease-in-out;
}

@keyframes scanSweep {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { top: 100%; opacity: 0; }
}

/* App Container */
#app-container {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
}

/* Fonts styling */
.font-mono {
  font-family: var(--font-cyber);
  letter-spacing: 1.5px;
}

/* Portrait orientation overlay locking */
#portrait-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #040409;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-primary);
}

@media (orientation: portrait) {
  #portrait-overlay {
    display: flex;
  }
}

.rotate-content {
  padding: 20px;
}

.rotate-icon {
  margin-bottom: 20px;
  animation: rotateGlow 3s infinite linear;
}

@keyframes rotateGlow {
  0% { transform: rotate(0deg); filter: drop-shadow(0 0 2px var(--neon-cyan)); }
  50% { filter: drop-shadow(0 0 15px var(--neon-cyan)); }
  100% { transform: rotate(360deg); filter: drop-shadow(0 0 2px var(--neon-cyan)); }
}

.rotate-content h2 {
  font-family: var(--font-cyber);
  color: var(--neon-cyan);
  margin-bottom: 10px;
  text-shadow: var(--glow-shadow-cyan);
}

.rotate-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Glassmorphism panel base style */
.glass {
  background: var(--panel-bg);
  backdrop-filter: blur(25px) saturate(145%);
  -webkit-backdrop-filter: blur(25px) saturate(145%);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.5);
  position: relative;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0.3;
}

/* System status top bar */
.sys-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 40px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.sys-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green);
}

.status-dot.green {
  background-color: var(--neon-green);
  box-shadow: var(--glow-shadow-green);
}

/* Screen Lock Status Indicator */
#lock-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 15px;
  background: rgba(0, 255, 204, 0.06);
  border: 1px solid rgba(0, 255, 204, 0.25);
  border-radius: 20px;
  color: var(--neon-cyan);
  text-shadow: var(--glow-shadow-cyan);
  cursor: pointer;
  transition: all 0.3s;
}

#lock-status-badge:hover {
  background: rgba(0, 255, 204, 0.12);
  border-color: var(--neon-cyan);
  box-shadow: var(--glow-shadow-cyan);
}

.lock-icon {
  animation: pulse-ring 2.5s infinite;
}

.lock-label {
  font-size: 0.75rem;
  font-weight: bold;
}

.animate-pulse {
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.sys-battery {
  display: flex;
  align-items: center;
  gap: 8px;
}

.battery-icon {
  width: 26px;
  height: 14px;
  border: 1px solid var(--text-secondary);
  border-radius: 3px;
  padding: 1px;
  position: relative;
}

.battery-icon::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 4px;
  width: 2px;
  height: 4px;
  background-color: var(--text-secondary);
  border-radius: 0 1px 1px 0;
}

#battery-fill {
  height: 100%;
  width: 100%;
  background-color: var(--neon-green);
  transition: width 0.3s;
}

/* Dashboard Core Grid (Upgraded to 3 columns, filled space) */
#dashboard {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100% - 40px);
  z-index: 5;
  transition: filter 0.5s ease, opacity 0.5s ease;
}

/* Grid layout for standby cards (Clock, Diagnostics, Weather) */
.grid-container {
  flex: 1;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 20px;
  height: calc(100% - 10px);
  align-items: stretch;
}

.module {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 25px;
  position: relative;
  overflow: hidden;
}

/* Card Decor corners for high-tech terminal design */
.module-decor {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--neon-cyan);
  border-style: solid;
  opacity: 0.6;
  z-index: 5;
}

.module-decor.top-left { top: -1px; left: -1px; border-width: 2.5px 0 0 2.5px; }
.module-decor.top-right { top: -1px; right: -1px; border-width: 2.5px 2.5px 0 0; }
.module-decor.bottom-left { bottom: -1px; left: -1px; border-width: 0 0 2.5px 2.5px; }
.module-decor.bottom-right { bottom: -1px; right: -1px; border-width: 0 2.5px 2.5px 0; }

/* Left Column: Clock styling */
.clock-module {
  border-color: rgba(0, 255, 204, 0.25);
  box-shadow: 0 10px 40px 0 rgba(0, 255, 204, 0.05);
}

/* Rotating HUD Bezel Overlay behind clock (Increased size) */
.hud-bezel-wrapper {
  position: absolute;
  width: 320px;
  height: 320px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-bezel-svg {
  width: 100%;
  height: 100%;
}

.hud-circle-outer {
  transform-origin: 50% 50%;
  animation: spinBezelClockwise 60s infinite linear;
}

.hud-circle-inner {
  transform-origin: 50% 50%;
  animation: spinBezelCounterClockwise 40s infinite linear;
}

.hud-circle-ticks {
  transform-origin: 50% 50%;
  animation: spinBezelClockwise 120s infinite linear;
}

@keyframes spinBezelClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes spinBezelCounterClockwise {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(-360deg); }
}

.clock-content {
  text-align: center;
  z-index: 2;
}

.timezone-tag {
  color: var(--neon-cyan);
  font-size: 0.85rem;
  margin-bottom: 15px;
  text-shadow: var(--glow-shadow-cyan);
  border: 1px solid rgba(0, 255, 204, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  background: rgba(0, 255, 204, 0.04);
}

#clock-display {
  font-size: 7.2vw; /* Responsive size - slightly smaller */
  font-weight: 800;
  line-height: 0.9;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1), 0 0 45px rgba(0, 255, 204, 0.22);
  margin-bottom: 15px;
}

#date-display {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Middle Column: Telemetry Gauge Diagnostics & Log Console */
.telemetry-module {
  border-color: rgba(189, 0, 255, 0.25);
  box-shadow: 0 10px 40px 0 rgba(189, 0, 255, 0.05);
  justify-content: space-between;
  align-items: stretch;
  padding: 20px;
}

.telemetry-module .module-decor {
  border-color: var(--neon-purple);
}

.telemetry-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.hud-title {
  font-size: 1.25rem;
  color: var(--neon-purple);
  font-weight: 600;
  text-shadow: var(--glow-shadow-purple);
}

.gauges-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 15px 0;
}

.gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.gauge-svg-wrapper {
  position: relative;
  width: 78px; /* Increased Gauge Size */
  height: 78px;
  margin-bottom: 8px;
}

.gauge-circular {
  width: 100%;
  height: 100%;
}

.gauge-bg {
  stroke: rgba(255, 255, 255, 0.04);
}

.gauge-fill {
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dasharray 0.5s ease;
}

.gauge-fill.cyan { filter: drop-shadow(0 0 5px var(--neon-cyan)); }
.gauge-fill.purple { filter: drop-shadow(0 0 5px var(--neon-purple)); }
.gauge-fill.green { filter: drop-shadow(0 0 5px var(--neon-green)); }
.gauge-fill.orange { filter: drop-shadow(0 0 5px var(--neon-orange)); }

.gauge-percentage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-primary);
}

.gauge-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* System Logs Stream Widget (Fills empty vertical space) */
.sys-log-stream {
  flex: 1;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(189, 0, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 5px;
  margin-bottom: 12px;
  height: 90px;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--neon-cyan);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9);
  text-align: left;
}

.log-line {
  opacity: 0.85;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  animation: logLineFadeIn 0.3s ease forwards;
}

@keyframes logLineFadeIn {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 0.85; transform: translateX(0); }
}

.telemetry-footer {
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Right Column: Weather styling */
.weather-module {
  border-color: rgba(57, 255, 20, 0.2);
  cursor: pointer;
}

.weather-module .module-decor {
  border-color: var(--neon-green);
}

.weather-module:hover {
  background: rgba(20, 30, 20, 0.8);
  border-color: var(--neon-green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.15);
}

.weather-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weather-meta {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.meta-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  display: block;
}

#location-country {
  font-size: 1.35rem;
  color: var(--neon-green);
  font-weight: 600;
  text-shadow: var(--glow-shadow-green);
}

.weather-primary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.glowing-svg svg {
  filter: drop-shadow(0 0 8px var(--neon-green));
}

.weather-info {
  display: flex;
  flex-direction: column;
}

#weather-temp {
  font-size: 5.8vw; /* Responsive size - slightly smaller */
  font-weight: bold;
  color: var(--text-primary);
  line-height: 0.9;
}

#weather-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-transform: uppercase;
}

.weather-tap-hint {
  font-size: 0.7rem;
  color: var(--neon-green);
  opacity: 0.6;
  text-align: center;
  border-top: 1px dashed rgba(57, 255, 20, 0.2);
  padding-top: 10px;
}

/* Hourly Weather Overlay Card */
#weather-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 250px;
  border-top: 2px solid var(--neon-cyan);
  border-bottom: none;
  border-left: none;
  border-right: none;
  border-radius: 20px 20px 0 0;
  z-index: 200;
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#weather-overlay:not(.hidden) {
  transform: translateY(0);
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.overlay-header h3 {
  font-weight: normal;
  font-size: 1.1rem;
}

.neon-cyan-text {
  color: var(--neon-cyan);
  text-shadow: var(--glow-shadow-cyan);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.btn-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.forecast-grid {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
  -webkit-overflow-scrolling: touch;
}

/* Custom scrollbar for cyber grid */
.forecast-grid::-webkit-scrollbar {
  height: 4px;
}

.forecast-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.forecast-grid::-webkit-scrollbar-thumb {
  background: var(--neon-cyan);
  border-radius: 2px;
}

.forecast-item {
  flex: 0 0 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 255, 204, 0.1);
  border-radius: 8px;
  transition: all 0.3s;
}

.forecast-item:hover {
  border-color: var(--neon-cyan);
  background: rgba(0, 255, 204, 0.05);
}

.forecast-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.forecast-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.forecast-icon svg {
  width: 100%;
  height: 100%;
}

.forecast-temp {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* Chatbot Drawer Widget styling */
#chatbot-wrapper {
  position: absolute;
  bottom: calc(10px + var(--safe-bottom));
  right: calc(15px + var(--safe-right));
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#chatbot-wrapper.minimized #chatbot-panel {
  transform: scale(0.8) translateY(100px);
  opacity: 0;
  pointer-events: none;
  height: 0;
  width: 0;
  overflow: hidden;
}

#chatbot-wrapper.minimized #chatbot-trigger {
  display: flex;
}

#chatbot-wrapper:not(.minimized) #chatbot-trigger {
  display: none;
}

/* Floating button trigger */
#chatbot-trigger {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(10, 10, 25, 0.8);
  border: 1px solid var(--neon-purple);
  border-radius: 30px;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--glow-shadow-purple);
  transition: all 0.3s;
}

#chatbot-trigger:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(189, 0, 255, 0.6);
}

/* Faacore dynamic eye animation */
.faacore-eye {
  width: 18px;
  height: 18px;
  background: #000;
  border: 2px solid var(--neon-purple);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-shadow-purple);
}

.faacore-pupil {
  width: 6px;
  height: 6px;
  background-color: var(--neon-cyan);
  border-radius: 50%;
  box-shadow: var(--glow-shadow-cyan);
  animation: wander 4s infinite ease-in-out;
}

.faacore-eye.mini {
  width: 14px;
  height: 14px;
  border-width: 1.5px;
}

.faacore-eye.mini .faacore-pupil {
  width: 4px;
  height: 4px;
}

@keyframes wander {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 1px); }
  50% { transform: translate(2px, -2px); }
  75% { transform: translate(-1px, 2px); }
}

.trigger-label {
  font-size: 0.8rem;
  font-weight: bold;
}

#unread-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--neon-red);
  color: white;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px var(--neon-red);
}

/* Expanded Chatbot Terminal Panel */
#chatbot-panel {
  width: 380px;
  height: 380px;
  display: flex;
  flex-direction: column;
  border-color: rgba(189, 0, 255, 0.25);
  box-shadow: 0 8px 32px 0 rgba(189, 0, 255, 0.08);
}

#chatbot-panel::before {
  background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
}

.chatbot-header {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(189, 0, 255, 0.15);
  background: rgba(189, 0, 255, 0.03);
}

.faacore-avatar {
  margin-right: 10px;
}

.chatbot-title {
  flex: 1;
}

.chatbot-title h4 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.chatbot-title .sub-status {
  font-size: 0.65rem;
  color: var(--neon-purple);
  text-shadow: var(--glow-shadow-purple);
  display: block;
}

.chatbot-controls {
  display: flex;
  gap: 8px;
}

.chatbot-controls button {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
}

.chatbot-controls button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Chat messages box */
#chat-messages {
  flex: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0, 0, 0, 0.25);
  -webkit-overflow-scrolling: touch;
}

#chat-messages::-webkit-scrollbar {
  width: 4px;
}

#chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

#chat-messages::-webkit-scrollbar-thumb {
  background: var(--neon-purple);
  border-radius: 2px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: msgFadeIn 0.3s ease forwards;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
}

.chat-message.bot .msg-bubble {
  background: rgba(189, 0, 255, 0.05);
  border: 1px solid rgba(189, 0, 255, 0.15);
  color: var(--text-primary);
  border-bottom-left-radius: 1px;
}

.chat-message.user .msg-bubble {
  background: rgba(0, 255, 204, 0.05);
  border: 1px solid rgba(0, 255, 204, 0.2);
  color: var(--neon-cyan);
  text-shadow: 0 0 5px rgba(0, 255, 204, 0.1);
  border-bottom-right-radius: 1px;
}

.msg-timestamp {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 3px;
  align-self: flex-end;
}

.chat-message.bot .msg-timestamp {
  align-self: flex-start;
}

/* Typing Indicator Animation */
#chat-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  align-self: flex-start;
  background: rgba(189, 0, 255, 0.03);
  border: 1px solid rgba(189, 0, 255, 0.1);
  border-radius: 8px;
  margin-left: 15px;
  margin-bottom: 10px;
}

#chat-typing-indicator .dot {
  width: 4px;
  height: 4px;
  background-color: var(--neon-purple);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

#chat-typing-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
#chat-typing-indicator .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Chat form input area */
#chat-form {
  display: flex;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
  gap: 8px;
}

#chat-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(189, 0, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.3s;
  -webkit-user-select: text;
  user-select: text;
}

#chat-input:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 8px rgba(0, 255, 204, 0.15);
}

#btn-chat-send {
  background: transparent;
  border: 1px solid rgba(189, 0, 255, 0.2);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--neon-purple);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btn-chat-send:hover {
  background: rgba(189, 0, 255, 0.1);
  border-color: var(--neon-purple);
  color: var(--text-primary);
}

/* Utility Animations */
.animate-pulse {
  animation: pulse-ring 2.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.5; }
}

/* Touch device active highlights removal */
input, button, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

/* Status coloring and visibility utility rules */
.green-status {
  color: var(--neon-green) !important;
  text-shadow: var(--glow-shadow-green) !important;
}

.hidden {
  display: none !important;
}

.geo-readout {
  color: var(--neon-cyan);
  font-size: 0.78rem;
  margin-top: 10px;
  opacity: 0.8;
  text-shadow: var(--glow-shadow-cyan);
}

.gb-system-tag {
  color: var(--neon-orange);
  font-size: 0.72rem;
  margin-top: 8px;
  border: 1px solid rgba(255, 94, 0, 0.25);
  padding: 3px 10px;
  border-radius: 4px;
  display: inline-block;
  background: rgba(255, 94, 0, 0.05);
  text-shadow: 0 0 5px rgba(255, 94, 0, 0.3);
}
