/* Light and speaker cards, shared by the guest room page and the owner's all-rooms page.
   Accents: pink for lights, blue for speakers (never more than two in one view). */

.offline {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  color: var(--warning);
  font-size: 15px;
  font-weight: 500;
}

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.count { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-top: var(--space-1); }
.head-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---- Lights ---- */

.lights { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }

.light {
  width: 100%;
  min-height: 120px;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  text-align: left;
  transition: transform var(--dur-med) var(--ease-out), background-color var(--dur-med) var(--ease-standard), box-shadow var(--dur-med) var(--ease-standard);
}
button.light:hover:not(:disabled) { transform: translateY(-4px); background: var(--bg-2); box-shadow: var(--shadow-md); }
button.light:active:not(:disabled) { transform: scale(0.98); }
.light.on { background: var(--bg-2); }
.light.unavailable { opacity: 0.55; }

.light-row { display: flex; align-items: center; gap: var(--space-4); }
.bulb {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background-color: var(--bg-3);
  background-image: var(--dot-texture);
  background-size: var(--dot-texture-size);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.light.on .bulb { background-color: var(--pink-500); background-image: none; color: var(--text-on-pastel); }
.light-name { font-size: 18px; font-weight: 700; line-height: 1.3; }
.light-status { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-top: 2px; }
.light.on .light-status { color: var(--pink-500); }

.light input[type="range"], .volume input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--pink-500); }

/* ---- Speakers ---- */

.speakers { display: flex; flex-direction: column; gap: var(--space-5); }

.speaker {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.speaker-label { display: flex; align-items: center; gap: var(--space-2); }
.speaker-label .display { margin: 0; font-size: 1.75rem; }
/* The speaker's name is the button that shows its volume; the pill hints at it and shows the current level. */
.speaker-heading { margin: 0; flex-grow: 1; min-width: 0; }
.speaker-toggle {
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  text-align: left;
}
.speaker-toggle .display { overflow-wrap: anywhere; }
.speaker-hint {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.speaker-toggle:hover .speaker-hint { border-color: var(--lavender-500); color: var(--text-primary); }
.speaker-toggle[aria-expanded="true"] .speaker-hint { border-color: var(--blue-500); color: var(--blue-500); }
.volume[hidden] { display: none; }
.now { display: flex; align-items: center; gap: var(--space-4); }
.play {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--blue-500);
  color: var(--text-on-pastel);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-standard);
}
.play:hover:not(:disabled) { transform: translateY(-1px); background: var(--blue-300); }
.play:active:not(:disabled) { transform: scale(0.97); }
.play:disabled {
  background-color: var(--bg-3);
  background-image: var(--dot-texture);
  background-size: var(--dot-texture-size);
  color: var(--text-secondary);
}
.now-state { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary); }
.now-title { font-size: 22px; font-weight: 700; line-height: 1.3; margin-top: var(--space-1); overflow-wrap: anywhere; }
.now-sub { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.volume { display: flex; align-items: center; gap: var(--space-3); color: var(--text-secondary); }
.volume input[type="range"] { accent-color: var(--blue-500); }
.volume-value { width: 44px; text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.divider { height: 1px; background: var(--border-subtle); }
.presets { display: flex; flex-direction: column; gap: var(--space-2); }
.presets .eyebrow { margin-bottom: var(--space-1); }
.preset {
  min-height: 56px;
  padding: 10px var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.preset:hover { transform: translateY(-1px); background: var(--bg-2); border-color: var(--lavender-500); }
.preset:active { transform: scale(0.97); }
.preset-name { font-size: 16px; font-weight: 700; }
.preset-sub { font-size: 13px; color: var(--text-secondary); }

/* ---- Thermostats (owner page only). Neutral colors: the page already uses its two accents. ---- */

.climate {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.climate.unavailable { opacity: 0.55; }
.climate-current { font-size: 56px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: var(--space-1); }
.modes { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.mode {
  min-height: 44px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
.mode:hover:not(:disabled):not(.active) { border-color: var(--lavender-500); }
.mode.active { background: var(--text-primary); border-color: var(--text-primary); color: var(--ink); }
.setpoints { display: flex; flex-direction: column; gap: var(--space-2); }
.setpoints:empty { display: none; }
.stepper { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: var(--space-3); }
.stepper-label { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.stepper-value { min-width: 64px; text-align: center; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.step {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-standard);
}
.step:hover { background: var(--bg-3); }
.step:active { transform: scale(0.94); }
