:root {
  --bg: #08090c;
  --bg-2: #12141a;
  --surface: rgba(255, 255, 255, 0.065);
  --surface-solid: #14161b;
  --surface-hover: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #ffffff;
  --muted: #98989f;
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.14);
  --warm: #ffffff;
  --warm-glow: rgba(255, 255, 255, 0.2);
  --green: #ffffff;
  --green-glow: rgba(255, 255, 255, 0.2);
  --red: #ff453a;
  --radius-xl: 26px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 255, 255, 0.06), transparent 60%),
    radial-gradient(700px 450px at 90% 0%, rgba(255, 255, 255, 0.03), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Desktop Sidebar ---------- */
.sidebar {
  width: 248px;
  background: rgba(14, 15, 19, 0.82);
  backdrop-filter: blur(22px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.brand-title { font-weight: 700; font-size: 16px; letter-spacing: -0.3px; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 500; }

.nav-list { display: flex; flex-direction: column; gap: 4px; flex: 1; margin-top: 6px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--text);
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: var(--green); box-shadow: 0 0 10px var(--green); }
.dot-red { background: var(--red); }

.lan-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.lan-box:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.08); }
.lan-box-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.lan-box-url { font-size: 12px; font-weight: 600; color: #e2e8f0; margin-top: 3px; word-break: break-all; }

/* ---------- Main Area ---------- */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 20px 28px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.greeting-wrap h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.greeting-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-right, .row-gap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.content {
  padding: 12px 28px 90px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeSlide 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Summary Strip (Compact Modern Pills) ---------- */
.summary-strip {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.summary-chip {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.summary-chip strong { font-weight: 700; color: #fff; }
.summary-chip.ok { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); color: #e2e8f0; }
.summary-chip.warm { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.1); color: #f1f5f9; }

/* ---------- Buttons & Inputs ---------- */
.btn {
  border: none;
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.16s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 10px; }
.btn-primary {
  background: linear-gradient(135deg, #f8fafc, #cbd5e1);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.3);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.11); }
.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.32);
}
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-ghost { background: transparent; color: #e2e8f0; padding: 6px 10px; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

.icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: all 0.15s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.input {
  width: 100%;
  background: rgba(9, 13, 24, 0.85);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 13px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.input-sm { width: auto; padding: 7px 12px; font-size: 12.5px; }

.card {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
}

.muted { color: var(--muted); font-size: 13px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 14px;
  flex-wrap: wrap;
}
.section-header h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }

/* ---------- Room Filter Pills ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.room-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.room-pills::-webkit-scrollbar { display: none; }

.pill {
  padding: 0 13px;
  height: 34px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  transition: all 0.16s;
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill.active {
  background: #fff;
  color: #090d16;
  border-color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(255, 255, 255, 0.16);
}

.cam-live-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 2px;
}

.cam-view-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.seg-control {
  display: inline-flex;
  align-items: center;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.35);
}

.cam-rotate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.cam-rotate-btn:active { transform: scale(0.95); background: rgba(255, 255, 255, 0.22); }

/* ---------- Scenes Row ---------- */
.scenes-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.scene-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.16s;
}
.scene-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-hover); }
.scene-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }

/* ---------- Cinema Camera Cards ---------- */
.cam-grid { display: grid; gap: 14px; }
.cam-grid.grid-1 { grid-template-columns: 1fr; }
.cam-grid.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cam-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* In 2x2 mode: keep video 100% unobstructed — hide overlay buttons/badges, show tiny clean title strip */
.cam-grid.grid-2 .cam-overlay-top { display: none; }
.cam-grid.grid-2 .cam-actions { display: none; }
.cam-grid.grid-2 .cam-meta { display: none; }
.cam-grid.grid-2 .cam-overlay-bottom {
  padding: 10px 8px 5px;
  background: linear-gradient(to top, rgba(5, 8, 16, 0.88) 0%, transparent 100%);
}
.cam-grid.grid-2 .cam-title {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cam-card {
  position: relative;
  background: #050810;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s, border-color 0.2s;
}
.cam-card:hover { border-color: rgba(255, 255, 255, 0.18); }

.cam-viewport {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  background: #04070f;
}

.cam-viewport img,
.cam-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cam-overlay-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.cam-badge {
  background: rgba(7, 11, 20, 0.68);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.rec-badge { background: rgba(239, 68, 68, 0.92); border-color: transparent; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.cam-overlay-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(5, 8, 16, 0.92) 0%, rgba(5, 8, 16, 0.5) 60%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cam-title { font-weight: 700; font-size: 15px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.cam-meta { font-size: 11.5px; color: rgba(226, 232, 240, 0.78); margin-top: 2px; }

.cam-actions { display: flex; gap: 6px; }
.cam-pill-btn {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  height: 32px;
  padding: 0 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.cam-pill-btn:hover { background: rgba(255, 255, 255, 0.25); }
.cam-pill-btn.recording { background: var(--red); border-color: var(--red); }

/* ---------- Apple Home Style Device Tiles ---------- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
}

.dev-tile {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.dev-tile:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.dev-tile:active { transform: scale(0.96); }

/* Glowing ON state — warm gold for lights, fresh emerald for switches */
.dev-tile.is-on.is-light {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.14);
}
.dev-tile.is-on:not(.is-light) {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 10px 28px rgba(255, 255, 255, 0.14);
}

.dev-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dev-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: all 0.22s;
}
.dev-tile.is-on.is-light .dev-icon-circle {
  background: #f8fafc;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.55);
}
.dev-tile.is-on:not(.is-light) .dev-icon-circle {
  background: #f8fafc;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.55);
}

.dev-more-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.65;
  transition: all 0.15s;
}
.dev-more-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); color: #fff; }

.dev-name {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.3;
  color: var(--text);
}

.dev-status-line {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dev-tile.is-on.is-light .dev-status-line { color: #f1f5f9; font-weight: 600; }
.dev-tile.is-on:not(.is-light) .dev-status-line { color: #e2e8f0; font-weight: 600; }

/* ---------- Scanner, Media, Settings, Logs ---------- */
.scanner-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.scan-summary {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.scan-list { display: flex; flex-direction: column; gap: 10px; }
.scan-item {
  background: rgba(9, 13, 24, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  margin-right: 5px;
  color: var(--muted);
}
.tag-cam { color: #e2e8f0; background: rgba(255, 255, 255, 0.16); }
.tag-dev { color: #e2e8f0; background: rgba(255, 255, 255, 0.16); }

.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; }
.simple-list { display: flex; flex-direction: column; gap: 8px; }
.list-row {
  background: rgba(9, 13, 24, 0.65);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.media-card img, .media-card video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
  display: block;
}
.media-meta {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.logs-box {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.log-row {
  font-size: 12px;
  padding: 9px 12px;
  border-radius: 11px;
  background: rgba(9, 13, 24, 0.65);
  border: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
}
.log-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Modals ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 14, 0.76);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}
.hidden { display: none !important; }
.modal {
  background: #14161c;
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}
.modal-lg { max-width: 840px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.checkbox-field { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }

.preset-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--accent); }
.chip-accent { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); color: #e2e8f0; }

/* Non-Tech Friendly Brand/Type Picker & Quick Scan inside Modals */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gang-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.wizard-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.wizard-step-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

/* Flagship Apple Home / One UI Bottom Sheet Modal */
.sheet-handle {
  display: none;
}
.picker-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.picker-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.picker-link {
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.picker-link:disabled { opacity: 0.55; cursor: default; }

.icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.icon-pick-btn {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 6px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.icon-pick-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.seg-gang {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  padding: 4px;
}
.seg-gang-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 4px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.seg-gang-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.sheet-adv summary {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 0;
}
.sheet-adv summary::after { content: "▾"; font-size: 11px; opacity: 0.7; }
.sheet-adv[open] summary::after { content: "▴"; }

.sheet-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}
.sheet-save-btn {
  padding: 13px 16px;
  font-size: 14.5px;
  border-radius: 14px;
}

/* Pro 2-Step Guided Device Wizard */
@keyframes radarPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  70% { box-shadow: 0 0 0 12px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.radar-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
}
.radar-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.radar-banner.scanning .radar-ring {
  animation: radarPulse 1.5s infinite;
}
.radar-title { font-size: 13.5px; font-weight: 700; color: var(--text); }
.radar-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.wiz-section-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin: 4px 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wiz-list {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
}
.wiz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.14s;
}
.wiz-row:active { background: rgba(255, 255, 255, 0.07); }
.wiz-row + .wiz-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.wiz-row-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.wiz-row-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.wiz-row-name { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-row-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.wiz-chev { font-size: 18px; color: var(--muted); flex-shrink: 0; }

.wiz-manual-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.wiz-manual-btn:active { background: rgba(255, 255, 255, 0.05); color: #fff; }

.wiz-connected-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .sheet-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .sheet-modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 26px 26px 0 0 !important;
    border-bottom: none !important;
    padding: 10px 18px max(22px, env(safe-area-inset-bottom)) !important;
    max-height: 92dvh;
  }
  .sheet-handle {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.22);
    margin: 0 auto 12px;
  }
}
.brand-btn {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 9px 6px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s;
}
.brand-btn.active {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.quick-scan-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}
.quick-scan-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.quick-scan-item:active { transform: scale(0.98); }

.ptz-view {
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
}
.ptz-view img,
.ptz-view video { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Clean Camera Modal Layout */
.cam-modal-clean { padding: 16px 18px 20px; }
.cam-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.cam-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.cam-modal-title-wrap h3 {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cam-modal-head-btns { display: flex; gap: 8px; flex-shrink: 0; }

/* 4-Icon Flagship SVG Action Dock */
.cam-controls-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cam-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cam-strip-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cam-zoom-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px;
  flex-shrink: 0;
}
.z-btn, .z-val {
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  height: 28px;
  border-radius: 99px;
  display: grid;
  place-items: center;
}
.z-btn { width: 30px; font-size: 15px; color: var(--muted); }
.z-btn:active { background: rgba(255, 255, 255, 0.12); color: #fff; }
.z-val { padding: 0 9px; font-size: 12px; color: #e2e8f0; min-width: 44px; }

.cam-dock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.dock-btn {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px 4px 10px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.dock-btn:active { transform: scale(0.95); }
.dock-btn.active { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.5); color: #e2e8f0; }
.dock-btn.danger-active { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
.dock-svg { display: grid; place-items: center; line-height: 1; }

/* Sleek Circular PTZ Radial Wheel (Imou / Apple Home style) */
.ptz-wheel-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 0 4px;
}
.ptz-wheel-wrap.no-ptz { display: none; }
.ptz-wheel {
  position: relative;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 14px 32px rgba(0, 0, 0, 0.45);
}
.wheel-dir {
  position: absolute;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: all 0.12s;
}
.wheel-dir:active,
.wheel-dir.holding {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
  transform: scale(0.92);
}
.wheel-up { top: 6px; left: 50%; transform: translateX(-50%); }
.wheel-up:active, .wheel-up.holding { transform: translateX(-50%) scale(0.92); }
.wheel-down { bottom: 6px; left: 50%; transform: translateX(-50%); }
.wheel-down:active, .wheel-down.holding { transform: translateX(-50%) scale(0.92); }
.wheel-left { left: 6px; top: 50%; transform: translateY(-50%); }
.wheel-left:active, .wheel-left.holding { transform: translateY(-50%) scale(0.92); }
.wheel-right { right: 6px; top: 50%; transform: translateY(-50%); }
.wheel-right:active, .wheel-right.holding { transform: translateY(-50%) scale(0.92); }

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
  transition: all 0.12s;
}
.wheel-center:active { transform: translate(-50%, -50%) scale(0.93); background: var(--accent); color: #fff; }

@media (max-width: 860px) {
  .cam-viewer-backdrop {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .cam-modal-clean {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    padding: max(14px, env(safe-area-inset-top)) 16px max(22px, env(safe-area-inset-bottom)) !important;
    display: flex;
    flex-direction: column;
    background: #090a0d;
  }
  .cam-modal-clean .ptz-view {
    margin: 4px -16px 16px;
    border-radius: 0;
    aspect-ratio: 16 / 9;
    flex: none;
  }
  .cam-controls-body {
    flex: 1;
    justify-content: flex-start;
  }
  .ptz-wheel-wrap {
    margin: auto 0;
  }
}
.dpad-circle {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 8px;
}
.dpad-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: all 0.1s;
}
.dpad-btn:active,
.dpad-btn.holding { transform: scale(0.92); background: var(--accent); border-color: var(--accent); color: #fff; }
.dpad-home { border-radius: 50%; background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.4); }

.cam-side-panel { display: flex; flex-direction: column; gap: 10px; }
.zoom-card, .motion-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}
.zoom-card-label { font-size: 11px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.zoom-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }

.pb-clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 8px;
}
.pb-clip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: all 0.14s;
}
.pb-clip-btn span:last-child { font-size: 10.5px; color: var(--muted); font-weight: 400; }
.pb-clip-btn:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.45); }
.pb-clip-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pb-clip-btn.active span:last-child { color: rgba(255, 255, 255, 0.85); }

/* ---------- Non-Tech Friendly Settings Layout ---------- */
.settings-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}
.set-card {
  padding: 16px;
}
.health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  white-space: nowrap;
  flex-shrink: 0;
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.health-pill {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.health-lbl {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.health-pill strong {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.health-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.health-meta {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.health-clean-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
.set-head {
  margin-bottom: 14px;
}
.set-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.set-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.4;
}
.set-group {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}
.set-row + .set-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.set-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.set-row-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.set-row-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.set-right-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.set-time-input {
  width: 86px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border-radius: 10px;
}
.btn-full {
  width: 100%;
  justify-content: center;
}
.set-btn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.set-btn-grid .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  padding: 10px 12px;
}
.set-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.set-card-head h2 { font-size: 15.5px; font-weight: 700; margin-bottom: 3px; }

/* Modern Non-Tech Scenes, Automations & Rooms */
.scene-sub-tabs {
  grid-template-columns: repeat(3, 1fr);
}
.scene-sub { display: none; }
.scene-sub.active { display: block; animation: fadeSlide 0.16s ease; }

/* Automations — Unified 2-Column Apple Home Tile Grid */
.auto-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.auto-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 13px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s, border-color 0.14s, opacity 0.14s;
}
.auto-card:active { transform: scale(0.97); }
.auto-card.is-off { opacity: 0.52; }
.auto-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.auto-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.auto-card-icon.is-2way {
  background: rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
}
.auto-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.auto-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.auto-card-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.auto-flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.auto-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
}
.auto-chip.is-src {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.35);
  color: #f1f5f9;
}
.auto-arrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.auto-step-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auto-step-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding-left: 2px;
}
.auto-select {
  height: 46px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 14px;
}
.auto-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}
.auto-seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.16s;
}
.auto-seg-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.28);
}
.auto-hint {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
  padding: 0 2px;
}
.auto-extra-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.auto-pill-btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.auto-pill-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: #f8fafc;
  color: #fff;
}

/* Fullscreen Native App Step-by-Step Page Modal */
.full-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #090a0d;
  display: flex;
  justify-content: center;
}
.full-modal-backdrop.hidden { display: none !important; }
.full-modal {
  width: 100%;
  max-width: 560px;
  height: 100dvh;
  background: #090a0d;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.full-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.full-head-center {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.full-step-badge {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.2px;
}
.full-head-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.full-progress {
  width: 120px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.full-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f8fafc, #e2e8f0);
  border-radius: 99px;
  transition: width 0.24s ease;
}
.full-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.full-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeSlide 0.18s ease;
}
.full-step.hidden { display: none !important; }
.full-hero {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.full-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.25;
}
.full-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.45;
}
.full-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.choice-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.choice-card {
  width: 100%;
  min-height: 132px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: all 0.16s;
}
.choice-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.choice-card:active { transform: scale(0.97); }
.choice-card.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: #f8fafc;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.16);
}
.choice-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.choice-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.choice-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}
.choice-card-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
}
.choice-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.16s;
}
.choice-card.active .choice-radio {
  border-color: #f8fafc;
  background: #f8fafc;
}
.choice-card.active .choice-radio::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}
.full-footer {
  padding: 12px 18px max(18px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(7, 11, 20, 0.96);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.full-footer .btn-primary {
  height: 50px;
  font-size: 15.5px;
  font-weight: 700;
  border-radius: 15px;
}
.full-footer .btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Unified 2-Column Tile Grid for All Pickers & Wizards (Zero Clipped Text) */
.full-pick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pick-tile {
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 13px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: transform 0.14s, background 0.14s, border-color 0.14s;
}
.pick-tile:active { transform: scale(0.97); }
.pick-tile.selected {
  background: rgba(255, 255, 255, 0.13);
  border-color: #f8fafc;
}
.pick-tile.selected-on {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.65);
}
.pick-tile.selected-off {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.55);
}
.pick-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pick-tile-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.pick-tile-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pick-tile-sub {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick-tile.selected .pick-row-ic {
  background: rgba(255, 255, 255, 0.22);
  color: #e2e8f0;
}
.pick-tile.selected .pick-check {
  background: #f8fafc;
  border-color: #f8fafc;
  color: #ffffff;
}
.pick-tile .scene-tri {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.pick-tile .scene-tri-btn {
  padding: 7px 6px;
  text-align: center;
}

/* Apple Photos Style People & Faces Gallery */
.face-quick-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.face-act-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s;
}
.face-act-btn:active { transform: scale(0.97); }
.face-act-btn.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.28);
}
.face-sec {
  margin-bottom: 20px;
}
.face-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}
.face-sec-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.face-clear-link {
  border: none;
  background: transparent;
  color: #f87171;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.person-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: #0a1020;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.person-portrait:active { transform: scale(0.97); }
.person-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.person-portrait-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 12px 11px;
  background: linear-gradient(to top, rgba(4, 7, 15, 0.92) 0%, rgba(4, 7, 15, 0.45) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}
.person-portrait-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.person-portrait-count {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  padding: 3px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}
.person-detail-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.person-detail-img {
  display: block;
  aspect-ratio: 1 / 1;
  background: #04070f;
  overflow: hidden;
}
.person-detail-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.person-detail-del {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: #fca5a5;
  font-size: 12.5px;
  font-weight: 600;
  padding: 10px 8px;
  cursor: pointer;
}
.person-detail-del:active { background: rgba(239, 68, 68, 0.16); }

/* Scan & Wizard Existing Grids — 2-Column Tiles */
.wiz-list, .scan-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wiz-tile {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 104px;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}
.wiz-tile:active { transform: scale(0.97); }
.wiz-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

/* Scene Wizard 3-State Row & Color Swatches */
.scene-act-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
}
.scene-act-row + .scene-act-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.scene-tri {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.scene-tri-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.14s;
}
.scene-tri-btn.is-on {
  background: #f8fafc;
  color: #ffffff;
}
.scene-tri-btn.is-off {
  background: #ef4444;
  color: #fff;
}
.color-swatches {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}
.color-swatch.active {
  border-color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

/* Weather Strip & Detail Sheet (Apple Home / One UI Dark) */
.weather-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(15, 23, 42, 0.72) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.weather-strip:active { transform: scale(0.985); }
.weather-strip-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.weather-strip-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
}
.weather-strip-temp {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: #fff;
  flex-shrink: 0;
}
.weather-strip-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.weather-strip-cond {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-strip-city {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.weather-strip-sub {
  font-size: 11.5px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
}

.weather-modal {
  max-height: 88vh;
  overflow-y: auto;
}
.weather-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  margin-bottom: 12px;
}
.weather-hero-icon {
  font-size: 52px;
  line-height: 1;
  flex-shrink: 0;
}
.weather-hero-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.weather-hero-temp {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: #fff;
}
.weather-hero-cond {
  font-size: 14.5px;
  font-weight: 600;
  color: #e2e8f0;
}
.weather-hero-hl {
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 600;
}
.weather-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.weather-metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 9px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.weather-metric span {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.weather-metric strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.weather-sec-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 12px 0 8px 2px;
}
.weather-hourly {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.weather-hourly::-webkit-scrollbar { display: none; }
.weather-hour-item {
  flex: 0 0 68px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 9px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.weather-hour-time {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.weather-hour-ic { font-size: 20px; line-height: 1.1; }
.weather-hour-temp { font-size: 13.5px; font-weight: 700; color: #fff; }
.weather-hour-rain { font-size: 10.5px; color: #e2e8f0; font-weight: 600; }

.weather-daily {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
}
.weather-day-row {
  display: grid;
  grid-template-columns: 78px 30px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.weather-day-row + .weather-day-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.weather-day-name { font-weight: 600; color: var(--text); white-space: nowrap; }
.weather-day-ic { font-size: 18px; text-align: center; }
.weather-day-desc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.weather-day-temps {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
}
.weather-day-temps span { color: var(--muted); font-weight: 500; margin-right: 6px; }

.weather-city-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.weather-chip {
  padding: 6px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.weather-chip:active { background: rgba(255, 255, 255, 0.25); border-color: rgba(255, 255, 255, 0.5); }

@media (max-width: 420px) {
  .weather-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Remote Tunnel Link Box inside Settings Health Card */
.remote-link-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  margin-top: 12px;
  margin-bottom: 0;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.remote-link-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.remote-link-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.remote-link-url {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.remote-link-box .btn {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 7px 12px;
}

/* Clean 1-Column iOS / One UI Pick List (Zero Text Clipping) */
.pick-list {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}
.pick-row {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.14s;
}
.pick-row + .pick-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.pick-row:active {
  background: rgba(255, 255, 255, 0.06);
}
.pick-row.selected {
  background: rgba(255, 255, 255, 0.09);
}
.pick-row-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}
.pick-row-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.pick-row.selected .pick-row-ic {
  background: rgba(255, 255, 255, 0.2);
  color: #e2e8f0;
}
.pick-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pick-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick-row-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.8px solid rgba(255, 255, 255, 0.24);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: transparent;
  flex-shrink: 0;
  transition: all 0.15s;
}
.pick-row.selected .pick-check {
  background: #f8fafc;
  border-color: #f8fafc;
  color: #ffffff;
}

.scene-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.scene-preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.14s;
}
.scene-preset-row:active { background: rgba(255, 255, 255, 0.06); }
.scene-preset-row + .scene-preset-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.scene-preset-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.scene-preset-plus {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.scene-tile {
  position: relative;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s, border-color 0.14s;
}
.scene-tile:active { transform: scale(0.97); }
.scene-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.scene-tile-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #fff;
}
.scene-tile-del {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: grid;
  place-items: center;
}
.scene-tile-del:hover { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.scene-tile-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.25; }
.scene-tile-sub { font-size: 11.5px; color: var(--muted); }

.suggest-wrap { margin-top: 12px; }
.suggest-label { font-size: 11.5px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.suggest-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.suggest-pill {
  background: rgba(255, 255, 255, 0.1);
  border: 1px dashed rgba(255, 255, 255, 0.42);
  color: #f1f5f9;
  padding: 7px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s;
}
.suggest-pill:active { transform: scale(0.96); background: rgba(255, 255, 255, 0.24); }

.room-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.room-add-row .input { flex: 1; min-width: 0; }
.room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.room-card {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s, border-color 0.14s;
}
.room-card:hover { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.08); }
.room-card:active { transform: scale(0.97); }
.room-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.room-card-ic {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
  display: grid;
  place-items: center;
}
.room-card-info { min-width: 0; }
.room-card-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.room-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.room-pick-all {
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.room-chip-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.room-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.room-chip-from {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.switch-chk {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.3);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s;
}
.switch-chk::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s;
}
.switch-chk:checked { background: var(--green); }
.switch-chk:checked::after { transform: translateX(20px); }

.adv-box {
  background: rgba(9, 13, 24, 0.55);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 14px;
}
.adv-box summary {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.adv-box summary::after { content: "▾"; font-size: 12px; opacity: 0.7; }
.adv-box[open] summary::after { content: "▴"; }

/* ---------- Modern Storage Sub-Tabs & Photo Cards ---------- */
.storage-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 5px;
  margin-bottom: 16px;
}
.storage-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s;
}
.storage-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}
.media-sub { display: none; }
.media-sub.active { display: block; animation: fadeSlide 0.18s ease; }

.sub-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.sub-label.warn { color: #fca5a5; }
.sub-label.ok { color: #e2e8f0; }

.face-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.snap-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.snap-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.snap-filters::-webkit-scrollbar { display: none; }
.snap-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.snap-chip.active {
  background: #fff;
  color: #0b1120;
  border-color: #fff;
}
.snap-refresh-btn { flex-shrink: 0; padding: 6px 11px; }

.snap-date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 14px 2px 8px;
}
.snap-date-head:first-child { margin-top: 2px; }
.snap-date-count {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
@media (max-width: 640px) {
  .cam-grid.grid-1 {
    margin: 0 -16px;
    gap: 10px;
  }
  .cam-grid.grid-1 .cam-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .cam-grid.grid-2 {
    margin: 0 -16px;
    gap: 2px;
  }
  .cam-grid.grid-2 .cam-card {
    border-radius: 0;
    border: none;
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin: 0 -14px;
  }
  .photo-grid .photo-card {
    border-radius: 8px;
  }
  #recordingsGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 -16px;
  }
  #recordingsGrid .photo-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .face-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.photo-card.clickable {
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}
.photo-card.clickable:active { transform: scale(0.97); }
.photo-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #04070f;
  overflow: hidden;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-tag {
  position: absolute;
  top: 7px;
  left: 7px;
  background: rgba(255, 255, 255, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
}
.photo-caption {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.photo-info {
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.photo-title { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-time { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }

/* Built-in Fullscreen Photo Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 7, 15, 0.96);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  padding: 14px 14px max(18px, env(safe-area-inset-bottom));
}
.lightbox.hidden { display: none; }
.lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
}
.lightbox-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lightbox-stage {
  flex: 1;
  min-height: 0;
  margin: 0 -14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}
.lightbox-stage img {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.lightbox-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-top: 12px;
}
.lightbox-bar .btn {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  padding: 10px 6px;
}
.photo-btns { display: flex; gap: 4px; flex-shrink: 0; }
.mini-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.mini-icon-btn.del { color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.12); }

/* CSS Fallback Landscape Mode for Mobile (Single Cam & 2x2 Grid) */
.ptz-view.landscape-fallback {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  height: 100vw !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  border-radius: 0 !important;
  z-index: 9999 !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
}
.cam-grid-stage:fullscreen,
.cam-grid-stage.grid-landscape-fallback {
  background: #000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cam-grid-stage.grid-landscape-fallback {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  height: 100vw !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  z-index: 9999 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.cam-grid-stage:fullscreen .cam-grid.grid-2,
.cam-grid-stage.grid-landscape-fallback .cam-grid.grid-2 {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  gap: 2px !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
}
.cam-grid-stage:fullscreen .cam-card,
.cam-grid-stage.grid-landscape-fallback .cam-card {
  border-radius: 0 !important;
  border: none !important;
  height: 100% !important;
}
.cam-grid-stage:fullscreen .cam-video-wrap,
.cam-grid-stage.grid-landscape-fallback .cam-video-wrap {
  aspect-ratio: auto !important;
  height: 100% !important;
}
.cam-grid-stage:fullscreen #exitGridFsBtn,
.cam-grid-stage.grid-landscape-fallback #exitGridFsBtn {
  position: absolute !important;
  bottom: 14px !important;
  right: 14px !important;
}

.empty-state {
  text-align: center;
  padding: 36px 18px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  font-size: 13.5px;
}

/* ---------- Toasts (Sleek Compact Pill) ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}
.toast {
  background: rgba(20, 22, 27, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  text-align: center;
  max-width: 100%;
  pointer-events: auto;
}
.toast.ok { border-color: rgba(255, 255, 255, 0.5); }
.toast.err { border-color: rgba(239, 68, 68, 0.55); color: #fecaca; }

/* Rich iOS-style AI Alert Notification Banner */
.alert-banner {
  background: rgba(18, 20, 25, 0.94);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(350px, calc(100vw - 24px));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  cursor: pointer;
  text-align: left;
  animation: fadeSlide 0.22s ease;
}
.alert-banner.stranger { border-color: rgba(255, 255, 255, 0.55); }
.alert-banner.family { border-color: rgba(255, 255, 255, 0.55); }
.alert-thumb {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}
.alert-body { flex: 1; min-width: 0; }
.alert-title { font-size: 12.5px; font-weight: 700; color: #fff; display: flex; justify-content: space-between; gap: 6px; }
.alert-time { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.alert-desc { font-size: 12px; color: #cbd5e1; margin-top: 2px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Mobile Floating Bottom Navigation ---------- */
.bottom-nav { display: none; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .topbar { padding: 18px 16px 8px; }
  .greeting-wrap h1 { font-size: 22px; }
  .content { padding: 10px 16px 112px; }
  .device-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dev-tile { min-height: 124px; padding: 14px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 64px;
    background: rgba(18, 20, 25, 0.88);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 6px;
    justify-content: space-around;
    align-items: center;
    z-index: 60;
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.55);
  }
  .bottom-nav-btn {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .bottom-nav-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
  }
}

/* Chung Home brand logo */
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: block;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.35);
}

/* ================= Chung Home — Simple Settings Menu & Pages ================= */
.set-menu { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.menu-group {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.menu-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  min-height: 56px;
}
.menu-row + .menu-row,
.menu-group > .set-row + .set-row,
.menu-group > .info-row + .info-row { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.menu-row:active { background: rgba(255, 255, 255, 0.04); }
.menu-ic {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}
.menu-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-title { font-size: 15px; font-weight: 600; }
.menu-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-chev { color: var(--muted); font-size: 20px; line-height: 1; flex-shrink: 0; }
.menu-row.is-danger { justify-content: center; }
.menu-row.is-danger .menu-text { align-items: center; }
.menu-row.is-danger .menu-title { color: #f87171; }

.set-page { max-width: 640px; display: flex; flex-direction: column; gap: 16px; animation: fadeSlide 0.16s ease; }
.set-page .form-stack { gap: 14px; }
.page-back-btn {
  background: transparent;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 0 0 4px;
  cursor: pointer;
  display: block;
}
.page-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.page-hero-sub { font-size: 13px; color: var(--muted); }
.page-note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-size: 15px;
}
.info-row span { color: var(--muted); }
.info-row strong { font-weight: 600; }
.set-page .remote-link-box { margin-top: 0; }
.menu-group .set-row { padding: 14px 16px; }

/* ================= Weather — calm, single focus ================= */
.weather-strip {
  background: var(--surface-solid);
  border: 1px solid var(--border);
}
.weather-modal { max-width: 440px; padding: 18px 18px 14px; }
.weather-modal .modal-header { margin-bottom: 4px; }
.w-city-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 0;
  min-width: 0;
}
.w-city-btn span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-city-chev { color: var(--muted); font-weight: 400; font-size: 20px; }
.w-hero { text-align: center; padding: 8px 0 18px; }
.w-hero-icon { font-size: 52px; line-height: 1.1; }
.w-hero-temp { font-size: 64px; font-weight: 300; letter-spacing: -2px; line-height: 1; margin-top: 4px; }
.w-hero-cond { font-size: 16px; font-weight: 600; margin-top: 6px; }
.w-hero-hl { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.w-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 12px;
}
.w-stat { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px; }
.w-stat + .w-stat { border-left: 1px solid rgba(255, 255, 255, 0.06); }
.w-stat span { font-size: 12px; color: var(--muted); }
.w-stat strong { font-size: 16px; font-weight: 600; }
.w-card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.w-card-title { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.w-hourly { display: flex; justify-content: space-between; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.w-hourly::-webkit-scrollbar { display: none; }
.w-hour { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 40px; }
.w-hour-time { font-size: 12px; color: var(--muted); }
.w-hour-ic { font-size: 20px; line-height: 1; }
.w-hour-temp { font-size: 14.5px; font-weight: 600; }
.w-day {
  display: grid;
  grid-template-columns: 1fr 32px 44px 76px;
  align-items: center;
  padding: 9px 0;
  font-size: 14.5px;
}
.w-day + .w-day { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.w-day-name { font-weight: 500; white-space: nowrap; }
.w-day-ic { font-size: 18px; text-align: center; }
.w-day-rain { font-size: 12px; color: #e2e8f0; text-align: center; font-weight: 600; }
.w-day-temps { text-align: right; font-weight: 600; white-space: nowrap; }
.w-day-temps span { color: var(--muted); font-weight: 400; margin-right: 10px; }
.w-updated { text-align: center; font-size: 11.5px; color: var(--muted); padding-top: 2px; }
/* ================= Weather Top Position & Fullscreen Screen ================= */
.weather-top-wrap {
  padding: 16px 24px 0;
  cursor: pointer;
}
.weather-top-wrap .weather-strip {
  margin-bottom: 0;
}
.weather-top-wrap:not(.hidden) + .topbar {
  padding-top: 12px;
}
@media (max-width: 860px) {
  .weather-top-wrap {
    padding: max(14px, env(safe-area-inset-top)) 16px 0;
  }
  .weather-top-wrap:not(.hidden) + .topbar {
    padding-top: 10px;
  }
}

.weather-backdrop {
  padding: 0 !important;
  background: var(--bg);
  backdrop-filter: none;
  display: block;
}
.weather-backdrop .weather-modal {
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background:
    radial-gradient(640px 420px at 50% -60px, rgba(255, 255, 255, 0.08), transparent 70%),
    var(--bg);
  padding: max(16px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
}
.w-shell {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.w-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.weather-backdrop .w-hero {
  padding: 18px 0 26px;
}
.weather-backdrop .w-hero-icon {
  font-size: 62px;
}
.weather-backdrop .w-hero-temp {
  font-size: 76px;
}
.weather-backdrop .w-stats {
  margin-bottom: 14px;
}
.weather-backdrop .w-card {
  margin-bottom: 14px;
  padding: 14px 16px;
}
.weather-backdrop .w-updated {
  margin-top: auto;
  padding-top: 12px;
}

/* ================= ColorOS / iOS 18 Theme Layer ================= */
/* 10/10 iOS 26 Liquid Glass — Layered Silver-Obsidian Depth & Specular Crystal Pills */

@keyframes glassPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

body {
  background:
    radial-gradient(520px 380px at 12% -4%, rgba(255, 255, 255, 0.14), transparent 64%),
    radial-gradient(460px 360px at 88% 12%, rgba(220, 226, 240, 0.09), transparent 62%),
    radial-gradient(560px 420px at 50% 96%, rgba(255, 255, 255, 0.075), transparent 66%),
    linear-gradient(180deg, #0b0c10 0%, #050608 55%, #090a0e 100%);
  background-attachment: fixed;
  color: #ffffff;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Crisp Tabular Numerals for Temps, Clocks & Stats */
.weather-pill-temp,
.w-hero-temp,
.w-stat strong,
.w-hour-temp,
.w-day-temps,
.info-row strong {
  font-variant-numeric: tabular-nums;
}

/* Header & Navigation Bar */
.topbar {
  gap: 10px;
  padding-top: max(18px, env(safe-area-inset-top));
}
.greeting-wrap { min-width: 0; flex: 1; }
.greeting-wrap h1 {
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.65px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.page-back-btn {
  color: rgba(255, 255, 255, 0.76);
  font-weight: 600;
  letter-spacing: -0.2px;
  transition: opacity 0.15s;
}
.page-back-btn:active { opacity: 0.5; }

/* Desktop Sidebar — Smoked Liquid Glass */
.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.025) 100%);
  backdrop-filter: saturate(180%) blur(32px);
  -webkit-backdrop-filter: saturate(180%) blur(32px);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}
.brand-title { color: #ffffff; font-weight: 700; letter-spacing: -0.4px; }
.brand-sub { color: rgba(255, 255, 255, 0.48); }
.nav-item { color: rgba(255, 255, 255, 0.58); border-radius: 999px; transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.nav-item.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.19) 0%, rgba(255, 255, 255, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 6px 18px rgba(0, 0, 0, 0.28);
  color: #ffffff;
}
.lan-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}
.lan-box-url { color: #ffffff; }

/* ---- 10/10 LIQUID GLASS PILL BUTTONS ---- */
.btn,
.icon-btn,
.weather-pill,
.room-pill,
.snap-chip,
.cam-rotate-btn,
.face-act-btn,
.dock-btn,
.z-btn,
.dpad-btn,
.wheel-center,
.brand-btn,
.gang-btn,
.pb-clip-btn {
  border-radius: 999px !important;
  backdrop-filter: saturate(190%) blur(26px) !important;
  -webkit-backdrop-filter: saturate(190%) blur(26px) !important;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}
.btn:active,
.icon-btn:active,
.weather-pill:active,
.room-pill:active,
.snap-chip:active,
.cam-rotate-btn:active,
.face-act-btn:active,
.dock-btn:active,
.brand-btn:active,
.gang-btn:active {
  transform: scale(0.94);
}

/* Standard Crystal Translucent Glass (Secondary, Icons, Weather Pill, Room Pills) */
.btn-secondary,
.icon-btn,
.weather-pill,
.room-pill,
.snap-chip,
.cam-rotate-btn,
.face-act-btn,
.dock-btn,
.z-btn,
.dpad-btn,
.wheel-center,
.brand-btn,
.gang-btn,
.pb-clip-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.04) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.28),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.05),
    0 6px 20px rgba(0, 0, 0, 0.32) !important;
}
.btn-secondary:hover,
.icon-btn:hover,
.weather-pill:hover,
.cam-rotate-btn:hover,
.dock-btn:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

/* Primary Liquid Glass CTA — Bright Frosted Crystal (NOT heavy solid flat white!) */
.btn-primary,
.face-act-btn.is-primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.12) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.54),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.38) !important;
}
.btn-primary:hover,
.face-act-btn.is-primary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.18) 100%) !important;
  border-color: rgba(255, 255, 255, 0.56) !important;
}

/* Active Selection Pills — Crisp Frosted Pearl (instant visual clarity) */
.room-pill.active,
.snap-chip.active,
.brand-btn.active,
.gang-btn.active,
.pb-clip-btn.active,
.dock-btn.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(232, 236, 244, 0.86) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.96) !important;
  color: #08090c !important;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 6px 20px rgba(255, 255, 255, 0.16) !important;
}
.pb-clip-btn.active span:last-child { color: rgba(8, 9, 12, 0.65) !important; }

.btn-ghost { color: rgba(255, 255, 255, 0.82) !important; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09) !important; }

/* Smoked Red Glass Danger Pill */
.btn-danger {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.2) 0%, rgba(255, 69, 58, 0.08) 100%) !important;
  border: 1px solid rgba(255, 69, 58, 0.36) !important;
  color: #ff6961 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 6px 18px rgba(0, 0, 0, 0.28) !important;
}
.btn-danger:hover { background: rgba(255, 69, 58, 0.3) !important; color: #ffffff !important; }

/* Equal-Height Topbar Glass Pills */
.topbar-right .btn-sm,
.weather-pill {
  height: 36px;
  padding: 0 13px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.weather-pill-ic { font-size: 15px; line-height: 1; }
.weather-pill-temp { letter-spacing: -0.3px; font-weight: 700; }

/* Segmented Controls — Liquid Glass Track + Specular Capsule */
.seg-control,
.storage-tabs {
  background: rgba(255, 255, 255, 0.055) !important;
  backdrop-filter: saturate(190%) blur(26px);
  -webkit-backdrop-filter: saturate(190%) blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 999px !important;
  padding: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.seg-btn,
.storage-tab {
  color: rgba(255, 255, 255, 0.56);
  border-radius: 999px !important;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.seg-btn.active,
.storage-tab.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.11) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.4), 0 4px 14px rgba(0, 0, 0, 0.28) !important;
}

/* Inputs — Deep Recessed Smoked Glass */
.input {
  background: rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  color: #ffffff;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.input::placeholder { color: rgba(255, 255, 255, 0.36); }
.input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* ---- 10/10 DEVICE TILES: Tactile Glass Depth & Luminous ON State ---- */
.dev-tile {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: saturate(190%) blur(26px);
  -webkit-backdrop-filter: saturate(190%) blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03),
    0 10px 28px rgba(0, 0, 0, 0.32);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.dev-tile:active { transform: scale(0.96); }
.dev-tile .dev-icon-circle {
  width: 42px;
  height: 42px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.62);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.dev-tile .dev-name {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.25px;
}
.dev-tile .dev-status-line {
  color: rgba(255, 255, 255, 0.48);
  font-size: 12.5px;
}
.dev-tile .dev-more-btn { color: rgba(255, 255, 255, 0.45); }

/* Luminous Pearl-Glass ON Tile */
.dev-tile.is-on,
.dev-tile.is-on.is-light,
.dev-tile.is-on:not(.is-light) {
  background:
    radial-gradient(150px 120px at 18% 18%, rgba(255, 255, 255, 0.24), transparent 72%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.19) 0%, rgba(255, 255, 255, 0.08) 100%) !important;
  border-color: rgba(255, 255, 255, 0.42) !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    0 14px 34px rgba(255, 255, 255, 0.09),
    0 10px 26px rgba(0, 0, 0, 0.35) !important;
}
.dev-tile.is-on .dev-icon-circle,
.dev-tile.is-on.is-light .dev-icon-circle,
.dev-tile.is-on:not(.is-light) .dev-icon-circle {
  background: linear-gradient(180deg, #ffffff 0%, #e5e8f0 100%) !important;
  border: 1px solid #ffffff !important;
  color: #08090c !important;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.52), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.dev-tile.is-on .dev-status-line,
.dev-tile.is-on.is-light .dev-status-line,
.dev-tile.is-on:not(.is-light) .dev-status-line {
  color: rgba(255, 255, 255, 0.94) !important;
  font-weight: 600;
}

/* Unified Liquid Glass Cards & Groups */
.card,
.scene-tile,
.auto-card,
.room-card,
.person-card,
.unknown-face-card,
.photo-card,
.pick-tile,
.choice-card,
.scan-row,
.menu-group,
.cam-card,
.remote-link-box,
.radar-banner,
.wiz-manual-btn,
.full-summary-bar,
.pick-list,
.toggle-row,
.log-row {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.028) 100%) !important;
  backdrop-filter: saturate(185%) blur(26px);
  -webkit-backdrop-filter: saturate(185%) blur(26px);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.2), 0 10px 28px rgba(0, 0, 0, 0.28) !important;
  color: #ffffff;
}
.menu-group { border-radius: 22px; }
.cam-card { border-radius: 24px; overflow: hidden; }
.scene-tile-icon,
.auto-card-icon,
.room-card-ic,
.pick-row-ic,
.menu-ic {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
  color: #ffffff !important;
}
.pick-tile.selected,
.choice-card.active {
  border-color: rgba(255, 255, 255, 0.46) !important;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.07) 100%) !important;
}
.pick-tile.selected .pick-check {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #08090c !important;
}
.choice-tag, .tag-cam, .tag-dev, .chip-accent, .health-badge {
  background: rgba(255, 255, 255, 0.11) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  border-radius: 999px;
}
.remote-link-lbl { color: rgba(255, 255, 255, 0.6); }
.remote-link-url { color: #ffffff; }
.dot-green { background: #ffffff; box-shadow: 0 0 8px rgba(255, 255, 255, 0.8); }

/* Settings Rows */
.menu-row { min-height: 58px; transition: background 0.15s ease; }
.menu-row + .menu-row,
.menu-group > .set-row + .set-row,
.menu-group > .info-row + .info-row {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.menu-row:active { background: rgba(255, 255, 255, 0.07); }
.menu-chev { color: rgba(255, 255, 255, 0.32); }
.menu-row.is-danger .menu-title { color: #ff6961; }

/* Liquid Glass Toggle Switch */
.switch-chk {
  width: 52px;
  height: 31px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.switch-chk::after {
  width: 23px;
  height: 23px;
  top: 3px;
  left: 3px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}
.switch-chk:checked {
  background: rgba(255, 255, 255, 0.94);
  border-color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.24);
}
.switch-chk:checked::after {
  transform: translateX(21px);
  background: #08090c;
}

/* Scene Tri-Toggle */
.scene-tri { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); border-radius: 999px; }
.scene-tri-btn { border-radius: 999px; }
.scene-tri-btn.is-on { background: #ffffff; color: #08090c; }
.scene-tri-btn.is-off { background: rgba(255, 69, 58, 0.22); color: #ff6961; }

/* Modals & Fullscreen Weather */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.modal,
.full-sheet {
  background: linear-gradient(165deg, rgba(30, 32, 40, 0.88) 0%, rgba(16, 17, 22, 0.92) 100%);
  backdrop-filter: saturate(190%) blur(34px);
  -webkit-backdrop-filter: saturate(190%) blur(34px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.26), 0 28px 70px rgba(0, 0, 0, 0.72);
  animation: glassPopIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 10/10 Fullscreen Weather Screen */
.weather-backdrop { background: #07080b; }
.weather-backdrop .weather-modal {
  background:
    radial-gradient(560px 400px at 50% -40px, rgba(255, 255, 255, 0.17), transparent 66%),
    radial-gradient(480px 380px at 85% 60%, rgba(255, 255, 255, 0.06), transparent 65%),
    linear-gradient(180deg, #171921 0%, #0b0c10 48%, #050608 100%);
  border: none;
  box-shadow: none;
}
.weather-backdrop .w-hero { padding: 20px 0 28px; }
.weather-backdrop .w-hero-icon { font-size: 64px; filter: drop-shadow(0 8px 24px rgba(255, 255, 255, 0.14)); }
.weather-backdrop .w-hero-temp {
  font-size: 86px;
  font-weight: 200;
  letter-spacing: -3.5px;
  line-height: 0.98;
  margin-top: 6px;
}
.weather-backdrop .w-hero-cond { font-size: 17px; font-weight: 600; margin-top: 8px; }
.weather-backdrop .w-hero-hl { font-size: 14px; color: rgba(255, 255, 255, 0.6); margin-top: 4px; }
.w-stats,
.w-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.095) 0%, rgba(255, 255, 255, 0.032) 100%);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.24), 0 10px 28px rgba(0, 0, 0, 0.28);
}
.w-day-rain { color: rgba(255, 255, 255, 0.78); }

/* ---- 10/10 FLOATING LIQUID GLASS BOTTOM DOCK ---- */
@media (max-width: 860px) {
  .bottom-nav {
    left: 16px !important;
    right: 16px !important;
    bottom: max(14px, env(safe-area-inset-bottom)) !important;
    max-width: 440px;
    margin: 0 auto;
    height: 62px !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.05) 100%) !important;
    backdrop-filter: saturate(210%) blur(34px) !important;
    -webkit-backdrop-filter: saturate(210%) blur(34px) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow:
      inset 0 1px 0.5px rgba(255, 255, 255, 0.38),
      inset 0 -1px 0 rgba(255, 255, 255, 0.06),
      0 18px 44px rgba(0, 0, 0, 0.65) !important;
    border-radius: 999px !important;
    padding: 5px !important;
  }
  .bottom-nav-btn {
    color: rgba(255, 255, 255, 0.52) !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    gap: 2px !important;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
  .bottom-nav-btn.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.11) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.42), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    color: #ffffff !important;
  }
}

/* Login Card */
.login-card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.095) 0%, rgba(255, 255, 255, 0.035) 100%) !important;
  backdrop-filter: saturate(190%) blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 26px !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.26), 0 28px 68px rgba(0, 0, 0, 0.65) !important;
}

/* Vector Icon Polish */
.top-add-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.weather-pill-ic,
.w-hero-icon,
.w-hour-ic,
.w-day-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}
.w-hero-icon {
  margin: 0 auto 4px;
  color: rgba(255, 255, 255, 0.94);
}
.menu-ic svg {
  display: block;
  color: rgba(255, 255, 255, 0.9);
}
.w-gps-btn,
.page-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.scene-tile-icon {
  display: grid;
  place-items: center;
}

/* ================= 5 Curated Liquid Glass Color Themes ================= */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.085) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s, box-shadow 0.2s;
}
.theme-card:active { transform: scale(0.96); }
.theme-card.active {
  border-color: var(--theme-accent, #ffffff);
  box-shadow: 0 0 0 1px var(--theme-accent, #ffffff), 0 10px 26px rgba(0, 0, 0, 0.35);
}
.theme-swatch {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.theme-name { font-size: 14px; font-weight: 700; }
.theme-desc { font-size: 11.5px; color: rgba(255, 255, 255, 0.56); }

/* Theme Variables & Glass Tints */
:root[data-theme="amber"] {
  --theme-accent: #f5be72;
  --theme-rgb: 245, 190, 114;
}
:root[data-theme="emerald"] {
  --theme-accent: #5eead4;
  --theme-rgb: 94, 234, 212;
}
:root[data-theme="violet"] {
  --theme-accent: #c4b5fd;
  --theme-rgb: 196, 181, 253;
}
:root[data-theme="ocean"] {
  --theme-accent: #7dd3fc;
  --theme-rgb: 125, 211, 252;
}

:root[data-theme]:not([data-theme="obsidian"]) body {
  background:
    radial-gradient(560px 420px at 14% -4%, rgba(var(--theme-rgb), 0.22), transparent 64%),
    radial-gradient(480px 380px at 88% 14%, rgba(var(--theme-rgb), 0.12), transparent 62%),
    radial-gradient(560px 420px at 50% 100%, rgba(var(--theme-rgb), 0.1), transparent 66%),
    linear-gradient(180deg, #0b0c10 0%, #050608 55%, #090a0e 100%);
}
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on,
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on.is-light,
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on:not(.is-light) {
  background:
    radial-gradient(170px 130px at 18% 18%, rgba(var(--theme-rgb), 0.28), transparent 72%),
    linear-gradient(160deg, rgba(var(--theme-rgb), 0.16) 0%, rgba(255, 255, 255, 0.04) 100%) !important;
  border-color: rgba(var(--theme-rgb), 0.45) !important;
  box-shadow: inset 0 1px 1px rgba(var(--theme-rgb), 0.48), 0 14px 34px rgba(var(--theme-rgb), 0.12) !important;
}
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on .dev-icon-circle,
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on.is-light .dev-icon-circle,
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on:not(.is-light) .dev-icon-circle {
  background: var(--theme-accent) !important;
  border-color: var(--theme-accent) !important;
  color: #0b0c10 !important;
  box-shadow: 0 0 24px rgba(var(--theme-rgb), 0.48) !important;
}
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on .dev-status-line,
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on.is-light .dev-status-line,
:root[data-theme]:not([data-theme="obsidian"]) .dev-tile.is-on:not(.is-light) .dev-status-line {
  color: var(--theme-accent) !important;
}
:root[data-theme]:not([data-theme="obsidian"]) .room-pill.active,
:root[data-theme]:not([data-theme="obsidian"]) .snap-chip.active,
:root[data-theme]:not([data-theme="obsidian"]) .brand-btn.active,
:root[data-theme]:not([data-theme="obsidian"]) .gang-btn.active,
:root[data-theme]:not([data-theme="obsidian"]) .pb-clip-btn.active,
:root[data-theme]:not([data-theme="obsidian"]) .dock-btn.active {
  background: rgba(var(--theme-rgb), 0.24) !important;
  border-color: rgba(var(--theme-rgb), 0.56) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.34), 0 6px 20px rgba(var(--theme-rgb), 0.2) !important;
}
:root[data-theme]:not([data-theme="obsidian"]) .btn-primary,
:root[data-theme]:not([data-theme="obsidian"]) .face-act-btn.is-primary {
  background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.3) 0%, rgba(var(--theme-rgb), 0.14) 100%) !important;
  border-color: rgba(var(--theme-rgb), 0.5) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.42), 0 8px 24px rgba(var(--theme-rgb), 0.18) !important;
}
:root[data-theme]:not([data-theme="obsidian"]) .switch-chk:checked {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  box-shadow: 0 0 16px rgba(var(--theme-rgb), 0.35);
}
:root[data-theme]:not([data-theme="obsidian"]) .bottom-nav-btn.active {
  background: linear-gradient(180deg, rgba(var(--theme-rgb), 0.26) 0%, rgba(var(--theme-rgb), 0.12) 100%) !important;
  border-color: rgba(var(--theme-rgb), 0.44) !important;
  color: var(--theme-accent) !important;
}
:root[data-theme]:not([data-theme="obsidian"]) .weather-backdrop .weather-modal {
  background:
    radial-gradient(560px 420px at 50% -40px, rgba(var(--theme-rgb), 0.24), transparent 66%),
    linear-gradient(180deg, #14161d 0%, #0a0b0f 48%, #050608 100%);
}
:root[data-theme]:not([data-theme="obsidian"]) .dot-green {
  background: var(--theme-accent);
  box-shadow: 0 0 8px rgba(var(--theme-rgb), 0.75);
}
/* ================= Scenes / Automations / Rooms Liquid Glass Polish ================= */
.scene-sub-tabs {
  margin-bottom: 16px !important;
}
.scene-tiles,
.auto-list,
.room-grid {
  gap: 12px !important;
}
.scene-tile,
.auto-card,
.room-card {
  border-radius: 26px !important;
  padding: 16px !important;
  min-height: 132px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 12px !important;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background 0.22s ease, border-color 0.22s ease !important;
}
.scene-tile:active,
.auto-card:active,
.room-card:active {
  transform: scale(0.96) !important;
}
.scene-tile-icon,
.auto-card-icon,
.room-card-ic {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  display: grid !important;
  place-items: center !important;
}
.scene-tile-name,
.auto-card-title,
.room-card-name {
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: -0.25px;
  color: #ffffff !important;
}
.scene-tile-sub,
.auto-card-sub,
.room-card-sub {
  font-size: 12.5px !important;
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Circular Frosted Glass Corner Action Buttons (✕, +, edit) */
.scene-tile-del,
.scene-preset-plus,
.room-card-edit {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
  color: rgba(255, 255, 255, 0.72) !important;
  display: grid !important;
  place-items: center !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}
.scene-tile-del:active,
.scene-preset-plus:active,
.room-card-edit:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}

/* Sleek Add Pill Button under Scenes & Automations */
.scene-add-pill {
  margin-top: 16px;
  height: 46px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

/* Room Add Row Pill Alignment */
.room-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-add-row .input {
  flex: 1;
  height: 44px;
  border-radius: 999px !important;
  padding: 0 16px;
}
.room-add-row .btn {
  height: 44px;
  padding: 0 20px;
}

/* Fullscreen Scene & Automation Wizards — Unified Liquid Glass */
.full-modal-backdrop,
.full-modal {
  background:
    radial-gradient(520px 380px at 14% -4%, rgba(var(--theme-rgb, 255, 255, 255), 0.14), transparent 64%),
    linear-gradient(180deg, #0b0c10 0%, #050608 100%) !important;
}
.full-head {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}
.full-foot {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(8, 9, 12, 0.72) !important;
  backdrop-filter: blur(22px);
}
.auto-seg {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.13) !important;
}
.auto-seg-btn { border-radius: 999px !important; }
.auto-seg-btn.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.11) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}
.auto-pill-btn {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
.auto-pill-btn.active {
  background: rgba(var(--theme-rgb, 255, 255, 255), 0.22) !important;
  border-color: rgba(var(--theme-rgb, 255, 255, 255), 0.52) !important;
  color: #ffffff !important;
}
/* ================= Camera Controls Clear ON/OFF Liquid Glass ================= */
.dock-btn {
  position: relative;
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.025) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.58) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 6px 16px rgba(0, 0, 0, 0.25) !important;
}
.dock-btn .dock-svg {
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.18s ease, transform 0.18s ease;
}

/* ON: Audio / Standard Active (Luminous Theme Accent Glass + Corner Dot) */
.dock-btn.active {
  background: linear-gradient(180deg, rgba(var(--theme-rgb, 255, 255, 255), 0.34) 0%, rgba(var(--theme-rgb, 255, 255, 255), 0.16) 100%) !important;
  border: 1px solid rgba(var(--theme-rgb, 255, 255, 255), 0.72) !important;
  color: #ffffff !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 0 22px rgba(var(--theme-rgb, 255, 255, 255), 0.28) !important;
}
.dock-btn.active .dock-svg { color: #ffffff !important; }
.dock-btn.active::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-accent, #ffffff);
  box-shadow: 0 0 8px rgba(var(--theme-rgb, 255, 255, 255), 0.9);
}

/* ON: Recording / Motion Guard Active (Luminous Ruby Red Glass + Red Dot) */
.dock-btn.danger-active {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.38) 0%, rgba(255, 69, 58, 0.16) 100%) !important;
  border: 1px solid rgba(255, 105, 97, 0.75) !important;
  color: #ffffff !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.34),
    0 0 22px rgba(255, 69, 58, 0.32) !important;
}
.dock-btn.danger-active .dock-svg { color: #ff8a82 !important; }
.dock-btn.danger-active::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff453a;
  box-shadow: 0 0 8px #ff453a;
}
/* Modern Vector Mini Buttons & Lightbox Bar */
.btn,
.page-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.page-back-btn {
  justify-content: flex-start;
  gap: 3px;
}
.mini-icon-btn {
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
  color: #ffffff !important;
  display: inline-grid !important;
  place-items: center !important;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mini-icon-btn:active { transform: scale(0.92); }
.mini-icon-btn.del {
  background: linear-gradient(180deg, rgba(255, 69, 58, 0.22) 0%, rgba(255, 69, 58, 0.1) 100%) !important;
  border-color: rgba(255, 69, 58, 0.42) !important;
  color: #ff6961 !important;
}
.photo-btns { gap: 8px !important; }
.snap-refresh-btn {
  width: 34px;
  height: 34px;
  padding: 0 !important;
}

/* ================= AI Smart Photo Search (Liquid Glass) ================= */
.ai-search-trigger {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.68);
  font: inherit;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, background 0.16s ease;
}
.ai-search-trigger:active { transform: scale(0.985); background: rgba(255, 255, 255, 0.14); }
.ai-search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ai-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-date-pills {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
}
.ai-date-pills::-webkit-scrollbar { display: none; }
.ai-date-picker {
  width: 126px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px !important;
  font-size: 12px;
  flex-shrink: 0;
  color-scheme: dark;
}
.ai-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-search-input {
  flex: 1;
  height: 44px;
  border-radius: 999px !important;
  padding: 0 16px;
  font-size: 14px;
}
.ai-search-btn {
  height: 44px;
  padding: 0 18px;
  flex-shrink: 0;
}
.ai-quick-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.ai-quick-chips::-webkit-scrollbar { display: none; }
.ai-search-status {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 12px;
  padding-left: 2px;
}
.ai-match-reason {
  padding: 0 10px 9px;
  font-size: 11.5px;
  color: var(--theme-accent, rgba(255, 255, 255, 0.8));
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* AI Search Spacing & Compact Calendar Icon Button */
.ai-search-modal .modal-header {
  margin-bottom: 16px !important;
}
.ai-date-row {
  gap: 8px !important;
  margin-bottom: 14px !important;
}
.ai-date-pills .snap-chip {
  flex-shrink: 0;
  white-space: nowrap;
}
.ai-date-btn {
  position: relative;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  flex-shrink: 0;
  display: inline-grid !important;
  place-items: center !important;
  overflow: hidden;
  cursor: pointer;
}
.ai-date-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ai-search-form { margin-bottom: 14px !important; }
.ai-quick-chips { margin-bottom: 14px !important; }
.ai-quick-chips .snap-chip { flex-shrink: 0; white-space: nowrap; }
.ai-search-status { margin-bottom: 14px !important; }
/* ================= Device & Camera Sheet Polish (Gang Seg + Balanced Footer) ================= */
.seg-gang {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.13) !important;
  border-radius: 999px !important;
  padding: 4px !important;
}
.seg-gang-btn {
  border-radius: 999px !important;
  color: rgba(255, 255, 255, 0.62) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  font-weight: 600 !important;
}
.seg-gang-btn.active {
  background: linear-gradient(180deg, rgba(var(--theme-rgb, 255, 255, 255), 0.32) 0%, rgba(var(--theme-rgb, 255, 255, 255), 0.14) 100%) !important;
  border: 1px solid rgba(var(--theme-rgb, 255, 255, 255), 0.56) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.38), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.icon-pick-btn {
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.025) 100%) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.68) !important;
}
.icon-pick-btn.active {
  background: linear-gradient(180deg, rgba(var(--theme-rgb, 255, 255, 255), 0.28) 0%, rgba(var(--theme-rgb, 255, 255, 255), 0.12) 100%) !important;
  border: 1px solid rgba(var(--theme-rgb, 255, 255, 255), 0.54) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.36) !important;
}
.sheet-footer {
  display: flex !important;
  flex-direction: row-reverse !important;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 6px !important;
}
.sheet-footer .btn {
  flex: 1 1 0 !important;
  width: auto !important;
  height: 46px !important;
  padding: 0 14px !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
}