:root {
  --bg-deep: #010614;
  --cyan: #22d3ee;
  --cyan-hot: #67f3ff;
  --sky: #38bdf8;
  --blue: #3b82f6;
  --emerald: #34f57a;
  --violet: #a855f7;
  --rose: #fb7185;
  --amber: #facc15;
  --text: #f8fafc;
  --muted: #93b4e0;
  --border-glow: rgba(56, 189, 248, 0.55);
  --fan-speed: 2.2s;
  --tower-hue: 0deg;
}

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

/* Android Standalone PWA smooth vertical scrolling: NEVER overflow-x: hidden on both html & body */
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: auto;
  overflow-y: auto;
  overflow-x: clip;
  background: var(--bg-deep);
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  height: auto;
  overflow-x: clip;
  overflow-y: visible;
  touch-action: pan-y;
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'Segoe UI', 'Noto Sans Thai', 'Leelawadee UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

button, input, select {
  font-family: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
}

.hidden {
  display: none !important;
}

/* ==================== Cyber Neon Wallpaper + Diagonal Streaks + Sparks ==================== */
.bg-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-wallpaper {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(1, 6, 20, 0.22) 0%, rgba(2, 8, 24, 0.44) 48%, rgba(1, 6, 18, 0.66) 100%),
    url('/assets/bg_cyber.jpg') center top / cover no-repeat;
}

/* Extra Reference-Matched Bottom-Right & Top-Left Cyber Diagonal Light Streaks */
.bg-cyber-streaks {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 28% at 96% 8%, rgba(34, 211, 238, 0.24), transparent 68%),
    radial-gradient(ellipse 52% 22% at 6% 20%, rgba(14, 165, 233, 0.16), transparent 65%),
    radial-gradient(ellipse 55% 26% at 95% 96%, rgba(14, 165, 233, 0.34), transparent 72%),
    radial-gradient(ellipse 55% 20% at 15% 98%, rgba(34, 211, 238, 0.28), transparent 70%);
}

.bg-mode-tint {
  position: absolute;
  inset: 0;
  transition: background 0.7s ease;
  background: radial-gradient(circle at 80% 18%, rgba(14, 165, 233, 0.14), transparent 55%);
}

.app-shell[data-mode="SLEEP"] { --fan-speed: 6s; --tower-hue: 56deg; }
.app-shell[data-mode="ECO"]   { --fan-speed: 2.2s; --tower-hue: -8deg; }
.app-shell[data-mode="FULL"]  { --fan-speed: 0.72s; --tower-hue: 0deg; }

.particles span {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 8px #38bdf8, 0 0 14px #0ea5e9;
  opacity: 0;
  animation: sparkDrift 8.5s linear infinite;
}
.particles span:nth-child(1)  { left: 8%;  bottom: 12%; animation-delay: 0s; }
.particles span:nth-child(2)  { left: 22%; bottom: 32%; animation-delay: 1.4s; animation-duration: 10s; }
.particles span:nth-child(3)  { left: 38%; bottom: 8%;  animation-delay: 2.6s; animation-duration: 9s; }
.particles span:nth-child(4)  { left: 55%; bottom: 24%; animation-delay: 0.9s; animation-duration: 11s; }
.particles span:nth-child(5)  { left: 74%; bottom: 16%; animation-delay: 3.1s; animation-duration: 8.5s; }
.particles span:nth-child(6)  { left: 88%; bottom: 42%; animation-delay: 1.9s; animation-duration: 9.5s; }
.particles span:nth-child(7)  { left: 14%; bottom: 60%; animation-delay: 4.2s; }
.particles span:nth-child(8)  { left: 66%; bottom: 58%; animation-delay: 2.1s; }
.particles span:nth-child(9)  { left: 91%; bottom: 72%; animation-delay: 0.5s; }
.particles span:nth-child(10) { left: 48%; bottom: 48%; animation-delay: 3.7s; }

@keyframes sparkDrift {
  0% { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  20% { opacity: 0.68; }
  80% { opacity: 0.42; }
  100% { transform: translate3d(14px, -130px, 0) scale(1.1); opacity: 0; }
}

/* ==================== PIN Login View ==================== */
.login-view {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 356px;
  background: rgba(5, 15, 38, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.2px solid var(--border-glow);
  border-radius: 24px;
  padding: 26px 20px 20px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72), 0 0 32px rgba(34, 211, 238, 0.18);
}

.login-logo-img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  margin-bottom: 6px;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.7));
}

.login-card h1 { margin: 0 0 4px; font-size: 21px; font-weight: 800; }
.login-card h1 span { color: var(--cyan-hot); }
.login-card h1 em { font-style: italic; }
.login-sub { margin: 0 0 16px; font-size: 12px; color: var(--muted); }

.pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 10px; }
.pin-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid #334155; transition: all 0.16s ease;
}
.pin-dots span.filled {
  background: var(--cyan-hot); border-color: #cffafe;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.95);
}

.login-error { min-height: 18px; font-size: 12px; color: #fda4af; margin-bottom: 12px; line-height: 1.4; }
.login-error.waiting { color: #7df9ff; text-shadow: 0 0 10px rgba(56, 232, 255, 0.45); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.keypad button {
  height: 54px; border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(12, 30, 68, 0.8);
  color: var(--text); font-size: 20px; font-weight: 700;
  transition: transform 0.1s ease, background 0.14s ease;
}
.keypad button:active { transform: scale(0.93); background: rgba(34, 211, 238, 0.28); }
.keypad button.key-muted { font-size: 13.5px; color: var(--muted); background: rgba(6, 17, 38, 0.78); }

/* ==================== App Shell & Persistent Top Header ==================== */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: clip;
  padding: calc(10px + env(safe-area-inset-top)) 11px calc(82px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 1px;
}

.brand-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }

.brand-logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(56, 232, 255, 0.72));
  animation: logoPulse 4s ease-in-out infinite alternate;
}

@keyframes logoPulse {
  from { filter: drop-shadow(0 0 9px rgba(56, 189, 248, 0.56)); }
  to { filter: drop-shadow(0 0 16px rgba(56, 232, 255, 0.9)); }
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.25px;
  line-height: 1.06;
  white-space: nowrap;
}
.brand-title .eco-word {
  color: #36ecff;
  text-shadow: 0 0 16px rgba(54, 236, 255, 0.72);
}
.brand-sub {
  font-size: 10.5px;
  font-style: italic;
  color: #96bce8;
  margin-top: 2px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.status-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(6, 20, 48, 0.88), rgba(4, 14, 36, 0.92));
  border: 1.2px solid rgba(56, 189, 248, 0.58);
  box-shadow:
    0 0 18px rgba(14, 165, 233, 0.28),
    inset 0 1px 0 rgba(186, 230, 253, 0.18),
    inset -3px 0 12px rgba(56, 232, 255, 0.22);
  flex-shrink: 0;
}

.status-online {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 0;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-dot {
  width: 8.5px;
  height: 8.5px;
  border-radius: 50%;
  background: #22f55e;
  box-shadow: 0 0 9px #22f55e, 0 0 14px rgba(34, 245, 94, 0.6);
  animation: dotPulse 1.9s ease-in-out infinite;
}
.status-dot.offline {
  background: #f43f5e;
  box-shadow: 0 0 9px #f43f5e;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.22); opacity: 0.7; }
}

.capsule-sep { width: 1px; height: 13px; background: rgba(148, 163, 184, 0.3); }
.capsule-pc-btn {
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; padding: 0;
  color: #bae6fd; width: 19px; height: 19px;
  transition: transform 0.15s ease, color 0.15s ease;
}
.capsule-pc-btn:active { transform: scale(0.88); color: #67f3ff; }
.capsule-pc-btn svg { width: 17px; height: 17px; filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.55)); }

/* ==================== Status / Timer / Emergency Banners (Compact, Hidden When Idle) ==================== */
.offline-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  margin-bottom: 8px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.72), rgba(30, 12, 34, 0.9));
  border: 1px solid rgba(251, 113, 133, 0.65);
  box-shadow: 0 4px 18px rgba(244, 63, 94, 0.22);
  font-size: 11px;
  font-weight: 700;
  color: #ffe4e6;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.offline-banner.rebooting {
  background: linear-gradient(135deg, rgba(7, 42, 82, 0.88), rgba(14, 24, 60, 0.94));
  border-color: rgba(56, 232, 255, 0.68);
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.3);
  color: #e0f2fe;
}
.offline-banner.rebooting .offline-pulse {
  background: #38ecff;
  box-shadow: 0 0 8px #38ecff;
}
.offline-banner.rebooting .offline-retry-btn {
  border-color: rgba(165, 243, 252, 0.55);
  background: rgba(14, 165, 233, 0.3);
}
.offline-left { display: flex; align-items: center; gap: 7px; min-width: 0; line-height: 1.32; }
.offline-pulse {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #fb7185; box-shadow: 0 0 8px #fb7185;
  animation: dotPulse 1s ease-in-out infinite;
}
.offline-retry-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(254, 205, 211, 0.55);
  background: rgba(244, 63, 94, 0.28);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}
.offline-retry-btn:active { transform: scale(0.94); }

.timer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  margin-bottom: 8px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(8, 37, 74, 0.9), rgba(24, 16, 62, 0.92));
  border: 1px solid rgba(56, 232, 255, 0.6);
  box-shadow: 0 4px 18px rgba(14, 165, 233, 0.26), inset 0 1px 0 rgba(165, 243, 252, 0.2);
}
.timer-banner-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.timer-ic {
  width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center;
  color: #67f3ff; flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(103, 243, 255, 0.75));
}
.timer-ic svg { width: 16px; height: 16px; }
.timer-banner-text {
  font-size: 11.5px; font-weight: 800; color: #e0f2fe;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.timer-cancel-chip {
  flex-shrink: 0;
  padding: 3.5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 113, 133, 0.62);
  background: rgba(159, 18, 57, 0.45);
  color: #ffe4e6;
  font-size: 10.5px;
  font-weight: 800;
}
.timer-cancel-chip:active { transform: scale(0.94); }

.cancel-banner {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  border: 2px solid #fb7185;
  background: linear-gradient(135deg, #be123c, #e11d48);
  color: #fff;
  font-weight: 800;
  font-size: 12.5px;
  text-align: center;
  box-shadow: 0 0 22px rgba(244, 63, 94, 0.8);
  animation: pulseCancel 0.9s infinite alternate;
}
@keyframes pulseCancel { from { transform: scale(1); } to { transform: scale(1.015); } }

.tab-page { animation: tabEnter 0.22s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes tabEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== Hero Telemetry Card (Reference Open Top + Chamfered HUD Bottom) ==================== */
.hero-card {
  position: relative;
  padding: 2px 2px 0;
  margin-bottom: 9px;
  overflow: visible;
}

/* Top-Left Glowing Cyber Diagonal Accent Slash (Matches Reference Top-Left of Gauge) */
.hero-chevron-tl {
  position: absolute;
  top: 2px;
  left: -4px;
  width: 62px;
  height: 44px;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(56, 232, 255, 0.48) 0%, rgba(14, 165, 233, 0.16) 40%, transparent 62%);
  clip-path: polygon(0 45%, 52% 0, 82% 0, 0 82%);
  filter: drop-shadow(0 0 10px rgba(56, 232, 255, 0.7));
}

.hero-flare-tr {
  position: absolute;
  top: -10px;
  right: 8px;
  width: 140px;
  height: 60px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 65% 40%, rgba(56, 189, 248, 0.32), transparent 72%);
  filter: blur(12px);
}

/* Photorealistic 3D Gaming PC Tower (Smooth Bottom Mask Eliminates White Fade!) */
.pc-tower-layer {
  position: absolute;
  top: -10px;
  right: -12px;
  width: 156px;
  height: 192px;
  pointer-events: none;
  z-index: 1;
  filter: hue-rotate(var(--tower-hue)) drop-shadow(-8px 2px 20px rgba(14, 165, 233, 0.45));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.65) 74%, transparent 90%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, rgba(0, 0, 0, 0.65) 74%, transparent 90%);
  transition: filter 0.7s ease;
}

.pc-tower-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right top;
  opacity: 0.95;
}

/* 3 Spinning RGB Fan Blade Glints Aligned Over Front Mesh Fans of pc_tower.png */
.fan-spin-overlay {
  position: absolute;
  left: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(165, 243, 252, 0.38) 0deg 34deg,
    transparent 34deg 90deg,
    rgba(56, 189, 248, 0.34) 90deg 124deg,
    transparent 124deg 180deg,
    rgba(165, 243, 252, 0.38) 180deg 214deg,
    transparent 214deg 270deg,
    rgba(56, 189, 248, 0.34) 270deg 304deg,
    transparent 304deg 360deg
  );
  mix-blend-mode: screen;
  animation: fanSpin var(--fan-speed) linear infinite;
}
.fan-1 { top: 37px; }
.fan-2 { top: 86px; animation-delay: -0.32s; }
.fan-3 { top: 134px; animation-delay: -0.64s; opacity: 0.55; }

@keyframes fanSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-top-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 152px 1fr;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 6px;
}

/* Layered Metallic 270° Circular Neon Gauge Ring */
.gauge-wrap {
  position: relative;
  width: 152px;
  height: 152px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 22px rgba(2, 10, 32, 0.85));
}

.gauge-svg { width: 100%; height: 100%; overflow: visible; }
#gauge-arc, #gauge-arc-glow {
  transition: stroke-dasharray 0.65s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.4s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 4px;
}

.gauge-bolt {
  color: #4bf3ff;
  filter: drop-shadow(0 0 10px rgba(75, 243, 255, 0.95));
  animation: boltPulse 2.1s ease-in-out infinite;
  margin-bottom: -1px;
}
@keyframes boltPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.16); opacity: 0.8; }
}

.gauge-number {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.7px;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(56, 232, 255, 0.42), 0 2px 10px rgba(0, 0, 0, 0.8);
}
.gauge-unit {
  font-size: 13.5px;
  font-weight: 700;
  color: #e2e8f0;
  margin-top: 1px;
}
.gauge-pill {
  margin-top: 4px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  color: #e0f2fe;
  background: rgba(8, 22, 52, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  white-space: nowrap;
}

/* 3D Glossy Green Leaves Sitting Naturally on Bottom-Left Rim */
.gauge-leaves-wrap {
  position: absolute;
  left: -5px;
  bottom: 5px;
  width: 50px;
  height: 40px;
  pointer-events: none;
  transform-origin: 12px 34px;
  animation: leafSway 4.2s ease-in-out infinite alternate;
}
.gauge-leaf-main {
  position: absolute;
  left: 0;
  bottom: 3px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  transform: rotate(-52deg);
  filter: drop-shadow(0 0 10px rgba(52, 245, 122, 0.65));
}
.gauge-leaf-small {
  position: absolute;
  left: 23px;
  bottom: -2px;
  width: 21px;
  height: 21px;
  object-fit: contain;
  transform: rotate(24deg);
  filter: drop-shadow(0 0 8px rgba(52, 245, 122, 0.55));
}
@keyframes leafSway {
  0% { transform: rotate(-2.5deg); }
  100% { transform: rotate(3.5deg); }
}

/* Right Metrics Stack */
.hero-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-right: 4px;
  padding-top: 6px;
  min-width: 0;
}

.savings-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  text-shadow: 0 2px 10px rgba(1, 6, 20, 0.95);
}
.bars-mini { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars-mini i {
  display: block; width: 3.2px; border-radius: 1.5px;
  background: linear-gradient(180deg, #67f3ff, #0284c7);
  box-shadow: 0 0 6px rgba(56, 232, 255, 0.65);
}
.bars-mini i:nth-child(1) { height: 5px; }
.bars-mini i:nth-child(2) { height: 8.5px; }
.bars-mini i:nth-child(3) { height: 12px; }

.savings-value-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}
.savings-tilde {
  font-size: 22px;
  font-weight: 800;
  color: #e2e8f0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95);
}
.savings-pct {
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  color: #34f57a;
  text-shadow: 0 0 18px rgba(52, 245, 122, 0.65), 0 2px 10px rgba(0, 0, 0, 0.95);
  font-variant-numeric: tabular-nums;
}
.mini-leaf-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(52, 245, 122, 0.72));
}

.temp-chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 100%;
}

.temp-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(4, 14, 38, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.48);
  box-shadow: 0 6px 14px rgba(1, 6, 20, 0.7), inset 0 1px 0 rgba(186, 230, 253, 0.16);
  min-width: 0;
}
.chip-icon { width: 18px; height: 18px; flex-shrink: 0; }
.chip-icon.sky { color: #60a5fa; filter: drop-shadow(0 0 6px rgba(96, 165, 250, 0.7)); }
.chip-icon.cyan { color: #38ecff; filter: drop-shadow(0 0 6px rgba(56, 236, 255, 0.75)); }
.chip-meta { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.chip-meta span { font-size: 9.5px; color: #94bce8; font-weight: 700; }
.chip-meta strong {
  font-size: 13px; color: #ffffff; font-weight: 800;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ==================== Chamfered Cyber-HUD Sparkline Frame ==================== */
.spark-hud-wrap {
  position: relative;
  z-index: 3;
  height: 68px;
  margin-top: 2px;
}

.spark-panel {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 65% 80% at 50% 100%, rgba(14, 165, 233, 0.2), transparent 72%),
    linear-gradient(180deg, rgba(4, 13, 34, 0.82) 0%, rgba(3, 11, 29, 0.92) 100%);
  clip-path: polygon(
    0 10px, 10px 0,
    calc(100% - 10px) 0, 100% 10px,
    100% calc(100% - 14px), calc(100% - 15px) 100%,
    15px 100%, 0 calc(100% - 14px)
  );
  overflow: hidden;
}

.spark-panel canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.spark-hud-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  filter: drop-shadow(0 0 6px rgba(56, 232, 255, 0.72));
}

.spark-bottom-glow {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -4px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(103, 243, 255, 0.85) 0%, rgba(14, 165, 233, 0.4) 55%, transparent 80%);
  filter: blur(5px);
  pointer-events: none;
  z-index: 2;
}

/* Signature Blazing Top-Right Cyber Star Flare on Sparkline Corner */
.spark-corner-flare {
  position: absolute;
  top: -7px;
  right: 4px;
  width: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 5;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.92) 0%, rgba(103, 243, 255, 0.6) 24%, rgba(14, 165, 233, 0) 68%);
  animation: flareTwinkle 2.8s ease-in-out infinite alternate;
}
@keyframes flareTwinkle {
  0% { opacity: 0.65; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.18); }
}

.details-pill {
  position: absolute;
  right: 13px;
  bottom: 5px;
  z-index: 5;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: rgba(6, 20, 50, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.56);
  color: #e0f2fe;
  font-size: 9.5px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(2, 6, 23, 0.7), 0 0 10px rgba(14, 165, 233, 0.24);
  transition: transform 0.14s ease, border-color 0.18s ease;
}
.details-pill:active { transform: scale(0.93); border-color: #67f3ff; }

/* ==================== Section Heading: /// โหมดการใช้งาน + Stepped Cyber Divider ==================== */
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 2px 9px;
  font-size: 14.5px;
  font-weight: 800;
  color: #f8fafc;
}
.heading-text { white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.slashes { display: inline-flex; gap: 3.5px; flex-shrink: 0; }
.slashes i {
  display: block;
  width: 4.5px;
  height: 13px;
  border-radius: 1.5px;
  background: linear-gradient(180deg, #7df9ff, #0284c7);
  transform: skewX(-22deg);
  box-shadow: 0 0 9px rgba(56, 232, 255, 0.8);
}

.cyber-divider-svg {
  flex: 1;
  height: 14px;
  min-width: 40px;
  filter: drop-shadow(0 0 5px rgba(56, 232, 255, 0.55));
}

.tech-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.55) 0%, rgba(56, 189, 248, 0.16) 75%, transparent 100%);
  position: relative;
}
.tech-line::before {
  content: "";
  position: absolute;
  left: 0; top: -2px; width: 24px; height: 2px;
  background: #67f3ff;
  box-shadow: 0 0 8px #38bdf8;
}

/* ==================== 3 Cyber Glass Power Mode Cards ==================== */
.modes-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 9px;
}

.mode-card {
  position: relative;
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 16px;
  color: #ffffff;
  overflow: hidden;
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, border-color 0.28s ease;
}

.mode-card:active { transform: scale(0.976); }
.mode-card:disabled { opacity: 0.72; pointer-events: none; }

/* Tactile Tap Ripple */
.tap-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42) 0%, rgba(103, 243, 255, 0.16) 45%, transparent 72%);
  transform: translate(-50%, -50%) scale(0);
  animation: rippleExpand 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes rippleExpand {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0.85; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

.card-aura {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Floating Bokeh Energy Particles (Visible ONLY Inside Active Card!) */
.card-bokeh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.45s ease;
}
.mode-card.active .card-bokeh { opacity: 1; }
.card-bokeh i {
  position: absolute;
  border-radius: 50%;
  background: rgba(165, 243, 252, 0.85);
  box-shadow: 0 0 8px rgba(103, 243, 255, 0.9), 0 0 14px rgba(56, 189, 248, 0.55);
  animation: bokehFloat 4.6s ease-in-out infinite;
}
.mode-card.sleep .card-bokeh i {
  background: rgba(233, 213, 255, 0.88);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.95);
}
.mode-card.full .card-bokeh i {
  background: rgba(186, 230, 253, 0.9);
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.95);
}
.card-bokeh i:nth-child(1) { width: 4px; height: 4px; left: 18%; bottom: 14%; animation-delay: 0s; animation-duration: 4.2s; }
.card-bokeh i:nth-child(2) { width: 3px; height: 3px; left: 38%; bottom: 22%; animation-delay: 0.9s; animation-duration: 5.1s; }
.card-bokeh i:nth-child(3) { width: 5px; height: 5px; left: 62%; bottom: 10%; animation-delay: 1.7s; animation-duration: 4.7s; }
.card-bokeh i:nth-child(4) { width: 3.5px; height: 3.5px; left: 78%; bottom: 26%; animation-delay: 0.4s; animation-duration: 4.4s; }
.card-bokeh i:nth-child(5) { width: 2.5px; height: 2.5px; left: 86%; bottom: 14%; animation-delay: 2.2s; animation-duration: 3.9s; }
.card-bokeh i:nth-child(6) { width: 4px; height: 4px; left: 48%; bottom: 16%; animation-delay: 1.3s; animation-duration: 5.4s; }

@keyframes bokehFloat {
  0% { transform: translate3d(0, 6px, 0) scale(0.6); opacity: 0; }
  30% { opacity: 0.82; }
  75% { opacity: 0.48; }
  100% { transform: translate3d(10px, -44px, 0) scale(1.15); opacity: 0; }
}

/* Card 1: Deep Sleep (Deep Space Indigo + Vivid Violet-Magenta Plasma) */
.mode-card.sleep {
  background: linear-gradient(128deg, rgba(24, 9, 58, 0.94) 0%, rgba(36, 12, 78, 0.92) 55%, rgba(22, 8, 52, 0.96) 100%);
  border: 1.4px solid rgba(192, 132, 252, 0.68);
  box-shadow:
    0 8px 22px rgba(2, 6, 23, 0.68),
    0 0 18px rgba(147, 51, 234, 0.24),
    inset 0 1px 0 rgba(233, 213, 255, 0.3),
    inset 0 -1px 12px rgba(168, 85, 247, 0.22);
}
.mode-card.sleep .card-aura {
  background:
    radial-gradient(ellipse 46% 85% at 10% 45%, rgba(168, 85, 247, 0.36), transparent 62%),
    radial-gradient(ellipse 52% 90% at 94% 100%, rgba(217, 70, 239, 0.56), rgba(168, 85, 247, 0.22) 45%, transparent 72%);
}

/* Card 2: Ultra Eco (Deep Ocean Navy + Blazing Turquoise-Cyan Energy) */
.mode-card.eco {
  background: linear-gradient(128deg, rgba(4, 42, 78, 0.93) 0%, rgba(6, 58, 96, 0.91) 52%, rgba(3, 26, 58, 0.96) 100%);
  border: 1.4px solid rgba(56, 232, 255, 0.72);
  box-shadow:
    0 8px 22px rgba(2, 6, 23, 0.68),
    0 0 20px rgba(34, 211, 238, 0.26),
    inset 0 1px 0 rgba(165, 243, 252, 0.32),
    inset 0 -1px 12px rgba(34, 211, 238, 0.24);
}
.mode-card.eco .card-aura {
  background:
    radial-gradient(ellipse 48% 90% at 12% 52%, rgba(34, 211, 238, 0.42), transparent 64%),
    radial-gradient(ellipse 56% 95% at 92% 96%, rgba(56, 232, 255, 0.64), rgba(14, 165, 233, 0.26) 48%, transparent 75%);
}

/* Card 3: Full Performance with Chamfered Cyber Tech Bottom Corners! */
.mode-chamfer-wrap {
  position: relative;
  border-radius: 17px;
  filter: drop-shadow(0 8px 20px rgba(2, 6, 23, 0.65));
  transition: filter 0.28s ease;
}
.mode-chamfer-wrap.is-active {
  filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.72));
}

.mode-card.full {
  border: none;
  border-radius: 16px 16px 0 0;
  background: linear-gradient(130deg, rgba(10, 26, 68, 0.94) 0%, rgba(8, 22, 58, 0.95) 56%, rgba(5, 16, 44, 0.97) 100%);
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - 14px), calc(100% - 15px) 100%,
    15px 100%, 0 calc(100% - 14px)
  );
  box-shadow: inset 0 1px 0 rgba(147, 197, 253, 0.28);
}
.mode-card.full .card-aura {
  background:
    radial-gradient(ellipse 40% 80% at 10% 86%, rgba(249, 115, 22, 0.46), rgba(234, 88, 12, 0.14) 48%, transparent 70%),
    radial-gradient(ellipse 52% 90% at 94% 96%, rgba(34, 211, 238, 0.62), rgba(59, 130, 246, 0.26) 46%, transparent 72%);
}

.full-chamfer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
}
.full-chamfer-poly {
  stroke: rgba(56, 189, 248, 0.68);
  stroke-width: 1.5;
  transition: stroke 0.28s ease, stroke-width 0.28s ease;
}
.mode-chamfer-wrap.is-active .full-chamfer-poly {
  stroke: #a5f3fc;
  stroke-width: 2.3;
}

/* Active Blazing Halo (Exact Match to Reference Glowing Active Card!) */
.mode-card.active {
  border-width: 2px;
}
.mode-card.sleep.active {
  border-color: #f3e8ff;
  box-shadow:
    0 0 26px rgba(192, 132, 252, 0.78),
    0 0 8px rgba(233, 213, 255, 0.65),
    inset 0 0 22px rgba(192, 132, 252, 0.34);
}
.mode-card.eco.active {
  border-color: #9bfbff;
  box-shadow:
    0 0 28px rgba(34, 211, 238, 0.85),
    0 0 10px rgba(165, 243, 252, 0.75),
    inset 0 0 24px rgba(56, 232, 255, 0.36);
}
.mode-card.full.active {
  box-shadow: inset 0 0 26px rgba(56, 189, 248, 0.38);
}

.mode-icon-box {
  position: relative;
  z-index: 2;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-3d-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.55));
}
.moon-anim   { animation: floatSlow 3.6s ease-in-out infinite alternate; }
.leaf-anim   { animation: floatSlow 3.2s ease-in-out 0.4s infinite alternate; }
.rocket-anim { animation: rocketHover 2.4s ease-in-out infinite alternate; }

@keyframes floatSlow {
  from { transform: translateY(1.5px) rotate(-2deg); }
  to   { transform: translateY(-2.5px) rotate(2deg); }
}
@keyframes rocketHover {
  from { transform: translate(-1px, 1.5px); }
  to   { transform: translate(1.5px, -2.5px); }
}

.mode-info {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
}
.mode-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 2px;
  letter-spacing: -0.1px;
}
.mode-sub {
  font-size: 9.8px;
  color: rgba(226, 238, 255, 0.9);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4.5px;
}
.mode-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: rgba(2, 9, 26, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 10px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
}
.mode-meta-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-ic { width: 12px; height: 12px; flex-shrink: 0; }
.meta-ic.green { color: #4ade80; filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.75)); }
.meta-ic.amber { color: #facc15; filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.8)); }
.meta-ic.flame { color: #fb923c; filter: drop-shadow(0 0 5px rgba(251, 146, 60, 0.8)); }

.mode-pill {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 82px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(9, 17, 42, 0.74);
  border: 1px solid rgba(196, 181, 253, 0.45);
  color: #f8fafc;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: all 0.22s ease;
  white-space: nowrap;
}
.mode-card.eco .mode-pill { border-color: rgba(103, 232, 249, 0.48); }
.mode-card.full .mode-pill { border-color: rgba(147, 197, 253, 0.48); }
.mode-pill .arr { font-size: 8.5px; color: #facc15; }

.mode-card.active .mode-pill {
  background: #ffffff;
  border-color: #ffffff;
  color: #0b1936;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.72);
}
.mode-card.active .mode-pill .arr {
  color: #0284c7;
  font-size: 11.5px;
  font-weight: 900;
}

/* Loading Spinner inside Active Switching Pill */
.pill-spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0.35);
  border-top-color: #67f3ff;
  animation: spinFast 0.7s linear infinite;
  flex-shrink: 0;
}
.mode-card.active .pill-spinner {
  border-color: rgba(11, 25, 54, 0.22);
  border-top-color: #0284c7;
}
@keyframes spinFast {
  to { transform: rotate(360deg); }
}

/* ==================== Bottom 2-Column Bento (Chamfered Tech Corners) ==================== */
.bento-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 9px;
}

.bento-wrap {
  position: relative;
  filter: drop-shadow(0 8px 20px rgba(1, 6, 20, 0.62));
}

.bento-card {
  position: relative;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 55% at 20% 0%, rgba(34, 211, 238, 0.12), transparent 70%),
    linear-gradient(165deg, rgba(7, 20, 48, 0.86) 0%, rgba(4, 12, 32, 0.92) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 10px 9px;
  clip-path: polygon(
    0 12px, 12px 0,
    calc(100% - 12px) 0, 100% 12px,
    100% calc(100% - 12px), calc(100% - 12px) 100%,
    12px 100%, 0 calc(100% - 12px)
  );
}

.bento-hud-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}
.bento-hud-svg polygon {
  stroke: rgba(56, 189, 248, 0.5);
  stroke-width: 1.25;
}

.bento-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  margin-bottom: 8px;
  padding-left: 2px;
  white-space: nowrap;
}
.bh-icon {
  width: 15px;
  height: 15px;
  color: #38bdf8;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.7));
}

.hw-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  padding: 6px 3px;
  border-radius: 10px;
  background: transparent;
  border: none;
  color: var(--text);
  transition: background 0.15s ease, transform 0.12s ease;
}
.hw-row:active { background: rgba(56, 189, 248, 0.15); transform: scale(0.98); }

.hw-sep {
  height: 1px;
  margin: 5px 2px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.36), rgba(56, 189, 248, 0.08));
}

.hw-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hw-badge.nvidia {
  color: #4ade80;
  filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.72));
}
.hw-badge.cpu {
  color: #38bdf8;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.72));
}

.hw-text { flex: 1; min-width: 0; }
.hw-name {
  font-size: 10.5px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-stat {
  font-size: 10.2px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.hw-stat.green { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.35); }
.hw-stat.violet { color: #d8b4fe; text-shadow: 0 0 10px rgba(192, 132, 252, 0.35); }
.hw-arrow { color: #93b4e0; font-size: 15px; font-weight: 700; flex-shrink: 0; }

/* Right 2x2 Options Tiles */
.opt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.opt-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px;
  border-radius: 11px;
  background: linear-gradient(160deg, rgba(11, 29, 68, 0.9), rgba(4, 13, 33, 0.96));
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #f1f5f9;
  font-size: 9.8px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(186, 230, 253, 0.14), 0 4px 10px rgba(1, 6, 20, 0.45);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.16s ease, box-shadow 0.16s ease;
}
.opt-tile:active {
  transform: scale(0.93);
  border-color: #67f3ff;
  box-shadow: 0 0 14px rgba(56, 232, 255, 0.38);
}
.opt-tile.win-power { border-color: rgba(56, 189, 248, 0.5); }

.opt-ic { width: 21px; height: 21px; display: flex; align-items: center; justify-content: center; }
.opt-ic svg { width: 19px; height: 19px; }
.opt-ic.cyan     { color: #38bdf8; filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.85)); }
.opt-ic.gold     { color: #facc15; filter: drop-shadow(0 0 9px rgba(250, 204, 21, 0.9)); }
.opt-ic.sky      { color: #60a5fa; filter: drop-shadow(0 0 8px rgba(96, 165, 250, 0.85)); }
.opt-ic.cyan-win { color: #38ecff; filter: drop-shadow(0 0 8px rgba(56, 236, 255, 0.9)); }

/* ==================== Stats / Settings / About Glass Cards ==================== */
.glass-card {
  background: rgba(6, 18, 44, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.1px solid rgba(56, 189, 248, 0.38);
  border-radius: 18px;
  padding: 13px;
  margin-bottom: 10px;
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.55), inset 0 1px 0 rgba(186, 230, 253, 0.12);
}
.glass-card.compact { padding: 11px; margin-bottom: 0; }
.card-kicker { font-size: 12px; font-weight: 800; color: #93c5fd; margin-bottom: 8px; }
.card-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }

.stats-hero-watts { font-size: 27px; font-weight: 900; color: #38bdf8; font-variant-numeric: tabular-nums; }
.stats-hero-watts small { font-size: 13px; color: #93b4e0; }
.mini-kpi-row { display: flex; gap: 10px; text-align: right; }
.mini-kpi-row small { display: block; font-size: 9.5px; color: #93b4e0; }
.mini-kpi-row strong { font-size: 11.5px; color: #f8fafc; font-variant-numeric: tabular-nums; }

/* Interactive Touch-Scrubbing Stats Chart */
.big-chart-wrap {
  position: relative;
  height: 162px;
  margin-top: 8px;
  border-radius: 13px;
  background: rgba(2, 9, 24, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.32);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.big-chart-wrap canvas { width: 100%; height: 100%; display: block; }

.chart-tooltip {
  position: absolute;
  top: 8px;
  left: 8px;
  pointer-events: none;
  z-index: 6;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(4, 15, 38, 0.94);
  border: 1px solid rgba(103, 243, 255, 0.65);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.72), 0 0 12px rgba(34, 211, 238, 0.25);
  font-size: 10.5px;
  line-height: 1.4;
  color: #f8fafc;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-tooltip .tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  color: #93c5fd;
  font-weight: 700;
}
.chart-tooltip .tt-watts { font-size: 12.5px; font-weight: 900; color: #67f3ff; }
.chart-tooltip .tt-temps { color: #cbd5e1; font-size: 10px; font-weight: 600; }

.chart-scrub-hint {
  margin-top: 6px;
  font-size: 10.5px;
  color: #7ea3cf;
  text-align: center;
}

.stats-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
.big-stat { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; }
.big-stat.cyan { color: #38bdf8; }
.big-stat.emerald { color: #4ade80; }
.sub-stat { font-size: 10.5px; color: #93b4e0; margin-top: 2px; }

.telemetry-kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.telemetry-kv-grid > div {
  background: rgba(4, 12, 30, 0.74);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 10px;
  padding: 7px 9px;
  min-width: 0;
}
.telemetry-kv-grid span { display: block; font-size: 10px; color: #93b4e0; }
.telemetry-kv-grid strong {
  display: block; font-size: 12px; color: #f8fafc; margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.log-list {
  max-height: 185px;
  overflow-y: auto;
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  color: #cbd5e1;
  background: rgba(3, 8, 20, 0.84);
  border-radius: 10px;
  padding: 8px 10px;
  line-height: 1.5;
}
.log-item + .log-item { margin-top: 4px; }

/* ==================== Auto-Timer Picker UI (Settings & Power Sheet) ==================== */
.timer-status-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.timer-status-badge.idle {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #94a3b8;
}
.timer-status-badge.active {
  background: rgba(8, 145, 178, 0.3);
  border: 1px solid rgba(103, 243, 255, 0.75);
  color: #a5f3fc;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}

.timer-active-box {
  margin: 10px 0;
  padding: 10px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(6, 40, 74, 0.85), rgba(24, 16, 62, 0.85));
  border: 1px solid rgba(103, 243, 255, 0.55);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timer-active-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.timer-active-info strong { font-size: 12.5px; color: #f8fafc; }
.timer-countdown-num {
  font-size: 18px;
  font-weight: 900;
  color: #67f3ff;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(103, 243, 255, 0.55);
}

.timer-picker-group { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.timer-sub-label { font-size: 10.5px; font-weight: 700; color: var(--muted); }

.timer-chip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.timer-chip {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background: rgba(5, 16, 40, 0.85);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 800;
  transition: all 0.16s ease;
}
.timer-chip.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.72), rgba(6, 182, 212, 0.75));
  border-color: #67f3ff;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}
.timer-chip:active { transform: scale(0.95); }

.timer-custom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}
.timer-custom-row input {
  width: 96px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  background: rgba(3, 10, 26, 0.9);
  color: #f8fafc;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.timer-target-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.timer-target-chip {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  background: rgba(5, 16, 40, 0.86);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.16s ease;
}
.timer-target-chip.active {
  background: rgba(14, 165, 233, 0.36);
  border-color: #67f3ff;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 232, 255, 0.3);
}
.timer-target-chip.warn.active {
  background: rgba(124, 58, 237, 0.42);
  border-color: #d8b4fe;
}
.timer-target-chip.danger.active {
  background: rgba(190, 18, 60, 0.48);
  border-color: #fb7185;
}
.timer-target-chip:active { transform: scale(0.95); }

/* Compact Quick Timer inside Power Sheet */
.sheet-timer-box {
  text-align: left;
  padding: 10px 11px;
  margin-bottom: 10px;
  border-radius: 15px;
  background: rgba(6, 18, 44, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.38);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: #bae6fd;
}
.sheet-timer-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.timer-select {
  flex: 1;
  min-width: 0;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: rgba(3, 10, 26, 0.95);
  color: #f8fafc;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}
.timer-go-btn, .timer-stop-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: none;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.timer-go-btn { background: linear-gradient(135deg, #0284c7, #06b6d4); }
.timer-stop-btn { background: linear-gradient(135deg, #be123c, #e11d48); }
.timer-go-btn:active, .timer-stop-btn:active { transform: scale(0.95); }

/* Settings Controls */
.settings-power-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.power-action-btn {
  display: flex; align-items: center; gap: 9px; text-align: left;
  padding: 10px 10px; border-radius: 14px;
  background: rgba(6, 17, 41, 0.86); border: 1px solid rgba(56, 189, 248, 0.3); color: var(--text);
}
.power-action-btn:active { transform: scale(0.96); }
.power-action-btn.danger {
  border-color: rgba(244, 63, 94, 0.58);
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.45), rgba(6, 17, 41, 0.92));
}
.power-action-btn.warn { border-color: rgba(250, 204, 21, 0.42); }
.power-action-btn strong { display: block; font-size: 12.5px; }
.power-action-btn small { display: block; font-size: 10px; color: var(--muted); }

.svg-ic {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.svg-ic svg { width: 20px; height: 20px; }
.svg-ic.rose   { color: #fb7185; filter: drop-shadow(0 0 7px rgba(251, 113, 133, 0.75)); }
.svg-ic.amber  { color: #facc15; filter: drop-shadow(0 0 7px rgba(250, 204, 21, 0.75)); }
.svg-ic.sky    { color: #38bdf8; filter: drop-shadow(0 0 7px rgba(56, 189, 248, 0.75)); }
.svg-ic.violet { color: #c4b5fd; filter: drop-shadow(0 0 7px rgba(196, 181, 253, 0.75)); }

.setting-hint { margin: 0 0 9px; font-size: 11px; color: #cbd5e1; line-height: 1.45; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 9px; }
.field span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.field input {
  width: 100%; height: 38px; border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.36); background: rgba(3, 10, 26, 0.9);
  color: #f8fafc; padding: 0 10px; font-size: 13.5px; font-weight: 700;
}
.btn-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.full-btn {
  width: 100%; min-height: 40px; padding: 7px 10px; border-radius: 12px;
  border: 1px solid transparent; font-size: 12px; font-weight: 800; color: #ffffff;
  transition: transform 0.14s ease;
}
.full-btn:active { transform: scale(0.97); }
.full-btn.cyan { background: linear-gradient(135deg, #0284c7, #06b6d4); }
.full-btn.emerald { background: linear-gradient(135deg, #059669, #10b981); }
.full-btn.violet { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.full-btn.sky { background: linear-gradient(135deg, #2563eb, #38bdf8); }
.full-btn.ghost { background: rgba(15, 34, 72, 0.85); border-color: rgba(56, 189, 248, 0.36); color: #bae6fd; }
.full-btn.rose-ghost { background: rgba(136, 19, 55, 0.38); border-color: rgba(244, 63, 94, 0.48); color: #fecdd3; }

.about-list > div {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.14); font-size: 12px;
}
.about-list > div:last-child { border-bottom: none; }
.about-list span { color: var(--muted); flex-shrink: 0; }
.about-list strong { color: #f8fafc; text-align: right; word-break: break-word; }
.about-note { margin: 0; font-size: 11.5px; color: #cbd5e1; line-height: 1.6; }

/* Always-On 24/7 & Permanent URL Cyber Card */
.always-on-card {
  background:
    radial-gradient(ellipse 70% 50% at 90% 0%, rgba(34, 211, 238, 0.15), transparent 68%),
    rgba(6, 18, 44, 0.88);
  border-color: rgba(56, 232, 255, 0.5);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.62), 0 0 20px rgba(14, 165, 233, 0.16), inset 0 1px 0 rgba(165, 243, 252, 0.18);
}
.ao-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.32);
  color: #cbd5e1;
}
.ao-badge.headless {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 245, 122, 0.65);
  color: #86efac;
  box-shadow: 0 0 12px rgba(52, 245, 122, 0.25);
}
.ao-badge.embedded {
  background: rgba(14, 165, 233, 0.22);
  border-color: rgba(56, 189, 248, 0.62);
  color: #bae6fd;
}
.ao-badge.pending {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(250, 204, 21, 0.52);
  color: #fde68a;
}
.ao-url-text {
  color: #67f3ff !important;
  font-family: 'Consolas', monospace;
  font-size: 11px;
  word-break: break-all !important;
}
.ao-unlock-wrap {
  margin-top: 10px;
}
.ao-unlock-link {
  display: block;
  padding: 9px 11px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.34), rgba(37, 99, 235, 0.32));
  border: 1px solid rgba(103, 243, 255, 0.68);
  color: #e0f2fe;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.24);
}
.ao-unlock-link:active { transform: scale(0.98); }
.ao-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 11px;
}
.ao-actions.single {
  grid-template-columns: 1fr;
}
.full-btn:disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* ==================== Floating Bottom Navigation with Smooth Animated Slanted Cyan Highlight ==================== */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: calc(100% - 22px);
  max-width: 458px;
  height: 60px;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 18, 44, 0.94), rgba(3, 10, 28, 0.96));
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1.25px solid rgba(56, 189, 248, 0.56);
  box-shadow:
    0 14px 36px rgba(1, 5, 18, 0.9),
    0 0 26px rgba(14, 165, 233, 0.3),
    inset 0 1px 0 rgba(186, 230, 253, 0.28);
}

/* Smoothly Gliding Slanted Neon Highlight Pill */
.nav-glider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 26.5%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 68% 58% at 50% 0%, rgba(186, 248, 255, 0.85) 0%, rgba(56, 232, 255, 0.38) 44%, rgba(14, 165, 233, 0.08) 84%),
    linear-gradient(180deg, rgba(56, 189, 248, 0.34), rgba(14, 165, 233, 0.06));
  border-top: 2px solid #9bfbff;
  box-shadow: inset 0 3px 16px rgba(125, 249, 255, 0.55);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.3s ease;
  clip-path: polygon(0% 0%, 82% 0%, 100% 100%, 0% 100%);
  transform: translateX(0%);
}

.bottom-nav[data-active-idx="0"] .nav-glider {
  transform: translateX(0%);
  clip-path: polygon(0% 0%, 82% 0%, 100% 100%, 0% 100%);
}
.bottom-nav[data-active-idx="1"] .nav-glider {
  transform: translateX(91.5%);
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
}
.bottom-nav[data-active-idx="2"] .nav-glider {
  transform: translateX(186%);
  clip-path: polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%);
}
.bottom-nav[data-active-idx="3"] .nav-glider {
  transform: translateX(278%);
  clip-path: polygon(18% 0%, 100% 0%, 100% 100%, 0% 100%);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: #8eb2dc;
  font-size: 10.5px;
  font-weight: 700;
  transition: color 0.22s ease, transform 0.16s ease;
  z-index: 2;
}
.nav-item:active { transform: scale(0.92); }
.nav-item svg { width: 20px; height: 20px; position: relative; z-index: 2; transition: filter 0.22s ease; }
.nav-item span { position: relative; z-index: 2; }

.nav-item.active {
  color: #7df9ff;
  text-shadow: 0 0 12px rgba(56, 232, 255, 0.72);
}
.nav-item.active svg {
  color: #ffffff;
  filter: drop-shadow(0 0 10px rgba(103, 243, 255, 0.92));
}

/* ==================== Modals & Bottom Sheets ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 18, 0.82);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 12px;
}

.modal-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 90dvh;
  overflow-y: auto;
  background: linear-gradient(170deg, #0d1f47, #040d22);
  border: 1.2px solid rgba(56, 189, 248, 0.52);
  border-radius: 24px;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.75), 0 0 26px rgba(14, 165, 233, 0.25);
}

.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: rgba(148, 163, 184, 0.45); margin: 0 auto 12px; }
.sheet-title { margin: 0 0 4px; font-size: 16.5px; }
.sheet-sub { margin: 0 0 12px; font-size: 11.5px; color: var(--muted); }

.power-sheet-grid { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.sheet-opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 10px 12px; border-radius: 14px;
  background: rgba(11, 27, 62, 0.88); border: 1px solid rgba(56, 189, 248, 0.32); color: #f8fafc;
}
.sheet-opt:active { transform: scale(0.98); }
.sheet-opt strong { display: block; font-size: 13px; }
.sheet-opt small { display: block; font-size: 10.5px; color: var(--muted); }
.sheet-opt.danger { border-color: rgba(244, 63, 94, 0.58); background: rgba(136, 19, 55, 0.4); }
.sheet-opt.warn   { border-color: rgba(250, 204, 21, 0.45); }
.sheet-opt.sky    { border-color: rgba(56, 189, 248, 0.48); }

.modal-icon { font-size: 32px; margin: 6px 0; }
.modal-sheet h2 { margin: 0 0 8px; font-size: 17px; }
.modal-sheet p { margin: 0 0 16px; font-size: 13px; color: #cbd5e1; line-height: 1.5; }

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-secondary, .btn-danger { height: 44px; border-radius: 13px; font-size: 13.5px; font-weight: 800; border: none; }
.btn-secondary { background: #1e293b; color: #e2e8f0; }
.btn-danger { background: linear-gradient(135deg, #e11d48, #f43f5e); color: #ffffff; }
.full-w { width: 100%; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100vw - 28px);
  background: rgba(5, 16, 40, 0.96);
  border: 1px solid #38bdf8;
  color: #f8fafc;
  padding: 9px 15px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.38;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72), 0 0 16px rgba(56, 189, 248, 0.25);
  z-index: 150;
  text-align: center;
}

/* ==================== Compact 360px Mobile Viewport Responsive Tuning ==================== */
@media (max-width: 374px) {
  .app-shell {
    padding: calc(6px + env(safe-area-inset-top)) 8px calc(76px + env(safe-area-inset-bottom));
  }
  .topbar { margin-bottom: 6px; }
  .brand-logo-img { width: 36px; height: 36px; }
  .brand-title { font-size: 16.5px; }
  .brand-sub { font-size: 9.5px; }
  .status-capsule { padding: 5px 9px; gap: 6px; }
  .status-online { font-size: 11px; }

  .hero-card { margin-bottom: 7px; }
  .hero-top-grid {
    grid-template-columns: 132px 1fr;
    gap: 8px;
    padding: 0 2px 4px;
  }
  .gauge-wrap { width: 132px; height: 132px; }
  .gauge-number { font-size: 29px; }
  .gauge-pill { font-size: 8.5px; padding: 2px 7px; }
  .savings-pct { font-size: 26px; }
  .temp-chip { padding: 5px 6px; gap: 4px; }
  .chip-meta strong { font-size: 11.5px; }
  .pc-tower-layer { width: 138px; height: 170px; right: -12px; }
  .spark-hud-wrap { height: 62px; }

  .section-heading { margin: 2px 2px 6px; font-size: 13.5px; }
  .modes-stack { gap: 7px; margin-bottom: 7px; }
  .mode-card { min-height: 68px; padding: 7px 9px; gap: 8px; }
  .mode-icon-box, .mode-3d-img { width: 41px; height: 41px; }
  .mode-title { font-size: 13.8px; }
  .mode-sub { font-size: 9.2px; }
  .mode-meta-pill { font-size: 9px; padding: 2px 7px; }
  .mode-pill { min-width: 72px; padding: 5.5px 8px; font-size: 10px; }

  .bento-grid { gap: 7px; }
  .bento-card { padding: 7px 7px; }
  .bento-header { margin-bottom: 5px; font-size: 11.5px; }
  .hw-row { padding: 5px 2px; }
  .hw-name { font-size: 9.8px; }
  .hw-stat { font-size: 9.3px; }
  .opt-tile { font-size: 9px; padding: 6px 1px; }
}
