/* How a call moves, one lane a system (.callpath; drew.json): twelve columns, a lane's name on a row of its own and
   its parts on the rows under it, each part a share of the row that its lane's count gives it (--span), packed from
   the left (a part keeps its lane's row and takes the next free place in it). A lane's line runs along the top of
   its parts, grey for the other system and violet for Synthflow, and each part's number sits on it. Under 900 px
   the lanes turn into one path down the page in the call's order: each part its number on the path's line, its
   system's name, its head and its words. */
.callpath { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: var(--space-5); margin: 0; }
.callpath-names, .callpath-steps { display: contents; }
.callpath-steps { margin: 0; padding: 0; list-style: none; }
.callpath-name { grid-column: 1 / -1; grid-row: var(--row); display: flex; align-items: center; gap: var(--space-2); margin: 0; color: var(--ink-secondary); font: var(--t-label); letter-spacing: 0; }
.callpath-name:not(:first-child) { margin-top: var(--space-6); }
.callpath-name--ours { color: var(--ink-accent); }
.callpath-name img { flex: none; }
.callpath-step { grid-column: span var(--span); grid-row: var(--row); display: grid; align-content: start; justify-items: start; row-gap: var(--space-2); min-width: 0;
  padding: 0 var(--space-6) 0 0; border-top: 1px solid var(--border-strong); }
.callpath-step--ours { border-top-color: var(--accent); }
.callpath-num { display: grid; place-items: center; width: var(--space-5); height: var(--space-5); margin-top: calc(var(--space-5) / -2); border: 1px solid var(--border-strong); border-radius: 50%;
  background: var(--surface-page); color: var(--ink-secondary); font: var(--t-caption); font-variant-numeric: tabular-nums; }
.callpath-step--ours > .callpath-num { border-color: var(--accent); color: var(--ink-accent); }
.callpath-head { margin: var(--space-2) 0 0; color: var(--ink-primary); text-wrap: balance; overflow-wrap: break-word; }
.callpath-who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.callpath-what { margin: 0; max-width: var(--measure); color: var(--ink-secondary); font: var(--t-body); text-wrap: pretty; overflow-wrap: break-word; }
.callpath-what code { font: var(--t-code-m); letter-spacing: var(--t-code-m-tracking); overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .callpath { display: block; }
  .callpath-names { display: none; }
  .callpath-steps { display: grid; row-gap: 0; }
  .callpath-step { position: relative; grid-column: auto; grid-row: auto; row-gap: var(--space-1); padding: 0 0 var(--space-6) var(--space-7); border-top: 0; }
  .callpath-step::before { content: ""; position: absolute; left: calc(var(--space-5) / 2); top: var(--space-5); bottom: 0; border-left: 1px solid var(--border-strong); }
  .callpath-step--ours::before { border-left-color: var(--accent); }
  .callpath-step:last-child { padding-bottom: 0; }
  .callpath-step:last-child::before { content: none; }
  .callpath-num { position: absolute; left: 0; top: 0; margin: 0; }
  .callpath-who { position: static; width: auto; height: auto; overflow: visible; clip-path: none; margin: 0; color: var(--ink-secondary); font: var(--t-label-s); letter-spacing: 0; }
  .callpath-step--ours > .callpath-who { color: var(--ink-accent); }
  .callpath-head { margin-top: 0; }
}
@media (forced-colors: active) { .callpath-step, .callpath-num { border-color: CanvasText; } }

/* One more fact of the section (which contacts it calls) beside the setting that starts a call: a part of the section
   under its own head, its words in the page's main column and the setting, a small window, in the rail */
.ig-moves-more { display: grid; grid-template-columns: minmax(0, var(--ig-main)) minmax(0, 1fr); gap: var(--space-6) var(--ig-gap); align-items: start; }
.ig-moves-words { display: grid; gap: var(--space-3); max-width: var(--measure); }
.ig-moves-words p { margin: 0; }
.ig-moves-figure { margin: 0; display: grid; gap: var(--space-3); }
.fr-words > .ig-moves-figure { max-width: 30rem; margin-top: var(--space-3); }   /* the example with no words of its own: in the head, under the lead */
.ig-moves .section-head:has(.ig-moves-figure) { align-items: start; }
.ig-moves-figure figcaption { margin: 0; }
.ig-action .product-window-head img { width: var(--icon-m); height: var(--icon-m); }
.ig-action-foot { margin: 0; padding: var(--space-3) var(--product-window-inset); border-top: 1px solid var(--border-subtle); }
/* a field of the other system's record, as its workflow editor names it: a neutral chip, since violet is Synthflow's */
.ig-token { display: inline-block; margin-right: var(--space-1); padding: 0 var(--space-2); border-radius: var(--radius-xs);
  background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border-subtle); color: var(--ink-secondary); font: var(--t-label-s); }

@media (max-width: 1199px) {
  .ig-moves-more { grid-template-columns: minmax(0, 1fr) minmax(0, 22rem); column-gap: var(--space-6); }
}
@media (max-width: 899px) {
  .ig-moves-more { grid-template-columns: minmax(0, 1fr); }
  .ig-moves-figure { max-width: 30rem; }
}

/* A drawing of the call's path (moves.picture, the parts' picture): under the lanes, across the container */
.ig-moves-picture { margin-top: var(--space-7); }

/* Less material (the type's own): one more fact with no example, or an example with no words, stands alone */
.ig-moves-more--one { grid-template-columns: minmax(0, 1fr); }
.ig-moves-more--one .ig-moves-figure { max-width: 30rem; }
/* A page's own parts (sections/parts.py): each a section in the frame's flow, its title at the left and its text
   whole in the lead's column. A part's form stands under them across the container: points as the frame's cells,
   a table as the family's (frame.table: the kit's Table on the page's own rules, its columns kept on a phone where it
   has four or more). Steps stand across the container in rows. */
.part-table { --table-head: 28%; }
.part > .fr-flow > .table-frame { padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-subtle); }
.part-table :is(th, td) { overflow-wrap: break-word; }
.part-table tbody th { font: var(--t-label-l); letter-spacing: var(--t-label-l-tracking); }
.part-steps > .steps { margin: 0; }
.part-steps .steps-item > p { color: var(--ink-secondary); overflow-wrap: break-word; }
/* Steps across the container in rows (steps_open): where their box is 800 px wide or more, two, three or four stand in
   a row (the class says how many: a step's words keep a column they read in), each row's path ending at its last
   node; under 800 px the kit sets them down one path. */
@container (min-width: 800px) {
  .steps--rows { grid-auto-flow: row; row-gap: var(--space-7); }
  .steps--rows.steps--1 { grid-template-columns: minmax(0, var(--measure)); }
  .steps--rows.steps--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); --gap: var(--space-8); }
  .steps--rows.steps--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps--rows.steps--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps--rows > .steps-item { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); grid-row: auto; }
  .steps--rows.steps--2 > .steps-item:nth-child(2n)::after, .steps--rows.steps--3 > .steps-item:nth-child(3n)::after,
  .steps--rows.steps--4 > .steps-item:nth-child(4n)::after, .steps--rows.steps--1 > .steps-item::after { content: none; }
  .steps--rows > .steps-item > p { max-width: var(--measure); }
}
.part-picture { margin: 0; }
/* two pictures side by side: each takes the share of the row its own proportions ask for, so both are one height */
.part-pictures { display: flex; gap: var(--space-5); align-items: flex-start; }
.part-pictures > .part-picture { flex: var(--ratio, 1) 1 0; min-width: 0; }
.part-pictures > .part-picture > img { width: 100%; }
@media (max-width: 899px) { .part-pictures { flex-direction: column; } .part-pictures > .part-picture { flex: none; width: 100%; } }
/* A part's drawing fits the width it stands in, whole, at every width: nothing of it is cut and nothing scrolls
   sideways. A wide drawing (WIDE px or more) is also a button: on a press it opens at its own size over the page
   (a popover: the browser's own, so a keyboard opens it, Escape and its Close shut it, and no script runs), where it
   scrolls both ways; on a phone, where its own words are too small to read at the window's width, a line under it
   says so, outside the drawing's frame, so it covers no word of the drawing. */
.part-picture :is(img, .part-picture-open) { display: block; max-width: 100%; }
.part-picture > img, .part-picture-open > img { width: auto; height: auto; max-height: calc(var(--space-9) * 7.5); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--surface-card); }
.part-picture-open { position: relative; padding: 0; border: 0; border-radius: var(--radius-lg); background: none; cursor: zoom-in; }
.part-picture-open:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.part-picture-cue { display: none; }
.part-picture-full { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: var(--space-8) var(--space-5) var(--space-5); border: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--surface-page); }
.part-picture .part-picture-full > img { display: block; width: auto; max-width: none; height: auto; max-height: none; border-radius: var(--radius-md); }
.part-picture-x { position: fixed; top: var(--space-3); right: var(--space-4); z-index: var(--layer-raised); display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-m, 40px); padding: 0 var(--space-4);
  border: 0; border-radius: var(--radius-full); background: var(--surface-inverse); color: var(--ink-on-dark); font: var(--t-label); cursor: pointer; }
.part-picture-x:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
@media (max-width: 599px) {
  .part-picture > img, .part-picture-open > img { width: 100%; max-height: none; }
  .part-picture-open { width: 100%; }
  .part-picture-open { display: grid; row-gap: var(--space-2); justify-items: start; color: var(--ink-accent); font: var(--t-label); text-align: left; }
  .part-picture-cue { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-s, 32px); }
}
/* A part's one picture stands beside its text (the language: a picture stands beside its text): from 1200 px, under
   the part's title in the head's left column, where the text beside it left the page empty. So a part of words and a
   drawing is as tall as its words, not its words and 685 px of drawing under them. The drawing stands at the column's
   560 px there at the most (a tall one keeps the height every drawing is held to), so its line says that it opens at
   its own size, as on a phone. Two pictures, and a part with no text, stand across the container as before. */
@media (min-width: 1200px) {
  .part > .fr-flow:has(> .fr-text):has(> .part-picture) > .fr-text { grid-row: 1 / span 2; }
  .part > .fr-flow:has(> .fr-text) > .part-picture { grid-column: 1; grid-row: 2; }
  .part > .fr-flow:has(> .fr-text) > .part-picture > .part-picture-open { display: grid; row-gap: var(--space-2); justify-items: start; color: var(--ink-accent); font: var(--t-label); text-align: left; }
  .part > .fr-flow:has(> .fr-text) > .part-picture .part-picture-cue { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-s, 32px); }
}
@media (forced-colors: active) { .part-picture-x, .part-picture-cue { border: 1px solid ButtonText; } }
/* A tool of the site's own (tool()): its box in the text's column, what the page hands it and the tool's slot. The
   list it is handed stands on hairlines, and the tool's script sets Choice's box before each line; lines of code
   stand on the sunken ground, and a line longer than the box breaks inside it. The slot's own parts (a
   calculator's card, a bar of buttons) are the system's, written in the site's part. */
.fr-flow > .tool { grid-column: 2; }
.fr-flow > .tool:has(> .site-part table) { grid-column: 1 / -1; }   /* a tool that works out tables takes the container's width, as a part's table does */
.tool { display: grid; gap: var(--space-4); min-width: 0; }
.tool > * { min-width: 0; margin: 0; }
.tool-title { color: var(--ink-primary); font: var(--t-headline); letter-spacing: var(--t-headline-tracking); text-wrap: balance; }
.tool-line, .tool-note { max-width: var(--measure); color: var(--ink-secondary); font: var(--t-body); text-wrap: pretty; overflow-wrap: anywhere; }
.tool-items { padding: 0; list-style: none; border-top: 1px solid var(--border-subtle); }
.tool-items > li { padding-block: var(--space-3); border-bottom: 1px solid var(--border-subtle); color: var(--ink-primary); font: var(--t-body); overflow-wrap: break-word; }
.tool-items > li > .choice { align-items: flex-start; }
.tool-code { padding: var(--space-5); border-radius: var(--radius-md); background: var(--surface-sunken); color: var(--ink-primary); font: var(--t-code-l); letter-spacing: var(--t-code-l-tracking); tab-size: 2;
  /* a line of code longer than its box breaks in it, its indent kept: no line is cut at the box's edge, and nothing scrolls out of a keyboard's reach */
  white-space: pre-wrap; overflow-wrap: anywhere; }
.tool > .site-part { display: grid; gap: var(--space-4); min-width: 0; }
.tool > .site-part > * { min-width: 0; }
.tool > .site-part:empty { display: none; }
.tool [hidden] { display: none !important; }
/* The pieces a tool's own part is written with beside the system's (Calculator, Field, Input, Choice, Segmented,
   Button, Table): a bar of buttons with the line that says what a press did; a value the visitor copies (its label,
   the value in code on the sunken ground, its Copy); rows of fields the visitor adds and takes out; a group's head
   inside a calculator; a figure past its limit. */
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.tool-status { margin: 0; color: var(--ink-secondary); font: var(--t-small); }
.tool-status:empty { display: none; }
.tool-outs { display: grid; gap: var(--space-5); }
.tool-out { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-4); margin: 0; }
.tool-out > .tool-out-label { grid-column: 1 / -1; margin: 0; color: var(--ink-secondary); font: var(--t-small); }
.tool-out > .tool-value:last-child { grid-column: 1 / -1; }
.tool-value { display: block; min-width: 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); background: var(--surface-sunken); color: var(--ink-primary);
  font: var(--t-code-l); letter-spacing: var(--t-code-l-tracking); overflow-wrap: anywhere; }
.tool-rows { display: grid; gap: var(--space-4); }
.tool-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; gap: var(--space-2) var(--space-3); }
.tool-row > :is(.tool-row-says, .field-error) { grid-column: 1 / -1; margin: 0; }
.tool-row-says { color: var(--ink-secondary); font: var(--t-code); letter-spacing: var(--t-code-tracking); overflow-wrap: anywhere; }
.tool-row-says:empty { display: none; }
.tool-head { margin: 0; color: var(--ink-primary); font: var(--t-label-strong); }
.tool .calc-result > :not(.calc-figure) { grid-column: 1 / -1; }
.tool .calc-figure.is-over > dd, .tool .is-over > .tool-value { color: var(--status-danger); }
.tool-lines { margin: 0; padding: 0; list-style: none; font: var(--t-code-l); letter-spacing: var(--t-code-l-tracking); }
.tool .table code { font: var(--t-code-l); letter-spacing: var(--t-code-l-tracking); overflow-wrap: anywhere; }
@media (max-width: 599px) {
  .tool-row { grid-template-columns: minmax(0, 1fr); padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-subtle); }
  .tool-row > .btn { justify-self: start; }
  .tool-out { grid-template-columns: minmax(0, 1fr); }
  .tool-out > .btn { justify-self: start; }
}
@media (max-width: 1199px) { .fr-flow > .tool { grid-column: 1; max-width: 40em; } .fr-flow > .tool:has(> .site-part table) { max-width: none; } }
/* A calculator takes the width its form needs: from 1200 px it stands across the container, what the reader types
   in one column and what comes out beside it in a second (the browser's columns: the result opens the second), so
   no half of the section stands empty beside a tall card. A calculator that works out a table keeps one column. */
@media (min-width: 1200px) {
  .fr-flow > .tool:has(> .site-part > .calc > .calc-result) { grid-column: 1 / -1; }
  .fr-flow > .tool > .site-part > .calc:has(> .calc-result):not(:has(table)) { display: block; columns: 2; column-gap: var(--space-8); }
  .fr-flow > .tool > .site-part > .calc:has(> .calc-result):not(:has(table)) > * { break-inside: avoid; }
  .fr-flow > .tool > .site-part > .calc:has(> .calc-result):not(:has(table)) > * + * { margin-top: var(--space-6); }
  .fr-flow > .tool > .site-part > .calc:has(> .calc-result):not(:has(table)) > .calc-result { break-before: column; margin-top: 0; padding-top: 0; border-top: 0; }
  /* Lines of code a reader copies, with the page's words for them: the words (the line over the code, the note
     under it) stand in the title's column and the code with its Copy beside them, so the code is read with what it
     means in one look and no half of the section stands empty */
  .fr-flow > .tool:has(> .tool-code):has(> :is(.tool-line, .tool-note)):not(:has(> .tool-title, > .tool-items)) {
    grid-column: 1 / -1; grid-template-columns: subgrid; grid-template-rows: auto auto 1fr auto; column-gap: var(--fr-gap); }
  .fr-flow > .tool:has(> .tool-code):has(> :is(.tool-line, .tool-note)):not(:has(> .tool-title, > .tool-items)) > .tool-line { grid-area: 1 / 1; }
  .fr-flow > .tool:has(> .tool-code):has(> :is(.tool-line, .tool-note)):not(:has(> .tool-title, > .tool-items)) > .tool-note { grid-area: 2 / 1; }
  .fr-flow > .tool:has(> .tool-code):not(:has(> .tool-line)):not(:has(> .tool-title, > .tool-items)) > .tool-note { grid-area: 1 / 1; }
  .fr-flow > .tool:has(> .tool-code):has(> :is(.tool-line, .tool-note)):not(:has(> .tool-title, > .tool-items)) > .tool-code { grid-area: 1 / 2 / span 3; }
  .fr-flow > .tool:has(> .tool-code):has(> :is(.tool-line, .tool-note)):not(:has(> .tool-title, > .tool-items)) > .site-part { grid-area: 4 / 2; }
}
.part > .fr-flow > .part-foot { grid-column: 2; max-width: var(--measure); margin-top: calc(var(--space-5) - var(--space-7)); color: var(--ink-secondary); font: var(--t-body); text-wrap: pretty; }
@media (max-width: 1199px) { .part > .fr-flow > .part-foot { grid-column: 1; margin-top: calc(var(--space-4) - var(--space-6)); } }
