/* Page of the phone. Layout of the P/T bench (task 012, taches/maquettes/012/), of the coffee machine (016) and of the screens of 031, in
   the style of the headset's screens (task 050; taches/maquettes/048/ and 049/, validated by Adrian on 1 November): striped band, dark
   panels, yellow tabs, orange main button. Fonts of the game (plan §5, A17): Baloo 2 for titles, Nunito Sans for texts, and the logo, all
   copied from Art/ by ProjectSetup.SyncMobilePage. Every size and colour is here: the JavaScript names classes, never a value.
   Every length is a multiple of --u (task 084): 1px on a phone (500 px of width or less), 1.3px on a tablet in portrait (500 to 900 px), 1.15px on a tablet in landscape (over 900 px). */

@font-face { font-family: "Baloo 2"; src: url("Baloo2-Bold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("NunitoSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }

/* State colours keep their meaning: green is good, yellow is an alert (attention panel), red is critical; none of the three is the
   gold of the labels and tabs, which carries no state. Texts are at 4.5:1 or more on their panel. */
:root {
  --bg: #20262a; --card: #2c3235; --card-2: #1c2225; --line: #4c5252; --text: #fff4db; --muted: #c9cdc2; --accent: #ffd060; --gold: #ffc53a;
  --on-gold: #282828; --active: #f6bd35; --active-edge: #9d6417; --idle: #343e42; --idle-edge: #11191c;
  --ok: #6fdca0; --bar-ok: #2a9d66; --warn: #ffc53a; --alert: #ff7a66; --alert-bg: #3b1d1a; --alert-text: #ffd2c8;
  --refused-bg: #33291a; --done-bg: #173a2b; --disabled: #a7aea6; --grey: #7b8583; --strong: #b5772c; --water: #4a8fb0;
  --stripes: repeating-linear-gradient(125deg, #ffc53a 0 calc(18 * var(--u)), #282b2c calc(18 * var(--u)) calc(36 * var(--u)));
  --bar-bg: linear-gradient(110deg, #353b3e, #252b2e);
  --primary-bg: linear-gradient(#f4873f, #ec5f2c); --secondary-bg: linear-gradient(#424c4f, #343e42);
  /* Row of the six expressions (task 082; maquette 082, version 8): the band behind the buttons, the buttons, and the grey-green of the headset's screen behind each face. */
  --expr-band: #1b2226; --expr-a: #3b464b; --expr-b: #2f393d; --expr-edge: #11191c; --expr-line: #4c585d; --expr-on-a: #ffd05a; --expr-on-b: #f9bf37; --expr-on-line: #ffe39a;
  --partner-screen: #1d272c; --partner-screen-line: #3b484e;
  /* Hierarchy of the texts (task 083, decision of Adrian of 7 November 2026): the recipe is larger than the hints (legends and short explanations), as multiples of the base size. */
  --size-recipe: 1.3; --size-hint: 0.88;
  --title: "Baloo 2", system-ui, sans-serif; --body: "Nunito Sans", system-ui, -apple-system, sans-serif;
}

/* The width of the screen picks the layout (task 084; decision of Adrian of 7 November 2026), never the orientation: the page follows a rotation or a split screen by itself, without being drawn again.
   - 500 px or less (phones): the column of 480 px at most, as before;
   - over 500 px up to 900 px (a tablet in portrait): the same column, centred, 620 px at most, everything 1.3 times larger;
   - over 900 px (a tablet in landscape, or a large one in portrait): everything 1.15 times larger, the header across the width, two columns (see the end of this file).
   The thresholds are 500.02 and 900.02 px (not 500 and 900) so that a width of exactly 500 or 900 px keeps the layout of the smaller screen. */
:root { --u: 1px; --col: 480px; }
@media (min-width: 500.02px) { :root { --u: 1.3px; --col: 620px; } }
@media (min-width: 900.02px) { :root { --u: 1.15px; --col: 620px; } }

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
/* The band of 7 px at the top of every screen (under the notch when there is one). */
body { margin: 0; font-family: var(--body); font-size: calc(17 * var(--u)); line-height: 1.45; padding-top: calc(calc(7 * var(--u)) + env(safe-area-inset-top));
  background: var(--stripes) 0 0 / 100% calc(calc(7 * var(--u)) + env(safe-area-inset-top)) no-repeat, var(--bg); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }

#app { max-width: var(--col); min-height: calc(100vh - calc(7 * var(--u)) - env(safe-area-inset-top)); min-height: calc(100dvh - calc(7 * var(--u)) - env(safe-area-inset-top)); margin: 0 auto; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }
/* What is under the band of the header: the screen proper (task 050). */
.body { flex: 1; display: flex; flex-direction: column; gap: calc(18 * var(--u)); padding: calc(26 * var(--u)) calc(20 * var(--u)) calc(calc(24 * var(--u)) + env(safe-area-inset-bottom)); }
.screen.game > .body, .screen.manual > .body { gap: calc(12 * var(--u)); padding: calc(12 * var(--u)) calc(14 * var(--u)) calc(calc(20 * var(--u)) + env(safe-area-inset-bottom)); }
.screen.summary > .body { gap: calc(14 * var(--u)); }
.grow { flex-grow: 1; }

/* Header band: role in gold capitals above the title, buttons at the right (maquette 048). */
.bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: calc(10 * var(--u)); padding: calc(10 * var(--u)) calc(16 * var(--u)); background: var(--bar-bg); border-bottom: calc(2 * var(--u)) solid #171c1f; }
.bar-text { flex: 1; min-width: 0; }
.bar-text > * { min-width: 0; }
.bar-text > .role { display: block; font-family: var(--body); font-weight: 700; font-size: calc(13 * var(--u)); line-height: 1.3; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.bar-text > :not(.role), .bar-text > .role:only-child { font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); line-height: 1.15; letter-spacing: 0; text-transform: none; color: var(--text); text-align: left; }
.bar-text > h1 { font-size: calc(28 * var(--u)); line-height: 1.1; }
.bar-text > .row { gap: calc(4 * var(--u)) calc(8 * var(--u)); flex-wrap: wrap; }
.bar-text > .row .strong { font-size: calc(22 * var(--u)); font-weight: 800; }
/* « Cafés 0/3 » at the left and the time left at the right, on one line, the digits aligned (task 083, maquette 083 and 084). */
.progress-line { display: flex; justify-content: space-between; align-items: baseline; gap: calc(8 * var(--u)); }
.progress-line .progress-time { font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.progress-line .progress-count { min-width: 0; }
.bar-actions { flex: none; display: flex; gap: calc(8 * var(--u)); }
/* Screens without a game in progress: the logo of the game, centred, 290 px wide, 4 px above and below (maquette 049). The picture is
   cropped to its drawing (a quarter of its width is transparent), so that the drawing itself is 290 px wide. */
.bar.with-logo { position: relative; justify-content: center; padding: calc(4 * var(--u)) calc(8 * var(--u)); }
.logo { width: min(calc(290 * var(--u)), calc(100% - calc(84 * var(--u)))); aspect-ratio: 290 / 175; background: url("logo.png") center / 125% auto no-repeat; }
.bar.with-logo .bar-actions { position: absolute; top: calc(8 * var(--u)); right: calc(8 * var(--u)); }
@media (max-width: 360px) {
  .bar { padding-left: calc(12 * var(--u)); padding-right: calc(12 * var(--u)); }
  .bar-text > :not(.role), .bar-text > .role:only-child, .bar-text > .row .strong { font-size: calc(19 * var(--u)); }
  .bar-text > h1 { font-size: calc(24 * var(--u)); }
  .body { padding-left: calc(14 * var(--u)); padding-right: calc(14 * var(--u)); }
  .tiles > .card { padding-left: calc(8 * var(--u)); padding-right: calc(8 * var(--u)); }
}

h1 { margin: 0; font-family: var(--title); font-weight: 800; font-size: calc(34 * var(--u)); line-height: 1.05; }
h2 { margin: 0; font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); }
p { margin: 0; }
.muted { color: var(--muted); }
/* Hints: legends and short explanations, smaller and quieter than the text around them (task 083). The recipe is larger and in the full colour of the text. */
.hint { color: var(--muted); font-size: calc(1em * var(--size-hint)); line-height: 1.4; }
.recipe-text { color: var(--text); font-size: calc(1em * var(--size-recipe)); line-height: 1.35; }
.recipe-text .icon.symbol.inline { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }
.small { font-size: calc(15 * var(--u)); }
.center { text-align: center; }
.strong { font-weight: 700; }
.role { font-family: var(--title); font-weight: 800; font-size: calc(20 * var(--u)); color: var(--accent); }
.label { font-size: calc(14 * var(--u)); color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.row { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.row.wide { gap: calc(20 * var(--u)); flex-wrap: wrap; }
.col { display: flex; flex-direction: column; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.stack.tight { gap: calc(6 * var(--u)); }

.icon { width: calc(22 * var(--u)); height: calc(22 * var(--u)); flex: none; fill: currentColor; }
.icon.small { width: calc(18 * var(--u)); height: calc(18 * var(--u)); }
.icon.big { width: calc(34 * var(--u)); height: calc(34 * var(--u)); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.accent { color: var(--accent); }
.icon.critical { color: var(--alert); }

.card { background: var(--card); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(12 * var(--u)); padding: calc(14 * var(--u)) calc(16 * var(--u)); display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.card.row { flex-direction: row; align-items: center; gap: calc(10 * var(--u)); padding: calc(14 * var(--u)) calc(16 * var(--u)); }
.card-title { font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); line-height: 1.15; }
.card-title.large { font-size: calc(26 * var(--u)); line-height: 1.1; }
.status-line { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(16 * var(--u)); color: var(--muted); }
.status-line .icon { width: calc(12 * var(--u)); height: calc(12 * var(--u)); }
.stack.tight .icon { width: calc(20 * var(--u)); height: calc(20 * var(--u)); }

/* Buttons: a thick lower edge makes them look pressable, as in the headset (maquette 048). Main: orange; secondary: grey; a choice or
   a tab is grey, and gold when it is the current one. At least 44 px high. */
button { font: inherit; color: var(--text); cursor: pointer; border: 0; border-radius: calc(11 * var(--u)); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; }
.primary { background: var(--primary-bg); color: var(--on-gold); border: calc(1 * var(--u)) solid #f7a35b; border-bottom: calc(4 * var(--u)) solid #a33d17; font-family: var(--title); font-weight: 800; font-size: calc(21 * var(--u)); min-height: calc(56 * var(--u)); padding: 0 calc(16 * var(--u)); }
.primary.big { min-height: calc(64 * var(--u)); font-size: calc(24 * var(--u)); }
.primary.huge { min-height: calc(72 * var(--u)); font-size: calc(26 * var(--u)); }
.primary:disabled { background: var(--card); color: var(--disabled); border-color: var(--line); border-bottom-color: var(--idle-edge); }
.dark, .secondary, .globe, .icon-button, .dose-button, .small-button { background: var(--secondary-bg); border: calc(1 * var(--u)) solid #727b79; border-bottom: calc(4 * var(--u)) solid #13191b; }
.dark { font-family: var(--title); font-weight: 800; font-size: calc(21 * var(--u)); min-height: calc(56 * var(--u)); display: flex; align-items: center; justify-content: center; }
/* « Remplir »: the drop at the left of the label, on the same line (task 083); the buttons of the manual: an open book, 1.45 times the height of the text, centred on the line with it (task 099). */
.with-icon { display: flex; align-items: center; justify-content: center; gap: 0.45em; }
.with-icon .icon.drop { width: 1.15em; height: 1.15em; }
.with-icon .icon.book { width: 1.45em; height: 1.45em; }
.secondary { font-family: var(--title); font-weight: 800; font-size: calc(20 * var(--u)); min-height: calc(52 * var(--u)); }
/* Globe of the language, on every screen (task 031; maquette 031, planche 1): 44 px, at the right of the header band. */
.globe, .icon-button { width: calc(44 * var(--u)); height: calc(44 * var(--u)); flex: none; padding: 0; display: flex; align-items: center; justify-content: center; }
.globe { color: var(--text); }

.overlay { position: fixed; inset: 0; z-index: 10; background: rgba(16, 20, 22, 0.82); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: var(--col); background: var(--card); border-top: calc(1 * var(--u)) solid var(--line); border-radius: calc(12 * var(--u)) calc(12 * var(--u)) 0 0; padding: calc(20 * var(--u)) calc(22 * var(--u)) calc(calc(24 * var(--u)) + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: calc(14 * var(--u)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.picker-list { display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.picker-option { min-height: calc(56 * var(--u)); background: var(--idle); border-bottom: calc(5 * var(--u)) solid var(--idle-edge); display: flex; align-items: center; justify-content: space-between; padding: 0 calc(16 * var(--u));
  font-weight: 700; font-size: calc(18 * var(--u)); text-align: left; border-radius: calc(12 * var(--u)); }
.picker-option[aria-pressed="true"] { background: var(--active); border-bottom-color: var(--active-edge); color: var(--on-gold); }

.seat { flex-direction: row; justify-content: space-between; align-items: center; padding: calc(14 * var(--u)) calc(16 * var(--u)); }
.seat.mine { background: var(--card-2); border: calc(2 * var(--u)) solid var(--gold); }
.seat-text { display: flex; flex-direction: column; gap: calc(2 * var(--u)); }
.seat-name { font-weight: 700; font-size: calc(18 * var(--u)); }
.seat-status { display: flex; align-items: center; gap: calc(6 * var(--u)); font-weight: 700; font-size: calc(16 * var(--u)); text-align: right; }
.countdown-box { flex-direction: row; align-items: center; justify-content: center; gap: calc(10 * var(--u)); padding: calc(12 * var(--u)); font-size: calc(16 * var(--u)); color: var(--muted); }
.countdown { font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); color: var(--text); }

.dots { display: flex; gap: calc(6 * var(--u)); }
.icon.dot { width: calc(14 * var(--u)); height: calc(14 * var(--u)); }
.dot.done { color: var(--ok); }
.dot.current { fill: none; stroke: var(--text); stroke-width: 2; }
.dot.next { fill: none; stroke: var(--grey); stroke-width: 2; }

.tiles { display: grid; gap: calc(8 * var(--u)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--card); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(12 * var(--u)); padding: calc(6 * var(--u)) calc(10 * var(--u)); display: flex; flex-direction: column; min-width: 0; }
.tile.row { flex-direction: row; align-items: center; gap: calc(10 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); }
.tile.alert { background: var(--alert-bg); border-color: var(--alert); box-shadow: inset 0 0 0 calc(1 * var(--u)) var(--alert); }
.tile.alert .tile-label { color: var(--alert-text); }
.tile.alert .icon { color: var(--alert); }
.tile-label { font-size: calc(13 * var(--u)); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.tile-value { font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); }
.tiles.two .tile > .tile-value { font-size: calc(28 * var(--u)); }
.tile-text { font-weight: 700; font-size: calc(17 * var(--u)); line-height: 1.2; }
.icon.symbol { width: calc(34 * var(--u)); height: calc(34 * var(--u)); color: var(--accent); }

.gauge { display: flex; flex-direction: column; gap: calc(6 * var(--u)); }
/* The head of a gauge, on one line with three zones (task 083, decision of Adrian of 7 November 2026): the name at the left, with its first letter in bold; « cible 40–70 » centred; the trend and the value at the right. */
.gauge-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: baseline; gap: calc(6 * var(--u)); }
.gauge-name { font-family: var(--body); font-size: calc(19 * var(--u)); line-height: 1.1; font-weight: 400; min-width: 0; overflow-wrap: normal; color: var(--text); }
.gauge-name strong { font-family: var(--title); font-weight: 800; color: var(--text); }
.gauge-target { text-align: center; color: var(--muted); font-size: calc(1em * var(--size-hint) * 1.12); white-space: nowrap; }
.gauge-head .gauge-reading { justify-self: end; }
@media (max-width: 372px) {
  /* The head keeps its three zones on one line at 320 px: the value and the words are a little smaller. */
  .gauge-head { gap: calc(4 * var(--u)); }
  .gauge-head .gauge-value { font-size: calc(34 * var(--u)); }
  .gauge-head .trend { font-size: calc(14 * var(--u)); }
  .gauge-name { font-size: calc(18 * var(--u)); }
  .gauge-target { font-size: calc(14.5 * var(--u)); }
}
.gauge-reading { display: flex; align-items: center; gap: calc(8 * var(--u)); }
.trend { display: flex; align-items: center; gap: calc(4 * var(--u)); font-size: calc(15 * var(--u)); font-weight: 700; color: var(--muted); }
.trend.rising { color: var(--warn); }
.trend.critical { color: var(--alert); font-weight: 800; text-transform: uppercase; }
.gauge-value { font-family: var(--title); font-weight: 800; font-size: calc(44 * var(--u)); line-height: 1; }
.gauge.critical .gauge-value { color: var(--alert); }
.gauge-bar { position: relative; height: calc(26 * var(--u)); background: var(--card-2); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(6 * var(--u)); }
.gauge.critical .gauge-bar { outline: calc(2 * var(--u)) solid var(--alert); }
.gauge-zone { position: absolute; top: calc(-1 * var(--u)); height: calc(26 * var(--u)); background: var(--bar-ok); }
.gauge-marker { position: absolute; top: calc(-6 * var(--u)); width: calc(4 * var(--u)); height: calc(36 * var(--u)); margin-left: calc(-2 * var(--u)); background: var(--text); border-radius: calc(2 * var(--u)); }
.gauge.critical .gauge-marker { width: calc(6 * var(--u)); margin-left: calc(-3 * var(--u)); background: var(--alert); }
.gauge-scale { display: flex; justify-content: space-between; font-size: calc(13 * var(--u)); }

.heat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: calc(8 * var(--u)); }
.heat { min-height: calc(64 * var(--u)); background: var(--idle); border: calc(3 * var(--u)) solid transparent; border-bottom: calc(5 * var(--u)) solid var(--idle-edge); border-radius: calc(12 * var(--u)); font-family: var(--title); font-weight: 800;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.heat-number { font-size: calc(26 * var(--u)); }
.heat-zero { font-size: calc(22 * var(--u)); }
.heat-note { font-family: var(--body); font-weight: 700; font-size: calc(12 * var(--u)); margin-top: calc(4 * var(--u)); }
.heat-note:empty { display: none; }
.heat.current { background: var(--active); border-color: transparent; border-bottom-color: var(--active-edge); color: var(--on-gold); }
.heat.sent { background: var(--card); border: calc(3 * var(--u)) dashed var(--accent); }
.heat.sent .heat-note { color: var(--accent); }
.heat:disabled { cursor: default; }
.heat-status { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(16 * var(--u)); font-weight: 700; color: var(--ok); }
.heat-status.pending { color: var(--accent); }

.banner { display: flex; gap: calc(12 * var(--u)); align-items: flex-start; border-radius: calc(12 * var(--u)); padding: calc(12 * var(--u)) calc(14 * var(--u)); }
.banner-text { display: flex; flex-direction: column; gap: calc(2 * var(--u)); }
.banner-title { font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); line-height: 1.1; }
.critical-banner { background: var(--alert-bg); border: calc(2 * var(--u)) solid var(--alert); color: var(--text); font-size: calc(15 * var(--u)); line-height: 1.35; align-items: center; }
.critical-banner > .icon { color: var(--alert); }
.hints { display: flex; flex-direction: column; }
.refused-banner { background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); padding: calc(12 * var(--u)); }

.hero { display: flex; flex-direction: column; align-items: center; gap: calc(14 * var(--u)); padding-top: calc(16 * var(--u)); }
.icon.hero-icon { width: calc(88 * var(--u)); height: calc(88 * var(--u)); }
.hero .icon.ok, .hero .icon.warn, .hero .icon.critical { width: calc(96 * var(--u)); height: calc(96 * var(--u)); }
.result-title { font-size: calc(44 * var(--u)); line-height: 1; }
.cause { font-family: var(--title); font-weight: 700; font-size: calc(22 * var(--u)); line-height: 1.2; }
.icon.error-icon { width: calc(40 * var(--u)); height: calc(40 * var(--u)); }
.screen.error h1 { font-size: calc(30 * var(--u)); line-height: 1.1; }

.manual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(8 * var(--u)); }
.manual-cell { background: var(--card-2); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(8 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); }
.manual-cell .tile-label { font-size: calc(13 * var(--u)); text-transform: none; letter-spacing: 0; }
.manual-value { font-family: var(--title); font-weight: 800; font-size: calc(22 * var(--u)); }
.rule { align-items: flex-start; font-size: calc(16 * var(--u)); line-height: 1.4; }

.loading > .body { align-items: center; justify-content: center; }
.icon.spinner { width: calc(24 * var(--u)); height: calc(24 * var(--u)); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 0.25; } to { opacity: 1; } }

/* ---- Coffee machine (task 016): layout of taches/maquettes/016/ ---- */
.screen.cafe > .body { gap: calc(12 * var(--u)); }
.between { display: flex; justify-content: space-between; align-items: center; gap: calc(10 * var(--u)); font-size: calc(16 * var(--u)); }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.top-aligned { align-items: start; }

.choice { position: relative; min-height: calc(64 * var(--u)); background: var(--idle); border: calc(3 * var(--u)) solid transparent; border-bottom: calc(5 * var(--u)) solid var(--idle-edge); border-radius: calc(12 * var(--u)); padding: calc(8 * var(--u)) calc(4 * var(--u)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(2 * var(--u)); }
.tiles.choices { container-type: inline-size; }
/* The cup of the coffee (task 099), the colour of the text in every state. Where the buttons are wide enough (see below) it stands at the left of the button, out of the flow, and the name and the state stay
   centred; in a narrower button there is no room at the left of a centred name, so the cup stands in the flow, centred, above the name. */
.choice .icon.cup { width: calc(22 * var(--u)); height: calc(22 * var(--u)); color: inherit; }
.choice-name { font-family: var(--title); font-weight: 800; font-size: calc(18 * var(--u)); line-height: 1.1; }
.choice-status { font-size: calc(14 * var(--u)); font-weight: 700; color: var(--muted); }
.choice.current { background: var(--active); border-color: transparent; border-bottom-color: var(--active-edge); color: var(--on-gold); }
.choice.current .choice-status { color: var(--on-gold); }
.choice.done { background: var(--done-bg); border-bottom-color: #0d241a; }
.choice.done .choice-status { color: var(--ok); }
.choice.sent { background: var(--card); border: calc(3 * var(--u)) dashed var(--accent); }
.choice.sent .choice-status { color: var(--accent); }
.choice:disabled:not(.current):not(.done):not(.sent) { background: var(--card); border-bottom-color: var(--idle-edge); color: var(--disabled); }
.choice:disabled:not(.current):not(.done):not(.sent) .choice-status { color: var(--disabled); }

.recipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(10 * var(--u)); font-size: calc(16 * var(--u)); }
.recipe-grid .icon.symbol { width: calc(26 * var(--u)); height: calc(26 * var(--u)); }

.dose-row { display: flex; align-items: center; gap: calc(10 * var(--u)); }
.dose-button { width: calc(64 * var(--u)); height: calc(64 * var(--u)); display: flex; align-items: center; justify-content: center; flex: none; }
.dose-row .dose-button .icon { width: calc(36 * var(--u)); height: calc(36 * var(--u)); }
.dose-button:disabled { background: var(--card); border-color: var(--line); border-bottom-color: var(--idle-edge); color: var(--disabled); }
.card .dose-button { width: calc(44 * var(--u)); height: calc(44 * var(--u)); }
.card .dose-row .dose-button .icon { width: calc(32 * var(--u)); height: calc(32 * var(--u)); }
.card .dose-row { gap: calc(4 * var(--u)); }
.tiles > .card { padding: calc(10 * var(--u)) calc(12 * var(--u)); min-width: 0; }
.dose-center { flex-grow: 1; display: flex; flex-direction: column; align-items: center; }
.dose-value { font-family: var(--title); font-weight: 800; font-size: calc(44 * var(--u)); line-height: 1; }
.card .dose-value { font-size: calc(28 * var(--u)); }
.dose-kind { font-size: calc(14 * var(--u)); font-weight: 700; color: var(--muted); }
.dose-kind.normal { color: var(--ok); }
.dose-kind.strong { color: var(--warn); }
.dose-kind.refused { color: var(--alert); }
.dose-kind.unknown { color: var(--muted); }
.dose-scale, .reservoir { display: grid; grid-template-columns: repeat(var(--steps, 10), minmax(0, 1fr)); gap: calc(3 * var(--u)); }
.cell { height: calc(14 * var(--u)); border-radius: calc(3 * var(--u)); background: var(--card-2); border: calc(1 * var(--u)) solid var(--line); }
.cell.normal { background: var(--bar-ok); border-color: var(--bar-ok); }
.cell.strong { background: var(--strong); border-color: var(--strong); }
.cell.refused { background: var(--alert-bg); border-color: var(--alert); }
.cell.mine { outline: calc(2 * var(--u)) solid var(--text); }
.cell.water { background: var(--water); border-color: var(--water); }
.cell.unknown { background: var(--card-2); }
.reservoir .cell { height: calc(12 * var(--u)); }
.scale-legend { display: flex; justify-content: space-between; gap: calc(8 * var(--u)); font-size: calc(13 * var(--u)); }
/* A button of the choice at least ~138 px wide (in units of --u) has room for the cup at the left of the centred name, the name being 14 px (--u) then: the column of the three buttons is 430 px (--u) or more. Container queries
   cannot read var(): one query per scale (a tablet in portrait, a tablet in landscape); a phone, and a browser without container queries, keep the cup above the name. */
@media (min-width: 500.02px) and (max-width: 900px) { @container (min-width: 560px) {
    .choice .icon.cup { position: absolute; left: calc(0.55em + 5 * var(--u)); top: 50%; transform: translateY(-50%); width: 1.35em; height: 1.35em; font-size: calc(14 * var(--u)); }
    .choice-name { font-size: calc(14 * var(--u)); }
    .choice-status { font-size: calc(13 * var(--u)); }
  } }
@media (min-width: 900.02px) { @container (min-width: 495px) {
    .choice .icon.cup { position: absolute; left: calc(0.55em + 5 * var(--u)); top: 50%; transform: translateY(-50%); width: 1.35em; height: 1.35em; font-size: calc(14 * var(--u)); }
    .choice-name { font-size: calc(14 * var(--u)); }
    .choice-status { font-size: calc(13 * var(--u)); }
  } }
/* The reservoir (task 099): the level in big bold digits at the right of the title, the rule on a line of its own in normal text. */
.reservoir-level { font-family: var(--title); font-weight: 800; font-size: calc(28 * var(--u)); line-height: 1; font-variant-numeric: tabular-nums; }
.reservoir-rule { font-size: calc(16 * var(--u)); line-height: 1.4; font-weight: 400; color: var(--text); }
.lock-line { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(15 * var(--u)); font-weight: 700; color: var(--accent); }
.lock-line.warn { color: var(--warn); }
.lock-line.ok { color: var(--ok); }

/* Stability counter (task 028): green while the progression advances, amber while it waits. */
.extraction { border: calc(2 * var(--u)) solid var(--line); }
.extraction.stable { border-color: var(--ok); }
.extraction.paused { border-color: var(--warn); }
.extraction-count { font-family: var(--title); font-weight: 800; font-size: calc(26 * var(--u)); line-height: 1; }
.extraction.paused .extraction-count { font-size: calc(22 * var(--u)); color: var(--warn); }
.guide-text { font-size: calc(16 * var(--u)); line-height: 1.4; }
.step.waiting { background: var(--warn); animation: step-wait 1.2s ease-in-out infinite; }
@keyframes step-wait { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .step.waiting { animation: none; } }
.settings-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(4 * var(--u)) calc(8 * var(--u)); font-size: calc(16 * var(--u)); }
.settings-head { font-size: calc(14 * var(--u)); font-weight: 700; color: var(--muted); }
.setting-line { gap: calc(12 * var(--u)); align-items: flex-start; }
.setting-value { text-align: right; }
.progress { display: grid; grid-template-columns: repeat(var(--steps, 3), minmax(0, 1fr)); gap: calc(4 * var(--u)); }
.step { height: calc(10 * var(--u)); border-radius: calc(3 * var(--u)); background: var(--card-2); }
.step.done { background: var(--ok); }

.command-line { display: flex; gap: calc(10 * var(--u)); align-items: flex-start; border-radius: calc(12 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); font-size: calc(15 * var(--u)); background: var(--card); border: calc(1 * var(--u)) solid var(--line); color: var(--accent); }
.command-line .strong { color: var(--text); }
.command-line.done { color: var(--ok); }
.command-line.failed { background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); color: var(--warn); }

.banner.served { background: var(--done-bg); border: calc(2 * var(--u)) solid var(--ok); align-items: center; }
.banner.served > .icon { color: var(--ok); }
.banner.served.refused { background: var(--refused-bg); border-color: var(--gold); }
.banner.served.refused > .icon { color: var(--warn); }

.alerts-row { display: flex; gap: calc(8 * var(--u)); align-items: stretch; }
.alerts { flex-grow: 1; display: flex; flex-direction: column; gap: calc(6 * var(--u)); }
.alert { display: flex; align-items: center; gap: calc(8 * var(--u)); background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); border-radius: calc(12 * var(--u)); padding: calc(8 * var(--u)) calc(10 * var(--u)); font-size: calc(15 * var(--u)); font-weight: 700; }
.alert .icon { color: var(--warn); }
.alert.none { background: var(--card); border: calc(1 * var(--u)) solid var(--line); color: var(--muted); }
.alert.none .icon { color: var(--ok); }
.tile.danger { flex-direction: row; justify-content: space-between; align-items: center; padding: calc(10 * var(--u)) calc(12 * var(--u)); }
.tile.danger .tile-value { font-size: calc(22 * var(--u)); }
.alert-card { display: flex; flex-direction: column; gap: calc(8 * var(--u)); background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); border-radius: calc(12 * var(--u)); padding: calc(12 * var(--u)); }
.alert-card p { font-size: calc(16 * var(--u)); line-height: 1.4; }
.alert-head { display: flex; align-items: center; gap: calc(8 * var(--u)); font-family: var(--title); font-weight: 800; font-size: calc(20 * var(--u)); }
.alert-head .icon { color: var(--warn); }
.guide-title { font-size: calc(15 * var(--u)); font-weight: 700; color: var(--accent); }
/* Pressure alert in steps (task 031; maquette 031, planche 3): one box per case, one label and one sentence per step. */
.alert-card .guide-intro { font-weight: 700; }
.guide-case { display: flex; flex-direction: column; gap: calc(8 * var(--u)); background: var(--card-2); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(8 * var(--u)); padding: calc(10 * var(--u)); }
.guide-case-title { font-family: var(--title); font-weight: 800; font-size: calc(18 * var(--u)); line-height: 1.25; color: var(--accent); }
.guide-step { display: flex; flex-direction: column; gap: calc(3 * var(--u)); }
.guide-who { align-self: flex-start; padding: calc(1 * var(--u)) calc(8 * var(--u)); border-radius: calc(6 * var(--u)); font-size: calc(13 * var(--u)); font-weight: 700; }
.guide-who.you { background: var(--text); color: var(--on-gold); }
.guide-who.mechanic { background: var(--warn); color: var(--on-gold); }
.guide-what { font-size: calc(16 * var(--u)); line-height: 1.35; }
.guide-note { font-size: calc(15 * var(--u)); line-height: 1.35; color: var(--accent); }
button.alert { width: 100%; min-height: calc(44 * var(--u)); text-align: left; }
.alert-link { color: var(--text); }
.tile.alert-tile { background: var(--alert-bg); border-color: var(--alert); }

.gauge-tile .gauge-value { font-size: calc(34 * var(--u)); line-height: 1.1; }
.gauge-tile .row { gap: calc(6 * var(--u)); align-items: baseline; }
.gauge-tile .trend { font-size: calc(14 * var(--u)); }

.small-button { min-height: calc(44 * var(--u)); font-size: calc(17 * var(--u)); }
/* « Arrêt » is the main button of the Sécurité: orange like the headset's; engaged, it turns red until it is released. */
.stop { min-height: calc(56 * var(--u)); background: var(--primary-bg); color: var(--on-gold); border: calc(1 * var(--u)) solid #f7a35b; border-bottom: calc(4 * var(--u)) solid #a33d17; font-family: var(--title); font-weight: 800; font-size: calc(19 * var(--u)); }
.stop.on { background: var(--alert-bg); color: var(--text); border: calc(2 * var(--u)) solid var(--alert); border-bottom-width: calc(4 * var(--u)); }
.stop:disabled, .dark:disabled { opacity: 0.55; }

.code-card { background: var(--card-2); border: calc(3 * var(--u)) solid var(--gold); align-items: center; }
.code-card .label { align-self: flex-start; }
.code { font-family: var(--title); font-weight: 800; font-size: calc(72 * var(--u)); letter-spacing: 0.25em; line-height: 1; padding-left: 0.25em; color: var(--accent); }
.geyser .banner-title { font-size: calc(24 * var(--u)); }

.manual-button { min-height: calc(52 * var(--u)); }
.card.sensor .tiles.four { margin-top: calc(2 * var(--u)); }
.invite-button { min-height: calc(44 * var(--u)); background: transparent; border: calc(2 * var(--u)) solid var(--line); font-weight: 700; font-size: calc(16 * var(--u)); display: flex; align-items: center; justify-content: center; gap: calc(8 * var(--u)); }

.tabs .tab { min-height: calc(54 * var(--u)); background: var(--idle); border-bottom: calc(5 * var(--u)) solid var(--idle-edge); border-radius: calc(12 * var(--u)); font-family: var(--title); font-weight: 800; font-size: calc(16 * var(--u)); position: relative; }
.tabs .tab.current { background: var(--active); border-bottom-color: var(--active-edge); color: var(--on-gold); }
.icon.badge { position: absolute; top: calc(6 * var(--u)); right: calc(8 * var(--u)); width: calc(12 * var(--u)); height: calc(12 * var(--u)); color: var(--alert); }
.tabs .tab.current .icon.badge { color: #a02a1c; }

.trouble { align-items: flex-start; gap: calc(12 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.35; }
.icon.symptom { width: calc(40 * var(--u)); height: calc(40 * var(--u)); color: var(--accent); }
.icon.symptom.ok { color: var(--ok); }

.screen.invite { align-items: stretch; }
.qr-frame { align-self: center; background: #FFFFFF; padding: calc(14 * var(--u)); border-radius: calc(12 * var(--u)); }
.qr { display: block; width: calc(250 * var(--u)); height: calc(250 * var(--u)); image-rendering: pixelated; }
.address { font-family: var(--title); font-weight: 800; font-size: calc(28 * var(--u)); overflow-wrap: anywhere; color: var(--accent); }

/* The reservoir and the dose, side by side, need 140 px each for the 44 px buttons of the dose: below that, one under the other. */
@media (max-width: 372px) { .tiles.top-aligned { grid-template-columns: minmax(0, 1fr); } }

/* ---- Reservoir warning, manual at the end of the tabs, entry of the puddle (task 048; taches/maquettes/048/) ---- */
/* The tabs of the Barista and, at the end of the same row, the button of the manual: the same in the three tabs. */
.tabbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: calc(6 * var(--u)); }
.tab-list { display: contents; }
.tabs .tab { padding: 0; }
.manual-tab { min-height: calc(54 * var(--u)); padding: 0 calc(7 * var(--u)); display: flex; flex-direction: row; align-items: center; justify-content: center; gap: calc(4 * var(--u));
  border: calc(2 * var(--u)) solid var(--gold); border-radius: calc(12 * var(--u)); background: var(--card-2); color: var(--accent); font-size: calc(12 * var(--u)); font-weight: 700; line-height: 1.2; }
.manual-tab .icon { width: 1.45em; height: 1.45em; }
/* The warning that the reservoir falls too fast: a button that opens the manual on the puddle. */
.leak-warning { width: 100%; display: grid; grid-template-columns: calc(26 * var(--u)) minmax(0, 1fr) calc(16 * var(--u)); gap: calc(10 * var(--u)); align-items: center; padding: calc(10 * var(--u)) calc(12 * var(--u)); text-align: left;
  background: var(--refused-bg); color: var(--text); border: calc(2 * var(--u)) solid var(--gold); border-radius: calc(12 * var(--u)); }
.leak-warning .icon.leak-icon { width: calc(26 * var(--u)); height: calc(26 * var(--u)); color: var(--accent); }
.leak-warning .icon.small { width: calc(16 * var(--u)); height: calc(16 * var(--u)); color: var(--accent); }
.leak-text { display: flex; flex-direction: column; gap: calc(3 * var(--u)); }
.leak-text strong { font-size: calc(16 * var(--u)); line-height: 1.25; font-weight: 700; }
.leak-more { font-size: calc(14 * var(--u)); color: var(--accent); font-weight: 700; }
/* The entry of the puddle in the manual, complete: who acts, the gesture, then filling. Gold when the player was sent there. */
.puddle-entry { display: flex; flex-direction: column; gap: calc(10 * var(--u)); background: var(--card); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(12 * var(--u)); padding: calc(14 * var(--u)); }
.puddle-entry.focus { background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); }
.puddle-entry .icon.symptom { width: calc(28 * var(--u)); height: calc(28 * var(--u)); }
.puddle-title { font-family: var(--title); font-weight: 800; font-size: calc(21 * var(--u)); line-height: 1.15; }
.steps-list { display: grid; grid-template-columns: calc(30 * var(--u)) minmax(0, 1fr); gap: calc(10 * var(--u)); align-items: start; }
.step-number { width: calc(30 * var(--u)); height: calc(30 * var(--u)); border-radius: calc(15 * var(--u)); background: var(--active); color: var(--on-gold); font-family: var(--title); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps-list .col { font-size: calc(15 * var(--u)); line-height: 1.35; }
.steps-list .col strong { font-size: calc(16 * var(--u)); }
/* The Ingénieur of two phones has no troubleshooting in his manual: he is sent to the Chef. */
.referral { display: flex; flex-direction: column; gap: calc(8 * var(--u)); background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); border-radius: calc(12 * var(--u)); padding: calc(16 * var(--u)) calc(14 * var(--u)); font-size: calc(16 * var(--u)); line-height: 1.4; }
.referral .icon { width: calc(28 * var(--u)); height: calc(28 * var(--u)); color: var(--accent); }
.referral-title { font-family: var(--title); font-weight: 800; font-size: calc(21 * var(--u)); line-height: 1.15; }
.setting-value.long { flex: 1 1 100%; text-align: left; }
.setting-line:has(.long) { flex-wrap: wrap; }

/* Task 049: the relay's home page and the screens where a game ends (maquette 049). */
.home-form { display: flex; flex-direction: column; gap: calc(16 * var(--u)); }
.field { display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.field > .label { letter-spacing: 0.16em; }
.code-input { width: 100%; height: calc(80 * var(--u)); padding: 0 calc(12 * var(--u)); text-align: center; background: var(--card-2); color: var(--accent); border: calc(2 * var(--u)) solid var(--gold); border-radius: calc(12 * var(--u));
  font-family: var(--title); font-weight: 800; font-size: calc(42 * var(--u)); letter-spacing: 0.06em; text-transform: uppercase; }
.code-input::placeholder { color: #8c9390; opacity: 1; text-transform: none; }
.code-input:focus { outline: calc(3 * var(--u)) solid var(--accent); outline-offset: calc(2 * var(--u)); }
.notice-slot:empty { display: none; }
.banner.refused-banner > .icon { color: var(--accent); margin-top: calc(1 * var(--u)); }
.banner.refused-banner > .banner-text { font-size: calc(16 * var(--u)); line-height: 1.35; }
.code-row { display: flex; justify-content: space-between; align-items: center; height: calc(76 * var(--u)); padding: 0 calc(18 * var(--u)); background: var(--card); border: calc(1 * var(--u)) solid var(--line); border-radius: calc(12 * var(--u)); }
.code-row > .label { letter-spacing: 0.16em; }
.code-line { font-family: var(--title); font-weight: 800; font-size: calc(28 * var(--u)); letter-spacing: 0.06em; }
.screen.home > .body { gap: calc(16 * var(--u)); }
@media (max-width: 360px) {
  .code-input { font-size: calc(36 * var(--u)); }
}

/* Task 056: the screen « Rejoindre la partie » (maquette 056, validated by Adrian on 2 November). The logo is 120 px high (100 px under 340 px of
   width), the button « Rejoindre » sits in a bar of its own under the content, which scrolls behind it (`position: sticky` at the bottom of the
   screen: the button is always on the page, and rests at the end of the content when it is short), and the card of the coffee machine's seat
   has a back (« Qui fait quoi ? »). Under the notch of an iPhone the bar keeps clear of the home indicator (env). */
.screen.join > .bar.with-logo { padding: calc(4 * var(--u)) calc(16 * var(--u)); }
.screen.join .logo { width: min(calc(199 * var(--u)), calc(100% - calc(84 * var(--u)))); height: calc(120 * var(--u)); aspect-ratio: auto; }
.screen.join .bar-actions { top: calc(12 * var(--u)); right: calc(16 * var(--u)); }
.screen.join > .body { gap: calc(14 * var(--u)); padding: calc(18 * var(--u)) calc(20 * var(--u)) calc(18 * var(--u)); }
.screen.join h1 { font-size: calc(32 * var(--u)); }
.screen.join .card { padding: calc(14 * var(--u)) calc(16 * var(--u)); gap: calc(4 * var(--u)); }
.screen.join .label { letter-spacing: 0.16em; }
.screen.join .card-title { font-size: calc(23 * var(--u)); }
.screen.join .status-line .icon { width: calc(10 * var(--u)); height: calc(10 * var(--u)); }
.screen.join .seat-card { padding-bottom: calc(16 * var(--u)); gap: calc(8 * var(--u)); }
.screen.join .card-title.seat-title { font-size: calc(40 * var(--u)); line-height: 1.05; }
.seat-line { font-size: calc(18 * var(--u)); line-height: 1.35; }
.flip { margin-top: calc(6 * var(--u)); height: calc(48 * var(--u)); display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--u)); background: transparent; border: calc(2 * var(--u)) solid #727b79;
  font-family: var(--title); font-weight: 800; font-size: calc(19 * var(--u)); }
.screen.join .who { padding-bottom: calc(16 * var(--u)); gap: calc(10 * var(--u)); }
.screen.join .who > .flip { margin-top: calc(4 * var(--u)); }
.who > [tabindex="-1"]:focus { outline: none; }
.posts { display: flex; flex-direction: column; gap: calc(10 * var(--u)); }
.post { display: flex; flex-direction: column; gap: calc(2 * var(--u)); padding: calc(10 * var(--u)) calc(12 * var(--u)); background: var(--card-2); border-radius: calc(10 * var(--u)); }
.post.mine { background: var(--refused-bg); border: calc(2 * var(--u)) solid var(--gold); }
.post-name { display: flex; flex-wrap: wrap; gap: 0 calc(6 * var(--u)); font-family: var(--title); font-weight: 800; font-size: calc(20 * var(--u)); line-height: 1.25; }
.post-tasks { font-size: calc(16 * var(--u)); color: var(--muted); }
.dock { position: sticky; bottom: 0; z-index: 3; flex: none; padding: calc(14 * var(--u)) calc(20 * var(--u)) calc(calc(22 * var(--u)) + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(32, 38, 42, 0), var(--bg) 22%); border-top: calc(1 * var(--u)) solid var(--card); }
.dock .primary { width: 100%; height: calc(76 * var(--u)); font-size: calc(26 * var(--u)); }
/* The screens of the preparation (« Je suis prêt »): the countdown is under the button, in the dock. */
.dock > .countdown-box { margin-top: calc(10 * var(--u)); }
@media (max-width: 339.98px) {
  .screen.join > .bar.with-logo { padding-left: calc(12 * var(--u)); padding-right: calc(12 * var(--u)); }
  .screen.join .logo { width: min(calc(166 * var(--u)), calc(100% - calc(84 * var(--u)))); height: calc(100 * var(--u)); }
  .screen.join .bar-actions { top: calc(10 * var(--u)); right: calc(12 * var(--u)); }
  .screen.join > .body { gap: calc(10 * var(--u)); padding: calc(12 * var(--u)) calc(16 * var(--u)) calc(12 * var(--u)); }
  .screen.join h1 { font-size: calc(26 * var(--u)); }
  .screen.join .card { padding: calc(10 * var(--u)) calc(14 * var(--u)); gap: calc(2 * var(--u)); }
  .screen.join .label { font-size: calc(12 * var(--u)); }
  .screen.join .card-title { font-size: calc(19 * var(--u)); }
  .screen.join .status-line { font-size: calc(14 * var(--u)); }
  .screen.join .status-line .icon { width: calc(9 * var(--u)); height: calc(9 * var(--u)); }
  .screen.join .seat-card { padding-bottom: calc(12 * var(--u)); gap: calc(6 * var(--u)); }
  .screen.join .card-title.seat-title { font-size: calc(32 * var(--u)); }
  .seat-line { font-size: calc(16 * var(--u)); line-height: 1.3; }
  .flip { margin-top: calc(4 * var(--u)); height: calc(44 * var(--u)); gap: calc(8 * var(--u)); font-size: calc(17 * var(--u)); }
  .flip .icon { display: none; }
  .screen.join .who { padding-bottom: calc(12 * var(--u)); gap: calc(8 * var(--u)); }
  .posts { gap: calc(8 * var(--u)); }
  .post { padding: calc(8 * var(--u)) calc(10 * var(--u)); }
  .post-name { font-size: calc(18 * var(--u)); }
  .post-tasks { font-size: calc(15 * var(--u)); }
  .dock { padding: calc(10 * var(--u)) calc(16 * var(--u)) calc(calc(14 * var(--u)) + env(safe-area-inset-bottom)); }
  .dock .primary { height: calc(64 * var(--u)); font-size: calc(24 * var(--u)); }
}

/* ---- The partner the player chooses (task 068; maquette 068, version 6) ------------------------------------------------------------------------------------
   Portrait: one picture of 5 columns (the colours, in the order of the headset's palette) by 2 rows (the robot, the drone), rendered from the headset's own models at twice the
   size it is shown at (art-source/blender/partenaires/portraits.py), cut by the position of its background. Turquoise and violet are Adrian's colours; pink, green and white are
   provisional (the swatches here and the picture agree). The number is a badge of text, written by the page: it is the seat's, not part of the picture. */
.portrait { position: relative; flex: none; display: inline-block; border-radius: calc(12 * var(--u)); background: #d9dedb; overflow: hidden; }   /* light, like the board of the maquette: the dark parts of the models (legs, tracks, screen) stand out */
.portrait.big { width: calc(96 * var(--u)); height: calc(96 * var(--u)); }
.portrait.small { width: calc(44 * var(--u)); height: calc(44 * var(--u)); border-radius: calc(9 * var(--u)); }
.portrait.band { width: calc(46 * var(--u)); height: calc(46 * var(--u)); border-radius: calc(10 * var(--u)); }
.portrait .pimg { position: absolute; inset: 0; background: url("partners.png") no-repeat; background-size: 500% 200%; background-position: calc(var(--col, 0) * 25%) calc(var(--row, 0) * 100%); }
.portrait[data-color="turquoise"] { --col: 0; }
.portrait[data-color="violet"] { --col: 1; }
.portrait[data-color="pink"] { --col: 2; }
.portrait[data-color="green"] { --col: 3; }
.portrait[data-color="white"] { --col: 4; }
.portrait[data-shape="drone"] { --row: 1; }
.portrait .pnum { position: absolute; right: calc(3 * var(--u)); bottom: calc(3 * var(--u)); font-family: var(--title); font-weight: 800; font-size: calc(13 * var(--u)); line-height: 1; padding: calc(3 * var(--u)) calc(5 * var(--u)) calc(2 * var(--u)); border-radius: calc(6 * var(--u));
  background: #121618; color: var(--text); border: calc(1 * var(--u)) solid var(--line); }
.screen.join .partner-card { gap: calc(8 * var(--u)); padding-bottom: calc(16 * var(--u)); }
.partner-choice { display: flex; flex-direction: column; gap: calc(8 * var(--u)); }
.partner-head { display: flex; gap: calc(14 * var(--u)); align-items: center; }
.partner-text { display: flex; flex-direction: column; gap: calc(2 * var(--u)); min-width: 0; }
.partner-line { margin: 0; font-size: calc(16 * var(--u)); line-height: 1.35; color: var(--muted); }
.choice-label { font-size: calc(13 * var(--u)); color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; margin-top: calc(4 * var(--u)); }
.segs { display: grid; grid-template-columns: 1fr 1fr; gap: calc(8 * var(--u)); }
.seg { height: calc(52 * var(--u)); display: flex; align-items: center; justify-content: center; gap: calc(10 * var(--u)); background: var(--idle); border: 0; border-bottom: calc(5 * var(--u)) solid var(--idle-edge); border-radius: calc(10 * var(--u));
  font-family: var(--title); font-weight: 800; font-size: calc(19 * var(--u)); color: var(--text); padding: 0 calc(10 * var(--u)); }
.seg .seg-icon { width: calc(26 * var(--u)); height: calc(26 * var(--u)); fill: none; }
.seg[aria-pressed="true"] { background: var(--active); border-bottom-color: var(--active-edge); color: var(--on-gold); }
.seg.taken { opacity: .38; }
.seg.taken .seg-icon { opacity: .8; }
.shape-note { margin-top: calc(-2 * var(--u)); }
.swatches { display: flex; gap: calc(12 * var(--u)); }
.swatch { width: calc(48 * var(--u)); height: calc(48 * var(--u)); flex: none; border-radius: 50%; padding: 0; background: transparent; border: calc(2 * var(--u)) solid transparent; display: grid; place-items: center; }
.swatch > span { width: calc(36 * var(--u)); height: calc(36 * var(--u)); border-radius: 50%; background: var(--sw); border: calc(2 * var(--u)) solid #0d1113; }
.swatch[data-color="turquoise"] { --sw: #19B3B0; }
.swatch[data-color="violet"] { --sw: #8C52E8; }
.swatch[data-color="pink"] { --sw: #E8559A; }
.swatch[data-color="green"] { --sw: #7CC242; }
.swatch[data-color="white"] { --sw: #ECE8DC; }
.swatch[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 calc(2 * var(--u)) #0d1113 inset; }
.swatch.taken > span { opacity: .28; background: linear-gradient(135deg, transparent 45%, var(--text) 45% 55%, transparent 55%), var(--sw); }
.partner-notes { display: flex; flex-direction: column; gap: calc(2 * var(--u)); }
.seat-who { display: flex; gap: calc(12 * var(--u)); align-items: center; min-width: 0; }
.seat.mine { flex-wrap: wrap; row-gap: calc(10 * var(--u)); }
.change-partner { flex-basis: 100%; height: calc(44 * var(--u)); padding: 0 calc(14 * var(--u)); background: transparent; border: calc(2 * var(--u)) solid #727b79; border-radius: calc(10 * var(--u)); font-family: var(--title); font-weight: 800; font-size: calc(16 * var(--u)); color: var(--text); }
.bar-portrait { flex: none; }
.partner-sheet { display: flex; flex-direction: column; gap: calc(8 * var(--u)); margin: calc(10 * var(--u)) 0 calc(16 * var(--u)); }
.sheet h2 { margin: 0; font-family: var(--title); font-weight: 800; font-size: calc(24 * var(--u)); }
.sheet .primary { width: 100%; }
.partner-notice { align-items: flex-start; }
/* Under 360 px the five swatches share the width of the card instead of keeping 48 px each (they stay above 44 px, the size of a finger). */
@media (max-width: 360px) {
  .swatches { gap: calc(6 * var(--u)); }
  .swatch { flex: 1 1 0; min-width: 0; width: auto; height: auto; aspect-ratio: 1; }
  .swatch > span { width: 78%; height: 78%; }
}

/* The row of the six expressions of the partner (task 082; maquette 082, version 8): under the header, six square buttons, no text. Each shows the face of the partner's screen it makes
   (a cell of partner-screens.png, the headset's atlas, whose black is baked in: it is lightened over --partner-screen, as the maquette does), the stars for « youhoo ». The picture is
   a box of the proportions of a face (240 by 172 px of its 256 px cell); the cell is placed by percentages, so it stays right whatever the width of the button (320 to 480 px). */
.expressions { flex: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: calc(4 * var(--u)); padding: calc(10 * var(--u)) max(calc(12 * var(--u)), env(safe-area-inset-left)) calc(12 * var(--u)) max(calc(12 * var(--u)), env(safe-area-inset-right)); background: var(--expr-band); border-bottom: calc(1 * var(--u)) solid var(--expr-edge); }
.expr { aspect-ratio: 1 / 1; min-width: calc(44 * var(--u)); min-height: calc(44 * var(--u)); padding: 0; display: grid; place-items: center; cursor: pointer; color: var(--text); font: inherit; background: linear-gradient(var(--expr-a), var(--expr-b)); border: calc(1 * var(--u)) solid var(--expr-line); border-bottom: calc(3 * var(--u)) solid var(--expr-edge); border-radius: calc(12 * var(--u)); -webkit-tap-highlight-color: transparent; }
.expr:focus-visible { outline: calc(3 * var(--u)) solid var(--gold); outline-offset: calc(2 * var(--u)); }
.expr.on { background: linear-gradient(var(--expr-on-a), var(--expr-on-b)); border-color: var(--expr-on-line); color: var(--on-gold); }
.expr:disabled, .expressions.waiting .expr:not(.on) { opacity: 0.42; cursor: default; }
.expr .tile { display: block; width: 82%; aspect-ratio: 240 / 172; border-radius: calc(6 * var(--u)); border: calc(1 * var(--u)) solid var(--partner-screen-line); background-color: var(--partner-screen); background-blend-mode: lighten; background-image: url("partner-screens.png"); background-repeat: no-repeat; background-size: 426.667% 297.674%; }
.expr.on .tile { box-shadow: 0 0 0 calc(2 * var(--u)) rgba(40, 40, 40, 0.35); }
.expr .tile-stars { display: grid; place-items: center; color: var(--text); background-image: none; }
.expr .tile-stars .icon { width: 100%; height: 100%; }
.face-happy { background-position: 33.673% 12.353%; }
.face-laugh { background-position: 66.327% 12.353%; }
.face-yey { background-position: 98.980% 12.353%; }
.face-question { background-position: 1.020% 12.353%; }
.face-sad { background-position: 33.673% 87.647%; }

/* ---- One Quest and one to five phones (task 083) ---- */
.team-tag { align-self: flex-start; display: inline-flex; align-items: center; border: calc(1 * var(--u)) solid var(--active); border-radius: calc(999 * var(--u)); padding: calc(3 * var(--u)) calc(12 * var(--u)); font-family: var(--title); font-weight: 800; font-size: calc(14 * var(--u)); color: var(--accent); }
.hacker-options { gap: calc(10 * var(--u)); }

/* ---- Tablets (task 084; maquette 084, version 7 validated by Adrian on 7 November 2026; corrected by task 099, maquette 099 validated on 8 November) ----
   Up to 900 px of width the page is the phone's column, drawn larger by --u (see the top of this file): nothing else is needed.
   Over 900 px (a tablet in landscape, a large one in portrait; the page follows a rotation or a split screen by itself, all of it being CSS on the width, nothing is drawn again):
   - the header spans the width; the row of the six expressions is spaced out, its buttons no longer stuck together, on a row of 820 px at most;
   - a body (or a panel of the Barista, `.blocks`) that has two blocks or more to show is laid out in two columns, CSS multi-columns: the blocks stay in the order the screen wrote them in (the order that is
     seen, read by a screen reader and followed by the Tab key, the same as on a phone), the left column takes the first ones, the right column the rest, and the cut falls between two blocks, where the two columns
     are the nearest in height (`column-fill: balance`, `break-inside: avoid`: a block is never cut). The stripes of the header, set upright, run between the two columns (background of the container). Nothing
     is moved or marked in the page for this: a block that appears or disappears (the geyser, a banner, an alert) only moves the cut, and keeps the focus, the value and the selection of a field;
   - the choice of the coffee and its recipe are one block (`.together`, ui.js): the recipe is always right under the three buttons;
   - a body or panel with one block only to show keeps one column, centred, as wide as on a tablet in portrait;
   - a block that is hidden does not count, nor does the spring `.grow` of the phones' screens (it disappears in two columns). */
.together { display: contents; }
@media (min-width: 900.02px) {
  #app { max-width: none; }
  .expressions { gap: calc(18 * var(--u)); padding-left: max(calc(12 * var(--u)), env(safe-area-inset-left), calc((100% - 820px) / 2)); padding-right: max(calc(12 * var(--u)), env(safe-area-inset-right), calc((100% - 820px) / 2)); }
  #app .screen > .body { padding-left: max(calc(20 * var(--u)), env(safe-area-inset-left), calc((100% - var(--col)) / 2)); padding-right: max(calc(20 * var(--u)), env(safe-area-inset-right), calc((100% - var(--col)) / 2)); }
  #app .screen > .body:has(> .blocks), #app .screen > .body:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) {
    padding-left: max(calc(28 * var(--u)), env(safe-area-inset-left), calc((100% - 1180px) / 2)); padding-right: max(calc(28 * var(--u)), env(safe-area-inset-right), calc((100% - 1180px) / 2)); }
  #app .dock { margin-top: auto; padding-left: max(calc(20 * var(--u)), env(safe-area-inset-left), calc((100% - var(--col)) / 2)); padding-right: max(calc(20 * var(--u)), env(safe-area-inset-right), calc((100% - var(--col)) / 2)); }

  /* A panel of the Barista with one block only: one column, centred. */
  #app .blocks:not(:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow))) { width: 100%; max-width: var(--col); margin-left: auto; margin-right: auto; }

  /* Two blocks or more to show: two columns (a body that holds panels is not one, its panels are). */
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)),
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) {
    --cgap: calc(30 * var(--u)); --sep: calc(9 * var(--u)); --blockgap: calc(14 * var(--u));
    display: block; flex: none; column-count: 2; column-fill: balance; column-gap: calc(2 * var(--cgap) + var(--sep));
    background: repeating-linear-gradient(135deg, var(--gold) 0 calc(14 * var(--u)), #282b2c calc(14 * var(--u)) calc(28 * var(--u))) 50% 0 / var(--sep) 100% no-repeat content-box;
  }
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > *,
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > * { break-inside: avoid; -webkit-column-break-inside: avoid; margin-top: 0; margin-bottom: var(--blockgap); }
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > :not(.hidden, .grow):not(:has(~ :not(.hidden, .grow))),
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > :not(.hidden, .grow):not(:has(~ :not(.hidden, .grow))) { margin-bottom: 0; }
  /* In a flex column (a phone) a button, a span or an icon is a block of the column; here the blocks are those of a block container: a button is as wide as the column, a span and an icon stand on their own line. */
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > button,
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > button { width: 100%; }
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > :is(span, svg),
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > :is(span, svg) { display: block; }
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > .qr-frame { width: fit-content; margin-left: auto; margin-right: auto; }
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > .grow,
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > .grow { display: none; }
  #app .body:not(:has(> .blocks)):has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > .together,
  #app .blocks:has(> :not(.hidden, .grow) ~ :not(.hidden, .grow)) > .together { display: flex; flex-direction: column; gap: var(--blockgap); }
}
