/* ============================================================
   GVT Solar — Design System v7
   Light Mode · iOS-style PWA · Clean & Premium
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --bg:           #f0f2f7;
  --bg-card:      #ffffff;
  --bg-input:     #f5f7fa;
  --bg-subtle:    #eef1f7;

  --solar:        #f59e0b;
  --solar-soft:   rgba(245,158,11,0.12);
  --solar-border: rgba(245,158,11,0.25);
  --solar-glow:   rgba(245,158,11,0.20);

  --grid:         #3b82f6;
  --grid-soft:    rgba(59,130,246,0.10);
  --grid-border:  rgba(59,130,246,0.22);
  --grid-glow:    rgba(59,130,246,0.18);

  --green:        #22c55e;
  --green-soft:   rgba(34,197,94,0.12);
  --green-border: rgba(34,197,94,0.25);

  --red:          #ef4444;
  --red-soft:     rgba(239,68,68,0.10);
  --red-border:   rgba(239,68,68,0.22);

  --orange:       #f97316;

  --text:         #111827;
  --text-sec:     rgba(17,24,39,0.55);
  --text-muted:   rgba(17,24,39,0.35);

  --border:       rgba(17,24,39,0.08);
  --border-hi:    rgba(17,24,39,0.14);
  --shadow:       0 2px 12px rgba(17,24,39,0.08), 0 1px 3px rgba(17,24,39,0.06);
  --shadow-lg:    0 8px 32px rgba(17,24,39,0.10), 0 2px 8px rgba(17,24,39,0.06);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm:  8px;

  --sai-top:    env(safe-area-inset-top, 0px);
  --sai-bottom: env(safe-area-inset-bottom, 0px);
  --sai-left:   env(safe-area-inset-left, 0px);
  --sai-right:  env(safe-area-inset-right, 0px);

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  /* prevent pull-to-refresh & overscroll bounce */
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

body {
  height: 100%;
  font-family: 'Inter', -apple-system, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
}

button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--grid); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }

/* ════════════════════════════════════════════════════════════
   LOGIN
════════════════════════════════════════════════════════════ */
.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 70% 50% at 30% 0%, rgba(245,158,11,0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 45% at 80% 100%, rgba(59,130,246,0.07) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  width: min(100%, 380px);
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.login-card { animation: card-in 0.4s cubic-bezier(0.25,0.46,0.45,0.94) both; }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-6px); }
  40%     { transform: translateX(6px); }
  60%     { transform: translateX(-4px); }
  80%     { transform: translateX(4px); }
}
.login-card.shake { animation: shake 0.4s ease both; }

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(245,158,11,0.12), rgba(59,130,246,0.08));
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}
.login-logo svg { width: 40px; height: 40px; }

.login-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text);
}
.login-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 28px;
}

.login-error {
  width: 100%;
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  border-radius: var(--r-md);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label  { font-size: 12px; font-weight: 600; color: var(--text-sec); letter-spacing: 0.03em; }

.field-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-hi);
  background: var(--bg-input);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus {
  border-color: var(--grid);
  box-shadow: 0 0 0 3px var(--grid-soft);
}

.field-pw-wrap { position: relative; }
.field-pw-wrap .field-input { padding-right: 46px; }
.pw-toggle {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: grid;
  place-items: center;
  padding: 4px;
}
.pw-toggle:hover { color: var(--text-sec); }

.login-btn {
  margin-top: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 0;
  background: linear-gradient(135deg, var(--grid), #6366f1);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(59,130,246,0.35);
  transition: opacity 0.2s, transform 0.15s;
}
.login-btn:active { opacity: 0.88; transform: scale(0.98); }

/* ════════════════════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════════════════════ */
.page-shell {
  min-height: 100dvh;
  display: grid;
  place-items: start center;
  background:
    radial-gradient(ellipse 70% 40% at 15% 0%, rgba(245,158,11,0.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 35% at 90% 100%, rgba(59,130,246,0.06) 0%, transparent 50%),
    var(--bg);
}

.app-shell {
  width: 100%;
  max-width: 1200px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

/* ── App Header ───────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(16px + var(--sai-top)) 20px 14px;
  background: rgba(240,242,247,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.app-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.app-header h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-indicator {
  font-size: 10px;
  background: rgba(255, 71, 87, 0.1);
  color: #ff4757;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  vertical-align: middle;
}
.live-dot {
  width: 5px;
  height: 5px;
  background: #ff4757;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff4757;
  animation: live-pulse 1.8s infinite;
}
@keyframes live-pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}


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

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-sec);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover  { background: var(--bg-subtle); }
.icon-btn:active { transform: scale(0.93); }

/* ── Status Chip ──────────────────────────────────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text-sec);
}
.status-chip.sm {
  font-size: 11px;
  padding: 4px 10px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  animation: pulse-dot 2.4s ease infinite;
}
.status-dot.warn   { background: var(--orange); }
.status-dot.danger { background: var(--red); animation: none; }

@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  55%  { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* ── Scroll Area ──────────────────────────────────────────── */
.app-scroll {
  flex: 1;
  overflow-y: hidden;
  overflow-x: hidden;
  padding: clamp(6px, 1.5vh, 16px) 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(4px, 1vh, 12px);
}
.app-scroll::-webkit-scrollbar { display: none; }

/* ── Meta Row ─────────────────────────────────────────────── */
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.meta-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: fade-up 0.38s cubic-bezier(0.25,0.46,0.45,0.94) both;
}

.card:nth-child(1) { animation-delay: 0.04s; }
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.13s; }
.card:nth-child(4) { animation-delay: 0.18s; }
.card:nth-child(5) { animation-delay: 0.22s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(8px, 2vh, 16px) 18px 4px;
}
.card-head h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.card-head span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════
   POWER FLOW
══════════════════════════════════════════════════════════ */
.flow-wrap {
  padding: 4px 16px 12px;
}

.flow-stage {
  position: relative;
  height: clamp(140px, 25vh, 250px);
}

.flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.flow-path {
  fill: none;
  stroke: var(--border-hi);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.5s;
}

/* Animated active paths */
.flow-path.solar-active {
  stroke: var(--solar);
  stroke-dasharray: 7 9;
  animation: dash-flow 1.3s linear infinite;
  filter: drop-shadow(0 0 3px rgba(245,158,11,0.45));
}
.flow-path.grid-active {
  stroke: var(--grid);
  stroke-dasharray: 7 9;
  animation: dash-flow 1.3s linear infinite;
  filter: drop-shadow(0 0 3px rgba(59,130,246,0.45));
}

@keyframes dash-flow {
  to { stroke-dashoffset: -16; }
}

/* ── Flow Nodes ──────────────────────────────────────────── */
.flow-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 86px;
  text-align: center;
}

.flow-node.left   { top: 25%;  left: 4px; }
.flow-node.right  { top: 25%;  right: 4px; }
.flow-node.bottom { bottom: 0;  left: 50%; transform: translateX(-50%); }

.node-icon {
  width: clamp(48px, 12vw, 62px);
  height: clamp(48px, 12vw, 62px);
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color 0.4s, box-shadow 0.4s;
  position: relative;
}
.node-icon svg { width: 28px; height: 28px; }

/* Active node glow */
.flow-node.solar-on .node-icon {
  border-color: var(--solar-border);
  box-shadow: 0 0 0 4px var(--solar-soft), var(--shadow);
}
.flow-node.grid-on .node-icon {
  border-color: var(--grid-border);
  box-shadow: 0 0 0 4px var(--grid-soft), var(--shadow);
}
.flow-node.load-on .node-icon {
  border-color: var(--green-border);
  box-shadow: 0 0 0 4px var(--green-soft), var(--shadow);
}

.node-watts {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.node-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-sec);
}
.node-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.node-badge.solar { background: var(--solar-soft); color: var(--solar); border: 1px solid var(--solar-border); }
.node-badge.grid  { background: var(--grid-soft);  color: var(--grid);  border: 1px solid var(--grid-border); }

/* ══════════════════════════════════════════════════════════
   AUTOMATION CARD
══════════════════════════════════════════════════════════ */
.auto-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.auto-body.solar-mode {
  background: linear-gradient(135deg, rgba(245,158,11,0.07) 0%, rgba(245,158,11,0.02) 100%);
  border-color: var(--solar-border);
}
.auto-body.grid-mode {
  background: linear-gradient(135deg, rgba(59,130,246,0.07) 0%, rgba(59,130,246,0.02) 100%);
  border-color: var(--grid-border);
}

.auto-info .auto-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.auto-info .auto-value {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--text);
}
.auto-info .auto-reason {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.4;
  max-width: 200px;
}
.auto-info .auto-detail {
  margin-top: 6px;
  font-size: 11px;
  color: var(--orange);
}

.auto-icon-ring {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.auto-icon-ring.solar {
  background: var(--solar-soft);
  border: 1px solid var(--solar-border);
}
.auto-icon-ring.grid {
  background: var(--grid-soft);
  border: 1px solid var(--grid-border);
}

/* ══════════════════════════════════════════════════════════
   METRICS 2×2
══════════════════════════════════════════════════════════ */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  animation: fade-up 0.38s 0.16s cubic-bezier(0.25,0.46,0.45,0.94) both;
}

.metric-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(6px, 1vh, 14px) 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: box-shadow 0.2s;
}
.metric-tile:hover { box-shadow: var(--shadow-lg); }

.mt-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.mt-icon.green  { background: var(--green-soft); }
.mt-icon.orange { background: var(--solar-soft); }
.mt-icon.blue   { background: var(--grid-soft); }
.mt-icon.red    { background: var(--red-soft); }

.mt-label { font-size: 11px; font-weight: 500; color: var(--text-sec); }
.mt-value { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; color: var(--text); }

/* ══════════════════════════════════════════════════════════
   BLE STATUS CARD
══════════════════════════════════════════════════════════ */
/* Removed .ble-card-wrap empty ruleset */
.ble-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(8px, 1vh, 14px) 16px;
}

.ble-dot-ring {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ble-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2.4s ease infinite;
  transition: background 0.3s;
}
.ble-dot.offline { background: var(--red); animation: none; }
.ble-dot.warn    { background: var(--orange); }

.ble-info { flex: 1; min-width: 0; }
.ble-title { font-size: 14px; font-weight: 700; color: var(--text); }
.ble-sub   { font-size: 12px; color: var(--text-sec); margin-top: 2px; }

.relay-badges { display: flex; gap: 6px; flex-shrink: 0; }
.relay-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  border: 1px solid;
}
.relay-badge.ok    { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.relay-badge.off   { background: var(--bg-subtle);  color: var(--text-muted); border-color: var(--border); }
.relay-badge.alarm { background: var(--red-soft);   color: var(--red);   border-color: var(--red-border); }

/* ══════════════════════════════════════════════════════════
   QUICK ACTIONS
══════════════════════════════════════════════════════════ */
.action-grid {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ctrl-btn {
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(10px, 1.5vh, 14px) 14px;
  text-align: left;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1vh, 8px);
  position: relative;
  overflow: hidden;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.1s;
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.ctrl-btn:disabled {
  opacity: 0.45;
  transform: none !important;
  pointer-events: none;
}

/* Button type styles */
.ctrl-btn.solar { border-color: var(--solar-border); }
.ctrl-btn.grid  { border-color: var(--grid-border); }
.ctrl-btn.alarm { border-color: var(--red-border); }
.ctrl-btn.off   { border-color: var(--border); }

/* ACTIVE / currently engaged state (server-confirmed) */
.ctrl-btn.is-active {
  box-shadow: 0 0 0 2.5px currentColor;
}
.ctrl-btn.solar.is-active {
  background: var(--solar-soft);
  box-shadow: 0 0 0 2.5px var(--solar);
}
.ctrl-btn.grid.is-active {
  background: var(--grid-soft);
  box-shadow: 0 0 0 2.5px var(--grid);
}
.ctrl-btn.alarm.is-active {
  background: var(--red-soft);
  box-shadow: 0 0 0 2.5px var(--red);
}
.ctrl-btn.off.is-active {
  background: var(--bg-subtle);
  box-shadow: 0 0 0 2.5px var(--text-sec);
}

.ctrl-btn.is-active .active-dot {
  display: block;
}

.active-dot {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ══════════════════════════════════════════════════════════
   SPINNER
══════════════════════════════════════════════════════════ */
/* Loading state for buttons */
.ctrl-btn.is-loading {
  opacity: 0.8;
  cursor: wait;
}
.ctrl-btn.is-loading::before {
  content: "";
  position: absolute;
  top: 10px; right: 10px;
  width: 12px; height: 12px;
  border: 2px solid rgba(0,0,0,0.05);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.is-active .active-dot {
  animation: pulse-dot-active 2s infinite;
}
@keyframes pulse-dot-active {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* Refresh button spinning state */
.refresh-spinning { animation: spin 0.65s linear infinite; }

.app-col-mid, .app-col-side, .app-row-bottom { display: contents; }
.desktop-detail-card { display: none; }

@media (max-width: 520px) {
  .page-shell { padding: 0; }
  .app-shell  { width: 100vw; min-height: 100dvh; }
}

@media (min-width: 521px) {
  .app-shell {
    border-radius: 0;
    overflow: hidden;
    height: 100dvh;
    max-width: 100%;
    border: none;
  }
  .card { padding: 16px 20px; }
  .card-head { margin-bottom: 20px; }
  .card-head h2 { font-size: 14px; font-weight: 800; color: var(--text-sec); }
  
  .app-scroll {
    display: grid;
    grid-template-columns: 460px 1fr 340px;
    gap: 20px;
    padding: 20px 24px;
    overflow-y: auto;
  }

  .app-col-mid, .app-col-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .app-row-bottom {
    grid-column: 1 / 4;
  }

  .desktop-detail-card { display: block; }
  
  .meta-row {
    grid-column: 1 / -1;
  }

  .action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .control-row {
    display: contents;
  }

  .weather-grid, .system-grid {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .weather-item, .sys-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
  }
  .weather-item:last-child, .sys-item:last-child { border-bottom: none; }
  .wi-label, .sys-label { font-size: 13px; color: var(--text-sec); }
  .wi-value, .sys-value { font-size: 15px; font-weight: 700; }

  /* Larger Icons on Desktop */
  .node-icon {
    width: 86px;
    height: 86px;
    border-radius: 24px;
  }
  .node-icon svg { width: 44px; height: 44px; }
  .node-watts { font-size: 20px; }
  .node-label { font-size: 13px; }

  .cb-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .cb-icon svg { width: 24px; height: 24px; }
  .cb-label { font-size: 16px; }
  .cb-sub   { font-size: 12px; }

  .mt-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }
  .mt-icon svg { width: 20px; height: 20px; }
  .mt-value { font-size: 26px; }

  .flow-stage {
    height: 320px;
  }
  .flow-node.left, .flow-node.right { top: 20%; }
}







.auto-body.manual-mode {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}
.auto-enable-btn {
  margin-top: 10px;
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.auto-enable-btn:hover { opacity: 0.9; }
.auto-enable-btn:disabled { opacity: 0.5; cursor: not-allowed; }
