/* =========================================================================
   bmsgo.life — Modern High-Energy & Professional Theme (modern-home.css v5)
   Full Mobile Icons, Mobile Bottom App Bar, Desktop Icons, Formal Typography
   ========================================================================= */

:root {
  --mh-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Leelawadee UI", "Thonburi", "Sukhumvit Set", "Inter", Roboto, sans-serif;
  --mh-mono: "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --mh-emerald: #10b981;
  --mh-emerald-dark: #047857;
  --mh-cyan: #06b6d4;
  --mh-cyan-dark: #0284c7;
  --mh-violet: #8b5cf6;
  --mh-violet-dark: #6d28d9;
  --mh-amber: #f59e0b;
  --mh-amber-dark: #b45309;
}

/* Eradicate sidebar width across the entire website */
:root {
  --sidebar-w: 0px !important;
}

/* Hide legacy sidebar elements on all pages */
#sidebar,
#backdrop,
.sidebar,
.sidebar-backdrop,
.topbar {
  display: none !important;
}

/* #topnav acts as top header container across all pages */
#topnav {
  display: block !important;
  margin-left: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  width: 100% !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
}

/* Full Width High-Density Layout (Comfortable Spacing & Maximized Content Space) */
.wrap,
.modern-home-wrap {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 1.25rem 1.75rem 3rem !important;
  box-sizing: border-box !important;
}

@media (max-width: 1200px) {
  .wrap,
  .modern-home-wrap {
    padding: 1rem 1.25rem 2.5rem !important;
  }
}

@media (max-width: 768px) {
  .wrap,
  .modern-home-wrap {
    padding: 0.75rem 0.85rem calc(70px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

@media (max-width: 480px) {
  .wrap,
  .modern-home-wrap {
    padding: 0.65rem 0.75rem calc(65px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

body {
  font-family: var(--mh-font) !important;
  background: var(--mh-bg, #0b1120) !important;
  color: var(--mh-text-main, #0f172a) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   LIGHT THEME (Default)
   ========================================================================= */
:root,
html:not([data-ui-theme="dark"]):not([data-theme="dark"]) body,
html[data-ui-theme="paper"] body,
html[data-ui-theme="light"] body {
  --mh-bg: #f3f6f9;
  --mh-bg-glow1: radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.12), transparent 45%);
  --mh-bg-glow2: radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.14), transparent 50%);
  --mh-bg-glow3: radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.08), transparent 45%);

  --mh-topbar-bg: rgba(255, 255, 255, 0.94);
  --mh-topbar-border: #e2e8f0;

  --mh-card-bg: #ffffff;
  --mh-card-surface: #f8fafc;
  --mh-card-border: #e2e8f0;
  --mh-card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --mh-card-hover-shadow: 0 20px 35px -5px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(16, 185, 129, 0.15);

  --mh-text-main: #0f172a;
  --mh-text-muted: #475569;
  --mh-text-faint: #64748b;

  --mh-badge-bg: rgba(16, 185, 129, 0.12);
  --mh-badge-text: #065f46;

  --mh-btn-primary-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --mh-btn-primary-shadow: 0 6px 20px rgba(16, 185, 129, 0.38);
  --mh-btn-primary-hover-shadow: 0 10px 28px rgba(16, 185, 129, 0.55);

  --mh-mobile-nav-bg: rgba(255, 255, 255, 0.96);
}

/* =========================================================================
   DARK THEME (True OLED / Cyber Dark across the entire site)
   ========================================================================= */
html[data-ui-theme="dark"],
html[data-theme="dark"],
html.dark-mode,
html[data-ui-theme="dark"] body,
html[data-theme="dark"] body,
body[data-ui-theme="dark"],
body[data-theme="dark"],
body.dark-mode {
  color-scheme: dark !important;

  /* Universal legacy palette variables overridden for complete site harmony */
  --canvas: #070d18 !important;
  --paper: #0f172a !important;
  --surface: #1e293b !important;
  --surface2: #334155 !important;
  --line: rgba(255, 255, 255, 0.12) !important;
  --line2: rgba(255, 255, 255, 0.18) !important;
  --ink: #f8fafc !important;
  --brand: #f8fafc !important;
  --brand2: #38bdf8 !important;
  --accent: #10b981 !important;
  --accent-ink: #ffffff !important;
  --mint: #064e3b !important;
  --muted: #94a3b8 !important;

  --mh-bg: #070d18 !important;
  --mh-bg-glow1: radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.18), transparent 50%) !important;
  --mh-bg-glow2: radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.20), transparent 55%) !important;
  --mh-bg-glow3: radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.12), transparent 50%) !important;

  --mh-topbar-bg: rgba(7, 13, 24, 0.96) !important;
  --mh-topbar-border: rgba(255, 255, 255, 0.1) !important;

  --mh-card-bg: #0f172a !important;
  --mh-card-surface: #1e293b !important;
  --mh-card-border: rgba(255, 255, 255, 0.12) !important;
  --mh-card-shadow: 0 8px 30px rgba(0, 0, 0, 0.6) !important;
  --mh-card-hover-shadow: 0 20px 40px rgba(16, 185, 129, 0.25) !important;

  --mh-text-main: #f8fafc !important;
  --mh-text-muted: #cbd5e1 !important;
  --mh-text-faint: #94a3b8 !important;

  --mh-badge-bg: rgba(16, 185, 129, 0.2) !important;
  --mh-badge-text: #34d399 !important;

  --mh-btn-primary-bg: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  --mh-btn-primary-shadow: 0 6px 22px rgba(16, 185, 129, 0.45) !important;
  --mh-btn-primary-hover-shadow: 0 12px 32px rgba(16, 185, 129, 0.65) !important;

  --mh-mobile-nav-bg: rgba(11, 17, 32, 0.98) !important;
}

.modern-home-wrap {
  position: relative;
  background-image: var(--mh-bg-glow1), var(--mh-bg-glow2), var(--mh-bg-glow3);
  background-repeat: no-repeat;
}

/* =========================================================================
   TOP NAVIGATION BAR (With Icons on Desktop and Mobile)
   ========================================================================= */
.mh-top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--mh-topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--mh-topbar-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.mh-nav-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0.5rem 1.25rem !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box !important;
}

@media (max-width: 1200px) {
  .mh-nav-container {
    padding: 0.5rem 1rem !important;
  }
}

@media (max-width: 768px) {
  .mh-nav-container {
    padding: 0.4rem 0.5rem !important;
  }
}

.mh-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--mh-text-main);
}

.mh-brand-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.mh-brand-icon-box svg {
  width: 21px;
  height: 21px;
}

.mh-brand-text {
  font-weight: 800;
}

.mh-brand-text span {
  color: #10b981;
}

/* Desktop Horizontal Nav Links WITH ICONS */
.mh-nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.04);
  padding: 0.35rem 0.5rem;
  border-radius: 14px;
}

html[data-ui-theme="dark"] .mh-nav-links,
[data-theme="dark"] .mh-nav-links {
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 880px) {
  .mh-nav-links { display: none; }
}

.mh-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--mh-text-muted);
  text-decoration: none;
  border-radius: 10px;
  transition: all 0.22s ease;
}

.mh-nav-link .nav-ic {
  width: 17px;
  height: 17px;
  opacity: 0.85;
}

.mh-nav-link:hover {
  color: var(--mh-text-main);
  background: rgba(16, 185, 129, 0.12);
}

.mh-nav-link:hover .nav-ic {
  opacity: 1;
  transform: scale(1.1);
}

.mh-nav-link.active {
  color: #ffffff;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.mh-nav-link.active .nav-ic {
  opacity: 1;
}

.mh-nav-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.mh-nav-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
  transition: all 0.2s ease;
}

.mh-nav-status-chip:hover {
  background: rgba(16, 185, 129, 0.22);
  transform: translateY(-1px);
}

.mh-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: mhPulse 1.8s infinite ease-in-out;
}

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

.mh-theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mh-card-bg);
  border: 1px solid var(--mh-card-border);
  color: var(--mh-text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--mh-card-shadow);
  transition: all 0.22s ease;
}

.mh-theme-toggle-btn:hover {
  color: #10b981;
  border-color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25);
}

.mh-nav-mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--mh-card-bg);
  border: 1.5px solid var(--mh-card-border);
  color: var(--mh-text-main);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--mh-card-shadow);
}

@media (max-width: 880px) {
  .mh-nav-mobile-toggle { display: inline-flex; }
}

/* =========================================================================
   MOBILE TOP MENU (Rich Icons & Cards on Phone)
   ========================================================================= */
.mh-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--mh-mobile-nav-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-bottom: 2px solid var(--mh-topbar-border);
  padding: 1rem 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: all 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.mh-mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mh-mobile-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--mh-card-surface);
  border: 1px solid var(--mh-card-border);
  border-radius: 16px;
  text-decoration: none;
  color: var(--mh-text-main);
  transition: all 0.2s ease;
}

.mh-mobile-item:active, .mh-mobile-item:hover {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
  transform: translateX(3px);
}

.mh-mobile-item.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.15);
}

.mh-mobile-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.mh-mobile-icon-box.green { background: linear-gradient(135deg, #10b981, #059669); }
.mh-mobile-icon-box.cyan  { background: linear-gradient(135deg, #06b6d4, #0284c7); }
.mh-mobile-icon-box.violet{ background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.mh-mobile-icon-box.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.mh-mobile-icon-box.blue  { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }

.mh-mobile-icon-box svg {
  width: 22px;
  height: 22px;
}

.mh-mobile-text {
  flex: 1;
}

.mh-mobile-text b {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mh-text-main);
  margin-bottom: 0.15rem;
}

.mh-mobile-text small {
  display: block;
  font-size: 0.8rem;
  color: var(--mh-text-muted);
}

.mh-mobile-arrow {
  color: var(--mh-text-faint);
  font-size: 1.1rem;
  font-weight: 700;
}

/* =========================================================================
   MOBILE BOTTOM BAR (App-like navigation on Phones)
   ========================================================================= */
.mh-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .mh-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--mh-mobile-nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1.5px solid var(--mh-topbar-border);
    padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
  }

  .mh-bottom-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
    color: var(--mh-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.35rem 0.5rem;
    border-radius: 10px;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    cursor: pointer;
    background: transparent;
    border: 0;
  }

  .mh-bottom-tab svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
  }

  .mh-bottom-tab:hover, .mh-bottom-tab.active {
    color: #10b981;
  }

  .mh-bottom-tab.active svg {
    transform: scale(1.12);
    color: #10b981;
  }
}

/* =========================================================================
   HERO SECTION
   ========================================================================= */
.mh-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.75rem;
  align-items: center;
  padding: 1.25rem 0 1.5rem;
}

@media (max-width: 960px) {
  .mh-hero {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.65rem 0 1rem;
  }
}

.mh-kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--mh-badge-bg);
  color: var(--mh-badge-text);
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.12);
  margin-bottom: 0.65rem;
}

.mh-hero-title {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  color: var(--mh-text-main);
  margin: 0 0 0.65rem;
}

.mh-hero-title span.highlight {
  background: linear-gradient(135deg, #10b981 10%, #06b6d4 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.25));
}

.mh-hero-subtitle {
  font-size: 0.98rem;
  line-height: 1.58;
  color: var(--mh-text-muted);
  margin: 0 0 1.15rem;
  max-width: 640px;
}

.mh-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.mh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 11px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.25s ease;
}

.mh-btn:active {
  transform: translateY(1px) scale(0.98) !important;
}

.mh-btn-primary {
  background: var(--mh-btn-primary-bg);
  color: #ffffff !important;
  box-shadow: var(--mh-btn-primary-shadow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.mh-btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--mh-btn-primary-hover-shadow);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.mh-btn-outline {
  background: var(--mh-card-bg);
  color: var(--mh-text-main) !important;
  border: 2px solid var(--mh-card-border);
  box-shadow: var(--mh-card-shadow);
}

.mh-btn-outline:hover {
  transform: translateY(-3px);
  border-color: #10b981;
  color: #10b981 !important;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.18);
}

/* =========================================================================
   CANVAS TELEMETRY WIDGET
   ========================================================================= */
/* =========================================================================
   CANVAS TELEMETRY WIDGET
   ========================================================================= */
.mh-hero-widget {
  background: var(--mh-card-bg);
  border: 1.5px solid var(--mh-card-border);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: var(--mh-card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

@media (max-width: 768px) {
  .mh-hero-widget {
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
  }
}

.mh-hero-widget:hover {
  transform: translateY(-3px);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: var(--mh-card-hover-shadow);
}

.mh-hero-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981, #06b6d4, #8b5cf6);
}

.mh-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mh-widget-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mh-battery-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(6, 182, 212, 0.12));
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
}

.mh-widget-meta span {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mh-text-faint);
}

.mh-widget-meta b {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.05;
  color: #10b981;
  letter-spacing: -0.02em;
}

.mh-widget-readings {
  display: flex;
  gap: 0.5rem;
}

.mh-reading-pill {
  padding: 0.35rem 0.65rem;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.mh-reading-pill.volt {
  background: rgba(6, 182, 212, 0.12);
  color: #0284c7;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

html[data-ui-theme="dark"] .mh-reading-pill.volt,
[data-theme="dark"] .mh-reading-pill.volt {
  color: #38bdf8;
}

.mh-reading-pill.temp {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

html[data-ui-theme="dark"] .mh-reading-pill.temp,
[data-theme="dark"] .mh-reading-pill.temp {
  color: #fbbf24;
}

.mh-reading-pill small {
  font-weight: 500;
  opacity: 0.75;
}

.mh-widget-chart-wrap {
  position: relative;
  width: 100%;
  height: 85px;
  margin: 0.65rem 0 0.35rem;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

html[data-ui-theme="dark"] .mh-widget-chart-wrap,
[data-theme="dark"] .mh-widget-chart-wrap {
  background: rgba(0, 0, 0, 0.3);
}

#mh-live-chart {
  width: 100%;
  height: 100%;
  display: block;
}

.mh-widget-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mh-text-faint);
  padding: 0 0.4rem;
  font-family: var(--mh-mono);
}

.mh-widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--mh-card-border);
  font-size: 0.8rem;
  color: var(--mh-text-muted);
}

.mh-widget-stats-live {
  font-weight: 700;
  color: var(--mh-text-main);
}

.mh-widget-stats-live strong {
  color: #10b981;
}

/* =========================================================================
   3 VIBRANT QUICK HUB CARDS
   ========================================================================= */
.mh-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0.85rem 0 2rem;
}

@media (max-width: 860px) {
  .mh-quick-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0.65rem 0 1.25rem;
  }
}

.mh-quick-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--mh-card-bg);
  border: 1.5px solid var(--mh-card-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--mh-text-main);
  box-shadow: var(--mh-card-shadow);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.24s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.mh-quick-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: currentColor;
}

.mh-quick-card.card-bms { color: #10b981; }
.mh-quick-card.card-bms:hover {
  border-color: #10b981;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.2);
}

.mh-quick-card.card-inv { color: #06b6d4; }
.mh-quick-card.card-inv:hover {
  border-color: #06b6d4;
  box-shadow: 0 10px 25px rgba(6, 182, 212, 0.2);
}

.mh-quick-card.card-sys { color: #8b5cf6; }
.mh-quick-card.card-sys:hover {
  border-color: #8b5cf6;
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

.mh-quick-card:hover { transform: translateY(-2px); }

.mh-quick-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.card-bms .mh-quick-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
}

.card-inv .mh-quick-icon {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #ffffff;
}

.card-sys .mh-quick-icon {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #ffffff;
}

.mh-quick-icon svg {
  width: 22px;
  height: 22px;
}

.mh-quick-info { flex: 1; }

.mh-quick-info h3 {
  font-size: 0.96rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--mh-text-main);
}

.mh-quick-info .mh-count {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
  color: inherit;
  letter-spacing: -0.02em;
}

.mh-quick-info p {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--mh-text-muted);
  margin: 0.15rem 0 0;
}

.mh-quick-arrow-box {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mh-text-muted);
  font-size: 0.85rem;
  transition: all 0.22s ease;
}

html[data-ui-theme="dark"] .mh-quick-arrow-box,
[data-theme="dark"] .mh-quick-arrow-box {
  background: rgba(255, 255, 255, 0.08);
}

.mh-quick-card:hover .mh-quick-arrow-box {
  background: currentColor;
  color: #ffffff;
  transform: translateX(4px);
}

/* =========================================================================
   3-STEP ONBOARDING
   ========================================================================= */
.mh-section {
  margin-bottom: 4.5rem;
}

.mh-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.mh-section-head h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mh-text-main);
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}

.mh-section-head p {
  font-size: 1rem;
  color: var(--mh-text-muted);
  margin: 0;
}

.mh-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 860px) {
  .mh-steps-grid { grid-template-columns: 1fr; }
}

.mh-step-card {
  background: var(--mh-card-bg);
  border: 1.5px solid var(--mh-card-border);
  border-radius: 22px;
  padding: 1.85rem;
  box-shadow: var(--mh-card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s ease, border-color 0.25s ease;
  position: relative;
}

.mh-step-card:hover {
  transform: translateY(-4px);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: var(--mh-card-hover-shadow);
}

.mh-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1.35rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.step-1 .mh-step-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.step-2 .mh-step-badge {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.4);
}

.step-3 .mh-step-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.mh-step-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--mh-text-main);
  margin: 0 0 0.65rem;
}

.mh-step-card p {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--mh-text-muted);
  margin: 0 0 1.5rem;
  flex: 1;
}

.mh-step-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: auto;
}

.mh-step-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 11px;
  text-decoration: none;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.mh-step-btn:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

.mh-step-btn.secondary {
  background: rgba(15, 23, 42, 0.05);
  color: var(--mh-text-main);
  border-color: var(--mh-card-border);
}

html[data-ui-theme="dark"] .mh-step-btn.secondary,
[data-theme="dark"] .mh-step-btn.secondary {
  background: rgba(255, 255, 255, 0.07);
}

.mh-step-btn.secondary:hover {
  border-color: #10b981;
  color: #10b981;
  transform: translateY(-2px);
}

/* =========================================================================
   FIRMWARE CATALOG
   ========================================================================= */
.home-firmware {
  background: var(--mh-card-bg);
  border: 1.5px solid var(--mh-card-border);
  border-radius: 26px;
  padding: 2.25rem;
  box-shadow: var(--mh-card-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  margin-bottom: 4.5rem;
}

.home-firmware-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.home-firmware-head h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mh-text-main);
  margin: 0 0 0.4rem;
}

.fw-board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.85rem;
}

.fw-board-tabs button {
  padding: 0.6rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.05);
  color: var(--mh-text-muted);
  border: 1.5px solid var(--mh-card-border);
  cursor: pointer;
  transition: all 0.22s ease;
}

html[data-ui-theme="dark"] .fw-board-tabs button,
[data-theme="dark"] .fw-board-tabs button {
  background: rgba(255, 255, 255, 0.06);
}

.fw-board-tabs button:hover {
  color: var(--mh-text-main);
  border-color: #10b981;
  transform: translateY(-2px);
}

.fw-board-tabs button.is-active {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: #10b981;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

.fw-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.fw-board-card {
  background: var(--mh-card-surface);
  border: 1.5px solid var(--mh-card-border);
  border-radius: 18px;
  padding: 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.28s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}

.fw-board-card:hover {
  transform: translateY(-4px);
  border-color: #10b981;
  box-shadow: 0 12px 28px rgba(16, 185, 129, 0.18);
}

.fw-board-card.is-selected {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

.fw-board-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.fw-board-card.is-selected .fw-board-check { display: flex; }

.fw-board-photo {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.95rem;
}

html[data-ui-theme="dark"] .fw-board-photo,
[data-theme="dark"] .fw-board-photo {
  background: rgba(0, 0, 0, 0.3);
}

.fw-board-photo img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.fw-board-card:hover .fw-board-photo img {
  transform: scale(1.08);
}

.fw-board-copy b {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mh-text-main);
  margin-bottom: 0.25rem;
}

.fw-board-copy small {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--mh-text-muted);
}

.fw-board-count {
  color: #10b981;
  font-weight: 700;
}

.home-fw-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.home-fw-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.1rem 1.4rem;
  background: var(--mh-card-surface);
  border: 1.5px solid var(--mh-card-border);
  border-radius: 16px;
  transition: all 0.22s ease;
}

@media (max-width: 768px) {
  .home-fw-row {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }
}

.home-fw-row:hover {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateX(3px);
}

.home-fw-name b {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--mh-text-main);
}

.home-fw-name span {
  font-size: 0.78rem;
  font-family: var(--mh-mono);
  color: var(--mh-text-faint);
}

.home-fw-device {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--mh-text-muted);
}

.home-fw-version {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--mh-mono);
  color: #10b981;
}

.home-fw-detail {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: all 0.22s ease;
  white-space: nowrap;
}

.home-fw-detail:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
}

/* =========================================================================
   COMMUNITY & SUPPORT
   ========================================================================= */
.mh-footer-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

@media (max-width: 800px) {
  .mh-footer-cards { grid-template-columns: 1fr; }
}

.mh-support-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 182, 212, 0.14));
  border: 1.5px solid rgba(16, 185, 129, 0.35);
  border-radius: 22px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--mh-card-shadow);
}

.mh-support-banner.community {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(139, 92, 246, 0.15));
  border-color: rgba(6, 182, 212, 0.35);
}

.mh-support-banner h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--mh-text-main);
  margin: 0 0 0.6rem;
}

.mh-support-banner p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--mh-text-muted);
  margin: 0 0 1.5rem;
}

.mh-support-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.mh-support-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  background: var(--mh-card-bg);
  color: var(--mh-text-main);
  border: 1.5px solid var(--mh-card-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.22s ease;
}

.mh-support-link:hover {
  border-color: #10b981;
  color: #10b981;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

/* Enforce Formal & Authoritative Typography across all elements */
body,
html[data-ui-theme] body,
:is(button, input, select, textarea, h1, h2, h3, h4, p, span, a, b, strong, small) {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Leelawadee UI", "Thonburi", "Sukhumvit Set", "Inter", Roboto, "Helvetica Neue", sans-serif !important;
}
/* =========================================================================
   TOP NAV ACTION BUTTONS & ICONS (Guaranteed Visibility on Mobile / Safari)
   ========================================================================= */

.mh-theme-toggle-btn,
.mh-nav-mobile-toggle {
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  border-radius: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  flex-shrink: 0 !important;
  border: 1.5px solid var(--mh-card-border) !important;
  background: var(--mh-card-bg) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  transition: all 0.2s ease !important;
  position: relative !important;
  z-index: 10 !important;
}

.mh-theme-toggle-btn:hover,
.mh-nav-mobile-toggle:hover {
  border-color: #10b981 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25) !important;
}

/* Guarantee SVG icon visibility inside top buttons */
.mh-theme-toggle-btn svg,
.mh-nav-mobile-toggle svg {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  display: block !important;
  stroke-width: 2.3 !important;
  fill: none !important;
  flex-shrink: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Light theme colors for toggle buttons */
html[data-ui-theme="paper"] .mh-theme-toggle-btn svg,
body:not([data-theme="dark"]) .mh-theme-toggle-btn svg,
html[data-ui-theme="paper"] .mh-nav-mobile-toggle svg,
body:not([data-theme="dark"]) .mh-nav-mobile-toggle svg {
  stroke: #0f172a !important;
  color: #0f172a !important;
}

/* Dark theme colors for toggle buttons */
html[data-ui-theme="dark"] .mh-theme-toggle-btn svg,
[data-theme="dark"] .mh-theme-toggle-btn svg,
html[data-ui-theme="dark"] .mh-nav-mobile-toggle svg,
[data-theme="dark"] .mh-nav-mobile-toggle svg {
  stroke: #f8fafc !important;
  color: #f8fafc !important;
}

/* Specific: Moon icon (Light mode) vs Sun icon (Dark mode) */
.mh-theme-toggle-btn .icon-moon {
  display: block !important;
  stroke: #1e293b !important;
}
.mh-theme-toggle-btn .icon-sun {
  display: none !important;
  stroke: #f59e0b !important;
}

html[data-ui-theme="dark"] .mh-theme-toggle-btn .icon-moon,
[data-theme="dark"] .mh-theme-toggle-btn .icon-moon {
  display: none !important;
}
html[data-ui-theme="dark"] .mh-theme-toggle-btn .icon-sun,
[data-theme="dark"] .mh-theme-toggle-btn .icon-sun {
  display: block !important;
  stroke: #fbbf24 !important;
}

/* Hamburger lines styling */
.mh-nav-mobile-toggle svg line {
  stroke: currentColor !important;
  stroke-width: 2.5 !important;
  stroke-linecap: round !important;
}

/* Status Chip & Header spacing on Phone screens */
.mh-nav-status-chip {
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

@media (max-width: 580px) {
  .mh-nav-container {
    padding: 0.65rem 0.9rem !important;
    gap: 0.4rem !important;
  }
  .mh-nav-brand {
    font-size: 1.15rem !important;
    gap: 0.45rem !important;
  }
  .mh-brand-icon-box {
    width: 32px !important;
    height: 32px !important;
  }
  .mh-brand-icon-box svg {
    width: 18px !important;
    height: 18px !important;
  }
  .mh-nav-right {
    gap: 0.45rem !important;
  }
  .mh-theme-toggle-btn,
  .mh-nav-mobile-toggle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    max-width: 38px !important;
  }
  .mh-theme-toggle-btn svg,
  .mh-nav-mobile-toggle svg {
    width: 20px !important;
    height: 20px !important;
  }
  /* On compact mobile, keep status dot without long text to avoid 2-line break */
  .mh-nav-status-chip span {
    display: none !important;
  }
  .mh-nav-status-chip {
    padding: 0.4rem !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    justify-content: center !important;
  }
  .mh-live-dot {
    margin: 0 !important;
  }
}

/* =========================================================================
   FIRMWARE CATALOG & HARDWARE CARDS (High-Contrast, Light & Dark Theme)
   Fixes dark mode visibility & enhances board showcase
   ========================================================================= */
.home-firmware {
  background: var(--mh-card-bg) !important;
  border: 1.5px solid var(--mh-card-border) !important;
  border-radius: 24px !important;
  box-shadow: var(--mh-card-shadow) !important;
  padding: 2rem !important;
  margin: 3.5rem 0 !important;
  transition: all 0.3s ease !important;
}

.home-firmware-head h2 {
  color: var(--mh-text-main) !important;
  font-family: var(--mh-font) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  margin: 0.5rem 0 0.25rem !important;
}

.home-firmware-head p {
  color: var(--mh-text-muted) !important;
  font-size: 0.95rem !important;
  margin: 0 !important;
}

/* Device Stage Container */
.fw-device-stage {
  border-radius: 20px !important;
  padding: 1.25rem !important;
  margin-top: 1.5rem !important;
  transition: background 0.3s ease, border-color 0.3s ease !important;
}

html[data-ui-theme="dark"] .fw-device-stage,
[data-theme="dark"] .fw-device-stage {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="paper"] .fw-device-stage,
body.home-page:not([data-theme="dark"]) .fw-device-stage {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* Board Category Tabs */
.fw-board-tabs {
  gap: 0.6rem !important;
  margin-bottom: 1.25rem !important;
}

.fw-board-tabs button {
  padding: 0.5rem 1.1rem !important;
  border-radius: 9999px !important;
  font-family: var(--mh-font) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer !important;
}

html[data-ui-theme="dark"] .fw-board-tabs button,
[data-theme="dark"] .fw-board-tabs button {
  background: rgba(30, 41, 59, 0.75) !important;
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-ui-theme="paper"] .fw-board-tabs button,
body.home-page:not([data-theme="dark"]) .fw-board-tabs button {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

.fw-board-tabs button:hover {
  transform: translateY(-2px) !important;
  color: var(--mh-text-main) !important;
  border-color: #10b981 !important;
}

.fw-board-tabs button.is-active {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

/* Hardware Board Cards */
.fw-board-grid {
  gap: 0.85rem !important;
}

.fw-board-card {
  border-radius: 18px !important;
  overflow: hidden !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
  cursor: pointer !important;
}

html[data-ui-theme="dark"] .fw-board-card,
[data-theme="dark"] .fw-board-card {
  background: #0f172a !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
}

html[data-ui-theme="paper"] .fw-board-card,
body.home-page:not([data-theme="dark"]) .fw-board-card {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #0f172a !important;
}

.fw-board-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25) !important;
}

.fw-board-card.is-selected {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 2.5px rgba(16, 185, 129, 0.4), 0 12px 30px rgba(0, 0, 0, 0.35) !important;
}

/* Studio Pod for Board Illustration (Fixes Dark Mode Invisibility) */
.fw-board-photo {
  height: 125px !important;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  transition: background 0.3s ease !important;
}

html[data-ui-theme="dark"] .fw-board-photo,
[data-theme="dark"] .fw-board-photo {
  background: radial-gradient(circle at 50% 45%, #1e293b 0%, #0d1526 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="paper"] .fw-board-photo,
body.home-page:not([data-theme="dark"]) .fw-board-photo {
  background: radial-gradient(circle at 50% 45%, #f8fafc 0%, #e2e8f0 100%) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Image/SVG Rendering: NEVER multiply in dark mode */
.fw-board-photo img {
  width: 100% !important;
  height: 100% !important;
  max-height: 110px !important;
  object-fit: contain !important;
  mix-blend-mode: normal !important;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35)) !important;
  padding: 4px !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fw-board-card:hover .fw-board-photo img {
  transform: scale(1.06) !important;
}

.fw-board-card[data-board="android"] .fw-board-photo img {
  object-fit: contain !important;
  object-position: center !important;
  padding: 4px !important;
  mix-blend-mode: normal !important;
}

/* Board Copy Text */
.fw-board-copy {
  padding: 0.85rem 1rem !important;
}

.fw-board-copy b {
  display: block !important;
  font-family: var(--mh-font) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--mh-text-main) !important;
  margin-bottom: 0.25rem !important;
}

.fw-board-copy small {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 0.78rem !important;
  color: var(--mh-text-muted) !important;
}

.fw-board-count {
  color: #10b981 !important;
  font-weight: 800 !important;
  background: rgba(16, 185, 129, 0.12) !important;
  padding: 0.15rem 0.5rem !important;
  border-radius: 999px !important;
  font-size: 0.75rem !important;
}

/* Board Check Icon */
.fw-board-check {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  font-size: 0.75rem !important;
  font-weight: 900 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
}

html[data-ui-theme="dark"] .fw-board-check,
[data-theme="dark"] .fw-board-check {
  background: #1e293b !important;
  color: transparent !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

html[data-ui-theme="paper"] .fw-board-check,
body.home-page:not([data-theme="dark"]) .fw-board-check {
  background: #ffffff !important;
  color: transparent !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.fw-board-card.is-selected .fw-board-check {
  background: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5) !important;
}

/* Firmware Result List */
.home-fw-list {
  border-radius: 18px !important;
  overflow: hidden !important;
  margin-top: 1rem !important;
  transition: all 0.3s ease !important;
}

html[data-ui-theme="dark"] .home-fw-list,
[data-theme="dark"] .home-fw-list {
  background: #0f172a !important;
  border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

html[data-ui-theme="paper"] .home-fw-list,
body.home-page:not([data-theme="dark"]) .home-fw-list {
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
}

.home-fw-row {
  display: grid !important;
  grid-template-columns: minmax(200px, 1.3fr) minmax(140px, 1fr) 100px auto !important;
  align-items: center !important;
  gap: 1rem !important;
  padding: 0.95rem 1.25rem !important;
  transition: background 0.18s ease !important;
}

html[data-ui-theme="dark"] .home-fw-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html[data-ui-theme="paper"] .home-fw-row,
body.home-page:not([data-theme="dark"]) .home-fw-row {
  border-top: 1px solid #f1f5f9 !important;
}

.home-fw-row:first-child {
  border-top: 0 !important;
}

html[data-ui-theme="dark"] .home-fw-row:hover,
[data-theme="dark"] .home-fw-row:hover {
  background: rgba(16, 185, 129, 0.09) !important;
}

html[data-ui-theme="paper"] .home-fw-row:hover,
body.home-page:not([data-theme="dark"]) .home-fw-row:hover {
  background: #f0fdf4 !important;
}

.home-fw-name b {
  font-family: var(--mh-font) !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  color: var(--mh-text-main) !important;
}

.home-fw-name span {
  font-family: var(--mh-mono) !important;
  font-size: 0.8rem !important;
  color: var(--mh-text-muted) !important;
}

.home-fw-device {
  font-size: 0.88rem !important;
  color: var(--mh-text-muted) !important;
}

.home-fw-version {
  font-family: var(--mh-mono) !important;
  font-weight: 800 !important;
  font-size: 0.9rem !important;
  color: #10b981 !important;
}

.home-fw-detail {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.45rem 0.9rem !important;
  border-radius: 10px !important;
  font-family: var(--mh-font) !important;
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
}

html[data-ui-theme="dark"] .home-fw-detail,
[data-theme="dark"] .home-fw-detail {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

html[data-ui-theme="paper"] .home-fw-detail,
body.home-page:not([data-theme="dark"]) .home-fw-detail {
  background: #ecfdf5 !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
}

.home-fw-detail:hover {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
  transform: translateY(-1px) !important;
}

.home-fw-more {
  display: inline-block !important;
  margin-top: 1rem !important;
  font-weight: 700 !important;
  color: #10b981 !important;
  font-size: 0.92rem !important;
  transition: color 0.2s ease !important;
}

.home-fw-more:hover {
  color: #059669 !important;
  text-decoration: underline !important;
}

@media (max-width: 900px) {
  .fw-board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  .home-firmware {
    padding: 1.25rem !important;
    margin: 2rem 0 !important;
  }
  .fw-board-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    padding-bottom: 0.5rem !important;
  }
  .fw-board-card {
    flex: 0 0 160px !important;
    scroll-snap-align: start !important;
  }
  .home-fw-row {
    grid-template-columns: 1fr auto !important;
    gap: 0.35rem 0.8rem !important;
  }
  .home-fw-device {
    grid-column: 1 !important;
  }
  .home-fw-version {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  .home-fw-detail {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
}

/* =========================================================================
   UNIVERSAL MODERN CARD & DASHBOARD COMPONENT STYLES
   Applies to all subpages (bms-online, inv-online, guide, firmware, groups, etc.)
   ========================================================================= */
.energy-hero,
.blog-hero,
.privacy-hero,
.card,
.board,
.dashboard-panel,
.paper-support,
.blog-card,
.group-panel,
.bms-family-group,
.inv-card,
.inv-compact,
.group-view,
.group-inverter,
.privacy-card,
.leader-card,
.energy-stat,
.tablewrap,
.dev,
.bcard {
  background: var(--mh-card-bg) !important;
  border: 1.5px solid var(--mh-card-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--mh-card-shadow) !important;
  color: var(--mh-text-main) !important;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.energy-hero {
  padding: 1.15rem 1.25rem !important;
  margin-bottom: 1.15rem !important;
  border-radius: 14px !important;
  position: relative !important;
  overflow: hidden !important;
}

.energy-hero h1 {
  font-size: clamp(1.4rem, 2.8vw, 1.95rem) !important;
  font-weight: 800 !important;
  color: var(--mh-text-main) !important;
  letter-spacing: -0.025em !important;
  margin: 0.25rem 0 0.4rem !important;
}

.energy-hero p {
  color: var(--mh-text-muted) !important;
  font-size: 0.9rem !important;
  max-width: 720px !important;
  line-height: 1.55 !important;
}

.energy-kicker {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.2rem 0.65rem !important;
  border-radius: 999px !important;
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}

.energy-stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 0.65rem !important;
  margin-bottom: 1.35rem !important;
}

.energy-stat {
  padding: 0.75rem 0.95rem !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  border-radius: 11px !important;
}

.energy-stat b {
  font-size: 1.55rem !important;
  font-weight: 900 !important;
  color: var(--mh-text-main) !important;
  font-family: var(--mh-font) !important;
}

.energy-stat span {
  font-size: 0.78rem !important;
  color: var(--mh-text-muted) !important;
  margin-top: 0.15rem !important;
}

/* Modern Interactive Buttons */
.btn,
.energy-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  padding: 0.45rem 0.95rem !important;
  border-radius: 9px !important;
  font-weight: 700 !important;
  font-size: 0.86rem !important;
  text-decoration: none !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
}

.btn.primary,
.energy-btn.primary,
.btn.lime,
.energy-btn.lime {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35) !important;
}

.btn.primary:hover,
.energy-btn.primary:hover,
.btn.lime:hover,
.energy-btn.lime:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.48) !important;
}

.btn:not(.primary):not(.lime),
.energy-btn:not(.primary):not(.lime) {
  background: var(--mh-card-surface) !important;
  color: var(--mh-text-main) !important;
  border: 1.5px solid var(--mh-card-border) !important;
}

.btn:not(.primary):not(.lime):hover,
.energy-btn:not(.primary):not(.lime):hover {
  background: var(--mh-card-bg) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
  transform: translateY(-1px) !important;
}

/* High-Density Monitoring & Pack Details Overrides */
.bcard {
  border-radius: 13px !important;
  border: 1.5px solid var(--mh-card-border) !important;
  overflow: hidden !important;
}

.cbody {
  padding: 10px 12px !important;
}

@media (max-width: 768px) {
  .cbody {
    padding: 8px 6px !important;
  }
}

.devhead {
  padding: 8px 12px !important;
  margin-bottom: 10px !important;
  border-radius: 11px !important;
  gap: 8px !important;
}

.devhead h1 {
  font-size: 16px !important;
}

.tabbar {
  gap: 6px !important;
  margin-bottom: 10px !important;
}

.tabbtn {
  padding: 6px 14px !important;
  font-size: 12.5px !important;
  border-radius: 8px !important;
}

.cards {
  gap: 10px !important;
}

.hero {
  padding: 8px 8px !important;
  margin-bottom: 8px !important;
  border-radius: 12px !important;
  gap: 8px !important;
}

.heroItem {
  min-width: 70px !important;
}

.hval {
  font-size: 24px !important;
}

.hval small {
  font-size: 13px !important;
}

.ring {
  width: 118px !important;
  height: 118px !important;
  flex: 0 0 118px !important;
}

.ringInner {
  width: 104px !important;
  height: 104px !important;
}

.ringPct {
  font-size: 24px !important;
}

.badges {
  gap: 5px !important;
  margin-bottom: 8px !important;
}

.badge {
  padding: 3px 8px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

.detail-toggle {
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 8px !important;
}

.detail-body {
  margin-top: 10px !important;
}

.metric-groups {
  gap: 8px !important;
  margin-bottom: 10px !important;
}

.metric-group {
  padding: 8px 10px !important;
  border-radius: 11px !important;
}

@media (max-width: 768px) {
  .metric-group {
    padding: 6px 6px !important;
    border-radius: 9px !important;
  }
}

.metric-group-head {
  margin-bottom: 6px !important;
  font-size: 12px !important;
}

.grid {
  gap: 6px !important;
}

.mcard {
  padding: 6px 8px !important;
  border-radius: 8px !important;
  gap: 6px !important;
}

.mcard .micon {
  width: 26px !important;
  height: 26px !important;
  flex: 0 0 26px !important;
  font-size: 13px !important;
}

.mcard .label {
  font-size: 10.5px !important;
}

.mcard .value {
  font-size: 15px !important;
}

/* Compact Cells Layout - Guarantees 4 clean columns on mobile without clipping */
.cells {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)) !important;
  gap: 5px !important;
}

@media (max-width: 768px) {
  .cells {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
  }
}

.cell {
  padding: 5px 2px !important;
  border-radius: 8px !important;
}

.cellno {
  font-size: 10px !important;
  margin-bottom: 2px !important;
}

.batt {
  width: 22px !important;
  height: 38px !important;
  margin: 0 auto 3px !important;
  border-radius: 4px !important;
}

.cell .cv {
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

.cell .cr {
  font-size: 9.5px !important;
  margin-top: 1px !important;
}

.legend {
  font-size: 10.5px !important;
  margin-top: 6px !important;
}

/* Subpage Cards: BMS Online, Inverter Online, Groups */
.bms-family-list, .inv-list {
  gap: 12px !important;
}

.bms-family-group, .inv-card, .group-panel, .group-view {
  padding: 12px 14px !important;
  border-radius: 13px !important;
}

.bms-family-head {
  padding-bottom: 10px !important;
}

.bms-fw-group {
  margin-top: 10px !important;
}

/* Site Footer */
#sitefoot,
.foot {
  margin-top: 2rem !important;
  padding: 1.35rem 1.2rem !important;
  background: var(--mh-card-bg) !important;
  border: 1.5px solid var(--mh-card-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--mh-card-shadow) !important;
  margin-bottom: 1.5rem !important;
}

@media (max-width: 768px) {
  #sitefoot,
  .foot {
    margin-bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .social-float {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    z-index: 98 !important;
  }
}

/* =========================================================================
   UNIVERSAL ROCK-SOLID DARK MODE FOR ALL PAGES
   Guarantees pure OLED cyber dark aesthetics and 100% legibility everywhere
   ========================================================================= */
html[data-ui-theme="dark"] body,
html[data-theme="dark"] body,
body.dark-mode {
  background-color: #070d18 !important;
  color: #f8fafc !important;
}

html[data-ui-theme="dark"] body::before,
html[data-theme="dark"] body::before,
body.dark-mode::before {
  opacity: 0.03 !important;
}

/* Modern Top Navigation Bar & Mobile Drawer in Dark Mode */
html[data-ui-theme="dark"] .mh-top-nav,
html[data-theme="dark"] .mh-top-nav,
body.dark-mode .mh-top-nav {
  background: rgba(7, 13, 24, 0.96) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html[data-ui-theme="dark"] .mh-nav-link,
html[data-theme="dark"] .mh-nav-link,
body.dark-mode .mh-nav-link {
  color: #cbd5e1 !important;
}
html[data-ui-theme="dark"] .mh-nav-link:hover,
html[data-theme="dark"] .mh-nav-link:hover,
body.dark-mode .mh-nav-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #10b981 !important;
}
html[data-ui-theme="dark"] .mh-nav-link.active,
html[data-theme="dark"] .mh-nav-link.active,
body.dark-mode .mh-nav-link.active {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

html[data-ui-theme="dark"] .mh-mobile-menu,
html[data-theme="dark"] .mh-mobile-menu,
body.dark-mode .mh-mobile-menu {
  background: rgba(11, 17, 32, 0.98) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}
html[data-ui-theme="dark"] .mh-mobile-link,
html[data-theme="dark"] .mh-mobile-link,
body.dark-mode .mh-mobile-link {
  color: #f1f5f9 !important;
}
html[data-ui-theme="dark"] .mh-mobile-link:hover,
html[data-theme="dark"] .mh-mobile-link:hover,
body.dark-mode .mh-mobile-link:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #10b981 !important;
}

/* Mobile Bottom Dock in Dark Mode */
html[data-ui-theme="dark"] .mh-bottom-bar,
html[data-theme="dark"] .mh-bottom-bar,
body.dark-mode .mh-bottom-bar {
  background: rgba(11, 17, 32, 0.96) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}
html[data-ui-theme="dark"] .mh-bottom-tab,
html[data-theme="dark"] .mh-bottom-tab,
body.dark-mode .mh-bottom-tab {
  color: #94a3b8 !important;
}
html[data-ui-theme="dark"] .mh-bottom-tab.active,
html[data-theme="dark"] .mh-bottom-tab.active,
body.dark-mode .mh-bottom-tab.active {
  color: #10b981 !important;
}

/* Comprehensive Cards & Surfaces Overrides across ALL pages */
html[data-ui-theme="dark"] :is(
  .card, .panel, .bcard, .device-card, .summary-card, .home-card, .stat-card,
  .energy-stat, .energy-hero, .full-section, .inv-compact, .group-inverter,
  .group-bms-pack, .full-flow-node, .paper-support, .hero-instrument, .theme-menu,
  .home-firmware, .guide-step-card, .home-hero-badge, .bms-family-head, .bms-pack-card,
  .device-section, .chart-card, .status-card, .energy-empty, .bms-family-group,
  .inv-card, .group-panel, .group-view, .tablewrap, .dev, .board, .dashboard-panel,
  .blog-card, .privacy-card, .leader-card, .full-tiles .full-tile, .group-inverter
),
html[data-theme="dark"] :is(
  .card, .panel, .bcard, .device-card, .summary-card, .home-card, .stat-card,
  .energy-stat, .energy-hero, .full-section, .inv-compact, .group-inverter,
  .group-bms-pack, .full-flow-node, .paper-support, .hero-instrument, .theme-menu,
  .home-firmware, .guide-step-card, .home-hero-badge, .bms-family-head, .bms-pack-card,
  .device-section, .chart-card, .status-card, .energy-empty, .bms-family-group,
  .inv-card, .group-panel, .group-view, .tablewrap, .dev, .board, .dashboard-panel,
  .blog-card, .privacy-card, .leader-card, .full-tiles .full-tile, .group-inverter
),
body.dark-mode :is(
  .card, .panel, .bcard, .device-card, .summary-card, .home-card, .stat-card,
  .energy-stat, .energy-hero, .full-section, .inv-compact, .group-inverter,
  .group-bms-pack, .full-flow-node, .paper-support, .hero-instrument, .theme-menu,
  .home-firmware, .guide-step-card, .home-hero-badge, .bms-family-head, .bms-pack-card,
  .device-section, .chart-card, .status-card, .energy-empty, .bms-family-group,
  .inv-card, .group-panel, .group-view, .tablewrap, .dev, .board, .dashboard-panel,
  .blog-card, .privacy-card, .leader-card, .full-tiles .full-tile, .group-inverter
) {
  background: #0f172a !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

/* Secondary Inset Surfaces, Chips, Indicators & Nodes */
html[data-ui-theme="dark"] :is(
  .system-ring-inner, .full-flow-core, .compact-inv, .inv-flow-point, .metric-group,
  .log, .tabbtn, .detail-toggle, .ringInner, .home-fw-search, .fw-step-item,
  .fw-spec-chip, .bms-fw-toggle, .group-device-head, .mcard, .cell, .full-flow-sub span,
  .theme-choice, .trend-chart
),
html[data-theme="dark"] :is(
  .system-ring-inner, .full-flow-core, .compact-inv, .inv-flow-point, .metric-group,
  .log, .tabbtn, .detail-toggle, .ringInner, .home-fw-search, .fw-step-item,
  .fw-spec-chip, .bms-fw-toggle, .group-device-head, .mcard, .cell, .full-flow-sub span,
  .theme-choice, .trend-chart
),
body.dark-mode :is(
  .system-ring-inner, .full-flow-core, .compact-inv, .inv-flow-point, .metric-group,
  .log, .tabbtn, .detail-toggle, .ringInner, .home-fw-search, .fw-step-item,
  .fw-spec-chip, .bms-fw-toggle, .group-device-head, .mcard, .cell, .full-flow-sub span,
  .theme-choice, .trend-chart
) {
  background: #1e293b !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

/* Universal Typography in Dark Mode */
html[data-ui-theme="dark"] :is(h1, h2, h3, h4, h5, h6, strong, b, .full-inv-head h1, .group-device-head h2),
html[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6, strong, b, .full-inv-head h1, .group-device-head h2),
body.dark-mode :is(h1, h2, h3, h4, h5, h6, strong, b, .full-inv-head h1, .group-device-head h2) {
  color: #f8fafc !important;
}

html[data-ui-theme="dark"] :is(p, span, small, em, .muted, .text-muted, .inv-card-meta, .section-title p),
html[data-theme="dark"] :is(p, span, small, em, .muted, .text-muted, .inv-card-meta, .section-title p),
body.dark-mode :is(p, span, small, em, .muted, .text-muted, .inv-card-meta, .section-title p) {
  color: #cbd5e1;
}

/* Inputs, Selects & Textareas */
html[data-ui-theme="dark"] :is(input, select, textarea, .home-fw-search input, .device-search input),
html[data-theme="dark"] :is(input, select, textarea, .home-fw-search input, .device-search input),
body.dark-mode :is(input, select, textarea, .home-fw-search input, .device-search input) {
  background-color: #1e293b !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f8fafc !important;
}
html[data-ui-theme="dark"] :is(input::placeholder, textarea::placeholder),
html[data-theme="dark"] :is(input::placeholder, textarea::placeholder),
body.dark-mode :is(input::placeholder, textarea::placeholder) {
  color: #64748b !important;
}

/* Tables in Dark Mode */
html[data-ui-theme="dark"] :is(table, thead, tbody, th, td),
html[data-theme="dark"] :is(table, thead, tbody, th, td),
body.dark-mode :is(table, thead, tbody, th, td) {
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}
html[data-ui-theme="dark"] th,
html[data-theme="dark"] th,
body.dark-mode th {
  background: #1e293b !important;
  color: #38bdf8 !important;
}
html[data-ui-theme="dark"] tr:hover td,
html[data-theme="dark"] tr:hover td,
body.dark-mode tr:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}

/* Footers & Social Float in Dark Mode */
html[data-ui-theme="dark"] :is(#sitefoot, .foot, .paper-footer-row, footer),
html[data-theme="dark"] :is(#sitefoot, .foot, .paper-footer-row, footer),
body.dark-mode :is(#sitefoot, .foot, .paper-footer-row, footer) {
  background: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

html[data-ui-theme="dark"] .social-float-panel,
html[data-theme="dark"] .social-float-panel,
body.dark-mode .social-float-panel {
  background: #0f172a !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}
html[data-ui-theme="dark"] .social-float-link,
html[data-theme="dark"] .social-float-link,
body.dark-mode .social-float-link {
  color: #f8fafc !important;
}
html[data-ui-theme="dark"] .social-float-link:hover,
html[data-theme="dark"] .social-float-link:hover,
body.dark-mode .social-float-link:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}



