:root {
  --bg-primary: #090d16;
  --bg-card: #131b2e;
  --bg-card-hover: #1c2742;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #38bdf8;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top, 16px) 16px env(safe-area-inset-bottom, 24px) 16px;
  max-width: 540px;
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 16px 0;
  border-bottom: 1px solid var(--border);
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
}

h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tier-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Voice Orb Section */
.voice-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 24px 0 20px 0;
  text-align: center;
}

.mic-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
  margin-bottom: 12px;
}

.mic-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-indigo));
  border: none;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  outline: none;
  z-index: 2;
  position: relative;
}

.mic-btn svg {
  width: 36px;
  height: 36px;
  fill: white;
}

.mic-btn:active {
  transform: scale(0.92);
}

.mic-btn.listening {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-red));
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.6);
  animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.voice-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.voice-transcript {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent-cyan);
  min-height: 24px;
}

/* Controls Bar (Speaker toggle & Push) */
.quick-toggles {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.toggle-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-chip.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border-color: rgba(16, 185, 129, 0.3);
}

/* Gauges Grid */
.section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.gauges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.gauge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.gauge-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.gauge-value {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 6px 0;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}

.progress-bar.warn {
  background: var(--accent-amber);
}

.progress-bar.danger {
  background: var(--accent-red);
}

/* Tier Switcher */
.tier-switcher {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.tier-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.tier-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tier-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Containers List */
.container-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.container-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.container-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.status-dot.down {
  background: var(--accent-red);
  box-shadow: 0 0 8px var(--accent-red);
}

.c-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.c-mem {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.action-btn-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
}

.action-btn-sm:hover, .action-btn-sm:active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
}

/* Chat Feed */
.chat-feed {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 24px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-bubble {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 88%;
}

.chat-bubble.user {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.2);
  color: #c7d2fe;
}

.chat-bubble.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-left: 2px solid var(--accent-cyan);
}

/* Login Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 13, 22, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 100;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
}

.modal-input {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  margin: 16px 0;
  text-align: center;
}

.modal-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-cyan);
  border: none;
  border-radius: 8px;
  color: #090d16;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
