/* Dish Lab — kitchen-warm palette
   Concept: friendly-serious school demo. Cream ceramics, deep teal water/machine,
   honey accent, terracotta as warning. Editorial display, workmanlike body. */

:root,
[data-theme='light'] {
  --color-bg: #f4efe4;
  --color-surface: #fbf7ec;
  --color-surface-2: #ffffff;
  --color-surface-offset: #ede6d3;
  --color-border: #d9cfb5;
  --color-divider: #e5ddc7;

  --color-text: #1e2422;
  --color-text-muted: #6b6659;
  --color-text-faint: #a49d8a;

  --color-primary: #0b3d3f;         /* deep teal — machine, links, CTA */
  --color-primary-hover: #0a2f31;
  --color-primary-tint: #cadcdd;

  --color-accent: #d99c1a;          /* honey — highlight, active step */
  --color-accent-soft: #f2d585;

  --color-danger: #b04627;          /* terracotta — failures, warnings */
  --color-danger-soft: #ecc9b7;

  --color-success: #3c6b2f;
  --color-success-soft: #cee0c3;

  --color-water: #4e8f9c;
  --color-soap: #eaf3f2;
  --color-food: #8b5a2b;

  --shadow-sm: 0 1px 2px rgb(30 36 34 / 8%);
  --shadow-md: 0 6px 20px rgb(30 36 34 / 10%);
  --shadow-lg: 0 20px 50px rgb(30 36 34 / 14%);
}

[data-theme='dark'] {
  --color-bg: #14181a;
  --color-surface: #1c2124;
  --color-surface-2: #232a2d;
  --color-surface-offset: #262d30;
  --color-border: #333c40;
  --color-divider: #2a3336;

  --color-text: #e8e4d6;
  --color-text-muted: #9a9484;
  --color-text-faint: #6a6659;

  --color-primary: #6bb2b7;
  --color-primary-hover: #86c3c9;
  --color-primary-tint: #29464a;

  --color-accent: #e8b445;
  --color-accent-soft: #4a3d19;

  --color-danger: #d6785a;
  --color-danger-soft: #4a2d20;

  --color-success: #7bb85f;
  --color-success-soft: #2a3a24;

  --color-water: #6ba4b1;
  --color-soap: #2c393a;
  --color-food: #b98a4d;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-md: 0 6px 20px rgb(0 0 0 / 40%);
  --shadow-lg: 0 20px 50px rgb(0 0 0 / 50%);
}

/* ---- Topbar ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: inherit;
  text-decoration: none;
}
.brand-mark { flex: 0 0 auto; }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.topbar-actions {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

/* ---- Buttons ---- */

.primary,
.secondary,
.ghost {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: var(--transition-interactive);
  border: 1px solid transparent;
  white-space: nowrap;
}
.primary {
  background: var(--color-primary);
  color: #fbf7ec;
}
.primary:hover { background: var(--color-primary-hover); }

.secondary {
  background: var(--color-accent);
  color: #1e2422;
}
.secondary:hover { background: color-mix(in oklab, var(--color-accent) 85%, black); }

.ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.ghost:hover { background: var(--color-surface-offset); }

.tiny {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.tiny:hover { color: var(--color-text); background: var(--color-surface-offset); }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
}
.icon-btn:hover { background: var(--color-surface-offset); }

/* ---- Stage layout ---- */

.stage {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr) minmax(280px, 1fr);
  align-items: stretch;
  min-height: calc(100dvh - 72px);
}

@media (max-width: 1100px) {
  .stage {
    grid-template-columns: 1fr 1fr;
  }
  .scene-panel { grid-column: 1 / -1; order: -1; }
}

@media (max-width: 720px) {
  .stage {
    grid-template-columns: 1fr;
  }
  .scene-panel { order: -1; }
}

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.panel-head h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sensors-head { margin-top: var(--space-2); }

.hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.line-count,
.progress,
.status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.status.running {
  color: var(--color-accent);
  font-weight: 600;
}
.status.done { color: var(--color-success); font-weight: 600; }
.status.error { color: var(--color-danger); font-weight: 600; }

.current-line {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--color-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60%;
}

/* ---- Program editor ---- */

.editor-wrap {
  display: grid;
  grid-template-columns: 32px 1fr;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  overflow: hidden;
  min-height: 240px;
  flex: 1;
}
.gutter {
  background: var(--color-surface-offset);
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: var(--space-3) 0;
  text-align: right;
  user-select: none;
  line-height: 21.7px;
  overflow: hidden;
}
.gutter div {
  padding-right: 8px;
  height: 21.7px;
}
.gutter div.active {
  color: #1e2422;
  background: var(--color-accent);
  font-weight: 700;
}
.gutter div.error {
  color: #fff;
  background: var(--color-danger);
  font-weight: 700;
}
#program {
  border: 0;
  outline: 0;
  padding: var(--space-3);
  resize: none;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 21.7px;
  background: transparent;
  color: var(--color-text);
  min-height: 400px;
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
}

.commands {
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: color-mix(in oklab, var(--color-surface) 90%, var(--color-bg));
}
.commands summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  list-style: none;
}
.commands summary::before {
  content: '›';
  display: inline-block;
  margin-right: var(--space-2);
  transition: transform var(--transition-interactive);
}
.commands[open] summary::before { transform: rotate(90deg); }
.commands ul {
  margin-top: var(--space-3);
  padding-left: var(--space-4);
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-text-muted);
}
.commands code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-offset);
  color: var(--color-text);
}
.commands em { color: var(--color-text-muted); font-style: normal; font-weight: 500; }

.run-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.run-row .primary { flex: 1; min-width: 90px; }

/* ---- Scene ---- */

.scene-panel { padding: var(--space-3); gap: var(--space-3); }
.scene-wrap {
  /* Never shrinks. The panel is a flex column stretched to the grid row; without
     this, every log line that grew the panel's content squeezed the canvas,
     the renderer resized, and the kitchen appeared to jump on every step. */
  flex: 0 0 auto;
  position: relative;
  background: linear-gradient(180deg, #eadfc4 0%, #ded1b2 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 800 / 520;
}
[data-theme='dark'] .scene-wrap {
  background: linear-gradient(180deg, #2b2f2e 0%, #1c2124 100%);
}
#scene { width: 100%; height: 100%; display: block; }

.scene-cam {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: color-mix(in oklab, var(--color-surface) 88%, transparent);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: var(--transition-interactive);
}
.scene-cam:hover { background: var(--color-surface); }

.scene-toast {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: var(--space-4);
  background: var(--color-primary);
  color: #fbf7ec;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 250ms, transform 250ms;
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
.scene-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
.scene-toast.err { background: var(--color-danger); }
.scene-toast.ok { background: var(--color-success); }

/* ---- Log ---- */

.log-wrap {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  /* Fixed height, so a growing log scrolls inside instead of reflowing the panel. */
  height: 180px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.log-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-divider);
  background: var(--color-surface-offset);
}
.log {
  list-style: none;
  padding: var(--space-2) var(--space-3);
  margin: 0;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  flex: 1;
  min-height: 60px;
}
.log li {
  padding: 2px 0;
  color: var(--color-text-muted);
  display: flex;
  gap: var(--space-2);
}
.log li .tag {
  display: inline-block;
  min-width: 3ch;
  color: var(--color-text-faint);
}
.log li.ok { color: var(--color-success); }
.log li.warn { color: var(--color-accent); }
.log li.err { color: var(--color-danger); }
.log li.info { color: var(--color-primary); }

/* ---- Goals + sensors ---- */

.goals, .sensors {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.goals li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  border: 1px solid var(--color-divider);
  font-size: var(--text-sm);
  transition: var(--transition-interactive);
}
.goals li.done {
  background: var(--color-success-soft);
  border-color: color-mix(in oklab, var(--color-success) 40%, transparent);
  color: var(--color-text);
}
.goals li .check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: transparent;
  font-weight: 900;
  font-size: 13px;
}
.goals li.done .check {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fbf7ec;
}
.goals li .goal-label { flex: 1; }

.sensors li {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: var(--transition-interactive);
}
.sensors li.lit {
  border-left-color: var(--color-accent);
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-accent) 12%, transparent);
}
.sensors li .sensor-name {
  font-weight: 600;
  color: var(--color-text);
  min-width: 90px;
}

.grownup {
  margin-top: auto;
  padding: var(--space-4);
  background: var(--color-primary);
  color: #fbf7ec;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.grownup h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
}
.grownup p {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: color-mix(in oklab, #fbf7ec 90%, transparent);
}
.chip {
  align-self: flex-start;
  padding: var(--space-1) var(--space-3);
  background: var(--color-accent);
  color: #1e2422;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-decoration: none;
}
.chip:hover { background: color-mix(in oklab, var(--color-accent) 85%, black); }

/* ---- Dialogs ---- */

.dlg {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  background: var(--color-surface);
  color: var(--color-text);
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.dlg::backdrop {
  background: rgb(0 0 0 / 40%);
  backdrop-filter: blur(4px);
}
.dlg h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-3);
}
.dlg ol, .dlg p { font-size: var(--text-sm); line-height: 1.6; margin-bottom: var(--space-3); }
.dlg ol { padding-left: var(--space-5); }
.dlg ol li { margin-bottom: var(--space-2); }
.dlg code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-offset);
}
.dlg menu {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-4);
  list-style: none;
}
.dlg a { color: var(--color-primary); }

/* ---- Kitchen v2 additions ---- */

.goals li .goal-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.goals li.done .goal-count { color: var(--color-success); }

.panel-head .demo {
  margin-left: auto;
  border: 1px solid var(--color-border);
  white-space: nowrap;
}
.panel-head .demo:disabled { opacity: 0.5; cursor: default; }
/* The scene header keeps one fixed row whatever the status or current line
   says. If it could wrap, every new step would push the canvas down and the
   whole kitchen would appear to jump. */
.scene-panel .panel-head { align-items: center; flex-wrap: nowrap; min-height: 32px; }
.scene-panel .status { flex: 0 0 auto; white-space: nowrap; }
.scene-panel .current-line { flex: 1 1 0; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scene-panel .demo { flex: 0 0 auto; }
@media (max-width: 520px) {
  .scene-panel .current-line { display: none; }
}

.program-links { display: flex; justify-content: flex-end; }
.link {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: var(--color-text); }
.link:disabled { opacity: 0.5; cursor: default; }

body.is-running .run-row button:disabled { opacity: 0.55; cursor: default; }

@media (min-width: 1101px) {
  .scene-panel { position: sticky; top: 88px; align-self: start; }
}

/* ---- v3: tonight's dishes ---- */

.dish-select-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.dish-select-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.dish-select {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.dish-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  user-select: none;
  transition: var(--transition-interactive);
}
.dish-opt input {
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  margin: 0;
  display: inline-block;
}
.dish-opt.on {
  border-color: var(--color-primary);
  color: var(--color-text);
  background: color-mix(in oklab, var(--color-primary) 10%, transparent);
}
.dish-opt.on input { background: var(--color-primary); border-color: var(--color-primary); }
.dish-opt:hover { border-color: var(--color-primary); }
.dish-opt input:disabled { opacity: 0.5; }
.is-running .dish-opt { cursor: not-allowed; opacity: 0.7; }

/* ---- v3: kitchen display ---- */

.display {
  margin-top: var(--space-3);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.display-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.display-actions { display: flex; gap: var(--space-2); }
.display-tiles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}
/* Full names of every dish, one fixed-height row under the tiles, so the
   Washed tile never has to truncate and the sticky panel never changes height. */
.display-line {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-height: 18px;
}
.display-line .dl { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.display-line b { font-weight: 600; color: var(--color-text); margin-right: 6px; }
@media (max-width: 520px) {
  .display-line { grid-template-columns: 1fr; min-height: 36px; }
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  min-width: 0;
}
.tile-k {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-faint);
}
.tile-v {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}
.tile-s {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile.hot .tile-v { color: var(--color-danger); }
.tile.cold .tile-v { color: var(--color-primary); }
.tile.low .tile-v { color: var(--color-danger); }
.tile.live .tile-k::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--color-success);
  vertical-align: middle;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.tile-bar {
  display: block;
  height: 4px;
  margin-top: 4px;
  border-radius: 2px;
  background: var(--color-divider);
  overflow: hidden;
}
.tile-bar i {
  display: block;
  height: 100%;
  background: var(--color-primary);
  transition: width 400ms ease;
}
.tile.low .tile-bar i { background: var(--color-danger); }

.telemetry {
  /* Always a 4 x 2 grid, so a longer reading never adds a row and moves the
     sticky panel. Long values ellipsize. */
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-muted);
  min-height: 34px;
}
.telemetry .tm { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) {
  .telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 68px; }
}
.telemetry .tm b {
  font-weight: 500;
  color: var(--color-text-faint);
  margin-right: 5px;
}
.metrics-json {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

/* ---- v3: goal counts, notebook, log ---- */

.goals li .goal-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-faint);
  font-variant-numeric: tabular-nums;
}
.goals li.done .goal-count { color: var(--color-success); }

.notebook-head {
  margin-top: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notebook-intro { margin-bottom: var(--space-2); }
.notebook {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(to bottom, transparent 0 25px, color-mix(in oklab, var(--color-accent) 22%, transparent) 25px 26px),
    color-mix(in oklab, var(--color-accent) 7%, var(--color-surface));
  border: 1px solid color-mix(in oklab, var(--color-accent) 35%, transparent);
  min-height: 60px;
  transition: box-shadow 300ms ease;
}
.panel.flash .notebook { box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-accent) 45%, transparent); }
.notebook li {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--color-text);
}
.notebook li.empty { color: var(--color-text-muted); font-style: normal; }
.notebook .nb-n {
  font-family: var(--font-mono);
  color: var(--color-accent);
  min-width: 2ch;
  font-size: 11px;
  line-height: 1.7;
}
.notebook-summary {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: var(--space-2) 0 var(--space-3);
}
.log li.nb { color: var(--color-accent); font-weight: 500; }

@media (max-width: 720px) {
  .display-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.display-head { flex-wrap: wrap; gap: var(--space-2); }
.display-actions .tiny { white-space: nowrap; }

/* ---- v3.1: installable sensor ---- */
.sensors li { align-items: center; }
.sensors li .sensor-desc { flex: 1; }
.sensors li .install {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-interactive);
}
.sensors li .install input { appearance: none; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--color-border); margin: 0; }
.sensors li.installed .install { border-color: var(--color-success); color: var(--color-success); background: var(--color-success-soft); }
.sensors li.installed .install input { background: var(--color-success); border-color: var(--color-success); }
.sensors li.installed { border-left-color: var(--color-success); }
.sensors li .install input:disabled { opacity: 0.5; }

/* Family pointer under the grown-up card */
.grownup .family-link {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid color-mix(in oklab, #fbf7ec 30%, transparent);
  font-size: var(--text-sm);
  color: #fbf7ec;
  line-height: 1.55;
}
.grownup .family-link a {
  display: inline-block;
  margin-top: var(--space-1);
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.grownup .family-link a:hover { color: #fbf7ec; }
/* The card keeps its deep-teal ground in dark mode so the light text and the
   honey link stay readable (the dark-mode primary is a pale teal). */
[data-theme='dark'] .grownup { background: #0b3d3f; }
