:root {
  --cream: #FAF3E3;
  --cream-card: #FFFBF1;
  --cream-soft: #F2E7CF;
  --ink: #2A1E17;
  --ink-muted: #6C584C;
  --teal: #0E8A91;
  --teal-bright: #18A4AC;
  --teal-soft: #D9F2F3;
  --coral: #E25B3C;
  --coral-soft: #FDE5DC;
  --shiba: #E69A3A;
  --shiba-soft: #FCEAD0;
  --gold: #F6B94D;
  --gold-soft: #FFF1C9;
  --green: #2B8A5B;
  --green-soft: #DCF5E7;

  --border: 2.5px solid var(--ink);
  --shadow-sm: 2.5px 2.5px 0 var(--ink);
  --shadow-md: 4px 4px 0 var(--ink);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;

  --font-display: 'Fredoka', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--cream);
  background-image: radial-gradient(rgba(42, 30, 23, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.app-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-badge img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.brand-text p {
  margin: 2px 0 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--cream-card);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  border: 1.5px solid var(--ink);
}

.status-pill.is-online { background: var(--green-soft); }
.status-pill.is-online .dot { background: var(--green); }
.status-pill.is-demo { background: var(--shiba-soft); }
.status-pill.is-demo .dot { background: var(--coral); }
.status-pill.is-offline { background: var(--coral-soft); }
.status-pill.is-offline .dot { background: var(--coral); }

/* Mode / Safety Banner */
.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--gold-soft);
  transition: background 0.2s ease;
}

.mode-banner.is-live {
  background: var(--green-soft);
}

.mode-banner.is-demo {
  background: var(--shiba-soft);
}

.mode-info {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.mode-icon {
  font-size: 16px;
  flex-shrink: 0;
}

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

.chip-btn {
  appearance: none;
  border: 2px solid var(--ink);
  background: var(--cream-card);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.chip-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.chip-btn-primary {
  background: var(--teal);
  color: #FFFFFF;
}

.mode-banner.is-live .chip-btn-primary {
  background: var(--cream-card);
  color: var(--ink);
}

.mode-banner.is-demo .chip-btn-primary {
  background: var(--coral);
  color: #FFFFFF;
}

/* Hero Shiba Card */
.hero-card {
  background: var(--cream-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shiba-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shiba-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

/* Bird's-eye Georgaklis Pool & Shiba Scene State Rules */
.pool-water-cold,
.pool-water-warm,
.pool-water-night,
.spa-water-hot,
.fx-pool-heat,
.fx-pool-steam,
.fx-pool-flames,
.fx-spa-heat,
.fx-spa-flames,
.fx-night-overlay,
.fx-clouds,
.fx-rain,
.fx-storm,
.fx-snowfall,
.fx-snow,
.fx-steam,
.fx-bubbles,
.fx-zzz,
.fx-light-glow,
.eyes-bliss,
.eyes-sleepy,
.acc-shades,
.acc-towel,
.acc-beanie,
.acc-umbrella {
  opacity: 0;
  transition: opacity 0.45s ease;
}

.pool-water-day,
.spa-water,
.acc-floatie,
.eyes-normal {
  opacity: 1;
  transition: opacity 0.45s ease;
}

/* Water color tiers based on actual live temperature */
.shiba-stage.temp-cold .pool-water-cold {
  opacity: 1;
}
.shiba-stage.temp-warm .pool-water-warm {
  opacity: 1;
}
.shiba-stage.spa-hot .spa-water-hot {
  opacity: 1;
}

/* Active heating glows, rising steam & little retro flames! */
.shiba-stage.pool-heating .fx-pool-heat,
.shiba-stage.pool-heating .fx-pool-steam,
.shiba-stage.pool-heating .fx-pool-flames {
  opacity: 1;
}
.shiba-stage.pool-heating .pool-pill .pill-bg {
  fill: #D94B38;
  stroke: #FFE29A;
}

.shiba-stage.spa-heating .fx-spa-heat,
.shiba-stage.spa-heating .fx-steam,
.shiba-stage.spa-heating .fx-spa-flames,
.shiba-stage.spa-heating .spa-water-hot {
  opacity: 1;
}
.shiba-stage.spa-heating .spa-pill .pill-bg {
  fill: #D94B38;
  stroke: #FFE29A;
}

/* Live Brookline weather layers */
.shiba-stage.is-night .fx-night-overlay {
  opacity: 1;
}
.shiba-stage.weather-cloudy .fx-clouds,
.shiba-stage.weather-rain .fx-clouds,
.shiba-stage.weather-storm .fx-clouds {
  opacity: 1;
}
.shiba-stage.weather-rain .fx-rain,
.shiba-stage.weather-rain .acc-umbrella,
.shiba-stage.weather-storm .fx-rain,
.shiba-stage.weather-storm .acc-umbrella {
  opacity: 1;
}
.shiba-stage.weather-storm .fx-storm {
  opacity: 1;
}
.shiba-stage.weather-snow .fx-snowfall {
  opacity: 1;
}

.shiba-stage.has-lights .pool-pill .pill-bg,
.shiba-stage.has-lights .spa-pill .pill-bg {
  stroke: #7CE8EE;
}

/* Shiba floats in the main pool by default, and slides right into the bottom-right spa when Spa is ON */
.shiba-mover {
  transform: translate(124px, 114px);
  transition: transform 0.7s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.shiba-bob {
  animation: bobGentle 3.6s ease-in-out infinite;
}

.shiba-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: ringPulse 3.2s ease-in-out infinite;
}

/* State: Winter snow dusting (air temp <= 42°F or freeze active) */
.shiba-stage.is-winter .fx-snow {
  opacity: 1;
}

/* State: Chilly & Off */
.shiba-stage.state-chilly .acc-beanie,
.shiba-stage.state-chilly .eyes-sleepy,
.shiba-stage.state-chilly .fx-zzz {
  opacity: 1;
}
.shiba-stage.state-chilly .eyes-normal {
  opacity: 0;
}

/* State: Pool ON */
.shiba-stage.state-pool .acc-shades {
  opacity: 1;
}
.shiba-stage.state-pool .shiba-bob {
  animation: bobFloat 2.6s ease-in-out infinite;
}

/* State: Spa ON — Shiba hops right into the bottom-right inset spa! */
.shiba-stage.state-spa .shiba-mover {
  transform: translate(247px, 140px) scale(0.76);
}
.shiba-stage.state-spa .spa-label {
  opacity: 0;
}
.shiba-stage.state-spa .acc-floatie,
.shiba-stage.state-spa .eyes-normal {
  opacity: 0;
}
.shiba-stage.state-spa .acc-towel,
.shiba-stage.state-spa .eyes-bliss,
.shiba-stage.state-spa .fx-steam {
  opacity: 1;
}

/* Modifier: Pool Lights ON — twilight yard + glowing aqua pool & spa */
.shiba-stage.has-lights .pool-water-night,
.shiba-stage.has-lights .fx-night-overlay,
.shiba-stage.has-lights .fx-light-glow {
  opacity: 1;
}

/* Modifier: Spa Bubbles ON — fizzing right inside the bottom-right spa */
.shiba-stage.has-bubbles .fx-bubbles {
  opacity: 1;
}

/* Modifier: Heating Active */
.shiba-stage.has-heating .fx-steam {
  opacity: 1;
}

/* Animations */
@keyframes bobFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-3.5px) rotate(2deg); }
}

@keyframes bobGentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-2px); }
}

@keyframes ringPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.65; }
  50% { transform: scale(1.08); opacity: 0.25; }
}

.rip {
  animation: rippleDrift 4s ease-in-out infinite;
}
.rip.r2 { animation-delay: 1.2s; }
.rip.r3 { animation-delay: 2.4s; }

@keyframes rippleDrift {
  0%, 100% { transform: translateX(0px); opacity: 0.35; }
  50% { transform: translateX(6px); opacity: 0.7; }
}

.steam {
  animation: steamRise 2.6s ease-in-out infinite;
}
.steam.s2 { animation-delay: 0.7s; }
.steam.s3 { animation-delay: 1.4s; }

@keyframes steamRise {
  0% { transform: translateY(5px); opacity: 0.15; }
  50% { transform: translateY(-4px); opacity: 0.85; }
  100% { transform: translateY(-12px); opacity: 0; }
}

.bub {
  transform-box: fill-box;
  transform-origin: center;
  animation: bubblePop 1.6s ease-in-out infinite;
}
.bub.b2 { animation-delay: 0.35s; animation-duration: 1.9s; }
.bub.b3 { animation-delay: 0.7s; animation-duration: 1.5s; }
.bub.b4 { animation-delay: 1.05s; animation-duration: 1.8s; }

@keyframes bubblePop {
  0%, 100% { transform: scale(0.7); opacity: 0.35; }
  50% { transform: scale(1.2); opacity: 0.95; }
}

/* Little retro dancing flames */
.flame-unit path {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: flameDance 0.75s ease-in-out infinite alternate;
}
.flame-unit.f2 path { animation-delay: 0.18s; animation-duration: 0.65s; }
.flame-unit.f3 path { animation-delay: 0.36s; animation-duration: 0.8s; }

@keyframes flameDance {
  0% { transform: scaleY(0.88) scaleX(1.06) skewX(-3deg); }
  50% { transform: scaleY(1.12) scaleX(0.94) skewX(3deg); }
  100% { transform: scaleY(0.96) scaleX(1.02) skewX(-2deg); }
}

/* Raindrops & water splash rings */
.raindrop {
  animation: rainFall 0.95s linear infinite;
}
.raindrop.rd2 { animation-delay: 0.25s; animation-duration: 0.85s; }
.raindrop.rd3 { animation-delay: 0.5s; animation-duration: 1.05s; }
.raindrop.rd4 { animation-delay: 0.75s; animation-duration: 0.9s; }

@keyframes rainFall {
  0% { transform: translate(6px, -16px); opacity: 0; }
  20% { opacity: 0.9; }
  85% { opacity: 0.85; }
  100% { transform: translate(-10px, 28px); opacity: 0; }
}

.splash {
  transform-box: fill-box;
  transform-origin: center;
  animation: splashRing 1.4s ease-out infinite;
}
.splash.sp2 { animation-delay: 0.45s; }
.splash.sp3 { animation-delay: 0.9s; }

@keyframes splashRing {
  0% { transform: scale(0.25); opacity: 0.95; }
  100% { transform: scale(1.45); opacity: 0; }
}

/* Snowflakes */
.flake {
  animation: snowDrift 3.6s linear infinite;
}
.flake.fl2 { animation-delay: 1.1s; animation-duration: 4.2s; }
.flake.fl3 { animation-delay: 2.2s; animation-duration: 3.2s; }

@keyframes snowDrift {
  0% { transform: translate(-4px, -14px); opacity: 0; }
  15% { opacity: 0.95; }
  85% { opacity: 0.9; }
  100% { transform: translate(8px, 38px); opacity: 0; }
}

/* Clouds & Lightning */
.cloud-drift {
  animation: cloudFloat 7s ease-in-out infinite alternate;
}
.cloud-drift.c2 { animation-delay: 2.5s; }

@keyframes cloudFloat {
  0% { transform: translateX(-6px); }
  100% { transform: translateX(8px); }
}

.bolt {
  animation: stormFlash 4.2s ease-in-out infinite;
}

@keyframes stormFlash {
  0%, 84%, 92%, 100% { opacity: 0; }
  86%, 90% { opacity: 1; }
}

.zzz {
  animation: zzzFloat 2.4s ease-in-out infinite;
}
.zzz.z2 { animation-delay: 0.6s; }

@keyframes zzzFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50% { transform: translate(3px, -5px); opacity: 1; }
}

.twinkle {
  animation: twinklePulse 2.2s ease-in-out infinite;
}
.twinkle.t2 { animation-delay: 0.7s; }
.twinkle.t3 { animation-delay: 1.3s; }

@keyframes twinklePulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.shiba-speech {
  position: relative;
  background: var(--cream-soft);
  border: 2px solid var(--ink);
  border-radius: 13px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.3;
}

/* Temperature Strip */
.temp-strip {
  display: grid;
  grid-template-columns: 1fr 2px 1fr 2px 1.15fr;
  align-items: center;
  background: var(--ink);
  color: var(--cream);
  border-radius: 14px;
  padding: 10px 6px;
}

.temp-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.temp-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  color: #D7C6B3;
}

.temp-value {
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 700;
  color: #FFF7E8;
  line-height: 1.1;
}

.temp-value-sm {
  font-size: 15px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
}

.temp-value-sm.is-heating {
  background: var(--coral);
  color: #FFFFFF;
}

.temp-value-sm.is-standby {
  background: var(--shiba);
  color: var(--ink);
}

.temp-divider {
  height: 30px;
  background: rgba(255, 247, 232, 0.18);
}

/* Primary Controls Stack */
.controls-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.control-card {
  background: var(--cream-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background 0.2s ease;
}

.card-pool.is-on {
  background: var(--teal-soft);
}

.card-spa.is-on {
  background: var(--coral-soft);
}

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

.card-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.card-emoji {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: var(--cream-soft);
  display: grid;
  place-items: center;
  font-size: 24px;
  flex-shrink: 0;
}

.card-pool.is-on .card-emoji { background: var(--teal); }
.card-spa.is-on .card-emoji { background: var(--coral); }

.title-with-temp {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-temp-badge {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9px;
  border: 2px solid var(--ink);
  background: var(--cream-soft);
  color: var(--ink);
  line-height: 1.2;
}

.card-pool.is-on .live-temp-badge,
.card-spa.is-on .live-temp-badge {
  background: var(--cream-card);
}

.control-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
}

.card-sub {
  margin: 3px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Giant Tactile Retro Power Switch */
.power-switch {
  appearance: none;
  border: var(--border);
  border-radius: 16px;
  background: var(--cream-soft);
  box-shadow: var(--shadow-sm);
  padding: 7px 11px;
  min-width: 104px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s ease;
}

.power-switch:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.switch-track {
  width: 40px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #D7CBB6;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--cream-card);
  border: 2px solid var(--ink);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.switch-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card-pool .power-switch[aria-checked="true"] {
  background: var(--teal);
  color: #FFFFFF;
}
.card-pool .power-switch[aria-checked="true"] .switch-track {
  background: #6EE4EB;
}
.card-spa .power-switch[aria-checked="true"] {
  background: var(--coral);
  color: #FFFFFF;
}
.card-spa .power-switch[aria-checked="true"] .switch-track {
  background: #FFD180;
}

.power-switch[aria-checked="true"] .switch-thumb {
  transform: translateX(16px);
}

/* Climate Row (Heater + Target Stepper) */
.card-climate {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 2px dashed rgba(42, 30, 23, 0.16);
}

.heater-pill {
  flex: 1;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--cream-soft);
  box-shadow: 2px 2px 0 var(--ink);
  padding: 8px 10px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.18s ease;
}

.heater-pill:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.heater-pill[aria-pressed="true"] {
  background: var(--gold);
  color: var(--ink);
}

.heater-pill.is-heating {
  background: var(--coral);
  color: #FFFFFF;
}

/* 3-way Pool Mode Segmented Control */
.mode-seg {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr;
  gap: 8px;
}

.seg-btn {
  appearance: none;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: var(--cream-soft);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.16s ease;
}

.seg-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

#btnPoolOff[aria-pressed="true"] {
  background: var(--ink);
  color: var(--cream);
}

#btnPoolOn[aria-pressed="true"] {
  background: var(--teal);
  color: #FFFFFF;
}

#btnPoolHeat[aria-pressed="true"] {
  background: var(--coral);
  color: #FFFFFF;
}

.stepper-full {
  width: 100%;
  justify-content: space-between;
  padding: 5px 6px;
}

.stepper-full .step-btn {
  width: 52px;
  height: 44px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--cream-card);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 4px;
  box-shadow: 2px 2px 0 var(--ink);
}

.step-btn {
  appearance: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: var(--cream-soft);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease;
}

.step-btn:active {
  transform: scale(0.93);
  background: var(--shiba-soft);
}

.step-readout {
  min-width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.05;
}

.step-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.08em;
}

.step-val {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}

/* Inline Feature Bar (Pool Lights / Spa Bubbles inside their cards) */
.feature-bar {
  appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: var(--cream-soft);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.2s ease;
}

.feature-bar:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.feature-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.feature-icon {
  font-size: 22px;
  line-height: 1;
}

.feature-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.extra-state {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--cream-card);
}

#btnLights[aria-pressed="true"] {
  background: var(--gold-soft);
}
#btnLights[aria-pressed="true"] .extra-state {
  background: var(--gold);
}

#btnBlower[aria-pressed="true"] {
  background: var(--teal-soft);
}
#btnBlower[aria-pressed="true"] .extra-state {
  background: var(--teal);
  color: #FFFFFF;
}

/* Return to Standby Button */
.all-off-btn {
  appearance: none;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: var(--border);
  background: var(--cream-soft);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
}

.all-off-main {
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.all-off-sub {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.78;
}

.all-off-btn.has-active {
  background: var(--ink);
  color: var(--cream);
}

.all-off-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

/* Collapsible Telemetry Drawer */
.details-drawer {
  background: var(--cream-card);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.details-drawer summary {
  list-style: none;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

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

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

.drawer-chevron {
  transition: transform 0.2s ease;
}

.telemetry-grid {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tele-item {
  background: var(--cream-soft);
  border: 1.5px solid rgba(42, 30, 23, 0.25);
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tele-wide {
  grid-column: 1 / -1;
}

.tele-k {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
}

.tele-v {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

/* Toast Notification */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translate(-50%, 90px);
  opacity: 0;
  pointer-events: none;
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--cream);
  border-radius: 14px;
  padding: 11px 16px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(42, 30, 23, 0.35);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  z-index: 100;
  text-align: center;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Retro Family PIN Overlay */
.pin-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(250, 243, 227, 0.96);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.pin-overlay[hidden] {
  display: none;
}

.pin-card {
  width: 100%;
  max-width: 340px;
  background: var(--cream-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.pin-dog {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pin-dog img {
  width: 100%;
  height: 100%;
  display: block;
}

.pin-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.03em;
}

.pin-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.pin-input {
  width: 100%;
  min-height: 54px;
  border: var(--border);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  padding: 8px 14px;
  outline: none;
}

.pin-input:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(14, 138, 145, 0.25);
}

.pin-error {
  color: var(--coral) !important;
  font-weight: 700;
  font-size: 13px !important;
}

.pin-submit {
  width: 100%;
  min-height: 52px;
  border: var(--border);
  border-radius: 14px;
  background: var(--teal);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.pin-submit:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}
