/* ── The kitchen ──────────────────────────────────────────────────────
   A small, quiet kitchen where you cook something for someone and send
   it. Its own look, grown out of the portfolio's birthday cake game:
   warm paper, food painted soft in 3D, flat pastel stickers for icons,
   Fraunces for titles and Figtree for everything else, light-blue keys.
   Every colour, size, corner and easing comes from these tokens.
   ──────────────────────────────────────────────────────────────────── */
:root {
  /* paper and ink */
  --k-ground:   #f7f6f4;   /* the page, and what the 3D is painted onto */
  --k-paper:    #ffffff;
  --k-card:     var(--k-paper);   /* the picking card */
  --k-wall:     #f7f4ef;   /* the menu's kitchen wall, a pale beige */
  --k-photo:    #edeae4;   /* the warm grey the menu's food photos are taken on (scripts/menu-photo.js GREY) */
  --k-ink-1:    #1f1b19;   /* words you press */
  --k-ink-head: #4a3327;   /* the Jua titles: a black brown, softer than ink-1 */
  --k-ink-2:    #3a3431;
  --k-ink-3:    #5c5551;   /* reading lines */
  --k-ink-4:    #6e6762;   /* quiet labels (4.6:1 on the ground) */
  --k-ink-inv:  #ffffff;
  --k-tile:     color-mix(in srgb, var(--k-ink-1) 5%, var(--k-ground));
  --k-tile-on:  color-mix(in srgb, var(--k-ink-1) 9%, var(--k-ground));
  --k-shadow:   color-mix(in srgb, var(--k-ink-1) 14%, transparent);
  --k-tone-d:   color-mix(in srgb, var(--k-ink-1) 72%, var(--k-ground));
  --k-tone-m:   color-mix(in srgb, var(--k-ink-1) 36%, var(--k-ground));
  --k-tone-l:   color-mix(in srgb, var(--k-ink-1) 13%, var(--k-paper));

  /* the pastels: muted, soft and a little whimsical (every blue keeps red under green) */
  --k-cream:   #f8f1e3;
  --k-butter-l: #faedc6; --k-butter:  #f5dc9d;  --k-butter-d: #d6b663;  --k-mustard: #b08d3c;
  --k-yolk:    #f2c14a;  /* an egg's yolk, brighter than the butter */
  --k-peach-l: #f7e0cc;  --k-peach:  #f1c3a2;  --k-peach-d: #d79a74;
  --k-salmon:  #f2a184;  /* the salmon sticker's coral */
  --k-pumpkin: #eca868;  --k-pumpkin-d: #d4874a;  /* a pumpkin pie's custard, kept soft (js/pumpkinpie.js) */
  --k-rose:    #ebb2ae;  --k-rose-d: #c98480;
  --k-sage-l:  #e1ebd6;  --k-sage:    #bcd1aa;  --k-sage-d: #86a374;
  --k-sky-l:   #d8e8ee;  --k-sky:    #b4d2de;  --k-sky-d:  #7fa9bb;
  --k-cocoa:   #b38e78;  --k-cocoa-d: #85634f;
  --k-steel:   #c4bdb8;  --k-steel-d: #9b928c;  --k-char:   #6f625b;
  --k-rice:    #c5b29c;   /* the grains on the onigiri sticker */
  --k-nori:    #3f4a3c;
  --k-berry:   #d77a7a;  --k-berry-d: #b86262;  /* the Christmas reds, kept soft */
  --k-taro:    #c9b6dc;  --k-taro-d: #9a84b4;   /* the boba's taro, a soft lilac */
  --k-pine:    #7d9c86;  --k-pine-d: #5f7e69;
  --k-night:   #3e4a62;  /* Christmas Eve's dusk (the cookies' page, while Santa comes) */

  /* the one accent: a soft light blue, and its ink for type and focus */
  --k-accent:      #8fb8ca;
  --k-accent-soft: var(--k-sky);
  --k-accent-ink:  #457386;
  /* the guides in the scene (what to take hold of next, where it goes, the way to move it): a warm
     butter yellow, so they read apart from the blue of what's chosen */
  --k-guide:       #f1bf4c;

  /* the keys: a glazed light-blue tile, top half paler, on a soft blue edge */
  --k-key-top:    var(--k-sky-l);
  --k-key-bot:    var(--k-sky);
  --k-key-go-top: #c3dbe5;
  --k-key-go-bot: #a8cddc;
  --k-key-edge:   var(--k-sky-d);
  --k-key-ink:    #24505f;
  /* the one other glaze, butter, for "eat it now" beside the blue "send it to someone": close to the blue's
     weight (judged against it by eye: at the blue's exact lightness it goes tan), so neither outweighs the other */
  --k-key-butter-top:  oklch(0.93 0.075 96);
  --k-key-butter-bot:  oklch(0.87 0.115 93);
  --k-key-butter-edge: oklch(0.75 0.12 88);
  --k-key-butter-ink:  var(--k-ink-head);

  /* type */
  /* Jua for the titles; Darumadrop One for the logo only */
  --k-font-head: "Jua", "Fraunces", Georgia, serif;
  --k-font-logo: "Darumadrop One", "Fredoka", var(--k-font-ui);   /* the logo only: round and chunky, like the stickers */
  --k-font-ui:   "Figtree", system-ui, sans-serif;
  --k-font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  /* the scale: 12 for labels, 14 for every line of body text, UI and chip, 20 for the names of things
     (dishes, prompts, polaroids), 26 for the fridge's title. Figtree for words, Jua (400 only) for names. */
  --k-t-micro: 12px;
  --k-t-body:  14px;
  --k-t-name:  20px;
  --k-t-lead:  17px;
  --k-t-title: 26px;
  --k-t-hero:  clamp(34px, 6vw, 60px);
  --k-t-display: clamp(26px, 2.6vw, 34px);   /* the menu's "Time to cook": small and fine over the kitchen */

  /* space */
  --k-s-1: 4px;  --k-s-2: 8px;  --k-s-3: 12px; --k-s-4: 16px;
  --k-s-5: 24px; --k-s-6: 32px; --k-s-7: 48px; --k-s-8: 64px;
  /* how far the prompt sits from the top and the tray from the bottom (the corner chip follows the prompt) */
  --k-quest-top: var(--k-s-6); --k-tray-bottom: var(--k-s-7);

  /* corners */
  --k-r-key:   12px;
  --k-r-field: 12px;
  --k-r-box:   20px;
  --k-r-tile:  22px;
  --k-r-pill:  999px;

  /* the one stroke: the badge's white ring and every tile's border (unpicked, picked, tipped in) */
  --k-stroke:  4px;
  --k-ring:    3px;   /* the white edge round the round badges (the prompt's, the pick's check) */

  /* motion */
  --k-ease-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --k-ease-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --k-ease-soft:  cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--k-ground);
  color: var(--k-ink-1);
  font-family: var(--k-font-ui);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--k-sky); color: var(--k-ink-1); }
.k-hide {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── The scene ── */
body.k-dish { overflow: hidden; }
/* On a phone (iOS most of all), a dish page behaves like an app's screen, not a web page: no rubber-band bounce or
   pull to refresh, no double-tap zoom, and a long press on the scene or a key doesn't pick up text or bring up a
   callout (what's typed in, and the link, can still be selected) */
html:has(body.k-dish), body.k-dish { overscroll-behavior: none; }
body.k-dish { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.k-dish input, body.k-dish textarea { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* (typed into at under 16px, iOS zooms the whole page in on the field: on a touch screen they're 16px) */
@media (pointer: coarse) { .k-field input, .k-field textarea, .k-linkbox input { font-size: 16px; } }
.k-scene { position: fixed; inset: 0; touch-action: none; }
.k-scene:focus { outline: none; }
.k-scene canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 700ms var(--k-ease-soft); }
.k-scene.is-ready canvas { opacity: 1; }

/* the loading screen: over everything till the kitchen's drawn, the logo's toast posted in a letter */
.k-loading {
  position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: var(--k-s-4);
  background: var(--k-ground); transition: opacity 360ms var(--k-ease-soft), visibility 0s linear 360ms;
}
.k-loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
/* the letter (js/loading.js, the home's logo in layers): it slides in and lands, the slice is thrown up out of it
   the way the home's is (home-pop, index.html), blinks, sinks back, and the letter is sent on; one turn is --loop.
   Each layer is a box the size of the whole picture (112 by 120 of the logo's units, so a place in the drawing is
   a percentage of the box: the envelope's top edge, at 50, is 53.33% down), and only boxes move, by transform and
   opacity alone, so it keeps going while the page builds. The picture's tipped 5 degrees as on the home; the
   envelope and the slot the slice rides in lean 4 more about the envelope's middle, the slice 7 back in its slot */
.k-post { --loop: 4s; position: relative; display: block; width: clamp(124px, 40vmin, 176px); aspect-ratio: 112 / 120; color: var(--k-ink-head); animation: k-post var(--loop) infinite; }
.k-post span, .k-post svg { position: absolute; inset: 0; display: block; }
.k-post svg { width: 100%; height: 100%; overflow: visible; }
.k-post__pic { rotate: -5deg; }
.k-post__slot, .k-post__env { transform-origin: 50% 74.17%; rotate: -4deg; }
.k-post__slot { clip-path: inset(-40% -40% 46.67% -40%); }   /* (the slice is only seen above the envelope's top edge) */
.k-post__toast { animation: k-post-toast var(--loop) infinite; }
.k-post__lean { transform-origin: 50% 53.33%; rotate: 7deg; }
/* (the blink: the open eyes give way to shut ones, two still drawings crossed over by opacity alone. It used to squash
   the eyes flat with a transform, and an inked drawing squashed is redrawn through its ink filter on every frame on
   the phone (WebKit), which stuttered and flickered: "eye blinking is glitchy", 2026-11-26) */
.k-post__eyes { animation: k-post-eyes var(--loop) linear infinite; }
.k-post__lids { opacity: 0; animation: k-post-lids var(--loop) linear infinite; }
.k-post__kick { transform-origin: 50% 95%; animation: k-post-kick var(--loop) infinite; }
@keyframes k-post {
  0% { transform: translateX(-68%) rotate(-11deg); opacity: 0; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
  20%, 80% { transform: translateX(0) rotate(0deg); opacity: 1; animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.3); }
  97%, 100% { transform: translateX(68%) rotate(9deg); opacity: 0; }
}
@keyframes k-post-toast {
  0%, 24% { transform: translateY(48.33%); animation-timing-function: cubic-bezier(0.12, 0.8, 0.3, 1); }
  31% { transform: translateY(-8.33%); animation-timing-function: ease-in-out; }
  37% { transform: translateY(2.5%); animation-timing-function: ease-in-out; }
  42% { transform: translateY(-1%); animation-timing-function: ease-in-out; }
  46%, 68% { transform: translateY(0); animation-timing-function: cubic-bezier(0.5, 0, 0.8, 0.4); }
  78%, 100% { transform: translateY(48.33%); }
}
@keyframes k-post-kick {
  0%, 14%, 24%, 36%, 100% { transform: none; }
  19% { transform: scale(1.04, 0.93); }
  27% { transform: scale(1.05, 0.9); }
  31% { transform: scale(0.98, 1.04); }
}
@keyframes k-post-eyes { 0%, 54.5%, 58.5%, 100% { opacity: 1; } 55.3%, 57.7% { opacity: 0; } }
@keyframes k-post-lids { 0%, 54.5%, 58.5%, 100% { opacity: 0; } 55.3%, 57.7% { opacity: 1; } }
/* (once the screen's faded right out, js/loading.js: nothing of it is seen, so nothing of it is kept moving) */
.k-loading.is-done.is-still .k-post, .k-loading.is-done.is-still .k-post span { animation-play-state: paused; }
.k-loading__words { font: 600 var(--k-t-body) var(--k-font-ui); color: var(--k-ink-3); }
/* (asked for less motion, the letter's simply there: the slice up in its envelope, as on the home) */
@media (prefers-reduced-motion: reduce) { .k-post, .k-post span { animation: none; } .k-loading { transition: none; } }

/* the way home, top left */
.k-corner { position: fixed; top: calc(var(--k-quest-top) + 8px); left: var(--k-s-4); z-index: 20; display: flex; gap: var(--k-s-2); }
.k-chip {
  display: inline-flex; align-items: center; gap: var(--k-s-2);
  height: 32px; padding: 0 var(--k-s-3);
  border-radius: var(--k-r-key);
  background: var(--k-tile); color: var(--k-ink-2);
  font: 600 var(--k-t-body) var(--k-font-ui);
  text-decoration: none;
  transition: background 180ms var(--k-ease-quart);
}
.k-chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) { .k-chip:hover { background: var(--k-tile-on); } }
.k-chip:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
/* the photo's viewfinder (js/keep.js): a square left clear over the dish, the rest of the scene dimmed,
   white corners marking it; taken, the photo shows in it as a polaroid, with a flash */
/* The finished dish, tapped to eat (js/ui.js, js/keep.js): a clear key laid over the whole scene, under the prompt, the
   keys and the letter's desk, so a tap anywhere on the food is the bite */
.k-tap { position: fixed; inset: 0; z-index: 11; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.k-tap[hidden] { display: none; }
.k-tap:focus { outline: none; }
.k-finder { position: fixed; z-index: 12; pointer-events: none; border-radius: 22px; box-shadow: 0 0 0 200vmax color-mix(in srgb, var(--k-ground) 62%, transparent); }
.k-finder[hidden] { display: none; }
.k-finder__c { position: absolute; width: 30px; height: 30px; border: 0 solid var(--k-paper); filter: drop-shadow(0 1px 2px var(--k-shadow)); }
.k-finder__c--tl { top: 0; left: 0; border-width: 4px 0 0 4px; border-top-left-radius: 22px; }
.k-finder__c--tr { top: 0; right: 0; border-width: 4px 4px 0 0; border-top-right-radius: 22px; }
.k-finder__c--bl { bottom: 0; left: 0; border-width: 0 0 4px 4px; border-bottom-left-radius: 22px; }
.k-finder__c--br { bottom: 0; right: 0; border-width: 0 4px 4px 0; border-bottom-right-radius: 22px; }
.k-finder__shot { display: none; }
.k-finder.is-shot { box-shadow: 0 0 0 200vmax color-mix(in srgb, var(--k-ground) 92%, transparent); }
.k-finder.is-shot .k-finder__c { display: none; }
.k-finder.is-shot .k-finder__shot {
  display: block; position: absolute; left: 50%; top: 50%; width: 78%; aspect-ratio: 1;
  padding: 10px 10px 36px; background: var(--k-paper); border-radius: 4px; object-fit: cover;
  box-shadow: 0 1px 2px var(--k-shadow), 0 18px 36px -18px var(--k-shadow);
  translate: -50% -50%; rotate: -3deg; animation: k-shot-in 520ms var(--k-ease-expo);
}
@keyframes k-shot-in { from { scale: 1.25; rotate: 0deg; } }
.k-finder.is-flash::after { content: ""; position: fixed; inset: -200vmax; background: #fff; animation: k-flash 380ms ease-out forwards; }
@keyframes k-flash { from { opacity: 0.9; } to { opacity: 0; } }
.k-zoom-row { display: flex; align-items: center; gap: var(--k-s-3); width: min(420px, 100%); font: 600 var(--k-t-micro) var(--k-font-ui); color: var(--k-ink-3); }
.k-zoom { flex: 1; height: 32px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.k-zoom::-webkit-slider-runnable-track { height: 6px; border-radius: var(--k-r-pill); background: var(--k-tile-on); }
.k-zoom::-moz-range-track { height: 6px; border-radius: var(--k-r-pill); background: var(--k-tile-on); }
.k-zoom::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: var(--k-paper); box-shadow: 0 1px 3px var(--k-shadow), 0 0 0 1px var(--k-shadow); }
.k-zoom::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--k-paper); box-shadow: 0 1px 3px var(--k-shadow), 0 0 0 1px var(--k-shadow); }
.k-zoom:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; border-radius: var(--k-r-pill); }
@media (prefers-reduced-motion: reduce) { .k-finder.is-shot .k-finder__shot { animation: none; } }

/* the settings: a round chip in the top right corner, and the little card of switches it opens under it */
.k-corner--end { left: auto; right: var(--k-s-4); }
/* Every way back and every close that sits over a scene is this one round of paper, 36px, pressed down when tapped:
   the menu's own keys (her redesign, 2026-11-24), the dish pages' and the market's corner keys, the fridge's cross and
   the market's closer look. `.k-round` alone holds the arrow back (19px drawn at 3); `.k-round--x` the cross (the plus
   turned an eighth, 22px drawn at 2.6), so both lines weigh the same. (A cross inside a paper card, .k-pick__close,
   stays bare: a round of paper on paper wouldn't show.) */
.k-round, .k-chip--round {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: var(--k-paper); color: var(--k-ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--k-ink-1) 16%, var(--k-paper)), 0 6px 10px -4px color-mix(in srgb, var(--k-ink-1) 30%, transparent);
  transition: transform 140ms var(--k-ease-quart), box-shadow 140ms var(--k-ease-quart), opacity 200ms var(--k-ease-quart);
}
.k-round svg, .k-chip--round svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.k-round--x svg { width: 22px; height: 22px; stroke-width: 2.6; rotate: 45deg; }
.k-round:active, .k-chip--round:active, .k-chip--round[aria-expanded="true"] { transform: translateY(3px); box-shadow: 0 0 0 color-mix(in srgb, var(--k-ink-1) 16%, var(--k-paper)); }
@media (hover: hover) and (pointer: fine) { .k-round:hover, .k-chip--round:hover { background: var(--k-paper); color: var(--k-ink-1); } }
.k-round:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
.k-set {
  position: absolute; top: calc(100% + var(--k-s-2)); right: 0; z-index: 30;
  width: min(300px, calc(100vw - 2 * var(--k-s-4)));
  padding: var(--k-s-3) var(--k-s-4) var(--k-s-2);
  border-radius: var(--k-r-box); background: var(--k-card);
  box-shadow: 0 1px 2px var(--k-shadow), 0 14px 32px -16px var(--k-shadow);
  animation: k-set-in 260ms var(--k-ease-expo);
}
@keyframes k-set-in { from { opacity: 0; translate: 0 -6px; scale: 0.97; } }
.k-set__title { margin: 0 0 var(--k-s-1); font: 400 var(--k-t-name) / 1.2 var(--k-font-head); color: var(--k-ink-head); }
/* on a gift someone sent: report it, block whoever sent it (js/ui.js giftKeys), under a hairline */
.k-set__gift { display: grid; gap: var(--k-s-1); margin-top: var(--k-s-2); padding: var(--k-s-3) 0 var(--k-s-2); border-top: 1px solid var(--k-line, color-mix(in srgb, var(--k-ink-1) 10%, transparent)); }
.k-set__gift .k-row { margin: 0; }
.k-set__gift .k-key { width: 100%; }
.k-set__sub { margin: 0; font: 600 var(--k-t-micro) / 1.3 var(--k-font-ui); color: var(--k-ink-4); }
.k-set__ask { margin: 0 0 var(--k-s-1); font: 500 var(--k-t-body) / 1.4 var(--k-font-ui); color: var(--k-ink-2); text-wrap: pretty; }
/* a gift that isn't opened here (reported, or from someone blocked): a few words in the middle, and the way out */
/* Carrying on where you left off (js/resume.js; asked by createGame in js/ui.js): over everything, the kitchen misted
   behind it; one blue key across, plain words under it. While the dish is played back it's the plain ground and one bar. */
.k-resume { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: var(--k-s-5); background: color-mix(in srgb, var(--k-ground) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: opacity 320ms var(--k-ease-soft), background-color 200ms linear; }
.k-resume.is-working { background: var(--k-ground); }
.k-resume.is-leaving { opacity: 0; pointer-events: none; }
.k-resume__card { display: grid; justify-items: center; gap: var(--k-s-4); width: min(320px, 100%); text-align: center; }
.k-resume__card > * { animation: k-rise 480ms var(--k-ease-expo) backwards; }
.k-resume__title { margin: 0; font: 400 24px / 1.2 var(--k-font-head); color: var(--k-ink-head); letter-spacing: -0.01em; }
.k-resume__card > .k-row { width: 100%; }
.k-resume__card > .k-row > .k-key--go { width: 100%; }
.k-resume__card > .k-row--meter { margin-top: var(--k-s-2); }
@media (prefers-reduced-motion: reduce) { .k-resume { transition: none; } .k-resume__card > * { animation: none; } }
.k-notice { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: var(--k-s-2); padding: var(--k-s-5); text-align: center; background: var(--k-ground); }
.k-notice h1 { margin: 0; font: 400 26px / 1.2 var(--k-font-head); color: var(--k-ink-head); }
.k-notice p { margin: 0 0 var(--k-s-3); max-width: 30ch; font: 500 var(--k-t-body) / 1.45 var(--k-font-ui); color: var(--k-ink-3); }
.k-switch { display: flex; align-items: center; gap: var(--k-s-3); min-height: 56px; padding: var(--k-s-2) 0; cursor: pointer; }
.k-switch__words { display: grid; gap: 2px; flex: 1; }
.k-switch__name { font: 600 var(--k-t-body) / 1.3 var(--k-font-ui); color: var(--k-ink-1); }
.k-switch__more { font: 500 var(--k-t-micro) / 1.35 var(--k-font-ui); color: var(--k-ink-3); }
/* the switch: a soft pill, its knob sliding over to the blue when it's on */
.k-switch input {
  appearance: none; flex: none; position: relative; margin: 0;
  width: 46px; height: 28px; border-radius: var(--k-r-pill);
  background: var(--k-tile-on); cursor: pointer;
  transition: background 200ms var(--k-ease-quart);
}
.k-switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--k-paper); box-shadow: 0 1px 3px var(--k-shadow);
  transition: translate 240ms var(--k-ease-expo);
}
.k-switch input:checked { background: var(--k-accent); }
.k-switch input:checked::after { translate: 18px 0; }
.k-switch input:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
/* the terms, read over the dish in a sheet (js/ui.js termsSheet): before the first gift, with "Agree and continue"
   across and "Not now" under it */
.k-terms-sheet {
  width: min(560px, calc(100vw - 2 * var(--k-s-4))); height: min(720px, calc(100svh - 2 * var(--k-s-5)));
  padding: 0 0 var(--k-s-4); border: 0; border-radius: var(--k-r-box); background: var(--k-ground);
  box-shadow: 0 12px 40px var(--k-shadow); display: grid; grid-template-rows: 1fr auto; overflow: hidden;
}
.k-terms-sheet:not([open]) { display: none; }
.k-terms-sheet::backdrop { background: color-mix(in srgb, var(--k-ink-1) 28%, transparent); }
.k-terms-sheet iframe { width: 100%; height: 100%; border: 0; background: var(--k-ground); }
.k-terms-sheet .k-row { margin: var(--k-s-3) var(--k-s-4) 0; }
.k-terms-sheet .k-row .k-key { width: 100%; }
/* friends on the sending step (js/ui.js addSending): "Put it in a friend's fridge", a chip each, and Edit under them */
.k-pals { display: grid; justify-items: center; gap: var(--k-s-2); width: min(520px, 100%); }
.k-pals[hidden] { display: none; }
.k-pals .k-row { margin: 0; }
.k-pals > .k-row { width: 100%; }
.k-pals > .k-row .k-key { width: 100%; }
.k-pals__ask { margin: 0; font: 600 var(--k-t-micro) / 1.3 var(--k-font-ui); color: var(--k-ink-4); }
.k-pals__list { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--k-s-2); }
.k-pal {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--k-s-3); border: 0; border-radius: var(--k-r-pill);
  background: var(--k-paper); color: var(--k-ink-1); box-shadow: 0 1px 2px var(--k-shadow), 0 6px 14px -8px var(--k-shadow);
  font: 600 var(--k-t-body) / 1 var(--k-font-ui); white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--k-ease-quart), background 180ms var(--k-ease-quart);
}
.k-pal:active:not(:disabled) { transform: scale(0.96); }
.k-pal:disabled { cursor: default; }
.k-pal.is-done { background: var(--k-sage-l, #e3eedd); }
.k-pal__x { font-size: 18px; line-height: 1; color: var(--k-ink-3); margin-right: -4px; }
.k-pal:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 2px; }
.k-pals__edit { min-height: 28px; padding: 0 var(--k-s-2); border: 0; background: none; cursor: pointer; font: 600 var(--k-t-micro) / 1 var(--k-font-ui); color: var(--k-ink-4); text-decoration: underline; text-underline-offset: 3px; }
.k-linkbox[hidden], .k-row[hidden] { display: none; }
/* Sign in with Apple (js/signin.js): Apple's own look, black with the apple and the system's font, as tall as a big key */
.k-apple {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; height: 44px; padding: 0 var(--k-s-4);
  border: 0; border-radius: var(--k-r-key); background: #000; color: #fff; cursor: pointer;
  font: 500 16px / 1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent; transition: opacity 160ms var(--k-ease-quart), transform 140ms var(--k-ease-quart);
}
.k-apple svg { width: 17px; height: 17px; margin-top: -3px; fill: currentColor; }
.k-apple:active { transform: translateY(1px); }
.k-apple:disabled { opacity: 0.55; cursor: progress; }
.k-apple:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
/* the first open's question: just the key on the kitchen at its foot, and "Not now" under it (no card) */
.k-hello {
  position: fixed; z-index: 60; left: 50%; bottom: max(var(--k-s-4), env(safe-area-inset-bottom));
  /* (narrow enough to keep clear of the home's menu tab in the bottom right corner, which reaches 78px in) */
  width: min(216px, calc(100vw - 160px)); translate: -50% 20px; opacity: 0;
  display: grid; gap: 2px; justify-items: center;
  transition: translate 460ms var(--k-ease-expo), opacity 300ms var(--k-ease-quart);
}
.k-hello.is-in { translate: -50% 0; opacity: 1; }
.k-hello .k-apple { padding: 0 var(--k-s-3); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, 0.45); }
.k-hello__later {
  min-height: 36px; padding: 0 var(--k-s-3); border: 0; background: none; cursor: pointer;
  font: 600 16px / 1 var(--k-font-ui); color: var(--k-ink-2);   /* (as big as the key's own words over it) */
  text-shadow: 0 0 6px var(--k-ground), 0 0 12px var(--k-ground);
}
.k-hello__later:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 2px; border-radius: var(--k-r-key); }
@media (prefers-reduced-motion: reduce) { .k-hello { transition: opacity 200ms linear; translate: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .k-set { animation: none; } .k-switch input, .k-switch input::after { transition: none; } }

/* ── The prompt: a till receipt, printed out of the top edge of the screen at each step ── */
/* (its torn foot: small uneven teeth, 0–5px deep, the one tear for every receipt) */
:root { --k-tear: polygon(0 0, 100% 0, 100% calc(100% - 3px), 97.6% calc(100% - 3.3px), 95.8% calc(100% - 1.8px), 94.0% calc(100% - 0.2px), 91.3% calc(100% - 0.5px), 88.6% calc(100% - 0.2px), 86.4% calc(100% - 4.7px), 83.3% calc(100% - 4.9px), 81.6% calc(100% - 0.4px), 79.6% calc(100% - 1.5px), 75.9% calc(100% - 2.9px), 72.6% calc(100% - 2.7px), 70.9% calc(100% - 1.0px), 67.5% calc(100% - 1.6px), 64.4% calc(100% - 1.5px), 60.7% calc(100% - 1.2px), 57.6% calc(100% - 4.4px), 54.1% calc(100% - 4.9px), 52.2% calc(100% - 3.8px), 50.2% calc(100% - 0.2px), 46.9% calc(100% - 2.9px), 43.0% calc(100% - 3.5px), 39.9% calc(100% - 2.3px), 36.1% calc(100% - 0.7px), 32.7% calc(100% - 3.5px), 29.5% calc(100% - 1.2px), 27.1% calc(100% - 3.3px), 25.5% calc(100% - 0.8px), 23.6% calc(100% - 3.8px), 21.6% calc(100% - 2.0px), 17.8% calc(100% - 2.2px), 14.7% calc(100% - 1.2px), 10.9% calc(100% - 2.1px), 8.4% calc(100% - 1.4px), 6.4% calc(100% - 1.2px), 4.2% calc(100% - 2.9px), 1.9% calc(100% - 2.1px), 0 calc(100% - 2px)); }
.k-quest {
  position: fixed; z-index: 15;
  top: 0; left: 50%;
  /* (the same width at every step, as wide as fits between the corner keys with room to breathe: 16px in from the screen,
     the key, 16px to the paper, the paper, and the same again on the other side. One receipt, not a new one each time) */
  width: min(380px, calc(100% - 2 * (var(--k-s-4) + 32px + var(--k-s-4))));
  translate: -50% 0;
  display: flex; flex-direction: column; align-items: stretch;
  padding: var(--k-s-3) var(--k-s-5) 12px;
  background: var(--k-paper);
  clip-path: var(--k-tear);
  filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--k-ink-1) 8%, transparent)) drop-shadow(0 6px 10px color-mix(in srgb, var(--k-ink-1) 7%, transparent));
  text-align: center; pointer-events: none;
}
/* (the slot it came out of: a breath of shade along the top) */
.k-quest::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(color-mix(in srgb, var(--k-ink-1) 9%, transparent), transparent); }
.k-quest[hidden] { display: none; }
.k-quest.is-popping { animation: k-pop 640ms var(--k-ease-expo) backwards; }
@keyframes k-pop { from { transform: translateY(-105%); } }
/* the first line: the step's sticker, then its title */
.k-quest__pill { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; }
.k-quest__badge {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--k-tile);
}
.k-quest__badge { padding: 0; border: 0; color: inherit; font: inherit; }
/* (pressable, it does the step: it tips toward you a little under a finger) */
.k-quest__badge:not(:disabled) { cursor: pointer; pointer-events: auto; transition: scale 160ms var(--k-ease-quart), rotate 240ms var(--k-ease-expo); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) and (pointer: fine) { .k-quest__badge:not(:disabled):hover { rotate: -6deg; } }
.k-quest__badge:not(:disabled):active { scale: 0.9; }
.k-quest__badge:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 2px; }
.k-quest__badge .k-icon { width: 24px; height: 24px; }
.k-quest.is-popping .k-quest__badge .k-icon { animation: k-badge 700ms var(--k-ease-expo) 200ms backwards; }
@keyframes k-badge { from { transform: scale(0.4) rotate(-20deg); opacity: 0; } }
.k-quest__title {
  margin: 0; min-width: 0;
  font-family: var(--k-font-head); font-weight: 400; color: var(--k-ink-head);
  font-variation-settings: "SOFT" 100, "opsz" 48;
  font-size: 19px; line-height: 1.15; letter-spacing: -0.01em;
  /* (her ask, 2026-11-06: the same 9px from the sticker always, and the first line full, what's left over on the
     second. Balanced, the two lines came out short and sat centred in the title's full width, so the gap to the
     sticker and the right edge both grew. On one line the title's as wide as its words and the pair is centred) */
  text-wrap: wrap; text-align: left;
}
/* what to do: the second line, printed under a dashed rule */
/* (room round the rule: a clear 12px under the round badge, which hangs ~11px below the title's baseline, so the rule sits
   ~23px under the words themselves; and about as much again under it. The message is two lines tall at every step, its
   words centred in them, so the receipt is the same length whether a step says a line or two) */
.k-quest__do {
  display: grid; align-content: center;
  margin: 12px 0 0; padding-top: 6px;
  min-height: calc(2.8em + 6px + 1.5px);
  border-top: 1.5px dashed color-mix(in srgb, var(--k-ink-1) 22%, transparent);
  font-size: 12.5px; font-weight: 500; line-height: 1.4; color: var(--k-ink-4);
  text-align: center; text-wrap: balance;
}

/* ── The tray: the step's controls, under the scene ── */
.k-tray {
  position: fixed; z-index: 15;
  left: 50%; bottom: max(var(--k-tray-bottom), env(safe-area-inset-bottom));
  width: min(720px, calc(100% - 2 * var(--k-s-4)));
  translate: -50% 0;
  margin: 0; padding: 0;
}
.k-tray[hidden], .k-stage[hidden] { display: none; }
.k-stage { display: grid; justify-items: center; gap: var(--k-s-4); }
.k-stage > * { animation: k-rise 480ms var(--k-ease-expo) backwards; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes k-rise { from { opacity: 0; transform: translateY(14px); } }
.k-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--k-s-3); }
/* (a row of tiles lines up along their tops, so a name that runs to two lines hangs below the rest) */
.k-row:has(> .k-tile) { align-items: flex-start; }
.k-tip { margin: 0; font-size: var(--k-t-body); font-weight: 600; line-height: 1.45; color: var(--k-ink-3); text-align: center; }

/* ── The first choice: asked in the middle of the screen, over a mist that lifts once it's made ── */
.k-mist {
  position: fixed; inset: 0; z-index: 14; pointer-events: none;
  background: color-mix(in srgb, var(--k-ground) 30%, transparent);
  -webkit-backdrop-filter: blur(2.5px); backdrop-filter: blur(2.5px);
  /* (taken off the page altogether once it's lifted, not only faded to nothing: a blur of the whole screen that's still
     there at no opacity can still be worked out every frame, under every step of the dish) */
  opacity: 0; visibility: hidden; transition: opacity 700ms var(--k-ease-soft), visibility 0s linear 700ms;
}
body.k-picking .k-mist { opacity: 1; visibility: visible; transition: opacity 700ms var(--k-ease-soft), visibility 0s; }
.k-quest, .k-tray { transition: top 600ms var(--k-ease-expo), bottom 600ms var(--k-ease-expo), translate 600ms var(--k-ease-expo); }
/* (one receipt in the middle, the prompt's own paper but whole: square, torn at the foot; the step's title and what to do
   across its top, ruled off by the prompt's dashed line, then the choices and Start, and a till line at the end. The tear
   clips the paper, so its shadow is the tray's, which follows the clipped edge; the title pill steps aside, kept for screen readers) */
body.k-picking .k-tray {
  bottom: 50%; translate: -50% 50%; width: max-content; max-width: calc(100% - 2 * var(--k-s-4));
  filter: drop-shadow(0 1px 1px color-mix(in srgb, var(--k-ink-1) 8%, transparent)) drop-shadow(0 12px 22px color-mix(in srgb, var(--k-ink-1) 10%, transparent));
}
body.k-picking .k-tray .k-stage {
  position: relative; justify-items: stretch; gap: 14px;
  padding: 20px var(--k-s-5) 20px;
  background: var(--k-card); clip-path: var(--k-tear);
}
/* (the till line, printed last: two dots a side, so even the two-tile card, 180px across, never has to widen for it) */
body.k-picking .k-tray .k-stage::after {
  content: "· · Let’s get cookin’ · ·"; content: "· · Let’s get cookin’ · ·" / "";
  text-transform: uppercase;
  margin-top: -2px; text-align: center;
  font: 10px/1 var(--k-font-mono); letter-spacing: 0.08em; color: color-mix(in srgb, var(--k-ink-1) 32%, transparent);
  animation: k-rise 480ms var(--k-ease-expo) 250ms backwards;
}
body.k-picking .k-quest { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
/* the card's head: the title, then what to do under it, then the prompt's dashed rule, the same space either side of it
   (the words' own line leaves about 3px under them, so the padding is that much less than the card's gap under the rule) */
.k-pick {
  display: flex; align-items: flex-start; gap: var(--k-s-3);
  padding-bottom: 11px;
  border-bottom: 1.5px dashed color-mix(in srgb, var(--k-ink-1) 22%, transparent);
}
.k-pick__words { display: grid; gap: 2px; min-width: 0; }
.k-pick__title { margin: 0; font: 400 19px/1.15 var(--k-font-head); color: var(--k-ink-head); letter-spacing: -0.01em; text-align: left; text-wrap: balance; }
.k-pick .k-tip { text-align: left; font-size: 12.5px; font-weight: 500; line-height: 1.4; color: var(--k-ink-4); }
.k-tray:focus { outline: none; }
/* (over the kitchen the card can be put away: a small x at the end of its top line, its arms ending where the dashed rule does,
   and centred on the title's line) */
.k-pick__close {
  flex: none; align-self: flex-start; margin: -10px -14px 0 auto;
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none;
  color: var(--k-ink-3); cursor: pointer;
  transition: color 180ms var(--k-ease-quart);
}
/* (just the cross, with long arms: the plus turned a quarter of the way round, drawn big and a little finer) */
.k-pick__close .k-glyph { width: 28px; height: 28px; stroke-width: 2; rotate: 45deg; }
@media (hover: hover) and (pointer: fine) { .k-pick__close:hover { color: var(--k-ink-1); } }
.k-pick__close:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .k-mist, .k-quest, .k-tray { transition: none; } }

/* ── The icons: flat little stickers, each in its own pastels (js/ui.js, ICONS) ── */
.k-icon { display: block; flex: none; overflow: visible; filter: drop-shadow(0 1px 1.5px var(--k-shadow)); }
.k-icon .d { fill: var(--d, var(--k-tone-d)); }
.k-icon .m { fill: var(--m, var(--k-tone-m)); }
.k-icon .l { fill: var(--l, var(--k-tone-l)); }
.k-icon .k { fill: var(--k, var(--k-tone-l)); }
.k-icon .x { fill: var(--x, var(--k-tone-d)); }
.k-icon .y { fill: var(--y, var(--k-tone-m)); }
.k-icon .w { fill: var(--k-cream); }
/* a shade laid over a part, so it darkens whatever colour that part's been given (an iced edge, a broth's rim) */
.k-icon .sh { fill: var(--k-ink-1); opacity: 0.14; }
.k-icon .s, .k-icon .sk, .k-icon .sw, .k-icon .sq { fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* a noodle: a thicker strand, in the sticker's own colour (--k) */
.k-icon .sn { fill: none; stroke: var(--k, var(--k-tone-m)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.k-icon .s { stroke: var(--d, var(--k-tone-d)); }
.k-icon .sk { stroke: var(--m, var(--k-tone-m)); }
.k-icon .sq { stroke: var(--k, var(--k-tone-m)); }
.k-icon .sw { stroke: var(--k-cream); }
.k-icon .bk * { fill: var(--k-paper); stroke: var(--k-paper); stroke-width: 4.5; stroke-linejoin: round; stroke-linecap: round; }
.k-glyph { display: block; flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── The logo: a sky-blue two-slice toaster sticker with the name on its front (js/toaster.js). Sized in em ── */
.tl { display: block; flex: none; overflow: visible; filter: drop-shadow(0 1px 1.5px var(--k-shadow)) drop-shadow(0 0.1em 0.2em color-mix(in srgb, var(--k-ink-1) 7%, transparent)); }
.tl .bk * { fill: var(--k-paper); stroke: var(--k-paper); stroke-width: 4.5; stroke-linejoin: round; }
/* the body's three tones, front to top, the way the light falls over its rounded top edge; the end in its own shade
   (with a hair of its own colour round it, so it closes over its seam with the front) */
.tl .front  { fill: var(--k-sky); }
.tl .edge   { fill: color-mix(in oklch, var(--k-sky) 50%, var(--k-sky-l)); }
.tl .top    { fill: var(--k-sky-l); }
.tl .band   { fill: var(--k-sky-d); }
.tl .end    { fill: color-mix(in oklch, var(--k-sky) 60%, var(--k-sky-d)); stroke: color-mix(in oklch, var(--k-sky) 60%, var(--k-sky-d)); stroke-width: 0.6; stroke-linejoin: round; }
.tl .band-e { fill: color-mix(in oklch, var(--k-sky-d) 80%, var(--k-ink-3)); stroke: color-mix(in oklch, var(--k-sky-d) 80%, var(--k-ink-3)); stroke-width: 0.6; stroke-linejoin: round; }
.tl .slot, .tl .groove { fill: color-mix(in oklch, var(--k-sky-d) 45%, var(--k-ink-2)); }
.tl .crust  { fill: var(--k-peach-d); }
.tl .side   { fill: color-mix(in oklch, var(--k-peach-d) 80%, var(--k-cocoa-d)); }
.tl .crumb  { fill: color-mix(in oklch, var(--k-butter) 70%, var(--k-peach-d)); }
.tl .lever  { fill: var(--k-steel); }
.tl .lever-s { fill: var(--k-steel-d); }
/* the name, printed square on the front: Capriola in the titles' brown, its weight a stroke of its own colour */
.tl .name { font-family: Capriola, var(--k-font-logo); fill: var(--k-ink-head); stroke: var(--k-ink-head); stroke-linejoin: round; paint-order: stroke fill; text-anchor: middle; letter-spacing: 0.01em; user-select: none; -webkit-user-select: none; }

/* ── The tiles: a soft rounded square holding a sticker, its name under it ── */
/* (a tile a dish takes out of the choice, hidden: its own display would otherwise keep it showing — the strawberry
   matcha's hot ways, which made a hot drink poured from the iced drink's hidden milk bottle) */
.k-tile[hidden] { display: none !important; }
.k-tile {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; gap: var(--k-s-2);
  width: 84px; margin: 0; padding: 0;
  background: none; border: 0;
  font: 600 var(--k-t-micro) / 1.15 var(--k-font-ui);
  color: var(--k-ink-3); text-align: center;
  cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent;
  animation: k-rise 480ms var(--k-ease-expo) backwards; animation-delay: calc(var(--i, 0) * 50ms);
  transition: color 200ms var(--k-ease-quart);
}
.k-tile input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.k-tile__face {
  position: relative; display: grid; place-items: center;
  width: 76px; height: 76px;
  border-radius: var(--k-r-tile);
  background: var(--k-tile);
  transition: background 200ms var(--k-ease-quart), box-shadow 200ms var(--k-ease-quart), transform 240ms var(--k-ease-expo);
}
.k-tile .k-icon { width: 46px; height: 46px; transform: rotate(var(--tilt, 0deg)); transition: transform 420ms var(--k-ease-expo), opacity 240ms var(--k-ease-quart); }
@media (hover: hover) and (pointer: fine) {
  .k-tile:hover:not(.is-done):not(:disabled):not(.is-on):not(:has(input:checked)) .k-tile__face { background: var(--k-tile-on); }
  .k-tile:hover:not(.is-done):not(:disabled) .k-icon { transform: rotate(calc(var(--tilt, 0deg) * -1)) scale(1.08); }
  .k-tile:hover:not(.is-done):not(:disabled) { color: var(--k-ink-1); }
}
.k-tile:active:not(.is-done) .k-tile__face, .k-tile.is-busy .k-tile__face { transform: scale(0.94); }
.k-tile:has(input:checked), .k-tile.is-on { color: var(--k-accent-ink); }
/* the pick: filled sky like a key, a darker lip along its bottom */
.k-tile:has(input:checked) .k-tile__face, .k-tile.is-on .k-tile__face { background: var(--k-sky); box-shadow: inset 0 -4px 0 var(--k-accent), 0 8px 18px -10px var(--k-shadow); }
.k-tile:has(input:checked) .k-icon, .k-tile.is-on .k-icon { transform: rotate(0deg) scale(1.06); }
/* a first choice's tile, in its own colour (--hue): a pale wash of it, the pick filled with it on a deeper lip */
.k-tile--hued .k-tile__face { background: oklch(from var(--hue) 0.955 calc(c * 0.4) h); }
@media (hover: hover) and (pointer: fine) {
  .k-tile--hued:hover:not(.is-done):not(:disabled):not(.is-on):not(:has(input:checked)) .k-tile__face { background: oklch(from var(--hue) 0.925 calc(c * 0.55) h); }
}
.k-tile--hued:has(input:checked), .k-tile--hued.is-on { color: oklch(from var(--hue) 0.47 calc(c * 0.9) h); }
.k-tile--hued:has(input:checked) .k-tile__face, .k-tile--hued.is-on .k-tile__face { background: oklch(from var(--hue) 0.885 calc(c * 0.75) h); box-shadow: inset 0 -4px 0 oklch(from var(--hue) 0.74 c h), 0 8px 18px -10px var(--k-shadow); }
.k-tile--hued .k-stamp { background: oklch(from var(--hue) 0.47 calc(c * 0.9) h); }
/* a tile that stays grey until it's picked (the sides): its own colour comes only with the pick */
.k-tile--hued.k-tile--rest:not(.is-on):not(:has(input:checked)) .k-tile__face { background: var(--k-tile); }
@media (hover: hover) and (pointer: fine) {
  .k-tile--hued.k-tile--rest:hover:not(.is-done):not(:disabled):not(.is-on):not(:has(input:checked)) .k-tile__face { background: var(--k-tile-on); }
}
/* the sides to choose from: all six in one line, never scrolling. On a wide, tall screen the tiles are a little
   bigger than the usual; on a phone they shrink to share the width (below), the names set small to fit */
.k-row--sides { flex-wrap: nowrap; gap: var(--k-s-4); }
@media (min-width: 720px) and (min-height: 501px) {
  .k-row--sides > .k-tile { flex: 0 0 84px; width: 84px; }
  .k-row--sides .k-tile__face { width: 84px; height: 84px; aspect-ratio: auto; }
  .k-row--sides .k-tile .k-icon { width: 56px; height: 56px; }
}
@media (max-width: 719px) and (min-height: 501px) {
  .k-row.k-row--sides:has(> .k-tile) { gap: var(--k-s-2); }
  .k-row--sides > .k-tile { flex: 1 1 0; width: auto; max-width: 56px; }
  .k-row--sides .k-tile__face { width: 100%; height: auto; aspect-ratio: 1; }
  .k-row--sides .k-tile .k-icon { width: clamp(28px, 62%, 36px); height: auto; }
  .k-row--sides .k-tile__name { font-size: 10px; letter-spacing: -0.01em; white-space: nowrap; }
}
/* a colour tile (the face is the colour itself): edged in white like a sticker, the pick ringed outside it; the
   row of them is spaced wide enough for those rings, the names clear of them, and the key under them well clear */
.k-row--swatches { column-gap: var(--k-s-5); }
.k-tile.k-tile--swatch { gap: 18px; }
.k-stage > .k-row--swatches { margin-bottom: var(--k-s-3); }
.k-tile--swatch .k-tile__face { box-shadow: 0 0 0 4px var(--k-paper), 0 6px 14px -6px var(--k-shadow); }
.k-tile--swatch:has(input:checked) .k-tile__face { box-shadow: 0 0 0 4px var(--k-paper), 0 0 0 6px var(--k-accent), 0 8px 18px -8px var(--k-shadow); }
.k-stamp {
  position: absolute; top: -6px; right: -6px;
  display: none; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--k-accent-ink); color: var(--k-ink-inv);
  box-shadow: 0 0 0 var(--k-ring) var(--k-paper);   /* the same white edge as the prompt's badge */
  animation: k-stamp 420ms var(--k-ease-expo) backwards;
}
.k-stamp .k-glyph { width: 11px; height: 11px; stroke-width: 4.5; }
.k-tile:has(input:checked) .k-stamp, .k-tile.is-on .k-stamp, .k-tile.is-done .k-stamp { display: grid; }
@keyframes k-stamp { from { transform: scale(0.3); opacity: 0; } }
.k-tile.is-done { cursor: default; color: var(--k-ink-4); }
.k-tile.is-done .k-tile__face { background: transparent; box-shadow: inset 0 0 0 var(--k-stroke) var(--k-tile-on); }
.k-tile.is-done .k-icon { opacity: 0.4; transform: rotate(0deg) scale(0.86); }
.k-tile.is-done .k-stamp { background: var(--k-tone-m); }
.k-tile:disabled { cursor: default; opacity: 0.45; }
.k-tile:has(input:focus-visible) .k-tile__face, .k-tile:focus-visible .k-tile__face { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
.k-tile:focus-visible { outline: none; }
/* a row of smaller tiles, for a step with many tools */
.k-row--small { gap: var(--k-s-2); }
.k-row--small .k-tile { width: 62px; gap: 6px; font-size: var(--k-t-micro); }
.k-row--small .k-tile__face { width: 54px; height: 54px; border-radius: 17px; }
.k-row--small .k-tile .k-icon { width: 32px; height: 32px; }
.k-row--small .k-stamp { width: 18px; height: 18px; top: -5px; right: -5px; }
/* a count on a tile (how many are in) */
.k-count {
  position: absolute; bottom: -6px; right: -6px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--k-r-pill);
  display: grid; place-items: center;
  background: var(--k-paper); color: var(--k-accent-ink);
  font: 700 var(--k-t-micro) var(--k-font-ui);
  box-shadow: 0 0 0 1.5px var(--k-accent);
}
.k-count:empty { display: none; }

/* ── The keys: a light-blue glazed tile, top half paler, on a soft edge it presses into ── */
.k-key {
  --top: var(--k-key-top); --bot: var(--k-key-bot);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--k-s-2);
  height: 36px; min-width: 120px; padding: 0 var(--k-s-3); margin: 0 0 3px;
  border: 0; border-radius: var(--k-r-key);
  background: linear-gradient(180deg, var(--top) 50%, var(--bot) 50%);
  box-shadow: 0 3px 0 var(--k-key-edge);
  color: var(--k-key-ink);
  font: 600 var(--k-t-body) / 1 var(--k-font-ui);
  white-space: nowrap; cursor: pointer; text-decoration: none;
  user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform 140ms var(--k-ease-quart), box-shadow 140ms var(--k-ease-quart), filter 180ms var(--k-ease-quart), opacity 200ms var(--k-ease-quart);
}
.k-key .k-icon { width: 22px; height: 22px; margin-left: -4px; }
.k-key--go { --top: var(--k-key-go-top); --bot: var(--k-key-go-bot); }
.k-key--butter { --top: var(--k-key-butter-top); --bot: var(--k-key-butter-bot); --k-key-edge: var(--k-key-butter-edge); --k-key-ink: var(--k-key-butter-ink); }
.k-key--big { height: 44px; min-width: 140px; padding: 0 var(--k-s-4); font-size: var(--k-t-body); }
.k-key--big .k-icon { width: 28px; height: 28px; }
.k-key--quiet { min-width: 0; background: transparent; box-shadow: none; color: var(--k-ink-3); padding: 0 var(--k-s-3); }
.k-key--round { width: 36px; padding: 0; }
/* two keys that are one choice (eat it now, send it to someone): side by side they share a width, the longer label's.
   The paired-keys rule: two primary keys are never the same colour and never stacked: blue (`go`) on the left,
   butter on the right, built by `choicePair` in js/ui.js (`.k-row--even.k-row--side` holds them side by side on a phone too) */
@media (width > 600px) {
  .k-row--even { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
}
/* (a main key on its own is the width of one key of a pair, not wider: the pair is 480px at most, the gap between its two
   keys taken off, halved; on an upright phone every main key runs across, below) */
@media (width > 600px) {
  .k-stage:not(:has(.k-tile)) > .k-row:not(.k-row--side):not(.k-row--save) > .k-key:not(.k-key--quiet):only-child { width: calc((480px - var(--k-s-3)) / 2); }
}
/* (and a pair that stays side by side even on a phone: a step's key and taking a photo of it, half each) */
.k-stage > .k-row.k-row--side { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: min(480px, 100%); }
.k-stage > .k-row--side > .k-key { min-width: 0; }
/* (on a narrow phone, where a longer label won't fit beside its sticker, each key of the pair stands its sticker
   over its words: both the same, so the sticker's always the same way from its words) */
@media (max-width: 420px) {
  .k-stage > .k-row--side > .k-key { flex-direction: column; gap: 4px; white-space: normal; text-wrap: balance; height: auto; min-height: 64px; padding: var(--k-s-2) var(--k-s-2); line-height: 1.15; }
  .k-stage > .k-row--side > .k-key .k-icon { margin: 0; }
}
/* a wide key and a square one beside it, the same height (saving a photo: for the fridge, or to the device) */
.k-stage > .k-row.k-row--save { display: grid; grid-template-columns: 1fr auto; width: min(420px, 100%); }
.k-key--icon { min-width: 0; aspect-ratio: 1; padding: 0; }
.k-key--icon .k-glyph { width: 22px; height: 22px; stroke-width: 3; }
/* The camera: a round key with just its picture, beside a step's main key (her ask, 2026-11-26: "change the take photo
   yellow cta to just a circle icon button for camera"). The same white round of paper as the corner keys (.k-round), as
   tall as the key it's beside, so it reads as a tool and the coloured key stays the one thing to press. js/ui.js camKey */
.k-cam {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; margin: 0 0 3px; padding: 0; border: 0; border-radius: 50%;
  background: var(--k-paper); color: var(--k-ink-2); cursor: pointer; -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--k-ink-1) 16%, var(--k-paper)), 0 6px 10px -4px color-mix(in srgb, var(--k-ink-1) 30%, transparent);
  transition: transform 140ms var(--k-ease-quart), box-shadow 140ms var(--k-ease-quart);
}
.k-cam .k-glyph { width: 21px; height: 21px; stroke-width: 2.6; }
.k-cam .k-icon { width: 24px; height: 24px; }
.k-cam:active { transform: translateY(3px); box-shadow: 0 0 0 color-mix(in srgb, var(--k-ink-1) 16%, var(--k-paper)); }
.k-cam:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .k-cam:hover { color: var(--k-ink-1); } }
/* (the main key keeps the width it has on its own, the camera after it; on a phone the key runs across, the camera at its end) */
.k-stage > .k-row.k-row--cam { flex-wrap: nowrap; }
@media (width > 600px) { .k-stage > .k-row--cam > .k-key:not(.k-key--quiet) { width: calc((480px - var(--k-s-3)) / 2); } }
@media (max-width: 600px) {
  .k-stage > .k-row--cam > .k-cam { width: 52px; height: 52px; }
  .k-stage > .k-row--cam > .k-cam .k-glyph { width: 26px; height: 26px; }
  .k-stage > .k-row--cam > .k-cam .k-icon { width: 32px; height: 32px; }
}
@media (hover: hover) and (pointer: fine) {
  .k-key:hover:not(:disabled) { filter: brightness(0.97); }
  .k-key--quiet:hover:not(:disabled) { filter: none; color: var(--k-ink-1); }
}
.k-key:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--k-key-edge); }
.k-key--quiet:active:not(:disabled) { transform: scale(0.95); }
.k-key:disabled { opacity: 0.4; cursor: default; }
.k-key:focus-visible { outline: 2px solid var(--k-accent-ink); outline-offset: 3px; }
/* "Do it for me" switched off in the settings (js/ui.js, the `helper` switch): every one of them gone, and a row
   that held only it goes too, so no empty gap is left under the step */
.k-no-helper .k-key--helper, .k-no-helper .k-row:has(> .k-key--helper:only-child) { display: none !important; }
/* on a phone, each step's main keys run the tray's whole width, tall enough for a thumb (the quiet ones,
   "Do it for me", stay small under them) */
@media (max-width: 600px) {
  .k-stage > .k-row:has(> .k-key:not(.k-key--quiet)) { width: 100%; }
  .k-stage > .k-row > .k-key:not(.k-key--quiet) { flex: 1 1 100%; height: 52px; font-size: 16px; }
  .k-stage > .k-row > .k-key:not(.k-key--quiet) .k-icon { width: 28px; height: 28px; }
  /* (the quiet word under them, "Do it for me", in the same size of letters as the key over it: her ask, 2026-11-19) */
  .k-stage > .k-row > .k-key--quiet { font-size: 16px; }
}
/* a count (the cake's candles): a square key either side of what's counted, one less and one more; they stay square
   on a phone too, where a step's other keys run the tray's width (above) */
.k-stage > .k-row--count > .k-key.k-key--icon { flex: none; width: 40px; height: 40px; }
@media (max-width: 600px) { .k-stage > .k-row--count > .k-key.k-key--icon { width: 48px; height: 48px; } }

/* ── The meter: one bar cut out like a sticker (a white edge, a soft shadow under), filling smoothly with the
   blue as the work goes; done, it pops and gets a little white tick at its end. Never a row of pills or a count ── */
.k-row--meter { gap: var(--k-s-3); }
.k-meter { display: flex; padding: 3px; }
.k-meter i {
  position: relative; display: block; flex: none; width: 132px; height: 12px; border-radius: var(--k-r-pill);
  background: var(--k-tile-on); overflow: hidden;
  box-shadow: 0 0 0 3px var(--k-paper), 0 3px 8px -3px var(--k-shadow);
}
.k-meter i::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: var(--k-accent);
  transform-origin: left; transform: scaleX(var(--f, 0));
  transition: transform 200ms var(--k-ease-quart);
}
/* (the tick: a short and a long stroke, turned) */
.k-meter i::after {
  content: ''; position: absolute; right: 9px; top: 42%; width: 3px; height: 6px;
  border: solid var(--k-paper); border-width: 0 2px 2px 0;
  translate: -50% -50%; rotate: 45deg; opacity: 0; transition: opacity 160ms var(--k-ease-quart);
}
.k-meter i.is-full { animation: k-cell-pop 520ms var(--k-ease-expo); }
.k-meter i.is-full::after { opacity: 1; }
@keyframes k-cell-pop { 30% { transform: scale(1.15) rotate(-2deg); } }
.k-meter__n {
  font: 600 var(--k-t-body) var(--k-font-ui); color: var(--k-ink-3); min-width: 3.5em; text-align: left;
  /* the same soft halo of the page as the prompt's line, so it reads over the food */
  text-shadow: 0 0 6px var(--k-ground), 0 0 3px var(--k-ground), 0 0 1px var(--k-ground);
}
@media (prefers-reduced-motion: reduce) { .k-meter i.is-full { animation: none; } }

.k-field { display: grid; gap: 6px; text-align: left; }
.k-field > span { font: 600 var(--k-t-micro) var(--k-font-ui); color: var(--k-ink-4); padding-left: 2px; }
.k-field input, .k-field textarea {
  font: 400 var(--k-t-body) / 1.4 var(--k-font-ui); color: var(--k-ink-1);
  background: var(--k-tile); border: 0; border-radius: var(--k-r-field);
  padding: 9px 12px; resize: none; min-width: 0;
  transition: background 180ms var(--k-ease-quart), box-shadow 180ms var(--k-ease-quart);
}
.k-field input:focus-visible, .k-field textarea:focus-visible { outline: none; background: var(--k-paper); box-shadow: inset 0 0 0 2px var(--k-accent); }
.k-field input::placeholder, .k-field textarea::placeholder { color: var(--k-ink-4); }
.k-error { margin: 0; font-size: var(--k-t-body); font-weight: 600; color: var(--k-ink-3); text-align: center; }
.k-error:empty { display: none; }

/* ── Made: the link with its Copy in one field, and two quiet ways on ── */
.k-linkbox {
  display: flex; align-items: center; gap: var(--k-s-2);
  width: min(520px, 100%);
  padding: 6px 6px 6px var(--k-s-4);
  background: var(--k-paper); border-radius: var(--k-r-key);
  box-shadow: 0 1px 2px var(--k-shadow), 0 14px 32px -16px var(--k-shadow);
}
.k-linkbox input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0; font: var(--k-t-body) var(--k-font-mono); color: var(--k-ink-1); text-overflow: ellipsis; }
.k-linkbox input:focus-visible { outline: none; }
.k-linkbox:has(input:focus-visible) { box-shadow: inset 0 0 0 2px var(--k-accent), 0 14px 32px -16px var(--k-shadow); }

/* a little speech bubble over something in the scene (the note: "Keep the note?"), its tail pointing down at it;
   the page puts it where that is */
.k-bubble {
  position: fixed; z-index: 14; translate: -50% -100%;
  padding: 8px 14px; border-radius: 16px; white-space: nowrap; pointer-events: none;
  background: var(--k-paper); color: var(--k-ink-1); font: 600 var(--k-t-body) / 1.2 var(--k-font-ui);
  box-shadow: 0 1px 2px var(--k-shadow), 0 10px 24px -12px var(--k-shadow);
  opacity: 0; transition: opacity 240ms var(--k-ease-quart);
}
.k-bubble::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; width: 12px; height: 12px;
  translate: -50% 0; rotate: 45deg; border-radius: 0 0 4px 0; background: inherit;
  box-shadow: 3px 3px 6px -4px var(--k-shadow);
}
.k-bubble.is-on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .k-bubble { transition: none; } }

/* the timed steps' bubble (her pick 2026-11-26, "Window, refined"): one disc with a ring at its edge like a timer's
   bezel. White while it counts the seconds to just right; sage with a tick through the just-right window, the ring
   draining again and blinking in its last third; berry with ! and then a fretting !! once it's gone too far. Her
   word on the round's peach tick: it "doesn't look like a success", so just right is green. js/ui.js discTime */
.k-bubble.k-disc {
  width: 56px; height: 56px; padding: 0; border-radius: 50%; isolation: isolate;
  display: grid; place-items: center; transform-origin: 50% 100%;
  font: 400 23px/1 var(--k-font-head); font-variant-numeric: tabular-nums; color: var(--k-ink-head);
  transition: opacity 240ms var(--k-ease-quart), background-color 450ms ease;
}
.k-disc[data-stage="ok"] { background: var(--k-sage-l); }
.k-disc[data-stage="warn"], .k-disc[data-stage="over"] { background: #f1d3cf; }
.k-disc::after { z-index: -1; }
.k-disc > svg.k-disc-ring { position: absolute; inset: 0; width: 56px; height: 56px; rotate: -90deg; fill: none; stroke-width: 3.5; overflow: visible; }
.k-disc .k-disc-track { stroke: #efedea; transition: stroke 450ms ease; }
.k-disc:not([data-stage="count"]) .k-disc-track { stroke: rgba(255, 255, 255, 0.8); }
.k-disc .k-disc-arc { stroke: var(--heat, var(--k-butter-d)); stroke-linecap: round; transition: stroke 450ms ease; }
.k-disc[data-stage="ok"] .k-disc-arc { stroke: var(--k-sage-d); }
.k-disc[data-stage="warn"] .k-disc-arc { stroke: var(--k-berry); }
.k-disc[data-stage="over"] .k-disc-arc { stroke: var(--k-berry-d); }
.k-disc[data-low] .k-disc-arc { animation: k-disc-low 0.5s ease-in-out infinite alternate; }
@keyframes k-disc-low { from { opacity: 1; } to { opacity: 0.3; } }
.k-disc > .k-disc-n, .k-disc > svg.k-disc-ok, .k-disc > b { display: none; grid-area: 1 / 1; position: relative; }
.k-disc[data-stage="count"] > .k-disc-n { display: block; }
.k-disc .k-disc-n.is-step { animation: k-disc-step 260ms var(--k-ease-expo); }
@keyframes k-disc-step { from { transform: translateY(4px); opacity: 0.2; } to { transform: none; opacity: 1; } }
.k-disc > svg.k-disc-ok { width: 24px; height: 24px; overflow: visible; }
.k-disc .k-disc-ok path { fill: none; stroke: #4f6b40; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 20; animation: k-disc-draw 380ms 120ms ease-out backwards; }
@keyframes k-disc-draw { from { stroke-dashoffset: 20; } to { stroke-dashoffset: 0; } }
.k-disc[data-stage="ok"] > svg.k-disc-ok { display: block; }
.k-disc > b { font-weight: 400; font-size: 27px; color: var(--k-berry-d); }
.k-disc[data-stage="warn"] > b, .k-disc[data-stage="over"] > b { display: block; }
.k-disc[data-stage="warn"] > b::after { content: '!'; }
.k-disc[data-stage="over"] > b::after { content: '!!'; }
.k-disc[data-stage="over"] > b { animation: k-disc-fret 0.22s ease-in-out infinite alternate; }
@keyframes k-disc-fret { from { rotate: -5deg; } to { rotate: 5deg; } }
.k-disc.is-pop { animation: k-disc-pop 420ms var(--k-ease-expo); }
@keyframes k-disc-pop { 0% { scale: 0.86; } 55% { scale: 1.07; } 100% { scale: 1; } }
.k-disc > .k-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .k-disc.is-pop, .k-disc .k-disc-n.is-step, .k-disc .k-disc-ok path, .k-disc > b, .k-disc[data-low] .k-disc-arc { animation: none; }
}
/* the line under the scene (on a card's page), and its one key */
.k-hint {
  position: fixed; left: 0; right: 0; z-index: 14;
  bottom: max(var(--k-s-5), env(safe-area-inset-bottom));
  margin: 0; padding: 0 var(--k-s-4);
  display: grid; justify-items: center; gap: var(--k-s-3);
  text-align: center; font-size: var(--k-t-body); font-weight: 600; line-height: 1.45; color: var(--k-ink-3);
}
.k-hint[hidden] { display: none; }

/* made: a burst of the pastels, falling over the scene */
.k-confetti { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.k-confetti i { position: absolute; left: 0; top: 0; border-radius: 2px; will-change: transform, opacity; }
.k-confetti i.is-round { border-radius: 50%; }
/* All gone, the curtain (js/finale.js; her pick, "2 · Curtain" on ending-looks.html, 2026-11-26): the receipt goes up, the
   room closes in on the empty plate like the end of an old film, a round window held on it with the rest dark, and a
   last line comes up in the dark. The window is a box with the dark spread round it as a shadow, scaled from wide open
   (--open, set to reach the screen's furthest corner) down to its size: only a transform moves. Over the scene, under
   the keys (z 15), never in the way of a tap */
.k-curtain { position: fixed; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; visibility: hidden; opacity: 0; transition: opacity 500ms var(--k-ease-soft), visibility 0s linear 500ms; }
.k-curtain.is-on { visibility: visible; opacity: 1; pointer-events: auto; cursor: pointer; transition: opacity 200ms var(--k-ease-soft), visibility 0s; }
.k-curtain__hole { position: absolute; border-radius: 50%; box-shadow: 0 0 0 200vmax color-mix(in srgb, var(--k-ink-1) 97%, transparent); transform: scale(var(--open, 6)); will-change: transform; }
.k-curtain__hole.is-closing { transform: scale(1); transition: transform 1.9s cubic-bezier(0.65, 0, 0.35, 1) 150ms; }
.k-curtain__hole.is-quick { transition-duration: 500ms; transition-delay: 0s; }
/* (closed out: the window shuts on its own middle, by its size so the dark round it stays; then the page's paper colour
   comes over everything, and the home comes up on that same colour. Her note, 2026-11-26: "i dont want it to wait there") */
.k-curtain__hole.is-closing.is-out { transition: width 620ms cubic-bezier(0.55, 0, 0.85, 0.35), height 620ms cubic-bezier(0.55, 0, 0.85, 0.35), left 620ms cubic-bezier(0.55, 0, 0.85, 0.35), top 620ms cubic-bezier(0.55, 0, 0.85, 0.35); }
.k-curtain__fade { position: fixed; inset: 0; z-index: 49; pointer-events: none; background: var(--k-ground); opacity: 0; transition: opacity 480ms var(--k-ease-soft); }
.k-curtain__fade.is-on { opacity: 1; pointer-events: auto; }
.k-curtain__words { position: absolute; left: var(--k-s-5); right: var(--k-s-5); text-align: center; color: var(--k-ground); opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--k-ease-soft), transform 700ms var(--k-ease-expo); }
.k-curtain__words.is-up { opacity: 1; transform: none; }
.k-curtain__words b { display: block; font: 400 31px/1.15 var(--k-font-head); text-wrap: balance; }
.k-curtain__words span { display: block; margin-top: 8px; font: 500 15px/1.35 var(--k-font-ui); opacity: 0.78; text-wrap: balance; }
@media (max-height: 500px) { .k-curtain__words b { font-size: 24px; } .k-curtain__words span { margin-top: 4px; font-size: 13px; } }
/* (the receipt goes up out of the way while the curtain's down; a quiet word under the keys reads light on the dark) */
body.k-curtain-on .k-quest { translate: 0 -140%; }
body.k-curtain-on .k-tray .k-key--quiet { color: color-mix(in srgb, var(--k-ground) 82%, transparent); }
/* (a key asked for on the curtain, a gift's "Add Mina to your fridge", rises in once the line's up) */
.k-stage > .k-row--end { animation: k-rise 560ms var(--k-ease-expo) 2.6s backwards; }
@media (prefers-reduced-motion: reduce) {
  .k-curtain__hole.is-closing, .k-curtain__words { transition: none; }
  .k-stage > .k-row--end { animation: none; }
}

/* phones: smaller tiles, the prompt below the corner chip */
@media (max-width: 719px) {
  .k-corner { top: calc(var(--k-s-4) - 2px); }   /* (36px keys, centred on the receipt's 32px line) */
  .k-quest { top: 0; --k-quest-pad: var(--k-s-3); padding-inline: var(--k-s-4); padding-bottom: 11px; }
  .k-quest__badge { width: 32px; height: 32px; }
  .k-quest__badge .k-icon { width: 22px; height: 22px; }
  .k-quest__title { font-size: 17px; }
  /* (the title row is 40px tall, room for a title that runs to two lines, so the receipt is the same length when one does;
     it starts 12px down, so its middle, 32px down, is the corner keys' middle line, and the 32px sticker sits on it) */
  .k-quest__pill { min-height: 40px; }
  /* (6px under that row, and the sticker 4px up inside it: the same clear 10px under the sticker as before) */
  .k-quest__do { font-size: var(--k-t-micro); margin-top: 6px; padding-top: 5px; min-height: calc(2.8em + 5px + 1.5px); }
  :root { --k-tray-bottom: var(--k-s-5); }
  .k-stage { gap: var(--k-s-3); }
  /* one row, no scroll: tiles share the width, and their faces stay square at whatever size that makes them */
  .k-row:has(> .k-tile) { flex-wrap: nowrap; gap: 14px; max-width: calc(100vw - 2 * var(--k-s-5)); }
  .k-row.k-row--swatches:has(> .k-tile) { gap: 18px; }
  .k-row { gap: var(--k-s-2); }
  .k-tile { flex: 1 1 0; min-width: 0; width: auto; max-width: 92px; gap: 5px; font-size: var(--k-t-micro); }
  .k-tile__face { width: 100%; height: auto; aspect-ratio: 1; border-radius: 16px; }
  .k-tile .k-icon { width: clamp(32px, 62%, 54px); height: auto; }
  /* the first-choice card: less at its sides, the room going to its tiles */
  body.k-picking .k-tray .k-stage { padding-inline: var(--k-s-4); }
  body.k-picking .k-row:has(> .k-tile) { max-width: calc(100vw - 4 * var(--k-s-4)); }
  .k-meter i { width: 116px; }
}

/* short screens: a smaller prompt, so the scene keeps its room */
@media (max-height: 820px) and (min-width: 720px) {
  :root { --k-quest-top: var(--k-s-5); --k-tray-bottom: var(--k-s-6); }
  .k-stage { gap: var(--k-s-3); }
}

/* a short, wide screen (a phone on its side): the prompt goes small across the top, and the tray stays where
   it always is, under the scene, but laid out along one line (the tiles, then the key beside them) rather than
   stacked, so the scene keeps as much of the height as it can and what's being worked on stays big */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --k-quest-top: var(--k-s-2); }
  .k-corner { top: calc(var(--k-s-2) - 2px); }
  /* (up between the corner keys, not under them) */
  /* (the keys are 36px at 6px down, the 30px sticker 9px: the same centre line) */
  .k-quest { top: 0; --k-quest-pad: 9px; width: min(420px, calc(100% - 240px)); padding-inline: var(--k-s-4); padding-bottom: 10px; }
  .k-quest__badge { width: 30px; height: 30px; }
  .k-quest__badge .k-icon { width: 20px; height: 20px; }
  .k-quest__title { font-size: 16px; }
  /* (one line tall here: the room's short and the receipt wide, so a step rarely needs two) */
  .k-quest__do { font-size: var(--k-t-micro); margin-top: 8px; padding-top: 5px; min-height: calc(1.4em + 5px + 1.5px); }
  .k-stage { gap: var(--k-s-2); }
  :root { --k-tray-bottom: var(--k-s-3); }
  body:not(.k-picking) .k-stage:not([hidden]):not([data-stage="write"]):not([data-stage="sent"]):not([data-stage="keepnote"]) { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: var(--k-s-4); }
  body:not(.k-picking) .k-stage > .k-row { flex-wrap: nowrap; }
  /* (the quiet word of a step, Back to the kitchen, never goes beside its main key: it drops to a line of its own
     under it) */
  body:not(.k-picking) .k-stage:has(> .k-row > .k-key--quiet:only-child):not([hidden]) { flex-wrap: wrap; row-gap: var(--k-s-1); }
  .k-stage > .k-row:has(> .k-key--quiet:only-child) { flex: 1 1 100%; }
  .k-stage > .k-row--swatches { margin-bottom: 0; }
  .k-tile { width: 64px; gap: 4px; }
  .k-tile__face { width: 56px; height: 56px; border-radius: 16px; }
  .k-tile .k-icon { width: 34px; height: 34px; }
  .k-row.k-row--sides:has(> .k-tile) { flex: 0 1 auto; gap: 10px; max-width: none; }
  .k-row--sides > .k-tile { flex: 0 0 62px; width: 62px; max-width: none; }
  .k-row--sides .k-tile__face { width: 62px; height: 62px; aspect-ratio: auto; }
  .k-row--sides .k-tile .k-icon { width: 40px; height: 40px; }
  body.k-picking .k-tray .k-stage { padding: 14px var(--k-s-4) 14px; gap: var(--k-s-2); }
  /* (the card's compact here: the same 10px or so either side of the dashed rule) */
  .k-pick { padding-bottom: 8px; }
  body.k-picking .k-tray .k-stage::after { margin-top: 0; }
}

/* clear of the notch, the island and the rounded corners (added to the home screen, or held on its side): the
   corner keys and the prompt step in by the safe area, on top of where they'd be anyway */
.k-corner { margin-top: env(safe-area-inset-top, 0px); margin-left: env(safe-area-inset-left, 0px); }
.k-corner--end { margin-left: 0; margin-right: env(safe-area-inset-right, 0px); }
.k-quest { padding-top: calc(var(--k-quest-pad, var(--k-s-3)) + env(safe-area-inset-top, 0px)); }

@media (prefers-reduced-motion: reduce) {
  .k-scene canvas { transition: none; }
  .k-quest.is-popping, .k-quest.is-popping .k-quest__badge .k-icon, .k-stage > *, .k-tile, .k-meter i.is-full::before, .k-stamp { animation: none !important; }
  .k-tile, .k-tile__face, .k-tile .k-icon, .k-key, .k-meter i::before, .k-field input, .k-field textarea, .k-chip { transition: none; }
}

/* ── The letter (js/letter.js): its desk over a dish's scene, and the sheet's typing field ──
   The desk is a second scene in a layer over the dish's, up while a note's written or read. The field that takes the
   typing lies over the sheet, unseen (js/letter.js puts it where the sheet is). A phone's keyboard up while it's
   typed: the tray rides just above it (--lt-kb: how much of the screen the keyboard covers, where the page isn't
   shrunk for it), and the prompt goes small, its words on one line, so the lines being typed keep what room's left;
   a phone on its side with the keyboard up has room for a couple of lines and the key: the prompt tucks away. */
/* (it comes up in 600ms, and goes away slower, 900ms: the dish carries on beneath it as it clears, js/keep.js noteScreen) */
.k-scene--letter { z-index: 13; opacity: 0; pointer-events: none; transition: opacity 900ms var(--k-ease-soft); }
.k-scene--letter.is-up { opacity: 1; pointer-events: auto; transition-duration: 600ms; }
.lt-input { position: fixed; z-index: 14; margin: 0; padding: 0; border: 0; opacity: 0; resize: none; font-size: 16px; caret-color: transparent; cursor: text; background: transparent; }
.lt-input[hidden] { display: none; }
.k-scene.is-signing, .k-scene.is-signing canvas { cursor: crosshair; }
.k-scene.is-stamping, .k-scene.is-stamping canvas { cursor: none; }
body.is-typing { --k-tray-bottom: calc(10px + var(--lt-kb, 0px)); }
body.is-typing .k-quest { --k-quest-pad: 8px; padding-bottom: 8px; }
body.is-typing .k-quest__badge { width: 28px; height: 28px; }
body.is-typing .k-quest__badge .k-icon { width: 18px; height: 18px; }
body.is-typing .k-quest__title { font-size: 15px; }
body.is-typing.lt-short .k-quest { display: none; }
body.is-typing .k-quest__do { margin-top: 7px; padding-top: 5px; min-height: calc(1.4em + 5px + 1.5px); }
@media (prefers-reduced-motion: reduce) { .k-scene--letter { transition: none; } }

/* ── Going home: the page being left fades into the kitchen, no hard cut (her note, TestFlight 2026-11-26: "return to
   home needs a smoother loading animations. something light"). A view transition between the two pages; js/ui.js lets
   it run only when the way is home (into a dish, its own loading screen is the way in). The home then settles its
   kitchen in once it's drawn (index.html, .k-again) ── */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 340ms; animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1); }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 1ms; } }
