:root {
  --bg: #060913;
  --glass-bg: linear-gradient(
    160deg,
    rgba(22, 30, 50, 0.78) 0%,
    rgba(12, 17, 30, 0.85) 100%
  );
  --glass-bg-hover: linear-gradient(
    160deg,
    rgba(28, 38, 64, 0.84) 0%,
    rgba(15, 22, 38, 0.88) 100%
  );
  --glass-border: rgba(255, 255, 255, 0.13);
  --glass-border-strong: rgba(255, 255, 255, 0.25);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  --glass-shadow: 0 18px 42px rgba(0, 0, 0, 0.52), 0 2px 8px rgba(0, 0, 0, 0.28);

  --text: #f8fafc;
  --text-dim: rgba(226, 234, 248, 0.78);
  --text-muted: rgba(176, 192, 218, 0.56);

  --amber: #ffca57;
  --amber-soft: rgba(255, 202, 87, 0.18);
  --amber-glow: rgba(255, 194, 71, 0.42);

  --sky: #56ccf2;
  --sky-soft: rgba(86, 204, 242, 0.16);

  --ember: #ff7b54;
  --ember-soft: rgba(255, 123, 84, 0.2);

  --violet: #b69bff;
  --violet-soft: rgba(182, 155, 255, 0.17);

  --teal: #3ee4c8;
  --green: #4ade80;
  --red: #fb7185;

  --radius-2xl: 26px;
  --radius-xl: 22px;
  --radius-lg: 17px;
  --radius-md: 13px;
  --radius-sm: 10px;
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  touch-action: manipulation;
}

/* Fluid Refractive Mesh Backdrop */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 85% 5%, rgba(62, 125, 255, 0.26) 0%, transparent 60%),
    radial-gradient(ellipse 75% 55% at 12% 92%, rgba(139, 92, 246, 0.28) 0%, transparent 62%),
    radial-gradient(ellipse 65% 50% at 50% 42%, rgba(20, 184, 166, 0.14) 0%, transparent 60%),
    #050811;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  opacity: 0.23;
  will-change: transform;
}

.orb-1 {
  width: 560px;
  height: 560px;
  top: -160px;
  right: -120px;
  background: radial-gradient(circle, rgba(255, 198, 88, 0.58) 0%, rgba(255, 138, 76, 0.16) 50%, transparent 72%);
  animation: floatOrb1 18s ease-in-out infinite alternate;
}

.orb-2 {
  width: 620px;
  height: 620px;
  bottom: -220px;
  left: -140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.62) 0%, rgba(59, 130, 246, 0.2) 52%, transparent 72%);
  animation: floatOrb2 22s ease-in-out infinite alternate;
}

.orb-3 {
  width: 480px;
  height: 480px;
  top: 32%;
  left: 34%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.42) 0%, rgba(45, 212, 191, 0.12) 55%, transparent 72%);
  animation: floatOrb3 26s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-45px, 38px) scale(1.08); }
}

@keyframes floatOrb2 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(55px, -36px) scale(1.1); }
}

@keyframes floatOrb3 {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-35px, -42px) scale(0.94); }
}

/* Liquid Glass Core Surface */
.glass-panel {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.hidden {
  display: none !important;
}

/* Splash Screen (iOS 26 Liquid Glass Stage) */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 55% at 25% 20%, rgba(56, 189, 248, 0.22) 0%, transparent 62%),
    radial-gradient(ellipse 65% 55% at 78% 82%, rgba(251, 191, 36, 0.20) 0%, transparent 62%),
    rgba(5, 8, 17, 0.94);
  backdrop-filter: blur(48px) saturate(210%);
  -webkit-backdrop-filter: blur(48px) saturate(210%);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] .splash-screen {
  background:
    radial-gradient(ellipse 70% 55% at 25% 20%, rgba(56, 189, 248, 0.24) 0%, transparent 62%),
    radial-gradient(ellipse 65% 55% at 78% 82%, rgba(251, 191, 36, 0.22) 0%, transparent 62%),
    rgba(226, 234, 246, 0.96);
}

.splash-screen.fade-out {
  opacity: 0;
  transform: scale(1.06);
  filter: blur(10px);
  pointer-events: none;
}

.splash-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 28px 32px;
  text-align: center;
  min-width: 280px;
  animation: splashRise 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.splash-emblem-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.splash-halo {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(255, 202, 87, 0.85), rgba(56, 189, 248, 0.8), rgba(168, 85, 247, 0.75), rgba(255, 202, 87, 0.85));
  filter: blur(22px);
  opacity: 0.62;
  animation: spinSlow 6s linear infinite;
}

.splash-ring {
  position: absolute;
  inset: -6px;
  border-radius: 34px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  animation: ringPulse 2.4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 0.22; }
}

.splash-emblem {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.65),
    0 20px 44px -8px rgba(2, 6, 20, 0.55);
  display: grid;
  place-items: center;
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

.splash-title {
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.splash-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
}

.splash-bar {
  width: 160px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
  position: relative;
  margin-top: 2px;
}

.splash-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 46%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), var(--amber), var(--violet));
  animation: splashSlide 1.25s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes splashSlide {
  0% { right: -50%; }
  100% { right: 110%; }
}

/* Auth & Invite Liquid Glass Screen */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(5, 8, 17, 0.62);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 410px;
  padding: 32px 26px;
  text-align: center;
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-card.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

.auth-logo {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 202, 87, 0.3), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 224, 148, 0.5);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.5), 0 10px 28px rgba(255, 194, 71, 0.2);
  color: var(--amber);
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}

.auth-logo svg {
  width: 38px;
  height: 38px;
}

.auth-sub {
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.auth-mode-tabs {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-mode-tab {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-mode-tab.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.38);
}

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

.auth-form input[type="password"],
.auth-form input[type="text"],
.auth-form input[type="email"] {
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.18);
  color: var(--text);
  font-family: inherit;
  font-size: 0.98rem;
  text-align: center;
  outline: none;
  transition: all 0.18s ease;
}

.auth-form input[type="password"] {
  letter-spacing: 0.12em;
}

.auth-form input:focus {
  border-color: rgba(255, 202, 87, 0.72);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(255, 202, 87, 0.16);
}

.remember-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-dim);
  cursor: pointer;
}

.auth-error {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(251, 113, 133, 0.18);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #ffe4e6;
  font-size: 0.84rem;
}

.auth-submit {
  width: 100%;
  padding: 13px;
  font-size: 0.96rem;
  border-radius: 16px;
}

.auth-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 4px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.social-auth-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.btn-social {
  width: 100%;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 500;
  font-size: 0.92rem;
}

.btn-passkey-hero {
  background: linear-gradient(145deg, rgba(255, 202, 87, 0.24), rgba(86, 204, 242, 0.14));
  border-color: rgba(255, 218, 130, 0.52);
  color: #fff8e6;
  font-weight: 600;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.36), 0 8px 24px rgba(255, 194, 71, 0.16);
}

.btn-passkey-hero:hover {
  background: linear-gradient(145deg, rgba(255, 202, 87, 0.34), rgba(86, 204, 242, 0.22));
  border-color: rgba(255, 224, 148, 0.75);
}

.btn-google {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Main App Shell */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(112px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header */
.top-bar {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "brand pills icons";
  align-items: center;
  gap: 12px 14px;
}

.brand-group {
  grid-area: brand;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-meta {
  min-width: 0;
  flex: 1;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 202, 87, 0.28), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 218, 132, 0.45);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.42);
  color: var(--amber);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-logo svg {
  width: 28px;
  height: 28px;
}

.brand-group h1 {
  font-size: 1.26rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.connection-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--text-dim);
  margin-top: 2px;
  flex-wrap: wrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

#conn-text {
  white-space: nowrap;
  flex-shrink: 0;
}

.status-dot.connected {
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}

.status-dot.connecting {
  background: var(--amber);
  animation: pulse 1.3s infinite;
}

.status-dot.offline {
  background: var(--red);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.meta-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.74rem;
  color: var(--text);
}

.user-meta-pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clock-pill {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.header-quick-pills {
  grid-area: pills;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-quick-pills .btn {
  padding: 8px 13px;
  border-radius: 13px;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
}

.header-icon-group {
  grid-area: icons;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-inline-start: 12px;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.14);
}

.btn-door-glass {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.24), rgba(217, 119, 6, 0.14));
  border-color: rgba(251, 191, 36, 0.44);
  color: #fef3c7;
}

.btn-door-glass:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.34), rgba(217, 119, 6, 0.22));
  border-color: rgba(251, 191, 36, 0.68);
}

.btn-guest-glass {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(14, 165, 233, 0.18));
  border-color: rgba(52, 211, 153, 0.44);
  color: #d1fae5;
}

.btn-guest-glass:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.34), rgba(14, 165, 233, 0.26));
  border-color: rgba(52, 211, 153, 0.68);
}

html[data-theme="light"] .header-icon-group {
  border-inline-start-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .btn-door-glass {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: rgba(217, 119, 6, 0.38);
  color: #92400e;
}

html[data-theme="light"] .btn-door-glass:hover {
  background: linear-gradient(135deg, #fde68a, #fcd34d);
  color: #78350f;
}

html[data-theme="light"] .btn-guest-glass {
  background: linear-gradient(135deg, #d1fae5, #e0f2fe);
  border-color: rgba(5, 150, 105, 0.38);
  color: #065f46;
}

html[data-theme="light"] .btn-guest-glass:hover {
  background: linear-gradient(135deg, #a7f3d0, #bae6fd);
  color: #064e3b;
}

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

/* Liquid Glass Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 15px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28), 0 6px 18px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn:hover {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.09));
  border-color: rgba(255, 255, 255, 0.36);
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.96);
}

.btn .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn-icon-glass {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
}

.btn-danger-glass {
  background: linear-gradient(150deg, rgba(251, 113, 133, 0.28), rgba(244, 63, 94, 0.12));
  border-color: rgba(251, 113, 133, 0.45);
  color: #ffe4e6;
}

.btn-danger-glass:hover {
  background: linear-gradient(150deg, rgba(251, 113, 133, 0.4), rgba(244, 63, 94, 0.2));
  border-color: rgba(251, 113, 133, 0.65);
}

.split-action {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: linear-gradient(150deg, rgba(251, 113, 133, 0.26), rgba(244, 63, 94, 0.12));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.24), 0 6px 18px rgba(0, 0, 0, 0.22);
}

.split-action .btn-danger-glass {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  height: 40px;
}

.split-action .btn-danger-glass:hover {
  background: rgba(251, 113, 133, 0.22);
  transform: none;
}

.split-action #btn-all-off {
  padding: 0 15px;
}

.split-action .split-edit {
  padding: 0 12px;
  border-right: 1px solid rgba(251, 113, 133, 0.35);
}

.split-action .split-edit .icon {
  width: 15px;
  height: 15px;
}

.all-off-mode-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.88), rgba(37, 99, 235, 0.94));
  color: #ffffff;
  border-color: rgba(147, 197, 253, 0.55);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 6px 20px rgba(37, 99, 235, 0.28);
  font-weight: 600;
}

.btn-primary:hover {
  filter: brightness(1.07);
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.94), rgba(37, 99, 235, 0.98));
}

.btn-ghost {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
  border-radius: 12px;
}

/* Summary Strip (Home tab top pills) */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.22s ease;
}

.stat-card.clickable {
  cursor: pointer;
}

.stat-card.clickable:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-strong);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.32);
}

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

.stat-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.stat-icon.sky {
  background: var(--sky-soft);
  color: var(--sky);
}

.stat-icon.ember {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.stat-icon.ember.active {
  background: var(--ember-soft);
  color: var(--ember);
  box-shadow: 0 0 22px rgba(255, 123, 84, 0.45);
}

.stat-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.stat-val {
  font-size: 1.15rem;
  font-weight: 700;
}

/* Desktop Floating Liquid Capsule Bottom Dock */
.main-nav {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  width: fit-content;
  max-width: calc(100vw - 32px);
  padding: 6px;
  display: flex;
  gap: 6px;
  border-radius: 999px;
}

.nav-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-tab .icon {
  width: 18px;
  height: 18px;
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.nav-tab.active {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.44), 0 6px 20px rgba(0, 0, 0, 0.22);
}

/* Mobile Floating Liquid Glass Pill Dock (5 Tabs) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 90;
  padding: 6px 6px;
  border-radius: 999px;
  background: linear-gradient(155deg, rgba(24, 34, 56, 0.88), rgba(10, 15, 28, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(36px) saturate(190%);
  -webkit-backdrop-filter: blur(36px) saturate(190%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3), 0 16px 40px rgba(0, 0, 0, 0.65);
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
}

.m-nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: rgba(235, 242, 255, 0.72);
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 500;
  padding: 6px 2px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.m-nav-item svg {
  width: 19px;
  height: 19px;
}

.m-nav-item.active {
  color: #fff;
  background: linear-gradient(150deg, rgba(255, 202, 87, 0.3), rgba(255, 255, 255, 0.14));
  border-color: rgba(255, 224, 148, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Filter Bar & Rename Toolbar */
.rooms-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.rooms-toolbar .filter-bar {
  margin-bottom: 0;
  padding: 2px 0;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.rename-trigger-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}

.rename-trigger-btn .icon {
  width: 16px;
  height: 16px;
}

.rename-rooms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rename-dev-row {
  display: grid;
  grid-template-columns: 1fr 145px;
  gap: 8px;
  align-items: center;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.rename-dev-input {
  width: 100%;
  padding: 8px 11px !important;
  font-size: 0.88rem !important;
}

.rename-orig-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Favorite Quick Scenes Strip (Top of Rooms Tab) */
.fav-scenes-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.fav-scenes-bar::-webkit-scrollbar {
  display: none;
}

.fav-scene-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 110, 0.34);
  background: linear-gradient(145deg, rgba(255, 198, 82, 0.16), rgba(20, 28, 48, 0.78));
  color: #fff6dc;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease;
  flex-shrink: 0;
}

.fav-scene-pill:hover {
  background: linear-gradient(145deg, rgba(255, 198, 82, 0.28), rgba(28, 38, 64, 0.88));
  border-color: rgba(255, 216, 128, 0.62);
  transform: translateY(-1px);
}

.fav-scene-pill:active {
  transform: scale(0.97);
}

.fav-star-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.16s ease;
}

.fav-star-btn.active {
  background: rgba(255, 198, 82, 0.22);
  border-color: rgba(255, 214, 118, 0.6);
  color: #ffd670;
}

.scene-title-text {
  min-width: 0;
}

.scene-actions-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.scene-act-btn {
  padding: 7px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.scene-act-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.scene-act-btn.danger:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(251, 113, 133, 0.45);
  color: #ffe4e6;
}

/* Room Reorder List inside Rename Modal */
.rename-rooms-order-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.order-index {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.order-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.rename-room-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 12px;
  transition: background 0.14s ease, transform 0.14s ease;
}

.rename-room-row.is-row-dragging {
  background: rgba(255, 202, 87, 0.2);
  outline: 1px solid rgba(255, 214, 118, 0.65);
  transform: scale(1.01);
}

.drag-handle {
  width: 32px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  cursor: grab;
  flex-shrink: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
  background: rgba(255, 202, 87, 0.22);
  color: #fff;
}

.rename-room-row input {
  flex: 1;
}

.order-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.order-btn {
  width: 32px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.order-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Home Activity Log */
.activity-log-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 320px;
  overflow-y: auto;
  padding-left: 4px;
}

.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.84rem;
}

.activity-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.activity-summary {
  color: var(--text);
  font-weight: 500;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.activity-actor {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--text-dim);
}

/* Physical Keypads Map */
.keypad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.keypad-card {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.keypad-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.keypad-node-title {
  font-weight: 700;
  font-size: 0.94rem;
  display: flex;
  align-items: center;
  gap: 7px;
}

.keypad-keys-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.keypad-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.83rem;
}

.keypad-key-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.keypad-key-num {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  font-size: 0.74rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.keypad-key-name {
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keypad-key-state {
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.keypad-key-state.on {
  background: rgba(250, 204, 21, 0.22);
  color: #fde68a;
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.filter-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.filter-chip.active {
  background: linear-gradient(150deg, rgba(255, 202, 87, 0.3), rgba(255, 202, 87, 0.12));
  border-color: rgba(255, 218, 130, 0.6);
  color: #fff6d6;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.42), 0 4px 16px rgba(255, 194, 71, 0.2);
}

.filter-chip[data-room-drag] {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-x;
}

.filter-chip.is-dragging {
  opacity: 0.25;
  border-style: dashed;
  border-color: rgba(255, 214, 118, 0.7);
}

.drag-ghost-chip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  margin: 0;
  transform: scale(1.07);
  background: linear-gradient(150deg, rgba(255, 202, 87, 0.42), rgba(24, 34, 58, 0.94)) !important;
  border-color: #ffd166 !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 194, 71, 0.35);
}

.chip-badge {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

/* Rooms Grid (Balanced Flex Columns — Zero Empty Vertical Gaps & 100% Safari/WebKit Safe) */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

@media (min-width: 1180px) {
  .rooms-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.rooms-grid.single-room {
  grid-template-columns: 1fr;
}

.rooms-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.room-card {
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.room-title {
  font-size: 1.08rem;
  font-weight: 600;
}

.room-count {
  font-size: 0.78rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 9px;
  border-radius: 999px;
}

.room-quick-btns {
  display: flex;
  gap: 6px;
}

.mini-pill-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.16s ease;
}

.mini-pill-btn:hover {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.16);
}

/* Apple-Home Compact Vitrea Switch Tiles */
.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.switch-tile {
  position: relative;
  padding: 10px 11px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 6px 16px rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 60px;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

.switch-tile:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06));
  transform: translateY(-2px);
}

.switch-tile:active {
  transform: scale(0.95);
}

.switch-tile.light.is-on {
  background: linear-gradient(148deg, rgba(255, 202, 87, 0.34) 0%, rgba(255, 168, 52, 0.14) 60%, rgba(255, 255, 255, 0.09) 100%);
  border-color: rgba(255, 224, 145, 0.72);
  box-shadow:
    0 12px 32px rgba(255, 184, 52, 0.28),
    inset 0 1px 2px rgba(255, 248, 220, 0.65);
}

.switch-tile.boiler.is-on {
  background: linear-gradient(148deg, rgba(255, 123, 84, 0.36), rgba(234, 88, 12, 0.14));
  border-color: rgba(255, 178, 150, 0.7);
  box-shadow: 0 12px 32px rgba(255, 123, 84, 0.28), inset 0 1px 2px rgba(255, 232, 220, 0.55);
}

.switch-tile.fan.is-on {
  background: linear-gradient(148deg, rgba(62, 228, 200, 0.32), rgba(20, 184, 166, 0.12));
  border-color: rgba(153, 246, 228, 0.68);
  box-shadow: 0 12px 32px rgba(45, 212, 191, 0.24), inset 0 1px 2px rgba(220, 255, 248, 0.55);
}

.switch-tile.blind.is-on {
  background: linear-gradient(148deg, rgba(86, 204, 242, 0.28), rgba(14, 165, 233, 0.11));
  border-color: rgba(125, 211, 252, 0.62);
  box-shadow: 0 10px 26px rgba(56, 189, 248, 0.2), inset 0 1px 2px rgba(224, 247, 255, 0.45);
}

.switch-tile.blind.is-on .tile-icon {
  background: rgba(86, 204, 242, 0.3);
  color: #e0f7ff;
}

.switch-tile.blind.is-on .tile-led {
  background: var(--sky);
  box-shadow: 0 0 12px var(--sky);
}

.tile-top {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tile-name {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.28;
  color: var(--text);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.tile-state {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.tile-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  transition: all 0.22s ease;
  flex-shrink: 0;
}

.tile-icon svg {
  width: 17px;
  height: 17px;
}

.switch-tile.light.is-on .tile-icon {
  background: rgba(255, 202, 87, 0.34);
  color: #fff4cc;
  box-shadow: 0 0 20px var(--amber-glow), inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.switch-tile.boiler.is-on .tile-icon {
  background: rgba(255, 123, 84, 0.34);
  color: #ffede5;
}

.switch-tile.fan.is-on .tile-icon {
  background: rgba(62, 228, 200, 0.32);
  color: #e6fffb;
}

.switch-tile.fan.is-on .tile-icon svg {
  animation: spinSlow 2.2s linear infinite;
}

.tile-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.switch-tile.light.is-on .tile-led {
  background: #ffe08a;
  box-shadow: 0 0 12px var(--amber);
}

.switch-tile.boiler.is-on .tile-led {
  background: var(--ember);
  box-shadow: 0 0 12px var(--ember);
}

.switch-tile.fan.is-on .tile-led {
  background: var(--teal);
  box-shadow: 0 0 12px var(--teal);
}

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

.tile-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
}

.tile-state {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.switch-tile.is-on .tile-state {
  color: rgba(255, 250, 232, 0.92);
}

/* Inline blind card */
.blind-inline {
  grid-column: 1 / -1;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(86, 204, 242, 0.35);
  background: linear-gradient(155deg, rgba(86, 204, 242, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.blind-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.blind-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--sky-soft);
  color: var(--sky);
  display: grid;
  place-items: center;
}

.blind-icon svg {
  width: 18px;
  height: 18px;
}

.blind-pos-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: #e0f7ff;
  background: rgba(86, 204, 242, 0.24);
  border: 1px solid rgba(125, 211, 252, 0.35);
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.blind-pos-badge.is-open {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.6);
  color: #e0f7ff;
}

.blind-pos-badge.is-partial {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(125, 211, 252, 0.4);
  color: #bae6fd;
}

.blind-pos-badge.is-closed {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-dim);
}

.blind-pos-badge.is-moving {
  background: rgba(255, 194, 71, 0.22);
  border-color: rgba(255, 212, 120, 0.55);
  color: #fff3c4;
}

.blind-visual-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
  position: relative;
}

.blind-visual-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #7dd3fc);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.blind-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.blind-btn-group {
  display: flex;
  gap: 6px;
}

.blind-btn {
  padding: 7px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}

.blind-btn:hover {
  background: rgba(86, 204, 242, 0.26);
  border-color: rgba(125, 211, 252, 0.55);
}

.blind-btn.is-current {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(125, 211, 252, 0.55);
  color: #e0f7ff;
  font-weight: 600;
}

.blind-slider-wrap {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.blind-slider {
  width: 100%;
  accent-color: var(--sky);
  cursor: pointer;
}

.blind-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0 2px;
}

/* Two column layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 20px;
  align-items: start;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 1.12rem;
  font-weight: 700;
}

.section-sub {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.sun-pill {
  padding: 3px 11px;
  border-radius: 999px;
  background: rgba(255, 202, 87, 0.18);
  border: 1px solid rgba(255, 218, 130, 0.42);
  color: #fff2c6;
  font-size: 0.78rem;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.blinds-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.blind-big-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Boiler Hero Card */
.boiler-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.boiler-card.is-on {
  border-color: rgba(255, 160, 128, 0.65);
  box-shadow: 0 14px 44px rgba(255, 123, 84, 0.24), var(--glass-inset);
}

.boiler-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.boiler-power-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.22s ease;
}

.boiler-power-btn svg {
  width: 28px;
  height: 28px;
}

.boiler-card.is-on .boiler-power-btn {
  background: linear-gradient(135deg, #ff7b54, #ea580c);
  border-color: rgba(255, 218, 198, 0.75);
  color: #fff;
  box-shadow: 0 0 32px rgba(255, 123, 84, 0.55);
}

.timer-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.preset-btn {
  padding: 11px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}

.preset-btn:hover {
  background: rgba(255, 123, 84, 0.24);
  border-color: rgba(255, 160, 128, 0.6);
}

.preset-btn.active {
  background: linear-gradient(145deg, rgba(255, 123, 84, 0.38), rgba(234, 88, 12, 0.2));
  border-color: rgba(255, 190, 165, 0.8);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
}

.boiler-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.boiler-countdown-box {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, rgba(255, 123, 84, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 166, 136, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boiler-countdown-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.boiler-countdown-digits {
  font-size: 1.65rem;
  font-weight: 700;
  color: #fff3ed;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.boiler-boost-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.boiler-custom-slider-box {
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boiler-slider-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.boiler-slider-controls input[type="range"] {
  flex: 1;
  accent-color: var(--ember);
  cursor: pointer;
}

.boiler-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.boiler-mini-stat {
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.boiler-mini-stat span {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.boiler-mini-stat strong {
  font-size: 0.96rem;
  font-weight: 700;
  color: #fff;
}

.boiler-week-matrix {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.boiler-day-col {
  padding: 9px 5px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 76px;
}

.boiler-day-col.today {
  border-color: rgba(255, 202, 87, 0.65);
  background: rgba(255, 202, 87, 0.11);
}

.boiler-day-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.boiler-day-chip {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 7px;
  background: rgba(255, 123, 84, 0.28);
  border: 1px solid rgba(255, 165, 135, 0.5);
  color: #ffefe8;
  white-space: nowrap;
}

.boiler-day-empty {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: auto;
  margin-bottom: auto;
}

.boiler-sched-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boiler-sched-item {
  padding: 13px 15px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.boiler-sched-item.enabled {
  border-color: rgba(255, 165, 135, 0.48);
  background: linear-gradient(152deg, rgba(255, 123, 84, 0.15), rgba(255, 255, 255, 0.05));
}

.boiler-dur-bar {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 123, 84, 0.13);
  border: 1px solid rgba(255, 165, 135, 0.38);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.boiler-dur-pill {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffefe8;
}

.boiler-legacy-alert {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 202, 87, 0.14);
  border: 1px solid rgba(255, 202, 87, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

/* Scenarios Grid */
.scenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.scene-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.scene-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.scene-title-wrap {
  display: flex;
  align-items: center;
  gap: 11px;
}

.scene-emoji {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.scene-name {
  font-size: 1rem;
  font-weight: 600;
}

.scene-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.scene-sched-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 11px;
  font-size: 0.78rem;
  background: rgba(182, 155, 255, 0.18);
  border: 1px solid rgba(182, 155, 255, 0.4);
  color: #ede9fe;
}

.scene-sched-badge.off {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
}

.scene-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Settings & Users Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
  align-items: start;
}

.settings-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-card-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.settings-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-badge.amber { background: var(--amber-soft); color: var(--amber); }
.settings-badge.violet { background: var(--violet-soft); color: var(--violet); }
.settings-badge.sky { background: var(--sky-soft); color: var(--sky); }
.settings-badge.green { background: rgba(74, 222, 128, 0.2); color: #86efac; }

.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 12px;
}

.user-item-card {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-item-card.paused {
  opacity: 0.6;
}

.user-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--amber-soft);
  color: var(--amber);
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.perms-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.perm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.install-steps {
  padding-right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.install-steps strong {
  color: #fff;
}

.url-copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.url-copy-box code {
  font-size: 0.82rem;
  color: #fff1bf;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.security-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-row span:first-child {
  color: var(--text-dim);
}

/* Toggle Switch */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  cursor: pointer;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 0.22s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toggle-switch.on {
  background: linear-gradient(135deg, #34d399, #10b981);
  border-color: rgba(167, 243, 208, 0.6);
}

.toggle-switch.on::after {
  transform: translateX(-18px);
}

.empty-box {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.04);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  max-height: 90dvh;
  background: linear-gradient(155deg, rgba(28, 36, 56, 0.88), rgba(14, 18, 30, 0.94));
  border-radius: var(--radius-2xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="time"],
select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 13, 24, 0.65);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-family: inherit;
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
select:focus {
  border-color: rgba(255, 202, 87, 0.72);
  background: rgba(12, 18, 32, 0.82);
  box-shadow: 0 0 0 3px rgba(255, 202, 87, 0.14);
}

.boiler-bottom-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

.boiler-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 18px;
  align-items: start;
}

.blinds-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-subnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow-x: auto;
  scrollbar-width: none;
}

.settings-subnav::-webkit-scrollbar {
  display: none;
}

.settings-subtab {
  flex: 1 1 0;
  min-width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.settings-subtab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.settings-subtab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(129, 140, 248, 0.28));
  border-color: rgba(125, 211, 252, 0.42);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.18);
}

.settings-subpanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-subpanel.hidden {
  display: none;
}

.settings-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  padding: 2px 6px 0;
}

.settings-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

/* Progressive Disclosure Accordions */
.glass-accordion {
  padding: 0;
  overflow: hidden;
}

.glass-accordion summary.accordion-summary {
  list-style: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.glass-accordion summary.accordion-summary::-webkit-details-marker {
  display: none;
}

.glass-accordion summary.accordion-summary > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.glass-accordion summary.accordion-summary strong {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  min-width: 0;
}

.accordion-chevron {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.22s ease, background 0.18s ease;
}

.glass-accordion[open] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.sub-accordion {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 13px;
}

.sub-accordion summary {
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dim);
  user-select: none;
}

.integrations-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.integration-box {
  padding: 18px;
  gap: 12px;
  background: rgba(10, 15, 28, 0.55);
  border-color: rgba(255, 255, 255, 0.14);
}

.setup-guide-box {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(86, 204, 242, 0.08);
  border: 1px solid rgba(86, 204, 242, 0.25);
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.55;
}

.setup-guide-title {
  font-weight: 700;
  color: #e0f7ff;
  margin-bottom: 5px;
}

.setup-guide-steps {
  padding-right: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setup-guide-steps a {
  color: var(--amber);
  text-decoration: underline;
}

.setup-guide-steps code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.shortcut-row {
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.shortcut-row-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shortcut-copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.setup-mini-guide {
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 12px;
}

.setup-mini-guide-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
}

.setup-mini-guide-summary::-webkit-details-marker {
  display: none;
}

.setup-mini-guide[open] > .setup-mini-guide-summary .accordion-chevron {
  transform: rotate(180deg);
}

.hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.schedule-box {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(182, 155, 255, 0.34);
  background: rgba(182, 155, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sched-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

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

.sched-mode-btn {
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

.sched-mode-btn.active {
  background: rgba(182, 155, 255, 0.28);
  border-color: rgba(210, 192, 255, 0.6);
  color: #fff;
}

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

.day-pill {
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.day-pill.active {
  background: var(--amber-soft);
  border-color: rgba(255, 218, 130, 0.6);
  color: #fff4cc;
}

.icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-choice {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.2rem;
  cursor: pointer;
}

.icon-choice.active {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.actions-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-left: 4px;
}

.action-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.action-pick-row.selected {
  border-color: rgba(255, 218, 130, 0.55);
  background: rgba(255, 202, 87, 0.14);
}

.action-pick-left {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}

.action-pick-room {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.action-pick-select {
  width: auto;
  min-width: 108px;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(16, 22, 36, 0.92);
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
}

.form-row > .action-pick-select {
  width: 100%;
}

/* Live Entrance Camera Modal */
.camera-modal-card {
  max-width: 1080px;
}

.camera-viewport {
  position: relative;
  width: 100%;
  min-height: 240px;
  max-height: 76dvh;
  border-radius: 16px;
  overflow: hidden;
  background: #04070e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.camera-viewport.zoomed {
  cursor: grab;
}

.camera-viewport.zoomed.panning {
  cursor: grabbing;
}

.camera-viewport img,
.camera-viewport video {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 76dvh;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  transition: transform 0.08s ease-out;
  pointer-events: none;
}

.camera-viewport.panning img,
.camera-viewport.panning video {
  transition: none;
}

.camera-viewport:fullscreen,
.camera-viewport:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
  border: none;
  background: #000;
}

.camera-viewport:fullscreen img,
.camera-viewport:-webkit-full-screen img,
.camera-viewport:fullscreen video,
.camera-viewport:-webkit-full-screen video {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

.camera-hud-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
  z-index: 4;
}

.cam-hud-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.68);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(241, 245, 249, 0.92);
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.camera-hud-zoom {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: 5;
}

.cam-zoom-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cam-zoom-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.cam-zoom-val {
  font-size: 0.74rem;
  color: #7dd3fc;
  min-width: 34px;
}

.camera-shutter-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.28s ease-out;
}

.camera-shutter-flash.flash {
  opacity: 0.78;
  transition: none;
}

.camera-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
}

/* Clean Redesigned Camera Modal */
.camera-modal-card {
  max-width: 780px;
}

.cam-modal-header {
  padding: 13px 16px !important;
}

.cam-modal-body {
  padding: 12px 14px 14px !important;
  gap: 10px !important;
}

.cam-segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.cam-seg-btn {
  border: none;
  border-radius: 9px;
  padding: 7px 10px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.cam-seg-btn.active {
  background: rgba(59, 130, 246, 0.24);
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.45);
}

.cam-toolbar-single {
  padding: 6px 8px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cam-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cam-tool-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cam-tool-btn:hover,
.cam-tool-btn.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.5);
}

.cam-tool-wide {
  padding: 0 12px;
  font-size: 0.8rem;
}

.cam-quality-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cam-q-btn {
  border: none;
  border-radius: 7px;
  padding: 4px 10px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.cam-q-btn.active {
  background: rgba(59, 130, 246, 0.34);
  color: #ffffff;
}

.cam-nuki-dock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.cam-nuki-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}

.cam-nuki-status.is-open {
  color: #4ade80;
}

html[data-theme="light"] .cam-segmented,
html[data-theme="light"] .cam-toolbar-single,
html[data-theme="light"] .cam-nuki-dock {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.11);
}

html[data-theme="light"] .cam-seg-btn {
  color: #475569;
}

html[data-theme="light"] .cam-seg-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .cam-tool-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

html[data-theme="light"] .cam-quality-seg {
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .cam-q-btn {
  color: #475569;
}

html[data-theme="light"] .cam-q-btn.active {
  background: #ffffff;
  color: #0f172a;
}

html[data-theme="light"] .cam-nuki-status {
  color: #1e293b;
}

html[data-theme="light"] .cam-nuki-status.is-open {
  color: #15803d;
}

@media (max-width: 768px) {
  .camera-viewport,
  .camera-viewport img,
  .camera-viewport video {
    max-height: 56dvh;
  }
  .cam-modal-body {
    padding: 10px 10px 12px !important;
    gap: 8px !important;
  }
  .cam-tool-btn {
    min-width: 32px;
    height: 30px;
    padding: 0 7px;
    font-size: 0.82rem;
  }
  .cam-nuki-dock {
    padding: 8px 9px;
  }
  .cam-nuki-status {
    font-size: 0.76rem;
  }
}

/* Native-style Elastic iOS Pull-to-Refresh Indicator */
.ptr-glow {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(env(safe-area-inset-top) + 150px);
  pointer-events: none;
  z-index: 940;
  opacity: 0;
  background: radial-gradient(
    ellipse 78% 72% at 50% 0%,
    rgba(59, 130, 246, 0.34) 0%,
    rgba(99, 102, 241, 0.16) 46%,
    transparent 82%
  );
  transform-origin: center top;
  will-change: opacity, transform;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.ptr-glow.is-dragging {
  transition: none;
}

html[data-theme="light"] .ptr-glow {
  background: radial-gradient(
    ellipse 78% 72% at 50% 0%,
    rgba(37, 99, 235, 0.22) 0%,
    rgba(99, 102, 241, 0.1) 48%,
    transparent 82%
  );
}

.ptr-indicator {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  transform: translate3d(-50%, -68px, 0) scale(0.82);
  opacity: 0;
  pointer-events: none;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(26px) saturate(190%);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #f1f5f9;
  font-size: 0.83rem;
  font-weight: 600;
  will-change: transform, opacity;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.45, 0.64, 1),
    opacity 0.24s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.ptr-indicator.is-dragging {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

.ptr-indicator.is-ready {
  border-color: rgba(96, 165, 250, 0.78);
  box-shadow:
    0 12px 34px rgba(37, 99, 235, 0.36),
    0 0 0 3px rgba(59, 130, 246, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #dbeafe;
}

.ptr-indicator.is-refreshing {
  transform: translate3d(-50%, 10px, 0) scale(1) !important;
  opacity: 1 !important;
  border-color: rgba(96, 165, 250, 0.8);
  box-shadow:
    0 12px 34px rgba(37, 99, 235, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ptr-spinner {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
}

.ptr-spinner svg {
  width: 20px;
  height: 20px;
  display: block;
  transform: rotate(-90deg);
}

.ptr-ring-track {
  opacity: 0.2;
}

.ptr-ring-arc {
  stroke-dasharray: 56.55;
  stroke-dashoffset: 56.55;
  transition: stroke-dashoffset 0.1s linear;
}

.ptr-indicator.is-ready .ptr-spinner {
  color: #93c5fd;
}

.ptr-indicator.is-refreshing .ptr-spinner svg {
  animation: ptrSpin 0.8s linear infinite;
}

.ptr-indicator.is-refreshing .ptr-ring-arc {
  stroke-dashoffset: 16 !important;
  animation: ptrArcPulse 1.2s ease-in-out infinite;
}

@keyframes ptrSpin {
  from { transform: rotate(-90deg); }
  to { transform: rotate(270deg); }
}

@keyframes ptrArcPulse {
  0%, 100% { stroke-dashoffset: 40; }
  50% { stroke-dashoffset: 14; }
}

html[data-theme="light"] .ptr-indicator {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow:
    0 12px 28px rgba(15, 23, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #0f172a;
}

html[data-theme="light"] .ptr-indicator.is-ready {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow:
    0 12px 30px rgba(37, 99, 235, 0.2),
    0 0 0 3px rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

html[data-theme="light"] .ptr-spinner {
  color: #2563eb;
}

.cam-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fb7185;
  margin-inline-end: 4px;
  animation: camPulse 1.4s ease-in-out infinite;
}

.cam-live-badge.paused {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.cam-live-badge.paused .cam-live-dot {
  background: #fbbf24;
  animation: none;
}

.btn-away-glass {
  padding: 8px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
}

.btn-away-glass:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-away-glass.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(244, 63, 94, 0.28));
  border-color: rgba(251, 191, 36, 0.72);
  color: #fef3c7;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.28);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.brand-logo,
.auth-logo,
.splash-emblem {
  padding: 0 !important;
  overflow: hidden;
}

/* Philips Hue Light Card inside Rooms */
.hue-room-card {
  grid-column: 1 / -1;
  padding: 12px 13px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hue-room-card.on {
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
}

.hue-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hue-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.hue-color-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(148, 163, 184, 0.25);
  transition: all 0.2s ease;
}

.hue-controls-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hue-bri-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hue-bri-slider {
  flex: 1;
  accent-color: #fbbf24;
  cursor: pointer;
}

.hue-swatches {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.hue-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.42);
  cursor: pointer;
  padding: 0;
  transition: transform 0.14s ease;
}

.hue-swatch:hover {
  transform: scale(1.14);
}

.hue-color-picker {
  width: 28px;
  height: 24px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.app-version-footer {
  text-align: center;
  padding: 10px 0 4px;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.55);
  user-select: none;
}

/* ==========================================================================
   Apple iOS 26 Liquid Glass Design System (Full HIG Compliance)
   1. Strict Hierarchy: Floating Liquid Glass Chrome vs. Clean Content Platters (No Glass-on-Glass)
   2. Scroll-Under Optical Refraction: Sticky floating Top Bar & Bottom Capsule over scrolling content
   3. Dynamic Specular Rim Tracking (--mx / --my pointer angle reflection)
   4. Untinted Glass by Default; Semantic Tint Only for Active / Lit / Primary Actions
   ========================================================================== */

/* 1. Content Platters (Rooms, Stats, Accordions) — quiet, legible, non-competing layer */
.room-card,
.stat-card,
.settings-card,
.glass-accordion {
  background: rgba(13, 19, 34, 0.56);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.14),
    0 12px 32px -12px rgba(0, 0, 0, 0.45);
}

/* 2. Floating Liquid Glass Chrome Layer (Top Bar, Capsule Navs, Modals) */
.top-bar {
  position: sticky;
  top: calc(8px + env(safe-area-inset-top));
  z-index: 95;
  border-radius: 26px;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.06) 48%,
    rgba(255, 255, 255, 0.11) 100%
  );
  backdrop-filter: blur(42px) saturate(215%) brightness(1.08);
  -webkit-backdrop-filter: blur(42px) saturate(215%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.58),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.16),
    0 20px 44px -12px rgba(2, 6, 20, 0.62);
}

.modal-card {
  background: linear-gradient(
    160deg,
    rgba(24, 34, 58, 0.74) 0%,
    rgba(13, 20, 36, 0.78) 100%
  );
  backdrop-filter: blur(48px) saturate(215%) brightness(1.08);
  -webkit-backdrop-filter: blur(48px) saturate(215%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.16),
    0 28px 68px -12px rgba(0, 0, 0, 0.75);
}

/* 3. Concentric Floating Capsule Navigation Bars + Scrubbable Liquid Glass Lens */
.main-nav {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  width: fit-content;
  max-width: calc(100vw - 32px);
  border-radius: 999px;
  padding: 6px;
  background: linear-gradient(
    160deg,
    rgba(20, 30, 52, 0.82) 0%,
    rgba(11, 17, 32, 0.86) 55%,
    rgba(18, 28, 48, 0.82) 100%
  );
  backdrop-filter: blur(42px) saturate(215%) brightness(1.06);
  -webkit-backdrop-filter: blur(42px) saturate(215%) brightness(1.06);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.56),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.16),
    0 22px 52px -8px rgba(0, 0, 0, 0.72);
  user-select: none;
  -webkit-user-select: none;
}

.mobile-bottom-nav {
  border-radius: 999px;
  padding: 6px 6px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.16) 0%,
    rgba(255, 255, 255, 0.06) 55%,
    rgba(255, 255, 255, 0.12) 100%
  );
  backdrop-filter: blur(44px) saturate(220%) brightness(1.08);
  -webkit-backdrop-filter: blur(44px) saturate(220%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.18),
    0 22px 50px -8px rgba(0, 0, 0, 0.72);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.nav-glass-lens {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 64px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  transform-origin: center center;
  background: linear-gradient(
    155deg,
    rgba(255, 255, 255, 0.30) 0%,
    rgba(255, 255, 255, 0.11) 55%,
    rgba(255, 255, 255, 0.22) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow:
    inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 1px 0 rgba(255, 255, 255, 0.26),
    0 8px 22px -4px rgba(0, 0, 0, 0.42);
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.18s ease,
    box-shadow 0.18s ease;
  will-change: transform, width;
}

.nav-glass-lens.is-scrubbing {
  transition: none !important;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.16) 68%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.42), rgba(125, 211, 252, 0.24));
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 2px 2px 0 rgba(255, 255, 255, 0.98),
    inset 0 -1.5px 2px 0 rgba(125, 211, 252, 0.5),
    0 12px 30px -2px rgba(56, 189, 248, 0.36),
    0 6px 18px rgba(0, 0, 0, 0.45);
}

.nav-tab,
.m-nav-item {
  position: relative;
  z-index: 1;
  border-radius: 999px;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.18s ease;
}

.nav-tab.active,
.m-nav-item.active {
  color: var(--text);
  transform: scale(1.05);
}

/* Mobile Top Bar Compact Layout (Prevent Overflow) */
@media (max-width: 768px) {
  .top-bar {
    padding: 9px 11px !important;
    gap: 8px !important;
  }
  .stats-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-bottom: 10px !important;
  }
  .stat-card {
    padding: 8px 6px !important;
    gap: 4px !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-radius: 16px !important;
  }
  .stat-icon {
    width: 26px !important;
    height: 26px !important;
    border-radius: 9px !important;
  }
  .stat-icon svg {
    width: 14px !important;
    height: 14px !important;
  }
  .stat-label {
    font-size: 0.66rem !important;
  }
  .stat-val {
    font-size: 0.78rem !important;
  }
  .brand-group {
    gap: 8px !important;
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
  }
  .connection-row {
    flex-wrap: wrap !important;
    row-gap: 4px !important;
    column-gap: 6px !important;
    font-size: 0.75rem !important;
    overflow: visible !important;
  }
  .meta-pill {
    padding: 2px 7px !important;
    font-size: 0.7rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .user-meta-pill {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1 !important;
  }
  .brand-group h1 {
    font-size: 0.98rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-bar {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand icons"
      "pills pills" !important;
    padding: 10px 12px !important;
    gap: 8px 8px !important;
  }
  .header-icon-group {
    gap: 6px !important;
    padding-inline-start: 0 !important;
    border-inline-start: none !important;
    flex-shrink: 0;
  }
  .header-icon-group .btn-icon-glass {
    width: 36px !important;
    height: 36px !important;
  }
  .header-quick-pills {
    width: 100%;
    gap: 6px !important;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: stretch;
  }
  html[data-theme="light"] .header-quick-pills {
    border-top-color: rgba(15, 23, 42, 0.09);
  }
  .header-quick-pills > .btn,
  .header-quick-pills > .split-action {
    flex: 1 1 0;
    min-width: 0;
  }
  .header-quick-pills > .split-action .btn {
    width: 100%;
  }
  .header-quick-pills .btn {
    padding: 8px 8px !important;
    font-size: 0.78rem !important;
    gap: 5px !important;
    border-radius: 12px !important;
  }
  .header-quick-pills .btn .icon {
    width: 14px;
    height: 14px;
  }
  .header-actions {
    gap: 5px !important;
    flex-shrink: 0;
  }
  .header-actions .btn-icon-glass {
    width: 34px !important;
    height: 34px !important;
  }
}

/* ==========================================================================
   Apple iOS 26 Liquid Glass DAY MODE — High-Contrast Daylight Palette
   ========================================================================== */
html[data-theme="light"] {
  --bg: #dde5f0;
  --text: #0f172a;
  --text-dim: #334155;
  --text-muted: #64748b;
  --glass-border: rgba(15, 23, 42, 0.12);
  --glass-border-strong: rgba(15, 23, 42, 0.22);
}

html[data-theme="light"] .ambient-bg {
  background:
    radial-gradient(ellipse 80% 60% at 85% 5%, rgba(56, 189, 248, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 75% 55% at 12% 92%, rgba(251, 191, 36, 0.16) 0%, transparent 62%),
    linear-gradient(180deg, #e8eef7 0%, #d8e2f0 100%);
}

html[data-theme="light"] .orb {
  opacity: 0.18;
}

html[data-theme="light"] .glass-panel,
html[data-theme="light"] .room-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .scene-card,
html[data-theme="light"] .blind-card,
html[data-theme="light"] .boiler-card,
html[data-theme="light"] .boiler-hero-card,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .glass-accordion,
html[data-theme="light"] .user-item-card {
  background: rgba(255, 255, 255, 0.90);
  border: 1px solid rgba(15, 23, 42, 0.11);
  box-shadow:
    inset 0 1px 0 0 #ffffff,
    0 8px 24px -8px rgba(15, 23, 42, 0.08),
    0 1px 3px rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

/* Light Mode — Boiler, Primary Buttons & High-Contrast Surfaces */
html[data-theme="light"] .btn-primary {
  background: linear-gradient(145deg, #3b82f6, #2563eb);
  color: #ffffff;
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 5px 14px rgba(37, 99, 235, 0.22);
}

html[data-theme="light"] .btn-primary:hover {
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
}

html[data-theme="light"] .boiler-card.is-on {
  background: linear-gradient(155deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fb923c;
  box-shadow: 0 10px 28px -8px rgba(234, 88, 12, 0.22);
}

html[data-theme="light"] .boiler-power-btn {
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.16);
  color: #334155;
}

html[data-theme="light"] .boiler-card.is-on .boiler-power-btn {
  background: linear-gradient(135deg, #f97316, #ea580c);
  border-color: #fdba74;
  color: #ffffff;
}

html[data-theme="light"] .preset-btn {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

html[data-theme="light"] .preset-btn:hover {
  background: #ffedd5;
  border-color: #fb923c;
  color: #9a3412;
}

html[data-theme="light"] .preset-btn.active {
  background: linear-gradient(145deg, #ffedd5, #fed7aa);
  border-color: #f97316;
  color: #9a3412;
  font-weight: 700;
}

html[data-theme="light"] .boiler-countdown-box {
  background: #fff7ed;
  border-color: #fdba74;
}

html[data-theme="light"] .boiler-countdown-digits {
  color: #c2410c;
}

html[data-theme="light"] .boiler-custom-slider-box,
html[data-theme="light"] .boiler-mini-stat,
html[data-theme="light"] .boiler-day-col,
html[data-theme="light"] .boiler-sched-item,
html[data-theme="light"] .info-row,
html[data-theme="light"] .url-copy-box {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

html[data-theme="light"] .boiler-mini-stat strong {
  color: #0f172a;
}

html[data-theme="light"] .boiler-day-col.today {
  background: #fef9c3;
  border-color: #eab308;
}

html[data-theme="light"] .boiler-day-chip {
  background: #ffedd5;
  border-color: #fdba74;
  color: #9a3412;
}

html[data-theme="light"] .boiler-sched-item.enabled {
  background: #fff7ed;
  border-color: #fb923c;
}

html[data-theme="light"] .boiler-dur-bar {
  background: #ffedd5;
  border-color: #fdba74;
}

html[data-theme="light"] .boiler-dur-pill {
  color: #9a3412;
}

html[data-theme="light"] .boiler-legacy-alert {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #78350f;
}

html[data-theme="light"] .blind-btn {
  background: #f1f5f9;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .top-bar,
html[data-theme="light"] .main-nav,
html[data-theme="light"] .mobile-bottom-nav {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow:
    inset 0 1.5px 0 0 #ffffff,
    0 18px 42px -8px rgba(15, 23, 42, 0.20),
    0 3px 10px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .nav-glass-lens {
  background: linear-gradient(
    155deg,
    rgba(15, 23, 42, 0.11) 0%,
    rgba(15, 23, 42, 0.06) 100%
  );
  border: 1px solid rgba(15, 23, 42, 0.18);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.8),
    0 4px 12px -2px rgba(15, 23, 42, 0.10);
}

html[data-theme="light"] .nav-glass-lens.is-scrubbing {
  background:
    radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.9), rgba(14, 165, 233, 0.22) 75%);
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow:
    inset 0 1.5px 1px 0 #ffffff,
    0 10px 24px -2px rgba(14, 165, 233, 0.25);
}

html[data-theme="light"] .m-nav-item,
html[data-theme="light"] .nav-tab {
  color: #475569;
}

html[data-theme="light"] .m-nav-item.active,
html[data-theme="light"] .nav-tab.active {
  color: #0f172a;
  font-weight: 700;
}

html[data-theme="light"] .device-tile {
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.11);
  box-shadow:
    inset 0 1px 0 0 #ffffff,
    0 2px 6px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .device-tile .tile-name {
  color: #0f172a;
  font-weight: 600;
}

html[data-theme="light"] .device-tile .tile-state {
  color: #475569;
}

html[data-theme="light"] .device-tile .tile-icon {
  background: #e2e8f0;
  color: #334155;
  border-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .device-tile .tile-led {
  background: #cbd5e1;
}

html[data-theme="light"] .device-tile.on {
  background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%);
  border: 1.5px solid #f59e0b;
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.85),
    0 8px 20px -6px rgba(245, 158, 11, 0.28);
}

html[data-theme="light"] .device-tile.on .tile-name {
  color: #78350f;
  font-weight: 700;
}

html[data-theme="light"] .device-tile.on .tile-state {
  color: #92400e;
  font-weight: 600;
}

html[data-theme="light"] .device-tile.on .tile-icon {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.35);
}

html[data-theme="light"] .device-tile.on .tile-led {
  background: #d97706;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
}

html[data-theme="light"] .hue-room-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .filter-chip {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.13);
  color: #334155;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .filter-chip.active {
  background: #0f172a;
  color: #ffffff;
  font-weight: 600;
  border-color: #0f172a;
  box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.28);
}

html[data-theme="light"] .fav-scene-pill {
  background: linear-gradient(145deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  color: #78350f;
}

html[data-theme="light"] .room-count,
html[data-theme="light"] .meta-pill,
html[data-theme="light"] .activity-actor {
  background: #e2e8f0;
  color: #1e293b;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .btn-ghost,
html[data-theme="light"] .btn-icon-glass,
html[data-theme="light"] .mini-pill-btn,
html[data-theme="light"] .scene-act-btn,
html[data-theme="light"] .fav-star-btn,
html[data-theme="light"] .order-btn {
  background: #f1f5f9;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.15);
}

html[data-theme="light"] .btn-danger-glass {
  background: #fee2e2;
  color: #991b1b;
  border-color: #f87171;
}

html[data-theme="light"] .btn-away-glass {
  background: #f1f5f9;
  color: #334155;
  border-color: rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .btn-away-glass.active {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

html[data-theme="light"] .toggle-switch {
  background: #cbd5e1;
  border-color: rgba(15, 23, 42, 0.15);
}

html[data-theme="light"] .toggle-switch.on {
  background: #f59e0b;
}

html[data-theme="light"] .modal-card {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

html[data-theme="light"] .activity-row,
html[data-theme="light"] .keypad-card,
html[data-theme="light"] .keypad-key-row,
html[data-theme="light"] .rename-dev-row,
html[data-theme="light"] .action-pick-row,
html[data-theme="light"] .schedule-box,
html[data-theme="light"] .setup-guide-box {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

html[data-theme="light"] .setup-guide-title {
  color: #0f172a;
}

html[data-theme="light"] .setup-guide-steps strong,
html[data-theme="light"] .install-steps strong {
  color: #0f172a;
}

html[data-theme="light"] .setup-guide-steps code {
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .setup-guide-steps a {
  color: #1d4ed8;
}

html[data-theme="light"] .url-copy-box code {
  color: #1e293b;
}

html[data-theme="light"] .integration-box {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .shortcut-row {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .shortcut-row-title {
  color: #0f172a;
}

html[data-theme="light"] .setup-mini-guide {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .setup-mini-guide-summary {
  color: #1e293b;
}

html[data-theme="light"] .settings-subnav {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .settings-subtab {
  color: #475569;
}

html[data-theme="light"] .settings-subtab:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .settings-subtab.active {
  color: #0f172a;
  background: #ffffff;
  border-color: rgba(14, 165, 233, 0.34);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .settings-group-label {
  color: #475569;
}

/* Guest Pass Modal & Cards */
.gp-modal-card {
  max-width: 560px;
  width: 94vw;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
}

.gp-modal-body {
  overflow-y: auto;
  padding-bottom: 18px;
}

.gp-doors-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gp-door-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  user-select: none;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.gp-door-chip input {
  accent-color: #38bdf8;
  width: 15px;
  height: 15px;
}

.gp-door-chip:has(input:checked) {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
}

.gp-pill-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gp-pill-btn {
  padding: 7px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.gp-pill-btn.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(129, 140, 248, 0.28));
  border-color: rgba(125, 211, 252, 0.48);
  color: #fff;
}

.gp-created-box {
  padding: 13px 14px;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.13);
  border: 1px solid rgba(52, 211, 153, 0.36);
  margin-bottom: 14px;
}

.gp-edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.36);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 12px;
}

html[data-theme="light"] .gp-edit-banner {
  background: #e0f2fe;
  border-color: rgba(2, 132, 199, 0.32);
  color: #0369a1;
}

.gp-created-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.gp-passes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gp-pass-card {
  padding: 12px 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gp-pass-card.inactive {
  opacity: 0.65;
}

.gp-pass-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.gp-pass-name {
  font-weight: 700;
  font-size: 0.94rem;
}

.gp-status-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.gp-status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.gp-status-badge.paused {
  background: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

.gp-status-badge.expired,
.gp-status-badge.exhausted,
.gp-status-badge.revoked {
  background: rgba(148, 163, 184, 0.16);
  color: var(--text-dim);
}

.gp-doors-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gp-door-tag {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text);
}

.gp-pass-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.gp-pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.door-quick-btn.guest-pass-btn {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.2));
  border-color: rgba(52, 211, 153, 0.42);
}

html[data-theme="light"] .gp-door-chip {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

html[data-theme="light"] .gp-door-chip:has(input:checked) {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.45);
}

html[data-theme="light"] .gp-pill-btn {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
  color: #475569;
}

html[data-theme="light"] .gp-pill-btn.active {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

html[data-theme="light"] .gp-created-box {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.4);
  color: #065f46;
}

html[data-theme="light"] .gp-pass-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .gp-status-badge.active {
  background: #d1fae5;
  color: #047857;
}

html[data-theme="light"] .gp-status-badge.paused {
  background: #fef3c7;
  color: #92400e;
}

html[data-theme="light"] .gp-door-tag {
  background: #e0f2fe;
  border-color: rgba(2, 132, 199, 0.25);
  color: #0369a1;
}

html[data-theme="light"] .door-quick-btn.guest-pass-btn {
  background: linear-gradient(135deg, #d1fae5, #e0f2fe);
  border-color: rgba(5, 150, 105, 0.38);
  color: #065f46;
}

/* Home Quick Global Search */
.home-search-wrap {
  position: relative;
  margin-bottom: 10px;
}

.home-search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(15, 23, 42, 0.48);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-search-wrap input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.52);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.home-search-clear {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}

.home-search-results {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.28);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.hs-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hs-row-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.hs-row-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.hs-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* System Health & Batteries Strip */
.health-summary-card {
  padding: 13px 15px;
}

.health-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.health-pill.ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.34);
  color: #6ee7b7;
}

.health-pill.warn {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde68a;
}

.health-pill.bad {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(251, 113, 133, 0.42);
  color: #fda4af;
}

/* Active Sessions List */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.session-item.current {
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(16, 185, 129, 0.09);
}

.session-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.session-title {
  font-size: 0.84rem;
  font-weight: 600;
}

.session-meta {
  font-size: 0.74rem;
  color: var(--text-dim);
}

/* Away Mode Presence Simulation Box */
.away-sim-box {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}

.away-sim-times {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}

.away-sim-times input[type="time"] {
  margin-inline-start: 6px;
  padding: 5px 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.5);
  color: var(--text);
  font-family: inherit;
}

.away-sim-devices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 128px;
  overflow-y: auto;
}

.sim-light-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 10px;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.sim-light-chip:has(input:checked) {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
}

/* Light Theme Overrides for v104 additions */
html[data-theme="light"] .home-search-wrap input {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.13);
  color: #0f172a;
}

html[data-theme="light"] .home-search-clear {
  background: rgba(15, 23, 42, 0.08);
  color: #334155;
}

html[data-theme="light"] .home-search-results {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(14, 165, 233, 0.3);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .hs-row,
html[data-theme="light"] .session-item,
html[data-theme="light"] .away-sim-box,
html[data-theme="light"] .sim-light-chip {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.11);
  color: #0f172a;
}

html[data-theme="light"] .session-item.current {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.35);
}

html[data-theme="light"] .health-pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

html[data-theme="light"] .health-pill.ok {
  background: #d1fae5;
  border-color: rgba(5, 150, 105, 0.3);
  color: #065f46;
}

html[data-theme="light"] .health-pill.warn {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.35);
  color: #92400e;
}

html[data-theme="light"] .health-pill.bad {
  background: #ffe4e6;
  border-color: rgba(225, 29, 72, 0.35);
  color: #9f1239;
}

html[data-theme="light"] .away-sim-times input[type="time"] {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
}

/* Interactive Undo Toast for All-Off */
.toast.undo-toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  pointer-events: auto;
  border-color: rgba(56, 189, 248, 0.45);
}

.toast-undo-btn {
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.24);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.toast-undo-btn:hover {
  background: rgba(56, 189, 248, 0.38);
}

html[data-theme="light"] .toast-undo-btn {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
}

.auth-locked-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

html[data-theme="light"] .auth-locked-pill {
  background: #d1fae5;
  border-color: rgba(5, 150, 105, 0.36);
  color: #065f46;
}

html[data-theme="light"] .scene-sched-badge {
  background: #ede9fe;
  border-color: rgba(109, 40, 217, 0.32);
  color: #4c1d95;
  font-weight: 600;
}

html[data-theme="light"] .scene-sched-badge.off {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.14);
  color: #475569;
}

html[data-theme="light"] .sun-pill {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.36);
  color: #92400e;
}

html[data-theme="light"] .scene-card-footer {
  border-top-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .scene-act-btn:hover {
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.24);
  color: #0f172a;
}

html[data-theme="light"] .scene-act-btn.danger:hover {
  background: #ffe4e6;
  border-color: rgba(225, 29, 72, 0.38);
  color: #be123c;
}

html[data-theme="light"] .settings-badge.amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

html[data-theme="light"] .settings-badge.sky {
  background: #e0f2fe;
  color: #075985;
  border-color: #38bdf8;
}

html[data-theme="light"] .settings-badge.violet {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #a78bfa;
}

html[data-theme="light"] .settings-badge.green {
  background: #dcfce7;
  color: #166534;
  border-color: #4ade80;
}

html[data-theme="light"] input,
html[data-theme="light"] select {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="light"] .tile-name,
html[data-theme="light"] .room-title,
html[data-theme="light"] .scene-name,
html[data-theme="light"] .stat-val,
html[data-theme="light"] .activity-summary,
html[data-theme="light"] .keypad-key-name {
  color: #0f172a;
}

html[data-theme="light"] .app-version-footer {
  color: #64748b;
}

/* 4. Dynamic Pointer-Tracked Specular Glint + Semantic Tint Only When Lit */
.device-tile {
  background:
    radial-gradient(
      140px circle at var(--mx, 25%) var(--my, 20%),
      rgba(255, 255, 255, 0.14),
      transparent 70%
    ),
    rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.26),
    0 6px 16px -8px rgba(2, 6, 18, 0.35);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.device-tile:hover {
  transform: translateY(-2px) scale(1.012);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.48),
    0 12px 26px -8px rgba(2, 6, 18, 0.48);
}

.device-tile:active {
  transform: scale(0.97);
}

.device-tile.on {
  background:
    radial-gradient(
      160px circle at var(--mx, 22%) var(--my, 18%),
      rgba(255, 251, 235, 0.34),
      transparent 68%
    ),
    linear-gradient(145deg, rgba(253, 224, 71, 0.24) 0%, rgba(245, 158, 11, 0.12) 55%, rgba(255, 255, 255, 0.05) 100%);
  border-color: rgba(253, 224, 71, 0.55);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 251, 235, 0.72),
    inset 0 -1px 0 0 rgba(251, 191, 36, 0.24),
    0 12px 32px -8px rgba(245, 158, 11, 0.30);
}

/* Untinted Clear Glass Filter Capsules (Tinted Only When Active) */
.filter-chip {
  background: rgba(255, 255, 255, 0.075);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.08),
    0 6px 16px -6px rgba(0, 0, 0, 0.34);
  transition:
    transform 0.26s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.filter-chip.active {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.32) 0%,
    rgba(255, 255, 255, 0.14) 100%
  );
  color: #fff;
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.78),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.22),
    0 10px 24px -6px rgba(0, 0, 0, 0.42);
}

.btn {
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.44),
    inset 0 -1px 0 0 rgba(255, 255, 255, 0.10),
    0 8px 20px -6px rgba(2, 6, 20, 0.42);
  transition:
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.btn:active {
  transform: scale(0.965);
}

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

.mini-pill-btn.active {
  background: rgba(56, 189, 248, 0.24);
  border-color: rgba(125, 211, 252, 0.65);
  color: #e0f2fe;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  background: rgba(6, 9, 17, 0.72);
  pointer-events: none;
}

.cam-live-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.24);
  border: 1px solid rgba(251, 113, 133, 0.55);
  color: #fecdd3;
  letter-spacing: 0.04em;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 94px;
  left: 22px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}

.toast {
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(18, 26, 44, 0.9);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 0.88rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  animation: slideUp 0.22s ease;
}

.toast.ok {
  border-color: rgba(74, 222, 128, 0.55);
}

.toast.err {
  border-color: rgba(251, 113, 133, 0.65);
  color: #ffe4e6;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1024px) {
  .boiler-layout-grid,
  .boiler-bottom-grid,
  .integrations-two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .boiler-week-matrix {
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  }
  .boiler-stats-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .boiler-mini-stat {
    padding: 9px 8px;
  }
  .boiler-mini-stat strong {
    font-size: 0.82rem;
  }
  .main-nav {
    display: none;
  }
  .mobile-bottom-nav {
    display: grid;
  }
  .app-shell {
    padding: calc(10px + env(safe-area-inset-top)) 11px calc(98px + env(safe-area-inset-bottom));
    gap: 12px;
  }
  .toast-container {
    bottom: calc(84px + env(safe-area-inset-bottom));
    left: 12px;
    right: 12px;
    max-width: none;
  }
  .rooms-toolbar {
    gap: 8px;
    margin-bottom: 12px;
  }
  .rename-rooms-grid {
    grid-template-columns: 1fr;
  }
  .rename-dev-row {
    grid-template-columns: 1fr 116px;
  }
  .rooms-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .rooms-col {
    gap: 10px;
  }
  .room-card {
    padding: 13px;
    gap: 10px;
  }
  .settings-grid,
  .scenes-grid,
  .blinds-two-col,
  .perms-check-grid,
  .settings-actions-grid {
    grid-template-columns: 1fr;
  }
  .settings-stack {
    gap: 10px;
  }
  .settings-subnav {
    gap: 4px;
    padding: 4px;
    border-radius: 15px;
  }
  .settings-subtab {
    padding: 8px 6px;
    font-size: 0.78rem;
    gap: 3px;
    border-radius: 11px;
  }
  .settings-subpanel {
    gap: 10px;
  }
  .settings-card {
    padding: 15px 14px;
  }
  .glass-accordion summary.accordion-summary {
    padding: 13px 14px;
    gap: 10px;
  }
  .glass-accordion summary.accordion-summary > div {
    gap: 8px;
  }
  .glass-accordion summary.accordion-summary strong {
    font-size: 0.86rem;
  }
  .accordion-content {
    padding: 12px 13px 15px;
  }
  .url-copy-box {
    flex-wrap: wrap;
    gap: 8px;
  }
  .url-copy-box code {
    min-width: 0;
    flex: 1 1 180px;
    word-break: break-all;
  }
  .activity-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  .top-bar {
    padding: 11px 14px;
  }
  .brand-group h1 {
    font-size: 1.08rem;
  }
  .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }
  .stat-card {
    padding: 10px 11px;
    gap: 9px;
  }
  .stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }
  .stat-val {
    font-size: 0.92rem;
  }
}

/* Admin Doors & Access Quickbar (visually distinct from Favorite Scenes) */
.doors-quickbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(12, 20, 38, 0.62);
  border: 1px solid rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  max-width: 100%;
  box-sizing: border-box;
}
.doors-quickbar-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.95);
  margin-inline-end: 2px;
  white-space: nowrap;
}
.door-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.36);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease;
}
.door-quick-btn:hover {
  background: rgba(14, 165, 233, 0.25);
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-1px);
}
.door-quick-btn:active {
  transform: scale(0.97);
}
.door-quick-btn.home-lock {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 194, 73, 0.45);
}
.door-quick-btn.home-lock:hover {
  background: rgba(245, 158, 11, 0.26);
  border-color: rgba(245, 194, 73, 0.7);
}
.door-faceid-tag {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.85;
}
html[data-theme="light"] .doors-quickbar {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
html[data-theme="light"] .doors-quickbar-label {
  color: #475569;
}
html[data-theme="light"] .door-quick-btn {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.11);
  border-color: rgba(14, 165, 233, 0.32);
}
html[data-theme="light"] .door-quick-btn.home-lock {
  color: #92400e;
  background: rgba(245, 158, 11, 0.13);
  border-color: rgba(217, 119, 6, 0.35);
}
html[data-theme="light"] .door-faceid-tag {
  background: rgba(15, 23, 42, 0.08);
  color: #78350f;
}

/* Mobile Single-Row & Anti-Awkward-Wrap Responsive Polish */
@media (max-width: 768px) {
  .doors-quickbar,
  .fav-scenes-bar,
  .filter-bar,
  .boiler-boost-row {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
  }
  .doors-quickbar::-webkit-scrollbar,
  .fav-scenes-bar::-webkit-scrollbar,
  .filter-bar::-webkit-scrollbar,
  .boiler-boost-row::-webkit-scrollbar {
    display: none;
  }
  .doors-quickbar {
    padding: 7px 10px;
  }
  .door-quick-btn,
  .fav-scene-pill,
  .filter-chip,
  .mini-pill-btn,
  .settings-badge,
  .btn,
  .btn-sm {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .door-quick-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .btn-sm {
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .mini-pill-btn {
    padding: 5px 9px;
    font-size: 0.75rem;
  }
  .settings-badge {
    padding: 2px 7px;
    font-size: 0.68rem;
  }
  .glass-accordion summary.accordion-summary {
    padding: 12px 12px;
    gap: 8px;
  }
  .glass-accordion summary.accordion-summary > div {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    flex: 1;
  }
  .glass-accordion summary.accordion-summary strong {
    font-size: 0.84rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .setting-row-between {
    gap: 8px;
  }
  .inline-actions {
    gap: 6px;
  }
  .boiler-card {
    padding: 16px 14px;
    gap: 14px;
  }
  .timer-presets {
    gap: 6px;
  }
  .preset-btn {
    padding: 9px 4px;
    font-size: 0.77rem;
    white-space: nowrap;
  }
  .boiler-countdown-digits {
    font-size: 1.38rem;
  }
  .camera-controls-bar {
    gap: 6px;
  }
  .room-header {
    gap: 8px;
  }
  .room-title {
    font-size: 0.96rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tile-name {
    font-size: 0.84rem;
    line-height: 1.25;
  }
  .tile-state {
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

/* ==========================================================================
   Notification Center Bell, Modal & App Update Banner
   ========================================================================== */
.btn-notif-bell {
  position: relative;
  overflow: visible !important;
}

.notif-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.55), 0 0 0 2px rgba(10, 15, 30, 0.85);
  pointer-events: none;
  z-index: 2;
}

.btn-notif-bell.has-unread {
  border-color: rgba(96, 165, 250, 0.5);
  color: #e0f2fe;
}

.btn-notif-bell.bell-ring svg {
  animation: notifBellRing 0.75s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  transform-origin: 50% 15%;
}

@keyframes notifBellRing {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(16deg); }
  30% { transform: rotate(-14deg); }
  45% { transform: rotate(11deg); }
  60% { transform: rotate(-8deg); }
  75% { transform: rotate(5deg); }
}

/* App Update Available Banner */
.app-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 15px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(99, 102, 241, 0.18), rgba(15, 23, 42, 0.86));
  border: 1px solid rgba(96, 165, 250, 0.48);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: updateBannerSlide 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes updateBannerSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.app-update-info {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.app-update-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.25);
  border: 1px solid rgba(147, 197, 253, 0.4);
  display: grid;
  place-items: center;
  font-size: 1.02rem;
  flex-shrink: 0;
}

.app-update-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.app-update-text strong {
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-update-text span {
  font-size: 0.78rem;
  color: rgba(219, 234, 254, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-update-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.btn-update-dismiss {
  width: 32px !important;
  height: 32px !important;
  font-size: 0.8rem;
}

/* Notifications Center Modal */
.notif-modal-card {
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.notif-modal-header {
  gap: 10px;
}

.notif-modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  padding-top: 12px;
  padding-bottom: 12px;
}

.notif-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.notif-filter-bar::-webkit-scrollbar {
  display: none;
}

.notif-filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.18s ease;
}

.notif-filter-pill.active {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.38), rgba(37, 99, 235, 0.24));
  border-color: rgba(96, 165, 250, 0.65);
  color: #eff6ff;
}

.notif-update-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(99, 102, 241, 0.16));
  border: 1px solid rgba(96, 165, 250, 0.45);
}

.notif-update-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 50vh;
  padding-inline-end: 2px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.notif-item.is-clickable {
  cursor: pointer;
}

.notif-item.is-clickable:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(96, 165, 250, 0.35);
}

.notif-item.is-unread {
  background: rgba(59, 130, 246, 0.11);
  border-color: rgba(96, 165, 250, 0.32);
}

.notif-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(148, 163, 184, 0.15);
}

.notif-cat-icon.doorbell { background: rgba(56, 189, 248, 0.2); border-color: rgba(56, 189, 248, 0.4); }
.notif-cat-icon.door { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.4); }
.notif-cat-icon.security { background: rgba(251, 113, 133, 0.2); border-color: rgba(251, 113, 133, 0.42); }
.notif-cat-icon.away { background: rgba(251, 191, 36, 0.2); border-color: rgba(251, 191, 36, 0.4); }
.notif-cat-icon.boiler { background: rgba(255, 123, 84, 0.2); border-color: rgba(255, 123, 84, 0.4); }
.notif-cat-icon.version { background: rgba(99, 102, 241, 0.24); border-color: rgba(129, 140, 248, 0.46); }
.notif-cat-icon.system { background: rgba(148, 163, 184, 0.18); border-color: rgba(148, 163, 184, 0.32); }

.notif-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.notif-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notif-item-top strong {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-new-chip {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.28);
  color: #bfdbfe;
  border: 1px solid rgba(96, 165, 250, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-item-body {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.notif-item-action {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.36);
  color: #bae6fd;
}

.notif-empty-state {
  text-align: center;
  padding: 32px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.notif-empty-icon {
  font-size: 1.85rem;
  opacity: 0.85;
}

.notif-empty-state strong {
  font-size: 0.94rem;
  color: var(--text);
}

.notif-empty-state p {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 280px;
}

.notif-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notif-version-info {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Day Mode overrides for Notifications & Update Banner */
html[data-theme="light"] .notif-badge {
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.42), 0 0 0 2px rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .btn-notif-bell.has-unread {
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
}

html[data-theme="light"] .app-update-banner {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.96), rgba(224, 231, 255, 0.94));
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] .app-update-icon {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}

html[data-theme="light"] .app-update-text strong {
  color: #0f172a;
}

html[data-theme="light"] .app-update-text span {
  color: #334155;
}

html[data-theme="light"] .notif-filter-pill {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

html[data-theme="light"] .notif-filter-pill.active {
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  border-color: #1d4ed8;
  color: #ffffff;
}

html[data-theme="light"] .notif-update-card {
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95), rgba(224, 231, 255, 0.92));
  border-color: rgba(37, 99, 235, 0.32);
}

html[data-theme="light"] .notif-item {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .notif-item.is-clickable:hover {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.32);
}

html[data-theme="light"] .notif-item.is-unread {
  background: rgba(239, 246, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.3);
}

html[data-theme="light"] .notif-new-chip {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.3);
}

html[data-theme="light"] .notif-item-action {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.28);
  color: #1d4ed8;
}

html[data-theme="light"] .notif-empty-state {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .notif-version-info {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: #475569;
}

@media (max-width: 768px) {
  .app-update-banner {
    padding: 9px 11px;
    gap: 8px;
  }
  .app-update-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 0.92rem;
  }
  .app-update-text strong {
    font-size: 0.82rem;
  }
  .app-update-text span {
    font-size: 0.72rem;
  }
  #btn-app-update-now {
    padding: 6px 10px;
    font-size: 0.76rem;
  }
  .notif-badge {
    top: -3px;
    left: -3px;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    font-size: 0.62rem;
  }
  .notif-modal-card {
    max-height: 86vh;
  }
  .notifications-list {
    max-height: 52vh;
  }
  .notif-update-card {
    flex-wrap: nowrap;
    padding: 9px 10px;
  }
  #btn-all-off {
    padding: 6px 9px !important;
    font-size: 0.75rem !important;
  }
  #btn-away-mode {
    padding: 6px 8px !important;
    font-size: 0.74rem !important;
  }
}

/* ==========================================================================
   Nuki Activity Log Panel & Active Lights Quick Filter Polish
   ========================================================================== */
.nuki-logs-panel {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.cam-nuki-logs-panel {
  margin-top: 4px;
  padding: 9px 10px;
}

.nuki-logs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.cam-nuki-logs-panel .nuki-logs-list {
  max-height: 160px;
}

.nuki-log-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.nuki-log-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.nuki-log-icon {
  font-size: 0.96rem;
  flex-shrink: 0;
}

.nuki-log-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.nuki-log-text strong {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nuki-log-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nuki-log-time {
  font-size: 0.71rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-chip.is-active-lights {
  border-color: rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

.filter-chip.is-active-lights.active {
  border-color: rgba(251, 191, 36, 0.78);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.36), rgba(217, 119, 6, 0.22));
  color: #fef3c7;
}

.active-cleanup-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(15, 23, 42, 0.78));
  border: 1px solid rgba(251, 191, 36, 0.34);
  margin-bottom: 2px;
}

.active-cleanup-bar strong {
  font-size: 0.86rem;
  color: var(--text);
}

html[data-theme="light"] .nuki-logs-panel {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.11);
}

html[data-theme="light"] .nuki-log-row {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.09);
}

html[data-theme="light"] .filter-chip.is-active-lights {
  border-color: rgba(217, 119, 6, 0.38);
  background: rgba(254, 243, 199, 0.85);
  color: #92400e;
}

html[data-theme="light"] .filter-chip.is-active-lights.active {
  border-color: #d97706;
  background: linear-gradient(145deg, #f59e0b, #d97706);
  color: #ffffff;
}

html[data-theme="light"] .active-cleanup-bar {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.92), rgba(255, 255, 255, 0.94));
  border-color: rgba(217, 119, 6, 0.3);
}

/* ==========================================================================
   Eufy Doorbell Intercom (Talkback, Live Audio & Quick Responses)
   ========================================================================== */
.cam-talk-btn {
  padding: 0 12px !important;
  gap: 5px;
  font-weight: 600;
}

.cam-talk-btn.is-talking {
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.42), rgba(225, 29, 72, 0.28)) !important;
  border-color: rgba(251, 113, 133, 0.78) !important;
  color: #ffe4e6 !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.22), 0 6px 18px rgba(244, 63, 94, 0.3);
  animation: talkPulse 1.35s ease-in-out infinite;
}

@keyframes talkPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.22), 0 6px 16px rgba(244, 63, 94, 0.28); }
  50% { box-shadow: 0 0 0 5px rgba(244, 63, 94, 0.32), 0 6px 20px rgba(244, 63, 94, 0.4); }
}

#btn-eufy-audio.is-listening {
  background: rgba(56, 189, 248, 0.24) !important;
  border-color: rgba(56, 189, 248, 0.65) !important;
  color: #e0f2fe !important;
}

#btn-eufy-voices.active {
  background: rgba(99, 102, 241, 0.26) !important;
  border-color: rgba(129, 140, 248, 0.65) !important;
}

.eufy-voices-panel {
  margin-top: 2px;
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.eufy-voices-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eufy-voice-chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.eufy-voice-chip:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.55);
}

html[data-theme="light"] .cam-talk-btn.is-talking {
  background: linear-gradient(145deg, #f43f5e, #e11d48) !important;
  border-color: #be123c !important;
  color: #ffffff !important;
}

html[data-theme="light"] #btn-eufy-audio.is-listening {
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(37, 99, 235, 0.45) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .eufy-voices-panel {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .eufy-voice-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

html[data-theme="light"] .eufy-voice-chip:hover {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.45);
  color: #1d4ed8;
}

/* ==========================================================================
   v108: Upgraded Camera Viewer, Doorbell Intercom Console & AI Sightings UI
   ========================================================================== */
.eufy-sub-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin: 2px 0 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.eufy-sightings-box {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.eufy-sightings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eufy-sighting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.8rem;
}

.eufy-sighting-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  min-width: 0;
}

.eufy-sighting-time {
  font-size: 0.74rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Header Camera Button Live Activity Dot */
#btn-open-camera {
  position: relative;
}

#btn-open-camera.has-doorbell-activity::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.85), 0 0 10px rgba(244, 63, 94, 0.85);
  animation: talkPulse 1.4s ease-in-out infinite;
}

/* Doorbell Source Tab Live Dot */
.cam-seg-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f43f5e;
  margin-inline-end: 5px;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.85);
  animation: talkPulse 1.3s ease-in-out infinite;
}

/* Visitor / Last-Seen Strip inside Camera Modal */
.cam-visitor-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-radius: 13px;
  background: rgba(56, 189, 248, 0.11);
  border: 1px solid rgba(56, 189, 248, 0.28);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cam-visitor-strip.is-live-alert {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.24), rgba(251, 146, 60, 0.16));
  border-color: rgba(251, 113, 133, 0.55);
  animation: talkPulse 1.8s ease-in-out infinite;
}

.cam-visitor-strip.is-live-known {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.16));
  border-color: rgba(52, 211, 153, 0.48);
}

.cam-visitor-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.cam-visitor-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.cam-visitor-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cam-sightings-panel {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 170px;
  overflow-y: auto;
}

/* Camera Viewport Enhanced Spinner & Quick Floating Controls */
.camera-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cam-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #38bdf8;
  animation: camSpin 0.85s linear infinite;
}

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

.camera-hud-quick {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 5;
}

.cam-hud-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.15s ease;
}

.cam-hud-icon-btn:hover {
  background: rgba(56, 189, 248, 0.34);
}

.cam-hud-icon-btn:active {
  transform: scale(0.92);
}

/* On-Air Talkback HUD Pill inside Viewport */
.cam-talk-hud {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(190, 18, 60, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(254, 205, 211, 0.48);
  color: #fff1f2;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.45);
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}

.cam-talk-rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  animation: talkPulse 1s ease-in-out infinite;
}

.cam-talk-wave,
.intercom-mini-wave {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
  height: 16px;
}

.cam-talk-wave i,
.intercom-mini-wave i {
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.85;
  transform: scaleY(0.24);
  transform-origin: center;
  transition: transform 0.07s linear;
}

.cam-talk-timer {
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
  font-size: 0.76rem;
}

/* Premium Doorbell Intercom Console */
.eufy-intercom-console {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.56));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.intercom-main-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.intercom-talk-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(99, 102, 241, 0.22));
  color: #f8fafc;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.intercom-talk-cta:active {
  transform: scale(0.985);
}

.intercom-talk-cta.is-connecting {
  opacity: 0.82;
  border-color: rgba(251, 191, 36, 0.6);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(56, 189, 248, 0.18));
}

.intercom-talk-cta.is-talking {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
  border-color: rgba(254, 205, 211, 0.72) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.28), 0 10px 24px rgba(225, 29, 72, 0.36);
  animation: talkPulse 1.35s ease-in-out infinite;
}

.intercom-talk-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
}

.intercom-talk-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.intercom-talk-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.intercom-talk-sub {
  font-size: 0.73rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.intercom-mini-wave {
  opacity: 0.35;
  flex-shrink: 0;
}

.intercom-talk-cta.is-talking .intercom-mini-wave {
  opacity: 1;
}

.intercom-listen-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 72px;
  padding: 6px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.16s ease;
}

.intercom-listen-btn > span:first-child {
  font-size: 1.15rem;
  line-height: 1;
}

.intercom-listen-btn.is-listening {
  background: rgba(14, 165, 233, 0.25) !important;
  border-color: rgba(56, 189, 248, 0.65) !important;
  color: #e0f2fe !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.intercom-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.intercom-mode-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.11);
  gap: 2px;
}

.intercom-mode-btn {
  border: none;
  border-radius: 8px;
  padding: 5px 9px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.intercom-mode-btn.active {
  background: rgba(59, 130, 246, 0.34);
  color: #ffffff;
}

/* Light Theme Overrides for v108 Camera & Intercom */
html[data-theme="light"] .eufy-sub-opts,
html[data-theme="light"] .eufy-sightings-box {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.11);
}

html[data-theme="light"] .eufy-sighting-row {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .cam-visitor-strip {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.25);
  color: #0f172a;
}

html[data-theme="light"] .cam-visitor-strip.is-live-alert {
  background: #fff1f2;
  border-color: rgba(225, 29, 72, 0.4);
  color: #9f1239;
}

html[data-theme="light"] .cam-visitor-strip.is-live-known {
  background: #ecfdf5;
  border-color: rgba(16, 185, 129, 0.4);
  color: #065f46;
}

html[data-theme="light"] .cam-sightings-panel {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .eufy-intercom-console {
  background: linear-gradient(155deg, #f8fafc, #eef2ff);
  border-color: rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .intercom-talk-cta {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.24);
}

html[data-theme="light"] .intercom-listen-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0f172a;
}

html[data-theme="light"] .intercom-listen-btn.is-listening {
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(37, 99, 235, 0.45) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .intercom-mode-seg {
  background: #e2e8f0;
  border-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .intercom-mode-btn {
  color: #475569;
}

html[data-theme="light"] .intercom-mode-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

@media (max-width: 560px) {
  .cam-talk-hud {
    top: 44px;
    bottom: auto;
    font-size: 0.74rem;
    padding: 5px 11px;
  }
}

/* ==========================================================================
   v109: Minimal, Clutter-Free Camera & Intercom Console
   ========================================================================== */
.cam-header-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cam-header-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
}

.cam-header-main .cam-segmented {
  width: 100%;
  max-width: 340px;
}

.cam-visitor-pill {
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cam-visitor-pill.is-live-alert {
  background: rgba(225, 29, 72, 0.82);
  border-color: rgba(254, 205, 211, 0.5);
  color: #fff1f2;
}

.cam-visitor-pill.is-live-known {
  background: rgba(5, 150, 105, 0.82);
  border-color: rgba(167, 243, 208, 0.48);
  color: #ecfdf5;
}

.cam-hud-fs-btn,
.cam-hud-zoom-reset {
  position: absolute;
  bottom: 10px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 10, 20, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.14s ease, background 0.15s ease;
}

.cam-hud-fs-btn {
  right: 10px;
  width: 32px;
}

.cam-hud-zoom-reset {
  left: 10px;
  padding: 0 11px;
  font-size: 0.76rem;
  color: #7dd3fc;
}

.cam-hud-fs-btn:hover,
.cam-hud-zoom-reset:hover {
  background: rgba(56, 189, 248, 0.34);
}

.cam-minimal-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cam-pill-action {
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.065);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.cam-pill-action:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.42);
}

.cam-pill-action:active {
  transform: scale(0.98);
}

.cam-intercom-bar {
  display: grid;
  grid-template-columns: 1fr 48px 48px;
  gap: 8px;
  align-items: center;
}

.cam-talk-cta {
  height: 50px;
  padding: 0 16px;
  border-radius: 15px;
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(99, 102, 241, 0.24));
  color: #f8fafc;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.cam-talk-cta:active {
  transform: scale(0.98);
}

.cam-talk-cta.is-connecting {
  opacity: 0.85;
  border-color: rgba(251, 191, 36, 0.6);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(56, 189, 248, 0.2));
}

.cam-talk-cta.is-talking {
  background: linear-gradient(135deg, #e11d48, #be123c) !important;
  border-color: rgba(254, 205, 211, 0.72) !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.26), 0 8px 22px rgba(225, 29, 72, 0.34);
  animation: talkPulse 1.35s ease-in-out infinite;
}

.cam-talk-cta .intercom-mini-wave {
  display: none;
}

.cam-talk-cta.is-talking .intercom-mini-wave {
  display: inline-flex;
  opacity: 1;
}

.cam-round-btn {
  width: 48px;
  height: 50px;
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.cam-round-btn.is-listening {
  background: rgba(14, 165, 233, 0.26) !important;
  border-color: rgba(56, 189, 248, 0.68) !important;
  color: #e0f2fe !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}

.cam-round-btn.active {
  background: rgba(99, 102, 241, 0.26);
  border-color: rgba(129, 140, 248, 0.6);
}

.cam-more-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

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

.cam-more-chip {
  padding: 9px 6px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cam-more-chip:hover,
.cam-more-chip.active {
  background: rgba(59, 130, 246, 0.24);
  border-color: rgba(96, 165, 250, 0.5);
}

.cam-sightings-list-clean {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 140px;
  overflow-y: auto;
}

html[data-theme="light"] .cam-pill-action,
html[data-theme="light"] .cam-round-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.13);
  color: #0f172a;
}

html[data-theme="light"] .cam-talk-cta {
  background: linear-gradient(135deg, #0284c7, #4f46e5);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.22);
}

html[data-theme="light"] .cam-round-btn.is-listening {
  background: rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(37, 99, 235, 0.48) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .cam-more-drawer {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.11);
}

html[data-theme="light"] .cam-more-chip {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0f172a;
}

/* ==========================================================================
   v111: Masked Wi-Fi Input, Sighting Thumbnails, Ring Popup & Instant Preview
   ========================================================================== */
.pw-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pw-input-wrap input {
  width: 100%;
  padding-inline-end: 38px !important;
}

.pw-eye-btn {
  position: absolute;
  inset-inline-end: 6px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pw-eye-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Sighting Thumbnail + Lightbox */
.sighting-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.14s ease;
}

.sighting-thumb:hover {
  transform: scale(1.06);
}

.sighting-lightbox-card {
  max-width: 520px;
  padding: 14px !important;
  gap: 10px;
}

.sighting-lightbox-img {
  width: 100%;
  max-height: 70dvh;
  object-fit: contain;
  border-radius: 14px;
  background: #020617;
  display: block;
}

/* Zero-Black-Screen Subtle Connecting Overlay over Instant Poster */
.camera-overlay.is-preview {
  inset: auto auto 12px 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  flex-direction: row;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(6, 10, 20, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.78rem;
  gap: 8px;
}

.camera-overlay.is-preview .cam-spinner {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

/* Real-Time Incoming Doorbell Ring Popup */
.doorbell-ring-popup {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 420px);
  z-index: 1200;
  padding: 13px 14px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(251, 113, 133, 0.55);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.55), 0 0 0 3px rgba(244, 63, 94, 0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: ringSlideIn 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ringSlideIn {
  from { opacity: 0; transform: translate(-50%, -18px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.doorbell-ring-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

.doorbell-ring-thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #020617;
  flex-shrink: 0;
}

.doorbell-ring-meta {
  flex: 1;
  min-width: 0;
}

.doorbell-ring-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #fff1f2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.doorbell-ring-sub {
  font-size: 0.78rem;
  color: #cbd5e1;
  margin-top: 2px;
}

.doorbell-ring-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

html[data-theme="light"] .doorbell-ring-popup {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(225, 29, 72, 0.45);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22), 0 0 0 3px rgba(225, 29, 72, 0.14);
}

html[data-theme="light"] .doorbell-ring-title {
  color: #9f1239;
}

html[data-theme="light"] .doorbell-ring-sub {
  color: #475569;
}

/* ==========================================================================
   v113: Apple Human Interface Guidelines & iOS 26 Liquid Glass Design System
   Reference: https://developer.apple.com/design/
   - Native SF Pro / SF Hebrew Typography & Optical Tracking
   - True Apple System Semantic Palette (Dark OLED & Light Grouped)
   - Strict Material Hierarchy: Solid Content Platters vs. Floating Liquid Glass Chrome
   - Concentric Geometry, Capsule Controls & Circular Apple Home Glyphs
   - Authentic iOS 26 Switches, Segmented Controls, Bottom Sheets & 44pt Touch Targets
   - Full Accessibility: Reduce Motion, Reduce Transparency, High Contrast, Focus Rings
   ========================================================================== */

:root {
  /* Apple HIG Dark Mode Semantic System Tokens */
  --apple-bg: #000000;
  --apple-surface-1: #1c1c1e;
  --apple-surface-2: #2c2c2e;
  --apple-surface-3: #3a3a3c;
  --apple-label: #ffffff;
  --apple-label-2: rgba(235, 235, 245, 0.72);
  --apple-label-3: rgba(235, 235, 245, 0.46);
  --apple-sep: rgba(255, 255, 255, 0.11);
  --apple-sep-strong: rgba(255, 255, 255, 0.22);

  /* Apple HIG System Accent Colors (Dark) */
  --apple-blue: #0a84ff;
  --apple-blue-soft: rgba(10, 132, 255, 0.18);
  --apple-amber: #ff9f0a;
  --apple-yellow: #ffd60a;
  --apple-green: #30d158;
  --apple-red: #ff453a;
  --apple-teal: #64d2ff;
  --apple-indigo: #5e5ce6;
  --apple-purple: #bf5af2;

  /* Apple HIG Spring & Motion Curves */
  --apple-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --apple-ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* Map legacy dashboard variables to Apple System tokens */
  --bg: var(--apple-bg);
  --text: var(--apple-label);
  --text-dim: var(--apple-label-2);
  --text-muted: var(--apple-label-3);
  --glass-border: var(--apple-sep);
  --glass-border-strong: var(--apple-sep-strong);
  --amber: var(--apple-yellow);
  --amber-soft: rgba(255, 214, 10, 0.16);
  --amber-glow: rgba(255, 159, 10, 0.38);
  --sky: var(--apple-teal);
  --sky-soft: rgba(100, 210, 255, 0.16);
  --ember: var(--apple-amber);
  --ember-soft: rgba(255, 159, 10, 0.18);
  --violet: var(--apple-purple);
  --violet-soft: rgba(191, 90, 242, 0.16);
  --green: var(--apple-green);
  --red: var(--apple-red);
}

html[data-theme="light"] {
  /* Apple HIG Light Mode Semantic System Tokens */
  --apple-bg: #f2f2f7;
  --apple-surface-1: #ffffff;
  --apple-surface-2: #f2f2f7;
  --apple-surface-3: #e5e5ea;
  --apple-label: #000000;
  --apple-label-2: rgba(60, 60, 67, 0.72);
  --apple-label-3: rgba(60, 60, 67, 0.48);
  --apple-sep: rgba(60, 60, 67, 0.14);
  --apple-sep-strong: rgba(60, 60, 67, 0.24);

  /* Apple HIG System Accent Colors (Light) */
  --apple-blue: #007aff;
  --apple-blue-soft: rgba(0, 122, 255, 0.12);
  --apple-amber: #ff9500;
  --apple-yellow: #ffcc00;
  --apple-green: #34c759;
  --apple-red: #ff3b30;
  --apple-teal: #32ade6;
  --apple-indigo: #5856d6;
  --apple-purple: #af52de;

  --bg: var(--apple-bg);
  --text: var(--apple-label);
  --text-dim: var(--apple-label-2);
  --text-muted: var(--apple-label-3);
  --glass-border: var(--apple-sep);
  --glass-border-strong: var(--apple-sep-strong);
}

/* 1. Native Apple SF Pro / SF Hebrew Typography & Optical Hierarchy */
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Heebo", system-ui, sans-serif;
  background: var(--apple-bg);
  color: var(--apple-label);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1;
}

h1, h2, h3, .splash-title, .room-title, .brand-group h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Heebo", system-ui, sans-serif;
  letter-spacing: -0.022em;
  font-weight: 700;
}

.section-header h2 {
  font-size: 1.38rem;
  line-height: 1.2;
}

.stat-val,
.room-count,
.clock-pill,
.notif-badge,
.boiler-countdown-digits,
.blind-pct-val {
  font-variant-numeric: tabular-nums;
}

/* 2. Quiet Architectural Backdrop (HIG: Content first, never noisy neon blobs) */
.ambient-bg {
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(10, 132, 255, 0.14) 0%, transparent 62%),
    radial-gradient(ellipse 75% 45% at 90% 105%, rgba(94, 92, 230, 0.10) 0%, transparent 60%),
    #000000;
}

.orb {
  opacity: 0.08;
  filter: blur(150px);
}

html[data-theme="light"] .ambient-bg {
  background: #f2f2f7;
}

html[data-theme="light"] .orb {
  display: none;
}

/* Bottom Scroll-Edge Soft Vignette behind Floating Liquid Glass Tab Bar */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(92px + env(safe-area-inset-bottom));
  pointer-events: none;
  z-index: 80;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.24) 55%, transparent 100%);
}

html[data-theme="light"] body::after {
  background: linear-gradient(to top, rgba(242, 242, 247, 0.88) 0%, rgba(242, 242, 247, 0.34) 55%, transparent 100%);
}

/* 3. Strict Content Layer — Clean Apple Grouped Platters (Zero Glass-on-Glass) */
.room-card,
.stat-card,
.settings-card,
.glass-accordion,
.scene-card,
.blind-card,
.boiler-card,
.boiler-hero-card,
.user-item-card,
.gp-pass-card {
  background: var(--apple-surface-1);
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid var(--apple-sep);
  border-radius: 26px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.24);
}

html[data-theme="light"] .room-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .glass-accordion,
html[data-theme="light"] .scene-card,
html[data-theme="light"] .blind-card,
html[data-theme="light"] .boiler-card,
html[data-theme="light"] .boiler-hero-card,
html[data-theme="light"] .user-item-card,
html[data-theme="light"] .gp-pass-card {
  background: var(--apple-surface-1);
  border: 1px solid rgba(60, 60, 67, 0.10);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.04),
    0 6px 20px -6px rgba(0, 0, 0, 0.06);
  color: var(--apple-label);
}

.room-card {
  padding: 14px;
  gap: 12px;
}

.room-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--apple-sep);
}

.room-title {
  font-size: 1.06rem;
  color: var(--apple-label);
}

/* 4. Floating Liquid Glass Chrome Layer (iOS 26 .regular Material) */
.top-bar {
  border-radius: 28px;
  background: linear-gradient(
    180deg,
    rgba(38, 38, 42, 0.72) 0%,
    rgba(24, 24, 27, 0.78) 100%
  );
  backdrop-filter: blur(44px) saturate(210%) brightness(1.06);
  -webkit-backdrop-filter: blur(44px) saturate(210%) brightness(1.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 0.5px 0 0 rgba(255, 255, 255, 0.44),
    inset 0 -0.5px 0 0 rgba(255, 255, 255, 0.08),
    0 14px 36px -10px rgba(0, 0, 0, 0.62);
}

.main-nav,
.mobile-bottom-nav {
  border-radius: 999px;
  padding: 5px;
  background: linear-gradient(
    180deg,
    rgba(42, 42, 46, 0.72) 0%,
    rgba(26, 26, 30, 0.80) 100%
  );
  backdrop-filter: blur(46px) saturate(220%) brightness(1.08);
  -webkit-backdrop-filter: blur(46px) saturate(220%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0.5px 0 0 rgba(255, 255, 255, 0.52),
    inset 0 -0.5px 0 0 rgba(255, 255, 255, 0.10),
    0 18px 42px -6px rgba(0, 0, 0, 0.72);
}

.nav-glass-lens {
  top: 4px;
  bottom: 4px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(255, 255, 255, 0.11) 100%
  );
  border: 0.5px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 0.5px 0 0 rgba(255, 255, 255, 0.65),
    0 4px 14px rgba(0, 0, 0, 0.32);
  transition:
    transform 0.36s var(--apple-spring),
    width 0.36s var(--apple-spring),
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.nav-tab,
.m-nav-item {
  min-height: 46px;
  color: rgba(235, 235, 245, 0.64);
  font-weight: 600;
}

.nav-tab.active,
.m-nav-item.active {
  color: var(--apple-blue);
  transform: scale(1.02);
}

html[data-theme="light"] .top-bar,
html[data-theme="light"] .main-nav,
html[data-theme="light"] .mobile-bottom-nav {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.78) 0%,
    rgba(248, 248, 252, 0.72) 100%
  );
  backdrop-filter: blur(44px) saturate(210%);
  -webkit-backdrop-filter: blur(44px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 0 0 #ffffff,
    0 0 0 0.5px rgba(0, 0, 0, 0.08),
    0 14px 36px -8px rgba(0, 0, 0, 0.16);
}

html[data-theme="light"] .nav-glass-lens {
  background: rgba(0, 122, 255, 0.11);
  border: 0.5px solid rgba(0, 122, 255, 0.20);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9),
    0 2px 10px rgba(0, 122, 255, 0.10);
}

html[data-theme="light"] .nav-tab,
html[data-theme="light"] .m-nav-item {
  color: rgba(60, 60, 67, 0.68);
}

html[data-theme="light"] .nav-tab.active,
html[data-theme="light"] .m-nav-item.active {
  color: var(--apple-blue);
}

/* 5. Concentric Geometry & Capsule Controls (iOS 26 Hallmark) */
.btn,
.header-quick-pills .btn,
.filter-chip,
.fav-scene-pill,
.gp-pill-btn,
.mini-pill-btn {
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.2s var(--apple-spring), background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.btn {
  min-height: 40px;
  padding: 9px 18px;
  background: rgba(255, 255, 255, 0.10);
  border: 0.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

.btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 0.84rem;
}

.btn-primary {
  background: var(--apple-blue);
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.38), 0 4px 16px rgba(10, 132, 255, 0.34);
}

.btn-primary:hover {
  background: var(--apple-blue);
  filter: brightness(1.08);
}

html[data-theme="light"] .btn {
  background: rgba(118, 118, 128, 0.12);
  border-color: rgba(60, 60, 67, 0.10);
  color: var(--apple-label);
  box-shadow: none;
}

html[data-theme="light"] .btn:hover {
  background: rgba(118, 118, 128, 0.18);
}

html[data-theme="light"] .btn-primary {
  background: var(--apple-blue);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.26);
}

html[data-theme="light"] .btn-primary:hover {
  background: #0071e3;
}

.btn-icon-glass {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
}

.btn-danger-glass {
  background: rgba(255, 69, 58, 0.18);
  border-color: rgba(255, 69, 58, 0.38);
  color: #ff6961;
}

html[data-theme="light"] .btn-danger-glass {
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(255, 59, 48, 0.24);
  color: #d70015;
}

.split-action {
  border-color: rgba(255, 69, 58, 0.36);
  background: rgba(255, 69, 58, 0.16);
  box-shadow: none;
}

html[data-theme="light"] .split-action {
  border-color: rgba(255, 59, 48, 0.24);
  background: rgba(255, 59, 48, 0.11);
}

/* Circular Apple Home Stat Icons & Concentric Stat Cards */
.stat-card {
  border-radius: 22px;
  padding: 13px 14px;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: none;
}

/* Apple Home Switch Tiles (Concentric inside 26px Room Card) */
.switch-tile {
  border-radius: 18px;
  min-height: 64px;
  padding: 11px 12px;
  background: var(--apple-surface-2);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transition: transform 0.2s var(--apple-spring), background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.switch-tile:hover {
  background: var(--apple-surface-3);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.switch-tile:active {
  transform: scale(0.96);
}

.tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: none;
}

.switch-tile.light.is-on {
  background: linear-gradient(155deg, rgba(255, 214, 10, 0.24) 0%, rgba(255, 159, 10, 0.14) 100%);
  border-color: rgba(255, 214, 10, 0.52);
  box-shadow: 0 8px 24px -8px rgba(255, 159, 10, 0.34);
}

.switch-tile.light.is-on .tile-icon {
  background: var(--apple-amber);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(255, 159, 10, 0.48);
}

.switch-tile.boiler.is-on {
  background: linear-gradient(155deg, rgba(255, 159, 10, 0.26) 0%, rgba(255, 69, 58, 0.14) 100%);
  border-color: rgba(255, 159, 10, 0.55);
  box-shadow: 0 8px 24px -8px rgba(255, 100, 50, 0.34);
}

.switch-tile.boiler.is-on .tile-icon {
  background: #ff6b35;
  color: #ffffff;
}

.switch-tile.fan.is-on {
  background: linear-gradient(155deg, rgba(48, 209, 88, 0.22) 0%, rgba(100, 210, 255, 0.12) 100%);
  border-color: rgba(48, 209, 88, 0.48);
}

.switch-tile.fan.is-on .tile-icon {
  background: var(--apple-green);
  color: #ffffff;
}

.switch-tile.blind.is-on {
  background: linear-gradient(155deg, rgba(100, 210, 255, 0.22) 0%, rgba(10, 132, 255, 0.12) 100%);
  border-color: rgba(100, 210, 255, 0.48);
}

.switch-tile.blind.is-on .tile-icon {
  background: var(--apple-blue);
  color: #ffffff;
}

/* Light Mode Apple Home Tiles — Crisp Light Gray Off / Warm Luminous Amber On */
html[data-theme="light"] .switch-tile {
  background: #f2f2f7;
  border: 0.5px solid rgba(60, 60, 67, 0.08);
  box-shadow: none;
}

html[data-theme="light"] .switch-tile:hover {
  background: #e5e5ea;
}

html[data-theme="light"] .switch-tile .tile-icon {
  background: rgba(60, 60, 67, 0.10);
  color: #3c3c43;
}

html[data-theme="light"] .switch-tile.light.is-on {
  background: linear-gradient(155deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid rgba(255, 149, 0, 0.45);
  box-shadow: 0 4px 16px -4px rgba(255, 149, 0, 0.24);
}

html[data-theme="light"] .switch-tile.light.is-on .tile-name {
  color: #1c1c1e;
}

html[data-theme="light"] .switch-tile.light.is-on .tile-state {
  color: #b45309;
  font-weight: 600;
}

html[data-theme="light"] .switch-tile.light.is-on .tile-icon {
  background: var(--apple-amber);
  color: #ffffff;
}

html[data-theme="light"] .switch-tile.blind.is-on {
  background: linear-gradient(155deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid rgba(0, 122, 255, 0.35);
}

html[data-theme="light"] .switch-tile.blind.is-on .tile-icon {
  background: var(--apple-blue);
  color: #ffffff;
}

html[data-theme="light"] .switch-tile.fan.is-on {
  background: linear-gradient(155deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid rgba(52, 199, 89, 0.40);
}

html[data-theme="light"] .switch-tile.fan.is-on .tile-icon {
  background: var(--apple-green);
  color: #ffffff;
}

/* 6. Authentic iOS 26 Toggle Switch (51x31pt + Elastic Thumb Elongation) */
.toggle-switch {
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.36);
  border: none;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.12);
  transition: background 0.24s var(--apple-spring);
}

.toggle-switch::after {
  top: 2px;
  right: 2px;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24), 0 1px 1px rgba(0, 0, 0, 0.12);
  transition: transform 0.28s var(--apple-spring), width 0.18s var(--apple-spring);
}

.toggle-switch:active::after {
  width: 32px;
}

.toggle-switch.on {
  background: var(--apple-green);
}

.toggle-switch.on::after {
  transform: translateX(-20px);
}

.toggle-switch.on:active::after {
  transform: translateX(-15px);
}

html[data-theme="light"] .toggle-switch {
  background: rgba(120, 120, 128, 0.26);
  border: none;
}

html[data-theme="light"] .toggle-switch.on {
  background: var(--apple-green);
}

/* 7. Apple Segmented Controls & Search Capsule */
.settings-subnav,
.auth-mode-tabs {
  padding: 3px;
  border-radius: 999px;
  background: rgba(118, 118, 128, 0.24);
  border: none;
}

.settings-subtab,
.auth-mode-tab {
  border-radius: 999px;
  font-weight: 600;
  min-height: 36px;
  transition: all 0.24s var(--apple-spring);
}

.settings-subtab.active,
.auth-mode-tab.active {
  background: rgba(99, 99, 102, 0.72);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), inset 0 0.5px 0 rgba(255, 255, 255, 0.28);
}

html[data-theme="light"] .settings-subnav,
html[data-theme="light"] .auth-mode-tabs {
  background: rgba(118, 118, 128, 0.12);
  box-shadow: none;
  border: none;
}

html[data-theme="light"] .settings-subtab.active,
html[data-theme="light"] .auth-mode-tab.active {
  background: #ffffff;
  color: #000000;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.home-search-wrap input {
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 18px 10px 42px;
  background: rgba(118, 118, 128, 0.20);
  border: 0.5px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.home-search-wrap input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3.5px var(--apple-blue-soft);
}

html[data-theme="light"] .home-search-wrap input {
  background: rgba(118, 118, 128, 0.12);
  border-color: transparent;
  color: #000000;
}

html[data-theme="light"] .home-search-wrap input:focus {
  background: #ffffff;
  border-color: var(--apple-blue);
}

/* Apple Inset Text Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="time"],
input[type="url"],
input[type="datetime-local"],
textarea,
select {
  border-radius: 14px;
  border: 1px solid var(--apple-sep);
  background: var(--apple-surface-2);
  box-shadow: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--apple-blue) !important;
  box-shadow: 0 0 0 3.5px var(--apple-blue-soft) !important;
}

html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="tel"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="time"],
html[data-theme="light"] input[type="url"],
html[data-theme="light"] input[type="datetime-local"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #f2f2f7;
  color: #000000;
  border-color: rgba(60, 60, 67, 0.14);
}

/* Filter Chips — Clean Apple Capsule Pills */
.filter-chip {
  min-height: 36px;
  padding: 7px 15px;
  background: var(--apple-surface-1);
  border: 0.5px solid var(--apple-sep);
  color: var(--apple-label-2);
}

.filter-chip.active {
  background: var(--apple-label);
  color: var(--apple-bg);
  border-color: transparent;
  font-weight: 700;
}

html[data-theme="light"] .filter-chip {
  background: #ffffff;
  border-color: rgba(60, 60, 67, 0.10);
  color: rgba(60, 60, 67, 0.80);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .filter-chip.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* 8. Liquid Glass Modals & iOS Bottom Sheet Presentation */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.modal-card {
  border-radius: 30px;
  background: rgba(28, 28, 30, 0.88);
  backdrop-filter: blur(48px) saturate(210%);
  -webkit-backdrop-filter: blur(48px) saturate(210%);
  border: 0.5px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.42),
    0 28px 70px rgba(0, 0, 0, 0.72);
  animation: appleModalRise 0.34s var(--apple-spring);
}

html[data-theme="light"] .modal-card {
  background: rgba(255, 255, 255, 0.92);
  border: 0.5px solid rgba(60, 60, 67, 0.14);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 24px 64px rgba(0, 0, 0, 0.20);
}

@keyframes appleModalRise {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast {
  border-radius: 999px !important;
  backdrop-filter: blur(36px) saturate(200%);
  -webkit-backdrop-filter: blur(36px) saturate(200%);
  border: 0.5px solid rgba(255, 255, 255, 0.24);
  font-weight: 600;
}

/* Mobile iOS Sheet Presentation & 16px Input Anti-Zoom */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px !important;
  }

  .header-icon-group .btn-icon-glass {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .modal-backdrop:not(#camera-modal):not(#sighting-lightbox) {
    align-items: end;
    justify-items: center;
    padding: 0 8px calc(8px + env(safe-area-inset-bottom));
  }

  .modal-backdrop:not(#camera-modal):not(#sighting-lightbox) .modal-card {
    max-width: 100%;
    width: 100%;
    max-height: 88dvh;
    border-radius: 32px;
    animation: appleSheetUp 0.38s var(--apple-spring);
  }

  .modal-backdrop:not(#camera-modal):not(#sighting-lightbox) .modal-card::before {
    content: "";
    display: block;
    width: 36px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    margin: 9px auto 0;
    flex-shrink: 0;
  }

  html[data-theme="light"] .modal-backdrop:not(#camera-modal):not(#sighting-lightbox) .modal-card::before {
    background: rgba(60, 60, 67, 0.24);
  }

  @keyframes appleSheetUp {
    from { opacity: 0.4; transform: translateY(48px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* 9. Apple Accessibility HIG — Keyboard Focus, Reduced Motion & Reduced Transparency */
:focus-visible {
  outline: 2.5px solid var(--apple-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .top-bar,
  .main-nav,
  .mobile-bottom-nav,
  .modal-card,
  .doorbell-ring-popup,
  .toast {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--apple-surface-1) !important;
    border-color: var(--apple-sep-strong) !important;
  }
  .btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* ==========================================================================
   v114: Apple Icon Composer, SF Symbols 7, Apple Design Resources & Alfa Intelligence
   ========================================================================== */

/* 1. Apple Icon Composer Continuous Squircle Framing (22.5% corner ratio) */
.brand-logo,
.auth-logo,
.splash-emblem {
  border-radius: 23% !important;
  overflow: hidden;
  padding: 0 !important;
  border: 0.5px solid rgba(255, 255, 255, 0.24) !important;
  box-shadow:
    inset 0 0.5px 0 rgba(255, 255, 255, 0.5),
    0 8px 22px -6px rgba(0, 0, 0, 0.45);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 2. SF Symbols 7 Hierarchical Rendering & Physics Animations */
.sf-sym {
  overflow: visible;
  transition: transform 0.24s var(--apple-spring), opacity 0.18s ease;
}

.sf-sym .sf-sec {
  fill-opacity: 0.18;
  transition: fill-opacity 0.24s ease;
}

.nav-tab.active .sf-sym .sf-sec,
.m-nav-item.active .sf-sym .sf-sec,
.switch-tile.is-on .sf-sym .sf-sec,
.stat-icon.active .sf-sym .sf-sec {
  fill-opacity: 0.36;
}

.sf-bounce {
  animation: sfSymbolBounce 0.46s var(--apple-spring);
}

@keyframes sfSymbolBounce {
  0% { transform: scale(1); }
  32% { transform: scale(1.24) translateY(-1.5px); }
  66% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

.stat-icon.ember.active .sf-sym {
  animation: sfSymbolPulse 2.4s ease-in-out infinite;
}

@keyframes sfSymbolPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.09); opacity: 0.86; }
}

/* 3. Apple Design Resources — iOS 26 Dynamic Type Scale & InsetGrouped Lists */
:root {
  --hig-large-title: 1.75rem;
  --hig-title-2: 1.375rem;
  --hig-headline: 1.0625rem;
  --hig-subhead: 0.9375rem;
  --hig-footnote: 0.8125rem;
  --hig-caption-2: 0.6875rem;
}

.section-header h2 {
  font-size: var(--hig-title-2);
  font-weight: 700;
  letter-spacing: -0.024em;
}

.settings-card-head h3 {
  font-size: var(--hig-headline);
  font-weight: 700;
  letter-spacing: -0.018em;
}

.settings-divider {
  height: 0.5px;
  background: var(--apple-sep);
  margin: 12px 0;
}

/* 4. Apple Intelligence — Screen Edge Shimmer & Unified Command Bar */
.ai-edge-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 950;
  opacity: 0;
  transition: opacity 0.35s var(--apple-spring);
}

.ai-edge-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 4px;
  background: conic-gradient(
    from var(--ai-angle, 0deg),
    #ff6b9d,
    #c084fc,
    #60a5fa,
    #38bdf8,
    #fbbf24,
    #ff6b9d
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: blur(6px);
}

.ai-edge-glow.active {
  opacity: 0.92;
  animation: aiSpinGlow 1.1s linear infinite;
}

@property --ai-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes aiSpinGlow {
  from { --ai-angle: 0deg; }
  to { --ai-angle: 360deg; }
}

.ai-hub-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.ai-command-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0 !important;
  border-radius: 999px;
  padding: 2px;
  background: var(--apple-surface-1);
  border: 1px solid var(--apple-sep);
  transition: border-color 0.25s ease, box-shadow 0.28s var(--apple-spring);
}

.ai-command-bar::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 999px;
  padding: 1.8px;
  background: conic-gradient(
    from var(--ai-angle, 0deg),
    #ff6b9d,
    #c084fc,
    #60a5fa,
    #38bdf8,
    #fbbf24,
    #ff6b9d
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.ai-command-bar:focus-within::before,
.ai-command-bar.is-thinking::before {
  opacity: 1;
  animation: aiSpinGlow 2.4s linear infinite;
}

.ai-command-bar:focus-within,
.ai-command-bar.is-thinking {
  border-color: transparent;
  box-shadow:
    0 0 24px -4px rgba(192, 132, 252, 0.34),
    0 0 14px -4px rgba(56, 189, 248, 0.28);
}

.ai-sparkle-badge {
  width: 34px;
  height: 34px;
  margin-inline-start: 6px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.22), rgba(192, 132, 252, 0.24), rgba(56, 189, 248, 0.22));
  color: #e9d5ff;
}

.ai-sparkle-badge svg {
  width: 18px;
  height: 18px;
}

.ai-command-bar input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 10px 10px !important;
  min-height: 42px;
  font-size: 0.92rem;
  color: var(--apple-label);
}

.ai-command-bar input:focus {
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.ai-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-inline-end: 5px;
  flex-shrink: 0;
}

.ai-command-bar .home-search-clear {
  position: static;
  transform: none;
  width: 28px;
  height: 28px;
}

.ai-bar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--apple-label-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.18s var(--apple-spring), background 0.18s ease, color 0.18s ease;
}

.ai-bar-btn svg {
  width: 17px;
  height: 17px;
}

.ai-bar-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--apple-label);
}

.ai-bar-btn:active {
  transform: scale(0.92);
}

.ai-bar-btn.is-listening {
  background: var(--apple-red);
  color: #ffffff;
  animation: sfSymbolPulse 1s ease-in-out infinite;
}

.ai-send-btn {
  background: var(--apple-blue);
  color: #ffffff;
}

.ai-send-btn:hover {
  background: var(--apple-blue);
  color: #ffffff;
  filter: brightness(1.08);
}

/* Smart Reply Banner */
.ai-reply-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.14), rgba(56, 189, 248, 0.12));
  border: 0.5px solid rgba(192, 132, 252, 0.36);
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--apple-label);
  animation: appleModalRise 0.26s var(--apple-spring);
}

.ai-reply-card.is-error {
  background: rgba(255, 69, 58, 0.14);
  border-color: rgba(255, 69, 58, 0.36);
}

.ai-reply-text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.ai-reply-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.10);
  color: var(--apple-label-2);
  cursor: pointer;
  flex-shrink: 0;
}

/* Live Smart Summary Strip & Contextual Suggestion Chips */
.ai-summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 2px 6px;
}

.ai-summary-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--hig-footnote);
  color: var(--apple-label-2);
  min-width: 0;
}

.ai-summary-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c084fc, #38bdf8);
  flex-shrink: 0;
}

.ai-chips-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 0.5px solid var(--apple-sep);
  background: var(--apple-surface-1);
  color: var(--apple-label);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s var(--apple-spring), border-color 0.16s ease, background 0.16s ease;
}

.ai-chip:hover {
  border-color: rgba(192, 132, 252, 0.5);
  background: var(--apple-surface-2);
}

.ai-chip:active {
  transform: scale(0.95);
}

/* Light Mode — Apple Intelligence Components */
html[data-theme="light"] .ai-command-bar {
  background: #ffffff;
  border-color: rgba(60, 60, 67, 0.12);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .ai-sparkle-badge {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.16), rgba(147, 51, 234, 0.16), rgba(0, 122, 255, 0.16));
  color: #7c3aed;
}

html[data-theme="light"] .ai-bar-btn {
  background: rgba(118, 118, 128, 0.12);
  color: #3c3c43;
}

html[data-theme="light"] .ai-bar-btn:hover {
  background: rgba(118, 118, 128, 0.2);
  color: #000000;
}

html[data-theme="light"] .ai-send-btn {
  background: var(--apple-blue);
  color: #ffffff;
}

html[data-theme="light"] .ai-reply-card {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.08), rgba(0, 122, 255, 0.08));
  border-color: rgba(147, 51, 234, 0.25);
  color: #1c1c1e;
}

html[data-theme="light"] .ai-chip {
  background: #ffffff;
  border-color: rgba(60, 60, 67, 0.12);
  color: #1c1c1e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

@media (prefers-reduced-motion: reduce) {
  .ai-edge-glow,
  .ai-command-bar::before {
    animation: none !important;
  }
}

/* ==========================================================================
   v115: iOS 26 Collapsing Large-Title Chrome, Native Taptic Switches & SF Symbols Polish
   ========================================================================== */

/* Hidden Safari Taptic Engine Haptic Switch Sink (must remain rendered, not display:none) */
.ios-haptic-sink {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

/* Native Safari iOS 17.4–26 Liquid Glass Toggle Switch inside .perm-check */
.perm-check input[type="checkbox"][switch] {
  accent-color: var(--apple-green);
  cursor: pointer;
  flex-shrink: 0;
}

/* Inline SF Symbol helpers */
.sf-inline-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.settings-subtab .icon,
.cam-pill-action .icon,
.cam-talk-cta .icon,
.cam-round-btn .icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.cam-pill-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.sf-pulse-ring {
  animation: sfSymbolPulse 1.4s ease-in-out infinite;
}

/* iOS 26 Collapsing Single-Row Large-Title Navigation Header */
.top-bar {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px !important;
  transition:
    padding 0.28s var(--apple-spring),
    border-radius 0.28s var(--apple-spring),
    background 0.26s ease,
    box-shadow 0.28s ease;
}

.top-bar .brand-logo {
  width: 44px;
  height: 44px;
  transition: width 0.28s var(--apple-spring), height 0.28s var(--apple-spring);
}

.top-bar .brand-group h1 {
  font-size: 1.24rem;
  line-height: 1.15;
  transition: font-size 0.28s var(--apple-spring);
}

.top-bar .connection-row {
  gap: 6px;
  margin-top: 2px;
}

.top-bar .meta-pill {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.78rem;
  color: var(--apple-label-2);
}

.top-bar .meta-pill:not(:empty)::before {
  content: "·";
  margin-inline-end: 6px;
  opacity: 0.45;
}

.top-bar .header-icon-group {
  border-inline-start: none !important;
  padding-inline-start: 0 !important;
  gap: 8px;
}

/* Scrolled Condensed Floating Liquid Glass Bar */
.top-bar.is-scrolled {
  padding: 7px 12px !important;
  border-radius: 999px !important;
  background: linear-gradient(
    180deg,
    rgba(40, 40, 46, 0.80) 0%,
    rgba(22, 22, 26, 0.86) 100%
  );
  box-shadow:
    inset 0 0.5px 0 0 rgba(255, 255, 255, 0.56),
    0 14px 36px -6px rgba(0, 0, 0, 0.68);
}

.top-bar.is-scrolled .brand-logo {
  width: 34px;
  height: 34px;
}

.top-bar.is-scrolled .brand-group h1 {
  font-size: 1.0rem !important;
}

.top-bar.is-scrolled .connection-row {
  font-size: 0.72rem !important;
  margin-top: 0;
}

html[data-theme="light"] .top-bar.is-scrolled {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.88) 0%,
    rgba(248, 248, 252, 0.84) 100%
  );
  box-shadow:
    inset 0 1px 0 0 #ffffff,
    0 0 0 0.5px rgba(0, 0, 0, 0.08),
    0 12px 32px -6px rgba(0, 0, 0, 0.14);
}

/* Scroll-Natural Apple Home Quick Action Strip (directly under header) */
.ios-quick-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 0 2px;
  border-top: none !important;
  margin-top: -6px;
}

.ios-quick-strip > .btn,
.ios-quick-strip > .split-action {
  flex: 0 0 auto;
}

.ios-quick-strip .btn {
  min-height: 38px;
  padding: 8px 15px !important;
  font-size: 0.84rem !important;
  border-radius: 999px !important;
  gap: 7px !important;
}

.ios-quick-strip .split-action .btn {
  height: 38px;
}

@media (max-width: 768px) {
  .top-bar {
    padding: 10px 12px !important;
  }
  .top-bar .brand-logo {
    width: 38px;
    height: 38px;
  }
  .top-bar .brand-group h1 {
    font-size: 1.06rem !important;
  }
  .top-bar .meta-pill {
    font-size: 0.72rem !important;
  }
  .ios-quick-strip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 7px !important;
    padding: 0 2px 2px !important;
    margin-top: -8px;
  }
  .ios-quick-strip::-webkit-scrollbar {
    display: none;
  }
  .ios-quick-strip > .btn,
  .ios-quick-strip > .split-action {
    flex: 1 0 auto;
  }
  .ios-quick-strip .btn {
    padding: 8px 13px !important;
    font-size: 0.8rem !important;
  }
}

/* ==========================================================================
   v116: All 10 Apple Home iOS 26 UX/UI Super-Upgrades
   ========================================================================== */

/* 1. Long-Press Haptic Tile Lift & Device Context Sheet */
.switch-tile.is-pressing {
  transform: scale(0.92) !important;
  box-shadow: 0 0 0 2.5px var(--apple-blue) !important;
}

.dev-ctx-card {
  max-width: 440px;
}

.dev-ctx-full-btn {
  width: 100%;
  justify-content: center;
}

.dev-ctx-full-btn.is-fav-active {
  background: rgba(255, 159, 10, 0.16);
  border-color: rgba(255, 159, 10, 0.45);
  color: var(--apple-amber);
}

.dev-ctx-block {
  padding: 12px 13px;
  border-radius: 18px;
  background: var(--apple-surface-2);
  border: 0.5px solid var(--apple-sep);
}

.dev-ctx-timer-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.dev-ctx-timer-row .gp-pill-btn {
  text-align: center;
  padding: 8px 4px;
}

/* 2. Undo Toast Animated 10s Progress Bar */
.undo-toast {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.undo-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--apple-blue), var(--apple-teal));
  transform-origin: right center;
  animation: undoCountdown 10s linear forwards;
}

@keyframes undoCountdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* 3. Apple Home Interactive Vertical Blind Window Dragger */
.blind-interactive-layout {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.blind-side-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.blind-window-drag {
  position: relative;
  width: 72px;
  min-height: 112px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--apple-sep-strong);
  background: #0b192c;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s var(--apple-spring), box-shadow 0.18s ease;
}

.blind-window-drag.is-dragging {
  transform: scale(1.03);
  box-shadow: 0 0 0 2.5px var(--apple-blue), 0 10px 24px rgba(10, 132, 255, 0.28);
}

.blind-window-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #38bdf8 0%, #bae6fd 58%, #fef3c7 100%);
  opacity: 0.78;
}

.blind-window-slats {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(28, 28, 34, 0.94) 0px,
      rgba(28, 28, 34, 0.94) 7px,
      rgba(255, 255, 255, 0.14) 7px,
      rgba(255, 255, 255, 0.14) 9px
    );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition: height 0.08s linear;
}

.blind-window-handle {
  position: absolute;
  left: 50%;
  bottom: 4px;
  transform: translateX(-50%);
  width: 26px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.blind-window-pct {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

html[data-theme="light"] .blind-window-slats {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(229, 229, 234, 0.96) 0px,
      rgba(229, 229, 234, 0.96) 7px,
      rgba(60, 60, 67, 0.16) 7px,
      rgba(60, 60, 67, 0.16) 9px
    );
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .blind-window-handle {
  background: rgba(60, 60, 67, 0.42);
}

/* 5. Apple Home Favorites Switch Strip */
.fav-devices-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.fav-devices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.fav-devices-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--apple-label);
}

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

@media (max-width: 768px) {
  .favorites-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 6. Mini Live Camera & Doorbell Peek Strip (Admin Only) */
.cam-peek-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.cam-peek-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px;
  border-radius: 20px;
  background: var(--apple-surface-1);
  border: 0.5px solid var(--apple-sep);
  color: var(--apple-label);
  font-family: inherit;
  text-align: right;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s var(--apple-spring), border-color 0.2s ease, background 0.2s ease;
}

.cam-peek-card:hover {
  border-color: var(--apple-sep-strong);
  transform: translateY(-1px);
}

.cam-peek-card:active {
  transform: scale(0.97);
}

.cam-peek-media {
  position: relative;
  width: 74px;
  height: 54px;
  border-radius: 13px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

.cam-peek-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam-peek-media img.is-missing {
  opacity: 0;
}

.cam-peek-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  direction: ltr;
}

.cam-peek-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cam-peek-title {
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cam-peek-sub {
  font-size: 0.72rem;
  color: var(--apple-label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="light"] .cam-peek-card {
  background: #ffffff;
  border-color: rgba(60, 60, 67, 0.10);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 7. Apple Fitness / Thermostat Radial Ring Boiler Dial */
.boiler-radial-hero {
  align-items: center !important;
  gap: 14px;
}

.boiler-radial-meta {
  flex: 1;
  min-width: 0;
}

.boiler-radial-btn {
  position: relative;
  width: 112px !important;
  height: 112px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--apple-surface-2) !important;
  border: none !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14), 0 8px 24px rgba(0, 0, 0, 0.34) !important;
  display: grid !important;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.22s var(--apple-spring), box-shadow 0.25s ease;
}

.boiler-card.is-on .boiler-radial-btn {
  background: radial-gradient(circle at 50% 40%, rgba(255, 159, 10, 0.22), rgba(28, 28, 30, 0.94) 76%) !important;
  box-shadow: 0 0 32px -4px rgba(255, 159, 10, 0.45), 0 10px 26px rgba(0, 0, 0, 0.45) !important;
}

.boiler-radial-btn:active {
  transform: scale(0.94);
}

.boiler-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.boiler-ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 8;
}

.boiler-ring-arc {
  fill: none;
  stroke: url(#boilerRingGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.85s var(--apple-spring);
  filter: drop-shadow(0 0 6px rgba(255, 159, 10, 0.55));
}

.boiler-ring-center {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--apple-label-2);
}

.boiler-card.is-on .boiler-ring-center {
  color: var(--apple-amber);
}

.boiler-ring-center svg {
  width: 24px;
  height: 24px;
}

.boiler-ring-digits {
  font-size: 0.84rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--apple-label);
}

html[data-theme="light"] .boiler-radial-btn {
  background: #f2f2f7 !important;
  box-shadow: inset 0 1px 0 #ffffff, 0 6px 18px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .boiler-card.is-on .boiler-radial-btn {
  background: radial-gradient(circle at 50% 35%, #fff7ed, #ffedd5 82%) !important;
  box-shadow: 0 8px 26px -4px rgba(255, 149, 0, 0.34) !important;
}

html[data-theme="light"] .boiler-ring-track {
  stroke: rgba(60, 60, 67, 0.12);
}

/* 8. Adaptive Time-of-Day & Weather Ambient Atmosphere */
html[data-ambient="morning"] .ambient-bg {
  background:
    radial-gradient(ellipse 95% 52% at 50% -12%, rgba(100, 210, 255, 0.17) 0%, transparent 62%),
    radial-gradient(ellipse 70% 42% at 85% 8%, rgba(255, 214, 10, 0.09) 0%, transparent 56%),
    #000000;
}

html[data-ambient="sunset"] .ambient-bg {
  background:
    radial-gradient(ellipse 95% 54% at 50% -12%, rgba(255, 149, 0, 0.18) 0%, transparent 62%),
    radial-gradient(ellipse 70% 45% at 15% 10%, rgba(191, 90, 242, 0.13) 0%, transparent 58%),
    #000000;
}

html[data-ambient="rain"] .ambient-bg {
  background:
    radial-gradient(ellipse 95% 54% at 50% -12%, rgba(96, 165, 250, 0.18) 0%, transparent 62%),
    radial-gradient(ellipse 75% 45% at 80% 100%, rgba(71, 85, 105, 0.18) 0%, transparent 60%),
    #000000;
}

html[data-theme="light"][data-ambient="morning"] .ambient-bg {
  background: linear-gradient(180deg, #eaf4ff 0%, #f2f2f7 38%);
}

html[data-theme="light"][data-ambient="sunset"] .ambient-bg {
  background: linear-gradient(180deg, #fff3e6 0%, #f2f2f7 38%);
}

html[data-theme="light"][data-ambient="rain"] .ambient-bg {
  background: linear-gradient(180deg, #e5ecf5 0%, #f2f2f7 40%);
}

/* 9. Philips Hue Apple Home 6 Presets & 44pt Thumb Brightness Slider */
.apple-hue-bri-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--apple-surface-2);
  border: 0.5px solid var(--apple-sep);
}

.hue-bri-pct {
  min-width: 38px;
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--apple-label);
}

.apple-hue-bri-bar .hue-bri-slider {
  flex: 1;
  height: 10px;
  accent-color: var(--apple-amber);
  cursor: pointer;
}

.apple-hue-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.hue-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 0.5px solid var(--apple-sep);
  background: var(--apple-surface-2);
  color: var(--apple-label);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s var(--apple-spring), border-color 0.16s ease;
}

.hue-preset-btn:active {
  transform: scale(0.93);
}

.hue-swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  flex-shrink: 0;
}

/* 10. Apple Skeleton Shimmer & RTL Directional Tab Transitions */
.skeleton-room {
  pointer-events: none;
}

.skeleton-line,
.skeleton-tile {
  position: relative;
  overflow: hidden;
  background: var(--apple-surface-2);
}

.skeleton-title {
  width: 42%;
  height: 18px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.skeleton-tile {
  height: 64px;
  border-radius: 18px;
}

.skeleton-line::after,
.skeleton-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: appleSkeletonShimmer 1.4s ease-in-out infinite;
}

html[data-theme="light"] .skeleton-line::after,
html[data-theme="light"] .skeleton-tile::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
}

@keyframes appleSkeletonShimmer {
  to { transform: translateX(100%); }
}

.tab-panel.tab-slide-from-left {
  animation: tabSlideFromLeft 0.28s var(--apple-spring);
}

.tab-panel.tab-slide-from-right {
  animation: tabSlideFromRight 0.28s var(--apple-spring);
}

@keyframes tabSlideFromLeft {
  from { opacity: 0.25; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes tabSlideFromRight {
  from { opacity: 0.25; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 520px) {
  .cam-peek-strip {
    gap: 8px;
  }
  .cam-peek-media {
    width: 60px;
    height: 46px;
  }
  .blind-window-drag {
    width: 62px;
    min-height: 104px;
  }
}

/* ==========================================================================
   v117: Safari 26 / iOS 26 Platform APIs + Live Blinds & Hue + Upgraded Nav
   ========================================================================== */

/* 1. Display-P3 Wide Color Gamut (iPhone OLED & Pro Display XDR) */
@media (color-gamut: p3) {
  :root {
    --apple-blue: color(display-p3 0.04 0.54 1.00);
    --apple-green: color(display-p3 0.16 0.85 0.36);
    --apple-amber: color(display-p3 1.00 0.62 0.04);
    --apple-yellow: color(display-p3 1.00 0.85 0.04);
    --apple-red: color(display-p3 1.00 0.26 0.22);
    --apple-teal: color(display-p3 0.36 0.84 1.00);
    --apple-purple: color(display-p3 0.76 0.34 0.98);
  }

  html[data-theme="light"] {
    --apple-blue: color(display-p3 0.00 0.48 1.00);
    --apple-green: color(display-p3 0.16 0.78 0.34);
    --apple-amber: color(display-p3 1.00 0.56 0.00);
    --apple-red: color(display-p3 1.00 0.22 0.18);
    --apple-teal: color(display-p3 0.00 0.66 0.96);
    --apple-purple: color(display-p3 0.68 0.28 0.92);
  }
}

/* 2. Safari 26 Native Scroll-Driven Header Condense (120Hz ProMotion) */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .top-bar {
      animation: appleHeaderCondense linear both;
      animation-timeline: scroll(root);
      animation-range: 0px 84px;
    }

    .top-bar .brand-logo {
      animation: appleHeaderLogoShrink linear both;
      animation-timeline: scroll(root);
      animation-range: 0px 84px;
    }

    .top-bar .brand-group h1 {
      animation: appleHeaderTitleShrink linear both;
      animation-timeline: scroll(root);
      animation-range: 0px 84px;
    }

    @keyframes appleHeaderCondense {
      from {
        padding: 12px 16px;
        border-radius: 26px;
      }
      to {
        padding: 7px 12px;
        border-radius: 999px;
      }
    }

    @keyframes appleHeaderLogoShrink {
      from {
        width: 42px;
        height: 42px;
      }
      to {
        width: 34px;
        height: 34px;
      }
    }

    @keyframes appleHeaderTitleShrink {
      from {
        font-size: 1.22rem;
      }
      to {
        font-size: 0.98rem;
      }
    }
  }
}

/* 3. CSS View Transitions API (Safari 26 GPU Morphs) */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.24s;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

::view-transition-group(cam-hero) {
  animation-duration: 0.34s;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
  border-radius: 20px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-group(cam-hero) {
    animation-duration: 0.01s !important;
  }
}

/* 4. Picture-in-Picture Camera HUD Button */
.cam-hud-pip-btn {
  position: absolute;
  bottom: 10px;
  right: 48px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 10, 20, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: transform 0.14s var(--apple-spring), background 0.15s ease, border-color 0.15s ease;
}

.cam-hud-pip-btn svg {
  width: 16px;
  height: 16px;
}

.cam-hud-pip-btn:hover {
  background: rgba(56, 189, 248, 0.34);
}

.cam-hud-pip-btn:active {
  transform: scale(0.92);
}

.cam-hud-pip-btn.is-pip {
  background: rgba(10, 132, 255, 0.78);
  border-color: rgba(125, 211, 252, 0.75);
  color: #ffffff;
}

/* 5. Ultra-Smooth 120Hz Live Finger-Tracking Blinds */
.blind-window-drag {
  will-change: transform;
  --blind-open: 0.5;
}

.blind-window-sky {
  opacity: calc(0.28 + var(--blind-open, 0.5) * 0.72);
  transition: opacity 0.14s linear;
}

.blind-window-slats {
  will-change: height;
  transition: height 0.22s var(--apple-spring);
}

.blind-window-drag.is-dragging .blind-window-slats,
.blind-window-drag.is-dragging .blind-window-sky,
.is-live-dragging .blind-visual-fill {
  transition: none !important;
}

.blind-window-drag.is-dragging .blind-window-handle {
  width: 32px;
  height: 4px;
  background: var(--apple-blue);
  box-shadow: 0 0 10px var(--apple-blue);
}

.blind-window-drag.is-dragging .blind-window-pct {
  background: rgba(10, 132, 255, 0.90);
  transform: translateX(-50%) scale(1.08);
}

.blind-window-drag.is-live-syncing .blind-window-pct {
  box-shadow: 0 0 0 2px rgba(100, 210, 255, 0.55);
}

/* 6. Real-Time Live Brightness Dimming Hue Slider */
.apple-hue-bri-bar {
  --bri-pct: 100%;
  --hue-accent: var(--apple-amber);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.apple-hue-bri-bar.is-dimming {
  border-color: var(--hue-accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--hue-accent) 24%, transparent);
}

.apple-hue-bri-bar .hue-bri-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(
    to left,
    var(--hue-accent) 0%,
    var(--hue-accent) var(--bri-pct),
    rgba(255, 255, 255, 0.14) var(--bri-pct),
    rgba(255, 255, 255, 0.14) 100%
  );
  outline: none;
  cursor: pointer;
}

html[data-theme="light"] .apple-hue-bri-bar .hue-bri-slider {
  background: linear-gradient(
    to left,
    var(--hue-accent) 0%,
    var(--hue-accent) var(--bri-pct),
    rgba(60, 60, 67, 0.14) var(--bri-pct),
    rgba(60, 60, 67, 0.14) 100%
  );
}

.apple-hue-bri-bar .hue-bri-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 0.5px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32), 0 0 0 1px rgba(255, 255, 255, 0.65);
  transition: transform 0.16s var(--apple-spring), box-shadow 0.16s ease;
}

.apple-hue-bri-bar.is-dimming .hue-bri-slider::-webkit-slider-thumb {
  transform: scale(1.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.42), 0 0 0 3px color-mix(in srgb, var(--hue-accent) 36%, transparent);
}

.hue-color-orb {
  transition: box-shadow 0.12s linear, opacity 0.12s linear, transform 0.16s var(--apple-spring);
}

/* 7. Upgraded Next-Gen iOS 26 Floating Liquid Glass Main Navigation Bar */
.main-nav,
.mobile-bottom-nav {
  --nav-accent: var(--apple-blue);
  --nav-lens-bg: linear-gradient(180deg, rgba(10, 132, 255, 0.28) 0%, rgba(10, 132, 255, 0.15) 100%);
  --nav-lens-border: rgba(100, 180, 255, 0.42);
  --nav-lens-glow: 0 4px 18px rgba(10, 132, 255, 0.26);
  padding: 5px 6px;
  background: linear-gradient(
    180deg,
    rgba(46, 46, 52, 0.74) 0%,
    rgba(22, 22, 26, 0.84) 100%
  );
  backdrop-filter: blur(50px) saturate(235%) brightness(1.10);
  -webkit-backdrop-filter: blur(50px) saturate(235%) brightness(1.10);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.56),
    inset 0 -0.5px 0 0 rgba(255, 255, 255, 0.12),
    0 22px 48px -8px rgba(0, 0, 0, 0.78);
}

/* Semantic Per-Tab Apple Accent Aura */
.main-nav[data-active-tab="boiler"],
.mobile-bottom-nav[data-active-tab="boiler"] {
  --nav-accent: var(--apple-amber);
  --nav-lens-bg: linear-gradient(180deg, rgba(255, 159, 10, 0.30) 0%, rgba(255, 110, 10, 0.16) 100%);
  --nav-lens-border: rgba(255, 185, 80, 0.46);
  --nav-lens-glow: 0 4px 18px rgba(255, 159, 10, 0.28);
}

.main-nav[data-active-tab="blinds"],
.mobile-bottom-nav[data-active-tab="blinds"] {
  --nav-accent: var(--apple-teal);
  --nav-lens-bg: linear-gradient(180deg, rgba(100, 210, 255, 0.28) 0%, rgba(56, 189, 248, 0.14) 100%);
  --nav-lens-border: rgba(125, 220, 255, 0.44);
  --nav-lens-glow: 0 4px 18px rgba(100, 210, 255, 0.25);
}

.main-nav[data-active-tab="scenarios"],
.mobile-bottom-nav[data-active-tab="scenarios"] {
  --nav-accent: var(--apple-purple);
  --nav-lens-bg: linear-gradient(180deg, rgba(191, 90, 242, 0.30) 0%, rgba(168, 85, 247, 0.15) 100%);
  --nav-lens-border: rgba(215, 145, 255, 0.44);
  --nav-lens-glow: 0 4px 18px rgba(191, 90, 242, 0.26);
}

.main-nav[data-active-tab="settings"],
.mobile-bottom-nav[data-active-tab="settings"] {
  --nav-accent: #e5e5ea;
  --nav-lens-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.10) 100%);
  --nav-lens-border: rgba(255, 255, 255, 0.38);
  --nav-lens-glow: 0 4px 16px rgba(255, 255, 255, 0.12);
}

.nav-glass-lens {
  top: 4px;
  bottom: 4px;
  background: var(--nav-lens-bg);
  border: 0.5px solid var(--nav-lens-border);
  box-shadow:
    inset 0 1px 0 0 rgba(255, 255, 255, 0.62),
    var(--nav-lens-glow);
  transition:
    transform 0.40s cubic-bezier(0.28, 1.18, 0.38, 1),
    width 0.36s var(--apple-spring),
    background 0.26s ease,
    border-color 0.26s ease,
    box-shadow 0.26s ease;
}

.nav-glass-lens.is-scrubbing {
  transition: background 0.18s ease, border-color 0.18s ease;
}

.nav-tab,
.m-nav-item {
  position: relative;
  z-index: 2;
  transition: color 0.22s ease, transform 0.22s var(--apple-spring);
}

.nav-tab.active,
.m-nav-item.active {
  color: var(--nav-accent);
}

.nav-icon-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.28, 1.24, 0.38, 1);
}

.nav-tab .nav-icon-box svg,
.m-nav-item .nav-icon-box svg {
  width: 21px;
  height: 21px;
}

.nav-tab.active .nav-icon-box,
.m-nav-item.active .nav-icon-box {
  transform: translateY(-1px) scale(1.10);
}

/* Mobile Floating Tab Bar Polish */
.mobile-bottom-nav {
  min-height: 62px;
  padding: 5px 6px;
}

.m-nav-item {
  min-height: 50px;
  gap: 3px;
  padding: 4px 2px;
}

.m-nav-item > span:not(.nav-icon-box) {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

/* Live Status Micro-Badges inside Nav Icons */
.nav-live-pill {
  position: absolute;
  top: -5px;
  left: -8px;
  min-width: 16px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--apple-amber);
  color: #1c1c1e;
  font-size: 0.60rem;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.42), 0 0 0 1.5px rgba(24, 24, 28, 0.85);
  pointer-events: none;
}

.nav-live-dot {
  position: absolute;
  top: -2px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(24, 24, 28, 0.85);
  pointer-events: none;
}

.nav-live-dot.boiler-dot {
  background: var(--apple-amber);
  box-shadow: 0 0 8px var(--apple-amber), 0 0 0 1.5px rgba(24, 24, 28, 0.85);
  animation: navBoilerPulse 1.8s ease-in-out infinite;
}

.nav-live-dot.blinds-dot {
  background: var(--apple-teal);
  box-shadow: 0 0 6px rgba(100, 210, 255, 0.7);
}

@keyframes navBoilerPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.28); opacity: 0.76; }
}

/* Light Mode Next-Gen Nav Bar Overrides */
html[data-theme="light"] .main-nav,
html[data-theme="light"] .mobile-bottom-nav {
  --nav-accent: var(--apple-blue);
  --nav-lens-bg: linear-gradient(180deg, rgba(0, 122, 255, 0.16) 0%, rgba(0, 122, 255, 0.08) 100%);
  --nav-lens-border: rgba(0, 122, 255, 0.24);
  --nav-lens-glow: 0 4px 14px rgba(0, 122, 255, 0.12);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.84) 0%,
    rgba(246, 246, 252, 0.78) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 0 #ffffff,
    0 0 0 0.5px rgba(0, 0, 0, 0.08),
    0 16px 38px -8px rgba(0, 0, 0, 0.16);
}

html[data-theme="light"] .main-nav[data-active-tab="boiler"],
html[data-theme="light"] .mobile-bottom-nav[data-active-tab="boiler"] {
  --nav-accent: #d97706;
  --nav-lens-bg: linear-gradient(180deg, rgba(255, 149, 0, 0.18) 0%, rgba(255, 149, 0, 0.09) 100%);
  --nav-lens-border: rgba(255, 149, 0, 0.28);
  --nav-lens-glow: 0 4px 14px rgba(255, 149, 0, 0.14);
}

html[data-theme="light"] .main-nav[data-active-tab="blinds"],
html[data-theme="light"] .mobile-bottom-nav[data-active-tab="blinds"] {
  --nav-accent: #0284c7;
  --nav-lens-bg: linear-gradient(180deg, rgba(14, 165, 233, 0.17) 0%, rgba(14, 165, 233, 0.08) 100%);
  --nav-lens-border: rgba(14, 165, 233, 0.26);
  --nav-lens-glow: 0 4px 14px rgba(14, 165, 233, 0.13);
}

html[data-theme="light"] .main-nav[data-active-tab="scenarios"],
html[data-theme="light"] .mobile-bottom-nav[data-active-tab="scenarios"] {
  --nav-accent: #9333ea;
  --nav-lens-bg: linear-gradient(180deg, rgba(168, 85, 247, 0.16) 0%, rgba(168, 85, 247, 0.08) 100%);
  --nav-lens-border: rgba(168, 85, 247, 0.25);
  --nav-lens-glow: 0 4px 14px rgba(168, 85, 247, 0.12);
}

html[data-theme="light"] .main-nav[data-active-tab="settings"],
html[data-theme="light"] .mobile-bottom-nav[data-active-tab="settings"] {
  --nav-accent: #1c1c1e;
  --nav-lens-bg: linear-gradient(180deg, rgba(60, 60, 67, 0.11) 0%, rgba(60, 60, 67, 0.06) 100%);
  --nav-lens-border: rgba(60, 60, 67, 0.16);
  --nav-lens-glow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .nav-live-pill,
html[data-theme="light"] .nav-live-dot {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16), 0 0 0 1.5px rgba(255, 255, 255, 0.95);
}

/* ==========================================================================
   v118: Apple Wallet / Home Key Guest Pass Admin Modal & Pass Cards (iOS 26)
   ========================================================================== */

.gp-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gp-created-box {
  padding: 15px 16px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--apple-green) 13%, var(--apple-surface-1));
  border: 0.5px solid color-mix(in srgb, var(--apple-green) 38%, transparent);
  box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--apple-green) 24%, transparent);
  margin-bottom: 14px;
}

.gp-created-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--apple-green);
  font-size: 0.94rem;
}

.gp-edit-banner {
  padding: 11px 14px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--apple-blue) 14%, var(--apple-surface-1));
  border: 0.5px solid color-mix(in srgb, var(--apple-blue) 36%, transparent);
  color: var(--apple-label);
}

.gp-door-chip {
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--apple-surface-2);
  border: 0.5px solid var(--apple-sep);
  color: var(--apple-label);
  font-size: 0.84rem;
  font-weight: 600;
  transition: transform 0.18s var(--apple-spring), background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.gp-door-chip:active {
  transform: scale(0.96);
}

.gp-door-chip input {
  accent-color: var(--apple-blue);
}

.gp-door-chip:has(input:checked) {
  background: color-mix(in srgb, var(--apple-blue) 18%, transparent);
  border-color: color-mix(in srgb, var(--apple-blue) 48%, transparent);
  color: var(--apple-label);
}

.gp-pill-btn {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 0.5px solid var(--apple-sep);
  background: var(--apple-surface-2);
  color: var(--apple-label-2);
  font-size: 0.82rem;
  font-weight: 600;
  transition: transform 0.18s var(--apple-spring), background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

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

.gp-pill-btn.active {
  background: var(--apple-blue);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--apple-blue) 42%, transparent);
}

.gp-pill-btn.is-perm-opt.active {
  background: var(--apple-purple);
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--apple-purple) 42%, transparent);
}

.gp-switch-row {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--apple-surface-2);
  border: 0.5px solid var(--apple-sep);
}

/* Apple Wallet Pass Admin Card */
.gp-pass-card {
  position: relative;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--apple-surface-1);
  border: 0.5px solid var(--apple-sep);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: transform 0.2s var(--apple-spring), border-color 0.2s ease;
}

.gp-pass-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 3.5px;
  background: var(--apple-sep-strong);
}

.gp-pass-card.is-active::before {
  background: linear-gradient(180deg, var(--apple-green), var(--apple-teal));
}

.gp-pass-card.is-active.is-permanent::before {
  background: linear-gradient(180deg, var(--apple-purple), var(--apple-blue));
}

.gp-pass-card.is-paused::before {
  background: var(--apple-amber);
}

.gp-pass-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--apple-label);
}

.gp-pass-emblem {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--apple-blue) 16%, transparent);
  color: var(--apple-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gp-pass-emblem.is-perm {
  background: color-mix(in srgb, var(--apple-purple) 18%, transparent);
  color: var(--apple-purple);
}

.gp-pass-emblem svg {
  width: 16px;
  height: 16px;
}

.gp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 999px;
}

.gp-status-badge.active {
  background: color-mix(in srgb, var(--apple-green) 16%, transparent);
  color: var(--apple-green);
}

.gp-status-badge.active.is-perm {
  background: color-mix(in srgb, var(--apple-purple) 18%, transparent);
  color: var(--apple-purple);
}

.gp-status-badge.paused {
  background: color-mix(in srgb, var(--apple-amber) 18%, transparent);
  color: var(--apple-amber);
}

.gp-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 7px currentColor;
}

.gp-door-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--apple-surface-2);
  border: 0.5px solid var(--apple-sep);
  color: var(--apple-label);
}

.gp-door-tag svg {
  width: 13px;
  height: 13px;
  color: var(--apple-blue);
}

.gp-pass-meta {
  font-size: 0.78rem;
  color: var(--apple-label-2);
  font-variant-numeric: tabular-nums;
}

.gp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 600;
  text-decoration: none;
  background: var(--apple-surface-2);
  border: 0.5px solid var(--apple-sep);
  color: var(--apple-label);
  transition: transform 0.16s var(--apple-spring), background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.gp-action-btn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

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

.gp-action-btn.is-primary {
  background: color-mix(in srgb, var(--apple-green) 16%, transparent);
  border-color: color-mix(in srgb, var(--apple-green) 34%, transparent);
  color: var(--apple-green);
}

.gp-action-btn.is-danger:hover {
  background: color-mix(in srgb, var(--apple-red) 16%, transparent);
  border-color: color-mix(in srgb, var(--apple-red) 36%, transparent);
  color: var(--apple-red);
}

.door-quick-btn.guest-pass-btn {
  background: color-mix(in srgb, var(--apple-blue) 14%, var(--apple-surface-1));
  border-color: color-mix(in srgb, var(--apple-blue) 32%, transparent);
  color: var(--apple-label);
}

/* Light Mode Polish for Admin Guest Pass UI */
html[data-theme="light"] .gp-pass-card {
  background: #ffffff;
  border-color: rgba(60, 60, 67, 0.10);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .gp-door-chip,
html[data-theme="light"] .gp-pill-btn,
html[data-theme="light"] .gp-door-tag,
html[data-theme="light"] .gp-action-btn,
html[data-theme="light"] .gp-switch-row {
  background: #f2f2f7;
  border-color: rgba(60, 60, 67, 0.12);
  color: #1c1c1e;
}

html[data-theme="light"] .gp-pill-btn.active {
  background: var(--apple-blue);
  color: #ffffff;
  border-color: transparent;
}

html[data-theme="light"] .gp-pill-btn.is-perm-opt.active {
  background: var(--apple-purple);
  color: #ffffff;
  border-color: transparent;
}

html[data-theme="light"] .gp-door-chip:has(input:checked) {
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.42);
  color: #005ecb;
}

html[data-theme="light"] .gp-created-box {
  background: rgba(36, 138, 61, 0.09);
  border-color: rgba(36, 138, 61, 0.28);
}

html[data-theme="light"] .gp-action-btn.is-primary {
  background: rgba(36, 138, 61, 0.11);
  border-color: rgba(36, 138, 61, 0.28);
  color: #1f7a34;
}

/* v120: Floating Liquid Glass Native ALPHA SH Handoff Pill (iPhone PWA -> Native) */
.native-handoff-pill {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(28, 32, 42, 0.88), rgba(14, 16, 22, 0.94));
  border: 1px solid rgba(10, 132, 255, 0.48);
  backdrop-filter: blur(36px) saturate(220%);
  -webkit-backdrop-filter: blur(36px) saturate(220%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 16px 38px rgba(0, 0, 0, 0.62);
  max-width: calc(100vw - 24px);
}

.native-handoff-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}

.native-handoff-link svg {
  color: var(--apple-blue);
}

.native-handoff-close {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="light"] .native-handoff-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(244, 246, 252, 0.92));
  border-color: rgba(0, 122, 255, 0.34);
  box-shadow: inset 0 1px 0 #ffffff, 0 12px 30px rgba(0, 0, 0, 0.14);
}

html[data-theme="light"] .native-handoff-link {
  color: #007aff;
}

html[data-theme="light"] .native-handoff-close {
  background: rgba(60, 60, 67, 0.10);
  color: #3c3c43;
}

/* v122: Room Header Overflow Fix (long Hebrew names + action pills) & Face ID Enrolled Badge */
.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.room-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.room-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-count {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.room-quick-btns {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
  flex-shrink: 0;
}

.room-quick-btns .mini-pill-btn {
  padding: 5px 10px;
  font-size: 0.74rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.passkey-enrolled-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--apple-green) 16%, transparent);
  border: 0.5px solid color-mix(in srgb, var(--apple-green) 38%, transparent);
  color: var(--apple-green);
  font-size: 0.80rem;
  font-weight: 700;
}

/* v124: 7-Day Boiler Cost Chart, Security Health Center & Eufy Visitor Filter Pills */
.boiler-chart-wrap {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.boiler-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.boiler-chart-bars {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 92px;
}
.boiler-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.boiler-bar-val {
  font-size: 0.66rem;
  font-weight: 700;
  color: rgba(251, 191, 36, 0.92);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.boiler-bar-track {
  width: 100%;
  max-width: 24px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.boiler-bar-fill {
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #fb923c, #ea580c);
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.boiler-bar-day {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}
html[data-theme="light"] .boiler-chart-wrap {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.09);
}
html[data-theme="light"] .boiler-bar-track {
  background: rgba(15, 23, 42, 0.08);
}
html[data-theme="light"] .boiler-bar-val {
  color: #c2410c;
}

.sec-score-pill {
  font-size: 0.76rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.35);
  font-variant-numeric: tabular-nums;
}
.sec-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.sec-health-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 13px;
  font-size: 0.79rem;
  font-weight: 600;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.26);
  color: #a7f3d0;
}
.sec-health-pill.warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fde68a;
}
.sec-ip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sec-ip-chip {
  font-size: 0.74rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  direction: ltr;
}
.sec-lockdown-btn {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(185, 28, 28, 0.36));
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
  font-weight: 700;
}
.sec-lockdown-btn:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.42), rgba(185, 28, 28, 0.52));
}
.cam-sighting-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cam-sighting-chip {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}
.cam-sighting-chip.active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.55);
  color: #e0f2fe;
}
html[data-theme="light"] .sec-health-pill {
  color: #065f46;
}
html[data-theme="light"] .sec-health-pill.warn {
  color: #92400e;
}
html[data-theme="light"] .sec-ip-chip {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .sec-lockdown-btn {
  color: #991b1b;
}

/* v125: Performance Optimization, Airy De-Cluttered Home, Eufy Guard Mode & Upcoming Automations Skip */
.room-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}

.eufy-guard-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.eufy-guard-bar.is-armed {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.38);
}
.guard-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(148, 163, 184, 0.95);
  white-space: nowrap;
  margin-inline-end: 2px;
}
.guard-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.guard-pill-btn:active {
  transform: scale(0.96);
}
.guard-pill-btn.active-home {
  background: rgba(52, 211, 153, 0.2);
  border-color: rgba(52, 211, 153, 0.52);
  color: #a7f3d0;
}
.guard-pill-btn.active-away {
  background: rgba(239, 68, 68, 0.26);
  border-color: rgba(248, 113, 113, 0.62);
  color: #fecaca;
}
.guard-pill-btn.active-disarmed {
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.48);
  color: #e2e8f0;
}
.guard-pill-btn.indoor-privacy {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.36);
  color: #bae6fd;
}
.guard-pill-btn.indoor-armed {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(251, 191, 36, 0.48);
  color: #fde68a;
}
.guard-pill-btn.siren-btn {
  margin-inline-start: auto;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.42);
  color: #fca5a5;
}
.guard-pill-btn.siren-btn.sounding {
  background: #dc2626;
  border-color: #f87171;
  color: #fff;
}

.upcoming-auto-card {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 20px;
}
.upcoming-auto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}
.upcoming-auto-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upcoming-auto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.upcoming-auto-row.is-skipped {
  opacity: 0.62;
  border-style: dashed;
}
.upcoming-auto-row.is-skipped .upcoming-auto-title {
  text-decoration: line-through;
}
.upcoming-auto-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.upcoming-auto-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}
.upcoming-auto-title {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.25;
}
.upcoming-auto-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.upcoming-skip-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: inherit;
  cursor: pointer;
}
.upcoming-skip-btn.is-skipped {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

/* Mobile Airy De-Cluttered Home + Faster GPU Compositing */
@media (max-width: 768px) {
  .stats-grid {
    gap: 7px !important;
    margin-bottom: 10px !important;
  }
  .stats-grid .stat-card {
    padding: 9px 7px !important;
    border-radius: 16px !important;
    gap: 5px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(24, 28, 40, 0.78) !important;
  }
  html[data-theme="light"] .stats-grid .stat-card {
    background: rgba(255, 255, 255, 0.9) !important;
  }
  .stats-grid .stat-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 9px !important;
  }
  .stats-grid .stat-label {
    font-size: 0.68rem !important;
  }
  .stats-grid .stat-val {
    font-size: 0.84rem !important;
  }
  .ai-hub-wrap {
    margin-bottom: 10px !important;
  }
  .cam-peek-strip {
    margin-bottom: 10px !important;
    gap: 8px !important;
  }
  .cam-peek-card {
    padding: 7px 9px !important;
    border-radius: 16px !important;
  }
  .switch-tile {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .room-card {
    padding: 14px 13px !important;
    margin-bottom: 12px !important;
  }
  .cam-peek-badge.low-batt {
    background: rgba(239, 68, 68, 0.88) !important;
    color: #fff !important;
  }
}
html[data-theme="light"] .eufy-guard-bar {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(15, 23, 42, 0.12);
}
html[data-theme="light"] .guard-pill-btn {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.12);
  color: #1e293b;
}
html[data-theme="light"] .guard-pill-btn.active-home {
  color: #065f46;
}
html[data-theme="light"] .guard-pill-btn.active-away {
  color: #991b1b;
}
html[data-theme="light"] .upcoming-auto-row {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.09);
}
