/* Ultra-functionalist: read at arm's length, hit with a wet thumb.
   Dark by default; the light scheme is an override, not the base.

   Three views share this page (UI.md): the egg, Settings and Help. The
   egg is two controls and a sentence; everything else is a rarer visit. */

:root {
  --bg: #0c0d0f;
  --panel: #17181c;
  --line: #2a2c31;
  --fg: #f5f5f6;
  --dim: #a0a2a8;
  --accent: #ffb020;
  --accent-fg: #1a1200;
  --track: #3a3d43;
  --blocked: #26282d;
  --warn: #ff7a4d;
  --ok: #5ad17f;
  --focus: #6fb5ff;
  /* The doneness track's hue, a yolk's: deep orange runny, golden jammy,
     pale yellow hard. Bright, to stand off the dark track. */
  --yolk-runny: #ff7417;
  --yolk-jammy: #ffb31f;
  --yolk-hard: #ffe680;
  /* The egg in cross-section (src/ui/eggSection.ts): the white from clear to
     set. Both opaque, since the rings are stacked, so the clear one is a
     colour of its own: the page's, a touch lighter and a touch blue, as a
     raw white looks in the pan. */
  --white-raw: #19202b;
  --white-set: #f2efe6;
  /* Its other picture, how hot each layer is, a colour at each of
     HEAT_STOPS_C (src/core/section.ts): blue below the room, a grey at
     40 C where nothing has begun to set, red toward the boil. The poles
     brighten off the dark, darken off the light. */
  --heat-cold: #6da7ec;
  --heat-cool: #256abf;
  --heat-mid: #45454a;
  --heat-warm: #b8403c;
  --heat-hot: #ff6b5e;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f7f8;
    --panel: #ffffff;
    --line: #d8d9dd;
    --fg: #121316;
    --dim: #55575e;
    --accent: #8a4b00;
    --accent-fg: #ffffff;
    --track: #cbccd1;
    --blocked: #e6e7ea;
    --warn: #a33000;
    --ok: #17703a;
    --focus: #0b5fd0;
    /* Deeper than a yolk, since a pale yellow vanishes on a light track. */
    --yolk-runny: #d9530a;
    --yolk-jammy: #e89400;
    --yolk-hard: #e8c410;
    --white-raw: #e6edf6;
    --white-set: #ffffff;
    --heat-cold: #1c5cab;
    --heat-cool: #86b6ef;
    --heat-mid: #ebeae6;
    --heat-warm: #ec8a84;
    --heat-hot: #b3261e;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
}

/* A column: the margins between the egg's parts add up rather than
   overlap. Settings and Help stay a plain block (views). */
main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 6px 16px calc(32px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

button {
  font: inherit;
  display: block;
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  min-height: 64px;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ------------------------------------------------------------ the top bar */

#topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  margin: 0 -8px 6px;
}
.navlink {
  display: inline-flex;
  align-items: center;
  width: auto;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}
.navlink:hover { background: color-mix(in srgb, var(--fg) 7%, transparent); }
.navlink--back::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

/* Mute: a pill, not a bar. It has to be reachable from every phase. The bar
   reaches 8 px into the gutter, where the links' padding goes; the pill's
   edge is drawn, so it keeps the page's 16 px. */
button.mute {
  width: auto;
  min-height: 36px;
  margin-left: auto;
  margin-right: 8px;
  padding: 6px 14px;
  font-size: 0.8125rem;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
}
button.mute[aria-pressed="true"] {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
}

/* ---------------------------------------------------------------- readout */

#readout {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 14px;
  text-align: center;
}

/* The Learning mark: small, in the panel's corner, over the time it is
   about. Its (i) opens in the readout's flow, under the phase label. */
#learning {
  position: absolute;
  top: 6px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  margin: 0;
}
#learning[hidden] { display: none; }
#learning .badge {
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

#phaseLabel {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--dim);
}

/* The time's two lines sit close under the digits: the
   digits have no descenders, so the clock gives back the room under its
   baseline, and the boil line follows with no gap of its own. */
#bigtime {
  font-size: clamp(4rem, 26vw, 7.5rem);
  line-height: 0.95;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 2px 0 -0.03em;
}

#subline {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  min-height: 1.2em;
  font-size: 0.875rem;
  color: var(--dim);
}

/* How sure I am of the time, under it: a line of words the cook presses to
   open, in place, what it means (UI.md section 8); under it "most likely"
   when that is not the word asked; then the white's line. While idle the
   line holds two lines' room, the word and "most likely", the word at its
   top, close under the boil line: so a drag that brings
   "most likely" or takes it away moves neither the word nor the slider under
   the thumb. The second line's room hangs the word's x-height (0.5rem, 8 px)
   into the panel's foot, so the folded word has no more empty room under it
   than it needs; what opens under it and the white's line take that back,
   so they sit where they did. The word is underlined, dotted in the accent
   while closed and solid while open, as a link is: no chevron. */
#readout { --certainty-hang: 0.5rem; }
#certainty {
  margin: 0 auto;
  max-width: 24rem;
  line-height: 1.35;
}
body:not([data-start="sous"]) #certainty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 3.25rem;
  margin-bottom: calc(-1 * var(--certainty-hang));
}
button.disclose {
  display: inline-block;
  width: auto;
  min-height: 32px;
  padding: 2px 8px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: underline dotted var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
button.disclose[aria-expanded="true"] { text-decoration-style: solid; }
#mostLikely { margin: 0; font-size: 0.875rem; color: var(--dim); }
#whiteRisk { margin: 2px 0 0; font-size: 0.875rem; color: var(--warn); }
body:not([data-start="sous"]) #whiteRisk { margin-top: calc(2px + var(--certainty-hang)); }

/* ------------------------------------------------------------------- (i) */

/* One affordance for "tell me more about this", everywhere (UI.md section 4).
   The glyph is drawn here, so the markup holds no words of its own; the hit
   area is a thumb's, the circle is small. */
button.info {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  min-height: 0;
  margin: 0 -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dim);
  vertical-align: middle;
}
button.info::before {
  content: "i";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  font: italic 700 0.8125rem/1 Georgia, "Times New Roman", serif;
}
button.info:hover { color: var(--fg); }
button.info[aria-expanded="true"] { color: var(--fg); }
button.info[aria-expanded="true"]::before { background: var(--fg); color: var(--panel); border-color: var(--fg); }

/* What an (i) opens, in place: no modal, no popover. */
.disclosed {
  margin: 8px 0 4px;
  padding: 10px 12px;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--fg);
  background: color-mix(in srgb, var(--fg) 5%, transparent);
  border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0;
}
#readout .disclosed { margin-left: auto; margin-right: auto; max-width: 28rem; }
body:not([data-start="sous"]) #certaintyMore { margin-top: calc(8px + var(--certainty-hang)); }
#certaintyMore p { margin: 0; }
#certaintyMore p:not([hidden]) ~ p { margin-top: 8px; }
#certaintyMore a.morelink { padding: 2px 0; }

/* --------------------------------------------------------------- the egg */

#controls { margin: 18px 0 0; }

/* The slider's heading: its name at the start, and at the end, a little
   stronger, the peak yolk the level asks for. The doneness word is on the
   ticks, so it is not said here again. */
.slider__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 12px;
  margin-bottom: 2px;
  font-size: 0.9375rem;
  color: var(--dim);
}
#donenessPeak { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }

.slider { position: relative; height: 72px; }

.slider__track {
  position: absolute;
  left: 17px; right: 17px;
  top: 19px;
  height: 10px;
  border-radius: 5px;
  background: var(--track);
  overflow: hidden;
}
/* The unreachable regions: at the soft end the white would still be raw; at
   the hard end (heat off only) the water runs out of heat first. */
.slider__blocked {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: repeating-linear-gradient(
    -45deg, var(--blocked) 0 5px, var(--line) 5px 10px);
}
.slider__blocked--hard { left: auto; right: 0; }
/* The odds at each level, relative to the best level's (src/core/reach.ts).
   The hue is the yolk's at that level, runny to hard, golden at jammy's
   anchor (0.41). The odds are the band's strength: a mask of opacity that
   renderOddsBand lays on, so a level that rarely comes out right is a faded
   yolk, and the odds read in grey as well as in colour. Masked out entirely
   until there is a profile. */
.slider__odds {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    var(--yolk-runny) 0%, var(--yolk-jammy) 41%, var(--yolk-hard) 100%);
  -webkit-mask-image: linear-gradient(transparent, transparent);
  mask-image: linear-gradient(transparent, transparent);
}
/* Levels the water can deliver but that hit the mark less than 3 times in
   10, once an egg has taught something: dotted, so they read apart from the
   striped levels that cannot be delivered at all, without leaning on colour. */
.slider__unlikely {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  background: radial-gradient(circle, var(--fg) 1.1px, transparent 1.6px) 0 0 / 5px 5px;
  opacity: 0.55;
}

.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  left: 0; right: 0; top: 0;
  width: 100%;
  height: 48px;
  margin: 0;
  background: transparent;
}
.slider input[type="range"]::-webkit-slider-runnable-track {
  height: 48px; background: transparent; border: 0;
}
.slider input[type="range"]::-moz-range-track {
  height: 48px; background: transparent; border: 0;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px; height: 34px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  cursor: pointer;
}
.slider input[type="range"]::-moz-range-thumb {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  cursor: pointer;
}

/* The bracket (core's wordBracket): the certainty's 90% interval in words, a
   cup just under the track, in the thumb's column, so it reads with the thumb
   and never over the odds shading. Its ends are ticks, so a narrow range
   still reads as a range, and its line is heavier over the most likely
   word's band. The foreground colour, not the accent or the odds' yolk, so
   it reads as a different thing from both, in either scheme. */
.slider__range { position: absolute; left: 17px; right: 17px; top: 38px; height: 7px; pointer-events: none; }
.slider__bracket {
  position: absolute;
  top: 0;
  height: 7px;
  border: 2px solid var(--fg);
  border-top: 0;
  border-radius: 0 0 3px 3px;
  opacity: 0.7;
  pointer-events: none;
}
/* The most likely word's band: the cup's bottom line, twice as thick, from
   --from to --to, fractions of the cup's outer width (src/ui/slider.ts). The
   cup's border lies outside the box this is placed in, so the calc lays it
   from the outer edge; it shares the cup's opacity, so where the two overlap
   the ink is one. Its bottom corners round as the cup's do, so at the cup's
   ends it fills the corner and never runs past it. */
.slider__likely {
  position: absolute;
  bottom: -2px;
  height: 4px;
  left: calc((100% + 4px) * var(--from, 0) - 2px);
  width: calc((100% + 4px) * (var(--to, 1) - var(--from, 0)));
  border-radius: 2px 2px 3px 3px;
  background: var(--fg);
}
.slider__ticks { position: absolute; left: 17px; right: 17px; top: 50px; height: 20px; }
.slider__ticks span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--dim);
  white-space: nowrap;
}
.slider__ticks span.blocked { text-decoration: line-through; opacity: 0.5; }

.value { margin: 0; font-size: 0.875rem; color: var(--dim); }
.value--note { margin-top: 2px; }

/* The setup sentence: prose whose clauses are buttons. Underlined like a
   link a thumb can find, tinted while its choice is open. The line height
   gives each clause a target taller than the text. */
/* The egg in cross-section on the left and the sentence beside it, so the
   egg costs the column no height of its own; the open
   clause's choice under both. In sous-vide there is no egg to draw, and
   the sentence has the row. */
#setup {
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 14px;
  /* From the top, so a sentence that gains a line (the start's time, at the
     start) moves nothing above it or beside it. */
  align-items: start;
}
#setup > .egg-toggle { grid-column: 1; grid-row: 1; }
#setup > #sentence { grid-column: 2; grid-row: 1; }
#setup > .panel { grid-column: 1 / -1; }
body[data-start="sous"] #setup > #sentence { grid-column: 1 / -1; }
#sentence {
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.9;
}
.clause {
  display: inline;
  cursor: pointer;
  width: auto;
  min-height: 0;
  margin: 0 -3px;
  padding: 3px 3px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-weight: 650;
  line-height: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* A clause and the punctuation after it break as one (sentence.ts). */
.clause-wrap { white-space: nowrap; }
.clause-wrap > .clause { white-space: normal; }
.clause:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.clause[aria-expanded="true"] {
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration-color: transparent;
}

/* The egg in cross-section (src/ui/eggSection.ts), how set each layer is,
   or how hot: a button, pressed to show the other, drawn as the egg alone. */
.egg-toggle {
  display: block;
  width: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  touch-action: manipulation;
}
.egg-section {
  display: block;
  height: 8.5rem;
  width: 6.5rem;
}
.egg-section__shell { fill: none; stroke: var(--line); stroke-width: 1.5; }

/* A clause's choice, opened in place under the sentence. */
.panel {
  margin: 10px 0 0;
  padding: 10px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  margin-bottom: 8px;
}
.panel__title {
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
}
button.panel__close {
  width: auto;
  min-height: 36px;
  margin-left: auto;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 600;
}
.panel .hint, .setting .hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--dim);
}
.prow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 0;
  color: var(--dim);
  font-size: 0.9375rem;
}

/* Three ways of saying the same size. They stay in step, so they read as one
   control rather than three competing ones. */
.measure__legend { margin: 14px 0 8px; color: var(--dim); font-size: 0.9375rem; }
.measure { display: flex; flex-direction: column; gap: 8px; }
.measure > div {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--dim); font-size: 0.9375rem;
}

select, input[type="number"] {
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 10px;
  min-height: 46px;
}
input[type="number"] { width: 5.5rem; text-align: right; }
select { max-width: 60vw; }

.unit { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); }

/* The − and + either side of a number (src/ui/stepper.ts): as tall as the
   field, so the row is no taller; the glyphs are drawn here, so the markup
   holds no words. A press is a hold, never a selection or a menu. */
button.step {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  font: 400 1.375rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button.step--less::before { content: "\2212"; }
button.step--more::before { content: "+"; }
button.step:active { background: var(--line); }
/* Drawn 34 px wide, a − or + takes a tap 44 px wide: 3 px more on the
   field's side, short of the 4 px gap to it, so a tap at the field's edge
   stays the field's however its edges round to pixels, and 7 px more on the
   other, across the gap to the label, or the 6 px to a unit and a pixel of
   it, which is words and takes no tap of its own. */
button.step::after {
  content: "";
  position: absolute;
  inset: -1px;
}
button.step--less::after { left: -8px; right: -4px; }
button.step--more::after { left: -4px; right: -8px; }
.unit:has(button.step) { gap: 4px; }
.unit:has(button.step) input[type="number"] { width: 4rem; padding-inline: 8px; }
/* When the eggs went in, mid-cook: a time of day between its − and +, read
   like a number field but not typed in. The clock's face in 1750 too. */
output.startedat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  min-height: 46px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
html[lang$="-x-1750"] output.startedat {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: normal;
}
#startedAtField + .hint { margin-top: 6px; }
/* The unit after the +, in a column of its own, so the rows' − and + line up. */
.unit:has(button.step) > span:last-child { min-width: 1.75em; margin-left: 2px; }
/* A count has no unit; it keeps the unit's room, so its − and + line up too. */
.unit:has(> button.step:last-child) { padding-right: calc(1.75em + 6px); }
/* The browser's own spinner would be a third pair of arrows; the keyboard's
   still step the field. */
input[data-stepper] { appearance: textfield; -moz-appearance: textfield; }
input[data-stepper]::-webkit-inner-spin-button,
input[data-stepper]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* segmented radio group: big targets, no decoration */
.seg { display: flex; gap: 6px; position: relative; }
.seg input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
}
.seg label {
  flex: 1;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9375rem;
  cursor: pointer;
}
/* In Settings a group spans the page, so its choices can spare the room:
   their words wrap to a second line before they come nearer the edge than
   10 px ("Wind-up timer" on a phone). A clause's panel is narrower, and
   keeps them on as few lines as it can. */
.setting .seg label { padding-inline: 10px; }
.seg input[type="radio"]:checked + label {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}
.seg input[type="radio"]:focus-visible + label {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
/* A segmented group too long for one row: the same choices, one to a line,
   read from the left like a list. */
.seg--list { flex-direction: column; }
.seg--list label { justify-content: flex-start; padding: 6px 14px; }
/* A second choice in a clause's panel, under its own label and (i): the
   heat after the boil, under the start. */
.seg--under { margin-top: 8px; }

/* A number's label and its (i), on the left of a row in a clause's panel.
   Where the row is too narrow for both (large text, a narrow phone), the
   number and its − and + go to a line of their own, at the right, as iOS's
   do, rather than crush the label. */
.prow:has(> .prow__head) { flex-wrap: wrap; row-gap: 6px; }
.prow__head { display: flex; align-items: center; gap: 2px; flex: 1 1 9rem; min-width: 0; }
/* The (i) ends where the head does, so the row's 12 px gap is whole between
   it and a −, whose tap reaches 7 px into it. */
.prow__head > button.info { margin-right: 0; }
.prow:has(> .prow__head) > .unit { margin-left: auto; }

/* ------------------------------------------------------------------ slot */

/* One longer line, in every phase. */
#slot { margin: 16px 0 0; }
#slot p { margin: 0; font-size: 0.9375rem; line-height: 1.45; }
#warn {
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--warn) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  color: var(--fg);
}
/* Between two lines that show: a hidden one's neighbour starts flush. */
#slot p:not([hidden]) ~ p { margin-top: 6px; }
#welcome { color: var(--dim); }

/* A way to Help: a link with an arrow, not a disclosure. */
a.morelink {
  display: inline-block;
  padding: 10px 0;
  color: var(--fg);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}
a.morelink::after { content: "\2192"; display: inline-block; margin-left: 6px; }

/* -------------------------------------------------------- Settings, Help */

.page h1 {
  margin: 4px 0 10px;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.page h1:focus { outline: none; }

.setting {
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
/* A heading on the left and a number on the right. Where the row is too
   narrow for both ("Room temperature" at 320 px), the number and its − and +
   go to a line of their own, at the right, as a clause's panel does. */
.setting__line { display: flex; flex-wrap: wrap; row-gap: 6px; align-items: center; justify-content: space-between; column-gap: 12px; }
.setting__line > .unit { margin-left: auto; }
.setting__head {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 36px;
  font-size: 1rem;
  font-weight: 600;
}
fieldset.setting .setting__head { margin-bottom: 8px; }
.setting__sub { margin: 6px 0 0; font-size: 0.875rem; color: var(--dim); }
.setting__sub strong { color: var(--fg); font-weight: 600; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }

#learned .hint { margin: 2px 0 10px; font-size: 0.875rem; }
#learned .hint:focus { outline: none; }
.forget__row { display: flex; align-items: center; gap: 6px; }
.forget__row button.secondary, .confirm__row button {
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 8px 16px;
  font-size: 0.9375rem;
}
#forgetConfirm, #shareConfirm {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}
#forgetTitle, #shareConfirmTitle { margin: 0 0 4px; font-weight: 650; }
#forgetConfirm .hint, #shareConfirm .hint { margin: 0 0 12px; }
/* Sharing, under what has been learned: the consent in the hint's size,
   always shown; the note under the switch only when it has something to say. */
#learned { border-bottom: 1px solid var(--line); }
#share { border-bottom: 0; }
#share .hint { margin: 2px 0 6px; font-size: 0.875rem; }
#share .hint:empty { display: none; }
#share .hint:focus { outline: none; }
#share .privacylink { margin: 10px 0 0; font-size: 0.875rem; }
/* The random number under its label, on a line of its own: fixed-width, so
   no face draws its 0 as an o, and selected whole by one tap, to copy. */
.share__uid {
  display: block;
  margin-top: 2px;
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}
.confirm__row { display: flex; gap: 8px; }
button.danger { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 55%, transparent); font-weight: 600; }

#colophon {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--dim);
}
#colophon p { margin: 0; }
#colophon strong { color: var(--fg); font-weight: 600; }
#colophon a { color: inherit; text-underline-offset: 2px; }
#colophon a:hover, #colophon a:focus-visible { color: var(--fg); }
#colophon .colophon__version { margin-top: 6px; }
.colophon__number {
  color: var(--fg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Help: a page to read. */
#help { line-height: 1.5; }
#help h2 {
  margin: 28px 0 8px;
  font-size: 1.25rem;
  line-height: 1.25;
  scroll-margin-top: 12px;
}
#help h3 { margin: 18px 0 4px; font-size: 1rem; }
#help p { margin: 0 0 10px; }
/* The technical aside under a gist: smaller and quieter, with its links. */
#help p.aside { font-size: 0.9rem; color: var(--dim); margin-top: -4px; }
#help p[data-copy-links] a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
#help section { scroll-margin-top: 12px; }
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}
.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.875rem;
  text-decoration: none;
}
.foryou {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 8px 8px 0;
}
#help .foryou h3 { margin-top: 0; }
.foryou ul { margin: 0; padding-left: 1.2em; }
.foryou li + li { margin-top: 6px; }
.sources { padding-left: 1.2em; font-size: 0.875rem; }
.sources li + li { margin-top: 8px; }
.sources a { color: var(--fg); text-underline-offset: 2px; overflow-wrap: anywhere; }
/* The last line of Help: the way to the privacy page. */
#help .privacylink { margin: 22px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
/* The motto under Help's title, and the credit under the privacy link. */
#help p.motto { margin: -4px 0 14px; color: var(--dim); font-style: italic; }
#help p.credit { margin: 6px 0 0; font-size: 0.875rem; color: var(--dim); }
#help .credit a { color: inherit; text-underline-offset: 2px; }

/* ---------------------------------------------------------------- views */

/* Settings and Help are pages of their own; the egg's parts, and the
   buttons under the time, step aside while one is open. In every phase:
   while a cook runs, Settings' pot rows
   correct it as the sentence does, and what does not belong to the cook -
   what I have learned, and sharing - waits for it to end. */
.page { display: none; }
body[data-view="settings"] #settings,
body[data-view="help"] #help { display: block; }
body:not([data-view="egg"]) :is(#readout, #actions, #controls, #slot, #feedback) { display: none; }
body:not([data-view="egg"]) main { display: block; }
body:not([data-phase="IDLE"]) :is(#learned, #share) { display: none; }

/* The app open in another tab (owner.ts): this tab shows only the note and
   its button. */
body[data-tab="waiting"] > main { display: none; }
#tabNote { max-width: 32rem; margin: 0 auto; padding: 32px 16px; }
#tabNote button { width: 100%; margin-top: 8px; }

#navBack { display: none; }
body:not([data-view="egg"]) #navBack { display: inline-flex; }
body:not([data-view="egg"]) #settingsLink,
body[data-view="help"] #helpLink { display: none; }

/* -------------------------------------------------------- the privacy page */

/* privacy/index.html: a page of its own, outside the app, with no script.
   It reads as Help does - the same column, faces and colours - and its one
   way out is the top bar's back link, to the app. */
main.doc {
  display: block;
  min-height: 0;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  line-height: 1.5;
}
.doc__bar {
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 0 -8px 6px;
}
.doc h1 {
  margin: 4px 0 4px;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.doc__updated { margin: 0 0 18px; font-size: 0.875rem; color: var(--dim); }
.doc h2 { margin: 28px 0 8px; font-size: 1.25rem; line-height: 1.25; }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 10px; padding-left: 1.2em; }
.doc li + li { margin-top: 6px; }
.doc p a, .doc li a {
  color: var(--fg);
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.doc__changes { font-size: 0.875rem; color: var(--dim); }

/* ----------------------------------------------------------------------- 1750 */

/* The English of 1750 is set in its own face (LANGUAGE.md section 6, "The
   face"), served from here and fetched only by a 1750 page. Its egg's page
   is headed by a title page after the Dictionary's. The clock and a number
   the cook types keep the system face: this one's figures are old-style,
   and its 0 is an o. */
@font-face {
  font-family: "IM FELL English";
  src: url("assets/fonts/IMFeENrm28P.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IM FELL English";
  src: url("assets/fonts/IMFeENit28P.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
.titlepage { display: none; }
html[lang$="-x-1750"] body[data-view="egg"] .titlepage { display: block; }
/* Longhands, not the `font` shorthand, which would reset the features the
   title inherits. */
.titlepage {
  margin: 0 8px 14px;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
  color: var(--dim);
}
/* Every ligature (liga, dlig) and the long s before a letter (hist), drawn
   by the face, so the text read aloud or searched keeps a plain s. One
   weight, and nothing made bold for it: Help's smallest heads are italic. */
html[lang$="-x-1750"] body {
  font-family: "IM FELL English", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-feature-settings: "liga", "dlig", "hist";
  font-synthesis-weight: none;
}
html[lang$="-x-1750"] #help h3 { font-style: italic; }
html[lang$="-x-1750"] #bigtime,
html[lang$="-x-1750"] input[type="number"] {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: normal;
}

/* ---------------------------------------------------------------- actions */

/* Directly under the time, in every phase: the hint, and one row of
   buttons. The row is Cancel on the left, at its own width, and the main
   button filling the rest, on the right where the thumb rests, with room
   between them for a wet thumb; with only the main button, it fills the
   row; with only Cancel, the rest is empty. The row is as tall as the main
   button in every phase, so nothing under it moves and nothing is left
   empty under it.

   Where the widest main button and Cancel do not fit side by side (a narrow
   screen, a larger text size, 1750's words), the row wraps: the main button
   over Cancel. The choice is the widest main button's, never the phase's
   own: the main button's cell holds the words of every main button the
   chosen setup's cook can show (the start's, Rolling boil, the chosen
   cooling's pull, Start again: view.ts, `sizerWords`), laid out at no
   height (.buttons__widths), so it wraps in every phase or in none. A
   change of cooling may change it, as iOS's does. And the probe, the same row with Cancel
   in every phase, never seen, sits in the same grid cell, so the block
   keeps the stack's height in every phase too: Start heating alone, idle,
   with Cancel's room under it. Only "still in the water?", with its two
   answers and Cancel, and the hint's (i) opened go past it. */
#actions { margin: 14px 0 0; }
.buttons { display: grid; }
.buttons > * { grid-area: 1 / 1; }
/* Reversed, so the main button, first for a screen reader and the keyboard,
   is drawn on the right; packed to the left, where Cancel alone sits. */
.buttons__row {
  display: flex;
  flex-flow: row-reverse wrap;
  justify-content: flex-end;
  align-items: center;
  align-content: flex-start;
  gap: 10px 24px;
}
.buttons__probe { visibility: hidden; }
/* As tall as the main button, with it or without. */
.buttons__main {
  flex: 1 1 auto;
  max-width: 100%;
  min-height: max(64px, 1.35 * 1.375rem + 28px);
}
.buttons__row > button.secondary {
  flex: none;
  width: auto;
  margin: 0;
  padding: 10px 20px;
}
/* The words a button may hold, set as that button sets them. */
.sizer { display: block; white-space: nowrap; }
.sizer--main { font-size: 1.375rem; font-weight: 650; padding: 14px; min-height: 64px; }
.sizer--cancel { font-size: 1rem; padding: 10px 20px; border: 1px solid transparent; min-height: 48px; }
.buttons__probe .buttons__main { display: grid; }
.buttons__probe .buttons__main > .sizer { grid-area: 1 / 1; }
.buttons__widths { display: block; height: 0; overflow: hidden; visibility: hidden; }

/* The hint holds two lines, or the (i)'s height, whichever is more, and
   sits at the foot of that room, next to the button it is about. */
#primaryHint {
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: flex-end;
  flex-wrap: wrap;
  margin: 0 auto 6px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--dim);
  min-height: max(32px, 2.7em);
}
#actions .disclosed { margin-bottom: 10px; }

button.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border: 0;
  font-size: 1.375rem;
  font-weight: 650;
  padding: 14px;
}
button.secondary {
  margin-top: 8px;
  min-height: 48px;
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--line);
  font-size: 1rem;
  padding: 10px;
}

/* ----------------------------------------------------------- running view */

/* One layout from setup to Done: at the
   start nothing moves and nothing goes; only the readout's words, its
   colours and the button change. The phase label is the instruction, so it
   reads in the foreground colour while a cook runs. */
body:not([data-phase="IDLE"]) #phaseLabel { color: var(--fg); font-weight: 600; }
/* Sous-vide starts no cook, so a running one cannot be corrected to it. */
body:not([data-phase="IDLE"]) :is(#startSous, #startSousLabel) { display: none; }

/* A control is shown when the answer depends on it.
 *
 * `sousVideEstimate` takes a radius, an alpha, a bath temperature and the two
 * dose targets - so in sous-vide the only live inputs are the egg's size and
 * the doneness slider. The boil, the cooling, the water, the eggs in the pan
 * and the altitude are all pan arithmetic, and leaving them on screen implies
 * they do something. One class, one rule: a new pan control inherits this by
 * wearing `pan-only`, and a new input to `sousVideEstimate` is the signal to
 * take the class off something. */
body[data-start="sous"] .pan-only { display: none; }

/* "Yesterday" is not a clock face, and will not fit like one. */
body[data-start="sous"][data-phase="IDLE"] #bigtime {
  font-size: clamp(2rem, 11vw, 3.4rem);
  letter-spacing: -0.01em;
}

body[data-phase="PULL"] #readout {
  border-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, var(--panel));
}
body[data-phase="PULL"] #bigtime { color: var(--warn); }
body[data-phase="DONE"] #readout { border-color: var(--ok); }
body[data-phase="DONE"] #bigtime { color: var(--ok); }

body[data-phase="PULL"] #readout { animation: flash 1s steps(2, end) infinite; }
@keyframes flash { 50% { opacity: 0.75; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---- calibration feedback, shown only when the egg is finished ---- */
#feedback { margin-top: 16px; }
#feedbackAsk, #whiteAsk {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--fg);
  font-weight: 600;
}
#whiteAsk, #probeAsk { margin-top: 14px; }
.pair { display: flex; gap: 8px; }
/* Five yolk words side by side: each word is five letters at most (the
   slider's tick budget), so they share a phone's width at a size a thumb
   can hit, the gap and the padding giving way first. A column is never
   narrower than its word, so with the text made larger the row breaks in
   two rather than cutting a word. */
.pair--five {
  display: grid; gap: 4px;
  grid-template-columns: repeat(auto-fit, minmax(3.6em, 1fr));
  font-size: 0.9375rem;
}
.pair--five > button.fb { min-width: 0; padding-left: 2px; padding-right: 2px; font-size: inherit; }
button.fb, button.wb {
  min-height: 52px;
  font-size: 1rem;
  border-radius: 12px;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--line);
}
/* The answer given stays legible: it is the record of what was said. */
button.fb[aria-pressed="true"], button.wb[aria-pressed="true"] {
  opacity: 1;
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 600;
}
#feedbackTarget { margin: 0 0 10px; text-align: center; font-size: 0.875rem; color: var(--dim); }
#feedbackOptional, #calibNote {
  text-align: center; margin: 8px 0 0; min-height: 1.1em; font-size: 0.8125rem; color: var(--dim);
}

/* ---- the thermometer, under the two questions ---- */
#probeEntry { text-align: center; }
#probeAsk { margin-bottom: 4px; font-size: 0.9375rem; color: var(--fg); font-weight: 600; }
#probeHow, #probeNote { margin: 0 0 8px; font-size: 0.875rem; color: var(--dim); min-height: 1.1em; }
.probe__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.probe__row > button { width: auto; margin-top: 0; padding: 10px 16px; }

/* ---- wider screens: the same column, with room to breathe ---- */
@media (min-width: 720px) {
  main { padding-top: 20px; }
  #readout { padding: 22px 24px 20px; }
  #sentence { font-size: 1.3125rem; }
}
