:root {
  --bg-color: #0d1117;
  --bg-card: rgba(22, 27, 34, 0.75);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --accent-gradient: linear-gradient(135deg, #60a5fa 0%, #a855f7 100%);
  --glow: rgba(59, 130, 246, 0.15);
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-nuc: #c084fc;
  --color-desktop: #60a5fa;
  --color-cyan: #38bdf8;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-y: scroll;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;
}

/* Scroll Offset for Fixed/Sticky Header */
section[id], div[id], #deck, #ops, #fleet, #uptime, #camera-feed-card {
  scroll-margin-top: 84px;
}

.background-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 480px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(168, 85, 247, 0.05) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0d1117;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
  color: var(--text-main);
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.logo:hover {
  color: var(--text-main);
  opacity: 0.9;
}

.logo-text-group {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.logo-deck-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.35);
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.18);
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-accent {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-main);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-primary {
  background: #3b82f6;
  color: #fff;
  border: 1px solid #3b82f6;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  background: rgba(59, 130, 246, 0.14) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.28) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4) !important;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.btn-nav,
.btn-torrent,
.btn-gemini,
.btn-wol {
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 8px 15px;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  height: 38px;
}

.btn-nav:hover,
.btn-torrent:hover,
.btn-gemini:hover,
.btn-wol:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
  color: #ffffff !important;
}

/* Universal Button Active States & Tactile Feedback */
.btn:active,
.btn-primary:active,
.btn-secondary:active,
.btn-nav:active,
.btn-torrent:active,
.btn-gemini:active,
.btn-wol:active,
.btn-control:active,
.btn-action-item:active,
.btn-console-act:active,
.terminal-tab:active,
.quick-chip:active,
.quick-drop-btn:active,
.pill-btn:active,
.pill-magnet:active,
.magnet-submit-btn:active,
.magnet-close:active,
.changelog-close:active,
.meta-link-btn:active,
.agy-send-btn:active,
.version-badge-btn:active {
  transform: translateY(1px) scale(0.98) !important;
  transition: transform 0.05s ease, box-shadow 0.05s ease !important;
}

/* Accessible Focus Ring for Keyboard Navigation */
button:focus-visible,
a:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-nav:focus-visible,
.btn-torrent:focus-visible,
.btn-gemini:focus-visible,
.btn-wol:focus-visible,
.btn-control:focus-visible,
.btn-action-item:focus-visible,
.btn-console-act:focus-visible,
.terminal-tab:focus-visible,
.quick-chip:focus-visible,
.quick-drop-btn:focus-visible,
.pill-btn:focus-visible,
.magnet-submit-btn:focus-visible,
.agy-send-btn:focus-visible,
.meta-link-btn:focus-visible,
.dropdown-item:focus-visible,
.app-card:focus-visible,
.logo:focus-visible,
.changelog-close:focus-visible,
.magnet-close:focus-visible,
.version-badge-btn:focus-visible {
  outline: 2px solid #38bdf8 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}

.wol-dropdown {
  min-width: 225px;
}

.torrent-dropdown {
  min-width: 260px;
}

/* Disk Storage Widget */
.disk-widget {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.disk-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.disk-label {
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.disk-val {
  color: #60a5fa;
  font-weight: 700;
  font-family: monospace;
}

.disk-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.disk-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 70%, #38bdf8 100%);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.disk-bar-fill.warning {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.disk-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: monospace;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 4px;
}

/* Action buttons and navigation links inside dropdowns - Unified Button Style & Palette */
.btn-action-item,
.dropdown-item,
a.dropdown-item,
button.dropdown-item,
.dropdown-menu button,
.dropdown-menu a {
  background: rgba(59, 130, 246, 0.12) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(96, 165, 250, 0.35) !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
  margin-bottom: 5px !important;
  font-weight: 600 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  text-align: left !important;
  cursor: pointer !important;
  font-family: inherit !important;
  font-size: 0.86rem !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.btn-action-item:hover,
.dropdown-item:hover,
a.dropdown-item:hover,
button.dropdown-item:hover,
.dropdown-menu button:hover,
.dropdown-menu a:hover {
  background: rgba(59, 130, 246, 0.26) !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.38) !important;
  transform: translateY(-1px) !important;
  color: #ffffff !important;
}

.btn-action-item:active,
.dropdown-item:active,
a.dropdown-item:active,
button.dropdown-item:active,
.dropdown-menu button:active,
.dropdown-menu a:active {
  transform: translateY(1px) scale(0.98) !important;
}

.item-tag {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: monospace;
  letter-spacing: 0.3px;
}

.item-tag.online {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.25);
}

.item-tag.offline {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
}

.dot-wol-desktop {
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  transition: all 0.3s ease;
}

.dot-wol-nuc {
  background-color: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  transition: all 0.3s ease;
}

.dot-wol-both {
  background-color: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
}

.dot-ping {
  background-color: #64748b;
  box-shadow: 0 0 6px rgba(100, 116, 139, 0.5);
}

.dot-sleep {
  background-color: #818cf8;
  box-shadow: 0 0 8px #818cf8;
}

.btn-sleep {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: rgba(99, 102, 241, 0.3) !important;
  color: #a5b4fc !important;
}

.btn-sleep:hover {
  background: rgba(99, 102, 241, 0.22) !important;
  border-color: #a5b4fc !important;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.35) !important;
  color: #ffffff !important;
}

/* Toast Notification */
.wol-toast {
  position: fixed;
  bottom: 80px;
  right: 28px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(12px);
  z-index: 99999;
  max-width: 360px;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.wol-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

.toast-dot.success {
  background-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.toast-dot.error {
  background-color: #ef4444;
  box-shadow: 0 0 10px #ef4444;
}

.toast-dot.loading {
  background-color: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: toastPulse 1.4s infinite;
}

@keyframes toastPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast-title {
  font-weight: 600;
  color: #f8fafc;
  font-size: 0.88rem;
}

.toast-subtext {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-arrow,
.dropdown.is-open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  min-width: 260px;
  background: rgba(13, 19, 33, 0.97);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 12px;
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.7), 0 0 25px rgba(59, 130, 246, 0.25);
  padding: 8px;
  z-index: 1000;
}

/* Invisible bridge so cursor never drops hover while traveling from button to menu */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 16px;
  background: transparent;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.is-open .dropdown-menu {
  display: flex !important;
  flex-direction: column;
  animation: fadeInDown 0.16s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.dropdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dropdown-dot.dot-1 {
  background-color: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

.dropdown-dot.dot-2 {
  background-color: #a855f7;
  box-shadow: 0 0 8px #a855f7;
}

.dropdown-dot.dot-gemini-desktop {
  background-color: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.dropdown-dot.dot-gemini-nuc {
  background-color: #ec4899;
  box-shadow: 0 0 8px #ec4899;
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--text-main);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-container {
  max-width: 800px;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-hover);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Services / Features */
.services {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-tag {
  display: block;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--primary);
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 36px 28px;
  border-radius: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.3);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 18px;
}

.card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* About */
.about {
  padding: 60px 0;
}

.about-card {
  background: linear-gradient(180deg, rgba(22, 27, 34, 0.6) 0%, rgba(13, 17, 23, 0.6) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
  max-width: 850px;
  margin: 0 auto;
}

.about-card h2 {
  font-size: 1.9rem;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.about-card p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

/* Fleet Telemetry Section */
.fleet-section {
  padding: 80px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.fleet-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.fleet-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.fleet-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.fleet-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.fleet-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.metric-name {
  color: var(--text-muted);
}

.metric-val {
  color: var(--text-main);
  font-family: monospace;
  font-weight: 600;
}

/* ==========================================================================
    Interactive Homelab Topology & Circuit Schematic Map
   ========================================================================== */
.schematic-section-container {
  background: #080c16;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 34px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.1);
  position: relative;
  overflow: hidden;
}

.schematic-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.schematic-main-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.schematic-sub-title {
  font-size: 0.75rem;
  color: #94a3b8;
}

.schematic-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-schematic-chip {
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.btn-schematic-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

.btn-schematic-chip.pulse-active {
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Schematic Board & Multi-Zone Grid */
.schematic-board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.schematic-zones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .schematic-zones-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.schematic-zone {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schematic-zone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.schematic-zone-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Schematic Node Cards */
.schematic-node-card {
  background: #0d1322;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  user-select: none;
}

.schematic-node-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  background: #111a30;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(56, 189, 248, 0.15);
}

.schematic-node-card.selected {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35) !important;
}

.schematic-node-card.severed {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35) !important;
}

.schematic-node-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.schematic-node-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.schematic-node-icon {
  font-size: 1.25rem;
}

.schematic-node-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.schematic-node-ip {
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: monospace;
}

.schematic-node-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  margin-top: 4px;
  color: #64748b;
}

.schematic-node-throughput {
  color: #38bdf8;
  font-weight: 600;
  font-family: monospace;
}

/* Circuit Flow Animation Lines */
.schematic-circuits-svg {
  width: 100%;
  height: 60px;
  display: block;
  margin: -6px 0;
  overflow: visible;
}

.circuit-wire {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  transition: stroke 0.3s;
}

.circuit-stream {
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-dasharray: 8 12;
  stroke-dashoffset: 40;
  animation: circuitFlow 1.4s linear infinite;
  will-change: stroke-dashoffset;
}

.circuit-stream.edge {
  stroke: #38bdf8;
  filter: drop-shadow(0 0 5px #38bdf8);
}
.circuit-stream.fiber {
  stroke: #60a5fa;
  filter: drop-shadow(0 0 5px #60a5fa);
}
.circuit-stream.vpn {
  stroke: #34d399;
  filter: drop-shadow(0 0 5px #34d399);
}
.circuit-stream.lan {
  stroke: #a78bfa;
  filter: drop-shadow(0 0 5px #a78bfa);
}

@keyframes circuitFlow {
  0% {
    stroke-dashoffset: 40;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

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

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

@keyframes modalScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.circuit-wire.pulsing {
  stroke: #38bdf8 !important;
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 6px #38bdf8);
  transition: all 0.1s ease;
}

/* Node Inspector Telemetry Panel */
.schematic-inspector-panel {
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-out;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inspector-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inspector-node-title {
  font-size: 1rem;
  font-weight: 800;
  color: #f8fafc;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.inspector-stat-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px 12px;
}

.inspector-stat-lbl {
  font-size: 0.68rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.inspector-stat-val {
  font-size: 0.86rem;
  font-weight: 700;
  color: #f1f5f9;
  font-family: monospace;
}

.inspector-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.inspector-services {
  font-size: 0.76rem;
  color: #94a3b8;
}

.inspector-btn-action {
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  transition: all 0.2s;
}

.inspector-btn-action:hover {
  background: rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Contact */
.contact {
  padding: 80px 0 100px;
}

.contact-card {
  background: radial-gradient(circle at top center, rgba(59, 130, 246, 0.15) 0%, rgba(22, 27, 34, 0.7) 70%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 16px;
  padding: 56px 32px;
  text-align: center;
  max-width: 750px;
  margin: 0 auto;
}

.contact-card h2 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.contact-card p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 28px;
}

.contact-actions {
  display: flex;
  justify-content: center;
}

/* Footer */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 30px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-main);
}

/* Responsive */
@media (max-width: 900px) {
  .logo {
    font-size: 1.15rem;
    gap: 7px;
  }
  .logo-deck-badge {
    font-size: 0.58rem;
    padding: 2.5px 6.5px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 12px 0;
  }
  .nav-container {
    flex-wrap: wrap;
    gap: 10px;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .about-card {
    padding: 32px 20px;
  }
  .footer-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .logo {
    font-size: 1.05rem;
    gap: 6px;
  }
  .logo-deck-badge {
    font-size: 0.52rem;
    padding: 2px 5px;
    letter-spacing: 0.05em;
  }
  .nav-links {
    gap: 8px;
  }
  .btn-nav {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 440px) {
  .logo {
    font-size: 0.98rem;
    gap: 5px;
  }
  .logo-deck-badge {
    font-size: 0.48rem;
    padding: 2px 4px;
    letter-spacing: 0.02em;
  }
}

/* Remote Magnet Drop Modal */
.magnet-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.94);
  z-index: 1000;
  display: none !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.magnet-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.magnet-modal {
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(59, 130, 246, 0.2);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.magnet-modal-overlay.active .magnet-modal {
  transform: scale(1);
}

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

.magnet-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f0f6fc;
}

.magnet-close {
  background: none;
  border: none;
  color: #8b949e;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.magnet-close:hover {
  color: #f0f6fc;
}

.magnet-input {
  width: 100%;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px;
  color: #f0f6fc;
  font-family: monospace;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 90px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

.magnet-input:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.2);
}

.magnet-targets {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.magnet-target-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: #8b949e;
  cursor: pointer;
}

.magnet-target-label input[type="radio"] {
  accent-color: #3b82f6;
}

.magnet-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.magnet-submit-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   Homelab Mission Control & Command Deck Styling
   ========================================================================== */

.homelab-hero {
  padding: 60px 0 30px;
  position: relative;
}

.homelab-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  color: #4ade80;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 10px #22c55e;
  animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-homelab-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
  color: #f8fafc;
}

.hero-homelab-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 760px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.command-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
}

.pill-route {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.25));
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.45);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.pill-route:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(6, 182, 212, 0.4));
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.3);
}

.pill-stream {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(124, 58, 237, 0.35));
  color: #c4b5fd !important;
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

.pill-stream:hover {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(124, 58, 237, 0.5));
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.4);
}

.pill-files {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.pill-files:hover {
  background: rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.pill-audiobooks {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35));
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.pill-audiobooks:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(217, 119, 6, 0.5));
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
}

.pill-magnet {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.pill-magnet:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.pill-health {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pill-health:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.pill-sonarr {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8 !important;
  border: 1px solid rgba(14, 165, 233, 0.4);
}

.pill-sonarr:hover {
  background: rgba(14, 165, 233, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.35);
}

.pill-radarr {
  background: rgba(249, 115, 22, 0.15);
  color: #fb923c !important;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.pill-radarr:hover {
  background: rgba(249, 115, 22, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.35);
}

.pill-prowlarr {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pill-prowlarr:hover {
  background: rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}

.pill-readarr {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pill-readarr:hover {
  background: rgba(16, 185, 129, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.pill-outline {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pill-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* Status Ribbon */
.status-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 50px;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ribbon-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #8b949e;
  font-weight: 600;
}

.ribbon-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f0f6fc;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Homelab App Grid */
.homelab-apps-section {
  padding: 40px 0 60px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.app-card {
  background: rgba(17, 24, 39, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.15);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.app-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 8px;
}

.app-card-desc {
  font-size: 0.88rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 18px;
  flex: 1;
}

.app-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.app-port {
  font-family: monospace;
  color: #60a5fa;
  font-weight: 600;
}

.app-btn-launch {
  color: #38bdf8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Quick Drop Inline Bar */
.quick-drop-inline {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.quick-drop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-drop-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-drop-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-drop-input {
  flex: 1;
  min-width: 260px;
  background: rgba(11, 15, 23, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f0f6fc;
  font-family: monospace;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.quick-drop-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.quick-drop-btn {
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.quick-drop-btn:hover {
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

/* ==========================================================================
   Homelab Control Matrix, Live Stats Dials & Terminal Viewer
   ========================================================================== */

/* Control Matrix */
.control-matrix-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.control-matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.control-matrix-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.btn-control {
  background: rgba(59, 130, 246, 0.14) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  color: #93c5fd !important;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-control:hover {
  background: rgba(59, 130, 246, 0.28) !important;
  border-color: #60a5fa !important;
  transform: translateY(-2px);
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4) !important;
}

.btn-control:active {
  transform: translateY(0);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.25);
}

.btn-control.active-pause,
.btn-control.btn-reboot {
  background: rgba(239, 68, 68, 0.16) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
}

.btn-control.active-pause:hover,
.btn-control.btn-reboot:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}

.btn-control.active-resume,
.btn-control.active-wake {
  background: rgba(34, 197, 94, 0.16) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
  color: #86efac !important;
}

.btn-control.active-resume:hover,
.btn-control.active-wake:hover {
  background: rgba(34, 197, 94, 0.28) !important;
  border-color: #22c55e !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.4) !important;
}

.btn-control.active-sleep {
  background: rgba(99, 102, 241, 0.16) !important;
  border-color: rgba(99, 102, 241, 0.45) !important;
  color: #a5b4fc !important;
}

.btn-control.active-sleep:hover {
  background: rgba(99, 102, 241, 0.28) !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4) !important;
}

/* Monospace identifiers (session IDs, version tags) */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.btn-control.active-eco {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
  color: #fde047 !important;
}

.btn-control.active-eco:hover {
  background: rgba(245, 158, 11, 0.28) !important;
  border-color: #f59e0b !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4) !important;
}

.btn-control.btn-sonarr {
  background: rgba(14, 165, 233, 0.14) !important;
  border-color: rgba(14, 165, 233, 0.45) !important;
  color: #38bdf8 !important;
}

.btn-control.btn-sonarr:hover {
  background: rgba(14, 165, 233, 0.28) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.4) !important;
}

.btn-control.btn-radarr {
  background: rgba(249, 115, 22, 0.14) !important;
  border-color: rgba(249, 115, 22, 0.45) !important;
  color: #fb923c !important;
}

.btn-control.btn-radarr:hover {
  background: rgba(249, 115, 22, 0.28) !important;
  border-color: #fb923c !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(249, 115, 22, 0.4) !important;
}

.btn-control.btn-prowlarr {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
  color: #f87171 !important;
}

.btn-control.btn-prowlarr:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}

.btn-control.btn-readarr {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
  color: #34d399 !important;
}

.btn-control.btn-readarr:hover {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4) !important;
}

/* Symmetrical Homelab Control Filter Tabs & Tags */
.control-filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.control-node-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.node-filter-btn {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.node-filter-btn:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
}

.node-filter-btn.active {
  background: rgba(59, 130, 246, 0.25);
  border-color: #3b82f6;
  color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

.node-filter-btn.active#tab-ctrl-desktop {
  background: rgba(96, 165, 250, 0.2);
  border-color: #60a5fa;
  color: #93c5fd;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.35);
}

.node-filter-btn.active#tab-ctrl-nuc {
  background: rgba(192, 132, 252, 0.2);
  border-color: #c084fc;
  color: #e9d5ff;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.35);
}

.ctrl-node-tag {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tag-desktop {
  background: rgba(96, 165, 250, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.tag-nuc {
  background: rgba(192, 132, 252, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.tag-cluster {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Consolidated Control Target Selector & Action Groups */
.control-node-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  position: relative;
  z-index: 50;
}

.ctrl-node-select {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #f8fafc;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  min-width: 280px;
}

.ctrl-node-select:hover,
.ctrl-node-select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
  background: rgba(30, 41, 59, 1);
}

.ctrl-node-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.35);
  transition: all 0.25s ease;
}

.control-groups-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.control-group {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px 16px;
}

.control-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.control-group-icon {
  font-size: 1rem;
}

.control-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
}

.control-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

/* Stats Metric Cards */
.homelab-stats-section {
  margin-bottom: 40px;
}

.stats-grid-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-metric-card {
  background: rgba(17, 24, 39, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  box-sizing: border-box;
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stat-card-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  font-weight: 700;
}

.stat-big-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #f0f6fc;
  line-height: 1.25;
  margin-bottom: 14px;
  font-family: var(--font-family);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.stat-subtext {
  font-size: 0.82rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  line-height: 1.5;
  margin-top: auto;
  padding-top: 6px;
}

/* Multi-Segment Storage Bar */
.storage-segments-wrap {
  margin-top: 14px;
}

.storage-segments-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.seg-movies { background: #3b82f6; }
.seg-tv { background: #8b5cf6; }
.seg-mixes { background: #ec4899; }
.seg-free { background: rgba(255, 255, 255, 0.15); }

.storage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Live Terminal Window */
.terminal-window {
  background: rgba(11, 15, 23, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 40px;
}

.terminal-header {
  background: rgba(15, 23, 42, 0.9);
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.terminal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

.terminal-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.terminal-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
}

#tab-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  line-height: 1.2;
}

.terminal-tab:hover,
.terminal-tab.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: #60a5fa;
  color: #ffffff;
}

.terminal-body {
  padding: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #a5b4fc;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-body::-webkit-scrollbar {
  width: 6px;
}
.terminal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}


/* Uptime Matrix & SLA Bar Visualizer */
.uptime-matrix {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.uptime-tier-row {
  background: rgba(11, 15, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 14px 18px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.uptime-tier-row:hover {
  border-color: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.uptime-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.uptime-tier-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: #f0f6fc;
}

.uptime-tier-title .tier-role {
  font-size: 0.78rem;
  color: #8b949e;
  font-weight: normal;
  margin-left: 6px;
}

.uptime-tier-sla {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.uptime-tier-sla .tier-val {
  color: #6ee7b7;
  font-weight: 700;
}

.uptime-tier-sla .tier-status {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.uptime-tier-sla .tier-status.online {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
}

.uptime-bars {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  width: 100%;
  padding: 2px 0;
}

.uptime-bar {
  flex: 1 1 0;
  height: 100%;
  border-radius: 2px;
  background-color: #10b981;
  transition: transform 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
  position: relative;
}

.uptime-bar:hover {
  transform: scaleY(1.35);
  background-color: #38bdf8 !important;
  z-index: 2;
}

.uptime-bar.standby {
  background-color: #6366f1;
}

.uptime-bar.standby:hover {
  background-color: #818cf8 !important;
}

.uptime-bar.warn {
  background-color: #f59e0b;
}

.uptime-bar.down {
  background-color: #ef4444;
}

.uptime-bar.maintenance {
  background: repeating-linear-gradient(45deg, #f59e0b, #f59e0b 3px, #b45309 3px, #b45309 6px) !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.45);
}

.uptime-bar.maintenance:hover {
  background: #fbbf24 !important;
  box-shadow: 0 0 10px #fbbf24 !important;
  transform: scaleY(1.4);
}

.uptime-bar.edge {
  background-color: #10b981 !important;
}

.uptime-bar.edge:hover {
  background-color: #38bdf8 !important;
  transform: scaleY(1.35);
}

.uptime-bar.isp {
  background-color: #10b981 !important;
}

.uptime-bar.isp:hover {
  background-color: #38bdf8 !important;
  transform: scaleY(1.35);
}

.sla-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6ee7b7;
  user-select: none;
}

.sla-status-indicator.in-maintenance {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.btn-control.active-maint {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-control.active-maint:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
  color: #ffffff;
}

.btn-control.active-maint.in-maintenance {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.btn-maint-sla-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fbbf24;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-maint-sla-chip:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.btn-maint-sla-chip.in-maintenance {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fef08a;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  animation: pulseCrit 1.4s infinite alternate;
}

.uptime-scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 0.72rem;
  color: #8b949e;
  font-family: monospace;
}

/* Embedded Antigravity (AGY) Interactive Terminal Console */
.agy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.94);
  z-index: 10000;
  display: none !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 16px;
}

.agy-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.agy-console-window {
  background: #090d16;
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 14px;
  width: 95%;
  max-width: 980px;
  height: 85vh;
  max-height: 780px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(59, 130, 246, 0.25);
  transform: scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.agy-console-window.fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  border-radius: 0;
  border: none;
}

.agy-modal-overlay.active .agy-console-window {
  transform: scale(1);
}

.agy-console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  gap: 12px;
}

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

.win-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.15s ease, filter 0.15s ease;
  border: none;
  padding: 0;
  appearance: none;
}

.win-dot:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

.win-dot.dot-close { background-color: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.win-dot.dot-min   { background-color: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.6); }
.win-dot.dot-max   { background-color: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }

.agy-console-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e2e8f0;
  flex: 1;
}

.agy-console-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-console-act {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-console-act:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.agy-session-meta-bar {
  display: flex;
  align-items: center;
  padding: 8px 18px;
  background: rgba(2, 6, 23, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.meta-item {
  display: flex;
  gap: 6px;
  color: #94a3b8;
}

.meta-lbl {
  color: #64748b;
}

.meta-val {
  color: #cbd5e1;
}

.meta-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.meta-link-btn {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #93c5fd;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meta-link-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
}

.agy-console-screen {
  flex: 1;
  background: #020617;
  padding: 16px 20px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(59, 130, 246, 0.3) rgba(0, 0, 0, 0.3);
}

.agy-console-screen .agy-line {
  white-space: pre-wrap;
  word-break: break-word;
}

.agy-console-screen .agy-line.user {
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.07);
  padding: 4px 8px;
  border-left: 3px solid #38bdf8;
  border-radius: 0 4px 4px 0;
  margin: 4px 0;
}

.agy-console-screen .agy-line.model {
  color: #e2e8f0;
}

.agy-console-screen .agy-line.tool {
  color: #fbbf24;
  font-size: 0.8rem;
}

.agy-console-screen .agy-line.system {
  color: #64748b;
  font-style: italic;
  font-size: 0.78rem;
}

.agy-quick-chips {
  display: flex;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  overflow-x: auto;
  white-space: nowrap;
}

.quick-chip {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #93c5fd;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.quick-chip:hover {
  background: rgba(59, 130, 246, 0.35);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.quick-chip:active {
  transform: translateY(1px);
}

.agy-console-input-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #090d16;
  border-top: 1px solid rgba(59, 130, 246, 0.25);
}

.agy-prompt-label {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.agy-modal-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: #f8fafc;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.agy-modal-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.agy-send-btn {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid #3b82f6;
  color: #fff;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.agy-send-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

/* Version Badge in Footer */
.version-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.version-badge-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* Lines of Code Badge in Footer */
.footer-loc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 20px;
  padding: 4px 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.footer-loc-badge:hover {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

/* Changelog Modal */
.changelog-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.94);
  z-index: 10001;
  display: none !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 16px;
}

.changelog-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.changelog-modal {
  background: #090d16;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  width: 92%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.2);
  transform: scale(0.96);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.changelog-modal-overlay.active .changelog-modal {
  transform: scale(1);
}

.changelog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.changelog-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
}

.changelog-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.changelog-close:hover {
  color: #fff;
}

.changelog-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
}

.changelog-entry {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.changelog-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.changelog-ver-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ver-tag {
  font-family: monospace;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.ver-tag.current {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.ver-date {
  font-size: 0.78rem;
  color: #64748b;
}

.ver-title {
  font-size: 0.9rem;
  color: #e2e8f0;
  margin: 4px 0 8px 0;
  font-weight: 600;
}

.ver-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.82rem;
  color: #94a3b8;
  line-height: 1.6;
}

.ver-list li {
  margin-bottom: 4px;
}

.ver-list code {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: monospace;
}

/* SSO & Security Gate Unified Styles */
.terminal-sso-gate,
.modal-sso-gate {
  padding: 36px 24px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.6) 0%, rgba(11, 15, 23, 0.96) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  box-sizing: border-box;
}

.modal-sso-gate {
  flex: 1;
  min-height: 420px;
}

.sso-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 8px;
}

.sso-badge-tag {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #93c5fd;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sso-badge-tag.green {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.sso-pin-input {
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  color: #f8fafc !important;
  font-family: monospace !important;
  font-size: 0.88rem !important;
  outline: none;
  transition: all 0.2s ease;
}

.sso-pin-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

button:disabled, .btn:disabled, .btn-secondary:disabled, .btn-control:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* ==========================================================================
   Mobile-First Adaptive UI, Touch Targets & Layout Switcher (dr_layout_mode)
   ========================================================================== */

/* Layout Toggle Switcher Buttons */
.layout-toggle-btn {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  color: #93c5fd !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  padding: 8px 14px !important;
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15) !important;
  user-select: none;
  min-height: 44px;
  min-width: 44px;
  box-sizing: border-box;
}

.layout-toggle-btn:hover {
  background: rgba(59, 130, 246, 0.3) !important;
  border-color: #60a5fa !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.35) !important;
}

.layout-toggle-btn:active {
  transform: scale(0.96) !important;
}

/* AI Token Telemetry Counter */
.token-counter-btn {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #93c5fd !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.token-counter-btn:hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35) !important;
}

.token-counter-btn:active {
  transform: scale(0.96) !important;
}

/* AI Model Breakdown Tags & Multi-Model Progress Bar */
.token-breakdown-tags {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.item-tag.tag-flash {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.item-tag.tag-argon {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.item-tag.tag-pro {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.model-progress-bar {
  display: flex;
  height: 6px;
  border-radius: 9999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0 8px;
  width: 100%;
}

.model-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.model-segment.flash {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.model-segment.argon {
  background: linear-gradient(90deg, #9333ea, #c084fc);
}

.model-segment.pro {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

/* Token Protocol Savings Tag */
.item-tag.tag-savings {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Homelab Health Radar Card & Modal */
.ribbon-health-radar {
  border-left: 2px solid #10b981 !important;
  background: rgba(16, 185, 129, 0.06) !important;
  transition: all 0.2s ease !important;
}

.ribbon-health-radar:hover {
  background: rgba(16, 185, 129, 0.14) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25) !important;
  transform: translateY(-1px) !important;
}

.health-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.94);
  z-index: 10002;
  display: none !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  padding: 16px;
}

.health-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.health-modal-window {
  background: #0f172a;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.2);
  overflow: hidden;
}

.health-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.health-radar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.health-radar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.84rem;
}

.health-meter-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.health-meter-fill {
  height: 100%;
  border-radius: 9999px;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.5s ease;
}

@media (max-width: 600px) {
  .token-counter-btn .token-breakdown-tags .tag-pro {
    display: none;
  }
}

@media (max-width: 480px) {
  .token-counter-btn .token-breakdown-tags .tag-argon {
    display: none;
  }
}

.layout-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Header Navigation - Desktop Mode Default */
.nav-menu-toggle {
  display: none !important;
}

.nav-mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  order: 3;
}

/* Top Bar Dedicated SSO Login & Logout Controls */
.top-sso-container {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sso-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-sso-login:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
  color: #fff;
}

.btn-sso-login:active {
  transform: translateY(1px) scale(0.98);
}

.top-sso-authed-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.top-sso-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
  white-space: nowrap;
}

.btn-sso-logout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-sso-logout:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: #ef4444;
  color: #fee2e2;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

.btn-sso-logout:active {
  transform: translateY(1px) scale(0.98);
}

/* When in desktop-layout on mobile/tablet viewports, enforce desktop canvas */
html.desktop-layout body {
  min-width: 1080px;
}

/* When forced mobile view on larger desktop screens (>768px), enhance touch targets without breaking desktop width */
@media (min-width: 769px) {
  html.mobile-layout body {
    width: 100% !important;
  }
  html.mobile-layout body .container {
    max-width: 1100px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
  }
  html.mobile-layout .header .container {
    max-width: 1100px !important;
  }
  html.mobile-layout .nav-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    position: relative !important;
  }
  html.mobile-layout .nav-menu-toggle {
    display: none !important;
  }
  html.mobile-layout .nav-links {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    border-top: none !important;
    padding: 0 !important;
  }
  html.mobile-layout .nav-container.nav-open .nav-links {
    display: flex !important;
  }
  html.mobile-layout .nav-links > .btn-nav,
  html.mobile-layout .nav-links > a.btn-nav,
  html.mobile-layout .nav-links > button.btn-nav {
    width: auto !important;
    min-height: 40px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 14px !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
  }
  html.mobile-layout .nav-links .dropdown {
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html.mobile-layout .nav-links .dropdown > .btn-nav {
    width: auto !important;
    min-height: 40px !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 14px !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
  }
  html.mobile-layout .nav-links .dropdown-menu {
    position: absolute !important;
    width: auto !important;
    min-width: 220px !important;
    max-width: 320px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 8px !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    padding: 8px !important;
    background: rgba(11, 15, 23, 0.95) !important;
    box-sizing: border-box !important;
  }
  html.mobile-layout .nav-links .dropdown-item,
  html.mobile-layout .nav-links .btn-action-item {
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
  }
  html.mobile-layout .command-pills {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }
  html.mobile-layout .command-pills .pill-btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 12px 16px !important;
    box-sizing: border-box !important;
  }
  html.mobile-layout .status-ribbon,
  html.mobile-layout .control-group-grid,
  html.mobile-layout .stats-grid-row,
  html.mobile-layout .fleet-grid,
  html.mobile-layout .app-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  html.mobile-layout .quick-drop-form,
  html.mobile-layout .control-node-bar,
  html.mobile-layout .footer-container {
    flex-direction: column !important;
    align-items: stretch !important;
    text-align: center !important;
  }
  html.mobile-layout .footer-meta {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
  }
  html.mobile-layout #camera-live-frame {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    min-height: 200px !important;
    max-height: 340px !important;
    display: block !important;
  }
  html.mobile-layout #camera-feed-card .btn,
  html.mobile-layout #camera-feed-card .btn-secondary {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.82rem !important;
    box-sizing: border-box !important;
  }
  html.mobile-layout .magnet-modal,
  html.mobile-layout .changelog-modal {
    width: 95% !important;
    max-width: 480px !important;
  }
  html.mobile-layout .agy-console-window {
    width: 95vw !important;
    max-width: 500px !important;
    height: 90vh !important;
  }
  html.mobile-layout .terminal-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    padding: 6px 12px !important;
    gap: 8px !important;
  }
  html.mobile-layout .terminal-tab {
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  html.mobile-layout .agy-window-controls {
    display: none !important;
  }
  html.mobile-layout .sso-pin-input {
    min-height: 44px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   Unified Mobile Breakpoints & Touch-Optimized Layout
   Applies when screen width <= 768px (unless forced desktop) OR when mobile-layout is active
   ========================================================================== */
@media (max-width: 768px) {
  html:not(.desktop-layout) body,
  html.mobile-layout body {
    width: 100% !important;
  }

  html:not(.desktop-layout) .container,
  html.mobile-layout .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 14px !important;
    box-sizing: border-box !important;
  }

  /* Header & Mobile Nav Drawer */
  html:not(.desktop-layout) .header,
  html.mobile-layout .header {
    padding: 10px 0 !important;
    position: sticky;
    top: 0;
    z-index: 500;
    background: #0d1117;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  html:not(.desktop-layout) .nav-container,
  html.mobile-layout .nav-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
  }

  html:not(.desktop-layout) .logo,
  html.mobile-layout .logo {
    order: 1 !important;
    font-size: 1.05rem !important;
    gap: 6px !important;
  }

  html:not(.desktop-layout) .logo-deck-badge,
  html.mobile-layout .logo-deck-badge {
    font-size: 0.52rem !important;
    padding: 2px 5px !important;
  }

  html:not(.desktop-layout) .nav-mobile-actions,
  html.mobile-layout .nav-mobile-actions {
    order: 2 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) .nav-menu-toggle,
  html.mobile-layout .nav-menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(96, 165, 250, 0.4) !important;
    color: #93c5fd !important;
    border-radius: 8px !important;
    font-size: 1.25rem !important;
    cursor: pointer !important;
  }

  html:not(.desktop-layout) .nav-links,
  html.mobile-layout .nav-links {
    order: 3 !important;
    width: 100% !important;
    display: none !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 12px 0 6px 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  }

  html:not(.desktop-layout) .nav-container.nav-open .nav-links,
  html.mobile-layout .nav-container.nav-open .nav-links {
    display: flex !important;
    animation: fadeInDown 0.2s ease-out;
  }

  html:not(.desktop-layout) .nav-links > .btn-nav,
  html:not(.desktop-layout) .nav-links > a.btn-nav,
  html:not(.desktop-layout) .nav-links > button.btn-nav,
  html.mobile-layout .nav-links > .btn-nav,
  html.mobile-layout .nav-links > a.btn-nav,
  html.mobile-layout .nav-links > button.btn-nav {
    width: 100% !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .nav-links .dropdown,
  html.mobile-layout .nav-links .dropdown {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html:not(.desktop-layout) .nav-links .dropdown > .btn-nav,
  html.mobile-layout .nav-links .dropdown > .btn-nav {
    width: 100% !important;
    min-height: 44px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
  }

  /* Inline Accordion Dropdowns on Mobile */
  html:not(.desktop-layout) .nav-links .dropdown-menu,
  html.mobile-layout .nav-links .dropdown-menu {
    position: static !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    border-radius: 8px !important;
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    padding: 8px !important;
    background: rgba(11, 15, 23, 0.95) !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .nav-links .dropdown-item,
  html:not(.desktop-layout) .nav-links .btn-action-item,
  html.mobile-layout .nav-links .dropdown-item,
  html.mobile-layout .nav-links .btn-action-item {
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
  }

  /* Hero Section */
  html:not(.desktop-layout) .homelab-hero,
  html.mobile-layout .homelab-hero {
    padding-top: 24px !important;
    padding-bottom: 24px !important;
  }

  html:not(.desktop-layout) .hero-homelab-title,
  html.mobile-layout .hero-homelab-title {
    font-size: 1.7rem !important;
    line-height: 1.25 !important;
    word-break: break-word !important;
    margin-bottom: 12px !important;
  }

  html:not(.desktop-layout) .hero-homelab-subtitle,
  html.mobile-layout .hero-homelab-subtitle {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 20px !important;
  }

  html:not(.desktop-layout) .homelab-badge,
  html.mobile-layout .homelab-badge {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
  }

  /* Command Pills - Mobile Stack */
  html:not(.desktop-layout) .command-pills,
  html.mobile-layout .command-pills {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
    margin-bottom: 24px !important;
  }

  html:not(.desktop-layout) .command-pills .pill-btn,
  html.mobile-layout .command-pills .pill-btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: center !important;
    padding: 12px 16px !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
  }

  /* Status Ribbon - Single Column Stacking (R1) */
  html:not(.desktop-layout) .status-ribbon,
  html.mobile-layout .status-ribbon {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding: 12px !important;
    margin-bottom: 24px !important;
  }

  html:not(.desktop-layout) .ribbon-item,
  html.mobile-layout .ribbon-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 10px !important;
    min-height: 38px !important;
  }

  /* Quick Drop Magnet Console */
  html:not(.desktop-layout) .quick-drop-inline,
  html.mobile-layout .quick-drop-inline {
    padding: 16px 14px !important;
    margin-bottom: 24px !important;
  }

  html:not(.desktop-layout) .quick-drop-header,
  html.mobile-layout .quick-drop-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  html:not(.desktop-layout) .quick-drop-form,
  html.mobile-layout .quick-drop-form {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }

  html:not(.desktop-layout) .quick-drop-input,
  html.mobile-layout .quick-drop-input {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) #quick-magnet-target,
  html.mobile-layout #quick-magnet-target {
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .quick-drop-btn,
  html.mobile-layout .quick-drop-btn {
    width: 100% !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Homelab Remote Control Matrix */
  html:not(.desktop-layout) .control-matrix-card,
  html.mobile-layout .control-matrix-card {
    padding: 16px 14px !important;
    margin-bottom: 24px !important;
  }

  html:not(.desktop-layout) .control-matrix-header,
  html.mobile-layout .control-matrix-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  html:not(.desktop-layout) .control-node-bar,
  html.mobile-layout .control-node-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  html:not(.desktop-layout) .control-node-bar .dropdown,
  html.mobile-layout .control-node-bar .dropdown {
    width: 100% !important;
  }

  html:not(.desktop-layout) #target-node-btn,
  html.mobile-layout #target-node-btn {
    width: 100% !important;
    min-height: 44px !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .ctrl-node-status-badge,
  html.mobile-layout .ctrl-node-status-badge {
    justify-content: center !important;
    width: 100% !important;
    min-height: 36px !important;
    box-sizing: border-box !important;
  }

  /* Single-column Card Stacking in Action Groups & Metrics */
  html:not(.desktop-layout) .control-group-grid,
  html.mobile-layout .control-group-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) .stats-grid-row,
  html.mobile-layout .stats-grid-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  html:not(.desktop-layout) .btn-control,
  html.mobile-layout .btn-control {
    width: 100% !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px 14px !important;
    font-size: 0.88rem !important;
    box-sizing: border-box !important;
  }

  /* Live Camera Feed (R4) */
  html:not(.desktop-layout) #camera-live-frame,
  html.mobile-layout #camera-live-frame {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    min-height: 200px !important;
    max-height: 340px !important;
    display: block !important;
  }

  html:not(.desktop-layout) #camera-feed-card .control-matrix-header,
  html.mobile-layout #camera-feed-card .control-matrix-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) #camera-feed-card .btn,
  html:not(.desktop-layout) #camera-feed-card .btn-secondary,
  html.mobile-layout #camera-feed-card .btn,
  html.mobile-layout #camera-feed-card .btn-secondary {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.82rem !important;
    box-sizing: border-box !important;
  }

  /* SLA Uptime Matrix & Scale */
  html:not(.desktop-layout) .uptime-legend-bar,
  html.mobile-layout .uptime-legend-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }

  html:not(.desktop-layout) .uptime-legend-items,
  html.mobile-layout .uptime-legend-items {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) .uptime-tier-row,
  html.mobile-layout .uptime-tier-row {
    padding: 12px 14px !important;
  }

  html:not(.desktop-layout) .uptime-tier-header,
  html.mobile-layout .uptime-tier-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }

  html:not(.desktop-layout) .uptime-bars,
  html.mobile-layout .uptime-bars {
    gap: 1.5px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  html:not(.desktop-layout) .uptime-bar,
  html.mobile-layout .uptime-bar {
    min-width: 2px !important;
  }

  /* Fleet Cluster Cards Single-Column Stacking (R1, R4) */
  html:not(.desktop-layout) .fleet-grid,
  html.mobile-layout .fleet-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  html:not(.desktop-layout) .fleet-card,
  html.mobile-layout .fleet-card {
    padding: 16px 14px !important;
  }

  html:not(.desktop-layout) .fleet-card .metric-row,
  html.mobile-layout .fleet-card .metric-row {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }

  html:not(.desktop-layout) .fleet-card .metric-val,
  html.mobile-layout .fleet-card .metric-val {
    word-break: break-word !important;
  }

  html:not(.desktop-layout) .fleet-card .btn,
  html:not(.desktop-layout) .fleet-card .btn-secondary,
  html.mobile-layout .fleet-card .btn,
  html.mobile-layout .fleet-card .btn-secondary {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Application Cards Single-Column Stacking */
  html:not(.desktop-layout) .app-grid,
  html.mobile-layout .app-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  html:not(.desktop-layout) .app-card,
  html.mobile-layout .app-card {
    padding: 16px 14px !important;
  }

  html:not(.desktop-layout) .app-card-footer a,
  html:not(.desktop-layout) .app-card-footer button,
  html.mobile-layout .app-card-footer a,
  html.mobile-layout .app-card-footer button {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  /* Mobile Modals (R2) */
  html:not(.desktop-layout) .magnet-modal,
  html.mobile-layout .magnet-modal {
    width: 95% !important;
    max-width: 480px !important;
    padding: 18px 14px !important;
  }

  html:not(.desktop-layout) .magnet-close,
  html.mobile-layout .magnet-close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html:not(.desktop-layout) .magnet-target-label,
  html.mobile-layout .magnet-target-label {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
  }

  html:not(.desktop-layout) .magnet-submit-btn,
  html.mobile-layout .magnet-submit-btn {
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Terminal Console Fullscreen on Mobile (R2) */
  html:not(.desktop-layout) .agy-modal-overlay,
  html.mobile-layout .agy-modal-overlay {
    padding: 0 !important;
  }

  html:not(.desktop-layout) .agy-console-window,
  html.mobile-layout .agy-console-window {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
  }

  html:not(.desktop-layout) .agy-console-header,
  html.mobile-layout .agy-console-header {
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) .agy-console-header-actions,
  html.mobile-layout .agy-console-header-actions {
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }

  html:not(.desktop-layout) .btn-console-act,
  html.mobile-layout .btn-console-act {
    min-height: 44px !important;
    padding: 8px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .quick-chip,
  html.mobile-layout .quick-chip {
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html:not(.desktop-layout) .agy-quick-chips,
  html.mobile-layout .agy-quick-chips {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 10px 12px !important;
  }

  html:not(.desktop-layout) .agy-console-input-bar,
  html.mobile-layout .agy-console-input-bar {
    padding: 10px 12px !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) .agy-modal-input,
  html.mobile-layout .agy-modal-input {
    min-height: 44px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .agy-send-btn,
  html.mobile-layout .agy-send-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 10px 16px !important;
  }

  /* Terminal Daemon Tabs & SSO Gate (R1, R2) */
  html:not(.desktop-layout) .terminal-tabs,
  html.mobile-layout .terminal-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    max-width: 100% !important;
    padding: 6px 12px !important;
    gap: 8px !important;
  }

  html:not(.desktop-layout) .terminal-tab,
  html.mobile-layout .terminal-tab {
    min-height: 44px !important;
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  html:not(.desktop-layout) .agy-window-controls,
  html.mobile-layout .agy-window-controls {
    display: none !important;
  }

  html:not(.desktop-layout) .sso-pin-input,
  html.mobile-layout .sso-pin-input {
    min-height: 44px !important;
    font-size: 0.9rem !important;
    box-sizing: border-box !important;
  }

  /* Changelog Modal */
  html:not(.desktop-layout) .changelog-modal,
  html.mobile-layout .changelog-modal {
    width: 95% !important;
    max-height: 85vh !important;
    border-radius: 12px !important;
  }

  html:not(.desktop-layout) .changelog-close,
  html.mobile-layout .changelog-close {
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html:not(.desktop-layout) .changelog-body,
  html.mobile-layout .changelog-body {
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 16px !important;
  }

  /* Footer Controls & Layout Switcher */
  html:not(.desktop-layout) .footer-container,
  html.mobile-layout .footer-container {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 14px !important;
  }

  html:not(.desktop-layout) .footer-meta,
  html.mobile-layout .footer-meta {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 12px !important;
  }

  html:not(.desktop-layout) .version-badge-btn,
  html.mobile-layout .version-badge-btn,
  html:not(.desktop-layout) .footer-loc-badge,
  html.mobile-layout .footer-loc-badge {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  html:not(.desktop-layout) .footer-links a,
  html.mobile-layout .footer-links a {
    min-height: 44px !important;
    padding: 10px 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Touch feedback for tactile feel */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
  button:active,
  a.btn:active,
  a.btn-nav:active,
  a.btn-secondary:active,
  a.pill-btn:active,
  .btn-control:active,
  .quick-chip:active,
  .quick-drop-btn:active,
  .dropdown-item:active,
  .btn-action-item:active,
  .magnet-submit-btn:active,
  .layout-toggle-btn:active {
    transform: scale(0.97) !important;
    filter: brightness(1.2) !important;
    transition: transform 0.08s ease, filter 0.08s ease !important;
  }
}

/* ==========================================================================
   Mobile fixes found by exact-width (360/390/430px) browser testing
   ========================================================================== */
html:not(.desktop-layout) .terminal-sso-gate > div,
html:not(.desktop-layout) .modal-sso-gate > div,
html.mobile-layout .terminal-sso-gate > div,
html.mobile-layout .modal-sso-gate > div {
  width: 100%;
  max-width: 100% !important;
  min-width: 0;
}

html:not(.desktop-layout) .terminal-sso-gate > div > div,
html:not(.desktop-layout) .modal-sso-gate > div > div,
html.mobile-layout .terminal-sso-gate > div > div,
html.mobile-layout .modal-sso-gate > div > div {
  max-width: 100% !important;
  flex-wrap: wrap;
}

html:not(.desktop-layout) .sso-badge-row,
html.mobile-layout .sso-badge-row {
  flex-wrap: wrap;
  justify-content: center;
}

html:not(.desktop-layout) .sso-badge-tag,
html.mobile-layout .sso-badge-tag {
  white-space: normal;
  text-align: center;
}

html:not(.desktop-layout) .terminal-sso-gate .sso-pin-input,
html:not(.desktop-layout) .modal-sso-gate .sso-pin-input,
html.mobile-layout .terminal-sso-gate .sso-pin-input,
html.mobile-layout .modal-sso-gate .sso-pin-input {
  flex: 1 1 100% !important;
  min-width: 0;
}

html:not(.desktop-layout) .terminal-sso-gate .btn,
html:not(.desktop-layout) .terminal-sso-gate .btn-nav,
html:not(.desktop-layout) .modal-sso-gate .btn,
html:not(.desktop-layout) .modal-sso-gate .btn-nav,
html:not(.desktop-layout) #btn-probe-now,
html.mobile-layout .terminal-sso-gate .btn,
html.mobile-layout .terminal-sso-gate .btn-nav,
html.mobile-layout .modal-sso-gate .btn,
html.mobile-layout .modal-sso-gate .btn-nav,
html.mobile-layout #btn-probe-now {
  min-height: 44px;
  flex: 1 1 auto;
}

/* Prompt bar and chips on mobile when unlocked */
html:not(.desktop-layout) .agy-remote-prompt-bar,
html.mobile-layout .agy-remote-prompt-bar {
  flex-direction: column !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

html:not(.desktop-layout) .agy-remote-prompt-bar input,
html.mobile-layout .agy-remote-prompt-bar input {
  min-height: 44px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

html:not(.desktop-layout) .agy-remote-prompt-bar .btn-nav,
html.mobile-layout .agy-remote-prompt-bar .btn-nav {
  min-height: 44px !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: normal !important;
  text-align: center !important;
  padding: 10px 12px !important;
}

html:not(.desktop-layout) .agy-inline-chips,
html.mobile-layout .agy-inline-chips {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  flex-wrap: nowrap !important;
  max-width: 100% !important;
  padding: 6px 2px !important;
}

/* ==========================================================================
    Homelab Disaster Recovery & Resilience Test
   ========================================================================== */
.disaster-modal-overlay,
.chaos-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.94);
  z-index: 10005;
  display: none !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.disaster-modal-overlay.active,
.chaos-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
}

.disaster-modal-window,
.chaos-modal-window {
  background: #090d16;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 16px;
  width: 95%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.22);
  overflow: hidden;
  animation: chaosPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.disaster-test-btn,
.chaos-lab-btn {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  color: #fde68a !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.pill-disaster,
.pill-chaos {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.22) !important;
  color: #fde68a !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.28) !important;
}

@keyframes chaosPop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.chaos-modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chaos-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Status Bar & Score */
.chaos-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.chaos-score-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.chaos-score-val {
  font-size: 1.6rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: -0.5px;
  transition: color 0.3s ease;
}

.chaos-score-val.warning {
  color: #fbbf24;
}

.chaos-score-val.critical {
  color: #f87171;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
  animation: pulseCrit 1s infinite alternate;
}

@keyframes pulseCrit {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

.chaos-actions-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-chaos-action {
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-chaos-sound {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.btn-chaos-sound.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-chaos-heal {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid #10b981;
  color: #a7f3d0;
}

.btn-chaos-heal:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.4);
}

/* Interactive Topology Map */
.chaos-topology-box {
  background: rgba(10, 15, 29, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.chaos-topology-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.chaos-grid-nodes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  position: relative;
  z-index: 2;
}

.chaos-node {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.chaos-node.node-ok {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.08);
}

.chaos-node.node-fault {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.15) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.45) !important;
  animation: shakeNode 0.5s ease-in-out infinite alternate;
}

.chaos-node.node-rerouted {
  border-color: #f59e0b !important;
  background: rgba(245, 158, 11, 0.15) !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35) !important;
}

@keyframes shakeNode {
  0% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
  100% { transform: translateY(1px); }
}

.chaos-node-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.chaos-node-name {
  font-size: 0.76rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.chaos-node-status {
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 5px;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
}

.chaos-node-status.ok {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.chaos-node-status.fault {
  background: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.chaos-node-status.warn {
  background: rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

/* Chaos Injection Controls Cards */
.chaos-arsenal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.chaos-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s, background 0.2s;
}

.chaos-card.active-fault {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.chaos-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #f1f5f9;
}

.chaos-card-desc {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

.chaos-card-trigger {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.chaos-card-trigger:hover {
  background: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

.chaos-card-trigger.btn-recovering {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #6ee7b7;
}

.chaos-card-trigger.btn-recovering:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

/* Chaos Live Streaming Console */
.chaos-console-box {
  background: #050811;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.chaos-console-header {
  background: rgba(15, 23, 42, 0.9);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chaos-console-feed {
  height: 125px;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.74rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chaos-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.chaos-line.sys { color: #64748b; }
.chaos-line.fault { color: #f87171; font-weight: 600; }
.chaos-line.heal { color: #34d399; font-weight: 600; }
.chaos-line.info { color: #38bdf8; }
.chaos-line.warn { color: #fbbf24; }

/* ========================================================
   NUC 24/7 EXTENDED MICROSERVICES & TELEMETRY SUITE
   ======================================================== */
.nuc-services-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.nuc-tabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}

.nuc-tab-btn {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.nuc-tab-btn:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  color: #f1f5f9;
}

.nuc-tab-btn.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
}

.nuc-pane {
  display: none;
  animation: fadeInPane 0.25s ease-out;
}

.nuc-pane.active {
  display: block;
}

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

.kpi-row-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-mini-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.kpi-mini-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #38bdf8;
  opacity: 0.7;
}

.kpi-mini-card.success::before { background: #10b981; }
.kpi-mini-card.purple::before { background: #a855f7; }
.kpi-mini-card.amber::before { background: #f59e0b; }

.kpi-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
}

.kpi-sub {
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Speedtest Card & Gauge */
.speedtest-hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 24px;
  position: relative;
}

.speedtest-sso-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.speedtest-gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
}

.speed-dial-meter {
  position: relative;
  width: 220px;
  height: 110px;
  overflow: hidden;
}

.speed-dial-bg {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 14px solid rgba(255, 255, 255, 0.08);
  border-top-color: #38bdf8;
  border-left-color: #10b981;
  transform: rotate(-45deg);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.speed-dial-center {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

/* DNS Feed Ticker */
.dns-threat-box {
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
}

.dns-threat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  max-height: 240px;
  overflow-y: auto;
}

.dns-threat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Edge AI Terminal Box */
.edge-ai-box {
  background: #050811;
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

/* Consolidated Ops & AI Section Grid */
.ops-ai-section {
  padding: 50px 0 60px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.ops-ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.ops-ai-grid .terminal-window,
.ops-ai-grid .edge-ai-box {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ops-ai-grid .terminal-body {
  flex: 1;
  min-height: 220px;
}

.ops-ai-grid .edge-ai-output {
  flex: 1;
  min-height: 190px;
  max-height: 320px;
}

@media (max-width: 1024px) {
  .ops-ai-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.edge-ai-header {
  background: rgba(88, 28, 135, 0.25);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(168, 85, 247, 0.2);
}

.edge-ai-output {
  padding: 18px;
  min-height: 140px;
  max-height: 260px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.edge-ai-chips {
  display: flex;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(15, 23, 42, 0.6);
  overflow-x: auto;
}

.edge-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
}

.edge-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #a855f7;
  color: #e9d5ff;
}

.edge-ai-input-bar {
  display: flex;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  gap: 10px;
}

.edge-ai-input {
  flex: 1;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 14px;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
}

/* Bookshelf Grid */
.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.book-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.book-card:hover {
  transform: translateY(-3px);
  border-color: rgba(167, 139, 250, 0.5);
}

.book-cover {
  height: 120px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.book-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* IoT Power & Temperature Grid */
.iot-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.iot-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Kuma Table */
.kuma-matrix-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.kuma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.kuma-table th {
  background: rgba(2, 6, 23, 0.8);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.kuma-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.kuma-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Speedtest SSO Protected Modal */
.speedtest-sso-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 23, 0.94);
  z-index: 10006;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.speedtest-sso-modal-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.speedtest-sso-modal {
  background: #090d16;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
  overflow: hidden;
  animation: modalScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Penny's Cat Hub (Stream & Smart Feeder IoT Side-by-Side) */
.penny-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 20px;
  align-items: stretch;
}

.penny-hub-stream-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.penny-hub-feeder-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 992px) {
  .penny-hub-grid {
    grid-template-columns: 1fr;
  }
}

html.mobile-layout .penny-hub-grid {
  grid-template-columns: 1fr !important;
}



/* Floating Back to Top Button */
.btn-floating-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.9);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 10px rgba(59, 130, 246, 0.2);
}

.btn-floating-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.btn-floating-top:hover {
  background: rgba(30, 58, 138, 0.95);
  border-color: #93c5fd;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 6px 20px rgba(0, 0, 0, 0.6);
  transform: translateY(-3px) scale(1.05);
}

.btn-floating-top:active {
  transform: translateY(0) scale(0.95);
}

@media (max-width: 768px) {
  .btn-floating-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
}


/* Service Status Dashboard Styles */
.service-status-dashboard {
  background: rgba(13, 19, 33, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px 20px;
}

.dash-filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.dash-filter-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.dash-filter-btn:hover {
  border-color: #38bdf8;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  transform: translateY(-1px);
}

.dash-filter-btn.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.dash-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.dash-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.dash-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dash-card.hidden {
  display: none !important;
}

.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.dash-card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
  flex-shrink: 0;
}

.dash-card-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #f8fafc;
  line-height: 1.2;
}

.dash-card-port {
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

.dash-card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.76rem;
  color: #94a3b8;
  padding: 8px 10px;
  background: rgba(2, 6, 23, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dash-card-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-schematic-chip,
a.btn-schematic-chip {
  text-decoration: none !important;
}

.dash-btn-action {
  font-family: inherit;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  color: #38bdf8 !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  transition: all 0.2s ease !important;
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 8px !important;
  padding: 5px 12px !important;
  cursor: pointer !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
}

.dash-btn-action:hover {
  background: rgba(56, 189, 248, 0.22) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
  text-decoration: none !important;
  transform: translateY(-1px) !important;
}

.dash-btn-action:active {
  transform: translateY(0) scale(0.97) !important;
}

@media (max-width: 768px) {
  .dash-service-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SUBPAGE NAVIGATION & CATEGORY MODULES (v2.8.8)
   ========================================================================== */
.btn-nav.active,
.btn-nav.active-page {
  background: rgba(56, 189, 248, 0.22) !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35) !important;
  font-weight: 700 !important;
}

.subpage-hero {
  padding: 40px 0 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 30px;
}

.subpage-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #38bdf8;
  margin-bottom: 14px;
}

.subpage-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.subpage-subtitle {
  font-size: 0.98rem;
  color: #94a3b8;
  max-width: 780px;
  margin: 0;
  line-height: 1.6;
}

.category-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 28px;
  margin-bottom: 28px;
}

.category-nav-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.category-nav-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(56, 189, 248, 0.15);
  background: rgba(15, 23, 42, 0.9);
}

.category-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.category-nav-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
}

.category-nav-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-nav-desc {
  font-size: 0.84rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 16px;
}

.category-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #38bdf8;
}
/* ==========================================================================
   NAVIGATION SEPARATION & TOOLS GROUPING (v2.8.10)
   ========================================================================== */
.nav-links {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.nav-pages-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 8px;
  flex-shrink: 0;
}

.nav-tools-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 6px;
  border-radius: 10px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-tools-group .dropdown > .btn-nav {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0 !important;
  font-size: 0.82rem;
  padding: 6px 12px;
  height: 34px;
}

.nav-tools-group .dropdown > .btn-nav:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: #60a5fa;
  color: #ffffff !important;
}

/* Mobile & Responsive Support */
@media (max-width: 1100px) {
  .nav-tools-group {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
  }
  .nav-divider {
    display: none;
  }
}

html.mobile-layout .nav-pages-group,
html.mobile-layout .nav-tools-group {
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

html.mobile-layout .nav-pages-group > .btn-nav,
html.mobile-layout .nav-tools-group .dropdown,
html.mobile-layout .nav-tools-group .dropdown > .btn-nav {
  width: 100% !important;
  min-height: 44px !important;
}


/* ==========================================================================
   TARGET NODE PILL SELECTOR & POWER ACTION CONTROLS (v2.8.20)
   ========================================================================== */
.target-node-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: transparent;
  padding: 0;
  border: none;
}

.btn-node-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 16px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  line-height: 1.4 !important;
  color: #94a3b8 !important;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-node-pill:hover {
  color: #ffffff !important;
  background: rgba(30, 41, 59, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

.btn-node-pill#btn-target-desktop.active {
  color: #e0f2fe !important;
  background: rgba(56, 189, 248, 0.16) !important;
  border: 1px solid #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35) !important;
}

.btn-node-pill#btn-target-desktop .dropdown-dot.dot-1 {
  background-color: #38bdf8 !important;
  box-shadow: 0 0 8px #38bdf8 !important;
}

.btn-node-pill#btn-target-nuc.active {
  color: #d1fae5 !important;
  background: rgba(16, 185, 129, 0.16) !important;
  border: 1px solid #10b981 !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35) !important;
}

.btn-node-pill#btn-target-nuc .dropdown-dot.dot-2 {
  background-color: #10b981 !important;
  box-shadow: 0 0 8px #10b981 !important;
}

.node-state-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 16px !important;
  min-height: 38px !important;
  border-radius: 8px !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  color: #cbd5e1 !important;
  font-family: inherit !important;
  line-height: 1.4 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.node-state-pill:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.node-state-pill.target-desktop {
  color: #e0f2fe !important;
  border: 1px solid rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(56, 189, 248, 0.2) !important;
}

.node-state-pill.target-desktop:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 16px rgba(56, 189, 248, 0.35) !important;
}

.node-state-pill.target-nuc {
  color: #d1fae5 !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(16, 185, 129, 0.2) !important;
}

.node-state-pill.target-nuc:hover {
  border-color: #10b981 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), 0 0 16px rgba(16, 185, 129, 0.35) !important;
}

/* ==========================================================================
   CONSOLIDATED NODE HARDWARE DECKS (NUC & DESKTOP)
   ========================================================================== */
.node-decks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 28px;
  margin-top: 24px;
  margin-bottom: 32px;
}

.node-deck-card {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s, box-shadow 0.2s;
}

.node-deck-card:hover {
  transform: translateY(-2px);
}

.node-deck-card.nuc-deck {
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.node-deck-card.nuc-deck:hover {
  border-color: rgba(16, 185, 129, 0.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(16, 185, 129, 0.18);
}

.node-deck-card.desktop-deck {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05) 0%, rgba(15, 23, 42, 0.85) 100%);
}

.node-deck-card.desktop-deck:hover {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(56, 189, 248, 0.18);
}

.node-deck-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.node-metric-subcard {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 148px;
  box-sizing: border-box;
}

html:not(.desktop-layout) .node-deck-metrics,
html.mobile-layout .node-deck-metrics {
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}

html:not(.desktop-layout) .node-decks-grid,
html.mobile-layout .node-decks-grid {
  grid-template-columns: 1fr !important;
  gap: 24px !important;
  margin-top: 20px !important;
  margin-bottom: 24px !important;
}

.btn-control-icon {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.btn-control-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.25;
}

.btn-control-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: inherit;
}

.btn-control-sub {
  font-size: 0.72rem;
  opacity: 0.78;
  font-weight: 500;
}

.btn-control.action-wake {
  background: rgba(34, 197, 94, 0.14) !important;
  border-color: rgba(34, 197, 94, 0.4) !important;
  color: #86efac !important;
}

.btn-control.action-wake:hover {
  background: rgba(34, 197, 94, 0.26) !important;
  border-color: #22c55e !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.4) !important;
  transform: translateY(-2px);
}

.btn-control.action-sleep {
  background: rgba(99, 102, 241, 0.14) !important;
  border-color: rgba(99, 102, 241, 0.4) !important;
  color: #a5b4fc !important;
}

.btn-control.action-sleep:hover {
  background: rgba(99, 102, 241, 0.26) !important;
  border-color: #6366f1 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4) !important;
  transform: translateY(-2px);
}

.btn-control.action-reboot {
  background: rgba(239, 68, 68, 0.14) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #fca5a5 !important;
}

.btn-control.action-reboot:hover {
  background: rgba(239, 68, 68, 0.26) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
  transform: translateY(-2px);
}

.btn-control.action-broadcast {
  background: rgba(168, 85, 247, 0.14) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
  color: #d8b4fe !important;
}

.btn-control.action-broadcast:hover {
  background: rgba(168, 85, 247, 0.26) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.4) !important;
  transform: translateY(-2px);
}


/* Universal Inline Check / Retry Button for Telemetry & Null Metrics */
.btn-check-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
  vertical-align: middle;
  margin-left: 4px;
}

.btn-check-inline:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

.btn-check-inline.checking {
  opacity: 0.7;
  cursor: wait;
}

.btn-check-inline.checking .check-icon {
  animation: spin 0.8s linear infinite;
}

.btn-check-inline .check-icon {
  font-size: 0.75rem;
  display: inline-block;
  transition: transform 0.4s ease;
}

.btn-check-inline:hover .check-icon {
  transform: rotate(180deg);
}
