:root {
  --mood: #e6b422;
  --bg: #fbf7f2;
  --card: #ffffff;
  --text: #2a2622;
  --muted: #7a726a;
  --line: #ece5dc;
  --shadow: 0 20px 50px -20px rgba(60, 40, 20, 0.35);
  --chip: #f1ebe4;
  --wall: #f3ebe1;
  --wall-2: #e7dccd;
  --frame: #ffffff;
  --sky-1: #7cc6f2;
  --sky-2: #d4effe;
  color-scheme: light;
}

/* Ons's lights decide the theme for everyone (data-theme, set by theme.js).
   Before that's known, fall back to the device's preference. */
:root[data-theme="dark"] {
  --bg: #17151a;
  --card: #221f26;
  --text: #f2ede8;
  --muted: #a59d96;
  --line: #34303a;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --chip: #2e2a34;
  --wall: #2c2832;
  --wall-2: #25222b;
  --frame: #d9d6de;
  --sky-1: #16223f;
  --sky-2: #3a4f80;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #17151a;
    --card: #221f26;
    --text: #f2ede8;
    --muted: #a59d96;
    --line: #34303a;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --chip: #2e2a34;
    --wall: #2c2832;
    --wall-2: #25222b;
    --frame: #d9d6de;
    --sky-1: #16223f;
    --sky-2: #3a4f80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--mood) 35%, transparent), transparent 70%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 16px;
  transition: background 0.6s ease;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 20px 20px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}

.card.pop { animation: pop 0.5s ease; }

@keyframes pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .card.pop { animation: none; }
}

.photo-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  background: var(--line);
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: opacity 0.35s ease;
}

.photo-wrap img.fading { opacity: 0; }

.badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: var(--card);
  border: 3px solid var(--mood);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: border-color 0.4s ease;
}

.eyebrow {
  margin: 22px 0 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.mood-label {
  margin: 0;
  font-size: clamp(38px, 11vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  color: var(--mood);
  transition: color 0.4s ease;
}

.caption {
  margin: 10px 0 0;
  font-size: 17px;
  line-height: 1.4;
}

.updated {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.scale {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 18px;
  font-size: 20px;
  flex-wrap: wrap;
}

.scale span {
  opacity: 0.3;
  filter: grayscale(1);
  transition: opacity 0.3s, filter 0.3s, transform 0.3s;
}

.scale span.on {
  opacity: 1;
  filter: none;
  transform: scale(1.3);
}

/* ---- /ons ---- */

h1 {
  margin: 6px 0 4px;
  font-size: 26px;
  font-weight: 800;
}

.sub { margin: 0 0 20px; color: var(--muted); }

form { display: flex; flex-direction: column; gap: 12px; }

input[type="password"] {
  font: inherit;
  font-size: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

input[type="password"]:focus {
  outline: 2px solid var(--mood);
  outline-offset: 1px;
}

button {
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: var(--mood);
  color: #fff;
  cursor: pointer;
  transition: background 0.4s ease, transform 0.1s ease, opacity 0.2s;
}

button:active { transform: scale(0.98); }
button:disabled { opacity: 0.6; cursor: default; }

.link-btn {
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px;
  margin-top: 6px;
}

.error { min-height: 1.4em; margin: 4px 0 0; color: #d64545; font-size: 15px; }
.status { min-height: 1.4em; margin: 10px 0 0; color: var(--muted); font-size: 15px; }

.slider-block { margin: 22px 0 18px; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d64545, #8a6fb0, #8a94a3, #3d6fd8, #e08a2c, #e6b422, #3fae6a, #b44de0, #1fa3c4, #6b7a99, #e0457b);
  outline: none;
  margin: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--card);
  border: 4px solid var(--mood);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--card);
  border: 4px solid var(--mood);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  cursor: grab;
}

input[type="range"]:focus-visible { outline: 2px solid var(--mood); outline-offset: 6px; }

.ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 18px;
}

.ticks button {
  background: none;
  padding: 2px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.45;
}

.ticks button.on { opacity: 1; transform: scale(1.25); }

/* ---- home: rooms with an AC, a window and curtains ---- */

.home-card { text-align: center; }
.home-card .eyebrow { margin-top: 4px; }
.home-sub { margin: 0; font-size: 15px; color: var(--muted); }

.rooms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.room-name { margin: 8px 0 4px; font-size: 15px; font-weight: 700; }

.facts { list-style: none; margin: 0; padding: 0; font-size: 12px; text-align: left; }

.facts li {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  border-top: 1px solid var(--line);
}

.facts .k { color: var(--muted); white-space: nowrap; }
.facts .v { font-weight: 700; text-align: right; }
.facts li.on .v { color: #1d9a5a; }

/* ---- page layout (/ and /ons): room | mood | room ---- */

.office { text-align: center; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.chips .lights-chip { margin: 0; }
.lights-chip.in-meeting { background: #d64545; color: #fff; }

.lights-chip {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 13px;
  font-weight: 700;
}

.office-name {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.layout {
  width: 100%;
  max-width: 1320px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.slot-left { grid-column: 1; grid-row: 1; }
.slot-mid { grid-column: 2; grid-row: 1; }
.slot-right { grid-column: 3; grid-row: 1; }

.room-card { max-width: 400px; justify-self: center; padding: 18px 18px 20px; }
.room-card .room-name { margin: 14px 0 10px; font-size: 26px; font-weight: 800; text-align: center; }
.room-card .facts { font-size: 17px; }
.room-card .facts li { padding: 9px 2px; }

@media (max-width: 1040px) {
  .layout { grid-template-columns: 1fr 1fr; max-width: 820px; }
  .slot-mid { grid-column: 1 / -1; justify-self: center; }
  .slot-left { grid-column: 1; grid-row: 2; }
  .slot-right { grid-column: 2; grid-row: 2; }
}

@media (max-width: 620px) {
  .layout { grid-template-columns: 1fr; }
  .slot-left { grid-column: 1; grid-row: 2; }
  .slot-right { grid-column: 1; grid-row: 3; }
}

/* /ons: each side holds a drawing plus a remote, so it needs wider columns. */
.console-layout { max-width: 1500px; align-items: start; }
.mid-stack { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 420px; justify-self: center; }
.mid-stack .card { max-width: none; }

@media (min-width: 1041px) and (max-width: 1360px) {
  .console-layout { grid-template-columns: 1fr 1fr; max-width: 900px; }
  .console-layout .slot-mid { grid-column: 1 / -1; }
  .console-layout .slot-left { grid-column: 1; grid-row: 2; }
  .console-layout .slot-right { grid-column: 2; grid-row: 2; }
}

.room-console { max-width: 460px; width: 100%; justify-self: center; padding: 16px; }
.room-title { margin: 0 0 12px; font-size: 24px; font-weight: 800; text-align: center; }
.room-console-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.room-console .room-name { display: none; }
.room-console .facts { font-size: 12.5px; margin-top: 8px; }
.room-sliders { display: grid; gap: 12px; margin-top: 14px; }
.room-slider { display: grid; gap: 6px; cursor: pointer; }
.room-slider-head { display: flex; justify-content: space-between; gap: 6px; font-size: 14px; font-weight: 700; }
.room-slider-head output { color: var(--muted); font-weight: 600; white-space: nowrap; }

.room-slider input[type="range"] {
  height: 10px;
  background: linear-gradient(90deg, var(--line), #3fae6a);
}

.room-slider input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; border: 3px solid #3fae6a; }
.room-slider input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 3px solid #3fae6a; }

/* ---- the switches at the top of /ons ---- */

.switches-card { text-align: center; }
.switches-card .status:empty { min-height: 0; margin: 0; }
.switches { display: grid; gap: 10px; margin-top: 14px; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--chip);
  color: var(--text);
  text-align: left;
}

.switch-text { display: grid; gap: 2px; }
.switch-name { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.switch-state { font-size: 17px; font-weight: 800; }

.switch-track {
  position: relative;
  flex: none;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: var(--track-off);
  transition: background 0.25s ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease;
}

.switch[aria-checked="true"] .switch-track { background: var(--track-on); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(24px); }
.switch:focus-visible { outline: 2px solid var(--mood); outline-offset: 2px; }

/* Meeting: green "Available" when off, red "In a meeting" when on. Lights: navy off, yellow on. */
.switch-meeting { --track-off: #3fae6a; --track-on: #d64545; }
.switch-lights { --track-off: #2d3350; --track-on: #f2c94c; }

.sandbox-banner {
  margin: 0;
  padding: 10px 16px;
  border-radius: 14px;
  background: #fff3c4;
  color: #4a3b00;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.sandbox-banner a { color: inherit; }

/* ---- the drawn room ---- */

.scene {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(var(--wall), var(--wall-2));
  border: 1px solid var(--line);
}

.ac {
  position: absolute;
  top: 7%;
  left: 14%;
  right: 14%;
  height: 15%;
  background: #fbfbfd;
  border: 1px solid #d9dbe2;
  border-radius: 10px 10px 14px 14px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.ac::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 16%;
  height: 3px;
  border-radius: 2px;
  background: #c9ccd3;
}

.ac-led {
  position: absolute;
  top: 24%;
  left: 9%;
  width: max(6px, 2.6cqw);
  height: max(6px, 2.6cqw);
  border-radius: 50%;
  background: #c44;
}

.ac-label {
  position: absolute;
  top: 18%;
  left: 18%;
  font: 800 max(8px, 3.6cqw)/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--air-solid);
}

.ac-display {
  position: absolute;
  top: 16%;
  right: 8%;
  padding: 0.25em 0.45em;
  border-radius: 4px;
  background: #1d2230;
  color: #4a5266;
  font: 700 max(11px, 6cqw)/1 ui-monospace, "SF Mono", Menlo, monospace;
}

.scene.ac-on .ac-led { background: #3fd16a; }
.scene.ac-on .ac-display { color: #6fe3ff; text-shadow: 0 0 6px #6fe3ff; }

/* LED button on the remote: the unit's display and lights go dark, the AC keeps running. */
.scene.led-off .ac-led { background: #9aa0aa; }
.scene.led-off .ac-display { color: transparent; text-shadow: none; }
.scene.led-off .ac-label { visibility: hidden; }

.flow {
  position: absolute;
  top: 22%;
  left: 22%;
  right: 22%;
  height: 16%;
  display: flex;
  justify-content: space-around;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 3;
  pointer-events: none;
}

.flow span {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(var(--air), transparent);
  animation: blow var(--speed) linear infinite;
}

.flow span:nth-child(2) { animation-delay: 0.4s; }
.flow span:nth-child(3) { animation-delay: 0.8s; }
.flow span:nth-child(4) { animation-delay: 1.2s; }

.scene.ac-on .flow { opacity: 1; }
.flow span { width: max(3px, 1.3cqw); }
.scene.turbo .flow span { width: max(4px, 1.8cqw); }

/* Air colour follows the mode; speed follows the fan (turbo is fastest). */
.scene { --air: rgba(111, 227, 255, 0.95); --air-solid: #1fa3c4; --speed: 1.6s; }
.scene.mode-heat { --air: rgba(255, 150, 80, 0.95); --air-solid: #e0662c; }
.scene.mode-dry { --air: rgba(140, 180, 255, 0.9); --air-solid: #3d6fd8; }
.scene.mode-fan { --air: rgba(220, 225, 235, 0.95); --air-solid: #6b7a99; }
.scene.mode-auto { --air: rgba(140, 230, 170, 0.95); --air-solid: #3fae6a; }
.scene.fan-low { --speed: 2.4s; }
.scene.fan-high { --speed: 1s; }
.scene.turbo { --speed: 0.55s; }

.scene.swing .flow { transform-origin: 50% 0; animation: swing 2.6s ease-in-out infinite alternate; }

@keyframes swing {
  from { transform: rotate(-14deg); }
  to { transform: rotate(14deg); }
}

@keyframes blow {
  0% { transform: translateY(-40%); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(60%); opacity: 0; }
}

.window {
  position: absolute;
  top: 41%;
  bottom: 9%;
  left: 18%;
  right: 18%;
  border: max(5px, 2cqw) solid var(--frame);
  border-radius: 4px;
  background: linear-gradient(var(--sky-1), var(--sky-2));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* A sliding window: the right pane slides left over the left one as it opens (--win 0..1). */
.pane {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border: 2px solid var(--frame);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0 18%, rgba(255, 255, 255, 0.15) 18% 100%);
}

.pane.l { left: 0; }

.pane.r {
  right: 0;
  z-index: 1;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.15);
  transform: translateX(calc(var(--win, 0) * -100%));
  transition: transform 0.6s ease;
}

/* The roller-blind box above the window. */
.rod {
  position: absolute;
  top: 36%;
  left: 15%;
  right: 15%;
  height: max(6px, 2.6cqw);
  border-radius: 3px;
  background: linear-gradient(#fdfdfb, #dedbd2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 3;
}

/* A roller blind: it comes down from the top as it closes (--cur 0..1 is how far open). */
.blind {
  position: absolute;
  top: 37.5%;
  left: 16%;
  right: 16%;
  height: calc(54.5% * (1 - var(--cur, 1)));
  border-bottom: max(3px, 1.2cqw) solid #b89a4c;
  border-radius: 0 0 2px 2px;
  background: repeating-linear-gradient(180deg, #ead690 0 2.2cqw, #dfc97f 2.2cqw 2.6cqw);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
  transition: height 0.6s ease;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  .flow span, .scene.swing .flow { animation: none; }
  .pane.r, .blind { transition: none; }
}

/* ---- the Midea AC remote on /ons (a physical object: same look in both themes) ---- */

.ac-remote {
  width: 184px;
  padding: 14px 12px 12px;
  border-radius: 26px;
  background: linear-gradient(90deg, #eceef0, #fbfbfc 30%, #fbfbfc 70%, #e6e8eb);
  border: 1px solid #d5d8dd;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45);
  color: #3b3f45;
  text-align: center;
}

.ac-remote svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.lcd {
  height: 124px;
  margin: 0 6px 14px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 3px solid #e2e4e7;
  background: linear-gradient(#bfc6b4, #c9cfbf);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.25);
  color: #2a2e26;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-align: left;
}

.lcd-on { visibility: hidden; position: relative; height: 100%; }
.ac-remote.is-on .lcd-on { visibility: visible; }
.lcd.blink { animation: lcd-blink 0.35s ease; }

@keyframes lcd-blink {
  0% { filter: brightness(1.35); }
  100% { filter: none; }
}

.lcd-top { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; }
.lcd-icon { font-size: 13px; }
.lcd-flags { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; align-items: flex-end; font-size: 8px; font-weight: 700; line-height: 1.3; }
.lcd-set { margin-top: 4px; font-size: 8px; font-weight: 700; letter-spacing: 0.05em; }
.lcd-temp { display: flex; align-items: flex-start; justify-content: center; line-height: 1; }
.lcd-digits { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lcd-unit { margin-top: 3px; font-size: 11px; font-weight: 700; }
.lcd-fan { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; font-size: 8px; font-weight: 700; }
.lcd-fan svg { width: 12px; height: 12px; stroke-width: 2; }
.lcd-bars { display: flex; gap: 2px; align-items: flex-end; }
.lcd-bars i { width: 3px; height: 8px; background: currentColor; opacity: 0.12; }
.lcd-bars i.lit { opacity: 1; }
.lcd .dim { visibility: hidden; }

.ac-remote button {
  padding: 0;
  border: 1px solid #c9cdd2;
  background: radial-gradient(circle at 50% 35%, #f6f7f2, #e3e6dc);
  color: #3b3f45;
  font: 600 11px/1 system-ui, sans-serif;
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.12);
}

.ac-remote button:not(:disabled):active { transform: scale(0.94); }
.ac-remote button:disabled { opacity: 0.45; cursor: not-allowed; }
.ac-remote button:focus-visible { outline: 2px solid #1fa3c4; outline-offset: 2px; }

.rm-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
.rm-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.rm-text { font-size: 10px; }
.ac-remote .rm-power { background: radial-gradient(circle at 50% 35%, #ffb36b, #f39a3c); border-color: #e08a2c; color: #fff; }
.ac-remote [aria-pressed="true"] { box-shadow: 0 0 0 2px #1fa3c4; }
.ac-remote .rm-power[aria-pressed="true"] { box-shadow: 0 0 0 2px #3fd16a; }

.rm-pad {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 1px solid #c9cdd2;
  background: radial-gradient(circle at 50% 35%, #f6f7f2, #e3e6dc);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.14);
}

.ac-remote .rm-pad button { position: absolute; border: 0; background: none; box-shadow: none; }
.ac-remote .rm-up, .ac-remote .rm-down { left: 50%; width: 50px; height: 34px; transform: translateX(-50%); }
.ac-remote .rm-up { top: 2px; }
.ac-remote .rm-down { bottom: 2px; }
.ac-remote .rm-pad .rm-up:active, .ac-remote .rm-pad .rm-down:active { transform: translateX(-50%) scale(0.92); }
.ac-remote .rm-set, .ac-remote .rm-timer { top: 50%; width: 32px; height: 46px; transform: translateY(-50%); font-size: 11px; }
.ac-remote .rm-set { left: 2px; }
.ac-remote .rm-timer { right: 2px; }
.ac-remote .rm-pad .rm-timer:not(:disabled):active { transform: translateY(-50%) scale(0.92); }
.rm-up svg, .rm-down svg { width: 22px; height: 12px; }

.ac-remote .rm-pad .rm-ok {
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid #6f7a5f;
  background: radial-gradient(circle at 50% 35%, #fbfbf7, #eceee6);
  font-size: 14px;
  transform: translate(-50%, -50%);
}

.ac-remote .rm-pad .rm-ok:active { transform: translate(-50%, -50%) scale(0.94); }

.rm-pills { display: flex; justify-content: center; margin: 2px 0 10px; }
.rm-pills button { width: 50px; height: 22px; font-size: 10px; }
.rm-pills button:first-child { border-radius: 11px 0 0 11px; }
.rm-pills button:last-child { border-radius: 0 11px 11px 0; }
.rm-pills button:not(:first-child) { border-left: 0; }

.rm-brand { margin: 18px 0 2px; font: 700 15px/1 system-ui, sans-serif; letter-spacing: 0.02em; color: #5d6168; }

/* ---- pop-out widget (/widget and the Picture-in-Picture window) ---- */

.pop-btn {
  margin-top: 14px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
}

body.widget-page { display: block; padding: 0; min-height: 0; height: 100vh; overflow: hidden; }

.widget {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
}

.widget-photo { position: relative; flex: 1; min-height: 0; display: block; }

.widget-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}

.widget-emoji {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--card);
  border: 3px solid var(--mood);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.widget-text { padding: 8px 12px 10px; text-align: center; }
.widget-label { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--mood); }
.widget-caption { margin: 3px 0 0; font-size: 13px; line-height: 1.3; }
/* Available / In a meeting, as a badge on the photo so it's seen at a glance. */
.widget-meeting {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #2f9a5c;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.widget-meeting.in-meeting { background: #d64545; }
.widget-updated { margin: 3px 0 0; font-size: 11px; color: var(--muted); }

/* Wide, short window: photo on the left, text on the right. */
@media (min-aspect-ratio: 5 / 4) {
  .widget { flex-direction: row; }
  .widget-photo { flex: 0 0 auto; height: 100%; aspect-ratio: 1; }
  .widget-text { align-self: center; text-align: left; }
}

/* ---- /sandbox ---- */

.sandbox-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sandbox-bar .pop-btn { margin: 0; }

.mood-grid {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.mood-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 10px 12px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  font-weight: 400;
  text-align: left;
}

.mood-tile:hover { border-color: var(--tile); }
.mood-tile[aria-pressed="true"] { border-color: var(--tile); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tile) 30%, transparent); }

.mood-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 12px;
  display: block;
}

.mood-tile-head { display: flex; align-items: center; gap: 6px; font-size: 18px; font-weight: 800; color: var(--tile); }
.mood-tile-caption { font-size: 13px; line-height: 1.35; }
.mood-tile-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--tile); flex: none; }

.hidden { display: none !important; }
