/* LAWS:
   - design only. No copy, no logic, no data — a rule here decides how the Writing Desk LOOKS and
     nothing about what it says, what it marks, or what it may write.
   - colours come from ui/kit tokens; geometry from the --dk* raw tokens. No hex, no px literal
     (spelltrail/tools/ui-gate.mjs check ①), which is also why a look can restyle this screen
     without opening it.
   - THE WRITING IS THE CHILD'S, so it is set in the BODY face and never the display face — the
     typing-target law the quest card has always kept, applied to a page of her own words.
   - the drawn keyboard's paint is ui/kbd/kbd.css's and this sheet never reaches inside it.
   History: NOTES.md */

/* ══ THE BOOK ═══════════════════════════════════════════════════════════════════════════════════
   A school exercise book: ruled lines, a page with a real bottom, and a page turn that slides
   sideways. THE RULES ARE PAINTED ON THE VIEWPORT, not on the flow, because the flow only ever
   moves sideways — one rule grid serves every page, so the lines cannot drift out from under the
   text however many pages she writes. */
#desk .dk-vp{
  position:relative; overflow:hidden; margin:0 auto;
  /* §52: PAPER, not a panel — the page's own colour with a grain you only see up close */
  background-color:var(--dk-paper); background-image:var(--dk-paper-tex); color:var(--dk-ink);
  border:var(--dk-hair) solid var(--line); border-radius:var(--dk-r) var(--dk-r) var(--dk-rsm) var(--dk-rsm);
  box-shadow:var(--dk-drop);
  /* the writing starts right of the margin line (--dk-pad-l), and the surfaces read the same number */
  padding:var(--dk-pad-y) var(--dk-pad-x) var(--dk-pad-y) var(--dk-pad-l);
  /* pan-y, NOT none: a vertical drag anywhere on the paper scrolls the page, which is how a phone
     gets the keyboard back after it has been scrolled off (owner, 2026-09-10). Horizontal is still
     ours — that is the page turn and the selection drag. */
  touch-action:pan-y;
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none;
}
/* THE STAMP (§58.1): the teacher's stamp on a finished page, in its bottom corner, over the rules and the writing as ink
   over ink — the kit draws it at the owner's 80% multiplied, so her words still read through it. It takes no pointer.
   STAMPED once, the moment it lands (`.fresh`; owner, 2026-10-24: "like it's being stamped"): it hangs over the page,
   big and pale with its shadow under it, falls, the ink takes on contact, and the press squashes it a hair. Never under
   reduced motion. The motion is on the box, so the stamp's own turn is untouched, and it is `backwards` so nothing is
   left transformed to cut the multiply off. The recap's stamp falls the same way (index.html, `stamp-down`). */
#desk .dk-stamp{
  --stamp-blend:multiply; --stamp-ink:.8; --stamp-lift:brightness(1);   /* the page is paper at every hour */
  position:absolute; right:var(--dk-stamp-in); bottom:var(--dk-stamp-in); z-index:2;
  width:var(--dk-stamp); height:var(--dk-stamp); pointer-events:none;
}
#desk .dk-stamp[hidden]{ display:none; }
#desk .dk-stamp.fresh{ animation:dk-stamp-down .7s linear .2s backwards; }
@keyframes dk-stamp-down{
  0%  { transform:translateY(-.9em) scale(1.75) rotate(-5deg); opacity:0;
        filter:drop-shadow(0 1.6em 1em rgb(0 0 0 / .26)); animation-timing-function:cubic-bezier(.55,0,.9,.55); }
  12% { opacity:.5; }
  60% { transform:translateY(0) scale(1) rotate(0deg); opacity:.5;
        filter:drop-shadow(0 .15em .15em rgb(0 0 0 / .18)); animation-timing-function:ease-out; }
  63% { opacity:1; }
  73% { transform:scale(.92,.95); filter:none; animation-timing-function:ease-out; }
  100%{ transform:scale(1); opacity:1; filter:none; }
}
@media (prefers-reduced-motion:reduce){ #desk .dk-stamp.fresh{ animation:none; } }
body.nomo #desk .dk-stamp.fresh{ animation:none; }
/* THE MARGIN LINE (§52): an exercise book's red rule down the left, the whole height of the page. Drawn
   first, so the rules and the writing lie over it as ink lies over a printed line. */
#desk .dk-vp::before{
  content:''; position:absolute; top:0; bottom:0; left:var(--dk-margin-x); width:var(--dk-margin-w);
  background:var(--dk-margin); pointer-events:none;
}
/* the rules sit at the BOTTOM of each line box, which is where a school book puts them — and since §52
   they run edge to edge, across the margin, as an exercise book's do */
#desk .dk-rules{
  position:absolute; left:0; right:0; top:var(--dk-pad-y);
  pointer-events:none;
  background-image:repeating-linear-gradient(to bottom,
    transparent 0, transparent calc(var(--dk-lh) - var(--dk-hair)),
    var(--dk-rule) calc(var(--dk-lh) - var(--dk-hair)), var(--dk-rule) var(--dk-lh));
}
/* ONE text stream; the browser paginates it into columns and a page turn is a translate. Nothing is
   ever split across a page boundary by us — multicol does it correctly, including hyphenation-free
   word wrapping, which a hand-rolled paginator would get wrong. */
#desk .dk-flow{
  position:relative; white-space:pre-wrap; word-break:normal;
  font-family:var(--fbody); font-size:var(--dk-fs); line-height:var(--dk-lh);
  column-fill:auto;
  transition:transform .18s cubic-bezier(.3,.7,.3,1);
}
#desk .dk-w{ white-space:pre; }
/* a turn draws a leaf (leaf.js), so the page under it changes at once rather than sliding */
#desk .dk-vp.flipping .dk-flow, #desk .dk-vp.flipping .dk-bwrap{ transition:none; }
#desk .dk-c.sel{ background:var(--dk-sel); border-radius:var(--dk-nub); }
#desk .dk-caret{
  position:absolute; width:var(--dk-caret); background:var(--dk-caret-ink);
  border-radius:var(--dk-nub); pointer-events:none; opacity:0;
}
#desk .dk-caret.live{ animation:dkblink 1.06s steps(1,end) infinite; }
@keyframes dkblink{ 0%,55%{opacity:1} 56%,100%{opacity:0} }

/* THE MARK. The browser's own squiggle, drawn the way the browser draws it, because that is the
   whole point of the owner's ruling: a child already knows what it means. `skip-ink:none` so a
   descender does not punch holes in it — a wavy line with gaps in it reads as a rendering fault. */
#desk .dk-w.mk{
  text-decoration:underline wavy var(--dk-mark);
  text-decoration-skip-ink:none;
  text-underline-offset:.18em;
  cursor:pointer;
}
/* THE ORANGE ASK: the same squiggle in the "maybe" colour (§51.3) — a real word she probably did not mean. */
#desk .dk-w.mk.ask{ text-decoration-color:var(--dk-ask); }

/* ══ SURFACE B ═════════════════════════════════════════════════════════════════════════════════
   The same page box, the same page turn, and — the part that matters — EVERY PAGE STAYS ATTACHED.
   A detached textarea reports scrollHeight 0, so a reflow that measures one is told everything fits
   and quietly scrambles the child's pages. */
#desk .dk-bwrap{ position:relative; transition:transform .18s cubic-bezier(.3,.7,.3,1); }
#desk .dk-bp{ position:absolute; top:0; }
#desk .dk-bt, #desk .dk-bm{
  position:absolute; inset:0; margin:0; padding:0; border:none;
  font-family:var(--fbody); font-size:var(--dk-fs); line-height:var(--dk-lh);
  white-space:pre-wrap; word-break:normal; overflow:hidden;
}
#desk .dk-bt{
  display:block; outline:none; resize:none; background:transparent; color:var(--dk-ink);
  caret-color:var(--dk-ink);
  -webkit-user-select:text; user-select:text;
}
/* the overlay carries the same text, painted invisible, so a squiggle lands under exactly the
   letters the box is drawing on top of it. A textarea cannot hold a span; this is the only way a
   control surface gets a mark at all. */
#desk .dk-bm{ color:transparent; pointer-events:none; }
/* the caret is the focus mark on a page. index.html's :focus-visible ring (a box-shadow, so `outline:none`
   above does not reach it) drew a cyan frame round the page after every turn on surface B. */
#desk .dk-bt:focus-visible{ box-shadow:none; }

/* ══ THE OPEN BOOK (ROADMAP §52 — the owner's pick B, 2026-10-14) ════════════════════════════════
   "Especially on a laptop it should look better, almost like a beautiful notepad." From 67.5em up the
   book lies OPEN in a blue cloth cover: the writing on the right page, and on the left page what a
   child reads and presses while she writes — the piece's name, the helper's line, "Did you mean…", the
   two buttons and the tools. A ribbon lies in the fold. Below that width it is one page, as before, on
   the same paper.
   NOTHING MOVES IN THE DOM. The one grid places the book's own children, the paper is #dkbook::before
   (one sheet across the fold, shaded either side of it) and the ribbon is ::after. The surfaces read
   --dk-spread, --dk-page-max and --dk-pad-l off the page and size it to half the card; desk.view.js
   writes the page's width back as --dk-pagew so the left page is the same size as the right. */
#desk #dkbook{ position:relative; }                  /* the turning leaf is drawn inside it */
#desk .dk-head{ display:none; }                     /* the left page's heading: the open book only */
@media (min-width:67.5em){
  #desk{
    --dk-spread:1;
    --dk-page-max:var(--dk-page-max-spread);
    --dk-lines-max:var(--dk-lines-max-spread);
    --dk-gap:var(--dk-gap-spread);
    --dk-pad-l:var(--dk-pad-l-spread);
    --dk-margin-x:var(--dk-margin-x-spread);
  }
  /* the app's column (900) is a phone's column made wide; an open book needs two pages of it. Only
     while the book is open — the cover and the print sheet keep the column they had. */
  body:has(#desk.show #dkbook:not([hidden])) #app{ max-width:var(--dk-app-spread); }
  #desk > .card:has(#dkbook:not([hidden])){ background:none; border-color:transparent; box-shadow:none; }
  #desk > .card:has(#dkbook:not([hidden]))::before{ display:none; }
  #desk #dkbook:not([hidden]){
    display:grid;
    grid-template-columns:var(--dk-pagew, var(--dk-page-max-spread)) auto;
    grid-template-rows:auto auto auto auto 1fr auto auto auto auto auto;
    width:fit-content; max-width:100%; margin:0 auto var(--dk-ribbon-tail);
    padding:var(--dk-cloth-pad); border-radius:var(--dk-cloth-r);
    background:var(--dk-cloth-bg); box-shadow:var(--dk-book-drop);
  }
  #desk #dkbook::before{
    content:''; grid-column:1 / -1; grid-row:1 / 9; z-index:0;
    border-radius:var(--dk-rsm); box-shadow:var(--dk-leaf-edges);
    background-color:var(--dk-paper);
    background-image:
      linear-gradient(90deg, transparent calc(var(--dk-pagew, var(--dk-page-max-spread)) - var(--dk-fold)),
        var(--dk-fold-ink) var(--dk-pagew, var(--dk-page-max-spread)),
        transparent calc(var(--dk-pagew, var(--dk-page-max-spread)) + var(--dk-fold))),
      var(--dk-paper-tex);
  }
  /* THE RIBBON BELONGS TO THE PAGES, NOT THE COVER: placed on the pages' own grid area (an absolutely placed
     grid child takes its area as its box), so with the drawn board up it hangs to just below the pages and
     not down the middle of the keys (photographed 2026-10-14 at tabletL with the board on). */
  #desk #dkbook::after{
    content:''; position:absolute; z-index:3; pointer-events:none;
    grid-column:1 / -1; grid-row:1 / 9;
    top:calc(-1 * var(--dk-cloth-pad));
    left:calc(var(--dk-pagew, var(--dk-page-max-spread)) - var(--dk-ribbon-w) / 2);
    width:var(--dk-ribbon-w); height:calc(100% + 2 * var(--dk-cloth-pad) + var(--dk-ribbon-tail));
    background:var(--dk-ribbon-bg);
    clip-path:polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - var(--dk-ribbon-notch)), 0 100%);
  }
  /* the left page, top to bottom: name, the helper, "Did you mean…", the trail card, the space that is
     left, the monitoring line, the two buttons, the tools */
  #desk #dkhead, #desk #dksay, #desk #dkpanel, #desk #dktrail, #desk #dkmon2, #desk #dkacts, #desk #dkbar{
    grid-column:1; position:relative; z-index:1; min-width:0; max-width:none;
    margin:var(--dk-g3) var(--dk-leaf-pad) 0;
  }
  #desk #dkhead{
    grid-row:1; margin-top:var(--dk-leaf-pad);
    display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--dk-g1) var(--dk-g3);
    padding-bottom:var(--dk-g2); border-bottom:var(--dk-edge) solid var(--dk-rule);
    color:var(--parchInk2); font-size:var(--dk-sm);
  }
  #desk #dkhead b{ font-family:var(--fdisp); font-weight:900; font-size:var(--dk-lg); color:var(--parchInk); min-width:0; overflow-wrap:anywhere; }
  #desk #dksay{ grid-row:2; }
  #desk #dkpanel{ grid-row:3; box-shadow:none; }
  #desk #dktrail{ grid-row:4; }
  #desk #dkmon2{ grid-row:6; }
  #desk #dkacts{ grid-row:7; margin-bottom:0; }
  #desk #dkbar{ grid-row:8; margin-bottom:var(--dk-leaf-pad); }
  /* the right page: the paper is the book's, so the page box is only the writing's frame */
  /* STRETCHED to the page's full height, over the height the surface wrote: when the left page is the
     taller one (a trail card under the finish line) the margin line still runs to the foot of the
     page. The writing keeps its own height — the flow and the rules are sized by the surface, never by
     this box — so no line appears that cannot be written on. */
  #desk #dkvp{
    grid-column:2; grid-row:1 / 9; align-self:stretch; height:auto !important; z-index:1;
    margin:0; border:none; border-radius:0; box-shadow:none; background:none;
  }
  /* STRETCHED, and said so: the board's own `.kbd` centres itself with auto margins (kbd.css), and an auto
     margin stops a grid item stretching — inside this fit-content grid the board shrank to its glyphs'
     width, 13px keys in a 184px board (Fable review §52, photographed on an iPad sideways). */
  #desk #dkkbd{ grid-column:1 / -1; grid-row:9; justify-self:stretch; width:100%;
    margin-top:calc(var(--dk-cloth-pad) + var(--dk-ribbon-tail)); }
  /* WITH THE BOARD UP THE TAIL IS TUCKED IN: it ends where the board begins, and the board comes up by the
     tail's length — on an iPad sideways that length is the board's bottom row (Fable review §52). */
  #desk #dkbook.kb #dkkbd{ margin-top:var(--dk-cloth-pad); }
  #desk #dkbook.kb::after{ height:calc(100% + 2 * var(--dk-cloth-pad)); }
  #desk #dkbook.kb:not([hidden]){ margin-bottom:0; }
  /* the left page's pager number sits on the paper here, not on the card: paper ink */
  #desk #dkbar .dk-pnum{ color:var(--dk-ink2); }
  /* the title is a cut of the opening line; two lines at most, then an ellipsis, never a stray "Th…" */
  #desk #dkhead b{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; }
  #desk #dkprobe{ grid-column:1 / -1; grid-row:10; }
  #desk .dk-leaf-face{ border:none; border-radius:0; box-shadow:none; }
}

/* ══ THE TURNING LEAF (§52, owner 2026-10-14: "pretty page flipping animations") ═════════════════════
   leaf.js lays a picture of a page over the book and these turn it about its left edge — the fold on the
   open book, the binding on a phone. Forward it lifts the page she is leaving and lays it over to the
   left; back it brings the page she is going to over from the left. A shade crosses it as it stands up.
   Never drawn under ?fast=1 or reduced motion (leaf.js decides, and draws nothing). */
#desk .dk-leaf, #desk .dk-leaf-under{ position:absolute; z-index:4; pointer-events:none; }
#desk .dk-leaf-under{ z-index:2; }
#desk .dk-leaf{
  transform-origin:0 50%; transform-style:preserve-3d;
  animation:dkturn var(--dk-flip) var(--dk-flip-ease) both;
}
#desk .dk-leaf.back{ animation-name:dkturnback; }
#desk .dk-leaf-face{
  position:absolute; inset:0; margin:0;
  -webkit-backface-visibility:hidden; backface-visibility:hidden;
}
#desk .dk-leaf-face.reverse{ transform:rotateY(180deg); }
#desk .dk-leaf-face.reverse::before{ display:none; }
#desk .dk-leaf-face::after{
  content:''; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(90deg, transparent, var(--dk-flip-shade));
  animation:dkshade var(--dk-flip) var(--dk-flip-ease) both;
}
#desk .dk-leaf-under .dk-leaf-face::after{ display:none; }
/* a turn made by typing is a flick: every part of the leaf reads its timing from --dk-flip */
#desk .dk-leaf.quick, #desk .dk-leaf-under.quick{ --dk-flip:var(--dk-flip-quick); }
/* surface B's page, drawn from its mark overlay: the same text, inked */
#desk .dk-leaf .dk-bm.dk-inked, #desk .dk-leaf-under .dk-bm.dk-inked{ color:var(--dk-ink); }
/* THE LEAF ITSELF NEVER FADES: opacity on a preserve-3d box flattens it, and a flat leaf shows its front
   page MIRRORED from behind instead of its blank back (photographed 2026-10-14). The fade is the blank
   back's own — it is the face that lies on the left page when a forward turn lands. */
@keyframes dkturn{
  0%  { transform:perspective(var(--dk-flip-persp)) rotateY(0deg); }
  86% { transform:perspective(var(--dk-flip-persp)) rotateY(-180deg); }
  100%{ transform:perspective(var(--dk-flip-persp)) rotateY(-180deg); }
}
@keyframes dkturnback{
  0%  { transform:perspective(var(--dk-flip-persp)) rotateY(-180deg); }
  14% { transform:perspective(var(--dk-flip-persp)) rotateY(-180deg); }
  100%{ transform:perspective(var(--dk-flip-persp)) rotateY(0deg); }
}
#desk .dk-leaf.fwd .dk-leaf-face.reverse{ animation:dkfadeout var(--dk-flip) linear both; }
#desk .dk-leaf.back .dk-leaf-face.reverse{ animation:dkfadein var(--dk-flip) linear both; }
@keyframes dkfadeout{ 0%, 86%{ opacity:1; } 100%{ opacity:0; } }
@keyframes dkfadein{ 0%{ opacity:0; } 14%, 100%{ opacity:1; } }
@keyframes dkshade{ 0%{ opacity:0; } 50%{ opacity:1; } 100%{ opacity:0; } }

/* ══ THE CHROME ════════════════════════════════════════════════════════════════════════════════ */
#desk .dk-bar{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:var(--dk-g2);
  margin-bottom:var(--dk-g2);
}
#desk .dk-bar .sp{ flex:1 1 auto; }
#desk .dk-pnum{ font-size:var(--dk-sm); font-weight:800; color:var(--mut); min-width:var(--dk-pnum-w); text-align:center; }
#desk button{ min-height:var(--dk-tap); }
/* `hidden` ON A FLEX CHILD HAS TO BE SAID (index.html's own `.row[hidden]` note, and the defect
   §36 (a) found on the Star Shop): .btn is display:inline-flex-ish and .dk-tool below is flex, so
   the UA's [hidden]{display:none} loses to the author rule and a hidden control goes on being
   drawn. Both of this screen's hidden controls — `Close the book`, the page group on a one-page
   piece — depend on this line. */
#desk [hidden]{ display:none !important; }

/* ── THE ACTION ROW: THE RITUAL, AND NOTHING ELSE (§36 (b) · §33.4) ──────────────────────────────
   Two controls, side by side, one line, at every width. `flex:1 1 0` with `min-width:0` and
   `nowrap` is #qbtns's settled answer to exactly this (index.html: "with nowrap a button's
   min-content IS its label"), and it is borrowed here rather than re-invented.
   THE PAIR IS NOT DRAWN THE SAME SIZE, and that is a deliberate departure from the rule sixty lines
   below. `Check my spelling` and `I am finished` are not two doors of one question — one is the
   thing she does over and over while writing, the other ends the piece — so the primary keeps its
   52 and the secondary sits at the 44 floor. The genuine pair on this screen is the ASK inside
   .dk-say ("I am finished" / "Back to my writing"), and that one still gets the equal treatment. */
#desk #dkacts{ flex-wrap:nowrap; gap:var(--dk-g2); }
#desk #dkacts .btn{
  flex:1 1 0; min-width:0; max-width:var(--dk-btn-max); white-space:nowrap;
  padding-inline:var(--dk-g3); font-size:var(--dk-md);
}
/* …AND A CEILING, which #qbtns also has and for the same measured reason: `flex:1 1 0` with nothing
   to stop it made these two 365px wide on a tablet and 405 on a laptop — two slabs filling the card,
   which is the fault this lane exists to fix arriving from the other end. */
#desk #dkacts{ justify-content:center; }
/* the cover's primary keeps the 52px box it had before the pair rule above was narrowed */
#desk #dknew{ padding-top:var(--dk-g2); padding-bottom:var(--dk-g2); }
#desk #dkacts .btn.sec{ min-height:var(--dk-tap); }

/* ── THE TOOL ROW: SIX SQUARES ON THE 24px GRID (§36 law 6) ──────────────────────────────────────
   Before: six text buttons — `‹ page`, `page 1 of 1`, `page ›`, `↶ undo`, `↷ redo`, `keys` — 96 to
   107px wide each, wrapping to two rows at phone390 and THREE at phone360. A page turn, an undo and
   a keyboard toggle are tools; a tool is an icon at the tap floor. Four squares and three gaps is
   200px, which fits the narrowest phone this board photographs with room to spare; the page group
   joins them only on a piece that has a second page. */
#desk .dk-tools{ gap:var(--dk-g2); }
#desk .dk-pages{ display:inline-flex; align-items:center; gap:var(--dk-g1); }
#desk .dk-tool{
  flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center;
  width:var(--dk-tap); height:var(--dk-tap); min-height:var(--dk-tap); padding:0;
  border:var(--dk-hair) solid var(--line); border-radius:var(--dk-r);
  background:var(--card2); color:var(--mut); cursor:pointer;
  transition:color .12s ease, border-color .12s ease;
}
/* §36 LAW 4 — HOVER IS A COLOUR, NEVER A LIFT. The global .btn nudges by a pixel on hover; every
   control on this screen answers in colour instead, which is also what the pills above already do. */
@media (hover:hover){ #desk .dk-tool:hover{ color:var(--ink); border-color:var(--goldD); } }
#desk .dk-tool:disabled{ opacity:var(--dk-off); cursor:default; }
@media (hover:hover){ #desk .dk-tool:disabled:hover{ color:var(--mut); border-color:var(--line); } }
@media (hover:hover){ #desk .btn:hover{ transform:none; } }
#desk .dk-tool::before{
  content:''; display:block; width:var(--dk-icon); height:var(--dk-icon);
  background:currentColor;
  -webkit-mask-position:center; mask-position:center;
  -webkit-mask-size:contain; mask-size:contain;
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
}
/* the six drawings, each a 24-grid stroke path and nothing else. A mask in currentColor rather than
   an <svg> in the view for the same reason the monitoring line's shield is one: a drawing is design,
   and desk.view.js may not hold one. */
#desk #dkprev::before{ -webkit-mask-image:var(--dk-i-prev); mask-image:var(--dk-i-prev); }
#desk #dknext::before{ -webkit-mask-image:var(--dk-i-next); mask-image:var(--dk-i-next); }
#desk #dkundo::before{ -webkit-mask-image:var(--dk-i-undo); mask-image:var(--dk-i-undo); }
#desk #dkredo::before{ -webkit-mask-image:var(--dk-i-redo); mask-image:var(--dk-i-redo); }
#desk #dkkeys::before{ -webkit-mask-image:var(--dk-i-keys); mask-image:var(--dk-i-keys); }
#desk #dkprintbtn::before{ -webkit-mask-image:var(--dk-i-print); mask-image:var(--dk-i-print); }

/* ── THE PILL ROW, WHEREVER THE DESK DRAWS ONE ───────────────────────────────────────────────────
   Two rows on this screen are built out of .mpill: the cover's "How you type" switch (static markup
   in index.html) and the PRINT BAR, which desk.view.js assembles group by group — size, space,
   format, pages-per-sheet, corrections. Both shipped as platform-default <button>s, because
   index.html's .mpill rules are scoped `#mascotset, #straightset` and nothing in the app was
   painting either of them (DESIGN-POLISH §1, system ④ — browser defaults).
   THE BASE IS SCOPED `#desk`, NEVER A LOOSE `.mpill`. The settings rows are the same class on a
   different screen and this sheet may not reach them; inside #desk the class occurs in exactly those
   two rows, so one base serves both and the cover's welded track is a four-line delta on top of it
   further down. */
#desk .mpill{
  min-height:var(--dk-tap); padding:0 var(--dk-g4); cursor:pointer;
  border:var(--dk-edge) solid var(--line); border-radius:var(--dk-pill);
  background:var(--card2); color:var(--mut);
  font-family:var(--fdisp); font-weight:800; font-size:var(--dk-md); letter-spacing:.02em;
  transition:color .12s ease, border-color .12s ease;
}
/* the print bar's pills are appended with no text node between them, so the space between two of
   them is this rule's job. The cover's track overrides it with a NEGATIVE margin — that is the one
   place where two pills are meant to be welded into one control rather than stood side by side. */
#desk .mpill + .mpill{ margin-left:var(--dk-g1); }
@media (hover:hover){ #desk .mpill:hover{ color:var(--ink); border-color:var(--goldD); } }
#desk .mpill:disabled{ opacity:var(--dk-off); cursor:default; color:var(--mut); border-color:var(--line); } @media (hover:hover){ #desk .mpill:disabled:hover{ opacity:var(--dk-off); cursor:default; color:var(--mut); border-color:var(--line); } }
#desk .mpill.on{
  background:linear-gradient(180deg,var(--goldL),var(--gold));
  border-color:var(--goldD); color:var(--parchInk);
}
/* a pill row's label above it, and its note below — .msl is also what the print bar names each of
   its five groups with, so it is part of the same base. */
#desk .msl{
  display:block; font-size:var(--dk-sm); font-weight:800; color:var(--mut);
  text-transform:uppercase; letter-spacing:.04em; margin-bottom:var(--dk-g2);
}
#desk .msub{ display:block; margin-top:var(--dk-g2); font-size:var(--dk-sm); color:var(--mut); }

/* THE TWO DOORS OUT OF A BEAT ARE THE SAME SIZE — the quest card's law (index.html, `#qbtns .btn.sec`,
   owner 2026-09-12: "the grey button, make it the same size as the next button"), restated for the
   desk's own rows because a law written against one id does not travel.
   .btn is 19px type in a 52px box and .btn.sec is 16px in a 48px box, and that de-emphasis is right
   wherever a secondary sits UNDER a primary. It is wrong beside one: `Print` and `Back`, `I am
   finished` and `Back to my writing` are pairs a child chooses BETWEEN, and drawn a size apart the
   quiet one reads as an afterthought instead of as the other half of a question. Colour still says
   which one the app expects.
   `:has()` asks the row whether it is holding a primary at all — #dkbar is six quiet buttons and no
   gold one (prev · page · next · undo · redo · keys), and inflating a toolbar to 52 would cost the
   phone a row of height for nothing. The padding is restated on BOTH halves and kept under the
   floor so min-height is what decides the box: that makes the two exactly equal whatever the face
   metrics do, which is the thing the rule is actually promising. Side padding is left alone, as the
   quest card leaves it, so each button keeps its own width.
   THE COVER IS DELIBERATELY NOT IN HERE. `Start a new page` and `Back` are in different rows — a
   lone primary above a lone secondary — and that is hierarchy, not a pair.
   §36 (b) NARROWED IT TO .dk-say. It used to name `.dk-bar:has(.btn:not(.sec))` as well, and that
   selector matched #dkacts — a row of FOUR, of which exactly one was a primary. So `Print` and
   `Close the book` were inflated to 52px and 20px type because they happened to stand beside
   `Check my spelling`, which is how a toolbar came to be three wrapped rows of slabs on a phone.
   The rule is right about a PAIR and was never about a row; it says so now. */
#desk .dk-say .btn,
#desk .dk-say .btn.sec{
  min-height:calc(var(--dk-tap) + var(--dk-g2));
  padding-top:var(--dk-g2); padding-bottom:var(--dk-g2);
}
/* …and the same type, which is the other half of "the same size". --dk-lg is 20 and the app's
   primary is 19, so the pair's face is one hair under it rather than a literal this sheet may not
   write (ui-gate ①). */
#desk .dk-say .btn.sec{ font-size:calc(var(--dk-lg) - var(--dk-hair)); }
#desk .dk-kbd{ margin-inline:auto; }

/* THE MONITORING LINE (RULINGS §9 ③). A small persistent line on the page, never a dialog — a
   dialog is dismissed and then it is not true any more. Quiet, and permanently there.

   IT MOVED ONTO PARCHMENT AND THE RED DOT BECAME A SHIELD (DESIGN-POLISH §4.4, 2026-09-13). It is a
   thing worth knowing, not a warning — warm, never loud, and there is no costume for being cross.
   The `●` it replaces was drawn in --dk-mark, which is THE ERROR COLOUR OF THIS SCREEN (it is the
   squiggle under a misspelling, forty lines up), so a plain friendly sentence was wearing the mark
   the app uses for a mistake. --dk-mark is untouched and still does that job; only this line stops
   borrowing it. Parchment is the surface this app already speaks from (.dk-say below, the teach
   card), and it is THEME-INVARIANT: --parch/--parchInk are declared on :root in kit/tokens.raw.css
   and no look overrides them, so the ink on it measures the same in Midnight as in Day.
   THE SHIELD'S INK IS --goldD AND NOT --goldInk. --goldInk follows the look — it resolves to
   var(--gold) in the dark palettes — and #ffd166 on the fixed parchment measures 1.19:1, which is
   an invisible mark in three of the five looks. --goldD never moves (kit/themes.css: the lantern is
   the brand and it is raw) and measures 3.03:1 there, clearing the 3:1 bar a non-text graphic
   answers to. The radius and padding are .dk-say's own tokens rather than one-off numbers, because
   these two are the same kind of slot and should read as siblings. */
#desk .dk-monitor{
  max-width:var(--dk-page-max); margin:var(--dk-g2) auto 0;
  padding:var(--dk-g2) var(--dk-g3); border-radius:var(--dk-r);
  background:var(--parch); color:var(--parchInk);
  font-size:var(--dk-sm); line-height:1.45; text-align:center;
}
/* (the shield mark before the line, a masked SVG in --goldD, went on 2026-10-25, v532: the owner, "Remove that shield
   icon". The line says what it says; it needs no badge.) */

/* the mascot's one line a piece, and the check's result line. Same slot, because they are the same
   kind of thing: the desk speaking once, quietly, about what just happened. */
#desk .dk-say{
  max-width:var(--dk-page-max); margin:var(--dk-g2) auto 0; min-height:var(--dk-tap);
  padding:var(--dk-g2) var(--dk-g3); border-radius:var(--dk-r);
  background:var(--parch); color:var(--parchInk); border:var(--dk-hair) solid var(--line);
  font-size:var(--dk-md); line-height:1.45; text-align:center;
}
#desk .dk-say:empty{ display:none; }
/* THE HOST ON THE LINE (2026-09-28): the resident's face at the start and the sentence beside it, left-
   aligned because a face and a centred paragraph do not read as somebody speaking. The face is the tap
   height, so the row is no taller than the min-height it already had; its own line is set in the ink's
   weight and leads the desk's. Painted residents scale smoothly (the global img[data-art] rule). */
#desk .dk-say.hosted{ display:flex; align-items:center; gap:var(--dk-g3); text-align:left; }
#desk .dk-say .dk-host{ width:var(--dk-tap); height:var(--dk-tap); flex:0 0 var(--dk-tap); object-fit:contain; }
#desk .dk-say .dk-own{ font-weight:700; }

/* ══ THE TAP PANEL ═════════════════════════════════════════════════════════════════════════════
   Up to four suggestions in ring order, each with a speaker where it can be HEARD. NOTHING IN HERE
   INSERTS: tapping a suggestion plays it, and the child goes back and retypes. That refusal is the
   owner's ruling (§8 ①) and it is why this panel has no primary action. */
#desk .dk-panel{
  max-width:var(--dk-page-max); margin:var(--dk-g2) auto 0;
  padding:var(--dk-g3); border-radius:var(--dk-r);
  background:var(--card); border:var(--dk-hair) solid var(--line); box-shadow:var(--dk-drop-sm);
}
#desk .dk-panel-h{ font-family:var(--fdisp); font-weight:900; font-size:var(--dk-md); margin-bottom:var(--dk-g2); }
/* the marked word as LETTERS on the look's card: --markInk/--askInk (tokens.semantic.css), not the squiggle's colours,
   which are tuned for the page's paper and measured 3.16:1 (red, night) and 2.69:1 (orange, day) here (#186) */
#desk .dk-panel-h b{ color:var(--markInk); }
#desk .dk-panel.ask .dk-panel-h b{ color:var(--askInk); }
#desk .dk-sugs{ display:flex; flex-wrap:wrap; gap:var(--dk-g2); }
#desk .dk-sug{
  display:inline-flex; align-items:center; gap:.4em;
  min-height:var(--dk-tap); padding:var(--dk-g2) var(--dk-g3);
  border-radius:var(--dk-pill); border:var(--dk-edge) solid var(--line); background:var(--sunk);
  font-family:var(--fbody); font-size:var(--dk-md); font-weight:800; color:var(--ink); cursor:pointer;
}
@media (hover:hover){ #desk .dk-sug:hover{ border-color:var(--goldD); } }
/* §36 LAW 5 — NO EMOJI, and THE APP'S ONE SPEAKER (owner 2026-11-12: "let's wire this speaker in everywhere in the
   game"). The mark is the painted amber speaker the quest's own buttons wear, an <img> desk.view.js writes; it was a
   line mask in currentColor. This rule only gives it its box. */
#desk .dk-sug .spk{
  display:inline-block; width:var(--dk-spk); height:var(--dk-spk); vertical-align:-.2em; object-fit:contain;
}
#desk .dk-sug[data-silent] .spk{ visibility:hidden; }
#desk .dk-heard{ margin-top:var(--dk-g2); font-size:var(--dk-md); color:var(--mut); font-style:italic; }
#desk .dk-note{ margin-top:var(--dk-g2); font-size:var(--dk-sm); color:var(--mut); }

/* ══ THE COVER ═════════════════════════════════════════════════════════════════════════════════
   FOR A CHILD (owner, 2026-10-24: "It doesn't even make sense to me as a designer, let alone to a child"), on the
   first-look rule (2026-10-20): the required line quiet at the top, ONE gold button, her pages as little pages of her
   book, and the grown-up's switches folded shut at the foot with Delete behind them. */
/* the privacy line (RULINGS §9 ③ as the owner cut it): a line, not a box, on the cover, and since v532 the cover's LAST
   line, under the grown-ups' fold (owner, 2026-10-25: "Move [it] to the bottom of page"); the page keeps its parchment slot */
#desk #dkcover .dk-monitor{ background:none; color:var(--mut); padding:0 var(--dk-g3); margin:var(--dk-g4) auto 0; }
#desk #dkcover .dk-bar{ margin-top:var(--dk-g2); }
#desk #dkcover #dknew{ min-width:min(100%, 16rem); }
#desk .dk-shelf{
  max-width:var(--dk-page-max); margin:var(--dk-g4) auto 0; padding:0 var(--dk-g1);
  font-family:var(--fdisp); font-size:var(--dk-md); font-weight:900; color:var(--ink); text-align:left;
}
#desk .dk-shelf[hidden]{ display:none; }
#desk .dk-pieces{ max-width:var(--dk-page-max); margin:var(--dk-g2) auto 0; }
/* THE WHOLE ROW IS THE DOOR (§36 law 2). It is a div with a role rather than a button because it
   holds the Delete control; everything a button looks and feels like is stated here. */
/* A ROW IS A LITTLE PAGE OF HER BOOK (2026-10-24): the page's own paper and ink at every hour, and its red margin line
   down the left, so the cover reads as the book she writes in rather than a list of form fields. */
#desk .dk-piece{
  display:flex; align-items:center; gap:var(--dk-g2); flex-wrap:nowrap; width:100%; text-align:left;
  padding:var(--dk-g2) var(--dk-g3) var(--dk-g2) calc(var(--dk-g4) + var(--dk-g3)); margin-bottom:var(--dk-g2);
  min-height:var(--dk-tap); border-radius:var(--dk-rsm); border:var(--dk-hair) solid var(--dk-rule);
  background-color:var(--dk-paper); background-image:linear-gradient(90deg, transparent var(--dk-g4),
    var(--dk-margin) var(--dk-g4), var(--dk-margin) calc(var(--dk-g4) + var(--dk-margin-w)), transparent 0);
  color:var(--dk-ink); font:inherit; cursor:pointer;
  transition:border-color .12s ease, background-color .12s ease;
}
@media (hover:hover){ #desk .dk-piece:hover{ border-color:var(--goldD); } }        /* law 4: a colour, never a lift */
#desk .dk-piece.asking{ cursor:default; flex-wrap:wrap; }
@media (hover:hover){ #desk .dk-piece.asking:hover{ border-color:var(--line); } }
#desk .dk-piece .t{ flex:1 1 auto; min-width:0; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#desk .dk-piece .m{ flex:0 0 auto; font-size:var(--dk-sm); color:var(--dk-ink2); white-space:nowrap; }
/* the one control that cannot be the card: quiet, at the tap floor, and no gold anywhere near it */
#desk .dk-del{
  flex:0 0 auto; min-height:var(--dk-tap); padding:0 var(--dk-g3);
  border:var(--dk-hair) solid transparent; border-radius:var(--dk-r);
  background:none; color:var(--mut); cursor:pointer;
  font-family:var(--fbody); font-weight:700; font-size:var(--dk-sm);
  transition:color .12s ease, border-color .12s ease;
}
@media (hover:hover){ #desk .dk-del:hover{ color:var(--dk-ink); border-color:var(--dk-rule); } }
#desk .dk-del{ color:var(--dk-ink2); }
/* Delete is the grown-up's, so it shows only while the fold below is open — a child's cover carries no destructive
   control. The confirm it opens is unchanged. */
#desk #dkcover .dk-del{ display:none; }
#desk #dkcover:has(#dkgrown[open]) .dk-del{ display:inline-block; }
/* THE GROWN-UP'S FOLD: closed by default, quiet, at the foot of the cover */
#desk .dk-grown{ max-width:var(--dk-page-max); margin:var(--dk-g4) auto 0; text-align:center; }
#desk .dk-grown > summary{
  display:inline-flex; align-items:center; min-height:var(--dk-tap); padding:0 var(--dk-g3); cursor:pointer;
  font-family:var(--fbody); font-weight:700; font-size:var(--dk-sm); color:var(--mut);
}
#desk .dk-grown > summary::-webkit-details-marker{ display:none; }
#desk .dk-grown > summary::after{ content:'▾'; display:inline-block; margin-left:var(--dk-g1); transition:transform .15s ease; }
#desk .dk-grown[open] > summary::after{ transform:rotate(180deg); }
#desk .dk-grown[open] > summary{ color:var(--ink); }
#desk .dk-grown .dk-surf .msl{ font-size:var(--dk-sm); }
/* ── "HOW YOU TYPE": ONE TRACK, NOT TWO BROWSER BUTTONS ───────────────────────────────────────────
   (DESIGN-POLISH §1 system ④ and §5.2.) Everything these two pills LOOK like is the base above; what
   is left here is the thing only this row is: ONE track rather than two chips.
   THE TRACK HAS NO WRAPPER. #dksurf's children are static markup in index.html, which this lane does
   not edit, so the two halves ARE the track: the outer corners keep the base's --dk-pill radius, the
   inner ones are squared off, and the second pill is pulled back by exactly one border width so the
   seam between them is one line and not two. The `.on` half sits on z-index 1 so its gold edge owns
   that seam.
   FLEX, NOT INLINE-FLEX: this box keeps `max-width` + `margin:auto`, and an inline-level box cannot
   be centred by auto margins. Flex also drops the whitespace text nodes between the buttons, which
   is what would otherwise open a word-space gap in the middle of the track. */
#desk .dk-surf{
  max-width:var(--dk-page-max); margin:var(--dk-g3) auto 0; text-align:center;
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:0;
}
#desk .dk-surf .msl{ flex:1 0 100%; }
#desk .dk-surf .msub{ flex:1 0 100%; }
#desk .dk-surf .mpill:first-of-type{ border-radius:var(--dk-pill) 0 0 var(--dk-pill); }
#desk .dk-surf .mpill:last-of-type{
  border-radius:0 var(--dk-pill) var(--dk-pill) 0;
  margin-left:calc(-1 * var(--dk-edge));
}
#desk .dk-surf .mpill.on{ position:relative; z-index:1; }

/* the probe's instrument panel, kept and hidden behind ?desk=probe — a dev instrument, never a
   child's affordance. It reads and decides nothing. */
#desk .dk-probe{ max-width:var(--dk-page-max); margin:var(--dk-g3) auto 0;
                 font-family:var(--fbody); font-size:var(--dk-sm); color:var(--mut); text-align:left; }
#desk .dk-probe[hidden]{ display:none; }

/* ── THE PRINT BAR: FIVE CHOICES READ AS A LIST (§36 (b)) ────────────────────────────────────────
   Measured before the change: 494px tall at phone390 and 148 at laptop, for five settings and two
   buttons. The height was not the settings — it was the shape: five block labels inside a centred
   WRAPPING flex, each with its chips loose underneath it. One row per choice, label left, pills
   right, is the same five choices in a third of the height, and it is the shape every settings row
   in this app already has. */
/* THE ROWS THEMSELVES WRAP ON A WIDE SCREEN, in `em` rather than at a breakpoint: a basis of
   --dk-prow-min puts one choice per line on a phone and two side by side from a tablet up, so the
   laptop does not pay a phone's stacking (measured: block-stacked it was 280px there against 148
   before, which is this lane's own fault arriving from the other end). */
#desk .dk-printbar{
  display:flex; flex-wrap:wrap; align-items:flex-start; gap:0 var(--dk-g4);
  max-width:var(--dk-page-max); margin-inline:auto;
}
#desk .dk-prow{
  flex:1 1 var(--dk-prow-min);
  display:flex; align-items:center; flex-wrap:wrap; gap:var(--dk-g2);
  padding:var(--dk-g1) 0; border-bottom:var(--dk-hair) solid var(--line);
}
#desk .dk-prow .msl{ flex:1 1 auto; margin-bottom:0; text-align:left; }
/* UI POLISH 2026-11-10: ON A PHONE EVERY ROW STACKS, not only the rows that happen to overflow. At 390 "Letter size"
   and its two pills fit one line and "Shape" and "Show the corrections" did not, so the bar read as one row in one
   shape and two in another — the label beside its pills, then above them. The label takes its own line in all of them. */
@media (max-width:35em){
  #desk .dk-prow .msl{ flex-basis:100%; }
}
#desk .dk-pills{ flex:0 0 auto; display:inline-flex; align-items:center; }
#desk .dk-pbrk{ flex:0 0 100%; height:0; }
#desk .dk-pgo{ flex:0 0 auto; margin:var(--dk-g3) auto 0; }

/* ══ PRINT (spec §7) ═══════════════════════════════════════════════════════════════════════════
   ONE `.dk-sheet` PER PAGE AND NO FLEX OR GRID ANCESTOR — `break-inside: avoid` is unreliable
   inside both, so #dksheets is a plain block and every sheet is a plain block inside it. */
#desk .dk-sheets{ display:block; max-width:var(--dk-page-max); margin:var(--dk-g3) auto 0; --dk-pscale:1; }
#desk .dk-sheet{
  display:block; break-inside:avoid; break-after:page; page-break-after:always;
  /* the paper and its ink, never the look's: Midnight's and Night's --ink is near-white and wrote the "Words to look
     at" list cream on cream (1.09:1, polish survey 2026-11-11), the same fault §52 fixed on the book's page */
  background:var(--dk-paper); color:var(--dk-ink);
  border:var(--dk-hair) solid var(--line); border-radius:var(--dk-r);
  padding:var(--dk-g4); margin-bottom:var(--dk-g3);
  font-family:var(--fbody);
  font-size:calc(var(--dk-md) * var(--dk-pscale));
  line-height:var(--dk-print-lh);
}
#desk .dk-sheets.wide .dk-sheet{ line-height:var(--dk-print-lh-wide); }
#desk .dk-sheet:last-child{ break-after:auto; page-break-after:auto; }
/* ── LIKE MY BOOK (§52): the book's pages on the sheet, as the book drew them ─────────────────────
   print.js lays each page out in the book's own pixels (its width, its lines, its margins) so every
   line breaks where it broke on screen, then the SHEET is scaled to the paper: --dk-zs on screen (only
   ever smaller, to fit a narrow screen), --dk-zp on paper. */
#desk .dk-sheet.book{ background:none; border:none; padding:var(--dk-g2) 0; zoom:var(--dk-zs); }
#desk .dk-bwrapp{ break-inside:avoid; width:fit-content; margin:0 auto var(--dk-g4); }
#desk .dk-bpage{
  position:relative; overflow:hidden;
  background-color:var(--dk-paper); background-image:var(--dk-paper-tex); color:var(--dk-ink);
  border:var(--dk-hair) solid var(--line); border-radius:var(--dk-rsm); box-shadow:var(--dk-drop-sm);
  -webkit-print-color-adjust:exact; print-color-adjust:exact;
}
#desk .dk-bpage::before{
  content:''; position:absolute; top:0; bottom:0; left:var(--dk-margin-x); width:var(--dk-margin-w);
  background:var(--dk-margin);
}
/* ONE RULE TILED a line apart, not one long repeating gradient: the sheet is scaled to the paper, and a
   scaled repeating gradient drops some of its hairlines (the rules came out every second line in the
   first proof). A tile is drawn the same way every line. */
#desk .dk-brules{
  position:absolute; left:0; right:0;
  background-image:linear-gradient(to bottom,
    transparent calc(var(--dk-lh) - var(--dk-hair)), var(--dk-rule) calc(var(--dk-lh) - var(--dk-hair)));
  background-size:100% var(--dk-lh);
}
#desk .dk-btext{
  position:relative; overflow:hidden; white-space:pre-wrap; word-break:normal;
  font-family:var(--fbody); font-size:var(--dk-fs); line-height:var(--dk-lh);
}
#desk .dk-bnum{ text-align:center; font-size:var(--dk-sm); color:var(--dk-ink2); margin-top:var(--dk-g1); }
#desk .dk-sheet-h{ font-family:var(--fdisp); font-size:var(--dk-md); margin:0 0 var(--dk-g2); color:var(--dk-ink2); }
#desk .dk-sheet-body{ white-space:pre-wrap; }
#desk .dk-card{
  display:block; break-inside:avoid;
  padding:var(--dk-g3); margin-bottom:var(--dk-g3);
  border:var(--dk-edge) dashed var(--line); border-radius:var(--dk-r);
  font-size:calc(var(--dk-lg) * var(--dk-pscale));
}
#desk .dk-marklist{ margin:0; padding-left:var(--dk-g4); }
#desk .dk-marklist li{ break-inside:avoid; margin-bottom:var(--dk-g1); }
#desk .dk-mwrote{ text-decoration:underline wavy var(--dk-mark); text-decoration-skip-ink:none; }
#desk .dk-marrow{ margin:0 .5em; color:var(--dk-ink2); }
#desk .dk-mtarget{ font-weight:800; }

/* THE DESK OWNS THE PAPER WHEN IT PRINTS. index.html's own @media print block belongs to the
   certificate: it hides `.screen` and shows `#cert.show`, so printing from here would print an
   empty page. `body.deskprint` is set for the duration of the call and these rules out-specify it
   (an id beats a class), whichever sheet loaded first. */
@media print{
  body.deskprint #cert.show{ display:none !important; }
  body.deskprint #desk.show{ display:block !important; }
  body.deskprint #desk .card{ background:none; border:none; box-shadow:none; padding:0; }
  body.deskprint #desk .card::before{ display:none !important; }
  body.deskprint #desk .dk-cover,
  body.deskprint #desk .dk-book,
  body.deskprint #desk .dk-printbar,
  body.deskprint #desk .backrow,
  body.deskprint #desk h2{ display:none !important; }
  body.deskprint #desk .dk-sheets{ max-width:none; margin:0; }
  body.deskprint #desk .dk-sheet{
    -webkit-print-color-adjust:exact; print-color-adjust:exact;
    background:none; border:none; border-radius:0; padding:0; margin:0;
    font-size:calc(var(--dk-print-fs) * var(--dk-pscale));
  }
  body.deskprint #desk .dk-card{ padding:var(--dk-card-pad); margin-bottom:var(--dk-card-gap); }
  body.deskprint #desk .dk-sheet.book{ zoom:var(--dk-zp); }
  body.deskprint #desk .dk-bpage{ box-shadow:none; }
}
/* A4 and Letter both leave room for this; without it the browser's default margin varies by engine.
   `@page` cannot be nested under a selector, so it stands at the top of the print block — it is the
   same margin index.html's certificate block sets and the same one parent.html prints its report at. */
@media print{ @page{ margin:var(--dk-sheet-pad); } }

/* ══ THE BOOK TRAIL'S CARD (§24 row 35, WRITING-QUEST-SPEC §11 ②) ════════════════════════════════
   Under the finish line, only when this page made or revised her trail: the stops in trail order,
   each with its place's painting and up to three of her words (correct spellings), and one button to
   the first open stop. A stop ahead of her is quieter and says "When you get here". */
#desk .dk-trail{
  margin:var(--dk-g2) auto 0; max-width:var(--dk-page-max);
  display:grid; gap:var(--dk-g2); padding:var(--dk-g3);
  background:var(--card); border:var(--dk-hair) solid var(--line); border-radius:var(--dk-r);
}
#desk .dk-trail[hidden]{ display:none; }
#desk .dk-trail-h{ margin:0; text-align:center; font-family:var(--fdisp); font-size:var(--dk-md); color:var(--ink); }
#desk .dk-trail-stops{ display:grid; grid-template-columns:repeat(auto-fit, minmax(0, 1fr)); gap:var(--dk-g2); }
#desk .dk-trail-stop{ display:grid; gap:var(--dk-g1); align-content:start; min-width:0; }
#desk .dk-trail-stop img{
  width:100%; aspect-ratio:5 / 3; object-fit:cover; display:block;
  border-radius:var(--dk-rsm); border:var(--dk-hair) solid var(--goldD);
}
#desk .dk-trail-stop.later{ opacity:.6; }
#desk .dk-trail-n{ font-family:var(--fdisp); font-size:var(--dk-sm); color:var(--goldD); text-transform:uppercase; letter-spacing:.04em; }
#desk .dk-trail-stop b{ font-family:var(--fdisp); font-size:var(--dk-sm); color:var(--ink); overflow-wrap:anywhere; }
#desk .dk-trail-w{ display:flex; flex-wrap:wrap; gap:var(--dk-g1); }
#desk .dk-trail-w span{
  font-family:var(--fbody); font-size:var(--dk-sm); color:var(--parchInk);
  background:var(--parch); border-radius:var(--dk-rsm); padding:0 var(--dk-g1);
}
#desk .dk-trail-go{ justify-self:center; min-height:var(--dk-tap); }

/* ══ THE PRACTICE IDEAS (ROADMAP §57, launch board L206) ════════════════════════════════════════
   The owner, 2026-10-24: "a set of practice ideas to the writing desk, in addition to free writing" — the board-8
   mock-up, approved. On the COVER, a shelf of five tiles under the one gold button (the first-look rule keeps that
   button the only gold thing: a tile is a little page of the book, like her own pages below it). On the PAGE, the
   idea's card above the writing — on the open book, on the left page beside it — on the book's own paper and ink at
   every hour (the page's paper is theme-invariant, so the card is too). Its head folds it away, because on a phone
   the drawn board takes the bottom of the screen and the page is short. */
#desk{
  /* the reel's turn, a 24-grid stroke path in currentColor (the tools' own recipe). The five idea tiles' line drawings
     left on 2026-10-25 for PAINTED icons (desk.view.js IDEA_ICON): the owner read them as "Unicode icons". */
  --dk-i-spin:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.6'/%3E%3Cpath d='M20 4v5h-5'/%3E%3C/svg%3E");
}
#desk .dk-ideas{ max-width:var(--dk-page-max); margin:var(--dk-g4) auto 0; }
#desk .dk-ideas[hidden]{ display:none; }
#desk .dk-ideas .dk-shelf{ margin-top:0; }
#desk .dk-ideagrid{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap:var(--dk-g2);
  margin-top:var(--dk-g2);
}
#desk .dk-ideatile{
  display:flex; align-items:center; gap:var(--dk-g3); min-height:calc(var(--dk-tap) + var(--dk-g3)); min-width:0;
  padding:var(--dk-g2) var(--dk-g3); text-align:left; cursor:pointer;
  border:var(--dk-hair) solid var(--dk-rule); border-radius:var(--dk-rsm);
  background-color:var(--dk-paper); color:var(--dk-ink); font:inherit;
  transition:border-color .12s ease;
}
@media (hover:hover){ #desk .dk-ideatile:hover{ border-color:var(--goldD); } }                 /* law 4: a colour, never a lift */
/* the tile's picture: a painted icon (2026-10-25), drawn smooth at its own size — never through a mask or a filter */
#desk .dk-ideatile .ic{ flex:0 0 auto; width:var(--dk-idea-icon); height:var(--dk-idea-icon); object-fit:contain; }
#desk .dk-ideatile .tx{ display:grid; gap:var(--dk-g1); min-width:0; }
#desk .dk-ideatile .tx b{ font-family:var(--fdisp); font-weight:900; font-size:var(--dk-md); }
#desk .dk-ideatile .tx .s{ font-size:var(--dk-sm); color:var(--dk-ink2); line-height:1.3; }
#desk .dk-ideas-foot{ margin:var(--dk-g2) 0 0; font-size:var(--dk-sm); color:var(--mut); text-align:center; }

/* the card above the page */
#desk .dk-idea{
  max-width:var(--dk-page-max); margin:0 auto var(--dk-g2); color:var(--dk-ink);
  background-color:var(--dk-paper); background-image:var(--dk-paper-tex);
  border:var(--dk-hair) solid var(--dk-rule); border-radius:var(--dk-r);
}
#desk .dk-idea[hidden]{ display:none; }
#desk .dk-idea-head{
  display:flex; align-items:center; justify-content:space-between; width:100%; min-height:var(--dk-tap);
  padding:0 var(--dk-g3); border:none; background:none; color:var(--dk-ink); cursor:pointer; text-align:left;
  font-family:var(--fdisp); font-weight:900; font-size:var(--dk-md);
}
#desk .dk-idea-head::after{ content:'▾'; color:var(--dk-ink2); transition:transform .15s ease; }
#desk .dk-idea.folded .dk-idea-head::after{ transform:rotate(-90deg); }
#desk .dk-idea-body{ display:grid; gap:var(--dk-g2); padding:0 var(--dk-g3) var(--dk-g3); }
#desk .dk-idea-row{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--dk-g2); }
#desk .dk-idea-go{ flex:1 1 12rem; margin:0; font-size:var(--dk-sm); color:var(--dk-ink2); }
#desk .dk-idea-btn{ min-height:var(--dk-tap); }
#desk .dk-idea-count{ margin:0; font-size:var(--dk-sm); color:var(--dk-ink2); }
#desk .dk-idea-chips{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--dk-g1) var(--dk-g2); }
#desk .dk-idea-chips .lbl{ font-size:var(--dk-sm); color:var(--dk-ink2); }
#desk .dk-wchip{
  padding:var(--dk-g1) var(--dk-g2); border-radius:var(--dk-pill); border:var(--dk-hair) solid var(--dk-rule);
  background:var(--parchHi); color:var(--dk-ink); font-weight:800; font-size:var(--dk-sm);
}
/* a week's word her page uses: gold-edged and ticked (the marks font draws the tick); nothing red, ever */
#desk .dk-wchip.used{ border-color:var(--goldD); }
#desk .dk-wchip.used::after{ content:' ✓'; color:var(--goldD); }

/* silly sentences: three reels, each a button that turns it. ONE LINE A REEL on a phone (the label beside the words, at
   the tap floor), because the page under the card is short there; side by side, label over words, from 40em up. */
#desk .dk-reels{ display:grid; grid-template-columns:minmax(0, 1fr); gap:var(--dk-g1); }
#desk .dk-reel{
  position:relative; display:grid; grid-template-columns:5.5rem minmax(0, 1fr); align-items:center; gap:var(--dk-g1) var(--dk-g2);
  min-height:var(--dk-tap); min-width:0; overflow:hidden;
  padding:var(--dk-g1) calc(var(--dk-icon) + var(--dk-g3)) var(--dk-g1) var(--dk-g3); text-align:left; cursor:pointer;
  border:var(--dk-edge) solid var(--dk-rule); border-radius:var(--dk-rsm); background:var(--parchHi); color:var(--dk-ink);
  font:inherit; transition:border-color .12s ease;
}
@media (hover:hover){ #desk .dk-reel:hover{ border-color:var(--goldD); } }
#desk .dk-reel .l{ font-size:var(--dk-sm); color:var(--dk-ink2); text-transform:uppercase; letter-spacing:.04em; }
#desk .dk-reel .v{ font-weight:800; font-size:var(--dk-md); overflow-wrap:anywhere; }
#desk .dk-reel::after{
  content:''; position:absolute; right:var(--dk-g2); top:50%; width:var(--dk-icon-sm); height:var(--dk-icon-sm);
  transform:translateY(-50%); background:var(--dk-ink2);
  -webkit-mask:var(--dk-i-spin) center / contain no-repeat; mask:var(--dk-i-spin) center / contain no-repeat;
}
@media (min-width:40em){
  #desk .dk-reels{ grid-template-columns:repeat(3, minmax(0, 1fr)); gap:var(--dk-g2); }
  #desk .dk-reel{ grid-template-columns:minmax(0, 1fr); align-items:start; padding-top:var(--dk-g2); padding-bottom:var(--dk-g2); }
}
#desk .dk-reel.spun .v{ animation:dk-reel-roll .32s cubic-bezier(.2,.8,.3,1) both; }
@keyframes dk-reel-roll{ from{ transform:translateY(-110%); opacity:0; } to{ transform:none; opacity:1; } }
@media (prefers-reduced-motion:reduce){ #desk .dk-reel.spun .v{ animation:none; } }
body.nomo #desk .dk-reel.spun .v{ animation:none; }

/* a picture: the painting on the left, the four questions beside it; a tap shows it across the card */
#desk .dk-pic-row{ display:grid; grid-template-columns:minmax(0, 2fr) minmax(0, 3fr); gap:var(--dk-g3); align-items:start; }
#desk .dk-pic{ display:block; padding:0; border:var(--dk-hair) solid var(--goldD); border-radius:var(--dk-rsm); overflow:hidden; background:none; cursor:zoom-in; }
#desk .dk-pic img{ display:block; width:100%; aspect-ratio:3 / 2; object-fit:cover; }
#desk .dk-pic.big{ grid-column:1 / -1; cursor:zoom-out; }
#desk .dk-pic[hidden]{ display:none; }
#desk .dk-pic-side{ display:grid; gap:var(--dk-g2); align-content:start; min-width:0; }
#desk .dk-qs{ margin:0; padding:0; list-style:none; display:grid; gap:var(--dk-g1); font-size:var(--dk-sm); font-weight:700; }

/* stretch a sentence: the small start, then the four questions that grow it */
#desk .dk-stretch{ display:flex; flex-wrap:wrap; align-items:baseline; gap:var(--dk-g2); }
#desk .dk-stretch .lbl{ font-size:var(--dk-sm); color:var(--dk-ink2); }
#desk .dk-start{ font-family:var(--fdisp); font-size:var(--dk-lg); }

/* fix the mistakes: a note on ruled paper; "Show me where" underlines the two slips (gold, never red) */
#desk .dk-fixnote{
  padding:var(--dk-g2) var(--dk-g3); border-radius:var(--dk-rsm); border:var(--dk-hair) solid var(--dk-rule);
  background:var(--parchHi); font-size:var(--dk-md); line-height:1.6;
}
#desk .dk-fixnote p{ margin:0; }
#desk .dk-fixnote.reveal .slip{ text-decoration:underline wavy var(--goldD); text-underline-offset:.2em; }

/* ON THE OPEN BOOK the card is the left page's: it takes the row left free above the monitoring line, beside the
   writing, so the right page is the writing alone */
@media (min-width:67.5em){
  #desk #dkidea{
    grid-column:1; grid-row:5; align-self:start; position:relative; z-index:1; min-width:0; max-width:none;
    margin:var(--dk-g3) var(--dk-leaf-pad) 0; background:none; border-color:var(--dk-rule);
  }
}

/* THE PRESS (polish survey 2026-11-11, item 8): a page, an idea or a reel settles under a finger; a suggestion, a tool
   and a pill press in. Under reduced motion they dim instead. Tokens in kit/tokens.raw.css. */
#desk .dk-piece:not(.asking):active, #desk .dk-ideatile:active, #desk .dk-reel:active{ transform:scale(var(--press-card)); }
#desk .dk-sug:active, #desk .dk-tool:not(:disabled):active, #desk .mpill:not(:disabled):active{ transform:scale(var(--press-small)); }
@media (prefers-reduced-motion:reduce){
  #desk .dk-piece:not(.asking):active, #desk .dk-ideatile:active, #desk .dk-reel:active,
  #desk .dk-sug:active, #desk .dk-tool:not(:disabled):active, #desk .mpill:not(:disabled):active{ transform:none; opacity:var(--press-dim); }
}
