[data-theme="warm"] {
  background: var(--warm-bg);
  color: var(--warm-text);
}

[data-theme="warm"] h1,
[data-theme="warm"] h2 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--warm-text);
}

[data-theme="warm"] h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.1; }
[data-theme="warm"] h2 { font-size: 1.75rem; margin-bottom: 1.5rem; }

/* Card */
.warm-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}


/* Pull quote */
.pull-quote {
  border-left: 4px solid var(--warm-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--warm-muted);
  background: rgba(232, 135, 90, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Accordion */
details {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0.75rem 0;
}
details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details summary::after { content: "+"; font-size: 1.2rem; opacity: 0.5; }
details[open] summary::after { content: "−"; }
details > *:not(summary) { margin-top: 0.75rem; }

/* Offline banner */
.offline-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #92400e;
}

/* Card internals */
.card-heading { font-size: 1.1rem; margin-bottom: 0.75rem; }
.brain-list   { margin: 1rem 0 0 1.5rem; line-height: 2; }
.fun-facts    { margin-left: 1.25rem; line-height: 2; }

/* Mood table */
.mood-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; table-layout: fixed; word-wrap: break-word; }
.mood-table-header th { text-align: left; padding: 0.5rem; color: var(--warm-muted); border-bottom: 1px solid rgba(0,0,0,0.08); }
.mood-table td { padding: 0.5rem; }


/* ── Live Dashboard — Bands ───────────────────────────────────── */

.band {
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.band-presence {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  align-items: start;
  background: transparent;
}

@media (max-width: 900px) {
  .band-presence { grid-template-columns: repeat(2, 1fr); }
}

.band-world {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: rgba(0, 0, 0, 0.03);
}

.band-hidden { display: none; }

@media (max-width: 640px) {
  .band-presence { grid-template-columns: 1fr; }
  .carousel-slide { padding: 1.25rem 1rem 1rem; border-radius: 20px; }
  .band { padding: 1rem; }
  .presence-card { padding: 0.9rem 1rem 0.8rem; }
}

/* ── Presence cards ───────────────────────────────────────────────── */

.presence-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.2rem 1rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
}

.card-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm-muted);
  margin: 0 0 0.25rem;
  opacity: 0.7;
}

.presence-card-mood {
  align-items: center;
  text-align: center;
}

.presence-sparklines {
  width: 100%;
  margin-top: 0.4rem;
}

.presence-card-state {
  justify-content: flex-start;
  gap: 0.5rem;
}

/* State card rows */
.state-obi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0 0.3rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 0.1rem;
}

.state-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.state-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warm-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.state-stat-val {
  font-weight: 500;
  color: var(--warm-text);
  text-align: right;
}

.state-stat-unit {
  font-size: 0.65rem;
  color: var(--warm-muted);
  margin-left: 0.15rem;
}

.state-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warm-muted);
  font-weight: 600;
  margin-top: 0.6rem;
}

/* Obi mode badge */
.obi-mode-badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
}

.obi-badge-unknown  { background: #9ca3af; }
.obi-badge-absent   { background: #6b7280; }
.obi-badge-calm     { background: #16a34a; }
.obi-badge-active   { background: #2ea8e0; }
.obi-badge-busy     { background: #dc2626; }

.proximity-bar-track--inline {
  width: 100%;
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}

/* ── Speech Bubble card ───────────────────────────────────────────── */

.presence-card-speech {
  position: relative;
}

.speech-bubble {
  background: var(--warm-bg, #fdf8f0);
  border: 2px solid var(--warm-accent);
  border-radius: 18px 18px 18px 4px;
  padding: 0.75rem 1rem;
  position: relative;
  margin: 0.1rem 0 0.5rem;
}

.speech-bubble::before {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 14px;
  border: 7px solid transparent;
  border-top-color: var(--warm-accent);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 16px;
  border: 5px solid transparent;
  border-top-color: var(--warm-bg, #fdf8f0);
}

.speech-bubble-text {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--warm-text);
  line-height: 1.6;
  margin: 0;
}

/* ── Mood Pulse ───────────────────────────────────────────────── */

.pulse-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--warm-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

@keyframes pulse-slow {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}
@keyframes pulse-mid {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.1); }
}
@keyframes pulse-fast {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}

.pulse-slow { animation: pulse-slow 4s ease-in-out infinite; }
.pulse-mid  { animation: pulse-mid  2.5s ease-in-out infinite; }
.pulse-fast { animation: pulse-fast 1.5s ease-in-out infinite; }

.pulse-offline {
  animation: none;
  background: transparent;
  border: 3px solid var(--warm-muted);
  color: var(--warm-muted);
}

.last-spoken-age {
  font-size: 0.7rem;
  color: var(--warm-muted);
  opacity: 0.65;
  margin-top: 0.2rem;
}

.salience-sparkline-row {
  margin-top: 0.6rem;
}

.wx-metric-row-last { border-bottom: none; padding-bottom: 0; }

/* ── Proximity Display ────────────────────────────────────────── */

.proximity-display {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}

.proximity-reading {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  line-height: 1;
}

.proximity-cm {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--warm-text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.proximity-unit {
  font-size: 0.7rem;
  color: var(--warm-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.2rem;
}

.proximity-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.proximity-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: #16a34a;
  transition: width 0.6s ease, background 0.4s ease;
}
.proximity-bar-fill.prox-close { background: #dc2626; }
.proximity-bar-fill.prox-mid   { background: #d97706; }
.proximity-bar-fill.prox-far   { background: #16a34a; }


/* ── Detections list (Frigate all-objects) ───────────────────── */
.detections-empty {
  font-size: 0.78rem;
  color: var(--warm-muted);
  font-style: italic;
  margin: 0.25rem 0 0;
}

.ha-person-unknown {
  font-size: 0.78rem;
  color: var(--warm-muted);
  font-style: italic;
}

.detections-list,
.ha-presence-list {
  list-style: none;
  padding: 0;
  margin: 0.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.detection-item {
  display: grid;
  grid-template-columns: 6rem 1fr 2.5rem;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
}
.detection-label {
  color: var(--warm-text);
  font-weight: 500;
  text-transform: capitalize;
}
.detection-bar-wrap {
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.detection-bar-fill {
  height: 100%;
  background: var(--warm-accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.detection-conf {
  color: var(--warm-muted);
  text-align: right;
  font-size: 0.72rem;
}

/* ── Who's home (HA presence) ────────────────────────────────── */
.ha-person-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
}
.ha-dot         { font-size: 0.6rem; }
.ha-dot-home    { color: #16a34a; }
.ha-dot-away    { color: #d97706; }
.ha-dot-unknown { color: #9ca3af; }
.ha-person-name { font-weight: 500; color: var(--warm-text); flex: 1; }
.ha-person-state {
  font-size: 0.7rem;
  color: var(--warm-muted);
  text-transform: lowercase;
}

.section-eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--warm-muted);
  font-weight: 700;
  margin: 0 0 0.2rem;
}
.ambient-level {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--warm-text);
}


/* ── Sound level val + waveform inline ──────────────────────────── */

.sound-val-wave-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.1rem;
}

.sound-val-wave-row .wx-card-val {
  flex-shrink: 0;
  font-size: 1rem;
  white-space: nowrap;
  margin-bottom: 0;
}

.sound-val-wave-row canvas {
  flex: 1;
  min-width: 0;
}

/* ── World Band: Sound + noise cards (side by side) ──────────────── */

.wx-card-sound,
.wx-card-noise {
  flex: 1;
}

.wx-card-sound {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* Put sound + noise in a row inside band-world */
.band-world > .wx-card-sound,
.band-world > .wx-card-noise {
  display: inline-flex;
}

/* Wrap sound + noise together — auto via adjacent sibling order; use a row wrapper */
.band-world {
  /* Sound + noise as first two children side-by-side */
}

.band-world .sound-noise-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 480px;
}

@media (max-width: 480px) {
  .band-world .sound-noise-row { grid-template-columns: 1fr; }
}

/* ── World Band: Weather card grid ────────────────────────────── */

.wx-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .wx-card-grid { grid-template-columns: 1fr; }
}

.wx-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
}

.wx-card-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.wx-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-muted);
  flex-shrink: 0;
}

.weather-symbol { font-size: 0.9rem; }

.wx-card-val {
  font-size: 1.05rem;
  font-weight: 600;
  text-align: right;
  color: var(--warm-text);
  white-space: nowrap;
}

/* Smaller val for longer strings like wind direction */
.wx-card-val-sm {
  font-size: 0.82rem;
  font-weight: 500;
}

/* ── Labeled sparkline rows (ambient noise strip) ──────────────── */

.wx-metric-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.3rem 0;
}

.wx-metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warm-muted);
  font-weight: 600;
}


/* ── Machine Band Toggle ─────────────────────────────────────── */

/* ── Metric Grid ─────────────────────────────────────────────── */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 1rem 0 0.5rem;
}
@media (max-width: 640px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
}

.metric-tile {
  background: #fff;
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  cursor: default;
}

.metric-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-muted);
  margin-bottom: 0.5rem;
}
.metric-value { font-size: 1.1rem; font-weight: 600; margin-top: 0.4rem; }

.metric-bar-wrap {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 3px;
  overflow: hidden;
}
.metric-bar {
  height: 100%;
  width: 0%;
  background: var(--warm-accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.metric-bar.warn { background: #d97706; }
.metric-bar.crit { background: #dc2626; }

.metric-tile.disk-warn .metric-value { color: #d97706; }
.metric-tile.disk-crit .metric-value { color: #dc2626; }


/* Sparkline context label */
.sparkline-ctx-label {
  font-size: 0.65rem;
  color: var(--warm-muted);
  opacity: 0.6;
  margin: 0.1rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Services strip (horizontal bar above metric tiles) */
.services-strip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.services-strip-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--warm-muted);
  font-weight: 600;
  white-space: nowrap;
  margin-right: 0.25rem;
}
.services-strip-dots {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.service-dot-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: var(--warm-muted);
  white-space: nowrap;
}
.dot-ok   { color: #16a34a; }
.dot-warn { color: #d97706; }
.dot-err  { color: #dc2626; }

/* Sparkline canvas */
.sparkline-canvas { display: block; margin-top: 0.5rem; width: 100%; max-width: 100%; }
.sparkline-label  { font-size: 0.7rem; color: var(--warm-muted); margin-top: 0.2rem; }

/* ── Thoughts Carousel — thought bubble ──────────────────────────── */

.thought-carousel {
  position: relative;
  margin-top: 2.5rem;
  padding-bottom: 4.5rem;
  overflow: clip;
  transition: height 0.3s ease;
}

/* Thought bubble container */
.carousel-slide {
  position: absolute;
  top: 0; left: 0; right: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
  /* Thought-bubble shape */
  background: #fff;
  border-radius: 32px;
  padding: 1.75rem 2rem 1.5rem;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.07),
    0 1px 6px rgba(0,0,0,0.04);
}

/* Bubble tail — two stacked circles above-left, classic thought bubble */
.carousel-slide::before,
.carousel-slide::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Larger inner circle */
.carousel-slide::before {
  width: 22px;
  height: 22px;
  bottom: -30px;
  left: 36px;
}

/* Smaller outer circle */
.carousel-slide::after {
  width: 12px;
  height: 12px;
  bottom: -46px;
  left: 28px;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.carousel-mood-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--warm-accent);  /* fallback */
}
.carousel-mood-badge[data-mood="peaceful"],
.carousel-mood-badge[data-mood="content"]      { background: var(--mood-content); }
.carousel-mood-badge[data-mood="contemplative"] { background: var(--mood-contemplative); }
.carousel-mood-badge[data-mood="curious"]       { background: var(--mood-curious); }
.carousel-mood-badge[data-mood="active"]        { background: var(--mood-active); }
.carousel-mood-badge[data-mood="excited"]       { background: var(--mood-excited); }

.carousel-quote {
  font-family: 'Courier Prime', 'Courier New', monospace;
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--warm-text);
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  max-width: 100%;
}

.carousel-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--warm-muted);
  margin: 0 0 0.75rem;
  letter-spacing: 0.03em;
}

.carousel-salience {
  letter-spacing: 0.05em;
  color: var(--warm-accent);
  font-size: 0.72rem;
}

.carousel-dots {
  display: flex;
  justify-content: flex-start;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.15);
  cursor: pointer;
  padding: 0;
  transition: background 0.3s ease, transform 0.2s ease;
}

.carousel-dot.active {
  background: var(--warm-accent);
  transform: scale(1.35);
}
