:root,
[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-grad: radial-gradient(1200px 600px at 12% -10%, rgba(56, 189, 248, 0.09), transparent 55%),
             radial-gradient(900px 500px at 90% 0%, rgba(251, 146, 60, 0.08), transparent 55%),
             #0b0f17;
  --surface: rgba(19, 25, 36, 0.88);
  --surface-2: rgba(27, 36, 51, 0.85);
  --surface-hover: rgba(36, 48, 68, 0.92);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.25);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --warm: #fb923c;
  --warm-soft: rgba(251, 146, 60, 0.16);
  --cold: #60a5fa;
  --cold-soft: rgba(96, 165, 250, 0.16);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.15);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --iso-slab: #2d3542;
  --iso-cold: #244b74;
  --iso-ok: #2d3a45;
  --iso-warm: #7a4522;
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-grad: radial-gradient(1100px 550px at 10% -10%, rgba(14, 165, 233, 0.12), transparent 55%),
             radial-gradient(900px 500px at 92% 0%, rgba(249, 115, 22, 0.10), transparent 55%),
             #f1f5f9;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-2: rgba(241, 245, 249, 0.95);
  --surface-hover: rgba(226, 232, 240, 0.9);
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.12);
  --warm: #ea580c;
  --warm-soft: rgba(234, 88, 12, 0.13);
  --cold: #2563eb;
  --cold-soft: rgba(37, 99, 235, 0.12);
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.12);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --iso-slab: #cbd5e1;
  --iso-cold: #60a5fa;
  --iso-ok: #94a3b8;
  --iso-warm: #fb923c;
}

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

html, body {
  min-height: 100%;
  background: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.hidden { display: none !important; }

.app-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  box-shadow: 0 0 12px var(--accent);
}

.brand-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-pills {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.nav-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-pill.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

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

.icon-pill, .icon-btn, .ghost-btn, .link-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.icon-pill:hover, .icon-btn:hover, .ghost-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-meta {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sep { opacity: 0.4; }

.badge-test {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
}

.seg-small {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* Kiosk Grid (optimized for 10" 1280x800 landscape tablet) */
.kiosk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.house-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kiosk-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Isometric Stage */
.iso-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 430px;
  padding: 6px 0;
}

.iso-floor-tag {
  position: absolute;
  left: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.tag-f2 { top: 10px; }
.tag-f1 { top: 53%; }

.iso-canvas {
  position: relative;
  width: 100%;
  max-width: 470px;
  aspect-ratio: 373 / 418;
}

.iso-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.iso-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.iso-pill {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 7px;
  border-radius: 9px;
  background: rgba(11, 15, 23, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #f8fafc;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

[data-theme="light"] .iso-pill {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.iso-pill:hover, .iso-pill.selected {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  z-index: 5;
}

.iso-pill.st-cold { border-color: rgba(96, 165, 250, 0.65); }
.iso-pill.st-warm { border-color: rgba(251, 146, 60, 0.65); }

.iso-pill-name {
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0.78;
  line-height: 1.1;
}

.iso-pill-temp {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.15;
}

.iso-legend {
  display: flex;
  gap: 14px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.leg-item { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot-cold { background: var(--cold); }
.dot-ok { background: var(--text-dim); }
.dot-warm { background: var(--warm); }

/* Room Cards View */
.rooms-cards-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 0 10px;
}

.floor-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

.room-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}

.room-card:hover, .room-card.selected {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.room-card.st-cold { border-left: 3px solid var(--cold); }
.room-card.st-warm { border-left: 3px solid var(--warm); }
.room-card.st-ok { border-left: 3px solid var(--ok); }

.rc-name { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.rc-temp { font-size: 22px; font-weight: 700; margin: 2px 0; }
.rc-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim); }

/* Selected Room Detail Bar */
.room-detail-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.rd-name { font-weight: 700; font-size: 14px; display: block; }
.rd-sub { font-size: 11.5px; color: var(--text-muted); }
.rd-right { display: flex; gap: 16px; }
.rd-metric { display: flex; flex-direction: column; align-items: flex-end; }
.rd-metric small { font-size: 10.5px; color: var(--text-dim); }
.rd-metric strong { font-size: 15px; }

/* Boiler Control Panel */
.boiler-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  background: var(--warm-soft);
  color: var(--warm);
}

.boiler-badge.idle {
  background: var(--surface-2);
  color: var(--text-muted);
}

.boiler-badge.pool-badge {
  background: var(--accent-soft);
  color: var(--accent);
}

.flame-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.thermostat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 14px;
}

.t-step-btn {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 28px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background 0.15s;
}

.t-step-btn.small { width: 44px; height: 44px; font-size: 22px; border-radius: 13px; }
.t-step-btn:hover { background: var(--surface-hover); }
.t-step-btn:active { transform: scale(0.94); }

.t-display { text-align: center; }
.t-target {
  font-size: 50px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.t-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.presets-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.preset-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 11px;
  padding: 7px 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  transition: all 0.15s;
}

.preset-chip span { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.preset-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.preset-chip.active span { color: var(--accent); }

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.tel-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.tel-label { font-size: 11px; color: var(--text-dim); }
.tel-val { font-size: 15px; font-weight: 700; margin-top: 2px; }

.mod-bar-wrap {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 12px;
}

.mod-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  border-radius: 99px;
  transition: width 0.35s ease;
}

.control-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.ghost-btn {
  padding: 6px 11px;
  font-size: 12px;
}

.link-btn {
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}

/* Pool Hero */
.pool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
}

.pool-now-val { font-size: 40px; font-weight: 800; color: var(--accent); line-height: 1; }
.pool-now-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.pool-target-ctrl { display: flex; align-items: center; gap: 10px; }
.pool-target-info { text-align: center; }
.pool-target-info strong { font-size: 20px; display: block; }
.pool-target-info small { font-size: 11px; color: var(--text-muted); }

/* Compact Weather Widget */
.mini-weather-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mini-w-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mini-w-now { display: flex; align-items: center; gap: 12px; }
.mini-w-icon { width: 46px; height: 46px; flex-shrink: 0; }
.mini-w-temp-row { display: flex; align-items: baseline; gap: 8px; }
.mini-w-temp { font-size: 28px; font-weight: 800; line-height: 1; }
.mini-w-cond { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.mini-w-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.mini-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.mini-h-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.mini-h-time { font-size: 11px; color: var(--text-dim); }
.mini-h-icon { width: 24px; height: 24px; }
.mini-h-temp { font-size: 13.5px; font-weight: 700; }
.mini-h-prob { font-size: 10.5px; color: var(--accent); min-height: 14px; }

.mini-days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mini-d-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.mini-d-card strong { font-size: 13px; }
.mini-d-card span { color: var(--text-muted); }

/* ================= TAB 2: WEATHER ================= */
.weather-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.w-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 24px;
  align-items: center;
}

.w-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.w-hero-icon { width: 76px; height: 76px; }
.w-hero-temp { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.w-hero-cond { font-size: 17px; font-weight: 600; margin-top: 4px; }
.w-hero-loc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.w-hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.wm-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.wm-label { font-size: 11.5px; color: var(--text-dim); }
.wm-val { font-size: 20px; font-weight: 700; margin-top: 3px; }

.w-hero-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.preset-pill-info {
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* 24h Chart & Cards */
.chart-wrap {
  width: 100%;
  height: 145px;
  margin-bottom: 10px;
}

.chart-wrap svg { width: 100%; height: 100%; display: block; }

.hourly-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.h-card {
  flex: 0 0 82px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.h-time { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.h-icon { width: 30px; height: 30px; }
.h-temp { font-size: 16px; font-weight: 700; }
.h-prob { font-size: 11px; color: var(--accent); font-weight: 600; }
.h-wind { font-size: 10.5px; color: var(--text-dim); }

/* 3 Days Grid */
.days3-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.d3-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.d3-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.d3-title { font-weight: 700; font-size: 15px; }
.d3-sub { font-size: 12px; color: var(--text-muted); }
.d3-range { font-size: 16px; font-weight: 700; text-align: right; }
.d3-range span { color: var(--text-muted); font-weight: 500; }

.d3-parts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.d3-part {
  display: grid;
  grid-template-columns: 56px 26px 1fr auto auto;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.d3-part-lbl { color: var(--text-muted); }
.d3-part-prob { color: var(--accent); font-size: 11.5px; text-align: right; }
.d3-part-temp { font-weight: 700; min-width: 42px; text-align: right; }

/* 10 Days List */
.days10-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.d10-row {
  display: grid;
  grid-template-columns: 110px 32px 92px 46px 1fr 46px 64px;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 13px;
}

.d10-day { font-weight: 600; }
.d10-day small { display: block; font-size: 11px; color: var(--text-dim); font-weight: 400; }
.d10-prob { font-size: 12px; color: var(--accent); }
.d10-min { text-align: right; color: var(--text-muted); font-weight: 600; }
.d10-max { text-align: left; font-weight: 700; }
.d10-wind { text-align: right; font-size: 12px; color: var(--text-dim); }

.range-track {
  height: 7px;
  background: rgba(148, 163, 184, 0.16);
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}

.range-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cold), var(--accent), var(--warm));
}

/* Month Grid */
.month-note {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
}

.tag-fc {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.tag-clim {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}

.m-cell {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-cell.climate {
  border-style: dashed;
  opacity: 0.85;
}

.m-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }
.m-mid { display: flex; align-items: center; justify-content: space-between; margin: 2px 0; }
.m-temps { font-size: 14px; font-weight: 700; }
.m-temps span { color: var(--text-dim); font-weight: 500; font-size: 12.5px; }
.m-prob { font-size: 11px; color: var(--accent); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, 0.68);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  overflow: hidden;
}

.pin-card { max-width: 320px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.sim-row { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sim-label-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sim-inline { display: flex; align-items: center; gap: 10px; }
.sim-inline input { flex: 1; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.sim-divider { height: 1px; background: var(--border); }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 11px;
  cursor: pointer;
}
.primary-btn.full { width: 100%; padding: 10px; }

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.35em;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
}
.pin-error { color: #f87171; font-size: 12.5px; text-align: center; }

/* Responsive */
@media (max-width: 980px) {
  .kiosk-grid { grid-template-columns: 1fr; }
  .w-hero { grid-template-columns: 1fr; }
  .days3-grid { grid-template-columns: 1fr; }
  .d10-row { grid-template-columns: 88px 28px 66px 40px 1fr 40px; }
  .d10-wind { display: none; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .nav-pills { order: 3; width: 100%; justify-content: center; }
  .w-hero-metrics { grid-template-columns: repeat(2, 1fr); }
  .mini-strip { grid-template-columns: repeat(3, 1fr); }
  .mini-days { grid-template-columns: 1fr; }
  .telemetry-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Real Daewoo Boiler (ESP32) controls */
.real-boiler-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12px;
}
.rb-title { font-weight: 600; opacity: 0.9; }
.rb-status { opacity: 0.65; }
.rb-status.online { color: #4ade80; opacity: 1; }
.rb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.rb-ctrl {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rb-label { font-size: 11px; opacity: 0.7; }
.rb-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 4px 6px;
}
.rb-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 16px;
  cursor: pointer;
}
.rb-btn:hover { background: rgba(255, 255, 255, 0.2); }
.rb-val { font-size: 16px; font-weight: 700; }
.rb-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.rb-flame {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.rb-flame.on {
  background: rgba(255, 123, 41, 0.2);
  color: #ff8c3a;
  border: 1px solid rgba(255, 123, 41, 0.5);
}
.rb-flame.off {
  background: rgba(255, 255, 255, 0.06);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
