  :root{
    --bg: #06201A;
    --bg2: #0A2B22;
    --card: rgba(94,234,212,0.055);
    --card-border: rgba(94,234,212,0.14);
    --hairline: #163B31;
    --text: #EAFBF3;
    --text-dim: #7FAE9E;
    --text-faint: #3E6459;
    --mint: #34D399;
    --lime: #A6E24D;
    --teal: #2DD4BF;
    --sea: #63E0C9;
    --warn: #F5B65A;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  body{
    background:#000; font-family:'Space Grotesk', sans-serif;
    display:flex; justify-content:center; padding:40px 12px; color:var(--text);
    min-height: 100vh;
  }
  .phone{
    width:390px; height:844px;
    background: radial-gradient(130% 90% at 50% -10%, #103A2E 0%, var(--bg) 50%);
    border-radius:44px; border:1px solid #0d251e;
    box-shadow: 0 40px 90px -20px rgba(0,0,0,0.85), inset 0 0 0 1px rgba(255,255,255,0.03);
    overflow:hidden; position:relative; display:flex; flex-direction:column;
  }

  @media (max-width: 600px) {
    body {
      padding: 0;
      margin: 0;
      background: var(--bg);
      display: block;
      width: 100%;
      height: 100%;
      min-height: 100vh;
      min-height: 100dvh;
      overflow: hidden;
    }
    .phone {
      width: 100%;
      max-width: 100%;
      height: 100vh;
      height: 100dvh;
      border-radius: 0;
      border: none;
      box-shadow: none;
    }
    .topbar {
      padding-top: max(16px, env(safe-area-inset-top, 16px));
      padding-left: max(16px, env(safe-area-inset-left, 16px));
      padding-right: max(16px, env(safe-area-inset-right, 16px));
    }
    .screen {
      padding-left: max(16px, env(safe-area-inset-left, 16px));
      padding-right: max(16px, env(safe-area-inset-right, 16px));
      padding-bottom: calc(100px + env(safe-area-inset-bottom, 16px));
    }
    .bottomnav {
      height: calc(76px + env(safe-area-inset-bottom, 16px));
      padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
      padding-left: max(12px, env(safe-area-inset-left, 12px));
      padding-right: max(12px, env(safe-area-inset-right, 12px));
      background: linear-gradient(180deg, rgba(6,32,26,0) 0%, rgba(6,32,26,0.97) 25%, #06201A 100%);
    }
  }
  .statusbar{display:none;}
  .topbar{padding:18px 20px 14px; display:flex; align-items:center; justify-content:space-between;}
  .app-brand{display:flex; align-items:center; gap:8px; color:var(--text); font-size:14px; font-weight:700; letter-spacing:0.01em;}
  .app-brand-mark{width:28px; height:28px; display:grid; place-items:center; border-radius:9px; color:var(--mint); background:rgba(45,212,191,0.1); border:1px solid rgba(45,212,191,0.18);}
  .sys-pill{
    display:flex; align-items:center; gap:8px;
    background:var(--card); border:1px solid var(--card-border);
    padding:9px 14px; border-radius:16px; font-size:13px; font-weight:600;
  }
  .sys-pill svg{width:15px;height:15px;}
  .sys-pill .chev{color:var(--text-faint); margin-left:2px;}
  .icon-btn{
    width:38px; height:38px; border-radius:12px;
    background:var(--card); border:1px solid var(--card-border);
    display:flex; align-items:center; justify-content:center;
  }
  .icon-btn svg{width:16px;height:16px;}

  .screen{flex:1; overflow-y:auto; padding: 4px 20px 100px;}
  .screen::-webkit-scrollbar{display:none;}
  .page{
    display:none;
    opacity:0;
    transform:translateY(12px);
    transition:opacity 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .page.active{display:block;}
  .page.visible{opacity:1; transform:translateY(0);}

  .card{
    background:var(--card); border:1px solid var(--card-border); border-radius:24px;
    padding:20px; margin-bottom:14px;
    box-shadow: 0 10px 24px -12px rgba(0,0,0,0.35);
  }
  .flow-section{ padding:4px 2px 8px; margin-bottom:6px; }
  .status-banner{
    padding:4px 0 7px; text-align:center;
  }
  .status-strip {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 28px;
  }
  .status-left-stack {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    z-index: 2;
  }
  .status-right-stack {
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
  }
  .status-chip {
    min-width:0;
    height:20px;
    padding:2px 8px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    border-radius:6px;
    font-size:8.5px;
    line-height:1;
    font-weight:700;
  }
  .status-freshness {
    position: relative;
    font-family: 'JetBrains Mono', monospace;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 2.5px 8px 3.5px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.25s ease, transform 0.1s ease;
    color: var(--warn);
    background: rgba(245,182,90,0.1);
    border: 1px solid rgba(245,182,90,0.23);
    z-index: 3;
  }
  .status-freshness.is-syncing {
    border-color: rgba(56, 189, 248, 0.5) !important;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.22);
  }
  .freshness-spin-inline {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1;
    color: #38BDF8;
    margin: 0 1px;
    animation: spinRefresh 0.75s linear infinite;
    transform-origin: center center;
    vertical-align: middle;
  }
  .status-freshness:hover {
    filter: brightness(1.15);
  }
  .status-freshness:active, .status-freshness.force-pulse {
    transform: scale(0.96);
  }
  .freshness-spin {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    opacity: 0.65;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .freshness-spin.spinning {
    animation: spinRefresh 0.75s linear infinite;
    opacity: 1;
    color: #38BDF8 !important;
  }
  @keyframes spinRefresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  .freshness-dot {
    font-size: 8px;
    line-height: 1;
  }
  .freshness-bar-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }
  .freshness-bar-fill {
    height: 100%;
    width: 0%;
    background: #10B981;
    border-radius: 1px;
    transition: width 0.9s linear, background-color 0.3s ease;
  }
  .freshness-bar-fill.scanning {
    width: 100% !important;
    background: linear-gradient(90deg, transparent 0%, #38BDF8 50%, transparent 100%) !important;
    background-size: 200% 100% !important;
    animation: scannerBeam 0.9s linear infinite !important;
  }
  @keyframes scannerBeam {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  .status-freshness.live {
    color: #10B981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
  }
  .status-freshness.stale {
    color: #F59E0B !important;
    background: rgba(245, 158, 11, 0.14) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
  }
  .status-freshness.offline {
    color: #EF4444 !important;
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
  }
  .status-freshness.connecting {
    color: #06B6D4 !important;
    background: rgba(6, 182, 212, 0.12) !important;
    border: 1px solid rgba(6, 182, 212, 0.3) !important;
  }

  .flow-section.telemetry-stale {
    opacity: 0.88;
    transition: opacity 0.3s ease;
  }
  .flow-section.telemetry-offline {
    opacity: 0.70;
    transition: opacity 0.3s ease;
  }
  .status-issue {
    color:var(--warn);
    font-size:8px;
    white-space:nowrap;
  }
  .status-issue.show {
    display:flex;
  }
  .status-time {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    letter-spacing: 0.04em;
  }
  /* Pull to refresh UI */
  .ptr-container {
    height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    transition: height 0.2s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
    user-select: none;
  }
  .ptr-container.active {
    opacity: 1;
  }
  .ptr-spinner {
    display: inline-block;
    font-size: 13px;
    color: #38BDF8;
    transition: transform 0.2s ease;
  }
  .ptr-spinner.spinning {
    animation: spinRefresh 0.65s linear infinite;
  }
  #modeBadgePill {
    flex:0 0 auto;
    font-size:9px;
  }
  .sb-issue{ display:none; margin:0; }
  .sb-issue.show{ display:flex; }
  .mode-bar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 2px 4px 6px;
  }
  .mode-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border-radius: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    border: 0;
    box-shadow:none;
  }
  .mode-badge-pill.hybrid {
    color: #34D399;
  }
  .mode-badge-pill.grid {
    color: #2DD4BF;
  }
  .mode-badge-pill.solar {
    color: #C7FF3D;
  }
  .mode-badge-pill.battery {
    color: #38BDF8;
  }
  .mode-badge-pill.inverter {
    color: #A6E24D;
  }
  .mode-badge-pill.standby {
    color: var(--warn);
  }
  .mode-badge-pill.fault {
    color: #F43F5E;
  }
  .mode-badge-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: dotGlow 1.8s ease-in-out infinite;
  }
  .mode-badge-icon {
    font-size: 9px;
    line-height: 1;
  }

  /* ---- Tesla 3D Flow Energy Pulse Animations ---- */
  @keyframes flowDashYellow {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
  }
  @keyframes flowDashCyan {
    0% { stroke-dashoffset: 24; }
    100% { stroke-dashoffset: 0; }
  }
  .tesla-flow-active {
    stroke-dasharray: 8 8;
    animation: flowDashYellow 0.9s linear infinite;
  }
  .tesla-flow-reverse {
    stroke-dasharray: 8 8;
    animation: flowDashYellow 0.9s linear infinite reverse;
  }
  .section-label{
    font-size:11px; letter-spacing:0.1em; text-transform:uppercase; color:var(--text-faint);
    margin: 20px 4px 8px;
  }
  .card-label{
    font-size:11px; letter-spacing:0.12em; text-transform:uppercase; color:var(--text-dim);
    display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; font-weight:600;
  }

  /* ---- Flow Diagram Theme Switcher ---- */
  .theme-switcher-bar {
    position:absolute;
    right:42px;
    top:50%;
    transform:translateY(-50%);
    z-index:31;
    display:flex;
    flex-direction:column;
    gap:4px;
    width:154px;
    padding:6px;
    border-radius:16px;
    background:rgba(4,20,16,0.97);
    border:1px solid rgba(94,234,212,0.2);
    box-shadow:0 10px 32px rgba(0,0,0,0.5);
    backdrop-filter:blur(14px);
  }
  .theme-float > summary { list-style:none; }
  .theme-float > summary::-webkit-details-marker { display:none; }
  .theme-float:not([open]):not(:hover):not(:focus-within) .theme-switcher-bar { display:none; }
  .theme-float {
    position:absolute;
    z-index:32;
    top:45%;
    right:0;
    transition: opacity 0.2s;
  }
  /* Only show theme button on home page */
  .theme-float { display:none; }
  body[data-page="home"] .theme-float { display:block; }
  .theme-float-trigger {
    width:35px;
    height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:1px solid rgba(94,234,212,0.22);
    border-right:0;
    border-radius:13px 0 0 13px;
    color:var(--mint);
    background:rgba(5,29,23,0.9);
    box-shadow:0 4px 18px rgba(0,0,0,0.3);
    font-size:17px;
    cursor:pointer;
  }
  .theme-float-trigger:focus-visible,
  .flow-theme-pill:focus-visible { outline:2px solid var(--mint); outline-offset:2px; }
  body.theme-tesla .theme-float-trigger {
    color:#fff;
    background:rgba(12,14,20,0.94);
    border-color:rgba(255,255,255,0.2);
  }
  .flow-theme-pill {
    width:100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    padding: 9px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.22s ease;
  }
  .flow-theme-pill:hover {
    color: var(--text);
  }
  .flow-theme-pill.active {
    background: linear-gradient(135deg, rgba(52,211,153,0.2), rgba(166,226,77,0.12));
    color: #EAFBF3;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(52,211,153,0.45);
  }
  body.theme-tesla .flow-theme-pill.active {
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.08));
    color: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.3);
  }

  /* ---- Tesla Studio Theme Overrides ---- */
  body.theme-tesla {
    background: #000000;
  }
  body.theme-tesla .phone {
    background: radial-gradient(120% 80% at 50% -5%, #181A22 0%, #08090C 55%, #000000 100%);
    border-color: #191B22;
  }
  body.theme-tesla .card {
    background: #0B0D11;
    border-color: #1A1C24;
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6);
  }
  body.theme-tesla .sys-pill,
  body.theme-tesla .icon-btn,
  body.theme-tesla .quad-cell {
    background: #0C0E14;
    border-color: #1B1E28;
  }

  /* ---- Dribbble Eco-Villa 3D Hybrid PBR Compositing ---- */
  .villa-3d-stage {
    position: relative;
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    background: #080C14;
    box-shadow: 0 16px 40px -10px rgba(0,0,0,0.85), inset 0 0 0 1px rgba(255,255,255,0.06);
    aspect-ratio: 9 / 14;
    max-height: 580px;
    margin: 0 auto 16px auto;
  }
  .villa-3d-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    pointer-events: none;
    user-select: none;
  }
  .villa-window-bloom {
    position: absolute;
    top: 36%;
    left: 31%;
    width: 32%;
    height: 22%;
    background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.45) 0%, rgba(217, 119, 6, 0.18) 55%, transparent 75%);
    mix-blend-mode: screen;
    pointer-events: none;
    opacity: 0.65;
    transition: opacity 0.5s ease;
  }
  .villa-conduit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
  }
  /* Real-Time 3D Dual-Rail Glass Conduits & Photon Waves */
  .conduit-track-base {
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }
  .conduit-inner-slot {
    stroke: rgba(0, 0, 0, 0.55);
    stroke-width: 2px;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
  }

  /* Solid Luminous Neon Core */
  .conduit-neon-core {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.4s ease;
  }
  .neon-solar {
    stroke: #FBBF24;
    stroke-width: 2.4px;
    filter: url(#laserAmberGlow);
  }
  .neon-grid {
    stroke: #C084FC;
    stroke-width: 2.4px;
    filter: url(#laserPurpleGlow);
  }
  .neon-home {
    stroke: #38BDF8;
    stroke-width: 2.4px;
    filter: url(#laserCyanGlow);
  }
  .neon-batt {
    stroke: #34D399;
    stroke-width: 2.4px;
    filter: url(#laserGreenGlow);
  }

  /* Smooth Traveling Photon Waves (Seamless Luminous Flow, NO Dotted Dashes) */
  .energy-photon-wave {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40 80;
    opacity: 0;
    transition: opacity 0.35s ease;
  }
  .energy-wave-active {
    opacity: 1 !important;
    animation: photonStreamForward var(--flow-dur, 1.2s) linear infinite;
  }
  .energy-wave-reverse {
    opacity: 1 !important;
    animation: photonStreamReverse var(--flow-dur, 1.2s) linear infinite;
  }

  @keyframes photonStreamForward {
    from { stroke-dashoffset: 120; }
    to { stroke-dashoffset: 0; }
  }
  @keyframes photonStreamReverse {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: 120; }
  }

  .dribbble-hud-card {
    position: absolute;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(12, 17, 28, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,0.65);
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 110px;
    pointer-events: auto;
    z-index: 5;
    transition: transform 0.2s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  }
  .dribbble-hud-card:hover {
    transform: translateY(-2px);
  }
  .hud-solar {
    top: 7%;
    left: 4%;
    border-color: rgba(245, 158, 11, 0.75);
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.28), 0 8px 24px rgba(0,0,0,0.55);
  }
  .hud-grid {
    top: 7%;
    right: 4%;
    border-color: rgba(168, 85, 247, 0.75);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.28), 0 8px 24px rgba(0,0,0,0.55);
  }
  .hud-home {
    top: 54%;
    right: 4%;
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.28), 0 8px 24px rgba(0,0,0,0.55);
  }
  .hud-batt {
    bottom: 74px;
    left: 4%;
    border-color: rgba(16, 185, 129, 0.75);
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.28), 0 8px 24px rgba(0,0,0,0.55);
  }
  .hud-header {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .hud-icon {
    font-size: 13px;
    line-height: 1;
  }
  .hud-title-col {
    display: flex;
    flex-direction: column;
  }
  .hud-label {
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: 0.04em;
  }
  .hud-sub {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9px;
    font-weight: 600;
    color: #C084FC;
  }
  .hud-sub-bottom {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    color: #6EE7B7;
    margin-top: 1px;
  }
  .hud-value {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.85);
  }
  .dribbble-summary-card {
    position: absolute;
    bottom: 14px;
    left: 16px;
    right: 16px;
    padding: 12px 18px;
    border-radius: 16px;
    background: rgba(10, 15, 25, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: space-around;
    pointer-events: auto;
    z-index: 5;
  }
  .summary-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .summary-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
  }
  .summary-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10.5px;
    font-weight: 700;
    color: #94A3B8;
    letter-spacing: 0.05em;
  }
  .summary-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
  }
  .summary-value.green-val {
    color: #34D399;
  }
  .summary-value.white-val {
    color: #FFFFFF;
  }
  .tesla-leader-line, .tesla-leader-dot, .tesla-leader-halo {
    display: none !important;
  }

  /* ---- Smooth Usage Timeframe Transition States ---- */
  #usage.timeframe-loading #paramChartSvg,
  #usage.timeframe-loading #historyStatsOnlyCard,
  #usage.timeframe-loading .usage-energy-flows,
  #usage.timeframe-loading [data-box-id^="km-"] {
    opacity: 0.42;
    filter: blur(1.5px);
    transition: opacity 0.15s ease, filter 0.15s ease;
    pointer-events: none;
  }
  #usage #paramChartSvg,
  #usage #historyStatsOnlyCard,
  #usage .usage-energy-flows,
  #usage [data-box-id^="km-"] {
    opacity: 1;
    filter: blur(0px);
    transition: opacity 0.22s ease, filter 0.22s ease;
  }
  .tesla-time-pill {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 5px 14px;
    background: rgba(10, 14, 23, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #F8FAFC;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    user-select: none;
  }
  .tesla-time-pill:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateX(-50%) translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  }
  .tesla-time-pill:active {
    transform: translateX(-50%) translateY(0);
  }

  /* Continuous Living Environment Animations */
  @keyframes treeSway1 {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(1.4deg); }
  }
  @keyframes treeSway2 {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-1.1deg); }
  }
  @keyframes cloudDriftSlow {
    0% { transform: translateX(-60px); }
    100% { transform: translateX(420px); }
  }
  @keyframes starTwinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.25); }
  }
  @keyframes sunPulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.05); opacity: 1; }
  }
  @keyframes conduitFlowForward {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -32; }
  }
  @keyframes conduitFlowReverse {
    0% { stroke-dashoffset: -32; }
    100% { stroke-dashoffset: 0; }
  }
  @keyframes sparkPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.75; }
    50% { transform: scale(1.2); opacity: 1; }
  }
  @keyframes rainStreak {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -90; }
  }

  /* Laser Energy Conduits with Rounded Capsule Dashes */
  .tesla-conduit {
    stroke-dasharray: 8 9;
    stroke-linecap: round;
    transition: opacity 0.4s ease, stroke-width 0.3s ease;
  }
  .tesla-conduit.active-forward {
    animation: conduitFlowForward var(--flow-dur, 1.1s) linear infinite;
    animation-play-state: running;
    opacity: 1;
  }
  .tesla-conduit.active-reverse {
    animation: conduitFlowReverse var(--flow-dur, 1.1s) linear infinite;
    animation-play-state: running;
    opacity: 1;
  }
  .tesla-conduit.idle {
    stroke-dasharray: none;
    animation: none;
    opacity: 0.28;
    filter: none;
  }
  .tesla-conduit.disconnected {
    stroke-dasharray: 4 5;
    animation: none;
    opacity: 0.16;
    filter: none;
  }

  /* ---- hub flow diagram ---- */
  .hub-wrap{ position:relative; width:100%; margin:2px auto 6px;}

  /* ---- hero dial (legacy, unused but kept for safety) ---- */
  .dial-wrap{ position:relative; width:220px; height:220px; margin:6px auto 4px;}
  .dial-center{
    position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
    text-align:center;
  }
  .dial-center .dv{font-family:'JetBrains Mono', monospace; font-size:36px; font-weight:700;}
  .dial-center .du{font-size:12px; color:var(--text-dim); margin-top:4px;}
  .dial-center .dl{font-size:11px; color:var(--text-faint); margin-top:8px; text-transform:uppercase; letter-spacing:0.1em;}
  .mode-strip{
    display:flex; align-items:center; justify-content:center; gap:8px;
    margin-top:6px; font-size:13px; color:var(--text-dim);
    padding:8px 10px; border-radius:12px; transition:all 0.4s ease;
  }
  .mode-strip.achievement{
    color:var(--lime); font-weight:700;
    background:linear-gradient(90deg, rgba(166,226,77,0.08), rgba(166,226,77,0.18), rgba(166,226,77,0.08));
    box-shadow:0 0 18px rgba(166,226,77,0.25), inset 0 0 0 1px rgba(166,226,77,0.3);
    animation: achievementPulse 1.8s ease-in-out infinite;
  }
  @keyframes achievementPulse{
    0%,100%{ box-shadow:0 0 14px rgba(166,226,77,0.2), inset 0 0 0 1px rgba(166,226,77,0.25); }
    50%{ box-shadow:0 0 26px rgba(166,226,77,0.45), inset 0 0 0 1px rgba(166,226,77,0.5); }
  }
  .mode-dot{width:7px;height:7px;border-radius:50%; background:var(--mint); box-shadow:0 0 8px var(--mint); animation: dotGlow 1.8s ease-in-out infinite;}
  @keyframes dotGlow{
    0%,100%{ box-shadow:0 0 3px var(--mint); opacity:0.7; }
    50%{ box-shadow:0 0 12px var(--mint); opacity:1; }
  }
  .balance-line{
    text-align:center; font-size:10.5px; color:var(--text-faint); font-family:'JetBrains Mono', monospace;
    margin-top:6px;
  }
  .energy-ring{
    fill:none; stroke-width:2.5; opacity:0; pointer-events:none;
  }
  .energy-ring.active{ animation: energyPulse 0.55s ease-out infinite; }
  @keyframes energyPulse{
    0%{ r:6; opacity:0.9; }
    100%{ r:24; opacity:0; }
  }
  .lightning-bolt{ opacity:0; pointer-events:none; transition:opacity 0.1s; }
  .lightning-bolt.active{ opacity:1; animation: boltFlicker 0.13s steps(1) infinite; }
  @keyframes boltFlicker{
    0%,100%{ opacity:1; }
    35%{ opacity:0.55; }
    60%{ opacity:1; }
    80%{ opacity:0.7; }
  }
  .bolt-spark{ opacity:0; }
  .lightning-bolt.active .bolt-spark{ animation: sparkTwinkle 0.5s ease-in-out infinite; }
  @keyframes sparkTwinkle{
    0%,100%{ opacity:0; }
    50%{ opacity:1; }
  }

  /* ---- element rows (solar/grid/battery/inverter) ---- */
  .elrow{
    display:flex; align-items:center; gap:14px;
    padding:14px 6px; border-bottom:1px solid var(--hairline);
  }
  .elrow:last-child{border-bottom:none;}
  .el-icon{
    width:46px; height:46px; border-radius:14px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  .el-icon svg{width:22px;height:22px;}
  .el-body{flex:1;}
  .el-name{font-size:14px; font-weight:600;}
  .el-sub{font-size:11px; color:var(--text-faint); margin-top:2px;}
  .el-right{text-align:right;}
  .el-val{font-family:'JetBrains Mono', monospace; font-size:16px; font-weight:700;}
  .status-pill{
    display:inline-block; font-size:9px; padding:3px 8px; border-radius:8px;
    margin-top:5px; letter-spacing:0.03em; font-weight:600;
  }

  .spark{width:56px; height:24px; margin-left:4px;}

  /* ---- Inverter Dual Cooling Fans & Energy Mixing VFX ---- */
  @keyframes invFanSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  .inv-fan-rotor {
    transform-origin: 0px 0px;
    animation: invFanSpin 1.2s linear infinite;
  }
  @keyframes mixWavePulse {
    0% { transform: scale(0.82); opacity: 0.85; }
    50% { transform: scale(1.35); opacity: 0.22; }
    100% { transform: scale(0.82); opacity: 0.85; }
  }
  .mix-wave {
    transform-origin: 200px 234px;
    animation: mixWavePulse 1.9s ease-in-out infinite;
  }
  .mix-wave-delayed {
    transform-origin: 200px 234px;
    animation: mixWavePulse 1.9s ease-in-out infinite 0.95s;
  }

  /* ---- sleeping sun & night animations ---- */
  @keyframes sleepZFloat {
    0% { transform: translate(0, 0) scale(0.8); opacity: 0; }
    25% { opacity: 0.95; }
    75% { transform: translate(6px, -18px) scale(1.1); opacity: 0.7; }
    100% { transform: translate(12px, -30px) scale(1.25); opacity: 0; }
  }
  .sleep-z.z1 { animation: sleepZFloat 3.2s ease-out infinite; }
  .sleep-z.z2 { animation: sleepZFloat 3.2s ease-out infinite 1.05s; }
  .sleep-z.z3 { animation: sleepZFloat 3.2s ease-out infinite 2.1s; }

  @keyframes starTwinkle {
    0%, 100% { opacity: 0.25; transform: scale(0.85); }
    50% { opacity: 0.95; transform: scale(1.15); }
  }
  .sleep-star.s1 { animation: starTwinkle 2.5s ease-in-out infinite; transform-origin: 80px 47px; }
  .sleep-star.s2 { animation: starTwinkle 3.2s ease-in-out infinite 0.8s; transform-origin: 240px 51px; }
  .sleep-star.s3 { animation: starTwinkle 2.9s ease-in-out infinite 1.4s; transform-origin: 120px 64px; }
  .sleep-star.s4 { animation: starTwinkle 3.6s ease-in-out infinite 2.0s; transform-origin: 205px 62px; }

  /* ---- sun path ---- */
  .sunpath-svg{width:100%; height:110px; margin-top:-8px;}
  .sun-meta{display:flex; justify-content:space-between; margin-top:4px;}
  .sun-meta .m{text-align:center; flex:1;}
  .sun-meta .m .t{font-size:10px; color:var(--text-faint); text-transform:uppercase; letter-spacing:0.06em;}
  .sun-meta .m .v{font-family:'JetBrains Mono', monospace; font-size:13px; font-weight:600; margin-top:3px;}
  .peak-banner{
    display:flex; align-items:center; gap:8px;
    background:linear-gradient(90deg, rgba(166,226,77,0.14), rgba(166,226,77,0.02));
    border:1px solid rgba(166,226,77,0.25); border-radius:12px;
    padding:10px 12px; margin-top:12px; font-size:12px;
  }
  .peak-banner b{color:var(--lime);}
  .weather-row{
    display:flex; align-items:center; gap:10px;
    margin-top:14px; padding:6px 10px; border-radius:12px;
    background:rgba(245,182,90,0.06); border:1px solid rgba(245,182,90,0.18);
  }
  .weather-icon{width:28px; height:28px; flex-shrink:0;}
  .weather-icon svg{width:100%; height:100%;}
  .loc-pill{
    font-size:10px; color:var(--text-dim); align-self:flex-start;
    background:rgba(255,255,255,0.04); border:1px solid var(--card-border);
    padding:4px 8px; border-radius:12px; white-space:nowrap; cursor:pointer;
  }
  .tilt-row{
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    margin-top:2px; padding-top:10px; border-top:1px solid var(--hairline);
  }
  .tilt-group{display:flex; align-items:center; gap:8px;}
  .tilt-label{font-size:11px; color:var(--text-dim);}
  .tilt-btn{
    width:26px; height:26px; border-radius:8px; border:1px solid var(--card-border);
    background:var(--card); color:var(--text); font-size:15px; line-height:1;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .tilt-btn-wide{width:auto; padding:0 10px; font-size:12px; font-weight:600;}
  .tilt-val{font-family:'JetBrains Mono', monospace; font-size:13px; font-weight:700; min-width:28px; text-align:center;}

  .quad-grid{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
  .quad-cell{background:var(--card); border:1px solid var(--card-border); border-radius:14px; padding:14px;}
  .qtrend{font-size:10px; font-weight:700; margin-top:8px;}
  .qtrend span{font-weight:500; color:var(--text-faint); margin-left:3px;}
  .qtrend.up{color:var(--lime);}
  .qtrend.down{color:var(--load, #E08462);}
  .qtrend.flat{color:var(--text-faint); font-style:italic; font-weight:500;}
  .gen-today-trend {
    display: inline-flex;
    align-items: center;
    gap: 4.5px;
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    transition: all 0.2s ease;
  }
  .gen-today-trend.up {
    color: var(--lime, #C7FF3D);
    background: rgba(199, 255, 61, 0.12);
    border: 1px solid rgba(199, 255, 61, 0.25);
  }
  .gen-today-trend.down {
    color: #FF6B6B;
    background: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.25);
  }
  .gen-today-trend.flat {
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  .gen-today-trend .trend-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .gen-today-trend .trend-diff {
    font-size: 10px;
    opacity: 0.85;
    font-weight: 600;
  }
  .gen-today-trend .trend-label {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--text-dim);
    margin-left: 1px;
  }
  .quad-top{display:flex; align-items:center; justify-content:space-between;}
  .quad-top svg{width:18px; height:18px; opacity:0.9;}
  .qv{font-family:'JetBrains Mono', monospace; font-size:17px; font-weight:700;}
  .qv i{font-style:normal; font-size:10px; color:var(--text-dim); font-weight:500; margin-left:2px;}
  .ql{font-size:10.5px; color:var(--text-dim); margin-top:8px;}
  .forecast-strip{
    display:flex; justify-content:space-between; margin-top:12px;
    padding-top:12px; border-top:1px solid var(--hairline);
  }
  .forecast-strip .fc{display:flex; flex-direction:column; align-items:center; gap:4px; flex:1;}
  .forecast-strip .fct{font-size:9px; color:var(--text-faint);}
  .forecast-strip svg{width:18px; height:18px;}
  .forecast-strip .fcv{font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-dim); font-weight:600;}

  /* ---- system health (sliders + badge) ---- */
  .health-row{display:flex; align-items:center; gap:22px;}
  .slider-col{display:flex; flex-direction:column; align-items:center; gap:8px;}
  .slider-track{
    width:10px; height:120px; border-radius:6px; background:#0D3226;
    position:relative; overflow:hidden;
  }
  .slider-fill{
    position:absolute; bottom:0; left:0; width:100%; border-radius:6px;
  }
  .slider-knob{
    position:absolute; left:50%; width:18px; height:18px; border-radius:50%;
    background:var(--text); transform:translate(-50%,50%);
    box-shadow:0 2px 6px rgba(0,0,0,0.4);
  }
  .slider-label{font-size:10px; color:var(--text-dim); text-align:center;}
  .slider-val{font-family:'JetBrains Mono', monospace; font-size:12px; font-weight:700; margin-top:2px;}
  .health-badge{
    flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
    text-align:center; gap:6px;
  }
  .badge-ring{position:relative; width:96px; height:96px;}
  .badge-ring .bv{
    position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
    font-family:'JetBrains Mono', monospace; font-size:22px; font-weight:700;
  }
  .badge-label{font-size:11px; color:var(--text-dim); margin-top:4px;}

  /* ---- stats / chips shared ---- */
  .stat-row{display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:14px;}
  .stat-chip{background:var(--card); border:1px solid var(--card-border); border-radius:14px; padding:12px 8px; text-align:center;}
  .stat-chip .sv{font-family:'JetBrains Mono', monospace; font-size:15px; font-weight:700;}
  .stat-chip .sl{font-size:9px; color:var(--text-faint); margin-top:4px; text-transform:uppercase; letter-spacing:0.04em;}

  .chip-row{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px;}
  .chip{font-family:'JetBrains Mono', monospace; font-size:9.5px; padding:5px 9px; border-radius:14px; border:1px solid var(--card-border); color:var(--text-dim);}
  button.chip{ background:var(--card); appearance:none; -webkit-appearance:none; }
  .chip.on{color:#06201A; background:var(--mint); border-color:transparent; font-weight:700;}

  .legend-row{display:flex; gap:16px; margin-bottom:12px;}
  .legend-row .li{display:flex; align-items:center; gap:6px; font-size:11px; color:var(--text-dim);}
  .legend-row .ld{width:8px;height:8px;border-radius:50%;}

  .pattern-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:8px;}
  .pattern-block{background:var(--card); border:1px solid var(--card-border); border-radius:14px; padding:12px 8px; text-align:center;}
  .pattern-block .bar-track{height:60px; display:flex; align-items:flex-end; justify-content:center; margin-bottom:8px;}
  .pattern-block .bar-fill{width:14px; border-radius:6px 6px 2px 2px;}
  .pattern-block .pl{font-size:10px; color:var(--text-dim);}
  .pattern-block .pv{font-family:'JetBrains Mono', monospace; font-size:12px; font-weight:700; margin-top:2px;}

  .seg2{display:flex; background:var(--card); border:1px solid var(--card-border); border-radius:14px; padding:4px; margin-bottom:16px;}
  .seg2 span{flex:1; text-align:center; font-size:10.5px; padding:6px 0; border-radius:9px; color:var(--text-dim); font-weight:600;}
  .seg2 span.active{background:#12352B; color:var(--text);}
  .bill-hero{text-align:center; padding:8px 0 4px;}
  .bill-hero .bl{font-size:12px; color:var(--text-dim); margin-bottom:8px;}
  .bill-hero .bv{font-family:'JetBrains Mono', monospace; font-size:40px; font-weight:700;}
  .bill-hero .bv span{font-size:16px; color:var(--text-dim); font-weight:500;}
  .bill-progress{height:8px; background:#0D3226; border-radius:5px; margin:16px 0 8px; overflow:hidden;}
  .bill-progress .fill{height:100%; background:linear-gradient(90deg,var(--lime),var(--mint)); border-radius:5px;}
  .bill-sub{display:flex; justify-content:space-between; font-size:11px; color:var(--text-dim);}
  .bar-history{display:flex; align-items:flex-end; gap:10px; height:110px; margin-top:6px;}
  .bar-history .bh{flex:1; display:flex; flex-direction:column; align-items:center; gap:6px;}
  .bar-history .bh .stack{width:100%; max-width:26px; border-radius:6px 6px 3px 3px; background:linear-gradient(180deg,var(--mint),#12352B);}
  .bar-history .bh .lab{font-size:9px; color:var(--text-faint);}

  .bill-table{ width:100%; border-collapse:collapse; font-family:'JetBrains Mono', monospace; font-size:11.5px; }
  .bill-table th{ text-align:right; color:var(--text-faint); font-weight:600; font-size:9.5px; text-transform:uppercase; letter-spacing:0.04em; padding:0 0 8px; font-family:'Space Grotesk'; }
  .bill-table th:first-child, .bill-table td:first-child{ text-align:left; }
  .bill-table td{ text-align:right; padding:9px 0; border-top:1px solid var(--hairline); color:var(--text); }
  .bill-table tr.current td{ color:var(--lime); }
  .diff-good{ color:var(--lime); }
  .diff-pending{ color:var(--text-faint); font-style:italic; }

  /* Bill Cards */
  .bill-card{
    background:var(--card); border:1px solid var(--card-border); border-radius:16px;
    margin-bottom:10px; overflow:hidden; cursor:pointer; transition:border-color 0.2s;
  }
  .bill-card:active{ opacity:0.88; }
  .bill-card-header{
    display:flex; align-items:center; justify-content:space-between;
    padding:13px 16px; gap:12px;
  }
  .bill-card-left{ flex:1; }
  .bill-card-month{ font-size:13px; font-weight:700; color:var(--text); margin-bottom:2px; }
  .bill-card-source{ font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-faint); }
  .bill-card-right{ text-align:right; }
  .bill-card-total{ font-family:'JetBrains Mono', monospace; font-size:20px; font-weight:800; color:var(--text); line-height:1; }
  .bill-card-units{ font-size:9.5px; color:var(--text-faint); margin-top:3px; }
  .bill-card-chevron{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.22);
    font-size: 16px;
    font-weight: 700;
    color: var(--mint);
    margin-left: 10px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, border-color 0.2s;
  }
  .bill-card:hover .bill-card-chevron{
    background: rgba(45, 212, 191, 0.16);
    border-color: rgba(45, 212, 191, 0.45);
  }
  .bill-card.expanded .bill-card-chevron{
    transform: rotate(180deg);
    background: rgba(166, 226, 77, 0.16);
    border-color: rgba(166, 226, 77, 0.45);
    color: var(--lime);
  }
  .bill-card-breakdown{
    display:none; padding:0 16px 16px;
    border-top:1px solid var(--hairline);
    padding-top:10px;
  }
  .bill-card.expanded .bill-card-breakdown{ display:block; }
  .bill-bd-row{
    display:flex; justify-content:space-between; align-items:center;
    padding:5px 0; border-bottom:1px solid rgba(255,255,255,0.04);
    font-size:11px;
  }
  .bill-bd-row:last-child{ border-bottom:none; }
  .bill-bd-label{ color:var(--text-dim); font-weight:500; flex:1; padding-right:8px; }
  .bill-bd-val{ font-family:'JetBrains Mono', monospace; font-weight:700; color:var(--text); white-space:nowrap; }
  .bill-bd-total .bill-bd-label{ font-weight:700; color:var(--text); font-size:12px; }
  .bill-bd-total .bill-bd-val{ font-size:15px; color:var(--lime); }

  .log-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }
  .log-list-container > .log-entry {
    margin-bottom: 0;
  }

  .log-entry{
    display:flex; align-items:flex-start; gap:12px;
    padding:12px 14px; border-radius:14px;
    background:rgba(255,255,255,0.025); border:1px solid rgba(255,255,255,0.06);
    transition:all 0.2s cubic-bezier(0.16,1,0.3,1);
  }
  .log-entry:hover{ background:rgba(255,255,255,0.045); border-color:rgba(255,255,255,0.12); }
  .log-entry.live-entry{
    background:rgba(245,158,11,0.07); border-color:rgba(245,158,11,0.3);
    box-shadow:0 4px 20px rgba(0,0,0,0.25);
  }
  .log-dot{ width:8px; height:8px; border-radius:50%; margin-top:5px; flex-shrink:0; }
  .log-icon-pill{
    width:32px; height:32px; border-radius:10px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    background:rgba(255,255,255,0.035); border:1px solid rgba(255,255,255,0.08);
  }
  .log-body{ flex:1; min-width:0; }
  .log-title{ font-size:12.5px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
  .log-sub{ font-size:11px; color:var(--text-dim); margin-top:2px; line-height:1.4; }
  .log-meta{ display:flex; flex-direction:column; align-items:flex-end; gap:4px; flex-shrink:0; }
  .log-time{ font-family:'JetBrains Mono', monospace; font-size:10px; color:var(--text-faint); white-space:nowrap; }
  .log-badge-tag{ font-size:8.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; padding:2px 7px; border-radius:6px; }

  .live-dot{ animation: liveDotPulse 1.6s ease-in-out infinite; }
  #teslaFlowSvg.telemetry-paused{ opacity:.62; }
  @keyframes liveDotPulse{
    0%,100%{ box-shadow:0 0 0 0 rgba(245,182,90,0.55); }
    50%{ box-shadow:0 0 9px 3px rgba(245,182,90,0.55); }
  }
  .live-badge{
    color:var(--warn); font-weight:700; letter-spacing:0.05em;
    animation: liveBadgeFade 1.6s ease-in-out infinite;
  }
  @keyframes liveBadgeFade{
    0%,100%{ opacity:1; }
    50%{ opacity:0.35; }
  }

  /* Compact Refined Settings Section */
  .settings-box {
    background: rgba(10, 24, 18, 0.7);
    border: 1px solid rgba(16, 185, 129, 0.16);
    border-radius: 12px;
    padding: 10px 12px;
  }
  .settings-box-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mint);
    margin-bottom: 7px;
  }
  .settings-lbl {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 3px;
  }
  .settings-input {
    width: 100%;
    height: 34px;
    background: #05140F;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    color: #F1F5F9;
    padding: 0 9px;
    font-size: 11.5px;
    font-family: ui-monospace, 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
  }
  .settings-input:focus {
    border-color: var(--mint);
  }
  select.settings-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    -webkit-appearance: none;
    appearance: none;
  }
  select.settings-input option {
    background: #071F17;
    color: #F1F5F9;
  }


  .batt-modal{
    position:absolute; inset:0; z-index:300; display:none;
    background:rgba(4,16,13,0.75); backdrop-filter:blur(3px);
    align-items:flex-end; justify-content:center;
  }
  .batt-modal.open{ display:flex; }
  .batt-modal-card{
    width:100%; max-height:78%; overflow-y:auto;
    background:#0A2B22; border:1px solid #163B31; border-radius:24px 24px 0 0;
    padding:20px 20px max(28px, calc(28px + env(safe-area-inset-bottom, 0px)));
    overscroll-behavior:contain;
  }
  .batt-modal-head{
    display:flex; justify-content:space-between; align-items:center;
    font-size:15px; font-weight:700; margin-bottom:16px;
  }
  .batt-close{ color:var(--text-dim); cursor:pointer; font-size:16px; padding:4px; }
  .batt-stat-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; }
  .batt-stat{ background:var(--card); border:1px solid var(--card-border); border-radius:12px; padding:10px 8px; text-align:center; }
  .bsv{ font-family:'JetBrains Mono', monospace; font-size:14px; font-weight:700; }
  .bsl{ font-size:9px; color:var(--text-faint); margin-top:4px; }
  .cell-table{ display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:4px; }
  .cell-row{
    display:flex; justify-content:space-between; align-items:center;
    background:var(--card); border:1px solid var(--card-border); border-radius:10px;
    padding:7px 10px; font-family:'JetBrains Mono', monospace; font-size:10.5px;
  }
  .cell-row .cn{ color:var(--text-faint); }
  .cell-row .cv{ color:var(--text); font-weight:600; }

  /* ================= 1. BRAND SPLASH & ICON ANIMATION ================= */
  .splash{
    position:absolute; inset:0; z-index:250;
    background: radial-gradient(130% 90% at 50% -10%, #0C2E24 0%, #061914 50%, #020A07 100%);
    display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px;
    border-radius:44px;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s ease;
  }
  .splash.fade-out{
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .splash-brand-icon{
    position: relative;
    width: 104px; height: 104px;
    display: flex; align-items: center; justify-content: center;
  }
  .splash-glow-halo{
    position: absolute; inset: -14px;
    background: radial-gradient(circle, rgba(52,211,153,0.35) 0%, rgba(166,226,77,0.12) 50%, transparent 70%);
    border-radius: 50%;
    animation: splashGlowPulse 2.2s ease-in-out infinite;
  }
  .splash-rotating-ring{
    position: absolute; inset: -4px;
    border-radius: 32px;
    border: 1.5px dashed rgba(52,211,153,0.45);
    animation: splashRingRotate 10s linear infinite;
  }
  .splash-logo-svg{
    width: 96px; height: 96px;
    animation: splashSquircleEntrance 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.65)) drop-shadow(0 0 16px rgba(52,211,153,0.35));
  }
  .splash-sun-rays{
    transform-origin: 60px 60px;
    animation: splashRaysPulse 2s ease-in-out infinite;
  }
  @keyframes splashSquircleEntrance{
    0% { transform: scale(0.4) rotate(-14deg); opacity: 0; }
    70% { transform: scale(1.08) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
  }
  @keyframes splashGlowPulse{
    0%, 100% { transform: scale(0.92); opacity: 0.5; }
    50% { transform: scale(1.18); opacity: 0.95; }
  }
  @keyframes splashRingRotate{
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  @keyframes splashRaysPulse{
    0%, 100% { transform: scale(0.96); opacity: 0.7; }
    50% { transform: scale(1.06); opacity: 1; stroke: #FDE047; }
  }
  .splash-brand-text{ text-align: center; margin-top: 4px; }
  .splash-title{
    font-size: 24px; font-weight: 800; letter-spacing: 0.08em;
    background: linear-gradient(135deg, #FFFFFF 30%, #A7F3D0 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  .splash-sub{
    font-size: 11.5px; color: var(--text-dim); margin-top: 4px;
    letter-spacing: 0.05em; text-transform: uppercase; font-weight: 500;
  }
  .splash-progress-track{
    width: 170px; height: 3.5px; background: rgba(255,255,255,0.08);
    border-radius: 4px; overflow: hidden; margin-top: 14px; position: relative;
  }
  .splash-progress-bar{
    width: 0%; height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399, #A6E24D);
    border-radius: 4px;
    box-shadow: 0 0 10px #34D399;
    transition: width 1.8s cubic-bezier(0.1, 0.7, 0.1, 1);
  }
  .splash-status-lbl{
    font-size: 11px; color: var(--text-faint); font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em; min-height: 16px;
  }

  /* ================= 2. REAL SOLAR LOGIN SCREEN ================= */
  .login-screen{
    position: absolute; inset: 0; z-index: 220;
    background: radial-gradient(130% 90% at 50% -10%, #0D2D23 0%, #051914 45%, #020A08 100%);
    display: flex; flex-direction: column;
    border-radius: 44px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(18px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .login-screen.open{
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: translateY(0);
  }
  .login-screen::-webkit-scrollbar{ display: none; }
  .login-inner{
    padding: 32px 24px 28px;
    display: flex; flex-direction: column; flex: 1;
    min-height: 100%; justify-content: center;
  }
  .login-badge-row{ display: flex; justify-content: center; margin-bottom: 12px; }
  .login-status-pill{
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25);
    padding: 4px 12px; border-radius: 14px;
    font-size: 11px; font-weight: 600; color: var(--mint);
    font-family: 'JetBrains Mono', monospace;
  }
  .login-live-dot{
    width: 6.5px; height: 6.5px; border-radius: 50%;
    background: #34D399; box-shadow: 0 0 8px #34D399;
    animation: dotGlow 1.8s ease-in-out infinite;
  }
  .login-header{ text-align: center; margin-bottom: 20px; }
  .login-mini-emblem{
    width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 14px;
    background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  }
  .login-title{
    font-size: 22px; font-weight: 700; color: #FFFFFF;
    letter-spacing: -0.01em; margin-bottom: 4px;
  }
  .login-subtitle{
    font-size: 12px; color: var(--text-dim); line-height: 1.4;
  }
  .login-tabs{
    display: flex; gap: 6px; background: rgba(255,255,255,0.04);
    padding: 3px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 18px;
  }
  .login-tab{
    flex: 1; padding: 7px 4px; border: none; background: transparent;
    color: var(--text-dim); font-family: inherit; font-size: 11.5px; font-weight: 600;
    border-radius: 10px; cursor: pointer; transition: all 0.2s ease;
  }
  .login-tab.active{
    background: rgba(52,211,153,0.18); color: #EAFBF3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(52,211,153,0.4);
  }
  .login-form{ display: flex; flex-direction: column; gap: 14px; }
  .login-panel{ display: flex; flex-direction: column; gap: 12px; }
  .login-input.no-icon{ padding-left: 14px; }
  .login-field-group{ display: flex; flex-direction: column; gap: 6px; }
  .login-label{
    font-size: 11px; font-weight: 600; color: var(--text-dim);
    letter-spacing: 0.04em; text-transform: uppercase;
  }
  .login-input-wrap{
    position: relative; display: flex; align-items: center;
    background: rgba(10,34,27,0.7); border: 1px solid #1A4D3E;
    border-radius: 14px; transition: border-color 0.2s, box-shadow 0.2s;
  }
  .login-input-wrap:focus-within{
    border-color: var(--mint);
    box-shadow: 0 0 0 2px rgba(52,211,153,0.22);
  }
  .login-input-icon{
    position: absolute; left: 14px; width: 17px; height: 17px;
    color: var(--text-dim); pointer-events: none;
  }
  .login-input{
    width: 100%; border: none; background: transparent;
    padding: 13px 42px 13px 40px; color: #FFFFFF;
    font-family: inherit; font-size: 13.5px; font-weight: 500;
    outline: none;
  }
  .login-input::placeholder{ color: var(--text-faint); }
  .login-pwd-toggle{
    position: absolute; right: 10px; background: transparent; border: none;
    color: var(--text-dim); cursor: pointer; padding: 6px;
    display: flex; align-items: center; justify-content: center;
  }
  .login-pwd-toggle:hover{ color: var(--text); }
  .login-hint{
    font-size: 10px; color: var(--text-faint); margin-top: 2px;
    line-height: 1.35;
  }
  .login-options-row{
    display: flex; align-items: center; justify-content: space-between;
    font-size: 11.5px; color: var(--text-dim); margin-top: 2px;
  }
  .login-checkbox-label{
    display: flex; align-items: center; gap: 7px; cursor: pointer;
    user-select: none;
  }
  .login-checkbox-label input{
    accent-color: var(--mint); cursor: pointer; width: 14px; height: 14px;
  }
  .login-forgot-link{
    color: var(--mint); text-decoration: none; font-weight: 600;
  }
  .login-forgot-link:hover{ text-decoration: underline; }
  .login-handshake-status{
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(45,212,191,0.1); border: 1px solid rgba(45,212,191,0.25);
    border-radius: 12px; padding: 8px 12px; font-size: 11.5px;
    font-weight: 600; color: var(--mint);
    animation: fadeIn 0.25s ease;
  }
  .handshake-spinner{
    width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid rgba(52,211,153,0.3); border-top-color: var(--mint);
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin{ to{ transform: rotate(360deg); } }
  .login-btn-submit{
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 13px; border-radius: 14px; border: none;
    background: linear-gradient(135deg, #10B981, #34D399);
    color: #041E16; font-family: inherit; font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(16,185,129,0.35);
    margin-top: 4px;
  }
  .login-btn-submit:hover{
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(16,185,129,0.45);
  }
  .login-btn-submit:disabled{
    opacity: 0.75; cursor: not-allowed; transform: none;
  }
  .login-divider{
    display: flex; align-items: center; gap: 12px;
    margin: 4px 0; color: var(--text-faint); font-size: 10px;
    letter-spacing: 0.08em; font-weight: 700;
  }
  .login-divider::before, .login-divider::after{
    content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08);
  }
  .login-btn-biometric{
    display: flex; align-items: center; justify-content: center; gap: 9px;
    width: 100%; padding: 11px; border-radius: 14px;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
  }
  .login-btn-biometric:hover{
    background: rgba(255,255,255,0.07); border-color: rgba(52,211,153,0.35);
  }
  .login-footer{
    text-align: center; font-size: 11.5px; color: var(--text-faint);
    margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 5px;
  }
  .login-footer a{
    color: var(--mint); text-decoration: none; font-weight: 600;
  }
  .login-footer a:hover{ text-decoration: underline; }

  /* Hardware Logger Setup & Refresh Animations */
  .logger-detected-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 78, 59, 0.16) 100%);
    border: 1.5px solid rgba(52, 211, 153, 0.28);
    border-radius: 18px;
    padding: 16px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .logger-detected-card:hover {
    border-color: rgba(52, 211, 153, 0.45);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .logger-pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
    box-shadow: 0 0 6px #10B981;
    animation: loggerRadarPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }
  @keyframes loggerRadarPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
  }
  .logger-icon-refresh-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
  }
  .logger-icon-refresh-btn:hover {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.45);
    color: #FFFFFF;
    transform: scale(1.08);
  }
  .logger-icon-refresh-btn:active {
    transform: scale(0.92);
  }
  .logger-icon-refresh-btn.is-spinning svg,
  .refresh-svg-icon.is-spinning {
    animation: rotateRefresh 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  }
  @keyframes rotateRefresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  .logger-connect-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .logger-connect-btn:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
  }
  .logger-connect-btn:hover .btn-arrow {
    transform: translateX(3px);
  }
  .logger-connect-btn .btn-arrow {
    transition: transform 0.2s ease;
    display: inline-block;
  }
  .logger-pair-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.2s ease;
  }
  .logger-pair-card:hover {
    border-color: rgba(52, 211, 153, 0.25);
  }
  .logger-pair-btn {
    width: auto;
    padding: 7px 13px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.08);
    color: var(--mint);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .logger-pair-btn:hover {
    background: rgba(52, 211, 153, 0.18);
    border-color: rgba(52, 211, 153, 0.5);
    color: #FFFFFF;
    transform: translateY(-0.5px);
  }

  /* Universal Google Auth Hero Button (Supabase Auth) */
  .btn-google-auth-hero{
    display: flex; align-items: center; justify-content: center; gap: 14px;
    width: 100%; padding: 13px 18px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    cursor: pointer; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  }
  .btn-google-auth-hero:hover{
    background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.06) 100%);
    border-color: rgba(52,211,153,0.5);
    transform: translateY(-1.5px);
    box-shadow: 0 8px 25px rgba(52,211,153,0.2), inset 0 1px 0 rgba(255,255,255,0.25);
  }
  .btn-google-auth-hero:active{ transform: scale(0.985); }

  /* Aesthetic Setup Action Boxes (Tesla/Luxury Cyberpunk Style) */
  .setup-box-card{
    display: flex; align-items: center; gap: 12px;
    padding: 13px 14px; border-radius: 16px;
    background: rgba(10, 35, 28, 0.55);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    cursor: pointer; transition: all 0.25s ease;
    text-align: left;
  }
  .setup-box-card:hover{
    background: rgba(16, 48, 38, 0.85);
    border-color: rgba(52,211,153,0.4);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  }
  .setup-box-card:active{ transform: scale(0.985); }
  .setup-box-icon{
    width: 38px; height: 38px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; flex-shrink: 0;
  }
  .setup-box-body{ flex: 1; min-width: 0; }
  .setup-box-title{
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 700; color: #FFFFFF;
  }
  .setup-box-pill{
    font-size: 9px; font-weight: 800; text-transform: uppercase;
    padding: 1.5px 6px; border-radius: 999px;
    background: rgba(52,211,153,0.15); color: var(--mint);
    border: 1px solid rgba(52,211,153,0.3);
  }
  .setup-box-desc{
    font-size: 10.5px; color: var(--text-dim); line-height: 1.35; margin-top: 2px;
  }
  .setup-box-arrow{
    font-size: 15px; color: var(--text-faint); transition: transform 0.2s ease, color 0.2s ease;
  }
  .setup-box-card:hover .setup-box-arrow{
    transform: translateX(3px); color: var(--mint);
  }

  /* Universal Google Auth Button */
  .login-btn-google{
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11.5px; border-radius: 14px;
    background: #ffffff; color: #1f2937; border: 1px solid rgba(0,0,0,0.1);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    margin-bottom: 8px;
  }
  .login-btn-google:hover{
    background: #f8fafc; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  /* Universal Setup Wizard Launch Button */
  .login-btn-wizard{
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 11px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(52,211,153,0.15), rgba(16,185,129,0.25));
    border: 1px solid rgba(52,211,153,0.4);
    color: var(--mint); font-family: inherit; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease;
    margin-top: 8px;
  }
  .login-btn-wizard:hover{
    background: linear-gradient(135deg, rgba(52,211,153,0.25), rgba(16,185,129,0.35));
    transform: translateY(-1px);
  }

  /* Wizard Brand Selection Grid */
  .brand-card-grid{
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0;
  }
  .brand-card{
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: 12px; padding: 12px 10px; text-align: center;
    cursor: pointer; transition: all 0.2s ease;
  }
  .brand-card:hover{
    border-color: rgba(52,211,153,0.4); background: rgba(52,211,153,0.05);
  }
  .brand-card.selected{
    border-color: var(--mint); background: rgba(52,211,153,0.12);
    box-shadow: 0 0 12px rgba(52,211,153,0.2);
  }
  .brand-card-icon{ font-size: 22px; margin-bottom: 4px; }
  .brand-card-name{ font-size: 13px; font-weight: 700; color: var(--text); }
  .brand-card-sub{ font-size: 10px; color: var(--text-faint); margin-top: 2px; }

  /* Wizard Connection Tabs */
  .wiz-conn-tabs{
    display: flex; gap: 6px; background: rgba(0,0,0,0.25); padding: 4px;
    border-radius: 10px; margin-bottom: 14px;
  }
  .wiz-conn-tab{
    flex: 1; text-align: center; font-size: 10.5px; font-weight: 600;
    padding: 7px 4px; border-radius: 8px; border: none; background: transparent;
    color: var(--text-dim); cursor: pointer; transition: all 0.2s ease;
  }
  .wiz-conn-tab.active{
    background: var(--mint); color: #041E16; font-weight: 700;
  }

  /* Radar Animation */
  .wiz-radar-box{
    position: relative; width: 68px; height: 68px; margin: 10px auto;
    display: flex; align-items: center; justify-content: center;
  }
  .wiz-radar-circle{
    position: absolute; inset: 0; border-radius: 50%;
    border: 1.5px solid rgba(52,211,153,0.4);
  }
  .wiz-radar-box.scanning .wiz-radar-circle{
    animation: radarRipple 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes radarRipple{
    0% { transform: scale(0.4); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
  }

  /* Discovered Device Cards */
  .discovered-device-card{
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-radius: 12px; margin-bottom: 8px;
    background: var(--card); border: 1px solid var(--card-border);
    transition: all 0.2s ease; text-align: left;
  }
  .discovered-device-card.recommended{
    border-color: rgba(52,211,153,0.4);
    background: linear-gradient(135deg, rgba(52,211,153,0.06), rgba(0,0,0,0.2));
  }
  .discovered-device-card.active-picked{
    border-color: var(--mint); box-shadow: 0 0 10px rgba(52,211,153,0.25);
  }
  .btn-device-select{
    padding: 5px 12px; border-radius: 8px; border: none; cursor: pointer;
    background: var(--mint); color: #041E16; font-size: 11.5px; font-weight: 700;
  }
  .btn-device-select:hover{ filter: brightness(1.1); }

  /* Battery Radio Cards */
  .batt-type-grid{
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0;
  }
  .batt-type-card{
    background: var(--card); border: 1px solid var(--card-border);
    border-radius: 10px; padding: 10px 6px; text-align: center;
    cursor: pointer; transition: all 0.2s ease;
  }
  .batt-type-card.selected{
    border-color: var(--mint); background: rgba(52,211,153,0.12);
  }

  @media (max-width: 600px) {
    .splash{ border-radius: 0; }
    .login-screen{ border-radius: 0; }
  }

  .sidebar-overlay{
    position:absolute; inset:0; z-index:150; background:rgba(4,16,13,0.6);
    opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity 0.28s ease, visibility 0.28s ease;
    border-radius:44px;
  }
  .sidebar-overlay.open{ opacity:1; visibility:visible; pointer-events:auto; }
  .sidebar-panel{
    position:absolute; top:0; left:0; bottom:0; width:78%; max-width:280px;
    background:#0A2B22; border-right:1px solid #163B31;
    padding:20px 16px; transform:translateX(-100%); transition:transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display:flex; flex-direction:column; gap:2px;
  }
  .sidebar-overlay.open .sidebar-panel{ transform:translateX(0); }
  .sidebar-head{ font-size:15px; font-weight:700; margin-bottom:4px; }
  .sidebar-sub{ font-size:11px; color:var(--text-faint); margin-bottom:18px; }
  .sidebar-item{
    display:flex; align-items:center; gap:12px; padding:12px 8px; border-radius:12px;
    font-size:13.5px; cursor:pointer; color:var(--text);
  }
  .sidebar-item:hover{ background:rgba(255,255,255,0.04); }
  .sidebar-item svg{ width:18px; height:18px; flex-shrink:0; }
  .sidebar-item-copy{display:flex; flex:1; min-width:0; flex-direction:column; gap:2px;}
  .sidebar-item-copy small{font-size:10px; color:var(--text-faint); font-family:'JetBrains Mono',monospace;}
  .sidebar-item.danger{ color:var(--load,#E08462); }
  .sidebar-divider{ height:1px; background:var(--hairline); margin:10px 0; }
  .sidebar-toggle{
    margin-left:auto; width:34px; height:20px; border-radius:10px; background:var(--hairline);
    position:relative; flex-shrink:0;
  }
  .sidebar-toggle.on{ background:var(--mint); }
  .sidebar-toggle::after{
    content:''; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%;
    background:#fff; transition:left 0.2s;
  }
  .sidebar-toggle.on::after{ left:16px; }

  .wizard-step{ display:none; }
  .wizard-step.active{ display:block; }
  .wizard-dots{ display:flex; gap:6px; justify-content:center; margin:14px 0; }
  .wizard-dot{ width:6px; height:6px; border-radius:50%; background:var(--hairline); }
  .wizard-dot.active{ background:var(--mint); width:18px; border-radius:3px; }
  .wizard-input{
    width:100%; box-sizing:border-box; background:var(--card); border:1px solid var(--card-border);
    border-radius:12px; padding:12px 14px; color:var(--text); font-family:'JetBrains Mono'; font-size:14px; margin:10px 0;
  }
  .wizard-btn{
    width:100%; padding:13px; border-radius:14px; border:none; cursor:pointer;
    background:var(--mint); color:#06201A; font-family:'Space Grotesk'; font-weight:700; font-size:14px; margin-top:8px;
  }
  .wizard-btn.secondary{ background:var(--card); color:var(--text-dim); border:1px solid var(--card-border); }

  .param-chip.on{ font-weight:700; border-color:transparent; color:#06201A; }

  .row-line{display:flex; align-items:center; justify-content:space-between; padding:14px 2px; border-bottom:1px solid var(--hairline);}
  .row-line .left{display:flex; align-items:center; gap:12px;}
  .row-line .bar{width:3px; height:26px; border-radius:2px;}
  .row-line .name{font-size:14px; font-weight:500;}
  .row-line .name .sub{display:block; font-size:11px; color:var(--text-faint); margin-top:2px; font-weight:400;}
  .row-line .val{font-family:'JetBrains Mono', monospace; font-size:15px; font-weight:600;}
  .row-line .val span{font-size:10px; color:var(--text-dim); font-weight:400;}

  .caption{text-align:center; font-size:11px; color:var(--text-faint); margin:16px 0 4px;}

  .bottomnav{
    position:absolute; bottom:0; left:0; right:0; height:84px;
    background: linear-gradient(180deg, rgba(6,32,26,0) 0%, rgba(6,32,26,0.96) 28%, #06201A 100%);
    display:flex; align-items:flex-start; padding-top:14px; justify-content:space-around;
    z-index: 100;
  }
  .navitem{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.16s ease;
    user-select: none;
    -webkit-user-select: none;
    padding: 2px 14px;
  }
  .navitem svg{
    width: 20px;
    height: 20px;
    stroke: currentColor;
    display: block;
    transition: transform 0.16s ease, stroke 0.16s ease;
  }
  .navitem.active{
    color: var(--mint);
    font-weight: 700;
  }
  .navitem.active svg{
    stroke: var(--mint);
  }
  /* ============================================================
     UNIFIED DYNAMIC CHART & ENERGY FLOWS STYLING
     ============================================================ */
  .timeframe-scroll-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    touch-action: pan-x;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
  }
  .timeframe-scroll-container:active {
    cursor: grabbing;
  }
  .timeframe-scroll-container::-webkit-scrollbar { display: none; }
  .timeframe-bar {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
    padding: 0 6px;
  }
  .tf-btn {
    padding: 6px 13px;
    border-radius: 18px;
    font-size: 11.5px;
    font-weight: 600;
    font-family: 'Space Grotesk', -apple-system, sans-serif;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.16s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .tf-btn:active { transform: scale(0.96); }
  .tf-btn.active {
    background: rgba(45, 212, 191, 0.16);
    color: var(--mint);
    border-color: rgba(45, 212, 191, 0.45);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
  }
  .chart-status-badge {
    text-transform: none;
    letter-spacing: 0;
    color: var(--mint);
    font-size: 10px;
    font-weight: 600;
    background: rgba(45, 212, 191, 0.12);
    padding: 2px 8px;
    border-radius: 10px;
  }
  .param-preset-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px;
    margin: 10px 0 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .param-preset-row::-webkit-scrollbar { display: none; }
  .preset-btn {
    padding: 3.5px 9px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-faint);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.14s ease;
  }
  .preset-btn.active {
    background: rgba(45, 212, 191, 0.14);
    color: var(--mint);
    border-color: rgba(45, 212, 191, 0.35);
  }
  .param-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
    padding: 0 2px;
  }
  .param-chip {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 9.5px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-faint);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.14s ease;
  }
  .param-chip.on {
    color: #FFFFFF;
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.2);
  }
  .param-chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
  }
  .ef-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 4px 10px;
  }
  .ef-title {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.01em;
  }
  .ef-bolt { color: #2DD4BF; }
  .ef-pagination {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    background: transparent;
    padding: 0;
    border-radius: 20px;
    border: 0;
    box-shadow: none;
  }
  .ef-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-dim);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.16s ease;
  }
  .ef-nav-btn:active {
    background: rgba(52, 211, 153, 0.22);
    color: var(--mint);
    transform: scale(0.92);
  }
  .ef-page-num {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .ef-nav-btn { background: transparent; opacity: .58; }
  .param-chart-viewport { position:relative; width:100%; overflow:hidden !important; touch-action:none !important; user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; }
  .param-chart-viewport.month-mode { overflow-x:auto !important; overflow-y:hidden !important; touch-action:pan-x !important; -webkit-overflow-scrolling:touch; scrollbar-width:thin; scrollbar-color:rgba(45,212,191,.35) transparent; }
  .param-chart-viewport:not(.month-mode) svg { max-width: 100%; display:block; }
  .param-chart-viewport.month-mode svg { max-width: none !important; display:block; height: 225px !important; min-height: 225px; }
  .chart-expand-btn { position:absolute; top:5px; right:5px; z-index:3; width:27px; height:27px; display:grid; place-items:center; border:1px solid rgba(45,212,191,.24); border-radius:9px; background:rgba(4,28,21,.82); color:var(--mint); cursor:pointer; opacity:.72; }
  .chart-expand-btn:hover, .chart-expand-btn:focus-visible { opacity:1; background:rgba(12,60,45,.95); }
  .usage-arrange-row { display:flex; justify-content:flex-end; margin:-1px 0 12px; }
  .usage-arrange-row .arrange-pill-btn { opacity:.82; }
  .chart-expanded-modal { position:fixed; inset:0; z-index:1200; display:none; align-items:center; justify-content:center; padding:16px; background:rgba(0,0,0,.76); backdrop-filter:blur(5px); }
  .chart-expanded-modal.open { display:flex; }
  .chart-expanded-sheet { width:min(1100px, 100%); max-height:94vh; overflow:auto; padding:16px; border:1px solid rgba(45,212,191,.28); border-radius:18px; background:#071d17; box-shadow:0 24px 80px rgba(0,0,0,.55); }
  .chart-expanded-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; color:#e8fff6; font-weight:700; }
  .chart-expanded-close { width:32px; height:32px; border-radius:10px; border:1px solid rgba(45,212,191,.25); background:rgba(45,212,191,.08); color:var(--mint); cursor:pointer; }
  .chart-expanded-values { display:grid; grid-template-columns:repeat(4,minmax(92px,1fr)); gap:6px; margin-top:12px; }
  .chart-value-cell { min-width:0; padding:7px 8px; border:1px solid rgba(45,212,191,.12); border-radius:9px; background:rgba(10,49,38,.55); font:10px 'JetBrains Mono',monospace; color:var(--text-dim); }
  .chart-value-cell strong { display:block; margin-bottom:4px; color:#e8fff6; }
  @media(max-width:600px) { .chart-expanded-modal { padding:7px; } .chart-expanded-sheet { padding:11px; max-height:96vh; } .chart-expanded-values { grid-template-columns:repeat(2,minmax(100px,1fr)); } }
  .ef-carousel-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
  }
  .ef-carousel-track {
    display: flex;
    width: 200%;
    transition: transform 0.32s cubic-bezier(0.25, 1, 0.5, 1);
  }
  .ef-page {
    width: 50%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 8px;
    padding: 2px 2px;
    box-sizing: border-box;
  }
  .ef-card {
    position: relative;
    background: linear-gradient(160deg, rgba(14, 45, 36, 0.92) 0%, rgba(5, 24, 18, 0.96) 100%);
    border: 1px solid rgba(75, 220, 185, 0.14);
    border-radius: 14px;
    padding: 10px 12px 10px 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
    box-sizing: border-box;
    box-shadow: 0 4px 14px -3px rgba(0, 15, 10, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.16s ease;
  }
  .ef-card:active {
    transform: scale(0.985);
  }
  /* Glass Specular Top Highlight */
  .ef-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    border-radius: 14px 14px 0 0;
  }
  /* Luminous Accent Edge Pill (Matching Image 4) */
  .ef-card-bar {
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3.5px;
    border-radius: 0 3px 3px 0;
    background: var(--ef-color, var(--mint));
    box-shadow: 0 0 6px var(--ef-color, var(--mint));
  }
  /* Subtle technical watermark graphic */
  .ef-card-watermark {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 36px;
    height: 36px;
    opacity: 0.04;
    pointer-events: none;
    color: var(--ef-color, var(--mint));
    z-index: 1;
  }
  .ef-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    position: relative;
    z-index: 2;
  }
  .ef-icon-wrap {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .ef-card-icon {
    width: 24px;
    height: 24px;
    /* Clean, crisp vector icon — NO heavy neon drop-shadow glow haze (matched to Image 4) */
  }
  .ef-card-body {
    position: relative;
    z-index: 2;
  }
  .ef-card-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 19px;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.1;
    margin-bottom: 2px;
    letter-spacing: -0.02em;
  }
  .ef-card-unit {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-left: 4px;
    letter-spacing: 0.02em;
  }
  .ef-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #EAFBF3;
    line-height: 1.2;
    letter-spacing: 0.01em;
  }
  .ef-card-sub {
    display: none;
  }
  .ef-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 12px;
  }
  .ef-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(75, 220, 185, 0.22);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
  }
  .ef-dot.active {
    background: var(--mint);
    transform: scale(1.35);
    box-shadow: 0 0 10px var(--mint), 0 0 3px var(--mint);
  }
  .ef-perf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
  }
  .ef-perf-card {
    position: relative;
    background: linear-gradient(160deg, rgba(14, 45, 36, 0.92) 0%, rgba(5, 24, 18, 0.96) 100%);
    border: 1px solid rgba(75, 220, 185, 0.14);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 62px;
    box-shadow: 0 4px 14px -3px rgba(0, 15, 10, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  .ef-perf-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 14px 14px 0 0;
  }
  .ef-perf-title {
    font-size: 13px;
    font-weight: 600;
    color: #EAFBF3;
    line-height: 1.25;
    letter-spacing: 0.01em;
  }
  .ef-perf-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
    color: #FFFFFF;
  }
  .ef-perf-lbl {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    margin-top: 3px;
  }
  .ef-mini-donut {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #usage .stat-chip {
    position: relative;
    background: linear-gradient(160deg, rgba(14, 45, 36, 0.92) 0%, rgba(5, 24, 18, 0.96) 100%);
    border: 1px solid rgba(75, 220, 185, 0.14);
    border-radius: 12px;
    padding: 8px 6px;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 4px 14px -4px rgba(0, 15, 10, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }
  #usage .stat-chip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
    border-radius: 12px 12px 0 0;
  }
  #usage .stat-chip::after {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 2px 2px 0;
    background: var(--sc-color, var(--mint));
    box-shadow: 0 0 5px var(--sc-color, var(--mint));
  }
  .sc-icon-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 2px;
  }

  /* ============================================================
     BOX REORDERING & ARRANGE MODAL STYLES
     ============================================================ */
  .arrange-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.25);
    color: var(--mint);
    font-size: 10.5px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    cursor: pointer;
    transition: all 0.16s ease;
    user-select: none;
    -webkit-user-select: none;
  }
  .arrange-pill-btn:hover {
    background: rgba(45, 212, 191, 0.16);
    border-color: rgba(45, 212, 191, 0.45);
  }
  .arrange-pill-btn:active {
    transform: scale(0.94);
    background: rgba(45, 212, 191, 0.22);
  }

  .box-order-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 14, 11, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .box-order-modal.open {
    opacity: 1;
    pointer-events: auto;
  }
  .box-order-sheet {
    background: linear-gradient(180deg, #0A2920 0%, #061A14 100%);
    border: 1px solid rgba(45, 212, 191, 0.28);
    border-bottom: none;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(45, 212, 191, 0.15);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .box-order-modal.open .box-order-sheet {
    transform: translateY(0);
  }
  .box-order-header {
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .box-order-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
  }
  .box-order-tab {
    flex: 1;
    padding: 7px 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-align: center;
    transition: all 0.16s ease;
  }
  .box-order-tab.active {
    background: rgba(45, 212, 191, 0.18);
    color: var(--mint);
    border-color: rgba(45, 212, 191, 0.5);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
  }
  .box-order-list {
    padding: 12px 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .box-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
  }
  .box-order-item.dragging {
    opacity: 0.45;
    background: rgba(45, 212, 191, 0.12);
    border-color: var(--mint);
  }
  .box-order-item.drag-over {
    border-top: 2px solid var(--mint);
    transform: translateY(2px);
  }
  .box-order-handle {
    color: var(--text-dim);
    cursor: grab;
    padding: 2px 4px;
    display: flex;
    align-items: center;
    opacity: 0.7;
    font-size: 14px;
    line-height: 1;
  }
  .box-order-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    width: 22px;
  }
  .box-order-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .box-order-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #FFFFFF;
  }
  .box-order-page-tag {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(45, 212, 191, 0.15);
    color: var(--mint);
    border: 1px solid rgba(45, 212, 191, 0.3);
  }
  .box-order-actions {
    display: flex;
    gap: 4px;
  }
  .box-order-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #EAFBF3;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 11px;
  }
  .box-order-btn:hover, .box-order-btn:active {
    background: rgba(45, 212, 191, 0.22);
    color: var(--mint);
    border-color: rgba(45, 212, 191, 0.45);
  }
  .box-order-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
  }
  .box-order-divider {
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--mint);
    background: rgba(45, 212, 191, 0.08);
    border-radius: 8px;
    border: 1px dashed rgba(45, 212, 191, 0.3);
    text-align: center;
    margin: 4px 0;
  }
  .box-order-footer {
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

/* WCAG 2.2 Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .splash-rotating-ring, .splash-glow-halo, .ef-particle, .live-dot, .login-live-dot {
    animation: none !important;
  }
}
/* ==========================================================================
   Inverter Hardware Parameters & Control Modal Styles
   ========================================================================== */
.inv-control-modal-card {
  width: 95%;
  max-width: 560px;
  background: var(--card-bg, #0B111A);
  border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(45, 212, 191, 0.08);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  position: relative;
  animation: invModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes invModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.inv-modal-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-title-group h3 {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text, #FFF);
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-title-group .inv-subtitle {
  margin: 2px 0 0;
  font-size: 10.5px;
  color: var(--text-dim, #94A3B8);
  font-family: 'JetBrains Mono', monospace;
}

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

.inv-sync-btn {
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--mint, #2DD4BF);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.inv-sync-btn:hover {
  background: rgba(45, 212, 191, 0.2);
}

.inv-sync-btn.spin-active .spin-icon {
  animation: spin 0.8s linear infinite;
}

.inv-close-btn {
  background: none;
  border: none;
  color: var(--text-dim, #94A3B8);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.inv-close-btn:hover {
  color: var(--text, #FFF);
}

.inv-tab-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 12px;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.inv-tab-nav::-webkit-scrollbar {
  display: none;
}

.inverter-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-dim, #94A3B8);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.inverter-tab-btn:hover {
  color: var(--text, #FFF);
  background: rgba(255, 255, 255, 0.04);
}

.inverter-tab-btn.active {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.35);
  color: var(--mint, #2DD4BF);
}

.inv-modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inv-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint, #64748B);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mode Selection Cards */
.inv-mode-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.inv-mode-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.inv-mode-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.inv-mode-card.selected {
  background: rgba(45, 212, 191, 0.08);
  border-color: var(--mint, #2DD4BF);
  box-shadow: 0 0 15px rgba(45, 212, 191, 0.15);
}

.inv-mode-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #FFF);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inv-mode-card.selected .inv-mode-code {
  color: var(--mint, #2DD4BF);
}

.inv-mode-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim, #94A3B8);
  margin-bottom: 4px;
}

.inv-mode-desc {
  font-size: 9.5px;
  color: var(--text-faint, #64748B);
  line-height: 1.35;
}

/* Preset Pills */
.inv-preset-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.inv-preset-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 10.5px;
  color: var(--text-dim, #94A3B8);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}

.inv-preset-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #FFF);
}

.inv-preset-pill.active {
  background: rgba(45, 212, 191, 0.2);
  border-color: var(--mint, #2DD4BF);
  color: var(--mint, #2DD4BF);
}

/* Stepper & Slider Field Cards */
.inv-stepper-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.inv-stepper-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text, #FFF);
}

.inv-stepper-sub {
  font-size: 9.5px;
  color: var(--text-faint, #64748B);
}

.inv-stepper-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-step-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text, #FFF);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.inv-step-btn:hover {
  background: rgba(45, 212, 191, 0.2);
  border-color: var(--mint, #2DD4BF);
  color: var(--mint, #2DD4BF);
}

.inv-num-input {
  width: 65px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--mint, #2DD4BF);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
}

.inv-range-slider {
  width: 100%;
  accent-color: var(--mint, #2DD4BF);
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  cursor: pointer;
}

/* Guardrail Warning Card */
.inv-guardrail-card {
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 6px;
  transition: all 0.2s ease;
}

.inv-guardrail-card.safe {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.inv-guardrail-card.error {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Toggle rows */
.inv-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 11px 14px;
}

.inv-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #FFF);
}

.inv-toggle-sub {
  font-size: 10px;
  color: var(--text-faint, #64748B);
  margin-top: 2px;
}

/* Custom Inverter Toggle Switches */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #94A3B8;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: rgba(45, 212, 191, 0.3);
  border-color: #2DD4BF;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.35);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
  background-color: #2DD4BF;
}

/* Modal Footer */
.inv-modal-footer {
  padding: 12px 20px 16px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inv-changes-badge {
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.3);
  color: var(--mint, #2DD4BF);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  display: none;
}

.inv-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-btn-discard {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #F87171;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  display: none;
  transition: all 0.15s ease;
}

.inv-btn-discard:hover {
  background: rgba(239, 68, 68, 0.2);
}

.inv-btn-apply {
  background: linear-gradient(135deg, #10B981, #059669);
  border: none;
  color: #FFF;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.inv-btn-apply:hover {
  background: linear-gradient(135deg, #34D399, #10B981);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.5);
}

.inv-btn-apply:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Confirmation Dialog */
.inv-confirm-card {
  width: 90%;
  max-width: 460px;
  background: #0B111A;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(245, 158, 11, 0.15);
  animation: invModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   INVERTER CONTROLS — COMPLETE REDESIGN (IMAGES 1, 2, 3 SPECIFICATION)
   ========================================================================== */

/* Section Boxes */
.inv-section-box {
  background: rgba(13, 22, 21, 0.65);
  border: 1px solid rgba(45, 212, 191, 0.14);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.inv-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.inv-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inv-section-title-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inv-section-title-icon svg {
  width: 17px;
  height: 17px;
}

.inv-section-title-icon.lightning {
  background: rgba(45, 212, 191, 0.12);
  color: var(--mint, #2DD4BF);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.inv-section-title-icon.batt {
  background: rgba(16, 185, 129, 0.12);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.inv-section-title-icon.wave {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.inv-section-title-icon.export {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.inv-section-title-icon.gear {
  background: rgba(148, 163, 184, 0.12);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.inv-section-title-icon.clock {
  background: rgba(245, 158, 11, 0.12);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.inv-section-heading {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #F1F5F9;
  letter-spacing: -0.01em;
}

.inv-section-subheading {
  font-size: 10.5px;
  color: #94A3B8;
  margin-top: 1px;
}

/* Info ⓘ Button (Strictly Informational) */
.inv-info-btn {
  background: transparent;
  border: none;
  color: #2DD4BF;
  opacity: 0.75;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.inv-info-btn svg {
  width: 20px;
  height: 20px;
}

.inv-info-btn:hover {
  opacity: 1;
  background: rgba(45, 212, 191, 0.12);
  transform: scale(1.08);
}

/* Redesigned Mode Selector Grid (Image 1) */
.inv-mode-cards-grid {
  display: grid;
  gap: 8px;
}

.inv-mode-cards-grid.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.inv-mode-cards-grid.col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.inv-mode-cards-grid .inv-mode-card {
  background: rgba(10, 18, 17, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.14);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 90px;
}

.inv-mode-cards-grid .inv-mode-card:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(13, 26, 24, 0.95);
}

.inv-mode-cards-grid .inv-mode-card.selected {
  background: linear-gradient(180deg, rgba(20, 83, 75, 0.3) 0%, rgba(13, 38, 35, 0.4) 100%);
  border: 1.5px solid #2DD4BF;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.22), inset 0 0 12px rgba(45, 212, 191, 0.1);
}

.inv-card-badge-row {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inv-card-icon {
  width: 22px;
  height: 22px;
}

.inv-mode-cards-grid .inv-mode-card .inv-mode-code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #F8FAFC;
  margin-bottom: 2px;
  justify-content: center;
}

.inv-mode-cards-grid .inv-mode-card.selected .inv-mode-code {
  color: #2DD4BF;
}

.inv-mode-cards-grid .inv-mode-card .inv-mode-name {
  font-size: 10px;
  color: #94A3B8;
  font-weight: 500;
  white-space: nowrap;
}

.inv-mode-cards-grid .inv-mode-card.selected .inv-mode-name {
  color: #E2E8F0;
  font-weight: 600;
}

.inv-mode-range {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #38BDF8;
  margin-top: 1px;
}

.inv-mode-sub {
  font-size: 9.5px;
  color: #64748B;
  margin-top: 1px;
}

/* Image 1 Bottom Bar (No Pending Changes vs Review & Apply) */
.inv-no-changes-bar {
  width: 100%;
  background: rgba(13, 26, 24, 0.8);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.inv-no-changes-check {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(45, 212, 191, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.35);
  color: #2DD4BF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.inv-no-changes-check svg {
  width: 16px;
  height: 16px;
}

.inv-no-changes-text {
  flex: 1;
}

.inv-no-changes-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #2DD4BF;
}

.inv-no-changes-sub {
  font-size: 10px;
  color: #94A3B8;
  margin-top: 1px;
}

.inv-no-changes-arrow {
  color: #2DD4BF;
  font-size: 18px;
  opacity: 0.6;
}

.inv-has-changes-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(20, 83, 75, 0.4) 0%, rgba(13, 38, 35, 0.6) 100%);
  border: 1px solid #2DD4BF;
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 0 25px rgba(45, 212, 191, 0.25);
}

.inv-has-changes-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.inv-has-changes-text {
  font-size: 11px;
  color: #E2E8F0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-has-changes-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   IMAGE 2 & 3: INFORMATION POPUP MODAL (READ-ONLY)
   ========================================================================== */

.inv-info-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10020;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: invBackdropFadeIn 0.2s ease-out;
}

@keyframes invBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.inv-info-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  background: linear-gradient(180deg, #091210 0%, #050a09 100%);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(45, 212, 191, 0.12);
  display: flex;
  flex-direction: column;
  animation: invSheetSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes invSheetSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.inv-info-sheet-handle-bar {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 10px auto 4px;
}

.inv-info-sheet-header {
  padding: 10px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.inv-info-sheet-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #FFF;
  letter-spacing: -0.01em;
}

.inv-info-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94A3B8;
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.inv-info-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
}

.inv-info-sheet-body {
  padding: 16px 18px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
}

/* Individual Option Cards inside Info Modal (Image 2) */
.inv-info-card {
  border-radius: 18px;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inv-info-card.theme-solar {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, rgba(13, 20, 18, 0.9) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: inset 0 0 25px rgba(245, 158, 11, 0.04);
}

.inv-info-card.theme-batt {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, rgba(13, 20, 18, 0.9) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: inset 0 0 25px rgba(16, 185, 129, 0.04);
}

.inv-info-card.theme-grid {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.06) 0%, rgba(13, 20, 18, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 0 25px rgba(56, 189, 248, 0.04);
}

.inv-info-card-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.inv-info-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-solar .inv-info-card-icon {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.theme-batt .inv-info-card-icon {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.theme-grid .inv-info-card-icon {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.inv-info-card-icon svg {
  width: 24px;
  height: 24px;
}

.inv-info-card-title-group {
  flex: 1;
}

.inv-info-card-code-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.inv-info-code {
  color: #FFF;
}

.theme-solar .inv-info-name {
  color: #FBBF24;
}

.theme-batt .inv-info-name {
  color: #34D399;
}

.theme-grid .inv-info-name {
  color: #38BDF8;
}

.inv-info-dash {
  color: #64748B;
}

.inv-info-card-desc {
  font-size: 11px;
  color: #CBD5E1;
  line-height: 1.45;
}

/* Numbered Load Priority Box (Image 2) */
.inv-info-priority-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 12px;
}

.inv-info-priority-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748B;
  font-weight: 600;
  margin-bottom: 6px;
}

.inv-info-priority-pills {
  display: flex;
  gap: 8px;
}

.inv-priority-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 5px 8px;
}

.inv-priority-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.inv-priority-pill.solar .inv-priority-num {
  background: #F59E0B;
  color: #000;
}

.inv-priority-pill.batt .inv-priority-num {
  background: #10B981;
  color: #000;
}

.inv-priority-pill.grid .inv-priority-num {
  background: #38BDF8;
  color: #000;
}

.inv-priority-txt {
  font-size: 10.5px;
  font-weight: 600;
  color: #E2E8F0;
}

/* Side-by-side Best for & When to use grid */
.inv-info-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inv-info-meta-col {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 10px 12px;
}

.inv-info-meta-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.inv-info-meta-hdr svg {
  width: 14px;
  height: 14px;
}

.inv-info-meta-col.best-for .inv-info-meta-hdr {
  color: #FBBF24;
}

.inv-info-meta-col.when-to-use .inv-info-meta-hdr {
  color: #34D399;
}

.inv-info-bullets {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inv-info-bullet {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 10px;
  color: #CBD5E1;
  line-height: 1.35;
}

.inv-bullet-check {
  width: 12px;
  height: 12px;
  color: #10B981;
  flex-shrink: 0;
  margin-top: 1px;
}

.inv-info-when-text {
  font-size: 10px;
  color: #CBD5E1;
  line-height: 1.4;
}

/* HK Solar visual system: explicit, audited tokens scoped to the optional theme. */
body.theme-hk-solar {
  --hk-bg: #071018;
  --hk-bg-raised: #0B1821;
  --hk-surface: #101F29;
  --hk-surface-raised: #142630;
  --hk-border: #263C45;
  --hk-hairline: #1B3039;
  --hk-text: #F1F7F6;
  --hk-muted: #B1C2C2;
  --hk-subtle: #879C9E;
  --hk-teal: #54DDD1;
  --hk-teal-strong: #74F0E3;
  --hk-lime: #C5ED65;
  --hk-solar: #FFD276;
  --hk-battery: #64E7A2;
  --hk-grid: #B8A0FF;
  --hk-danger: #FF8888;
  --hk-focus: #D8F48D;
  --hk-shadow: 0 18px 44px rgba(0, 0, 0, .34);
  --bg: var(--hk-bg);
  --bg2: var(--hk-bg-raised);
  --card: rgba(16, 31, 41, .94);
  --card-border: var(--hk-border);
  --hairline: var(--hk-hairline);
  --text: var(--hk-text);
  --text-dim: var(--hk-muted);
  --text-faint: var(--hk-subtle);
  --mint: var(--hk-teal);
  --teal: var(--hk-teal);
  --sea: var(--hk-teal-strong);
  --lime: var(--hk-lime);
  --warn: var(--hk-solar);
  --good: var(--hk-battery);
  --load: var(--hk-teal);
  --solar: var(--hk-solar);
  --card-bg: var(--hk-surface);
  color: var(--hk-text);
  background: var(--hk-bg);
  color-scheme: dark;
}

body.theme-hk-solar .phone {
  background: radial-gradient(100% 54% at 50% 0%, #142A32 0%, var(--hk-bg) 68%);
  border-color: var(--hk-border);
}
body.theme-hk-solar .card,
body.theme-hk-solar .settings-box,
body.theme-hk-solar .chart-expanded-sheet,
body.theme-hk-solar .sidebar-panel {
  background: linear-gradient(145deg, rgba(19, 39, 49, .98), rgba(11, 24, 33, .98));
  border-color: var(--hk-border);
  box-shadow: var(--hk-shadow);
}
body.theme-hk-solar .card { padding: 17px; margin-bottom: 12px; border-radius: 20px; }
body.theme-hk-solar .sys-pill,
body.theme-hk-solar .icon-btn,
body.theme-hk-solar .quad-cell,
body.theme-hk-solar .settings-input,
body.theme-hk-solar .chip,
body.theme-hk-solar .stat-chip {
  background-color: var(--hk-surface);
  border-color: var(--hk-border);
  color: var(--hk-text);
}
body.theme-hk-solar .section-label,
body.theme-hk-solar .card-label { color: var(--hk-muted); }
body.theme-hk-solar .chip.on {
  color: #071018;
  background: var(--hk-teal);
  border-color: var(--hk-teal);
}
body.theme-hk-solar .bottomnav {
  background: linear-gradient(180deg, rgba(7,16,24,0), rgba(7,16,24,.98) 30%, #071018);
  border-color: var(--hk-border);
}
body.theme-hk-solar .navitem.active,
body.theme-hk-solar .navitem.active svg { color: var(--hk-teal-strong); }
body.theme-hk-solar .status-freshness.live {
  color: var(--hk-battery) !important;
  background: rgba(100, 231, 162, .10) !important;
  border-color: rgba(100, 231, 162, .34) !important;
}
body.theme-hk-solar .status-freshness.stale {
  color: var(--hk-solar) !important;
  background: rgba(255, 210, 118, .10) !important;
  border-color: rgba(255, 210, 118, .34) !important;
}
body.theme-hk-solar .status-freshness.offline {
  color: var(--hk-danger) !important;
  background: rgba(255, 136, 136, .10) !important;
  border-color: rgba(255, 136, 136, .34) !important;
}
body.theme-hk-solar .status-freshness.connecting {
  color: var(--hk-teal-strong) !important;
  background: rgba(84, 221, 209, .10) !important;
  border-color: rgba(84, 221, 209, .34) !important;
}
body.theme-hk-solar .freshness-spin-inline,
body.theme-hk-solar .freshness-spin.spinning,
body.theme-hk-solar .ptr-spinner { color: var(--hk-teal-strong) !important; }
body.theme-hk-solar .batt-modal,
body.theme-hk-solar .chart-expanded-modal,
body.theme-hk-solar .sidebar-overlay { background-color: rgba(2, 8, 13, .82); }
body.theme-hk-solar .batt-modal-card,
body.theme-hk-solar .chart-expanded-sheet {
  background: var(--hk-bg-raised);
  border-color: var(--hk-border);
  color: var(--hk-text);
}
body.theme-hk-solar input,
body.theme-hk-solar select,
body.theme-hk-solar textarea {
  color: var(--hk-text);
  accent-color: var(--hk-teal);
}
body.theme-hk-solar input::placeholder,
body.theme-hk-solar textarea::placeholder { color: var(--hk-subtle); opacity: 1; }
body.theme-hk-solar [style*="color:#FFFFFF"],
body.theme-hk-solar [style*="color: #FFFFFF"],
body.theme-hk-solar [style*="color:white"],
body.theme-hk-solar [style*="color: white"] { color: var(--hk-text) !important; }
body.theme-hk-solar [style*="background:#0B111A"],
body.theme-hk-solar [style*="background: #0B111A"] { background: var(--hk-surface) !important; }
body.theme-hk-solar :focus-visible {
  outline: 2px solid var(--hk-focus);
  outline-offset: 3px;
}
body.theme-hk-solar .theme-switcher-bar {
  background: rgba(8, 21, 29, .98);
  border-color: var(--hk-border);
}
body.theme-hk-solar .flow-theme-pill.active {
  color: #071018;
  background: linear-gradient(135deg, var(--hk-teal), var(--hk-lime));
  box-shadow: 0 0 0 1px rgba(197, 237, 101, .5), 0 6px 18px rgba(84, 221, 209, .18);
}
.theme-switcher-divider { height: 1px; margin: 2px 8px; background: var(--hairline); }
body[data-page="home"] .theme-float,
body[data-page="usage"] .theme-float,
body[data-page="billing"] .theme-float,
body[data-page="log"] .theme-float { display: block; }
.theme-float-trigger { width: 44px; height: 48px; }
.flow-theme-pill { min-height: 44px; }

/* Event rows intentionally contain only category icon, event name, measured value and time. */
.log-entry { align-items: center; gap: 10px; }
.log-entry .log-dot,
.log-entry .log-sub,
.log-entry .log-badge-tag,
.log-entry .live-dot { display: none !important; }
.log-icon-pill {
  width: 30px; height: 30px; display: grid; place-items: center;
  flex: 0 0 30px; border-radius: 10px;
  color: var(--teal); background: rgba(45, 212, 191, .08);
  border: 1px solid var(--card-border);
}
.log-icon-pill svg { display: block; }
.log-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 10px; }
.log-title { min-width: 0; }
.log-value { color: var(--lime); font: 600 11px 'JetBrains Mono', monospace; white-space: nowrap; }
.log-time { color: var(--text-dim); font-size: 10px; }
body.theme-hk-solar .log-entry { border-color: var(--hk-hairline); }
body.theme-hk-solar .log-icon-pill { color: var(--hk-teal); background: rgba(84, 221, 209, .08); }
body.theme-hk-solar .log-value { color: var(--hk-lime); }
@media (max-width: 380px) {
  .log-entry { padding-left: 10px; padding-right: 10px; gap: 8px; }
  .log-body { gap: 5px; }
  .log-title { font-size: 11.5px; }
}
