/* mossmoth · qrcode on the pencil line: left of the line the code, what it is, and anything wrong with it; right of it
   the menu that edits it. Fields are written on pencil lines; nothing is boxed in. */
/* align-content: the rows keep their own heights; stretched, they would share out the spare space, and on a phone
   (code above menu) the menu would drop whenever it got shorter */
.flow { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(2 * var(--gap)); align-items: start; align-content: start;
  padding: calc(var(--u) * 2.2) var(--right) calc(var(--u) * 3) var(--left); min-height: calc(100svh - var(--u) * 4); }
.flow .side { justify-self: end; text-align: right; display: grid; justify-items: end; gap: calc(var(--u) * .7); width: min(100%, 22em); }
.crumbs { color: var(--muted); font-size: .8em; letter-spacing: .02em; min-height: 1.2em; }
.flow .q { font: 400 clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem)/1.12 var(--display); text-wrap: balance; margin-top: -.2em; }

/* the code: a checkerboard shows only behind a see-through side */
.code { width: min(100%, 15em); display: flex; flex-wrap: wrap; gap: .8em; justify-content: flex-end; padding: .6em; margin-right: -.6em; }
.code.empty { display: none; }
.code.pending { aspect-ratio: 1; }            /* its place, held until the first code is drawn */
.code figure { margin: 0; flex: 1 1 6em; }
.code svg { display: block; width: 100%; height: auto; }
.code figcaption { color: var(--muted); font-size: .75em; text-align: center; margin-top: .3em; }
.code[data-behind] { background: repeating-conic-gradient(var(--check) 0 25%, var(--check-base) 0 50%) 0 0 / 12px 12px; }
.code[data-behind="light"] { --check: #DCDFDD; --check-base: #FFFFFF; }
.code[data-behind="dark"] { --check: #2A3242; --check-base: #161C28; }
.readout { list-style: none; margin: 0; padding: 0; display: grid; gap: .2em; font-size: .9em; color: var(--muted); }
.readout li:first-child { color: var(--ink); overflow-wrap: anywhere; }
.warns { display: grid; gap: .5em; font-size: .88em; max-width: 22em; }
.warns:empty { display: none; }
.warn { color: var(--ink); }
.warn::before { content: "! "; color: var(--moth); }
.hint { color: var(--muted); }
:is(.warn, .hint) .fix { color: var(--muted); white-space: nowrap; }
:is(.warn, .hint) button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; }

/* the menu's fields and panels */
.flow .places .panel { display: grid; gap: .15em; margin-bottom: .6em; }
.flow .places .panel label { color: var(--muted); font-size: .9em; }
.flow .places .panel .req { white-space: nowrap; }
.flow .places .panel .field { display: block; width: min(100%, 22em); position: relative; margin-bottom: .7em; }
.flow .places .panel :is(input, textarea) { display: block; width: 100%; border: 0; border-radius: 0; padding: 0 0 .15em; margin: 0; font: inherit; font-size: 1.12em;
  line-height: 1.55; background: transparent; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
.flow .places .panel textarea { resize: vertical; min-height: calc(3 * 1.55em); }
.flow .places .panel label:has(+ .field :focus) { color: var(--link); }
.flow .places .panel .swatch { display: inline-flex; align-items: center; gap: .8em; color: var(--muted); cursor: pointer; }
.flow .places .panel input[type=color] { width: 2.6em; height: 2.6em; padding: 0; border: 1px solid var(--rule); background: none; cursor: pointer; }
.places li .note.said { color: var(--moss); }

/* technical details */
.tech { font-size: .78em; color: var(--ink); max-width: 30em; display: grid; gap: 1em; }
.tech dl { display: grid; grid-template-columns: auto 1fr; gap: .2em 1em; margin: 0; }
.tech dt { color: var(--muted); }
.tech dd { margin: 0; }
.tech table { border-collapse: collapse; width: 100%; }
.tech th { text-align: left; color: var(--muted); font-weight: 400; }
.tech td, .tech th { padding: .15em .6em .15em 0; vertical-align: top; }
.tech td.content { overflow-wrap: anywhere; }
.tech pre { white-space: pre-wrap; word-break: break-all; font-size: .9em; margin: 0; color: var(--muted); }
.tech .k { color: var(--muted); margin: 0; }

@media (max-width: 47.99em) {
  .flow { grid-template-columns: 1fr; row-gap: calc(var(--u) * 1); padding-left: var(--hang); }
  /* the thread (pencil.css): the step's name, its question and a field's label are tied onto the line */
  .flow .crumbs, .flow .q, .flow .places .panel label {
    position: relative; z-index: 1; width: fit-content; margin-left: var(--tie); padding-right: .2em; background: var(--white); box-shadow: var(--halo); }
  .flow .crumbs, .flow .places .panel label { font: 400 .8rem/1.3 var(--body); color: var(--muted); letter-spacing: .02em; }
  .flow .q { font-size: 1.4rem; line-height: 1.2; margin-top: .25em; }
  .flow .side { row-gap: .5em; }
  .flow .places .panel label { display: block; margin-bottom: .2em; }
  .flow .side { justify-self: start; text-align: left; justify-items: start; }
  /* the menu is the thing on a phone: the code stays small above it, the readout and tips step aside (warnings stay) */
  .flow .side { grid-template-columns: auto 1fr; align-items: center; column-gap: 1em; }
  .crumbs, .flow .q, .warns { grid-column: 1 / -1; }
  .code { width: 6.5em; justify-content: flex-start; margin: 0 0 0 -.6em; }
  .readout { font-size: .82em; }
  .readout li:not(:first-child):not(:nth-child(2)) { display: none; }
  .warns .hint { display: none; }
}
