/* The Koukousk Solutions website. It starts from tokens.css (the koukousk-ui skill's own, copied
   unchanged) and follows the skill's references/web.md. Everything here is a translation of the
   Mac app's look to a page, so a ruling on this file belongs in the skill too. */

:root {
  /* Glass on a pale page has nothing to refract, so it is told apart by its edge and its shade. */
  --glass-solid: #ffffff;                 /* where there is no blur to be had */
  --glass-edge: rgba(0, 0, 0, 0.08);
  --glass-shade: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 18px rgba(0, 0, 0, 0.07);
  --lens-shade: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);

  --pool: rgba(255, 255, 255, 0.5);       /* the light pooling at the top of the surface */
  --band-glass: rgba(255, 255, 255, 0.12);   /* glass on the band, which is the opposite of the page */
  --band-rim: rgba(255, 255, 255, 0.2);
  --sheet-shade: 0 -18px 48px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass-solid: #37383b;
    --glass-edge: rgba(0, 0, 0, 0.3);
    --glass-shade: 0 6px 18px rgba(0, 0, 0, 0.22);
    --lens-shade: 0 0 0 0 transparent;
    --pool: rgba(255, 255, 255, 0.05);
  --band-glass: rgba(0, 0, 0, 0.07);
  --band-rim: rgba(0, 0, 0, 0.14);
    --band-glass: rgba(0, 0, 0, 0.07);
    --band-rim: rgba(0, 0, 0, 0.14);
  --sheet-shade: 0 -18px 48px rgba(0, 0, 0, 0.35);
    --sheet-shade: 0 -18px 48px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --glass-solid: #37383b;
  --glass-edge: rgba(0, 0, 0, 0.3);
  --glass-shade: 0 6px 18px rgba(0, 0, 0, 0.22);
  --lens-shade: 0 0 0 0 transparent;
  --pool: rgba(255, 255, 255, 0.05);
  --band-glass: rgba(0, 0, 0, 0.07);
  --band-rim: rgba(0, 0, 0, 0.14);
  --sheet-shade: 0 -18px 48px rgba(0, 0, 0, 0.35);
}

/* The display face where there is no Futura (Windows, Android): Jost Bold, which is drawn after
   it, kept in the site itself (fonts/, with its licence). The face is asked for after Futura in
   the tokens, so a device that has Futura never fetches this. The big lines wait for it and
   do not show first in another face and then change. */
@font-face {
  font-family: "Jost";
  font-weight: 700;
  font-style: normal;
  font-display: block;
  src: url("/fonts/jost-700.woff2") format("woff2");
}

/* The surface: the page is the one surface, lit from above. */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--surface-foot);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--surface-foot);      /* (the sheets are the surface; nothing fixed lies behind them to be repainted as they move) */
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* Glass. The fill is solid unless the browser can blur what is behind it. */

.glass {
  -webkit-backdrop-filter: none;      /* no blur unless something passes behind (below): it is */
  backdrop-filter: none;              /* the dearest thing a browser draws, and here it showed nothing */
  background: var(--glass-solid);
  box-shadow: inset 0 0 0 1px var(--glass-rim), 0 0 0 1px var(--glass-edge), var(--glass-shade);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-fill); }
}

/* A bar of choices, with one lens. */

.bar { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.bar > .item {
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  outline: none;                          /* the lens goes to whatever the keys are on */
  -webkit-tap-highlight-color: transparent;
}
.bar > .item[aria-current], .bar > .item:focus-visible { color: var(--text); }

.bar > .lens {
  width: var(--w, 0px);
  transform: translate(var(--x, 0px), -50%);
  border-radius: calc(min(var(--h) * 0.3, 14px) - 4px);    /* concentric with its bar */
  box-shadow: inset 0 0 0 1px var(--glass-rim), var(--lens-shade);
  transition: height 140ms ease-out;
}
.bar.pressed > .lens { height: calc(var(--h) + 4px); }      /* pressed, it swells a little past its bar */

/* Before the script has run, or without it, the lens lies on the page that is showing. */
.no-js .bar > .lens { display: none; }
.no-js .bar > .item { line-height: calc(var(--h) - 8px); border-radius: calc(min(var(--h) * 0.3, 14px) - 4px); }
.no-js .bar > .item[aria-current] { background: var(--lens-fill); box-shadow: inset 0 0 0 1px var(--glass-rim), var(--lens-shade); }
.no-js .bar > .item:focus-visible { box-shadow: 0 0 0 2px var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .bar > .lens { transition: none; }
}

/* The page. A pile of sheets, each the whole window: first the company, then one for each
   thing it makes. Each stays where it is while the next comes up over it and covers it, and the
   top of the next shows at the foot of the first, so it is plain there is more below. A sheet is
   the surface itself from edge to edge, never a card on it. What is on a sheet is sized from the
   window, both ways, so the room round it stays in proportion however big the window is.
   The page is not told to snap to a sheet. Safari snaps again whenever anything on the page
   changes its look, a button under the pointer included, and the sheet jumped to its end. A
   sheet goes all the way when its handle is pressed or let go of, and not otherwise. */

:root { --peek: clamp(64px, 8vh, 96px); }      /* how much of the next sheet shows at the foot of the first */

.sheet {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--gap);
  background:
    radial-gradient(circle max(620px, 45vw) at 50% -40px, var(--pool), transparent) no-repeat,
    linear-gradient(var(--surface-top), var(--surface-foot));
}
.sheet + .sheet { box-shadow: 0 -1px 0 var(--rule), var(--sheet-shade); }      /* its edge, on what it covers */
.sheet:not(:last-child) { min-height: calc(100vh - var(--peek)); min-height: calc(100dvh - var(--peek)); }      /* (the next one's edge shows under it) */

/* Each sheet is a layer of its own, drawn once and then only moved, on every device. Left to
   itself a browser may draw a sheet into the page and paint the window again at each step of a
   scroll, which is what a slow machine cannot keep up with. */
.sheet { will-change: transform; }

/* Under a finger the pile scrolls inside itself, and the page does not scroll at all. A phone's
   browser hides its bars as a page scrolls and brings them back, and the window is a different
   height each time. Seen on an iPhone: the sheets shifted at every change, and the last one
   came to rest well short of the top. A page that does not scroll keeps its bars where they
   are, so the pile is one size from start to finish, and a sheet takes its height from the pile
   and not from the window. */
@media (hover: none) and (pointer: coarse) {
  html, body { height: 100%; min-height: 0; overflow: hidden; }
  .pile {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .pile > .sheet { min-height: 100%; }
  .pile > .sheet:not(:last-child) { min-height: calc(100% - var(--peek)); }
}

/* One block in the middle of a sheet: a big line, and under it, to the same width, what it is. */

.block {
  --s: max(2.5rem, min(14.2vw, 14.5vh));  /* the big line's size: the window's width or its height, whichever runs out first */
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}
.block > .display {
  margin: 0;
  font-size: var(--s);
  text-align: center;
}
.company h1 > span { display: block; }

/* The company's mark: the pieces of the cut fruit, beside its name and as tall as its two
   lines, the way a product's sheet has its own mark beside its name. A window taller than it
   is wide has no room beside, so there the mark stands over the name. (Which picture of it a
   device is shown is settled below, with a product's icon.) */
.company .block { --s: max(2.5rem, min(14.2vw, 11.2vh)); }
.company .block > .icon, .company .block > .mark {
  height: min(calc(var(--s) * 3.3), 25vh);
  margin-bottom: calc(var(--s) * 0.3);
}
@media (min-aspect-ratio: 1/1) {
  .company .block {
    --s: max(2.5rem, min(9.7vw, 16.5vh));
    display: grid;
    grid-template-columns: auto auto;
    column-gap: calc(var(--s) * 0.34);
    align-items: center;
  }
  .company .block > .icon, .company .block > .mark { height: calc(var(--s) * 1.86); margin: 0; }
  .company .block > .display { text-align: left; }
  .company .block > .lead { grid-column: 1 / -1; }
}
.block > .lead {
  box-sizing: border-box;
  width: 0;                               /* the big line sets how wide the block is, unless it */
  min-width: max(100%, min(100vw - var(--gap) * 2, 32rem));      /* is too small a line to set text to */
  margin: max(var(--gap), calc(var(--s) * 0.22)) 0 0;
  font-size: max(17px, calc(var(--s) * 0.19));
  line-height: 1.45;
  text-align: justify;                    /* straight down both sides, under the big line's own two ends */
  text-align-last: center;
}

/* A thing it makes: its mark and its name as one line, the way its own first page has them. */

.solution h2 {
  display: flex;
  align-items: center;
  gap: 0.22em;
}
.mark {
  flex: none;
  height: 1.16em;
  width: auto;
  fill: var(--accent);
}

/* Its icon. An Apple device sees the glass drop of the one its Mac shows, cut out of its tile,
   the same drop as in its tab (img/squirt-drop.webp, made by make_tab_icons.sh). There is no
   icon made for anything else yet, so anything else sees the plain mark for the time being.
   The company's own mark goes the same way (img/koukousk-pieces.webp, its tab's glass pieces).
   (Safari is known by the stylesheet alone; other browsers on an Apple device by the script.) */
.icon {
  display: none;
  flex: none;
  height: 1.16em;
  width: auto;
}
.apple .icon { display: block; }
.apple .icon + .mark { display: none; }
@supports (font: -apple-system-body) {
  .icon { display: block; }
  .icon + .mark { display: none; }
}

.solution .lead { text-align: center; text-wrap: balance; }      /* too few lines to pull out to both sides */
.solution .word { margin-top: max(var(--gap), calc(var(--s) * 0.3)); }

/* A button of words: one piece of glass, with the lens in it while the pointer is on it. */

button.word {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.word {
  position: relative;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  padding: 0 var(--gap);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.word::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: calc(min(var(--h) * 0.3, 14px) - 4px);
  background: var(--lens-fill);
  box-shadow: inset 0 0 0 1px var(--glass-rim), var(--lens-shade);
  opacity: 0;
  transition: inset 140ms ease-out;
}
.main.word::before { background: rgba(255, 255, 255, 0.24); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.word > * { position: relative; }
.word:hover::before, .word:focus-visible::before { opacity: 1; }
.word:active::before { opacity: 1; inset: -3px; }

.glass.main.word { color: var(--on-accent); }

/* A dock: the way out at the left, the choices in one bar in the middle, the main thing to do at
   the right. Over it, one line saying what the choice under the lens is. */

.dock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--gap);
}
.caption {
  min-height: 1.5em;
  margin: 0 0 var(--gap-in);
  font-size: 14px;
  color: var(--text-soft);
  text-align: center;
}
button.item {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.bar > .item[aria-pressed="true"] { color: var(--text); }

/* The way back to the company: at the top left of the window, where a way back is looked for. */

.out {
  --h: 44px;
  position: fixed;
  left: var(--gap);
  top: var(--gap);
  z-index: 20;
  justify-content: center;
  width: var(--h);
  padding: 0;
}
.out {      /* (the one piece of glass the page moves under) */
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  backdrop-filter: blur(18px) saturate(1.6);
}
.out svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Squirt, in a browser. What shows is by its state: empty, loaded, running, done, refused. */

.squirt { flex-direction: column; }
.squirt [data-for] { display: none; }
.squirt[data-state="loaded"] [data-for="loaded"],
.squirt[data-state="running"] [data-for="running"],
.squirt[data-state="done"] [data-for="done"],
.squirt[data-state="refused"] [data-for="refused"] { display: flex; }
.squirt[data-state="loaded"] p[data-for="loaded"] { display: block; }

.squirt .drophere { cursor: pointer; }
.squirt .drophere h1 {
  --s: max(1.25rem, min(6.5vw, 11vh));    /* one line, as the app has it, so smaller than a name */
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-size: var(--s);
}
.squirt:not([data-state="empty"]) .drophere { display: none; }
.squirt.over { box-shadow: inset 0 0 0 3px var(--accent); }      /* something is held over it */

.work { display: none; }
.squirt:not([data-state="empty"]) .work {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--gap) * 3);
  max-width: 100%;
}
.drop {
  flex: none;
  height: min(46vh, 52vw);
  width: auto;
}
.drop-back { fill: var(--glass-fill); }
.drop-juice { fill: var(--accent); opacity: 0.86; transition: y 240ms ease-out, height 240ms ease-out; }
.drop-edge { fill: none; stroke: var(--rule); stroke-width: 3; }
.told { width: min(44vw, 30rem); }
.told .title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.told .line { margin: var(--gap-in) 0 0; color: var(--text-soft); }
.told .yield {
  display: none;
  margin: var(--gap) 0 0;
  font-size: clamp(28px, 4.6vh, 44px);
  color: var(--accent);
}
.told .yield small { font: 400 16px/1 var(--body); letter-spacing: 0; text-transform: none; color: var(--text-soft); }
.told .came {
  display: none;
  max-height: 22vh;
  margin: var(--gap) 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  font-size: 14px;
}
.squirt[data-state="done"] .yield, .squirt[data-state="done"] .came { display: block; }
.came li { display: flex; justify-content: space-between; gap: var(--gap); padding: 3px 0; }
.came a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.came a:hover, .came a:focus-visible { text-decoration-color: var(--accent); outline: none; }
.came span { flex: none; color: var(--text-soft); font-variant-numeric: tabular-nums; }

.docks { margin-top: calc(var(--gap) * 2); }
.squirt[data-state="empty"] .docks { display: none; }

/* Getting it. */

.getit h2 { --s: max(1.25rem, min(6.6vw, 12vh)); font-size: var(--s); white-space: nowrap; }
.getit .dock { margin-top: max(var(--gap), calc(var(--s) * 0.34)); }
/* What there is to know about a thing, kept out of the way: a small button, and a panel that
   comes out of its glass and stands clear of it by the gap inside a group. */

.info { --h: 44px; position: relative; display: flex; width: var(--h); }      /* (as tall and as wide as the dock's glass) */
/* Where there is nothing made for the chosen kind of device there is nothing to know, and the
   button is not there. It goes into the row and comes out of it as the button beside it changes,
   in the same glide, and the row closes up over it. */
.info.gone {
  width: 0;
  margin-left: calc(var(--gap) * -1);      /* (and the gap it stood behind) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.info.gone .info-button { transform: scale(0.6); }
.info.live { transition: width var(--glide), margin-left var(--glide), opacity 200ms ease, visibility 0s linear 0s; }
.info.live.gone { transition: width var(--glide), margin-left var(--glide), opacity 200ms ease, visibility 0s linear 360ms; }
.info.live .info-button { transition: transform var(--glide); }
.info-button { justify-content: center; width: var(--h); padding: 0; color: var(--text-soft); }
.info-button:hover, .info-button:focus-visible, .info.open .info-button { color: var(--text); }
.info-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.info-button svg .dot { fill: currentColor; stroke: none; }
.info-panel {
  position: absolute;
  top: calc(100% + var(--gap-in));
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  height: auto;
  padding: 12px 16px;
  border-radius: 13px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--text-soft);
  transform-origin: calc(100% - 22px) 0;      /* (out of the middle of its button) */
  transform: scale(0.5);
  opacity: 0;
  visibility: hidden;
  transition: transform 220ms ease-in, opacity 160ms ease, visibility 0s linear 220ms;
}
.info.open .info-panel {
  transform: none;
  opacity: 1;
  visibility: visible;
  transition: transform var(--rise), opacity 160ms ease, visibility 0s linear 0s;
}
.info-panel a { color: var(--text); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; outline: none; }
.info-panel a:hover, .info-panel a:focus-visible { text-decoration-color: var(--accent); }



/* A button with two wordings, one showing. Both lie in the same place and it is as wide as the
   one showing (the script gives it that width). Going from one to the other it glides: its
   width, its colour and its words all ease across, and the row moves with it, not in a jump.
   Idle, it is plain glass that says how things stand and does nothing. */
.swap {
  justify-content: center;
  white-space: nowrap;
}
.swap.live { transition: width var(--glide), background-color 280ms ease, box-shadow 280ms ease, color 280ms ease; }
/* The wording that shows is in the row and in the middle of the button. The other is lifted out
   and laid over that same middle, unseen, so it takes no room and pushes nothing aside. */
.swap.live > span { transition: opacity 200ms ease, visibility 0s linear 0s; }
.swap > .cannot, .swap.idle > .can {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  visibility: hidden;
}
.swap.idle > .cannot {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  opacity: 1;
  visibility: visible;
}
.swap.live > .cannot, .swap.live.idle > .can { transition: opacity 200ms ease, visibility 0s linear 200ms; }
.swap.live.idle > .cannot { transition: opacity 200ms ease, visibility 0s linear 0s; }
.glass.main.word.idle {
  background: var(--glass-solid);
  box-shadow: inset 0 0 0 1px var(--glass-rim), 0 0 0 1px var(--glass-edge), var(--glass-shade);
  color: var(--text-soft);
  cursor: default;
  pointer-events: none;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .glass.main.word.idle { background: var(--glass-fill); }
}


/* The band: a thing said across the whole window, on the opposite of the surface, with two
   buttons under it: the one that stops it being said again, and at the right the way on. */

.band-hold {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  animation: band-in 210ms ease-in-out;
}
.band-hold[hidden] { display: none; }
.band {
  box-sizing: border-box;
  width: 100%;
  padding: calc(var(--gap) * 2) var(--gap);
  background: var(--ink);
  color: var(--stage);
  text-align: center;
}
.band h2 {
  margin: 0;
  font-size: clamp(1.15rem, min(5.2vw, 9vh), 4rem);      /* a head of some length still goes on one line */
  text-wrap: balance;
  color: var(--accent);
}
.band .dock { margin-top: var(--gap); }
.band .glass:not(.main) {
  background: var(--band-glass);
  box-shadow: inset 0 0 0 1px var(--band-rim);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: inherit;
}
.band .glass:not(.main)::before { background: var(--band-glass); box-shadow: inset 0 0 0 1px var(--band-rim); }
@keyframes band-in { from { opacity: 0; } to { opacity: 1; } }

/* The one band that explains (the owner asked for it): a head, why, the steps, where they are
   kept, and its two buttons. What it says is read, so it is in the text face at a reading
   size, in a column, and the steps are a list from the left. Too tall for a short window, it
   scrolls inside itself. */
.band.long { max-height: 100%; overflow-y: auto; }
.band.long h2 { font-size: clamp(1.15rem, min(4.6vw, 6vh), 2.75rem); }
.band.long p, .band.long ol {
  max-width: 34rem;
  margin: var(--gap) auto 0;
  font-size: 15px;
  line-height: 1.5;
  text-wrap: pretty;
}
.band.long ol { padding-left: 1.5em; text-align: left; }
.band.long li + li { margin-top: 6px; }
.band.long li::marker { color: var(--accent); font-weight: 600; }
.band.long p a, .band.long li a { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; outline: none; }
.band.long p a:hover, .band.long p a:focus-visible { color: var(--accent); }

/* A phone's line is too short to be pulled out to both sides without gaps opening in it, so
   there the text is centred: the same on both sides, as the big line is. */

@media (max-width: 600px) {
  .block > .lead { text-align: center; text-wrap: balance; }
  .squirt:not([data-state="empty"]) .work { flex-direction: column; gap: var(--gap); }
  .drop { height: min(30vh, 60vw); }
  .told { width: 100%; text-align: center; }
  .came li { text-align: left; }
  .dock > .bar > .item { padding: 0 10px; font-size: 13px; }
}

/* A window too short to hold a sheet whole: the sheets go by one after another instead. */

@media (max-height: 520px) {
  .sheet { position: static; padding-bottom: calc(var(--gap) * 4); }
}

/* The filer: the company's page, where each thing it makes is a folder and its name is on a tab
   standing on the folder's top edge. With every folder down, their tabs stand in a row at the
   foot of the window, the later folder in front of the one before and a step lower, so that
   each tab shows. A folder comes up to just under the top of the window, where its tab still
   shows, and those in front of it stay at the foot (a sheet sticks at both ends). The tab is
   the sheet's own surface, with its own edge: pressed, or taken hold of, it moves its folder.

   --n is how many folders there are and --k which one a sheet is (both in the page).
   --win is the window's height, or the pile's where the pile is what scrolls. */

.pile.filer {
  --tab: 34px;                                    /* a tab's height */
  --step: calc(var(--tab) + var(--gap-in));       /* how much lower each folder stands than the one behind it */
  --lip: var(--gap);                              /* how much of the front folder shows under its tab */
  --win: 100vh;
  --tab-w: min(160px, calc((100vw - var(--gap) * 2 + var(--gap-in)) / var(--n) - var(--gap-in)));
}
.pile.filer > .company { min-height: calc(var(--win) - var(--lip) - (var(--n) - 1) * var(--step)); }
.pile.filer > .solution {
  --foot: calc(var(--lip) + (var(--n) - 1 - var(--k)) * var(--step));      /* how much of it shows when it is down */
  top: var(--tab);
  bottom: calc(var(--foot) * 2 - var(--step) + var(--tab) - var(--win));
  min-height: calc(var(--win) - var(--tab) - var(--foot) + var(--step));      /* (the next one's top shows under it) */
}
.pile.filer > .solution:last-child {
  bottom: calc(var(--foot) + var(--tab) - var(--win));
  min-height: calc(var(--win) - var(--tab));
}
@media (hover: none) and (pointer: coarse) {
  @supports (height: 1cqh) {
    .pile.filer { container-type: size; --win: 100cqh; }
  }
}
@media (max-height: 520px) {
  .pile.filer > .solution, .pile.filer > .solution:last-child { top: auto; bottom: auto; }
}

.tab {
  --from-middle: calc((var(--k) - (var(--n) - 1) / 2) * (var(--tab-w) + var(--gap-in)));
  position: absolute;
  bottom: 100%;
  left: calc(50% + var(--from-middle) - var(--tab-w) / 2);
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--tab-w);
  height: var(--tab);
  border-radius: min(var(--tab) * 0.3, 14px) min(var(--tab) * 0.3, 14px) 0 0;
  /* (the sheet's own surface carried up into it: the same pool of light, from the same place) */
  background:
    radial-gradient(circle max(620px, 45vw) at calc(50% - var(--from-middle)) calc(var(--tab) - 40px), var(--pool), transparent) no-repeat,
    var(--surface-top);
  color: var(--text-soft);
  font: 600 13px/1 var(--body);
  text-decoration: none;
  white-space: nowrap;
  cursor: grab;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.tab::before {      /* its edge: round the top and down both sides, to where the sheet's own edge begins */
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: 1px;
  left: -1px;
  border: 1px solid var(--rule);
  border-bottom: 0;
  border-radius: calc(min(var(--tab) * 0.3, 14px) + 1px) calc(min(var(--tab) * 0.3, 14px) + 1px) 0 0;
  pointer-events: none;
}
.tab:hover, .tab:focus-visible { color: var(--text); }
html.holding .tab { cursor: grabbing; }

/* The handle: the top edge of every sheet but the first, as wide as the sheet and as tall as
   the strip of it that shows. In its middle an arrow, drawn on the sheet itself: up while the
   sheet can be brought up, flattening as it rises, and down once it is up. It can be pressed,
   or taken hold of with the pointer and dragged, and the sheet goes with the hand. */

.handle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--peek);
  color: var(--text-soft);
  cursor: grab;
  outline: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
.handle:hover, .handle:focus-visible { color: var(--text); }
.handle svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  will-change: transform;      /* (a layer of its own: redrawing the arrow redraws nothing of the sheet) */
}
html.holding, html.holding .handle { cursor: grabbing; }
html.at-top .handle svg { animation: nudge 1.8s ease-in-out infinite; }      /* at rest at the top, it asks */
@keyframes nudge { 0%, 100% { transform: translateY(2px); } 50% { transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .word::before, .swap, .swap > span, .info, .info .info-button, .info-panel, .info.open .info-panel { transition: none; }
  .band-hold { animation: none; }
  html.at-top .handle svg { animation: none; }
}
