/* Plain CSS, no build step. Phone width first; a laptop just gets more margin.
 *
 * The look is deliberately quiet. Someone opens this to answer one question in
 * a hurry, often one-handed, sometimes at night — so: one column, few lines,
 * generous space, and colour saved for the thing that is actually happening.
 * Everything below is either a token, a shape, or a state. */
:root {
  /* Surfaces: an off-white page with white cards, so a card reads as a card
     without needing a border drawn around it. */
  --bg: #fafaf8;
  --card: #ffffff;
  --surface: #f1f1ee;      /* quiet fills: secondary buttons, inputs, replies */
  --ink: #16181c;
  --muted: #6a7180;
  --line: #e9e9e5;         /* hairline; used between rows, not around boxes */
  --shadow: 0 1px 2px rgba(20, 22, 26, .05), 0 1px 8px rgba(20, 22, 26, .04);

  /* State. The soft variants tint a whole card; the solid ones are for a dot,
     a word, or a headline that has to carry. */
  --ok: #17734a;
  --on: #96560a;
  --alarm: #b3201c;
  --unknown: #6a7180;
  --ok-soft: #eaf5ef;
  --on-soft: #fdf3e4;
  --alarm-soft: #fdeceb;
  --accent: #16181c;

  --radius: 16px;
  --radius-sm: 12px;
  --gap: 1rem;
  --page: 34rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1113; --card: #17191d; --surface: #21242a; --ink: #f4f5f7;
    --muted: #9aa1ad; --line: #262a30;
    --shadow: none;
    --ok: #52c98d; --on: #e5ab52; --alarm: #ff7a72; --unknown: #9aa1ad;
    --ok-soft: #14241d; --on-soft: #251d11; --alarm-soft: #2a1614;
    --accent: #f4f5f7;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
a { color: var(--ink); text-underline-offset: .18em; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
header, main, footer, .update-bar { max-width: var(--page); margin: 0 auto; padding: 0 max(1.25rem, env(safe-area-inset-right)) 0 max(1.25rem, env(safe-area-inset-left)); }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding-top: .5rem; min-height: 3.5rem; }
h1 { font-size: .95rem; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.brand { display: flex; align-items: center; gap: .55rem; min-height: 44px; color: var(--ink); text-decoration: none; white-space: nowrap; }
h2 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -.015em; font-weight: 600; margin: 0 0 .35rem; }
nav { position: relative; flex-shrink: 0; font-size: .9rem; }
.linkish { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-decoration: underline; border: 0; background: none; cursor: pointer; font: inherit; font-size: .9rem; padding: .45rem 0; text-align: left; }
nav a:hover, .linkish:hover { color: var(--ink); }
#nav { display: flex; align-items: center; gap: .4rem; }
.refresh-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; }
.refresh-btn:hover { color: var(--ink); }
.refresh-btn.spinning svg { animation: wait-spin .8s linear infinite; }
.nav-menu > summary { min-height: 44px; padding: .5rem .9rem; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .9rem; }
.nav-menu[open] > summary { color: var(--ink); }
.nav-links { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 10; width: min(15rem, calc(100vw - 2.5rem)); padding: .35rem; border-radius: var(--radius-sm); background: var(--card); box-shadow: 0 10px 30px rgba(20, 22, 26, .14); border: 1px solid var(--line); }
.nav-links a, .nav-links button { display: flex; align-items: center; min-height: 44px; width: 100%; padding: .6rem .75rem; color: var(--ink); font: inherit; text-decoration: none; border-radius: 8px; }
.nav-links a:hover, .nav-links button:hover { background: var(--surface); }
main { padding-top: .75rem; padding-bottom: 1.5rem; }
footer { padding-bottom: 2rem; }
footer p { margin: 0; }

/* ---- cards ------------------------------------------------------------------
   No borders. A white card on an off-white page is enough separation, and one
   fewer line on every edge is most of what makes this feel calm. */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin: 0 0 var(--gap); overflow-wrap: anywhere; min-width: 0; }
/* Signing in is the first thing a household sees and the emptiest screen in
   the app; give it room rather than leaving a small box under the header. */
.auth-card { padding: 1.75rem 1.5rem; margin-top: 2.5rem; }
.auth-card h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.auth-card > .muted { margin-top: 0; }

/* ---- the answer -------------------------------------------------------------
   The verdict tints the whole card rather than marking its edge, so the state
   is legible from arm's length without a colour bar to decode. */
.verdict.unknown { background: var(--surface); }
.verdict.on { background: var(--on-soft); }
.verdict.alarm { background: var(--alarm-soft); }
.verdict.alarm h2 { color: var(--alarm); }
.verdict p { margin: .3rem 0; }
.device-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.device-name { font-weight: 500; font-size: .9rem; color: var(--muted); margin: 0; min-width: 0; }
.connection-label { font-size: .8rem; color: var(--muted); flex-shrink: 0; }
.status-card h2 { font-size: clamp(1.7rem, 7.5vw, 2.1rem); line-height: 1.12; letter-spacing: -.025em; margin-bottom: .6rem; }
/* The readings: figures first, label under them, evenly across the card. Tabular
   numerals so a countdown doesn't jitter as it counts down. */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .5rem;
  margin: 1.1rem 0 0; padding: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: .75rem; color: var(--muted); margin: 0 0 .15rem; letter-spacing: .01em; }
.facts dd { margin: 0; font-size: 1.15rem; font-weight: 500; line-height: 1.2;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* A unit's card. The heading carries the name, the state, and the way into
   everything that belongs to this unit rather than to the app. */
.unit-card { position: relative; }
.device-heading { flex-wrap: nowrap; }
.card-open { color: inherit; text-decoration: none; }
.card-open::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.gear { display: inline-flex; align-items: center; justify-content: center; position: relative; z-index: 1;
  width: 44px; height: 44px; margin: -.6rem -.7rem -.6rem 0; flex: 0 0 auto;
  color: var(--muted); text-decoration: none; border-radius: 50%; }
.gear:hover, .gear:focus-visible { color: var(--ink); }
.status-description { color: var(--muted); font-size: .95rem; }
.status-description p { margin: .2rem 0; }
.facts:only-of-type > div:only-child dd { font-size: 1.05rem; }
/* Status pills: the reading is the pill, its label sits above it. Colour backs
   up the word and never replaces it. */
.facts.pills { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.facts.pills > div { flex: 1 1 auto; max-width: 100%; }
/* A pill's label is a word or two ("Alarms in", "Snoozed for"), kept on one line
   so a longer one doesn't push its pill below the others in the row. */
.facts.pills dt { white-space: nowrap; }
.facts.pills dd.pill { display: inline-block; padding: .28rem .6rem; border-radius: 999px; font-size: 1rem;
  background: var(--surface); color: var(--ink); max-width: 100%; white-space: normal; }
.facts.pills dd.pill.ok { color: var(--ok); }
.facts.pills dd.pill.on { color: var(--on); }
.facts.pills dd.pill.alarm { color: #fff; background: var(--alarm); }
.verdict.on .facts.pills dd.pill, .verdict.alarm .facts.pills dd.pill:not(.alarm) { background: rgba(255, 255, 255, .65); }
/* In the dark scheme that same white wash turns the pill into a pale grey disc
   with pale amber or white text on it — the On and countdown pills were
   unreadable with the stove on (Garrett, 2026-10-07). Lift the pill a shade
   above the tinted card instead and let the light ink carry: about 6.5:1 for
   the amber, 12:1 for the white, against 1.1:1 and 2:1 before. */
@media (prefers-color-scheme: dark) {
  .verdict.on .facts.pills dd.pill, .verdict.alarm .facts.pills dd.pill:not(.alarm) { background: rgba(255, 255, 255, .08); }
}
.status-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1.1rem; }
.status-footer p { margin: 0; }
.stale-note { margin: .9rem 0 0; }
.alarm-controls { border-top: 1px solid var(--line); margin-top: .9rem; padding-top: .75rem; }
.alarm-controls > .snooze-heading { margin-bottom: .55rem; font-size: .9rem; color: var(--muted); font-weight: 600; }

/* ---- stepping in -------------------------------------------------------------
   Everything that is not the answer lives on a page of its own, reached from a
   list of rows. A row is a whole tap target, with the value it holds on the
   right, so the list reads as a table of contents rather than a menu. */
.rows { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-height: 56px; padding: .9rem 1.25rem; color: var(--ink); text-decoration: none; }
.row-link + .row-link { border-top: 1px solid var(--line); }
.row-link:hover { background: var(--surface); }
.row-title { font-weight: 500; min-width: 0; }
.row-value { flex-shrink: 0; margin-left: auto; }
.row-link::after { content: ''; width: .42rem; height: .42rem; flex: 0 0 auto; margin-left: .2rem;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(-45deg); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: .25rem;
  color: var(--muted); text-decoration: none; font-size: .9rem; }
.back::before { content: '\2039'; margin-right: .45rem; font-size: 1.25em; line-height: 1; }
.back:hover { color: var(--ink); }
.page-title { font-size: 1.3rem; margin: 0 0 1.1rem; }

.dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--unknown); vertical-align: baseline; }
.dot.ok { background: var(--ok); } .dot.on { background: var(--on); } .dot.alarm { background: var(--alarm); }

.banner { background: var(--alarm-soft); color: var(--ink); border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: var(--gap); }
.banner.quiet { background: var(--surface); }
/* A plain button on a quiet banner would be the banner's own grey. */
.banner.quiet .action:not(.primary) { background: var(--card); }
.banner strong { display: block; margin-bottom: .2rem; font-weight: 600; }

/* ---- controls ---------------------------------------------------------------
   One height, one radius, no outlines. A secondary button is a quiet fill; the
   primary one is solid ink. That is the whole button system. */
.buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 1.1rem 0 0; }
.buttons.alarm-actions { grid-template-columns: 1fr; margin-top: .5rem; }
.buttons.one { grid-template-columns: 1fr; }
button.action {
  font: inherit; font-weight: 500; line-height: 1.3; min-height: 48px; min-width: 0; padding: .8rem 1rem;
  border-radius: var(--radius-sm); overflow-wrap: anywhere; border: 0;
  background: var(--surface); color: var(--ink); cursor: pointer;
  transition: opacity .12s ease;
}
button.action:hover { opacity: .82; }
button.action:active { transform: translateY(1px); }
button.action:disabled { opacity: .5; cursor: default; transform: none; }
button.action.danger { background: var(--alarm); color: var(--card); border-color: var(--alarm); }
.confirm-box { margin-top: .9rem; padding: .9rem; border-radius: var(--radius-sm); background: var(--alarm-soft); }
.confirm-box p { margin-top: 0; }
button.primary { background: var(--accent); color: var(--card); }
/* On a tinted status card the quiet fill turns muddy; give those buttons the
   card's own surface back so they stay legible against the state colour. */
.verdict.on button.action:not(.primary), .verdict.alarm button.action:not(.primary),
.verdict.unknown button.action:not(.primary) { background: var(--card); }

.reply { margin-top: .9rem; padding: .8rem .9rem; border-radius: var(--radius-sm); background: var(--surface); white-space: pre-wrap; font-size: .95rem; }
.reply.bad { background: var(--alarm-soft); color: var(--alarm); }

img.shot { width: 100%; border-radius: var(--radius-sm); display: block; background: var(--surface); }
.shot-wrap + .shot-wrap { margin-top: 1.1rem; }

ul.timeline { list-style: none; margin: 0; padding: 0; }
ul.timeline li { padding: .7rem 0; border-top: 1px solid var(--line); }
ul.timeline li:first-child { border-top: 0; }
.when { color: var(--muted); font-size: .8rem; }
#activity-list li { padding: 0; }
.activity-event > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem; padding: .7rem 0; }
.activity-title { font-size: .92rem; font-weight: 400; }
.activity-event .when { white-space: nowrap; }
.activity-event > summary::after { grid-column: 3; grid-row: 1; }
.activity-text { margin: 0 0 .9rem; color: var(--muted); font-size: .875rem; white-space: pre-wrap; }

label { display: block; font-size: .875rem; color: var(--muted); margin-bottom: .4rem; }
input[type=email], input[type=text], input[type=number], input[type=password] {
  font: inherit; font-size: 16px; width: 100%; min-width: 0; min-height: 48px; padding: .75rem .9rem;
  border-radius: var(--radius-sm); border: 0; background: var(--surface); color: var(--ink);
}
input::placeholder { color: var(--muted); opacity: .8; }
/* A tick beside its words, big enough to hit with a thumb, and the words are
   the target too — "remember this device" is easy to miss on a phone. */
label.checkbox { display: flex; align-items: center; gap: .6rem; min-height: 44px;
  margin: .25rem 0 .1rem; color: var(--ink); font-size: .95rem; cursor: pointer; }
label.checkbox input { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; accent-color: var(--ink); }
/* A password field sits under its own label like the others, but two of them
   in a row need a little air between the pairs. */
.auth-card form label + input + label { margin-top: 1rem; }
form .buttons { grid-template-columns: 1fr; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.5rem; letter-spacing: .18em; }
/* An invitation link is for sending, not for reading aloud: no letter-spacing,
   and it wraps rather than pushing the card sideways on a phone. */
.invite-link { font-size: .95rem; letter-spacing: 0; overflow-wrap: anywhere; user-select: all; }
.invite-actions { margin: .25rem 0 .5rem; }
/* The WhatsApp button is a link, not a button: sharing is navigation, and it
   must still work if the script that wires the others never ran. */
.invite-actions a.action {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 500; min-height: 48px; padding: .8rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
.invite-actions a.action:hover { opacity: .82; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: .55rem .3rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
.wrap-x { overflow-x: auto; }
.setup-steps { margin: 1.1rem 0; padding-left: 1.3rem; color: var(--muted); }
.setup-steps li { padding: .4rem 0 .4rem .2rem; }
.setup-steps strong { color: var(--ink); font-weight: 500; }
#pair-options { margin-top: .75rem; }
#pair-options > .action { margin-bottom: .25rem; }
#pair-change form { margin: .5rem 0; }
#pair-code, #code { font-variant-numeric: tabular-nums; letter-spacing: .2em; }

/* The bar that appears when a new version has taken over in the background. */
.update-bar > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  flex-wrap: wrap; margin-top: .75rem; padding: .8rem 1rem .8rem 1.25rem; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.update-bar p { margin: 0; font-size: .95rem; }
.update-bar button.action { min-height: 44px; padding: .5rem 1.1rem; border-radius: 999px; font-size: .9rem; }

/* ---- disclosure rows --------------------------------------------------------
   Every collapsed section is a row you tap, with a chevron that turns. */
summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: .6rem 0; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; width: .42rem; height: .42rem; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin: -.2rem .25rem 0 auto; flex: 0 0 auto; transition: transform .15s ease; }
details[open] > summary::after { transform: rotate(225deg); margin-top: .2rem; }
details.card > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: .1rem; }
details.card > summary > * { grid-column: 1; }
details.card > summary::after { grid-column: 2; grid-row: 1 / span 2; }
details.card > summary + * { margin-top: .9rem; }
@media (prefers-reduced-motion: reduce) {
  summary::after, button.action { transition: none; }
}
@media (max-width: 350px) {
  header, main, footer, .update-bar { padding-left: 1rem; padding-right: 1rem; }
  .card, .auth-card { padding: 1rem; }
  .row-link { padding-left: 1rem; padding-right: 1rem; }
}

.field { margin: 1.1rem 0; }
.field + .field { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.field p.muted { margin: .4rem 0 0; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row input { flex: 1 1 6rem; min-width: 0; }
.row button.action { padding: .75rem 1.1rem; flex: 0 0 auto; }
.suffix { color: var(--muted); }

ul.plain { list-style: none; margin: .25rem 0 .75rem; padding: 0; }
ul.plain li { padding: .35rem 0; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
ul.plain li > * { min-width: 0; overflow-wrap: anywhere; }

/* The mask picker: a 32x24 grid laid over the heatmap, so "rows 5-9, columns
   10-20" is something you drag rather than something you compose in your head. */
.mask-pick { position: relative; line-height: 0; margin: .5rem 0; touch-action: none; }
.mask-grid {
  position: absolute; inset: 0; display: grid;
  grid-template-rows: repeat(24, 1fr); cursor: crosshair;
}
.mask-grid i { border: 0; }
.mask-grid i.masked { background: rgba(20, 22, 26, .62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.mask-grid i.sel { background: rgba(80, 170, 255, .45); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }

/* The heat picture on the unit's main screen. */
.heat-card { padding: .6rem; }
.heat-card .shot { display: block; width: 100%; height: auto; border-radius: calc(var(--radius) - 4px); }
.heat-card p { margin: .45rem .3rem .1rem; }
.heat-card .shot-wrap + .shot-wrap { margin-top: .8rem; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1rem !important; letter-spacing: .02em; }

input[type=range] { flex: 1 1 auto; min-width: 0; height: 44px; accent-color: var(--ink); }

/* One device, one frame: its status and its pictures belong together. */
.device-frame { border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); padding: .6rem; margin-bottom: 1.5rem; }
.device-frame > .card { margin-bottom: .6rem; }
.device-frame > .card:last-child { margin-bottom: 0; }
.device-row-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.device-row .row-title { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
/* A switch that looks like one: on is filled, off is hollow. */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; }
.switch-row label { margin: 0; }
/* 44 px touch target; the 52 x 32 track is drawn inside it. */
button.switch { position: relative; flex: 0 0 auto; width: 56px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
button.switch::before { content: ''; position: absolute; left: 2px; top: 6px; width: 52px; height: 32px; border-radius: 999px;
  background: #c9ccd3; transition: background .15s; }
button.switch span { position: absolute; top: 9px; left: 5px; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
button.switch[aria-checked="true"]::before { background: var(--ok); }
button.switch[aria-checked="true"] span { transform: translateX(20px); }
button.switch:disabled { opacity: .5; cursor: default; }

.live-wrap canvas.live-canvas { display: block; width: 100%; height: auto; border-radius: calc(var(--radius) - 4px); }
.live-wrap canvas[hidden], .live-wrap img[hidden], .live-wrap[hidden], .heat-card[hidden] { display: none; }
#live-chart { background: var(--card); }
.device-title { margin: .2rem 0 .7rem; }

#chart-dialog { border: 0; border-radius: var(--radius); padding: .8rem; width: min(96vw, 1100px); background: var(--card); color: var(--ink); }
#chart-dialog::backdrop { background: rgba(20, 22, 26, .55); }
#chart-dialog canvas { display: block; width: 100%; height: auto; }
#chart-dialog p { margin: .4rem 0 0; text-align: center; }

.wifi-list { margin: .2rem 0 .4rem; }
.wifi-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem 0; }
.wifi-name { min-width: 0; overflow-wrap: anywhere; font-size: 1rem; color: var(--ink); }
.wifi-actions { display: inline-flex; gap: .3rem; flex: 0 0 auto; }
button.small-btn { min-width: 44px; min-height: 44px; padding: .3rem .6rem; font-size: .9rem; }
.wifi-add { margin-top: .4rem; }
.wifi-add input { flex: 1 1 auto; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
button.chip { min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  color: var(--ink); font-size: .9rem; cursor: pointer; }

/* Turning and mirroring the unit's own picture (and the ignored-areas picker
   laid over it). Mirror first, in the picture's own frame, then turn. */
.turn-box { position: relative; --turn: 0deg; --flip: 1; }
.turn-box > * { transform: rotate(var(--turn)) scaleX(var(--flip)); }
.turn-box.mirror { --flip: -1; }
.turn-box.r90 { --turn: 90deg; } .turn-box.r180 { --turn: 180deg; } .turn-box.r270 { --turn: 270deg; }
.turn-box.r90, .turn-box.r270 { aspect-ratio: 3 / 4; overflow: hidden; }
.turn-box.r90 > *, .turn-box.r270 > * { position: absolute; top: 50%; left: 50%; width: 133.334%; margin: 0;
  transform: translate(-50%, -50%) rotate(var(--turn)) scaleX(var(--flip)); }
.turn-box img.shot { display: block; width: 100%; height: auto; }

details.heat-card > summary { cursor: pointer; font-weight: 500; padding: .35rem .3rem .55rem; min-height: 44px; display: flex; align-items: center; }
details.heat-card:not([open]) > summary { padding-bottom: .35rem; }

.wifi-grip { flex: 0 0 auto; width: 32px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: grab; touch-action: none; user-select: none; letter-spacing: -.15em; }
.wifi-row.dragging { background: var(--surface); border-radius: .6rem; }
.wifi-row.dragging .wifi-grip { cursor: grabbing; }
.wifi-row .wifi-name { flex: 1 1 auto; }

.steps { margin: .4rem 0 1rem 1.1rem; padding: 0; color: var(--muted); }
.steps li { margin: .3rem 0; }
.checks { margin: .8rem 0; }
#position-checks li, #oven-checks li { padding: .35rem 0 .35rem 1.7rem; position: relative; font-size: .95rem; list-style: none; }
.checks li::before { position: absolute; left: 0; top: .35rem; font-weight: 700; }
.checks li.good::before { content: '✓'; color: var(--ok); }
.checks li.bad::before { content: '!'; color: var(--alarm); }
.checks li.wait::before { content: '…'; color: var(--muted); }

/* Turn and mirror, in the picture's top right corner. */
.live-wrap { position: relative; }
.feed-btn { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20, 22, 26, .55); color: #fff; cursor: pointer; backdrop-filter: blur(3px); }
.feed-btn[aria-pressed="true"] { background: rgba(255, 255, 255, .9); color: #16181c; }

/* Feed editor: hidden until the picture is pressed and held. */
.feed-btn.feed-edit { position: absolute; top: .5rem; right: .5rem; z-index: 2; width: auto; padding: 0 .9rem 0 .7rem; gap: .4rem; border-radius: 999px; font-size: .95rem; }
.feed-btn.feed-edit[hidden] { display: none; }
.live-wrap { -webkit-touch-callout: none; user-select: none; }
.live-wrap.editing > canvas, .live-wrap.editing > .turn-box, .live-wrap.editing > #live-heat-note { display: none; }
#feed-editor .feed-tools { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
#feed-editor .feed-tools .action { display: inline-flex; align-items: center; gap: .4rem; }
#feed-editor .feed-tools #feed-done { margin-left: auto; }
#feed-editor .action[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* The device's name and the way into its options share one row, outside the cards. */
.device-title-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: .2rem 0 .7rem; }
.device-title-row .device-title { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.device-title-row .gear { margin: 0; }

/* ---- setup guide ------------------------------------------------------------
   One step per screen: where you are, a drawing, a few short lines, Back and
   Next. The drawings use the page's own tokens, so they follow dark mode. */
.welcome-card { margin-top: 1.5rem; background: var(--ok-soft); }
.welcome-card p { margin: .2rem 0 0; }
.auth-card.after-welcome { margin-top: 0; }
.guide h2 { font-size: 1.45rem; margin-bottom: .6rem; }
.guide .small, .setup-card .small, .setup-card label { font-size: 1rem; }
.guide > .buttons { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.setup-card input { font-size: max(16px, 1rem); }
.guide-progress > span { font-size: .875rem; }
.guide h2:focus:not(:focus-visible) { outline: none; }
.calibrate-card.slim { padding: .7rem .9rem; }
.calibrate-card.slim p { margin: 0 0 .5rem; }
.calibrate-card.slim p.small { font-size: .95rem; }
.reminder-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.reminder-row .action.compact { min-height: 40px; padding: .45rem .9rem; font-size: .92rem; }
.dismissed-note { margin: .2rem 0 .9rem; }
#alerts-card .buttons { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.oven-progress { display: flex; align-items: center; gap: .6rem; margin: .4rem 0 .9rem; }
.oven-progress .guide-bar { flex: 1 1 auto; }
.oven-progress .guide-bar > span { transition: width .4s linear; }
.oven-progress .wait-spin { margin-right: 0; }
.guide-progress { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.guide-progress > span { flex: 0 0 auto; }
.guide-bar { flex: 1 1 auto; height: 6px; border-radius: 999px; background: var(--surface); overflow: hidden; }
.guide-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
#setup-progress { display: block; }
.cal-overall { margin: 0 0 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.cal-overall-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; font-size: .8rem; }
.cal-overall-heading > span { color: var(--muted); font-size: .75rem; }
.cal-overall-track { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; }
.cal-overall-stage { min-width: 0; color: var(--muted); }
.cal-overall-bar { display: block; height: 7px; border-radius: 99px; background: var(--line); }
.cal-overall-label { display: flex; align-items: center; justify-content: center; gap: .15rem; margin-top: .4rem; font-size: .7rem; overflow-wrap: anywhere; }
.cal-overall-label svg { flex: 0 0 .8rem; width: .8rem; height: .8rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cal-overall-stage.complete { color: var(--ok); }
.cal-overall-stage.complete .cal-overall-bar { background: var(--ok); }
.cal-overall-stage.current { color: var(--ink); font-weight: 600; }
.cal-overall-stage.current .cal-overall-bar { background: var(--ink); }
.calibration-navigation { display: flex; align-items: center; gap: .75rem; }
.calibration-navigation #calibration-progress { flex: 1; min-width: 0; }
.calibration-navigation a.action.back { flex-shrink: 0; margin: 0; }
#setup-progress .guide-bar { margin-top: .65rem; }
.cal-progress-segments { display: flex; gap: .35rem; margin-top: .65rem; }
.cal-progress-segments > span { flex: 1; height: 6px; border-radius: 999px; background: var(--surface); }
.cal-progress-segments > .complete { background: var(--ok); }
.cal-progress-segments > .current { background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.action.preference-choice { display: block; text-align: left; padding: 1rem; white-space: normal; }
.choice-title { display: block; font-weight: 600; }
.choice-note { display: block; margin-top: .4rem; font-size: .875rem; font-weight: 400; line-height: 1.45; }
.choice-default { display: inline-block; margin-left: .5rem; padding: .05rem .4rem; border: 1px solid currentColor; border-radius: 999px; font-size: .7rem; line-height: 1.5; vertical-align: middle; }
.preference-confirmation { margin-top: .75rem; font-size: .9rem; }
.preference-confirmation.saved { color: var(--ok); }
a.action.back[aria-disabled="true"] { opacity: .5; cursor: wait; }
.guide-fig { margin: .4rem 0 1rem; padding: .75rem; border-radius: var(--radius-sm); background: var(--surface); }
.guide-fig svg { display: block; width: 100%; height: auto; max-height: 15rem; }
.guide-list { margin: .5rem 0 .9rem; padding-left: 1.3rem; }
.guide-list li { padding: .3rem 0 .3rem .2rem; }
.guide-list strong { font-weight: 600; }
.guide-skip { margin: 1rem 0 0; }
a.action {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  font-weight: 500; line-height: 1.3; min-height: 48px; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); text-decoration: none;
}
a.action.help-button { width: 48px; height: 48px; padding: 0; border-radius: 50%; font-size: 1.3rem; font-weight: 700; }
a.action.back { margin-bottom: .75rem; }
.nav-links { display: grid; gap: .25rem; }
a.action.primary { background: var(--accent); color: var(--card); }
a.action:hover { opacity: .82; }
.ok-banner { background: var(--ok-soft); }
.ok-banner strong { color: var(--ok); }

.guide-fig { --f-ink: var(--ink); --f-fill: var(--card); --f-accent: #e9dcc4; --f-warm: #e5892f; }
@media (prefers-color-scheme: dark) { .guide-fig { --f-accent: #6b5d45; } }
.guide-fig svg * { stroke-linecap: round; stroke-linejoin: round; }
.f-fill, .f-card, .f-mug rect { fill: var(--f-fill); stroke: var(--f-ink); stroke-width: 1.6; }
.f-line, .f-steam path { fill: none; stroke: var(--f-ink); stroke-width: 1.6; }
.f-steam path { stroke: var(--muted); }
.f-dark { fill: var(--f-ink); }
.f-accent { fill: var(--f-accent); stroke: var(--f-ink); stroke-width: 1.6; }
.f-view { fill: var(--ok); fill-opacity: .14; stroke: var(--ok); stroke-dasharray: 5 4; stroke-width: 1.4; }
.f-dim { fill: none; stroke: var(--muted); stroke-width: 1.4; }
.f-hatch { stroke: var(--f-ink); stroke-width: 4; }
.f-arrow { fill: none; stroke: var(--ok); stroke-width: 2.4; }
.f-mugtop circle { fill: var(--f-warm); stroke: var(--f-ink); stroke-width: 1.6; }
.f-pick { fill: var(--ok-soft); stroke: var(--ok); stroke-width: 1.6; }
.f-tick { fill: none; stroke: var(--ok); stroke-width: 2.4; }
.f-field { fill: var(--surface); stroke: var(--muted); stroke-width: 1; }
.f-go { fill: var(--ok); }
.f-cap { fill: var(--f-ink); font: 500 11px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; text-anchor: middle; stroke: none; }
.f-cap.f-left { text-anchor: start; }
.f-cap.f-small { font-size: 9px; }
.f-cap.f-bold { font-weight: 700; }
.f-cap.f-muted { fill: var(--muted); }
.f-cap.f-on-go { fill: var(--card); font-weight: 600; }
#position-card .checks li[hidden] { display: none !important; }
/* Which mug to take away next, in step 2: a small top view inside the step. */
.guide-fig.mini { margin: .6rem 0 0; padding: .4rem; background: var(--card); }
.guide-fig.mini svg { max-height: 8.5rem; }
.f-take { fill: none; stroke: var(--alarm); stroke-width: 3; stroke-dasharray: 6 4; }
#pc-finish-row .buttons { margin-top: .55rem; }
.oven-settings { margin-top: 1.2rem; border-top: 1px solid var(--line); }
.oven-settings > summary { font-weight: 500; }

/* Firmware update progress (Support page and Device details) */
.update { margin: .6rem 0 .9rem; padding: .7rem .85rem; background: var(--surface); border-radius: var(--radius-sm); }
.update.good { background: var(--ok-soft); }
.update.bad { background: var(--alarm-soft); }
.update-words { font-size: .95rem; margin-bottom: .45rem; }
.update-bar { position: relative; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: .3rem; }
.update-bar > span { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .4s ease; }
.update.bad .update-bar > span { background: var(--alarm); }
.update-bar.busy > span { background-image: linear-gradient(45deg, rgba(255,255,255,.35) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.35) 50%, rgba(255,255,255,.35) 75%, transparent 75%); background-size: 16px 16px; animation: update-stripe 1s linear infinite; }
.update-bar.unknown > span { width: 30% !important; animation: update-slide 1.4s ease-in-out infinite alternate; }
.wait-spin { display: inline-block; width: .9em; height: .9em; border: .16em solid var(--line); border-top-color: var(--muted); border-radius: 50%; vertical-align: -.12em; margin-right: .4em; animation: wait-spin .9s linear infinite; }
@keyframes wait-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wait-spin { animation-duration: 2.5s; } }
@keyframes update-stripe { from { background-position: 0 0; } to { background-position: 16px 0; } }
@keyframes update-slide { from { margin-left: 0; } to { margin-left: 70%; } }
@media (prefers-reduced-motion: reduce) { .update-bar.busy > span, .update-bar.unknown > span { animation: none; } }

/* One Snooze heading; each row names the stove or oven. */
.snooze-heading { margin: 0; font-size: 1rem; font-weight: 600; }
/* label · − · figure · + · the button that does it */
.snooze-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px auto; align-items: center; gap: .35rem; }
.snooze-row .timer-label { grid-column: 1 / -1; font-weight: 500; line-height: 1.25; }
.snooze-row .set-btn { white-space: nowrap; }
@media (min-width: 430px) {
  .snooze-row { grid-template-columns: minmax(0, 1fr) 44px minmax(4rem, auto) 44px auto; }
  .snooze-row .timer-label { grid-column: auto; }
}
.snooze-row .timer-value { padding: .65rem .1rem; font-variant-numeric: tabular-nums; text-align: center; font-weight: 600; }
.snooze-row .set-btn { padding: .65rem .6rem; }
.snooze-row .stepper { padding: 0; font-size: 1.35rem; line-height: 1; -webkit-tap-highlight-color: transparent; }

/* Why the countdown last started over: one quiet line under the pills. */
.restart-why { margin: .45rem 0 0; }

/* ---- operator launch tracker (/ops#/launch) ---- */
.lt-count { margin: -.6rem 0 .5rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.lt-bar { display: flex; height: .5rem; border-radius: 999px; background: var(--surface); overflow: hidden; }
.lt-bar .done { background: var(--ok); }
.lt-bar .doing { background: var(--on); }
.lt-gate { margin: 1rem 0 0; font-size: .9rem; }
.lt-phase { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .2rem; }
.lt-sub { margin: 0 0 .5rem; }
.lt-list { list-style: none; margin: 0; padding: 0; }
.lt-task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--line); }
.lt-task:first-child { border-top: 0; }
.lt-status { width: 1.75rem; height: 1.75rem; border-radius: 50%; border: 2px solid var(--muted); background: transparent; color: #fff; cursor: pointer; padding: 0; font-size: .9rem; line-height: 1; }
.lt-status.doing { border-color: var(--on); background: linear-gradient(90deg, var(--on) 50%, transparent 50%); }
.lt-status.done { border-color: var(--ok); background: var(--ok); }
.lt-title { font-weight: 500; }
.lt-task.done .lt-title { color: var(--muted); text-decoration: line-through; }
.lt-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .2rem; }
.lt-pill { font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--surface); color: var(--muted); }
.lt-pill.doing { background: var(--on-soft); color: var(--on); }
.lt-pill.done { background: var(--ok-soft); color: var(--ok); }
.lt-pill.gate { background: var(--alarm-soft); color: var(--alarm); }
.lt-date { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lt-note { font-size: .9rem; color: var(--muted); white-space: pre-wrap; margin-top: .2rem; }
.lt-editbtn { min-height: 0; padding: .2rem 0; }
.lt-edit, .lt-add { display: grid; gap: .55rem; }
.lt-edit input, .lt-edit textarea, .lt-edit select, .lt-add input:not([type=checkbox]), .lt-add select { width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; }
.lt-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.lt-row > select, .lt-row > input { flex: 1 1 9rem; width: auto; }
.lt-check { display: flex; gap: .45rem; align-items: center; font-size: .9rem; }
.lt-danger { color: var(--alarm); }
nav[aria-label="Operator navigation"] { flex-shrink: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: .3rem; }

/* How alerts sound is the phone's to decide: where to change it. */
.notif-help { margin-top: .6rem; }
.notif-help > summary { cursor: pointer; font-size: .95rem; min-height: 44px; display: flex; align-items: center; }
.notif-help p { margin: .4rem 0; }
/* Contain margins so the alerts slot can shrink without a final jump. */
#alerts-slot { display: flow-root; }
/* Step headings take focus so a screen reader starts there; they are not
   controls, so no ring. */
.guide h2[tabindex="-1"]:focus, .card h2[tabindex="-1"]:focus { outline: none; }

/* Large, keyboard-accessible controls for calibration corrections. */
#burner-editor { position: absolute; inset: 0; pointer-events: none; }
.burner-hit { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; border: 0; background: transparent; pointer-events: auto; cursor: pointer; }
.burner-hit span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #a12626; box-shadow: 0 0 0 2px #16181c; font-size: 22px; line-height: 1; font-weight: 700; }
.burner-hit:disabled { cursor: wait; opacity: .5; }
.zone-move { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; }
.zone-move .action { padding: .45rem .2rem; font-size: .85rem; }
.zone-size.buttons { margin-top: .4rem; }
.presence-picture { max-width: min(100%, calc(25svh * var(--heat-aspect, 1.333))); margin: .5rem auto 0; }
#presence-workspace { scroll-margin-top: .5rem; }
#presence-workspace .live-wrap { margin: 0; }
#presence-workspace #live-heat-note { margin: .25rem 0; font-size: .75rem; }
#zone-adjust { margin-top: .3rem; }
#zone-adjust > p { margin: .2rem 0 .5rem; }

/* Short, local instruction animations. The final frame is also the complete
   instruction when motion is disabled. No repeating movement while reading. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.cal-checkpoint { max-width: 30rem; margin-inline: auto; }
.cal-checkpoint .page-title:focus { outline: none; }
.checkpoint-seal { width: 4rem; height: 4rem; display: grid; place-items: center; margin-bottom: 1rem; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.checkpoint-seal svg { width: 2.25rem; height: 2.25rem; }
.checkpoint-seal path, .checkpoint-mark path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.checkpoint-list { list-style: none; padding: 0; margin: 1.25rem 0; display: grid; gap: .35rem; }
.checkpoint-list li { display: flex; align-items: center; gap: .5rem; min-height: 48px; padding: .55rem .2rem; color: var(--muted); border-radius: 12px; }
.checkpoint-list li > span:not(.checkpoint-mark) { min-width: 0; overflow-wrap: normal; }
#setup-card .row-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .75rem; }
#setup-card .row-title { grid-column: 1; overflow-wrap: normal; }
#setup-card .row-value { grid-column: 1; grid-row: 2; margin-left: 0; font-size: .85rem; color: var(--muted); }
#setup-card .row-link::after { grid-column: 2; grid-row: 1 / 3; }
.checkpoint-mark { display: grid; place-items: center; flex: 0 0 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--surface); font-size: .8rem; }
.checkpoint-mark svg { width: 1.25rem; height: 1.25rem; }
.checkpoint-list .checked { color: var(--ink); }
.checked .checkpoint-mark { color: var(--ok); background: var(--ok-soft); }
.checkpoint-seal path, .just-done .checkpoint-mark path { stroke-dasharray: 28; animation: checkpoint-tick .65s ease-out both; }
.checkpoint-list .just-done { font-weight: 600; }
.checkpoint-list .next-up { color: var(--ok); background: var(--ok-soft); animation: checkpoint-next .7s .65s ease-out both; }
.checkpoint-next { margin-left: auto; }
@keyframes checkpoint-tick { from { stroke-dashoffset: 28; } to { stroke-dashoffset: 0; } }
@keyframes checkpoint-next { from { background: transparent; color: var(--muted); } to { background: var(--ok-soft); color: var(--ok); } }
.guide-time { color: var(--ok); font-weight: 600; margin: .4rem 0; }
.setup-next { margin-top: 1.5rem; }
.setup-next h3 { margin-top: 0; margin-bottom: .3rem; }
.setup-next > .buttons:first-child { margin-top: 0; }
.mug-clear-step.setup-next { margin-top: 0; }
.mug-clear-step .instruction-demo { margin: .5rem 0 1rem; padding: 0; background: transparent; }
.mug-clear-step .instruction-demo svg { max-height: 11rem; }
.mug-clear-step .demo-replay { display: none; }
.connection-preview { border-radius: 14px; overflow: hidden; background: var(--surface); }
.connection-preview canvas { display: block; width: 100%; height: auto; }
.firmware-ready { color: var(--ok); font-weight: 600; }
.connection-wait { min-height: 13rem; padding: 1.5rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; text-align: center; }
.connection-wait .wait-spin { width: 2rem; height: 2rem; border-width: 3px; }
.mount-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem; padding: .25rem; background: var(--surface); border-radius: 14px; }
.mount-options button { min-width: 0; min-height: 48px; padding: .6rem .2rem; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; overflow-wrap: anywhere; }
.mount-options button[aria-pressed="true"] { background: var(--card); color: var(--ok); box-shadow: var(--shadow); font-weight: 600; }
.instruction-demo { position: relative; margin: .8rem 0 1rem; padding: .7rem; border-radius: 16px; background: var(--surface); --f-ink: var(--ink); --f-fill: var(--card); --f-warm: #e5892f; }
.instruction-demo svg { display: block; width: 100%; height: auto; max-height: 17rem; }
.instruction-demo svg * { stroke-linecap: round; stroke-linejoin: round; }
.instruction-demo figcaption { margin: .2rem .3rem 0; line-height: 1.5; }
.instruction-demo figcaption strong, .instruction-demo figcaption span { display: block; }
.instruction-demo figcaption strong { margin-bottom: .25rem; }
.instruction-demo figcaption span { color: var(--muted); font-size: .95rem; }
.demo-replay { display: block; min-height: 44px; padding: .45rem .3rem; margin-top: .15rem; border: 0; color: var(--ok); background: transparent; font: inherit; font-size: .9rem; cursor: pointer; }
/* Short, selectable stories: default loop, replay-and-hold, or swipe. */
.mount-story-pills { display:grid; grid-template-columns:repeat(var(--scene-count), minmax(0,1fr)); gap:.3rem; margin:0 0 .35rem; }
.mount-story-pills button { min-width:0; min-height:44px; padding:.15rem 0; border:0; background:transparent; cursor:pointer; color:var(--muted); }
.mount-story-pills button > span { display:grid; place-items:center; position:relative; isolation:isolate; overflow:hidden; border-radius:999px; padding:.25rem 0; background:var(--card); font-size:.8rem; font-weight:650; }
.mount-story-pills button > span::before { content:""; position:absolute; inset:0; z-index:-1; background:var(--ok); opacity:.22; transform:scaleX(var(--story-progress,0)); transform-origin:left; }
.mount-story-pills button[aria-pressed="true"] > span { color:var(--ink); }
.mount-story-play { position:absolute; right:.6rem; top:4.1rem; width:44px; height:44px; padding:11px; z-index:2; border:0; border-radius:50%; background:var(--card); color:var(--ink); cursor:pointer; }
.mount-story-play svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2.5; }
.mount-story-play:disabled { opacity:.4; cursor:default; }
.foam-stages { touch-action:pan-y; }
.mount-story-pills button:focus-visible, .mount-story-play:focus-visible, .foam-stages:focus-visible { outline:2px solid var(--ok); outline-offset:3px; }
.foam-demo { padding: .8rem; }
.foam-demo svg { max-height: 14rem; }
.foam-stages { display: grid; }
.foam-stage { grid-area: 1 / 1; min-width: 0; }
.foam-caption { margin: .2rem 0 .1rem; text-align: center; }
.foam-clean-stage { animation: foam-clean-scene 27.75s linear infinite; }
.foam-peel-stage { opacity: 0; animation: foam-peel-scene 27.75s linear infinite; }
.foam-press-stage { opacity: 0; animation: foam-press-scene 27.75s linear infinite; }
.foam-aim-stage { opacity: 0; animation: foam-aim-scene 27.75s linear infinite; }
.foam-aim-stem { fill: none; stroke: var(--muted); stroke-width: 5; }
.foam-aim-ball, .foam-aim-case { fill: var(--line); stroke: var(--muted); stroke-width: 1.5; }
.foam-aim-lens { fill: #23392f; }
.foam-aim-cooktop { stroke: var(--muted); stroke-width: 1.5; }
.foam-aim-beam { fill: none; stroke: var(--ok); stroke-width: 2; stroke-dasharray: 5 4; }
.foam-aim-camera { transform-origin: 79px 57px; animation: foam-aim-tilt 27.75s ease-in-out infinite; }
.foam-aim-targets { fill: var(--ok-soft); fill-opacity: .5; stroke: var(--ok); stroke-width: 2; animation: foam-aim-found 27.75s ease-in-out infinite; }
.foam-clean-grain { fill: none; stroke: var(--muted); stroke-width: 1.5; opacity: .2; }
.foam-cloth { fill: var(--card); stroke: #6b9eab; stroke-width: 2; }
.foam-cloth-fold { fill: none; stroke: #6b9eab; stroke-width: 2; }
.foam-wipe { animation: foam-wipe 27.75s ease-in-out infinite; }
.foam-drops { fill: #6b9eab; animation: foam-dry 27.75s linear infinite; }
.foam-clean-shine { fill: none; stroke: var(--ok); stroke-width: 2.5; animation: foam-clean-shine 27.75s linear infinite; }
.foam-plate { stroke: var(--line); stroke-width: 2; }
.foam-shadow { fill: var(--ink); opacity: .07; }
.foam-backing { fill: #596a63; }
.foam-liner-paper { fill: #dc765a; stroke: #ac4c35; stroke-width: 1.5; }
.foam-liner-fold { fill: none; stroke: #f8cfb9; stroke-width: 3; }
.foam-liner-cover { animation: foam-uncover 27.75s ease-in-out infinite; }
.foam-peeling-liner { transform-origin: 145px 99px; animation: foam-peel 27.75s ease-in-out infinite; }
.foam-peel-arrow, .foam-push-arrow { fill: none; stroke: var(--ok); stroke-width: 3; }
.foam-peel-arrow { animation: foam-peel-cue 27.75s linear infinite; }
.foam-surface { fill: var(--line); }
.foam-wood { fill: #c7a77c; }
.foam-surface-edge { fill: none; stroke: var(--muted); stroke-width: 2; }
.foam-press { animation: foam-attach 27.75s ease-in-out infinite; }
.foam-pressure { animation: foam-push 27.75s ease-in-out infinite; }
.cabinet-continuity .foam-press { animation-name: foam-attach-under; }
.cabinet-continuity .foam-pressure { animation-name: foam-push-under; }
.cabinet-continuity .foam-aim-camera { transform-origin: 120px 85.7px; animation-name: foam-aim-under; }
.foam-contact { fill: none; stroke: var(--ok); stroke-width: 2.5; }
@keyframes foam-clean-scene { 0%, 15.85546% { opacity: 1; visibility: visible; } 17.29795%, 100% { opacity: 0; visibility: hidden; } }
@keyframes foam-peel-scene { 0%, 17.29795% { opacity: 0; visibility: hidden; } 18.73805%, 29.55016% { opacity: 1; visibility: visible; } 30.99027%, 100% { opacity: 0; visibility: hidden; } }
@keyframes foam-press-scene { 0%, 30.09% { opacity: 0; visibility: hidden; } 32.25189%, 50.99114% { opacity: 1; visibility: visible; } 52.43243%, 100% { opacity: 0; visibility: hidden; } }
@keyframes foam-aim-scene { 0%, 80.17978% { opacity: 0; visibility: hidden; } 82.34292%, 100% { opacity: 1; visibility: visible; } }
@keyframes foam-aim-tilt { 0%, 56.03686% { transform: rotate(-20deg); } 63.964%, 100% { transform: rotate(0); } }
@keyframes foam-aim-found { 0%, 63.24335% { opacity: .15; } 66.84659%, 100% { opacity: 1; } }
@keyframes foam-wipe { 0%, 2.88259% { transform: translate(-30px, -8px); } 5.76519% { transform: translate(35px, -8px); } 10.09027% { transform: translate(-30px, 24px); } 13.69351%, 100% { transform: translate(35px, 24px); } }
@keyframes foam-dry { 0%, 3.60324% { opacity: .5; } 10.81092%, 100% { opacity: 0; } }
@keyframes foam-clean-shine { 0%, 11.53157% { opacity: 0; } 13.69351%, 15.85546% { opacity: 1; } 17.29795%, 100% { opacity: 0; } }
@keyframes foam-uncover { 0%, 19.45989% { clip-path: inset(0 0 0 0); } 27.38703%, 100% { clip-path: inset(0 0 100% 0); } }
@keyframes foam-peel { 0%, 19.45989% { transform: translateY(46px); opacity: 1; } 27.38703% { transform: translateY(-48px); opacity: 1; } 29.55016%, 100% { transform: translate(40px, -66px) rotate(-12deg); opacity: 0; } }
@keyframes foam-peel-cue { 0%, 28.10768% { opacity: 1; } 29.55016%, 100% { opacity: 0; } }
@keyframes foam-attach { 0%, 32.97254% { transform: translateX(36px); } 38.73892%, 100% { transform: translateX(0); } }
@keyframes foam-push { 0%, 37.29762% { opacity: 0; transform: translateX(14px); } 40.90086%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes foam-attach-under { 0%, 32.97254% { transform: translateY(24px); } 38.73892%, 100% { transform: translateY(0); } }
@keyframes foam-push-under { 0%, 37.29762% { opacity: 0; transform: translateY(12px); } 40.90086%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes foam-aim-under { 0%, 56.03686% { transform: rotate(-12deg); } 63.964%, 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) {
  .foam-stage { grid-area: auto; opacity: 1; visibility: visible; }
  .foam-stages { gap: 1rem; }
  .foam-drops { opacity: 0; }
  .foam-clean-shine { opacity: 1; }
  .foam-aim-targets { opacity: 1; }
  .foam-peeling-liner { transform: translate(35px, -35px) rotate(-12deg); }
  .foam-liner-cover { clip-path: inset(0 0 65% 0); }
}
.mount-demo svg { max-height: 16rem; }
.mount-demo figcaption { display: flex; align-items: center; gap: .5rem; }
.mount-demo figcaption span { flex: 1; }
.mount-location-steps { flex: 1; margin: 0; padding-left: 1.4rem; text-align: left; }
.mount-location-caption { margin: .45rem 0; padding-left: .2rem; color: var(--ink); font-size: .95rem; font-weight: 600; }
.mount-location-caption::marker { color: var(--ok); font-weight: 700; }
.mount-outlet-cue { animation: mount-rule-outlet 12s linear infinite; }
.mount-location-outlet { animation: mount-list-first 12s linear infinite; }
.mount-location-view { animation: mount-list-second 12s linear infinite; }
.mount-location-drop { animation: mount-list-third 12s linear infinite; }
/* Once Below is reached, retain the whole checklist while highlights loop. */
.mount-demo[data-rules-complete="true"] .mount-location-caption { animation-name: mount-list-first; }
.mount-demo .md-pad { animation: none; }
.mount-view-cue, .mount-demo .mount-aim-overlay { animation: mount-rule-view 12s linear infinite; }
.mount-demo .mount-drop-overlay { animation: mount-rule-drop 12s linear infinite; }
.mount-cue-halo { fill:var(--ok); fill-opacity:.2; }
.mount-burner-highlight { fill:var(--ok); fill-opacity:.45; }
.mount-cue-halo, .mount-burner-highlight, .mount-demo .mi-drop-zone { animation: mount-feature-flash 12s ease-in-out infinite; }
.mount-demo .mi-drop-zone { fill:var(--alarm); stroke-width:3.5; animation-name:mount-drop-pulse; }
.mount-demo .mi-drop-line, .mount-demo .mi-drop-arrow { stroke-width:2.5; }
/* One gentle pulse every two seconds, on the story clock so replay,
   hold and orbit keep it aligned with the current instruction. */
@keyframes mount-feature-flash {
  0%, 16.667%, 33.333%, 50%, 66.667%, 83.333%, 100% { fill-opacity:.16; }
  8.333%, 25%, 41.667%, 58.333%, 75%, 91.667% { fill-opacity:.6; }
}
@keyframes mount-drop-pulse {
  0%, 16.667%, 33.333%, 50%, 66.667%, 83.333%, 100% { fill-opacity:.45; }
  8.333%, 25%, 41.667%, 58.333%, 75%, 91.667% { fill-opacity:.95; }
}
/* Reserve the full list height; add each rule without moving the diagram. */
@keyframes mount-list-first { 0%, 100% { opacity: 1; visibility: visible; } }
@keyframes mount-list-second { 0%, 30% { opacity: 0; visibility: hidden; transform: translateY(4px); } 34%, 100% { opacity: 1; visibility: visible; transform: translateY(0); } }
@keyframes mount-list-third { 0%, 63% { opacity: 0; visibility: hidden; transform: translateY(4px); } 67%, 100% { opacity: 1; visibility: visible; transform: translateY(0); } }
@keyframes mount-rule-outlet { 0%, 29% { opacity: 1; visibility: visible; } 33%, 100% { opacity: 0; visibility: hidden; } }
@keyframes mount-rule-view { 0%, 30% { opacity: 0; visibility: hidden; } 34%, 62% { opacity: 1; visibility: visible; } 66%, 100% { opacity: 0; visibility: hidden; } }
@keyframes mount-rule-drop { 0%, 63% { opacity: 0; visibility: hidden; } 67%, 96% { opacity: 1; visibility: visible; } 100% { opacity: 0; visibility: hidden; } }
/* Final mounting scene: route the cable down the wall beside the stove. */
.foam-clips-stage { opacity: 0; animation: foam-clips-scene 27.75s linear infinite; }
.clip-route { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .4; }
.clip-base, .clip-outlet { fill: var(--card); stroke: var(--muted); stroke-width: 1.2; }
.clip-outlet-slots { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.clip-retainer { fill: none; stroke: var(--card); stroke-width: 3; }
.clip-attach { animation: clip-attach-first 27.75s ease-out infinite both; }
.clip-attach-2 { animation-name: clip-attach-second; }
.clip-cable path { fill: none; stroke-linecap: round; stroke-dasharray: 200; animation: clip-cable-route 27.75s ease-in-out infinite; }
.clip-cable-edge { stroke: var(--muted); stroke-width: 4; }
.clip-cable-core { stroke: var(--card); stroke-width: 2.3; }
.clip-press-arrow { fill: none; stroke: var(--ok); stroke-width: 2.5; }
@keyframes foam-clips-scene { 0%, 52.43243% { opacity: 0; visibility: hidden; } 54.59438%, 78.01784% { opacity: 1; visibility: visible; } 80.17978%, 100% { opacity: 0; visibility: hidden; } }
@keyframes clip-attach-first { 0%, 74.77492% { opacity: 0; transform: translateX(14px); } 78.81103%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes clip-attach-second { 0%, 78.81103% { opacity: 0; transform: translateX(14px); } 82.84714%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes clip-cable-route { 0%, 83.85557% { stroke-dashoffset: 200; opacity: 0; } 84.86519% { stroke-dashoffset: 200; opacity: 1; } 93.94584%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mount-location-caption { transform: none; }
  .mount-demo[data-rules-complete="true"] .mount-location-caption { animation: none; }
  .mount-location-caption, .mount-outlet-cue, .mount-view-cue, .mount-demo .mount-drop-overlay { animation: none; opacity: 1; visibility: visible; }
  .mount-demo .mount-aim-overlay { animation:none; opacity:0; visibility:hidden; }
  .mount-demo[data-story-index="1"] .mount-aim-overlay { opacity:1; visibility:visible; }
  .clip-attach, .clip-cable path { animation: none; transform: none; stroke-dashoffset: 0; opacity: 1; }
}
/* Mounting instructions use the same camera, room and geometry as Location. */
.foam-demo .mount-instruction-scene { max-height: 16rem; }
.mount-instruction-scene .md-pad { animation: none; }
.mount-instruction-scene .mount-view-cue, .mount-instruction-scene .mount-burner-highlight { animation: none; opacity: 1; visibility: visible; }
.mount-instruction-scene[data-mount-phase="clean"] [data-mount-part]:not([data-mount-part="environment"]) { display: none; }
.mount-instruction-scene:not([data-mount-phase="clips"]):not([data-mount-phase="aim"]) [data-mount-part="cable"],
.mount-instruction-scene:not([data-mount-phase="clips"]):not([data-mount-phase="aim"]) [data-mount-part="clips"] { display: none; }
.mount-instruction-scene[data-mount-phase="peel"] [data-mount-part="environment"] { opacity: .4; }
.mount-instruction-scene[data-mount-phase="peel"] [data-mount-part="mount"],
.mount-instruction-scene[data-mount-phase="peel"] [data-mount-part="device"] { display: none; }
.mount-stl-liner path, .mount-stl-liner circle { vector-effect: non-scaling-stroke; }
.mount-stl-liner .foam-liner-paper { stroke-width: 1.2; }
.mount-stl-liner .foam-liner-fold { stroke-width: 1.8; }
.mount-instruction-scene[data-mount-phase="press"] [data-mount-part="mount"],
.mount-instruction-scene[data-mount-phase="press"] [data-mount-part="device"] { animation: mount-attach-3d 27.75s ease-in-out infinite; }
.mount-instruction-scene[data-mount-phase="aim"] [data-mount-part="device"] { transform-origin: var(--ball-x) var(--ball-y); animation: mount-aim-3d 27.75s ease-in-out infinite; }
.mount-cloth-face { fill: #a4d5df; stroke: #477f91; stroke-width: 1.4; }
.mount-cloth-fold { fill: #76b1c3; stroke: #477f91; stroke-width: 1.4; }
.mount-cloth-edge { fill: #5d9fb3; stroke: #477f91; stroke-width: 1.2; }
.mount-cloth-stitch { fill: none; stroke: #e2f4f6; stroke-width: 1; stroke-dasharray: 2 2; }
.mount-wipe { animation: mount-wipe-3d 27.75s ease-in-out infinite; }
.mount-action-arrow { fill: none; stroke: var(--ok); stroke-width: 2.5; }
.mount-contact-ring { fill: none; stroke: var(--ok); stroke-width: 2; stroke-dasharray: 3 4; }
.mount-liner-cover { animation: foam-uncover 27.75s ease-in-out infinite; }
.mount-liner-lift { animation: mount-peel-3d 27.75s ease-in-out infinite; }
.mount-pressure-cue { animation: mount-press-3d 27.75s ease-in-out infinite; }
.mount-instruction-beam { animation: mount-aim-found-3d 27.75s ease-in-out infinite; }
.mount-instruction-scene[data-mount-phase="clips"] [data-mount-part="clips"] { animation: mount-clip-3d 27.75s ease-out infinite; }
.mount-instruction-scene[data-mount-phase="clips"] [data-mount-part="cable"] { stroke-dasharray: 1; animation: mount-cable-3d 27.75s ease-in-out infinite; }
.mount-clip-detail { animation: mount-clip-detail 27.75s ease-out infinite; }
.mount-clip-leader { fill: none; stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mount-clip-focus { fill: none; stroke: #237b55; stroke-width: 2; animation: mount-clip-focus 27.75s ease-in-out infinite; }
.mount-clip-detail-back { fill: #e9f4ec; stroke: #7d9b89; stroke-width: 1.3; }
.mount-clip-detail-base { fill: #fff9; stroke: #688a86; stroke-width: 1.2; }
.mount-clip-detail-surface { fill: none; stroke: #9aa99e; stroke-width: 3; }
.mount-clip-detail-holder { animation: mount-clip-seat 27.75s ease-in-out infinite; }
.mount-clip-detail-cord { fill: none; stroke: #34483d; stroke-width: 3; stroke-linecap: round; animation: mount-clip-thread 27.75s ease-out infinite; }
.mount-clip-detail-hook-edge { fill: none; stroke: #688a86; stroke-width: 4.5; stroke-linecap: round; }
.mount-clip-detail-hook { fill: none; stroke: #e8f7f2b3; stroke-width: 2.5; stroke-linecap: round; }
.mount-clip-liner { transform-origin: 11px 15px; animation: mount-clip-peel 27.75s ease-in-out infinite; }
.mount-clip-liner-sheet, .mount-clip-liner-tab { fill: #b9dfed; stroke: #45778b; stroke-width: 1; }
.mount-instruction-scene[data-mount-phase="clips"] [data-mount-part="adapter"] { animation: mount-plug-in 27.75s ease-in-out infinite; }
@keyframes mount-plug-in {
  0%, 54.59438% { opacity: 0; transform: translate(var(--plug-x),var(--plug-y)); }
  55.13514% { opacity: 1; transform: translate(var(--plug-x),var(--plug-y)); }
  60.36036%, 100% { opacity: 1; transform: translate(0,0); }
}
@keyframes mount-wipe-3d {
  0%, 2.88259% { transform: translate(calc(-1 * var(--wipe-x)),calc(-1 * var(--wipe-y))); }
  5.76519% { transform: translate(var(--wipe-x),var(--wipe-y)); }
  10.09027% { transform: translate(calc(-1 * var(--wipe-x)),calc(-1 * var(--wipe-y))); }
  13.69351%, 100% { transform: translate(var(--wipe-x),var(--wipe-y)); }
}
@keyframes mount-peel-3d { 0%, 19.45989% { transform: translateY(0); opacity: 0; } 20.21622% { opacity: 1; } 27.38703% { transform: translate(20px,-32px) rotate(-12deg); opacity: 1; } 29.55016%, 100% { transform: translate(28px,-46px) rotate(-12deg); opacity: 0; } }
@keyframes mount-attach-3d { 0%, 32.97254% { transform: translate(var(--attach-x),var(--attach-y)); } 38.73892%, 100% { transform: translate(0,0); } }
@keyframes mount-press-3d { 0%, 37.29762% { opacity: 0; transform: translate(calc(var(--attach-x) * .4),calc(var(--attach-y) * .4)); } 40.90086%, 100% { opacity: 1; transform: translate(0,0); } }
@keyframes mount-aim-found-3d { 0%, 89.54941% { opacity: .15; } 95.67611%, 100% { opacity: 1; } }
@keyframes mount-aim-3d { 0%, 83.78541% { transform: rotate(-18deg); } 91.71254%, 100% { transform: rotate(0); } }
@keyframes mount-clip-3d { 0%, 68% { opacity: 0; transform: translateX(6px); } 72%, 100% { opacity: 1; transform: translateX(0); } }
@keyframes mount-clip-detail { 0%, 60.5% { opacity: 0; } 62%, 100% { opacity: 1; } }
@keyframes mount-clip-peel { 0%, 62% { opacity: 1; transform: translate(0,0) rotate(0); } 66.5% { opacity: 1; transform: translate(18px,-18px) rotate(30deg); } 68%, 100% { opacity: 0; transform: translate(23px,-25px) rotate(35deg); } }
@keyframes mount-clip-seat { 0%, 68% { transform: translateX(-12px); } 72%, 100% { transform: translateX(0); } }
@keyframes mount-clip-thread { 0%, 72% { opacity: 0; } 75%, 100% { opacity: 1; } }
@keyframes mount-clip-focus { 0%, 63.06306% { opacity: 0; } 67%, 73%, 79% { opacity: .7; } 70%, 76%, 82%, 100% { opacity: .2; } }
@keyframes mount-cable-3d { 0%, 55.13514% { stroke-dashoffset: 1; opacity: 0; } 55.85586% { stroke-dashoffset: 1; opacity: 1; } 60.36036%, 100% { stroke-dashoffset: 0; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .mount-wipe, .mount-liner-lift, .mount-pressure-cue, .mount-instruction-beam, .mount-clip-focus, .mount-clip-detail,
  .mount-clip-liner, .mount-clip-detail-holder, .mount-clip-detail-cord,
  .mount-instruction-scene[data-mount-phase] [data-mount-part] { animation: none !important; }
  .mount-instruction-scene[data-mount-phase="press"] [data-mount-part],
  .mount-instruction-scene[data-mount-phase="aim"] [data-mount-part],
  .mount-instruction-scene[data-mount-phase="clips"] [data-mount-part] { transform: none; }
  .mount-liner-cover { animation: none; clip-path: inset(0 0 65% 0); }
  .mount-liner-lift { transform: translate(20px,-24px) rotate(-12deg); }
  .mount-instruction-scene[data-mount-phase="clips"] [data-mount-part="cable"] { stroke-dashoffset: 0; opacity: 1; }
  .mount-instruction-beam { opacity: 1; }
  .mount-clip-focus { opacity: .35; }
  .mount-clip-liner { transform: translate(17px,-14px) rotate(25deg); }
}
.mount-graphic { position: relative; }
.mount-zoom { position: absolute; bottom: .25rem; right: .25rem; display: flex; flex-direction: column; gap: 0; }
.mount-zoom button { position: relative; isolation: isolate; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-size: 1.2rem; cursor: pointer; }
.mount-zoom button::before { content: ''; position: absolute; inset: 4px; z-index: -1; border: 1px solid var(--line); border-radius: 9px; background: var(--card); box-shadow: var(--shadow); }
.mount-zoom button:disabled { opacity: .45; cursor: default; }
.mount-rules { margin: 1rem 0; padding-left: 1.5rem; }
.mount-rules li { padding: .3rem 0 .3rem .3rem; font-weight: 600; }
.mount-rules li::marker { color: var(--ok); }
.mount-rules span { display: block; color: var(--muted); font-size: .85rem; font-weight: 400; }
.mount-drop-key::before { content: ''; display: inline-block; width: .6rem; height: .6rem; margin-right: .35rem; border: 2px solid var(--alarm); border-radius: 2px; background: var(--alarm-soft); }
.mount-orbit { cursor: grab; touch-action: none; user-select: none; border-radius: 10px; }
.mount-orbit.dragging { cursor: grabbing; }
.mount-orbit:focus-visible { outline: 2px solid var(--ok); outline-offset: 3px; }
.mount-view-help { margin: .3rem 0 .5rem; color: var(--muted); font-size: .85rem; text-align: center; }
.mount-drop-note { display: flex; align-items: center; justify-content: center; gap: .4rem; margin: .2rem 0 .4rem; font-size: .85rem; }
.mount-drop-note span { flex: 0 0 .8rem; height: .8rem; border: 2px solid var(--alarm); border-radius: 2px; background: var(--alarm-soft); }
.mi-drop-zone { fill: var(--alarm-soft); fill-opacity: .75; stroke: var(--alarm); stroke-width: 2; }
.mi-drop-line { fill: none; stroke: var(--alarm); stroke-width: 1.5; stroke-dasharray: 3 5; }
.mi-drop-arrow { fill: none; stroke: var(--alarm); stroke-width: 1.7; }
.mi-shadow { fill: #605846; opacity: .09; }
.mi-wall { fill: #eee9df; }.mi-tile { fill: none; stroke: #ded7c9; stroke-width: .8; }
.mi-wood { fill: #c7a57c; stroke: #ac8961; stroke-width: .8; }
.mi-wood.side { fill: #b18d65; }.mi-wood.top { fill: #e1c6a3; }
.mi-wood.underside { fill: #b89972; }
.mi-panel { fill: #d5b58e; stroke: #ac8961; stroke-width: .8; }
.mi-handle { fill: none; stroke: #73634d; stroke-width: 2.5; }
.mi-metal { fill: #c7d1d3; stroke: #8a9c9e; stroke-width: .8; }
.mi-metal.side { fill: #a5b6b9; }.mi-metal.top { fill: #e4edef; }
.mi-metal.underside { fill: #abbabe; }
.mi-vent { fill: none; stroke: #627f82; stroke-width: 1.7; }
.mi-base { fill: #cab69a; stroke: #b49b7c; stroke-width: .7; }
.mi-base.side { fill: #b8a183; }.mi-base.top { fill: #ece3d3; }
.mi-range { fill: #e5e5dd; stroke: #c1c5bd; stroke-width: .7; }.mi-range.side { fill: #cdd2ca; }
.mi-door { fill: #777f78; }.mi-oven-handle { fill: none; stroke: #ccd6cc; stroke-width: 2; }
.mi-cooktop { fill: #37473d; }.mi-burner { fill: #293a30; stroke: #acbdad; stroke-width: 1.5; }
.mi-selected { stroke: #397659; stroke-width: 1.4; }
.mi-socket { fill: none; stroke: #738876; stroke-width: 4; }
.mi-outlet, .mi-adapter { fill: #fffdf5; stroke: #928e81; stroke-width: 1; }
.mi-outlet-slot { fill: none; stroke: #4c514b; stroke-width: 1.5; }
.mi-adapter.side { fill: #e1e1d8; }
.mi-cord { fill: none; stroke: #34483d; stroke-width: 2.3; }
.mi-clip { fill: #edf9f680; stroke: #64817a; stroke-width: .8; }
.mi-clip-loop-edge, .mi-clip-loop { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mi-clip-loop-edge { stroke: #64817a; stroke-width: 3; }
.mi-clip-loop { stroke: #e8f7f2b3; stroke-width: 1.7; }
.md-pad { fill: #e6e7e2; stroke: #7f8880; stroke-width: .8; animation: mount-seat 5s ease-in-out infinite; }
.md-pad.side { fill: #bcc1b9; stroke-width: .35; }
.md-socket-base { fill: #b7bdb5; stroke: #7f8880; stroke-width: .8; }
.md-socket-rim { fill: #d9ddd5; stroke: #7f8880; stroke-width: .8; }
.md-ball { fill: #d5e0d7; stroke: #516e59; stroke-width: 1.5; }
.md-case { fill: #fffdf6; stroke: #516e59; stroke-width: 1.5; }
.md-case.side { fill: #e2e8de; }.md-case.underside { fill: #d1dbc9; }
.md-usb, .md-lens { fill: #253b2d; }
.md-label { fill: var(--muted); font: 12px system-ui, sans-serif; text-anchor: middle; }
.md-aim-line { stroke: var(--ok); stroke-width: 2; fill: var(--card); }
path.md-aim-line { stroke-dasharray: 5 4; fill: none; }
.mi-aim-target { fill: var(--card); stroke: var(--ok); stroke-width: 1.5; }
@keyframes mount-seat { 0%, 100% { stroke: #7f8880; } 50% { stroke: #28835a; } }
.cal-demo { padding: .65rem; }
.cal-demo svg { max-height: 10rem; }
.cal-demo figcaption { font-size: .95rem; font-weight: 500; }
.f-mugtop { fill: var(--f-warm); stroke: var(--f-ink); stroke-width: 1.6; }
.f-steam { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.demo-place-mug { animation: place-mug 1.2s ease-out var(--mug-delay) both; }
.mug-placement-loop .demo-place-mug { animation: place-mugs-first 6s ease-out infinite both; }
.mug-placement-loop .demo-place-mug:nth-of-type(2) { animation-name: place-mugs-second; }
.mug-placement-loop .demo-place-mug:nth-of-type(3) { animation-name: place-mugs-third; }
.mug-single-placement .demo-place-mug:nth-of-type(n) { animation-name: place-single-mug; }
.mug-placement-loop.paused .demo-place-mug { animation-play-state: paused; }
.mug-clear-loop { display: flex; flex-direction: column; }
.mug-clear-loop figcaption { order: -1; margin-bottom: .4rem; font-size: 1.15rem; }
.demo-clear-mug { transform: translateX(var(--mug-out-x)); animation: clear-mugs 5s ease-in-out infinite; }
.demo-clear-check { animation: clear-mugs-check 5s step-end infinite; }
.mug-clear-loop.paused .demo-clear-mug, .mug-clear-loop.paused .demo-clear-check { animation-play-state: paused; }
/* Move fully onto the counter, hold the empty stove, then restart without fading. */
@keyframes clear-mugs { 0%, 18% { transform: translateX(0); } 60%, 100% { transform: translateX(var(--mug-out-x)); } }
@keyframes clear-mugs-check { 0% { opacity: 0; } 60%, 100% { opacity: 1; } }
.mug-positions { display: block; margin-top: .4rem; color: var(--muted); font-size: .85rem; font-weight: 400; }
/* Share one clock: keep every mug down, then reset all three at the loop boundary. */
@keyframes place-mugs-first { 0%, 5% { opacity: 0; transform: translateY(-24px); } 15%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes place-mugs-second { 0%, 17% { opacity: 0; transform: translateY(-24px); } 27%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes place-mugs-third { 0%, 29% { opacity: 0; transform: translateY(-24px); } 39%, 100% { opacity: 1; transform: translateY(0); } }
/* Take two seconds to lower the mug, hold it in place, then clearly restart. */
@keyframes place-single-mug { 0%, 5% { opacity: 0; transform: translateY(-24px); } 6% { opacity: 1; transform: translateY(-24px); } 40%, 100% { opacity: 1; transform: translateY(0); } }
.demo-lift-mug { opacity: 0; transform: translateX(var(--mug-out-x)); animation: lift-mug 3.2s ease-in-out both; }
.demo-mug-away-check { animation: mug-away-check 3.2s ease-out both; }
.demo-center-dot { fill: #fff; stroke: #53605a; stroke-width: 2; }
.burner-action { font-size: 1.15rem; font-weight: 600; }
.step-goal { color: var(--muted); font-size: .95rem; margin: .35rem 0 .8rem; }
.burner-guide, .presence-guide { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: .4rem 0; }
.burner-guide > div:last-child, .presence-guide > div:last-child { flex: 1 1 10rem; min-width: 0; }
.burner-guide p, .presence-guide p { margin: .15rem 0; }
#presence-demo { flex: 0 0 5.5rem; }
.burner-guide .cal-demo, .presence-guide .cal-demo { margin: 0; padding: .2rem; }
.burner-guide .demo-replay, .presence-guide .demo-replay { display: none; }
#pc-burners-count { margin: 0; }
.burner-picture { position: relative; margin: 0 auto; aspect-ratio: var(--heat-aspect, 1.333); }
.burner-picture.orienting canvas { filter: grayscale(1); opacity: .3; }
#pc-orienting { position: absolute; inset: 0; display: grid; place-items: center; border-radius: calc(var(--radius) - 4px); background: #80808033; }
#pc-orienting[hidden] { display: none; }
.orientation-status { display: flex; align-items: center; max-width: calc(100% - 1rem); padding: .65rem .8rem; border-radius: var(--radius-sm); background: var(--card); color: var(--ink); box-shadow: 0 2px 12px #0002; font-size: .9rem; }
.orientation-status .wait-spin { flex-shrink: 0; }
.placing-mugs .burner-picture { max-width: min(100%, calc(48svh * var(--heat-aspect, 1.333))); }
#pc-mug-instruction:focus, #pc-center-title:focus, #pc-burner-instruction:focus { outline: none; }
.mug-placement-instruction .burner-action { margin: .3rem 0; }
.hot-water-word { background: #b42318; color: #fff; padding: .05em .25em; border-radius: .25em; }
.calibration-visual { margin-top: .5rem; }
.filling-mugs #pc-live-view { display: none; }
.calibration-demo, #pc-live-view { min-width: 0; }
.alignment-note { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .65rem; align-items: start; margin: 0 0 .75rem; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: .9rem; line-height: 1.4; }
.alignment-note strong { display: block; font-weight: 600; }
.alignment-note-detail { display: block; margin-top: .25rem; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.alignment-note-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: .65rem; color: var(--ok); background: var(--ok-soft); }
.alignment-note-icon svg { width: 1.7rem; height: 1.7rem; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#pc-live-view .burner-picture:has(canvas[hidden]) { background: var(--surface); border-radius: var(--radius-sm); }
.calibration-demo-art { margin: 0; }
#calibration-demo-detail { margin: .3rem 0; }
.calibration-view-controls { display: grid; margin: .4rem 0 .7rem; }
.calibration-view-controls:not(:has(button:not([hidden]))) { display: none; }
.calibration-view-controls button { grid-area: 1 / 1; justify-self: start; min-height: 44px; }
.playing-demo #pc-placement-details, .playing-demo #pc-burner-actions, .playing-demo #pc-center-actions, .playing-demo #position-checks, .playing-demo #pc-restart-cups, .playing-demo #pc-dot-controls { display: none; }
.calibration-demo .instruction-demo { margin: 0; padding: 0; background: transparent; }
.calibration-demo .instruction-demo svg { width: 100%; max-height: 11rem; }
.calibration-demo figcaption, .calibration-demo .demo-replay { display: none; }
.calibration-demo .demo-place-mug, .calibration-demo .demo-clear-mug, .calibration-demo .demo-clear-check { animation-duration: 2s; animation-iteration-count: 1; animation-fill-mode: both; animation-play-state: running; }
.calibration-demo .mug-single-placement .demo-place-mug, .calibration-demo .mug-all-placement .demo-place-mug { animation-duration: 6s; animation-iteration-count: infinite; }
.calibration-demo .demo-center-view { animation: center-view 2s ease-in-out both; }
.demo-move-front-mug { transform: translate(-55px, -16px); animation: move-front-mug 3s ease-in-out infinite both; }
@keyframes move-front-mug { 0%, 20% { transform: translate(0, 0); } 75%, 100% { transform: translate(-55px, -16px); } }
.demo-next-burner-mug { transform: translate(55px, -16px); animation: next-burner-mug 4s ease-in-out infinite both; }
@keyframes next-burner-mug { 0%, 20% { transform: translate(-55px, -16px); } 75%, 100% { transform: translate(55px, -16px); } }
@keyframes center-view { 0%, 15% { transform: translate(-14px, 10px); } 65%, 100% { transform: translate(0, 0); } }
.demo-fill-row { animation: fill-mug-row 9s ease-in-out infinite; }
.demo-fill-water { fill: #88c6df; transform-box: fill-box; transform-origin: bottom; animation: fill-water-first 9s linear infinite; }
.fill-water-2 { animation-name: fill-water-second; }
.fill-water-3 { animation-name: fill-water-third; }
.demo-tap-water { fill: none; stroke: #88c6df; stroke-width: 4; stroke-dasharray: 6 4; animation: tap-water 9s step-end infinite; }
.demo-fill-heat { animation: fill-heat-first 9s linear infinite; }
.fill-heat-2 { animation-name: fill-heat-second; }
.fill-heat-3 { animation-name: fill-heat-third; }
.demo-fill-heat path { fill: none; stroke: #c7472e; stroke-width: 3; stroke-linecap: round; animation: fill-steam-rise 2s ease-out infinite; }
.demo-fill-heat path:nth-child(2) { animation-delay: -.65s; }
.demo-fill-heat path:nth-child(3) { animation-delay: -1.3s; }
@keyframes fill-heat-first { 0%, 23%, 100% { opacity: 0; } 28%, 94% { opacity: 1; } }
@keyframes fill-heat-second { 0%, 53%, 100% { opacity: 0; } 58%, 94% { opacity: 1; } }
@keyframes fill-heat-third { 0%, 83%, 100% { opacity: 0; } 88%, 94% { opacity: 1; } }
@keyframes fill-steam-rise { 0% { opacity: 0; transform: translateY(3px); } 25%, 65% { opacity: 1; } 100% { opacity: 0; transform: translateY(-7px); } }
@keyframes fill-mug-row { 0%, 25% { transform: translateX(100px); } 36%, 55% { transform: translateX(0); } 66%, 85% { transform: translateX(-100px); } 95%, 100% { transform: translateX(0); } }
@keyframes fill-water-first { 0%, 10% { transform: scaleY(0); } 24%, 100% { transform: scaleY(1); } }
@keyframes fill-water-second { 0%, 40% { transform: scaleY(0); } 54%, 100% { transform: scaleY(1); } }
@keyframes fill-water-third { 0%, 70% { transform: scaleY(0); } 84%, 100% { transform: scaleY(1); } }
@keyframes tap-water { 0%, 25%, 55%, 85% { opacity: 0; } 10%, 40%, 70% { opacity: 1; } }
.placement-feedback { position: absolute; top: .5rem; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 1rem); margin: 0; padding: .45rem .65rem; border-radius: var(--radius-sm); background: #16181ce6; color: #fff; font-size: .9rem; font-weight: 600; text-align: center; pointer-events: none; }
.placement-feedback.learned { background: #123e2bee; }
.placement-feedback.needs-help { background: #703a0bee; }
#mug-placement-labels { position: absolute; inset: 0; pointer-events: none; }
#mug-placement-labels span { position: absolute; transform: translate(-50%, -140%); border-radius: .4rem; padding: .15rem .35rem; background: #123e2b; color: #fff; border: 1px solid #7effad; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.finding-burners .burner-picture { max-width: min(100%, calc(38svh * var(--heat-aspect, 1.333))); }
.centering-mugs #pc-center-demo svg { max-height: 16svh; }
.centering-mugs .burner-picture { max-width: min(100%, calc(34svh * var(--heat-aspect, 1.333))); }
#mug-center-guide { position: absolute; inset: 16%; border: 2px dashed #7effad; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 1px #12281c66; }
#pc-center-actions, #pc-burner-actions .buttons { margin-top: .55rem; }
#pc-restart-cups { display: block; width: auto; margin-top: 1.5rem; padding: 1rem 2rem; }
#burner-feedback { position: absolute; transform: translate(-50%, -50%); width: 40px; height: 40px; border: 3px dashed #42e891; border-radius: 50%; box-shadow: 0 0 0 2px #12281c; pointer-events: none; }
#burner-feedback[data-state="ready"] { border-style: solid; }
#burner-feedback[data-state="added"] { width: auto; height: auto; border: 0; border-radius: 1rem; padding: .25rem .5rem; background: var(--ok); color: var(--card); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.presence-indicator { display: flex; gap: .7rem; align-items: center; padding: .65rem .8rem; border-radius: var(--radius-sm); background: var(--surface); }
.presence-indicator[data-detected="yes"] { background: var(--ok-soft); color: var(--ok); }
#presence-test { margin-bottom: .75rem; }
#presence-icon { display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; width: 1.7rem; height: 1.7rem; flex-shrink: 0; font-weight: 700; }
#presence-effect { display: block; font-size: .8rem; }
.demo-route { fill: none; stroke: var(--ok); stroke-width: 2; stroke-dasharray: 4 5; }
@keyframes place-mug { from { opacity: 0; transform: translateY(-24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lift-mug { 0%, 22% { transform: translateX(0); opacity: 1; } 78% { transform: translateX(var(--mug-out-x)); opacity: 1; } 90%, 100% { transform: translateX(var(--mug-out-x)); opacity: 0; } }
@keyframes mug-away-check { 0%, 86% { opacity: 0; } 100% { opacity: 1; } }
.presence-area { fill: var(--ok-soft); stroke: var(--ok); stroke-dasharray: 5 4; stroke-width: 2; }
.demo-person { fill: var(--ok); stroke: var(--ok); stroke-width: 5; }
.demo-person path { fill: none; }.demo-hand { transform-origin: 98px 105px; }
.demo-near .demo-hand { animation: wave-hand 2.8s ease-in-out both; }.demo-away { transform: translateX(164px); animation: walk-away 3s ease-in-out both; }
@keyframes wave-hand { 0%, 100% { transform: rotate(0); } 25%, 65% { transform: rotate(-25deg); } 45%, 85% { transform: rotate(12deg); } }
@keyframes walk-away { 0%, 20% { transform: translateX(0); } 100% { transform: translateX(164px); } }
.oven-window { fill: var(--card); stroke: var(--muted); stroke-width: 1.5; }
.oven-state { padding: 1rem; margin: .8rem 0; border-radius: var(--radius-sm); background: var(--surface); animation: oven-state-enter .4s ease-out both; }
.oven-state strong { display: block; font-size: 1.55rem; line-height: 1.2; letter-spacing: .02em; }
.oven-state div > span { display: block; margin-top: .35rem; font-size: .9rem; }
.oven-state div { min-width: 0; }
#oven-flow { scroll-margin-top: .75rem; }
#oven-flow > #oven-live-view { margin-top: .75rem; }
#oven-flow:focus { outline: none; }
#oven-flow .buttons { grid-template-columns: 1fr; }
#oven-flow .oven-actions .buttons { margin-top: .55rem; }
#oven-flow .oven-cue { margin-top: .6rem; }
#oven-flow .oven-cue svg { max-height: 7rem; }
#oven-flow .oven-cue figcaption { font-size: .85rem; }
#oven-flow .oven-cue .demo-replay { display: none; }
.oven-state[data-state="turn-on"], .oven-state[data-state="on"] { background: var(--on-soft); color: var(--on); }
.oven-cue .demo-oven-heat { animation: oven-warm 3.8s ease-out both; }
.oven-cue .oven-waves { animation: oven-heat-rise 3s ease-in-out infinite; }
.oven-cue .oven-element { stroke-width: 6; }
@keyframes oven-state-enter { from { opacity: .5; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes oven-heat-rise { 0%, 100% { opacity: .5; transform: translateY(3px); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .oven-state, .oven-cue .oven-waves, .oven-cue .demo-oven-heat { animation: none; } }
.oven-element { fill: none; stroke: #cf7023; stroke-width: 4; }.oven-waves { fill: none; stroke: #c47b42; stroke-width: 2; }
.demo-oven-heat { animation: oven-warm 3.8s ease-out both; }.demo-dial { transform: rotate(70deg); animation: turn-dial 1.5s ease-in-out both; }
@keyframes oven-warm { 0%, 30% { opacity: 0; } 100% { opacity: 1; } }
@keyframes turn-dial { from { transform: rotate(0); } to { transform: rotate(70deg); } }
@media (prefers-color-scheme: dark) {
  .mount-demo { background: #252b28; }.mi-wall { fill: #373d37; }.mi-tile { stroke: #51594e; }
  .mi-wood { fill: #947553; }.mi-wood.side { fill: #7e6347; }.mi-wood.top, .mi-panel { fill: #ad8e6a; }
  .mi-base { fill: #8b7962; }.mi-base.side { fill: #76664f; }.mi-base.top { fill: #baad95; }
  .mi-selected { stroke: #86cfad; }.mi-cord { stroke: #d5dfd5; }
}
@media (prefers-reduced-motion: reduce) {
  .instruction-demo *, .guide-fig .demo-lift-mug, .guide-fig .demo-place-mug, .guide-fig .demo-mug-away-check { animation: none !important; }
  .demo-lift-mug { opacity: 1; transform: none; }
  .cal-checkpoint * { animation: none !important; }
  .demo-replay { display: none; }
}
/* Phone setup labels remain readable with enlarged text on a narrow screen. */
#connection-guide .guide-progress > span, .setup-card.guide .guide-progress > span { flex: 0 1 auto; min-width: 0; }

.live-canvas.editing-oven-area { cursor: crosshair; }

.calibration-final .checkpoint-seal { width: 5.5rem; height: 5.5rem; }
.calibration-final .checkpoint-seal svg { width: 3.25rem; height: 3.25rem; }

/* Match the other pills visually; let the button's tap area extend above
   and below the pill without increasing its height or shifting the row. */
.oven-status-info { position: relative; display: flex; align-items: center; justify-content: center; gap: .35rem; min-width: 44px; min-height: 44px; margin: calc((1.2em - 44px) / 2) 0; padding: 0; border: 0; border-radius: inherit; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.oven-status-info svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
#oven-reading-dialog { width: min(26rem, calc(100vw - 2.5rem)); padding: 1.25rem; border: 0; border-radius: var(--radius); background: var(--card); color: var(--ink); }
#oven-reading-dialog::backdrop { background: rgba(20, 22, 26, .55); }
#oven-reading-dialog p { margin: .75rem 0 1rem; }

/* ---- 2026-10-25 feedback ----------------------------------------------------- */
/* Numbered steps in the connection guide: what to do on the phone, in order. */
.guide-steps { margin: 0 0 .8rem; padding-left: 1.35rem; display: grid; gap: .45rem; font-size: 1.02rem; }
/* A changed instruction or title fades in with a brief highlight so it is seen. */
@keyframes attention { 0% { opacity: 0; background: var(--ok-soft); } 35% { opacity: 1; background: var(--ok-soft); } 100% { opacity: 1; background: transparent; } }
.attention { animation: attention 1.6s ease-out both; border-radius: .3em; box-decoration-break: clone; }
.home-screen-help { margin: 1rem 0; }
.mount-location-note { margin: .4rem 0 0; }
