/* THE PAGE KIT — the look of the two components every page borrows.
 *
 * WHAT THIS FILE IS. `PAGE_DESIGN_LAWS.md` section 12 says a global law
 * is implemented ONCE, as a resource, and that anything built afterwards
 * is built around that resource rather than beside it. This stylesheet is
 * the popup's and the accordion's half of that resource; `popup.js` and
 * `accordion.js` are the other half, and the two Jinja macros in
 * `_kit_popup.html` and `_kit_accordion.html` are how a page asks for
 * them. A popup that is not made from these is a red, not a debt.
 *
 * WHAT THIS FILE MAY NOT CONTAIN. Section 13: the measures belong to the
 * resource, not to the law — and the resource for a measure is the token
 * set at the head of `abbundo.css`, not this file. So there is no length,
 * no duration and no colour written out below: every one of them is a
 * `var(--…)` that `:root` defines. The `kit-tokens` gate parses this file
 * and proves it both ways — no literal here, and no `var()` here naming a
 * token that `:root` does not define. A number that is missing is ADDED
 * TO THE TOKEN SET; it is never written down here.
 *
 * WHY THERE IS NO MEDIA QUERY. A media query cannot read a custom
 * property, so a breakpoint written here would be exactly the literal the
 * rule above forbids. The grid drops from two columns to one by
 * `repeat(auto-fit, minmax(var(--kit-col-min), 1fr))` instead — the same
 * behaviour, decided by the one token that says how narrow a column of
 * controls may become.
 *
 * THIS FILE IS LOADED BY THE PAGES THAT USE THE KIT, not by the shell: no
 * page template is touched by the round that wrote it (C.58a), and the
 * demo page at `/dev/kit` is for now its only reader.
 */

/* ------------------------------------------------------------------ *
 * POPUP                                                              *
 * ------------------------------------------------------------------ */

/* The box. `display: none` with `display: flex` under `[open]` rather
 * than a plain `display: flex`, because the browser's own rule for a
 * dialog that is not open is `display: none`, and a component that
 * overrode that unconditionally would stand on every page all the time.
 * The site's `.prepare-pop` has done it this way since the prepare popup
 * was built; the kit inherits the shape rather than inventing a second.
 *
 * `overscroll-behavior: contain` is the site's scroll-chaining law (the
 * owner's finding of 31.08.2026: a list scrolled to its end handed the
 * rest of the wheel to the page underneath and the drawing slid away).
 * The chain is cut where it would be handed on. Nothing switches
 * `overflow: hidden` on the document — that cure was tried, it clipped
 * every sentence on the page, and it is not coming back. */
.kit-pop {
  width: min(var(--pop-width), calc(100% - var(--pop-gutter)));
  max-height: min(var(--pop-height), var(--pop-height-cap));
  padding: 0;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: contain;
}

/* `overflow: hidden` stated again under `[open]` (fix-wheel, 03.10.2026):
 * the site's rule for every open dialog (abbundo.css, "AN OPEN POPUP
 * HOLDS THE PAGE STILL") is `dialog[open] { overflow-y: auto }`, whose
 * element-and-attribute weight beats the plain class above, so the kit's
 * box became a second scrolling box around its own body. On the account
 * page's title-block tab it held 227 px of nothing at 1440 x 900, and
 * scrolling that box carries the title out of sight. The kit's body is the one
 * scrolling box; the page behind is held still by popup.js's wheel and
 * fields.js's keys, which never needed the box to scroll. */
.kit-pop[open] { display: flex; overflow: hidden; }

/* A PANE'S OWN ADDRESS WITH NO SCRIPT: a link to `#kit-pop-<name>-pane-
   <pane>` shows that pane inside a popup that stands in the flow (the
   sign-in popup's "no account yet?" link on the door). `!important`
   because the site's own `[hidden]` rule carries it too. */
.kit-pop-pane:target { display: block !important; }

/* A PANE'S OWN ADDRESS WITH NO SCRIPT: a link to `#kit-pop-<name>-pane-
   <pane>` shows that pane inside a popup that stands in the flow (the
   sign-in popup's "no account yet?" link on the door). `!important`
   because the site's own `[hidden]` rule carries it too. */
.kit-pop-pane:target { display: block !important; }

.kit-pop::backdrop { background: var(--scrim); }

/* THE WAY IN WITH SCRIPTING BLOCKED (C.58 step 3, from the start page's
   old law: "a reader with no script meets a panel that can be opened").
   An opener is written as a link to the popup's own address —
   `<a href="#kit-pop-faq" data-kit-open="faq">` — and with the script
   running the click never changes the address, because `popup.js` takes
   the press and opens the modal. Without the script the link does what
   a link does: the dialog becomes the document's `:target`, and this
   rule shows it IN PLACE, in the page's flow, as the plain section it
   is. A popup that the script has opened carries `[open]` and is not
   this case; a dialog the page LOADED with a hash naming it is opened
   by the script at once and the hash taken off the address, so the two
   readings never stand at the same time. */
.kit-pop:target:not([open]) {
  display: flex;
  position: static;
  max-height: none;
  margin: var(--s4) auto;
}

/* A popup whose purpose has parts needs room for two columns of controls
 * beside each other; one whose purpose has none does not. The wide box is
 * asked for by the macro, never by a page's own stylesheet. */
.kit-pop-wide { width: min(var(--pop-width-wide), calc(100% - var(--pop-gutter))); }

/* The head: the title on the left, the way out on the right. Fixed
 * height in the flex column (`flex: none`), so the body below it is the
 * part that scrolls and the title never leaves the screen. */
.kit-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  border-bottom: var(--hairline) solid var(--line);
  flex: none;
}

.kit-pop-title { font-weight: 600; margin: 0; }

.kit-pop-close {
  flex: none;
  min-width: var(--tap);
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--motion-quick), color var(--motion-quick);
}

.kit-pop-close:hover { background: var(--panel-sunken); color: var(--ink); }

/* The way back to the content a page opened inside the popup replaced
 * (popup.js `visit`, fix-wheel round 03.10.2026): the kit's arrow and
 * its word, at the head's start, the title after it taking the room. It
 * is built by the script the first time a page is visited and stands
 * only while one is. */
.kit-pop-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: var(--tap);
  padding: 0 var(--s2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
  transition: background var(--motion-quick), color var(--motion-quick);
}

.kit-pop-back:hover { background: var(--panel-sunken); color: var(--ink); }

.kit-pop-back:not([hidden]) ~ .kit-pop-title { flex: 1 1 auto; }

/* The tab strip, when the purpose has parts. One row, no wrapping into a
 * second line that would change the head's height as the popup opens. */
.kit-pop-tabs {
  display: flex;
  gap: var(--s1);
  padding: var(--s2) var(--s4) 0;
  border-bottom: var(--hairline) solid var(--line);
  flex: none;
}

.kit-pop-tab {
  border: 0;
  border-bottom: var(--hairline) solid transparent;
  /* Square at the bottom, rounded at the top. The site's button rules
     give every button a radius, and a radius on a box that carries ONLY
     a bottom border makes that border curl up at both ends — the active
     tab then reads as half a box rather than as an underline (seen in
     the first golden of this component, round C.58a). The top corners
     keep the radius, because they are what the hover background fills. */
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--ink-soft);
  padding: var(--s2) var(--s3);
  min-height: var(--tap);
  cursor: pointer;
  font: inherit;
  transition: color var(--motion-quick), border-color var(--motion-quick);
}

.kit-pop-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* The body is the one scrolling box. `min-height: 0` is what lets a flex
 * child shrink below its content and scroll instead of pushing the foot
 * off the bottom of the box. */
.kit-pop-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding: var(--s4);
}

/* Section 2 of the laws: the controls of a group share one grid, labels
 * above controls, equal columns, one gutter. Two columns where the popup
 * is wide enough for them and one where it is not, decided by the column
 * token and not by a breakpoint. */
.kit-pop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--kit-col-min), 1fr));
  gap: var(--s4);
}

.kit-pop-text { max-width: var(--measure); color: var(--ink-soft); margin: 0; }

/* The rhythm inside a popup's body. Every block after the first stands
   one step below the one before it — the site's own paragraph margins
   are taken away by the rule above, and something has to put the gap
   back, once, here, rather than in each page that fills a popup. */
.kit-pop-body > * + *,
.kit-pop-pane > * + * { margin-top: var(--s4); }

/* The foot belongs to the ACTIVE TAB (section 5): one row per tab, the
 * others carrying `hidden`. The note beside the action is the slot the
 * three-words line stands in. */
.kit-pop-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-top: var(--hairline) solid var(--line);
  flex: none;
}

.kit-pop-foot[hidden] { display: none; }

/* EVERY POPUP ACTION ONCE, IN THE STICKY FOOT (C.160, owner 06.10. and
 * 10.10.2026: "Fertig" and "Vorgaben speichern" stood twice, once in the
 * foot and once at the end of the content). A row of actions that a
 * form keeps in its markup - so it posts with the script blocked - but
 * that belongs to the popup's foot carries `data-kit-to-foot`; popup.js
 * (`toFoot`) moves it into the foot, where it is one of the foot's
 * parts: no box of its own, its controls in the foot's one row. It
 * follows its tab like every other part of the foot (`data-kit-foot`). */
.kit-pop-foot-part {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  align-items: center;
}
.kit-pop-foot-part[hidden] { display: none; }

/* THE TAB STRIP STAYS IN REACH (C.160, owner 10.10.2026: the account
 * settings' tabs scrolled away in every tab but the Plankopf). A strip
 * that stands inside the popup's scrolling body - the settings panel's,
 * on the start page, the account page and in the job's settings popup -
 * sticks to the body's top edge while the panes scroll under it, and
 * carries the panel's own ground so no line shows through it. Its height
 * is the body's reserve at the top (kit/stickyfoot.js reads the
 * `data-sticky-head` mark), so a line the keyboard or a jump brings into
 * view stops under it, never behind it. The kit's own strip in the
 * popup's head needs none of this: it stands outside the body. */
.kit-pop-body .kit-pop-tabs {
  position: sticky;
  /* a sticky row stops at the box's padding, not at its edge, so the
     body's own padding above it is taken back: stuck, the strip stands
     flush with the top of the body and no line scrolls past above it */
  top: calc(-1 * var(--s4));
  z-index: 3;
  background: var(--panel);
}

/* A head stacked under another that would slide under it leaves whole
 * instead (kit/stickyfoot.js `leave`): hidden where it stands, so no
 * line moves, and back the moment the reader scrolls back to it. */
[data-sticky-gone] { visibility: hidden; }

/* A sticky strip holds only inside its parent box. The job's settings
 * fragment stands its strip in the part before the form (beside the
 * Plankopf pane, the only pane that part holds), which ends long before
 * the Zeichnung and Papier panes do; so that part gives way and the
 * strip's box is the whole fragment, as the settings panel is on the
 * start page and the account page. */
.kit-pop .kit-formpage.is-fragment > .kit-formpage-before:has(> .kit-pop-tabs) {
  display: contents;
}

/* THE SCROLL CUE (batch 38; kit/scrollcue.js). A box marked
 * `data-scroll-cue` that has more than it shows fades out at the edge
 * where it continues - the sign that the list scrolls in its own box, so
 * a line the edge cuts never stands there unexplained. The script says
 * which edge from the real scroll position; without it nothing fades.
 * Only the mask's opacity counts, so the opaque ink token draws it. A
 * line the keyboard reaches is brought clear of the fade. */
[data-scroll-cue] { scroll-padding-bottom: var(--s7); }
[data-scroll-cue][data-scroll-more="below"] {
  mask-image: linear-gradient(to bottom, var(--ink) calc(100% - var(--s7)), transparent);
}
[data-scroll-cue][data-scroll-more="above"] {
  mask-image: linear-gradient(to top, var(--ink) calc(100% - var(--s7)), transparent);
}
[data-scroll-cue][data-scroll-more="both"] {
  mask-image: linear-gradient(to bottom, transparent, var(--ink) var(--s7),
                              var(--ink) calc(100% - var(--s7)), transparent);
}

.kit-pop-note { margin-right: auto; color: var(--ink-soft); }

/* ------------------------------------------------------------------ *
 * POPUP, PHONE MODE (C.96, page design law P16, global)              *
 * ------------------------------------------------------------------ */

/* At the kit's one width (where it stacks) every kit popup opens as a
 * sheet from the foot of the glass, at most --pop-height-phone of it
 * high: the title on top, the tabs and the body below it, the foot with
 * its one action, and the way out - its written name, as wide as the
 * sheet - at the very bottom, where the thumb is. The head's box gives
 * way (`display: contents`) so its title and its close control can stand
 * at the two ends. The picture popup is not a sheet: the picture is the
 * whole box. */
@media (max-width: 35rem) {
  .kit-pop:not(.kit-pop-picture) {
    width: auto;
    max-width: none;
    max-height: var(--pop-height-phone);
    inset-inline: 0;
    margin: auto 0 0 0;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: 0;
  }
  .kit-pop:not(.kit-pop-picture) > .kit-pop-head { display: contents; }
  .kit-pop-back { order: 0; align-self: flex-start; margin: var(--s2) var(--s3) 0; }
  .kit-pop-title { order: 0; flex: none; padding: var(--s3) var(--s3) var(--s2); }
  .kit-pop-tabs { order: 1; }
  .kit-pop-body { order: 2; flex: 1 1 auto; }
  .kit-pop-foot { order: 3; }
  .kit-pop:not(.kit-pop-picture) > .kit-pop-head > .kit-pop-close {
    order: 4;
    align-self: stretch;
    margin: var(--s2) var(--s3) calc(var(--s2) + var(--safe-foot));
    border: var(--hairline) solid var(--line-strong);
  }
  .kit-pop:not(.kit-pop-picture) > .kit-pop-head > .kit-pop-close > span { display: none; }
  .kit-pop:not(.kit-pop-picture) > .kit-pop-head > .kit-pop-close::after {
    content: attr(aria-label);
  }
  /* C.160: the sheet's way out at its foot IS the popup's "Fertig"; the
   * foot's own done button (`data-kit-way-out`, the kit's `kit_done` macro)
   * would say it a second time, so it gives way here, and a foot that
   * held nothing else gives way with it. */
  .kit-pop:not(.kit-pop-picture) > .kit-pop-foot [data-kit-way-out] { display: none; }
  .kit-pop:not(.kit-pop-picture) > .kit-pop-foot:not(:has(> :not([data-kit-way-out]):not([hidden]))) {
    display: none;
  }
  .kit-pop button, .kit-pop .button, .kit-pop select,
  .kit-pop input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]) {
    min-height: var(--tap);
  }
  .kit-pop button, .kit-pop .button { min-width: var(--tap); }
  .kit-pop label:has(> input[type="checkbox"], > input[type="radio"], > input[type="color"]) {
    min-height: var(--tap);
    display: flex;
    align-items: center;
  }
}

/* ------------------------------------------------------------------ *
 * POPUP, THE PHONE FRAME (C.58j)                                     *
 * ------------------------------------------------------------------ */

/* The job page lays itself out as a phone - one frame, a thumb bar, the
 * layers from the foot (C.96, layout C) - below a width the kit's one
 * breakpoint does not know: a phone held sideways is 844 px wide. The
 * page says so with `phone-job` on the body (jobphone.js), and a kit
 * popup on it opens as the same sheet from the foot the kit's phone
 * mode above draws, whatever the width. A media query cannot ask a
 * class, so the declarations stand twice; the gate `phone-job-page`
 * measures this reading (law P16) at three windows. */
body.phone-job .kit-pop:not(.kit-pop-picture) {
  width: auto;
  max-width: none;
  max-height: var(--pop-height-phone);
  inset-inline: 0;
  margin: auto 0 0 0;
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 0;
}
body.phone-job .kit-pop:not(.kit-pop-picture) > .kit-pop-head { display: contents; }
body.phone-job .kit-pop-back { order: 0; align-self: flex-start; margin: var(--s2) var(--s3) 0; }
body.phone-job .kit-pop-title { order: 0; flex: none; padding: var(--s3) var(--s3) var(--s2); }
body.phone-job .kit-pop-tabs { order: 1; }
body.phone-job .kit-pop-body { order: 2; flex: 1 1 auto; }
body.phone-job .kit-pop-foot { order: 3; }
body.phone-job .kit-pop:not(.kit-pop-picture) > .kit-pop-head > .kit-pop-close {
  order: 4;
  align-self: stretch;
  margin: var(--s2) var(--s3) calc(var(--s2) + var(--safe-foot));
  border: var(--hairline) solid var(--line-strong);
}
body.phone-job .kit-pop:not(.kit-pop-picture) > .kit-pop-head > .kit-pop-close > span { display: none; }
body.phone-job .kit-pop:not(.kit-pop-picture) > .kit-pop-head > .kit-pop-close::after {
  content: attr(aria-label);
}
body.phone-job .kit-pop:not(.kit-pop-picture) > .kit-pop-foot [data-kit-way-out] { display: none; }
body.phone-job .kit-pop:not(.kit-pop-picture) > .kit-pop-foot:not(:has(> :not([data-kit-way-out]):not([hidden]))) {
  display: none;
}
body.phone-job .kit-pop button, body.phone-job .kit-pop .button, body.phone-job .kit-pop select,
body.phone-job .kit-pop input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]) {
  min-height: var(--tap);
}
body.phone-job .kit-pop button, body.phone-job .kit-pop .button { min-width: var(--tap); }
body.phone-job .kit-pop label:has(> input[type="checkbox"], > input[type="radio"], > input[type="color"]) {
  min-height: var(--tap);
  display: flex;
  align-items: center;
}

/* THE FORM'S ACTION ROW STAYS AT THE FOOT (law P16, once for every kit
 * form page shown as a popup's fragment - at EVERY width since C.117,
 * manager 30.09.2026: a reader at a common laptop height must see a
 * popup's actions without hunting for them, and a fragment's row drawn
 * at the end of a long scrolling body stood 900 px below the window).
 * A sticky row holds only inside its parent box, and a form whose only
 * controls are its buttons ends where its row ends - so the form gives
 * way to the fragment (`display: contents`), the row's box becomes the
 * whole fragment, and the row sticks to the popup's foot while the words
 * above scroll. The form stays a form: it still posts, it only draws no
 * box. A popup with a foot of its own (`.kit-pop-foot`) needs none of
 * this: that foot stands below the scrolling body by construction. */
.kit-pop .kit-formpage.is-fragment > .kit-form,
.kit-pop .kit-formpage.is-fragment > .kit-form > .kit-action {
  display: contents;
}
.kit-pop .kit-formpage.is-fragment .kit-action-row {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding-block: var(--s2);
  background: var(--panel);
  border-top: var(--hairline) solid var(--line);
}

/* A popup filled with a sub-page's fragment (`.kit-pop-fragment`, the
 * job page's five) names the sub-page in its own head already, so the
 * fragment's title, which says the same words, is not said twice on
 * the screen. It stays in the markup - the kit form page's two readings
 * are the same bytes - and the dialog is labelled by its head. */
.kit-pop-fragment > .kit-formpage.is-fragment > .kit-formpage-title { display: none; }
.kit-pop-fragment > .kit-formpage.is-fragment > .kit-formpage-intro:first-of-type { margin-top: 0; }
/* ...and the part before the form, straight under that unshown title,
 * keeps no heading's air above it either (batch 38: 48 px stood empty
 * over the job settings' tabs). */
.kit-pop-fragment > .kit-formpage.is-fragment > .kit-formpage-title + .kit-formpage-before { margin-top: 0; }
/* A FORM PAGE THAT IS A TAB GROUP (`data-kit-tabs`: the job's settings)
 * stands its strip and its first pane in the part before the form and
 * the other panes in the form; in a popup the form is as wide as the
 * popup, so the part before it is too - a pane narrower than its
 * siblings wrapped every help line of the title block twice and made
 * each field a line taller (batch 38). */
.kit-pop-fragment > .kit-formpage.is-fragment[data-kit-tabs] > .kit-formpage-before { max-width: none; }

/* A tab group standing in the flow (the settings panel, C.58j) takes its
 * container's edges, not the popup head's inset. */
[data-kit-tabs] .kit-pop-tabs { padding-inline: 0; }

/* ------------------------------------------------------------------ *
 * POPUP, PICTURE MODE                                                *
 * ------------------------------------------------------------------ */

/* The enlarged picture. It has no markup on any page: `popup.js` builds
 * exactly one of these per document, the first time something asks to be
 * enlarged. That is what makes the duplicate `id="preview-lightbox"` the
 * inventory found impossible rather than merely unlikely — there is no id
 * for a second copy to collide with, because there is no second copy.
 *
 * The box is the picture: no head, no foot, no padding, so a drawing is
 * read at the size the screen allows and not inside a frame that takes a
 * third of it. */
.kit-pop-picture {
  width: auto;
  max-width: calc(100% - var(--pop-gutter));
  max-height: var(--pop-height);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.kit-pop-picture[open] { display: block; }

.kit-pop-picture::backdrop { background: var(--scrim); }

.kit-pop-picture img {
  display: block;
  max-width: 100%;
  max-height: var(--pop-height);
  width: auto;
  height: auto;
}

/* c243: the picture stands in the sheet viewer's frame (sheetview.js),
 * shaped like the picture (its ratio set when it loads) and as large as
 * the popup allows, so the whole picture opens fitted with no letterbox
 * and the viewer zooms and pans inside it. */
.kit-pop-picture .kit-pop-picture-frame {
  /* c248: the popup's own ceiling (its share of the window AND its cap),
     never the share alone - on a window taller than the cap the frame
     stood taller than the popup and the sheet's lower edge was cut */
  width: min(var(--pop-width-glass),
             calc(min(var(--pop-height), var(--pop-height-cap)) * var(--picture-ratio)));
  aspect-ratio: var(--picture-ratio);
  max-height: min(var(--pop-height), var(--pop-height-cap));
  border: 0;
}

.kit-pop-picture .kit-pop-close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  background: var(--panel);
  border: var(--hairline) solid var(--line);
}

/* ------------------------------------------------------------------ *
 * ACCORDION                                                          *
 * ------------------------------------------------------------------ */

/* Section 6: the section is always open, the questions are collapsed, a
 * click opens one and closes the one that was open, and NOTHING MOVES.
 * The stylesheet's share of "nothing moves" is that an open answer costs
 * no margin the closed one did not: the row keeps its own hairline and
 * the answer grows inside it. */
.kit-acc { display: block; }

.kit-acc-heading { margin: 0 0 var(--s3); }

.kit-acc-item { border-bottom: var(--hairline) solid var(--line); }

.kit-acc-q {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) 0;
  min-height: var(--tap);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

/* The marker is drawn by the rule above, so the browser's own triangle is
 * taken away in both spellings a browser may use for it. */
.kit-acc-q::-webkit-details-marker { display: none; }
.kit-acc-q::marker { content: ""; }

/* The one piece of the row that says open or shut. C.58j (owner
 * 28.09.2026): the icon set's own chevron, drawn in the markup by the
 * macro - a character was drawn by each phone's font, thick on one and
 * thin on the next. It turns, and the turn is the only thing in the kit
 * that is allowed to take time. */
.kit-acc-mark {
  width: var(--kit-marker);
  height: var(--kit-marker);
  color: var(--ink-faint);
  transition: transform var(--motion-quick);
}

.kit-acc-item[open] > .kit-acc-q > .kit-acc-mark { transform: rotate(90deg); }

/* The answer begins under the QUESTION'S first letter, not under the
   mark beside it: the inset is the mark's own column plus the gap the
   row uses, so the two can never drift apart. */
.kit-acc-a {
  padding: 0 0 var(--s4) calc(var(--kit-marker) + var(--s2));
  max-width: var(--measure);
  color: var(--ink-soft);
}

.kit-acc-a > :first-child { margin-top: 0; }
.kit-acc-a > :last-child { margin-bottom: 0; }

/* A reader who asked for less movement gets none at all. */
@media (prefers-reduced-motion: reduce) {
  .kit-acc-mark,
  .kit-pop-close,
  .kit-pop-tab { transition: none; }
}

/* ------------------------------------------------------------------ *
 * THE SCREEN KEYBOARD (C.158, owner 06.10.2026)                      *
 * ------------------------------------------------------------------ */

/* While a phone's keyboard is open (kit/keyboard.js marks the root
 * `data-kb` and writes its height and the free height), a popup stands
 * on the keyboard and is no taller than the free part of the screen, so
 * its foot - the save and the way out - is never under the keyboard;
 * and a page form's action row rides on the keyboard while one of its
 * fields is being typed in. Closed, nothing here applies. */
:root[data-kb] .kit-pop[open] {
  bottom: var(--kb);
  max-height: min(var(--pop-height-phone), var(--vv-height));
}
:root[data-kb] [data-kb-bar] {
  position: sticky;
  bottom: var(--kb);
  z-index: 3;
  background: var(--panel);
}
/* inside a popup, which already stands on the keyboard, the row rides at
 * the foot of the popup's scrolling body */
:root[data-kb] dialog [data-kb-bar] {
  bottom: 0;
}
/* while typing in a popup, its tab row gives its room to the field, the
 * save and the preview; the tabs come back with the keyboard's going */
:root[data-kb] .kit-pop[open] .kit-pop-tabs {
  display: none;
}
/* the page itself keeps room under its last line for the keyboard, so a
 * field near the end of a short page can still be brought above it */
:root[data-kb] body {
  padding-bottom: var(--kb);
}
/* while typing, the sheet's own close row at its foot gives its room to
 * the field, its save and the preview; the way out comes back with the
 * keyboard's going (the back gesture and Escape close the sheet at any
 * time) */
:root[data-kb] .kit-pop[open] > .kit-pop-head > .kit-pop-close {
  display: none;
}
