/* Room controls. A calm, tactile screen over the portal: big cards, generous
   space, light that glows with the lights, warmth that follows the
   thermostat. Everything animates for a reason (the room changed) and none of
   it moves for anyone who asked for less motion. */

html.ctl-open, html.ctl-open body { overflow: hidden; }

.ctl {
  --ctl-glow: .6;          /* 0..1, the room's average brightness */
  --ctl-warm: .5;          /* 0..1, low..high end of the thermostat range */
  --ctl-r: 22px;
  position: fixed; inset: 0; z-index: 60;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 60% at 50% -10%,
      rgba(255, calc(200 + 30 * (1 - var(--ctl-warm))), calc(140 + 90 * (1 - var(--ctl-warm))), calc(.10 + .22 * var(--ctl-glow))),
      transparent 60%),
    var(--canvas, #F6F4F0);
  color: var(--ink-900, #14161A);
  padding: 0 18px calc(48px + env(safe-area-inset-bottom));
  opacity: 0; transform: translateY(14px);
  transition: opacity .28s ease, transform .32s cubic-bezier(.2,.8,.2,1), background 1.6s ease;
}
.ctl.is-open { opacity: 1; transform: none; }
.ctl[data-mood="sleep"], .ctl[data-mood="evening"] { filter: saturate(.92) brightness(.97); }

.ctl-top { display: flex; align-items: center; gap: 12px; max-width: 980px; margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 0 4px; }
.ctl-back { appearance: none; border: 0; background: rgba(255,255,255,.7); backdrop-filter: blur(8px);
  border-radius: 999px; padding: 10px 16px; font: inherit; font-size: 15px; color: inherit;
  cursor: pointer; min-height: 44px; }
.ctl-demo { font-size: 12.5px; color: var(--ink-500, #6b6f76); background: rgba(255,255,255,.6);
  border-radius: 999px; padding: 6px 12px; }

.ctl-head { max-width: 980px; margin: 0 auto; padding: 18px 0 8px; }
.ctl-eyebrow { margin: 0; font-size: 14px; color: var(--ink-500, #6b6f76); }
.ctl-title { margin: 2px 0 6px; font-family: var(--font-display, inherit); font-weight: 500;
  font-size: clamp(36px, 9vw, 52px); letter-spacing: -.02em; line-height: 1.05; }
.ctl-sub { margin: 4px 0; color: var(--ink-500, #6b6f76); font-size: 15px; }
.ctl-suggest { appearance: none; border: 1px solid var(--border, #e5e2dc); background: rgba(255,255,255,.75);
  border-radius: 999px; padding: 10px 16px; margin: 10px 8px 0 0; font: inherit; font-size: 14.5px;
  color: inherit; cursor: pointer; min-height: 44px; }

.ctl-body { max-width: 980px; margin: 0 auto; }
.ctl-sec { margin: 22px 0 6px; }
.ctl-h { font-size: 15px; font-weight: 500; margin: 0 0 10px; color: var(--ink-600, #4b4f56); }

/* ---- set the mood ---- */
.ctl-moods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ctl-mood { appearance: none; border: 0; border-radius: 18px; min-height: 72px; padding: 16px;
  text-align: left; font: inherit; font-size: 17px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, #8a7a62, #5e5444);
  box-shadow: 0 8px 22px -14px rgba(0,0,0,.5);
  transition: transform .18s ease, box-shadow .25s ease; }
.ctl-mood--morning { background: linear-gradient(135deg, #e9c98a, #c99b5a); color: #2b2216; }
.ctl-mood--relax { background: linear-gradient(135deg, #c98d5f, #8f5a3a); }
.ctl-mood--evening { background: linear-gradient(135deg, #6c5a7c, #3d3350); }
.ctl-mood--sleep { background: linear-gradient(135deg, #3a4256, #1c2130); }
.ctl-mood--away { background: linear-gradient(135deg, #9aa1a8, #6b7279); }
.ctl-mood__n { font-weight: 500; }

/* ---- cards ---- */
.ctl-bigs { display: grid; gap: 14px; margin-top: 18px; }
.ctl-card { position: relative; background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border: 1px solid rgba(0,0,0,.05); border-radius: var(--ctl-r); padding: 20px;
  box-shadow: 0 10px 30px -22px rgba(0,0,0,.35); }
.ctl-card--big { padding: 22px 22px 18px; }
.ctl-card__head { display: flex; align-items: center; gap: 10px; }
.ctl-card__t { margin: 0; font-size: 17px; font-weight: 500; }
.ctl-card__v { margin: 2px 0 0; font-size: 15px; color: var(--ink-600, #4b4f56); }
.ctl-card__foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.grow { flex: 1; }

.ctl-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2, #efece6); color: var(--ink-700, #33363c); flex: none; }
.ctl-ic svg { width: 20px; height: 20px; }

/* tactile press: the control gives a little, then settles */
.is-pressed { animation: ctl-press .22s ease; }
@keyframes ctl-press { 0% { transform: scale(1); } 40% { transform: scale(.95); } 100% { transform: scale(1); } }

/* ---- temperature ---- */
.ctl-temp { overflow: hidden; }
.ctl-temp::before { content: ""; position: absolute; inset: -40%; pointer-events: none;
  background: radial-gradient(closest-side,
    rgba(calc(120 + 135 * var(--ctl-warm)), calc(170 + 30 * var(--ctl-warm)), calc(255 - 150 * var(--ctl-warm)), .22),
    transparent 70%);
  transition: background 1.2s ease; }
.ctl-temp__dial { position: relative; width: min(78vw, 280px); aspect-ratio: 1; margin: 6px auto 0; }
.ctl-temp__ring { width: 100%; height: 100%; touch-action: none; cursor: grab; transform: rotate(0deg); }
.ctl-ring__bg { fill: none; stroke: var(--surface-2, #efece6); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 432 1000; transform: rotate(126deg); transform-origin: 50% 50%; }
.ctl-temp__ring .ctl-ring__fg { fill: none; stroke-width: 10; stroke-linecap: round;
  stroke: rgb(calc(110 + 140 * var(--ctl-warm)), calc(150 + 20 * var(--ctl-warm)), calc(230 - 160 * var(--ctl-warm)));
  transform: rotate(126deg); transform-origin: 50% 50%;
  transition: stroke-dashoffset .3s cubic-bezier(.2,.8,.2,1), stroke 1s ease; }
.ctl-ring__knob { fill: #fff; stroke: rgba(0,0,0,.15); stroke-width: 1.5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2)); transition: cx .3s ease, cy .3s ease; }
.ctl-temp__mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  pointer-events: none; }
.ctl-temp__now { margin: 0; font-size: 13px; color: var(--ink-500, #6b6f76); }
.ctl-temp__big { margin: 0; font-size: clamp(64px, 18vw, 88px); line-height: 1; font-weight: 300;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ctl-temp__n { display: inline-block; transition: transform .25s ease; }
.ctl-temp__n.is-ticking { transform: scale(1.06); }
.ctl-temp__deg { font-size: .45em; vertical-align: top; margin-left: 2px; }
.ctl-temp__word { margin: 6px 0 0; font-size: 15px; font-weight: 500; }
.ctl-temp__btns { display: flex; justify-content: center; align-items: center; gap: 28px; margin: 4px 0 8px; }
.ctl-round { appearance: none; width: 60px; height: 60px; border-radius: 50%; border: 1px solid var(--border, #e5e2dc);
  background: #fff; font: inherit; font-size: 28px; line-height: 1; color: inherit; cursor: pointer;
  box-shadow: 0 6px 16px -10px rgba(0,0,0,.4); transition: transform .15s ease; }
.ctl-round:active { transform: scale(.92); }
.ctl-round--lg { width: 76px; height: 76px; font-size: 22px; background: var(--ink-900, #14161A); color: #fff; }

/* visually hidden but focusable: the accessible slider behind the dial */
.ctl-sr { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.ctl-sr:focus-visible + .ctl-chips { outline: 2px solid var(--ink-900); outline-offset: 4px; }

.ctl-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.ctl-chips--wide { justify-content: stretch; }
.ctl-chips--wide .ctl-chip { flex: 1; }
.ctl-chip { appearance: none; border: 1px solid var(--border, #e5e2dc); background: #fff; border-radius: 999px;
  padding: 11px 18px; min-height: 44px; font: inherit; font-size: 15px; color: inherit; cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .15s ease, box-shadow .3s ease; }
.ctl-chip[aria-pressed="true"] { background: var(--ink-900, #14161A); color: #fff; border-color: transparent;
  box-shadow: 0 0 0 6px rgba(255, 196, 120, .18); }

/* ---- lights: the card itself lights up ---- */
.ctl-light { --b: .6; overflow: hidden; }
.ctl-light::before { content: ""; position: absolute; inset: -30% -30% auto auto; width: 90%; aspect-ratio: 1;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, calc(.15 + .55 * var(--b))), transparent 70%);
  transition: background .35s ease; }
.ctl-light .ctl-ic--glow { background: rgba(255, 214, 140, calc(.25 + .75 * var(--b)));
  box-shadow: 0 0 calc(30px * var(--b)) rgba(255, 196, 110, calc(.8 * var(--b))); transition: all .35s ease; }
.ctl-light__big { margin: 14px 0 0; font-size: 56px; font-weight: 300; line-height: 1; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums; }
.ctl-light__unit { font-size: .45em; margin-left: 2px; }
.ctl-light__track { position: relative; height: 64px; margin: 16px 0 6px; border-radius: 18px;
  background: var(--surface-2, #efece6); overflow: hidden; }
.ctl-light__fill { position: absolute; inset: 0 auto 0 0; width: 50%;
  background: linear-gradient(90deg, rgba(255, 205, 130, .55), rgba(255, 226, 170, calc(.6 + .4 * var(--b))));
  box-shadow: 0 0 calc(40px * var(--b)) rgba(255, 200, 120, calc(.7 * var(--b)));
  transition: width .12s linear; }
.ctl-light__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0;
  cursor: pointer; touch-action: pan-y; }
.ctl-light__range:focus-visible ~ * , .ctl-light__track:focus-within { outline: 2px solid var(--ink-900); outline-offset: 3px; }

.ctl-toggle { appearance: none; width: 56px; height: 34px; border-radius: 999px; border: 0; padding: 3px;
  background: var(--surface-3, #ddd8cf); cursor: pointer; transition: background .25s ease; }
.ctl-toggle[aria-checked="true"] { background: #e8b770; }
.ctl-toggle__k { display: block; width: 28px; height: 28px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
.ctl-toggle[aria-checked="true"] .ctl-toggle__k { transform: translateX(22px); }

.ctl-link { appearance: none; border: 0; background: none; padding: 10px 4px; min-height: 44px; font: inherit;
  font-size: 15px; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ctl-link--quiet { color: var(--ink-500, #6b6f76); }

/* ---- small cards ---- */
.ctl-smalls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.ctl-smallwrap { display: flex; flex-direction: column; }
.ctl-small { appearance: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
  min-height: 132px; display: flex; flex-direction: column; gap: 6px; width: 100%;
  transition: transform .15s ease, background .4s ease, box-shadow .4s ease; }
.ctl-small__t { margin: 8px 0 0; font-size: 16px; font-weight: 500; }
.ctl-small__v { margin: 0; font-size: 14.5px; color: var(--ink-600, #4b4f56); }
.ctl-small.is-on { background: rgba(255, 247, 234, .95); box-shadow: 0 10px 30px -18px rgba(220, 140, 60, .55); }
.ctl-small--fireplace.is-on .ctl-ic, .ctl-small--sauna.is-on .ctl-ic { background: #f6c58c; color: #6b3a10; }
.ctl-small.is-ready { box-shadow: 0 0 0 2px #e8b770, 0 10px 30px -18px rgba(220, 140, 60, .55); }
.ctl-off { opacity: .8; }
.ctl-off .ctl-small__v { margin: 6px 0; }

/* ---- feedback ---- */
.ctl-status { min-height: 0; font-size: 14px; margin-top: 6px; }
.ctl-status:empty { display: none; }
.ctl-status.is-busy { color: var(--ink-500, #6b6f76); }
.ctl-status.is-ok { color: #2f6a3b; }
.ctl-status.is-error { color: #8a3b12; background: #fbf0e8; border-radius: 14px; padding: 10px 12px; }
.ctl-status p { margin: 0; }
.ctl-status__row { display: flex; gap: 14px; }
.ctl-status__more { margin-top: 6px !important; }
.ctl-toast { position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 12px); opacity: 0; background: var(--ink-900, #14161A); color: #fff;
  border-radius: 999px; padding: 12px 20px; font-size: 15px; pointer-events: none;
  transition: opacity .2s ease, transform .25s ease; max-width: calc(100% - 40px); text-align: center; }
.ctl-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.ctl-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.ctl-btn { appearance: none; border: 0; border-radius: 999px; background: var(--ink-900, #14161A); color: #fff;
  font: inherit; font-size: 16px; padding: 16px 26px; min-height: 52px; width: 100%; margin-top: 14px;
  cursor: pointer; transition: transform .15s ease, opacity .2s ease; }
.ctl-btn:disabled { opacity: .5; }
.ctl-btn--sm { width: auto; padding: 10px 16px; min-height: 40px; font-size: 14px; margin-top: 8px; }
.ctl-big { margin: 8px 0 2px; font-size: 28px; font-weight: 400; letter-spacing: -.01em; }

/* ---- bottom sheets ---- */
.ctl-sheet { position: fixed; inset: 0; z-index: 70; background: rgba(20,22,26,0);
  display: flex; align-items: flex-end; justify-content: center; transition: background .25s ease; }
.ctl-sheet.is-open { background: rgba(20,22,26,.32); }
.ctl-sheet__panel { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--paper, #fff); border-radius: 26px 26px 0 0;
  padding: 10px 22px calc(26px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.ctl-sheet.is-open .ctl-sheet__panel { transform: none; }
.ctl-sheet__panel.is-warm { background: linear-gradient(180deg, #fff6ea, #fff 60%); }
.ctl-sheet__grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3, #ddd8cf); margin: 2px auto 10px; }
.ctl-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.ctl-sheet__t { margin: 0; font-size: 22px; font-weight: 500; }
.ctl-x { appearance: none; border: 0; background: var(--surface-2, #efece6); width: 40px; height: 40px;
  border-radius: 50%; font-size: 22px; cursor: pointer; color: inherit; }

.ctl-zone { --b: .5; padding: 14px 0; border-top: 1px solid var(--surface-2, #efece6); }
.ctl-zone__top { display: flex; justify-content: space-between; font-size: 16px; }
.ctl-zone__v { color: var(--ink-500, #6b6f76); }
.ctl-zone__range, .ctl-vol { width: 100%; margin-top: 10px; accent-color: #d99a4e; min-height: 32px; }

/* the window the shades come down over */
.ctl-window { position: relative; height: 260px; border-radius: 16px; overflow: hidden; margin: 14px 0;
  border: 6px solid #e9e4dc; touch-action: none; cursor: ns-resize; }
.ctl-window__sky { position: absolute; inset: 0;
  background: linear-gradient(180deg, #a9c8e6 0%, #dfe9f1 55%, #8fb08a 56%, #6f9168 100%); }
.ctl-window__bars { position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 49.3%, #e9e4dc 49.3%, #e9e4dc 50.7%, transparent 50.7%); }
.ctl-window__shade { position: absolute; left: 0; right: 0; top: 0; height: 0;
  background: repeating-linear-gradient(180deg, rgba(236,228,214,.94) 0 14px, rgba(222,212,196,.94) 14px 16px);
  box-shadow: 0 4px 10px rgba(0,0,0,.18); transition: height .25s cubic-bezier(.2,.8,.2,1); }
.ctl-window:focus-visible { outline: 3px solid var(--ink-900); outline-offset: 3px; }

/* fire */
.ctl-flame { display: grid; place-items: center; margin: 12px auto 4px; width: 96px; height: 96px; border-radius: 50%;
  background: var(--surface-2, #efece6); transition: background .8s ease, box-shadow .8s ease; }
.ctl-flame .ctl-ic { width: 64px; height: 64px; background: none; color: #9a8f80; }
.ctl-flame .ctl-ic svg { width: 44px; height: 44px; }
.ctl-flame.is-on { background: radial-gradient(circle, #ffd9a0, #f3a15a); box-shadow: 0 0 60px rgba(243,161,90,.55); }
.ctl-flame.is-on .ctl-ic { color: #8a3b12; animation: ctl-flicker 1.6s ease-in-out infinite; }
@keyframes ctl-flicker { 0%,100% { transform: scale(1) rotate(-1deg); } 50% { transform: scale(1.06) rotate(1.5deg); } }
.ctl-ack { background: #fff3e2; border-radius: 16px; padding: 14px; margin-top: 10px; }
.ctl-ack p { margin: 0; }

/* sauna */
.ctl-sauna { position: relative; width: 200px; height: 200px; margin: 10px auto; }
.ctl-sauna__ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ctl-sauna__ring .ctl-ring__bg { stroke-dasharray: none; transform: none; stroke-width: 8; }
.ctl-sauna__ring .ctl-ring__fg { fill: none; stroke: #e39a52; stroke-width: 8; stroke-linecap: round;
  transition: stroke-dashoffset 1s linear; }
.ctl-sauna__ring.is-ready .ctl-ring__fg { stroke: #c9763a; filter: drop-shadow(0 0 6px rgba(227,154,82,.7)); }
.ctl-sauna__mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ctl-sauna__t { margin: 0; color: var(--ink-600, #4b4f56); font-size: 14px; }
.ctl-sauna__target { font-size: 22px; min-width: 90px; text-align: center; }
.ctl-adv { margin-top: 8px; }

/* music */
.ctl-wave { display: flex; gap: 5px; align-items: flex-end; height: 34px; margin: 14px 0 4px; }
.ctl-wave i { width: 5px; height: 6px; border-radius: 3px; background: var(--ink-300, #b9bcc2); }
.ctl-wave.is-on i { background: #d99a4e; animation: ctl-wave 1.2s ease-in-out infinite; }
.ctl-wave.is-on i:nth-child(2) { animation-delay: .15s; } .ctl-wave.is-on i:nth-child(3) { animation-delay: .3s; }
.ctl-wave.is-on i:nth-child(4) { animation-delay: .45s; } .ctl-wave.is-on i:nth-child(5) { animation-delay: .6s; }
@keyframes ctl-wave { 0%,100% { height: 6px; } 50% { height: 26px; } }
.ctl-transport { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 14px 0; }
.ctl-list { display: flex; flex-direction: column; margin-top: 4px; }
.ctl-row { appearance: none; border: 0; border-top: 1px solid var(--surface-2, #efece6); background: none;
  text-align: left; padding: 14px 2px; min-height: 48px; font: inherit; color: inherit; cursor: pointer; }

/* mood confirm */
.ctl-preview { list-style: none; padding: 0; margin: 12px 0 0; font-size: 18px; }
.ctl-preview li { padding: 8px 0; border-top: 1px solid var(--surface-2, #efece6); }
.ctl-steps { list-style: none; padding: 0; margin: 16px 0 0; }
.ctl-steps li { padding: 6px 0; font-size: 16px; color: var(--ink-500, #6b6f76); transition: color .3s ease; }
.ctl-steps li.is-done { color: #2f6a3b; }
.ctl-steps li.is-failed { color: #8a3b12; }
.ctl-steps__m { display: inline-block; width: 22px; }
.ctl-steps__done { color: var(--ink-900) !important; font-weight: 500; font-size: 18px !important; margin-top: 6px; }

/* ---- the Stay screen's room card ---- */
.roomcard { display: flex; flex-direction: column; gap: 4px; }
.roomcard__l { margin: 0; font-size: 13px; color: var(--ink-500, #6b6f76); }
.roomcard__v { margin: 0 0 8px; font-size: 18px; }
.roomcard__go { appearance: none; align-self: flex-start; display: inline-flex; gap: 10px; align-items: center;
  border: 0; border-radius: 999px; background: var(--ink-900, #14161A); color: #fff; font: inherit;
  font-size: 15px; padding: 12px 18px; min-height: 44px; cursor: pointer; }

/* ---- tablets and in-room iPads: more at once, more space ---- */
@media (min-width: 760px) {
  .ctl { padding: 0 32px 60px; }
  .ctl-moods { grid-template-columns: repeat(5, 1fr); }
  .ctl-mood { min-height: 96px; }
  .ctl-bigs { grid-template-columns: 1fr 1fr; }
  .ctl-smalls { grid-template-columns: repeat(4, 1fr); }
  .ctl-sheet { align-items: center; }
  .ctl-sheet__panel { border-radius: 26px; max-width: 520px; }
}

/* Motion off: everything still changes, it just doesn't travel. */
@media (prefers-reduced-motion: reduce) {
  .ctl, .ctl *, .ctl-sheet, .ctl-sheet * { transition: none !important; animation: none !important; }
}

/* `hidden` must win over the display rules above. */
.ctl [hidden], .ctl-sheet [hidden] { display: none !important; }
/* Confirmations at the top, clear of the buttons a thumb is on. */
.ctl-toast { bottom: auto; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -12px); }
.ctl-ring__bg { stroke: rgba(20,22,26,.08); }

/* Room buttons under a chat reply */
.msgwrap { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.msg__acts { margin: 0 0 6px; }

/* Optional guest password: a quiet link under the email-link form. */
.gate__pw { margin-top: 18px; }
.gate__pw [hidden], .stack [hidden] { display: none !important; }
.linkbtn { appearance: none; border: 0; background: none; padding: 10px 0; font: inherit; font-size: 15px;
  color: var(--ink-600, #4b4f56); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
