.living-room-shell {
  position: relative;
  --lr-accent: #5fd7c1;
  --lr-secondary: #7ab6e6;
  --lr-glow: rgba(95, 215, 193, 0.18);
  /* Default: Brett's branded ReefMind reef image for every tank/user unless
     an explicit custom/tank wallpaper is selected. */
  --lr-wallpaper: linear-gradient(180deg, rgba(2,6,18,0.10) 0%, rgba(2,6,18,0.20) 60%, rgba(2,6,18,0.40) 100%), url('/img/living-room-reefmind-default.jpg?v=20260529');
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  padding: 4px 0 28px;
}

.living-room-display {
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  width: 100%;
  min-width: 0;
  min-height: 0;
  /* Cap to the viewport height so the display still fits without scrolling,
     but do NOT carve out 112px of dead space for an imaginary chrome — at
     wide-but-short browser proof sizes (eg. 1280x633) that subtraction was
     starving the display down to ~926px wide. The display will be width- or
     height-bound by aspect-ratio against its real container. */
  max-height: 100vh;
  margin-inline: auto;
  border: 1px solid rgba(184,220,238,0.14);
  border-radius: 28px;
  background: var(--lr-wallpaper);
  background-size: cover !important;
  background-position: center !important;
  box-shadow:
    0 28px 90px rgba(2, 14, 32, 0.42),
    inset 0 1px 0 rgba(255,255,255,0.10);
  padding: clamp(14px, 1.8vw, 28px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(10px, 1.1vw, 18px);
  align-content: stretch;
}

.living-room-display::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Subtle bottom-weighted vignette only — used to be a heavy 0.18→0.62 stack
     on top of the wallpaper gradient, which compounded to ~85% darkening at
     the bottom and made the underwater photo unreadable. The wallpaper
     gradient now handles overall mood; this layer just adds gentle cinematic
     edges so the panel feels framed without crushing the image. */
  background:
    linear-gradient(180deg, rgba(2,8,22,0.04) 0%, rgba(2,8,22,0.0) 36%, rgba(2,8,22,0.10) 84%, rgba(2,8,22,0.22) 100%),
    linear-gradient(90deg, rgba(2,8,22,0.16) 0%, rgba(2,8,22,0.0) 32%, rgba(2,8,22,0.0) 68%, rgba(2,8,22,0.16) 100%);
}

.living-room-display::after {
  content: '';
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 22px;
  box-shadow: inset 0 0 60px rgba(2,18,42,0.18);
}

.living-room-display.lr-custom-wallpaper::before {
  background: none;
}

.living-room-display.lr-custom-wallpaper::after {
  border-color: rgba(255,255,255,0.04);
  box-shadow: none;
}

.living-room-display > * { position: relative; z-index: 1; }

.lr-display-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 4;
}

.lr-fullscreen-btn,
.lr-btn-preview {
  background: rgba(8,22,42,0.58);
  border: 1px solid rgba(184,220,238,0.18);
  color: rgba(232,240,252,0.86);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 18px rgba(2,18,42,0.32);
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lr-ambient-light {
  position: absolute;
  width: min(70vw, 880px);
  height: min(70vw, 880px);
  right: -22%;
  top: -34%;
  border-radius: 999px;
  background: radial-gradient(circle, var(--lr-glow), transparent 62%);
  filter: blur(36px);
  opacity: 0.55;
}
.lr-depth-ribbons {
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.18;
  background:
    linear-gradient(180deg, transparent 0 38%, rgba(255,255,255,0.04) 50%, transparent 62%),
    radial-gradient(ellipse at 50% 60%, transparent 0 38%, rgba(2,8,22,0.18) 100%);
  mix-blend-mode: soft-light;
}

.living-room-display.lr-native-fullscreen,
.living-room-display:fullscreen,
.living-room-display:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  padding: clamp(24px, 2.4vw, 42px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.living-room-display.lr-native-fullscreen::after,
.living-room-display:fullscreen::after,
.living-room-display:-webkit-full-screen::after { inset: 18px; border-radius: 28px; }
.living-room-display.lr-native-fullscreen .lr-display-actions,
.living-room-display:fullscreen .lr-display-actions,
.living-room-display:-webkit-full-screen .lr-display-actions {
  opacity: 0;
  pointer-events: none;
}
.living-room-display.lr-native-fullscreen .lr-hero,
.living-room-display:fullscreen .lr-hero,
.living-room-display:-webkit-full-screen .lr-hero {
  min-height: 0;
  grid-template-columns: minmax(360px, 480px) minmax(420px, 640px);
  gap: clamp(22px, 3vw, 58px);
  margin: 0 auto clamp(18px, 2vh, 28px);
  width: min(100%, 1440px);
}
.living-room-display.lr-native-fullscreen .lr-controller-face,
.living-room-display:fullscreen .lr-controller-face,
.living-room-display:-webkit-full-screen .lr-controller-face {
  width: min(28vw, 38vh, 430px);
  height: min(28vw, 38vh, 430px);
  min-width: 220px;
  min-height: 220px;
}
.living-room-display.lr-native-fullscreen .lr-health-orb,
.living-room-display:fullscreen .lr-health-orb,
.living-room-display:-webkit-full-screen .lr-health-orb {
  width: min(15vw, 21vh, 240px);
  height: min(15vw, 21vh, 240px);
}
.living-room-display.lr-native-fullscreen .lr-health-orb span,
.living-room-display:fullscreen .lr-health-orb span,
.living-room-display:-webkit-full-screen .lr-health-orb span { font-size: clamp(2.8rem, 4.8vw, 4.8rem); }
.living-room-display.lr-native-fullscreen .lr-health-orb small,
.living-room-display:fullscreen .lr-health-orb small,
.living-room-display:-webkit-full-screen .lr-health-orb small { font-size: clamp(1.02rem, 1.1vw, 1.2rem); }
.living-room-display.lr-native-fullscreen .lr-tank-chip strong,
.living-room-display:fullscreen .lr-tank-chip strong,
.living-room-display:-webkit-full-screen .lr-tank-chip strong { font-size: clamp(1.75rem, 2.15vw, 2.55rem); }
.living-room-display.lr-native-fullscreen .lr-tank-chip small,
.living-room-display:fullscreen .lr-tank-chip small,
.living-room-display:-webkit-full-screen .lr-tank-chip small { font-size: clamp(1.12rem, 1.18vw, 1.4rem); }
.living-room-display.lr-native-fullscreen .lr-param-name,
.living-room-display:fullscreen .lr-param-name,
.living-room-display:-webkit-full-screen .lr-param-name { font-size: clamp(1.22rem, 1.4vw, 1.7rem); }
.living-room-display.lr-native-fullscreen .lr-param strong,
.living-room-display:fullscreen .lr-param strong,
.living-room-display:-webkit-full-screen .lr-param strong { font-size: clamp(1.7rem, 2.15vw, 2.8rem); }
.living-room-display.lr-native-fullscreen .lr-status-badge,
.living-room-display:fullscreen .lr-status-badge,
.living-room-display:-webkit-full-screen .lr-status-badge { font-size: clamp(1.0rem, 1.1vw, 1.3rem); }
.living-room-display.lr-native-fullscreen .lr-hero-visual,
.living-room-display:fullscreen .lr-hero-visual,
.living-room-display:-webkit-full-screen .lr-hero-visual {
  width: min(31vw, 520px);
  min-width: 340px;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}
.living-room-display.lr-native-fullscreen .lr-content-grid,
.living-room-display:fullscreen .lr-content-grid,
.living-room-display:-webkit-full-screen .lr-content-grid {
  width: min(100%, 1600px);
  margin: 0 auto;
}
.living-room-display.lr-native-fullscreen .lr-vitals-deck,
.living-room-display:fullscreen .lr-vitals-deck,
.living-room-display:-webkit-full-screen .lr-vitals-deck {
  grid-template-columns: repeat(var(--lr-vital-columns, 8), minmax(132px, 1fr));
  gap: clamp(10px, 1vw, 16px);
}
.living-room-display.lr-native-fullscreen .lr-time-strip,
.living-room-display:fullscreen .lr-time-strip,
.living-room-display:-webkit-full-screen .lr-time-strip {
  gap: clamp(14px, 1.6vw, 28px);
  padding: clamp(14px, 1.2vw, 22px) clamp(20px, 1.8vw, 30px);
}
.living-room-display.lr-native-fullscreen .lr-clock strong,
.living-room-display:fullscreen .lr-clock strong,
.living-room-display:-webkit-full-screen .lr-clock strong { font-size: clamp(2.2rem, 3.2vw, 3.6rem); }
.living-room-display.lr-native-fullscreen .lr-date-day,
.living-room-display:fullscreen .lr-date-day,
.living-room-display:-webkit-full-screen .lr-date-day { font-size: clamp(1.5rem, 1.9vw, 2.05rem); }
.living-room-display.lr-native-fullscreen .lr-date-weekday,
.living-room-display:fullscreen .lr-date-weekday,
.living-room-display:-webkit-full-screen .lr-date-weekday { font-size: clamp(1.04rem, 1.18vw, 1.3rem); }
.living-room-display.lr-native-fullscreen .lr-weather-temp,
.living-room-display:fullscreen .lr-weather-temp,
.living-room-display:-webkit-full-screen .lr-weather-temp { font-size: clamp(1.85rem, 2.4vw, 2.7rem); }
.living-room-display.lr-native-fullscreen .lr-weather-condition,
.living-room-display:fullscreen .lr-weather-condition,
.living-room-display:-webkit-full-screen .lr-weather-condition { font-size: clamp(1.1rem, 1.25vw, 1.36rem); }
.living-room-display.lr-native-fullscreen .lr-weather-location,
.living-room-display:fullscreen .lr-weather-location,
.living-room-display:-webkit-full-screen .lr-weather-location { font-size: clamp(0.95rem, 1.05vw, 1.18rem); }

.lr-hero {
  min-height: clamp(300px, 40vh, 500px);
  display: grid;
  /* Camera lane gets the larger share so the main-page Live view video reads
     big at a glance. Health orb (left) needs less room than the reef video. */
  grid-template-columns: minmax(280px, 0.85fr) minmax(400px, 620px);
  align-items: center;
  gap: clamp(20px, 3vw, 56px);
}
.lr-hero-compact { grid-template-columns: minmax(280px, 1fr); justify-items: center; }

.lr-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 1.8vw, 32px);
  flex-wrap: wrap;
  width: 100%;
  min-height: 0;
}
.lr-top-bar .lr-tank-chip { flex: 0 0 auto; }
.lr-top-bar .lr-time-strip { flex: 0 1 auto; margin-left: auto; }

.lr-tank-chip {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px / 56%;
  background: radial-gradient(ellipse at 50% 50%, rgba(9,84,113,0.42) 0%, rgba(2,27,54,0.68) 62%, rgba(2,8,22,0.52) 100%);
  color: rgba(226,232,240,0.72);
  padding: clamp(14px, 1.4vw, 22px) clamp(22px, 2vw, 34px);
  max-width: 320px;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 42px rgba(2,18,42,0.36);
}
.lr-tank-chip-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
.lr-tank-chip span {
  display: block;
  color: rgba(184,220,238,0.82);
  font-size: clamp(0.94rem, 1.05vw, 1.18rem);
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
}
.lr-tank-chip strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(248,250,254,0.98);
  font-size: clamp(1.6rem, 2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(2,18,42,0.5);
  text-align: center;
}
.lr-tank-chip small {
  display:block;
  margin-top:8px;
  color:rgba(216,228,244,0.82);
  font-size:clamp(1.05rem, 1.12vw, 1.28rem);
  font-weight:600;
  line-height:1.3;
  text-align: center;
}

.lr-time-strip {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 22px);
  padding: clamp(10px, 1vw, 16px) clamp(14px, 1.4vw, 22px);
  border-radius: 18px;
  border: 1px solid rgba(184,220,238,0.14);
  background: linear-gradient(135deg, rgba(4,18,34,0.62), rgba(8,30,56,0.42));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 14px 32px rgba(2,14,32,0.34);
  color: rgba(232,240,252,0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  max-width: min(54%, 620px);
}
.lr-time-strip > * {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.lr-clock strong {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: clamp(1.6rem, 2.2vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  color: rgba(248,250,254,0.98);
  text-shadow: 0 1px 14px rgba(2,18,42,0.55);
  font-variant-numeric: tabular-nums;
}
.lr-clock-meridiem {
  font-style: normal;
  font-size: clamp(0.85rem, 0.95vw, 1.05rem);
  font-weight: 700;
  color: rgba(200,214,232,0.88);
  letter-spacing: 0.08em;
}
.lr-date {
  border-left: 1px solid rgba(184,220,238,0.16);
  padding-left: clamp(10px, 1.2vw, 22px);
}
.lr-date-weekday {
  font-size: clamp(0.9rem, 1.05vw, 1.15rem);
  font-weight: 700;
  color: rgba(184,220,238,0.82);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}
.lr-date-day {
  margin-top: 4px;
  font-size: clamp(1.18rem, 1.45vw, 1.6rem);
  font-weight: 800;
  color: rgba(248,250,254,0.98);
  letter-spacing: -0.01em;
  line-height: 1;
}
.lr-weather {
  border-left: 1px solid rgba(184,220,238,0.16);
  padding-left: clamp(10px, 1.2vw, 22px);
}
.lr-weather-temp {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-size: clamp(1.36rem, 1.8vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
  color: rgba(248,250,254,0.98);
  font-variant-numeric: tabular-nums;
}
.lr-weather-temp em {
  font-style: normal;
  font-size: clamp(0.92rem, 1vw, 1.1rem);
  font-weight: 700;
  color: rgba(200,214,232,0.86);
  letter-spacing: 0.04em;
}
.lr-weather-condition {
  font-size: clamp(0.96rem, 1.08vw, 1.2rem);
  font-weight: 700;
  color: rgba(232,240,252,0.92);
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.lr-weather-location {
  font-size: clamp(0.84rem, 0.95vw, 1.02rem);
  color: rgba(184,220,238,0.78);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.lr-weather-empty .lr-weather-condition {
  color: rgba(232,240,252,0.94);
}
.lr-weather-setup-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18em;
  background: rgba(4,18,34,0.72);
  border: 1px solid rgba(0,212,170,0.38);
  border-radius: 8px;
  padding: 0.38em 0.7em;
  cursor: pointer;
  color: rgba(232,240,252,0.94);
  font: inherit;
  text-align: left;
  box-shadow: 0 4px 14px rgba(2,14,32,0.32), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.15s, background 0.15s;
}
.lr-weather-setup-btn small {
  color: rgba(184,220,238,0.82);
  font-size: clamp(0.78rem, 0.88vw, 0.96rem);
  font-weight: 600;
}
.lr-weather-setup-btn:hover,
.lr-weather-setup-btn:focus-visible {
  background: rgba(4,18,34,0.88);
  border-color: var(--lr-accent, rgba(0,212,170,0.7));
  outline: none;
}
.lr-weather-zip-form {
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.lr-weather-zip-input {
  background: rgba(4,18,34,0.72);
  border: 1px solid rgba(0,212,170,0.38);
  border-radius: 6px;
  padding: 0.26em 0.55em;
  color: rgba(232,240,252,0.94);
  font: inherit;
  font-size: clamp(0.82rem, 0.92vw, 1rem);
  width: clamp(80px, 10vw, 140px);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.lr-weather-zip-input::placeholder { color: rgba(184,220,238,0.48); }
.lr-weather-zip-input:focus {
  border-color: var(--lr-accent, rgba(0,212,170,0.7));
}
.lr-weather-zip-btn {
  background: rgba(0,212,170,0.18);
  border: 1px solid rgba(0,212,170,0.45);
  border-radius: 6px;
  padding: 0.26em 0.7em;
  color: rgba(232,240,252,0.96);
  font: inherit;
  font-size: clamp(0.82rem, 0.92vw, 1rem);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.13s, border-color 0.13s;
}
.lr-weather-zip-btn:hover,
.lr-weather-zip-btn:focus-visible {
  background: rgba(0,212,170,0.32);
  border-color: var(--lr-accent, rgba(0,212,170,0.8));
  outline: none;
}
.lr-weather-controls .lr-weather-field {
  display: block;
  margin-top: 10px;
}
.lr-weather-controls .lr-weather-field > span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(226,232,240,0.78);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.lr-weather-temp-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}

.lr-camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.lr-camera-actions .lr-btn {
  min-height: 36px;
}

.lr-controller-face {
  position: relative;
  justify-self: center;
  width: min(27vw, 320px);
  height: min(27vw, 320px);
  min-width: 220px;
  min-height: 220px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,0.14), transparent 28%),
    radial-gradient(circle at 50% 56%, rgba(8,52,72,0.42), rgba(10,22,52,0.56) 68%, rgba(2,8,22,0.78) 100%);
  box-shadow:
    0 0 72px var(--lr-glow),
    0 22px 80px rgba(0,0,0,0.36),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    inset 0 0 80px rgba(2,18,42,0.42);
}
.lr-orbit-ring {
  position: absolute;
  inset: 7%;
  border-radius: 999px;
  border: 2px solid transparent;
  background: conic-gradient(from 210deg, var(--lr-accent) 0 72%, rgba(255,255,255,0.06) 72% 100%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  padding: 2px;
  opacity: 0.55;
}
.lr-orbit-two {
  inset: 18%;
  background: conic-gradient(from 30deg, var(--lr-secondary) 0 58%, rgba(255,255,255,0.05) 58% 100%) border-box;
  opacity: 0.34;
}
.lr-orbit-three {
  inset: 2%;
  padding: 1px;
  background: conic-gradient(from 140deg, rgba(255,255,255,0.04), rgba(184,220,238,0.16), rgba(255,255,255,0.04), rgba(184,220,238,0.10), rgba(255,255,255,0.04)) border-box;
  opacity: 0.30;
}
.lr-health-orb {
  width: min(16vw, 180px);
  height: min(16vw, 180px);
  min-width: 132px;
  min-height: 132px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(255,255,255,0.16), rgba(10,68,92,0.24) 48%, rgba(18,28,72,0.42) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 0 36px var(--lr-glow), inset 0 0 22px rgba(2,18,42,0.32);
}
.lr-health-orb span { display: block; font-size: clamp(2.4rem, 4.2vw, 4.1rem); font-weight: 800; letter-spacing: -0.06em; color: rgba(255,255,255,0.96); line-height: .82; text-shadow: 0 1px 24px rgba(2,18,42,.45); }
.lr-health-orb small { display: block; color: rgba(226,232,240,0.82); font-weight: 800; font-size: clamp(1.02rem, 1.08vw, 1.16rem); text-transform: uppercase; letter-spacing: 0.14em; margin-top: 6px; }

.lr-hero-visual {
  position: relative;
  justify-self: end;
  width: min(40vw, 600px);
  min-width: 320px;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(184,220,238,0.14);
  background: rgba(2,8,22,0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 20px 60px rgba(2,14,32,0.42);
}
.lr-hero-visual-media {
  height: 100%;
  min-height: 100%;
  border-radius: inherit;
  overflow:hidden;
}
.living-room-camera-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.06) contrast(1.02);
  transition: opacity 0.28s ease;
}
.lr-inline-live-video,
.lr-inline-live-iframe {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020817;
  border: 0;
}
.lr-inline-live-status {
  display: none !important;
}
.lr-inline-live-error { color: #fecaca; border-color: rgba(248,113,113,0.35); }
.lr-hero-visual-media { position: relative; }
.lr-hero-visual-media::after {
  content:none;
}
.lr-camera-caption {
  position:absolute;
  left:22px;
  right:22px;
  top:20px;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  color:white;
  text-align:center;
  text-shadow:0 2px 18px rgba(0,0,0,.65);
}
.lr-camera-caption strong { font-size:clamp(1.36rem, 1.7vw, 1.85rem); font-weight:800; line-height:1; letter-spacing:-0.005em; }
.lr-camera-caption small { color:rgba(220,232,248,.86); font-size:clamp(1.04rem, 1.12vw, 1.24rem); font-weight:600; }
.lr-choose-camera-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  margin-top: 0.5em;
  background: rgba(2,8,22,0.58);
  border: 1px solid rgba(184,220,238,0.30);
  border-radius: 5px;
  padding: 0.22em 0.55em;
  cursor: pointer;
  color: rgba(232,240,252,0.92);
  font-size: clamp(0.72rem, 1.1vw, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, border-color 0.15s;
}
.lr-choose-camera-btn:hover,
.lr-choose-camera-btn:focus-visible {
  background: rgba(2,8,22,0.76);
  border-color: var(--lr-accent, rgba(0,212,170,0.6));
  outline: none;
}
.lr-hero-visual-placeholder {
  min-height: 220px;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: rgba(226,232,240,0.66);
  padding: 20px;
  background:
    radial-gradient(circle at 52% 42%, var(--lr-glow), transparent 34%),
    radial-gradient(circle at 32% 70%, rgba(255,255,255,0.04), transparent 22%);
}
.lr-hero-visual-preview {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(0.92) brightness(0.86);
}
.lr-hero-visual-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(2,8,22,0.18) 0%, rgba(2,8,22,0.28) 55%, rgba(2,8,22,0.72) 100%);
}
.lr-hero-visual-preview .lr-camera-caption {
  position: absolute;
  left: 22px;
  right: 22px;
  top: auto;
  bottom: 78px;
  z-index: 2;
  text-align: left;
  align-items: flex-start;
  text-shadow: 0 1px 14px rgba(2,8,22,0.78);
}
.lr-live-video-link {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(184,220,238,0.18);
  background: linear-gradient(135deg, rgba(8,22,42,0.72), rgba(12,30,56,0.64));
  color: rgba(236,244,252,0.94);
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(2,18,42,0.36), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.lr-live-video-link strong,
.lr-live-video-link small { display: block; }
.lr-live-video-link strong {
  font-size: clamp(1.18rem, 1.35vw, 1.45rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.lr-live-video-link small {
  margin-top: 4px;
  color: rgba(200,214,232,0.86);
  font-size: clamp(1.0rem, 1.08vw, 1.2rem);
  font-weight: 600;
}
.lr-live-video-link:not(.lr-live-video-disabled):hover {
  border-color: rgba(184,220,238,0.36);
  box-shadow: 0 14px 30px rgba(2,18,42,0.48), 0 0 0 1px rgba(184,220,238,0.16);
}
.lr-live-video-disabled {
  color: rgba(226,232,240,0.72);
  background: linear-gradient(135deg, rgba(4,18,34,0.72), rgba(14,28,52,0.62));
}
.lr-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--lr-accent);
  box-shadow: 0 0 0 4px rgba(95,215,193,0.10);
  flex: 0 0 auto;
}
.lr-live-video-disabled .lr-live-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148,163,184,0.10);
}

.lr-content-grid {
  display: block;
  width: 100%;
  align-self: end;
  padding: clamp(10px, 1.1vw, 18px) clamp(10px, 1.1vw, 18px) clamp(12px, 1.3vw, 20px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(2,19,42,0.82), rgba(4,22,36,0.68));
  border: 1px solid rgba(184,220,238,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 56px rgba(2,14,32,0.42);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.lr-vitals-deck {
  display: grid;
  grid-template-columns: repeat(var(--lr-vital-columns, 8), minmax(74px, 1fr));
  gap: clamp(8px, 1vw, 14px);
}
.lr-card,
.lr-appearance-panel,
.lr-control-group {
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(5, 45, 74, 0.54);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.lr-card { padding: 16px; }
.lr-section-head { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:12px; }
.lr-section-head span { font-weight:900; color:white; }
.lr-top-signals { display:none; }
.lr-param-grid { display: contents; }
.lr-param {
  --lr-status-color: #7fc8a9;
  --lr-status-bg: rgba(127,200,169,0.08);
  --lr-param-progress: 0;
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  min-height: 104px;
  padding: clamp(10px, 1vw, 16px) clamp(8px, 0.9vw, 14px);
  border-radius: 22px;
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  row-gap: clamp(5px, 0.6vw, 10px);
  text-align: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(255,255,255,0.05), rgba(6,28,52,0.66) 50%, rgba(2,12,28,0.92) 100%);
  border: 1px solid rgba(184,220,238,0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 12px 32px rgba(2,14,32,0.46);
}
.lr-param > *:not(.lr-param-gauge) { position: relative; z-index: 2; }
.lr-param::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,0.06), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
/* Reef Halo: a single status-coloured ring frames the value at the centre of
   each card. The ring base is faint white; --lr-param-progress sweeps a
   status-coloured arc clockwise from 12 o'clock. The centre is mask-cut so the
   value reads through cleanly. One element, one colour, no marker dot. */
.lr-param-gauge {
  grid-row: 2;
  grid-column: 1;
  justify-self: center;
  align-self: center;
  width: clamp(64px, 5.4vw, 96px);
  height: clamp(64px, 5.4vw, 96px);
  border-radius: 50%;
  background:
    conic-gradient(
      from -90deg,
      var(--lr-status-color) 0%,
      var(--lr-status-color) calc(var(--lr-param-progress, 0) * 1% - 3%),
      rgba(255, 255, 255, 0.07) calc(var(--lr-param-progress, 0) * 1% + 3%),
      rgba(255, 255, 255, 0.07) 100%
    );
  -webkit-mask:
    radial-gradient(circle,
      transparent calc(50% - clamp(3px, 0.36vw, 5px)),
      #000 calc(50% - clamp(3px, 0.36vw, 5px)),
      #000 100%);
  mask:
    radial-gradient(circle,
      transparent calc(50% - clamp(3px, 0.36vw, 5px)),
      #000 calc(50% - clamp(3px, 0.36vw, 5px)),
      #000 100%);
  filter: drop-shadow(0 0 9px var(--lr-status-color));
  opacity: 0.88;
  pointer-events: none;
  z-index: 0;
  transition: filter 600ms ease, opacity 600ms ease;
}
.lr-param-status-missing .lr-param-gauge {
  background: conic-gradient(
    from -90deg,
    rgba(255, 255, 255, 0.10) 0,
    rgba(255, 255, 255, 0.10) 100%
  );
  filter: none;
  opacity: 0.55;
}
.lr-param-status-ok { --lr-status-color: #7fc8a9; --lr-status-bg: rgba(127,200,169,0.10); }
.lr-param-status-watch { --lr-status-color: #d8b966; --lr-status-bg: rgba(216,185,102,0.12); }
.lr-param-status-high { --lr-status-color: #d88b8b; --lr-status-bg: rgba(216,139,139,0.12); }
.lr-param-status-low { --lr-status-color: #7faace; --lr-status-bg: rgba(127,170,206,0.12); }
.lr-param-status-missing { --lr-status-color: #8a96a8; --lr-status-bg: rgba(138,150,168,0.10); }
.lr-param-top,
.lr-param-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.lr-param-top {
  grid-row: 1;
  align-self: start;
  margin-bottom: 0;
}
.lr-param-name {
  color: #f6f9ff;
  font-size: clamp(0.82rem, 0.95vw, 1.08rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(2,18,42,0.85), 0 0 2px rgba(2,18,42,0.65);
}
.lr-param[data-param-key="ph"] .lr-param-name {
  text-transform: none;
  letter-spacing: 0.06em;
}
/* Parameter source attribution (Manual / Trident / Apex probe / Collector)
   is intentionally hidden from the Living Room splash — the view is meant for
   family/guests, and that technical chain belongs on the dashboard and in
   Settings. The renderer no longer emits the .lr-param-source span or a
   [data-source] attribute on .lr-param. Belt-and-braces guard below ensures
   any third-party theme or older cached markup still hides the chip. */
.lr-param-source { display: none !important; }
/* Status badge: kept in DOM for assistive tech but visually hidden. Visual
   status is carried by the Reef Halo ring colour around each value. */
.lr-status-badge {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lr-param::after { content: none; }
.lr-param strong {
  grid-row: 2;
  grid-column: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #ffffff;
  text-shadow: 0 1px 14px rgba(2,18,42,0.85), 0 0 2px rgba(2,18,42,0.7);
  font-size: clamp(1.65rem, 2.15vw, 2.75rem);
  line-height: .92;
  letter-spacing: -0.015em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.lr-param strong em {
  color: rgba(228,238,252,0.94);
  font-size: clamp(0.72rem, 0.82vw, 0.95rem);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-top: 2px;
  text-shadow: 0 1px 8px rgba(2,18,42,0.7);
}
.lr-param-footer { display: contents; }
.lr-param small {
  display:block;
  color:rgba(216,228,244,0.82);
  font-size:clamp(0.72rem, 0.82vw, 0.95rem);
  font-weight:600;
  line-height:1;
}
/* Target range text: kept in DOM for assistive tech but visually hidden —
   the ring colour around the value already encodes the in/out-of-range
   status at distance. */
.lr-param-target {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lr-list { list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.lr-list li { display:flex; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid rgba(255,255,255,0.07); }
.lr-list li:last-child { border-bottom:0; }
.lr-list strong { color: var(--lr-accent); }
.lr-brief { color: rgba(226,232,240,0.78); line-height:1.5; margin:0; }

.living-room-settings {
  position:absolute;
  top:18px;
  left:18px;
  z-index:8;
  width:52px;
  min-height:52px;
  border: 1px solid rgba(184,255,246,0.55);
  border-radius: 999px;
  background: rgba(5,45,74,0.78);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 14px 34px rgba(0,0,0,.36),
    0 0 0 2px rgba(95,215,193,0.34),
    0 0 22px var(--lr-glow, rgba(95,215,193,0.32));
  overflow:hidden;
  opacity:0.95;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity .18s ease, width .18s ease, border-radius .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.living-room-settings:hover,
.living-room-settings:focus-within,
.living-room-settings[open] { opacity:1; }
.living-room-settings:hover:not([open]),
.living-room-settings:focus-within:not([open]) {
  transform: scale(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 18px 40px rgba(0,0,0,.42),
    0 0 0 2px var(--lr-accent, #5fd7c1),
    0 0 28px var(--lr-glow, rgba(95,215,193,0.5));
}
.living-room-settings[open] {
  width:min(980px, calc(100vw - 48px));
  max-height: calc(100% - 36px);
  overflow-y: auto;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(5,45,74,0.90), rgba(22,31,78,0.82));
}
.lr-customize-summary {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  min-height:52px;
  padding:0;
  cursor:pointer;
  color:white;
  font-weight:950;
  list-style:none;
}
.lr-customize-summary::before {
  content:'⚙';
  font-size:1.6rem;
  line-height:1;
  opacity:1;
  color: var(--lr-accent, #5fd7c1);
  text-shadow:
    0 0 14px var(--lr-glow, rgba(95,215,193,0.55)),
    0 1px 2px rgba(0,0,0,0.55);
}
.lr-customize-summary span,
.lr-customize-summary small {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}
.lr-customize-summary::-webkit-details-marker { display:none; }
.lr-settings-drawer {
  display:grid;
  grid-template-columns: minmax(220px, .75fr) minmax(240px, .9fr) minmax(320px, 1.6fr);
  gap:12px;
  padding:0 14px 14px;
  align-items:start;
}
.living-room-settings:not([open]) .lr-settings-drawer { display:none; }
.lr-appearance-panel, .lr-control-group { padding:14px; }
.lr-panel-title { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; color:white; font-weight:900; }
.lr-panel-x { color:rgba(226,232,240,0.55); }
.lr-control-label { color:white; font-weight:800; margin-bottom:4px; }
.lr-control-help { color:rgba(226,232,240,0.56); font-size:0.76rem; margin-bottom:10px; }
.lr-radio-row { display:grid; gap:8px; color:rgba(226,232,240,0.82); font-size:0.85rem; }
.lr-input { width:100%; margin-top:10px; border:1px solid rgba(184,255,246,0.18); border-radius:12px; background:rgba(5,45,74,0.58); color:white; padding:10px; }
.lr-upload-drop { display:grid; gap:2px; margin-top:10px; padding:12px; border:1px dashed rgba(255,255,255,0.22); border-radius:14px; background:rgba(255,255,255,0.045); cursor:pointer; color:rgba(226,232,240,0.86); }
.lr-upload-drop span { color:white; font-weight:900; }
.lr-upload-drop small { color:rgba(226,232,240,0.58); font-size:0.72rem; }
.lr-upload-drop input { display:none; }
.lr-module-toggles, .lr-swatch-grid, .lr-wallpaper-grid { display:grid; gap:8px; }
.lr-color-inputs { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.lr-color-inputs label { display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid rgba(255,255,255,0.10); border-radius:12px; padding:8px; color:rgba(226,232,240,0.82); font-size:0.78rem; }
.lr-color-inputs input { width:38px; height:30px; border:0; border-radius:8px; background:transparent; padding:0; }
.lr-module-toggle, .lr-swatch, .lr-wallpaper { cursor:pointer; display:flex; align-items:center; gap:10px; border:1px solid rgba(255,255,255,0.10); border-radius:14px; padding:9px; background:rgba(255,255,255,0.04); color:rgba(226,232,240,0.82); }
.lr-module-toggle strong, .lr-module-toggle small { display:block; }
.lr-module-toggle small { margin-top:2px; font-size:0.72rem; }
.lr-swatch.active, .lr-wallpaper.active { border-color: var(--lr-accent); box-shadow:0 0 0 1px var(--lr-accent); }
.lr-swatch-dot { width:18px; height:18px; border-radius:999px; box-shadow:0 0 18px currentColor; }
.lr-wallpaper-thumb { width:52px; height:38px; border-radius:10px; background-size:cover !important; background-position:center !important; border:1px solid rgba(255,255,255,0.10); }
.lr-current-preview { height:74px; border-radius:14px; background-size:cover !important; background-position:center !important; border:1px solid rgba(255,255,255,0.12); }
.lr-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.lr-btn { border:1px solid rgba(255,255,255,0.14); border-radius:12px; padding:10px 12px; color:white; background:rgba(255,255,255,0.07); font-weight:800; cursor:pointer; }
.lr-btn-primary { background:linear-gradient(135deg, var(--lr-accent), var(--lr-secondary)); color:#001016; border:0; }
.lr-save-status { min-height:18px; color:var(--lr-accent); font-size:0.76rem; margin-top:8px; }

@media (max-height: 800px) and (min-width: 900px) {
  .living-room-display { padding: 18px; gap: 12px; }
  .lr-hero { min-height: 240px; gap: 24px; grid-template-columns: minmax(260px, 0.8fr) minmax(360px, 520px); }
  .lr-controller-face { width: 255px; height: 255px; min-width: 255px; min-height: 255px; }
  .lr-health-orb { width: 154px; height: 154px; min-width: 154px; min-height: 154px; }
  .lr-health-orb span { font-size: clamp(3.35rem, 5.2vw, 4.7rem); }
  .lr-hero-visual { width: min(40vw, 500px); min-width: 320px; }
  .lr-tank-chip strong { font-size: clamp(1.36rem, 1.7vw, 1.92rem); }
  .lr-tank-chip small { font-size: clamp(1rem, 1.08vw, 1.18rem); }
  .lr-content-grid { padding: 10px; }
  .lr-vitals-deck { grid-template-columns: repeat(var(--lr-vital-columns, 8), minmax(82px, 1fr)); gap: clamp(6px, 0.7vw, 12px); }
  .lr-param { min-height: 0; padding: 10% 5% 9%; }
  .lr-status-badge { padding: 4px 9px; min-height: 24px; font-size: clamp(.9rem, 1vw, 1.1rem); }
  /* Constrained widths: shrink label clamps and tighten letter-spacing so the
     longest parameter names (MAGNESIUM, PHOSPHATE) fit inside the inscribed
     ring without overflow:hidden clipping them to MAGNESIU / PHOSPHAT. Allow
     wrapping as a safety net (overflow-wrap: anywhere). */
  .lr-param-name {
    font-size: clamp(0.94rem, 1.08vw, 1.22rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .lr-param strong { font-size: clamp(1.7rem, 2.2vw, 2.6rem); }
  .lr-param strong em { font-size: clamp(.96rem, 1.02vw, 1.18rem); margin-top: 1px; }
  .lr-param-gauge { width: clamp(64px, 5.6vw, 104px); height: clamp(64px, 5.6vw, 104px); }
}

@media (max-aspect-ratio: 1.45) and (min-width: 721px) {
  .living-room-display { aspect-ratio: 4 / 3; padding: 18px; gap: 12px; }
  .lr-hero {
    grid-template-columns: minmax(220px, 0.85fr) minmax(300px, 430px);
    min-height: 220px;
    gap: 18px;
  }
  .lr-controller-face { width: 235px; height: 235px; min-width: 235px; min-height: 235px; }
  .lr-health-orb { width: 142px; height: 142px; min-width: 142px; min-height: 142px; }
  .lr-health-orb span { font-size: clamp(3.2rem, 6vw, 4.5rem); }
  .lr-health-orb small { font-size: clamp(.95rem, 1.05vw, 1.18rem); }
  .lr-tank-chip strong { font-size: clamp(1.4rem, 1.75vw, 1.8rem); }
  .lr-tank-chip small { font-size: clamp(.96rem, 1.05vw, 1.12rem); }
  .lr-camera-caption strong { font-size: clamp(1.16rem, 1.45vw, 1.45rem); }
  .lr-camera-caption small { font-size: clamp(.94rem, 1vw, 1.08rem); }
  .lr-live-video-link strong { font-size: clamp(1.04rem, 1.18vw, 1.22rem); }
  .lr-live-video-link small { font-size: clamp(.9rem, .98vw, 1.04rem); }
  .lr-hero-visual { width: min(34vw, 400px); min-width: 260px; }
  .lr-content-grid { padding: 10px 10px 12px; }
  .lr-vitals-deck { grid-template-columns: repeat(var(--lr-vital-columns, 8), minmax(72px, 1fr)); gap: 8px; }
  .lr-param { min-height: 0; padding: 9% 5% 8%; border-radius: 20px; }
  .lr-param-name {
    font-size: clamp(0.94rem, 1.08vw, 1.18rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .lr-status-badge { font-size: clamp(.88rem, .95vw, 1.02rem); padding: 3px 8px; min-height: 22px; }
  .lr-param strong { font-size: clamp(1.5rem, 2.1vw, 2.05rem); }
  .lr-param strong em { font-size: clamp(.94rem, 1.02vw, 1.12rem); margin-top: 1px; }
  .lr-param-gauge { width: clamp(58px, 5vw, 92px); height: clamp(58px, 5vw, 92px); }
}

@media (max-aspect-ratio: 1.45) and (min-width: 721px) {
  .lr-time-strip {
    gap: 12px;
    padding: 9px 14px;
  }
  .lr-clock strong { font-size: clamp(1.36rem, 1.8vw, 2rem); }
  .lr-date-day { font-size: clamp(1.05rem, 1.25vw, 1.35rem); }
  .lr-date-weekday { font-size: clamp(0.8rem, 0.92vw, 1rem); }
  .lr-weather-temp { font-size: clamp(1.18rem, 1.5vw, 1.6rem); }
  .lr-weather-condition { font-size: clamp(0.88rem, 0.98vw, 1.08rem); }
  .lr-weather-location { font-size: clamp(0.78rem, 0.85vw, 0.92rem); }
}

@media (max-width: 900px) {
  .living-room-shell { grid-template-columns: 1fr; }
  .lr-settings-drawer { grid-template-columns: 1fr; }
  .lr-top-bar { justify-content: center; }
  .lr-hero { grid-template-columns: 1fr; justify-items:center; }
  .lr-controller-face { width:min(72vw, 430px); height:min(72vw, 430px); }
  .lr-health-orb { width:190px; height:190px; }
  .lr-hero-visual { justify-self:center; width:min(88vw, 560px); }
  .lr-time-strip {
    margin-left: 0;
    max-width: 100%;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .living-room-display { padding:16px; border-radius:22px; }
  .lr-vitals-deck { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .lr-param { min-height:104px; }
  .lr-tank-chip { max-width:260px; }
  .lr-time-strip {
    flex-wrap: wrap;
    gap: 10px 14px;
    padding: 10px 14px;
  }
  .lr-date,
  .lr-weather { border-left: 0; padding-left: 0; }
}


/* iPad/iOS Safari does not reliably support arbitrary element Fullscreen API.
   JS toggles this class as an app-fullscreen fallback from the same user tap. */
body.living-room-pseudo-fullscreen-active {
  overflow: hidden !important;
  touch-action: none;
}
.living-room-display.lr-pseudo-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483000 !important;
  width: 100vw !important;
  height: var(--lr-viewport-height, 100dvh) !important;
  min-height: var(--lr-viewport-height, 100dvh) !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  padding: clamp(14px, 2vw, 30px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}
.living-room-display.lr-pseudo-fullscreen::after { inset: 18px; border-radius: 28px; }
.living-room-display.lr-pseudo-fullscreen .lr-display-actions {
  opacity: 1;
  pointer-events: auto;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}
.living-room-display.lr-pseudo-fullscreen .lr-fullscreen-btn::before { content: 'Exit '; }
.living-room-display.lr-pseudo-fullscreen .lr-hero {
  min-height: 0;
  grid-template-columns: minmax(280px, 420px) minmax(340px, 560px);
  gap: clamp(16px, 2.2vw, 42px);
  margin: 0 auto clamp(12px, 1.6vh, 24px);
  width: min(100%, 1280px);
}
.living-room-display.lr-pseudo-fullscreen .lr-controller-face {
  width: min(24vw, 34vh, 330px);
  height: min(24vw, 34vh, 330px);
  min-width: 210px;
  min-height: 210px;
}
.living-room-display.lr-pseudo-fullscreen .lr-health-orb {
  width: min(13vw, 18vh, 190px);
  height: min(13vw, 18vh, 190px);
}
.living-room-display.lr-pseudo-fullscreen .lr-health-orb span { font-size: clamp(2.6rem, 4.6vw, 4.6rem); }
.living-room-display.lr-pseudo-fullscreen .lr-param strong { font-size: clamp(1.55rem, 2vw, 2.5rem); }
.living-room-display.lr-pseudo-fullscreen .lr-vitals-deck {
  grid-template-columns: repeat(var(--lr-vital-columns, 8), minmax(74px, 1fr));
  gap: clamp(7px, 0.85vw, 13px);
}
@supports (-webkit-touch-callout: none) {
  .living-room-display.lr-pseudo-fullscreen {
    height: var(--lr-viewport-height, -webkit-fill-available) !important;
    min-height: var(--lr-viewport-height, -webkit-fill-available) !important;
  }
}


/* Deployed proof correction: iPad/1280px Living Room should fit all eight vitals without clipping. */
.lr-param strong {
  font-size: clamp(1.55rem, 1.8vw, 2.2rem);
  line-height: 0.9;
}
.lr-param-name {
  font-size: clamp(0.72rem, 0.78vw, 0.92rem);
  letter-spacing: 0.08em;
}
.lr-param-gauge {
  width: clamp(58px, 4.8vw, 78px);
  height: clamp(58px, 4.8vw, 78px);
}
.living-room-display.lr-native-fullscreen .lr-vitals-deck,
.living-room-display:fullscreen .lr-vitals-deck,
.living-room-display:-webkit-full-screen .lr-vitals-deck,
.living-room-display.lr-pseudo-fullscreen .lr-vitals-deck {
  grid-template-columns: repeat(var(--lr-vital-columns, 8), minmax(74px, 1fr));
  gap: clamp(6px, 0.7vw, 10px);
}
.living-room-display.lr-native-fullscreen .lr-param,
.living-room-display:fullscreen .lr-param,
.living-room-display:-webkit-full-screen .lr-param,
.living-room-display.lr-pseudo-fullscreen .lr-param {
  min-height: 86px;
  padding: clamp(7px, 0.75vw, 10px);
}
.living-room-display.lr-native-fullscreen .lr-param strong,
.living-room-display:fullscreen .lr-param strong,
.living-room-display:-webkit-full-screen .lr-param strong,
.living-room-display.lr-pseudo-fullscreen .lr-param strong {
  font-size: clamp(1.45rem, 1.7vw, 2.1rem);
}
.living-room-display.lr-native-fullscreen .lr-param-gauge,
.living-room-display:fullscreen .lr-param-gauge,
.living-room-display:-webkit-full-screen .lr-param-gauge,
.living-room-display.lr-pseudo-fullscreen .lr-param-gauge {
  width: clamp(52px, 4.5vw, 74px);
  height: clamp(52px, 4.5vw, 74px);
}
.living-room-display.lr-native-fullscreen .lr-param-name,
.living-room-display:fullscreen .lr-param-name,
.living-room-display:-webkit-full-screen .lr-param-name,
.living-room-display.lr-pseudo-fullscreen .lr-param-name {
  font-size: clamp(0.68rem, 0.72vw, 0.86rem);
}

/* Mobile: enlarge the parameter circles and centre the value so it reads
   clearly at arm's length on phones. The 2-column vitals grid gives each card
   ~46vw to work with; the ring fills most of that, with the numeric value
   centred inside it via the existing grid-cell overlap of .lr-param-gauge and
   .lr-param strong. Placed after the deployed-proof corrections so cascade
   order wins on small screens. */
@media (max-width: 720px) {
  .lr-vitals-deck {
    gap: 12px;
  }
  .lr-param {
    min-height: 168px;
    padding: 14px 10px 12px;
    row-gap: 8px;
    border-radius: 24px;
  }
  .lr-param-gauge {
    width: clamp(108px, 28vw, 140px);
    height: clamp(108px, 28vw, 140px);
  }
  .lr-param strong {
    font-size: clamp(1.95rem, 6.8vw, 2.6rem);
    line-height: 0.95;
  }
  .lr-param strong em {
    font-size: clamp(0.78rem, 2.6vw, 0.95rem);
    margin-top: 3px;
  }
  .lr-param-name {
    font-size: clamp(0.82rem, 2.8vw, 0.96rem);
    letter-spacing: 0.10em;
    line-height: 1.05;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* ── Small-screen notice ───────────────────────────────────────────────────
   The Living Room splash is a 10-foot "kiosk" experience built for a TV, wall
   display, or tablet. On phones the cinematic layout is necessarily cramped,
   so surface a slim, dismissible notice (small screens only) that points
   reefers to Full screen or a larger display. Hidden by default — the ID
   selector outranks the base .tab-help-bar block display — and the
   max-width:720px block re-enables it on phones. Dismissal is handled by the
   shared .tab-help-bar dismiss logic (key: living-room-small-screen). */
#help-bar-living-room-small-screen { display: none; }
@media (max-width: 720px) {
  #help-bar-living-room-small-screen { display: block; }
}
