/* ---------------------------------------------------------------------------
   How it works
   ---------------------------------------------------------------------------
   Five steps and the morning after, in the order the product is used: connect,
   check, run, why, fix. One invented store, ST-014, goes through all of it.

   Each step is a sentence, one screen of the application, and three things
   worth knowing. The screens are drawn here in HTML, not captured: the same
   sidebar on every one with a different row lit, so the page also says where
   in the application each step lives. They are sharp at any size, they follow
   the theme, and the queries and figures in them can be changed like copy.

   Loaded after shared.css and site.css by /how-it-works and its Italian twin.
   --------------------------------------------------------------------------- */

section[id] {
  scroll-margin-top: 64px;
}

.how h2 {
  max-width: 24ch;
}

.sub code {
  font: 500 0.92em var(--mono);
  color: var(--text);
}

/* The steps as a contents line under the head. */
.how-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0 0;
  padding: 0;
  list-style: none;
}

.how-index a {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 14.5px;
  color: var(--text-soft);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.how-index a:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.how-index span,
.step-num {
  font: 500 12px var(--mono);
  letter-spacing: 0.06em;
  color: var(--accent);
}

.step-num {
  margin-bottom: 14px;
}

/* Three things worth knowing, under the screen. */
.how-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px clamp(20px, 3vw, 44px);
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.how-points li {
  font-size: 15.5px;
  color: var(--text-soft);
}

.how-points b {
  display: block;
  margin-bottom: 5px;
  font-size: 16.5px;
  font-weight: 650;
  color: var(--text);
}

.how-points code {
  font: 500 0.9em var(--mono);
  color: var(--text);
}

/* Where the docs say the rest. */
.how-docs {
  margin-top: 26px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.how-docs a {
  margin-left: 4px;
  color: var(--text-soft);
  text-underline-offset: 3px;
}

.how-docs a:hover {
  color: var(--text);
}

@media (max-width: 860px) {
  .how-points {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ---------------------------------------------------------------------------
   A screen
   ---------------------------------------------------------------------------
   The figure is a size container and the application inside it is drawn in
   `em`, with the type tied to the figure's width: 13 design pixels on a
   1180px-wide screen, so the whole picture scales as one and nothing in it
   wraps differently at another width. Two narrower designs follow, because a
   picture scaled to a phone is a picture nobody can read: under 940px the
   sidebar goes, with whatever is marked `.wide`, and the type is sized for a
   780px screen; under 640px it is sized for a 440px one, whatever is marked
   `.mid` goes too, and the panes that stood side by side stack.
   --------------------------------------------------------------------------- */

.how-shot {
  container-type: inline-size;
  margin: 34px 0 0;
}

.how-shot + .how-shot {
  margin-top: 26px;
}

.how-shot figcaption {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.how-shot figcaption code {
  font: 500 0.92em var(--mono);
  color: var(--text-soft);
}

/* The home page's frame: a thick light rim, the window inside it. */
.how-frame {
  overflow: hidden;
  border: 6px solid var(--rim);
  border-radius: 22px;
  background: var(--panel);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 24px 48px -32px rgba(38, 30, 20, 0.4);
}

:root[data-theme='dark'] .how-frame {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.app {
  --a-ok: #1f9d55;
  --a-bad: #e5484d;
  --a-warn: #f5a623;
  --a-run: #3399e0;
  --a-violet: #6b4fd6;
  --a-wire: #cfc9c2;
  display: grid;
  grid-template-columns: 18.5em minmax(0, 1fr);
  color: var(--text);
  font-size: clamp(7px, calc(100cqw * 13 / 1200), 14.5px);
  line-height: 1.4;
  text-align: left;
  background: var(--bg);
}

:root[data-theme='dark'] .app {
  --a-ok: #4ec27a;
  --a-bad: #f0686b;
  --a-warn: #eea23e;
  --a-violet: #a48cf2;
  --a-wire: #4d4a47;
}

.app p {
  margin: 0;
}

.app svg {
  flex: none;
  width: 1.1em;
  height: 1.1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- the sidebar -------------------------------------------------------------- */

.app-side {
  display: flex;
  flex-direction: column;
  gap: 0.15em;
  min-width: 0;
  padding: 1em 0.7em 1.2em;
  border-right: 1px solid var(--line);
  background: var(--side);
}

.as-ws {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.2em 0.5em 0.8em;
  font-weight: 600;
}

.as-ws i {
  width: 1.35em;
  height: 1.35em;
  border-radius: 50%;
  background: linear-gradient(135deg, #e16540, #c14fc0 55%, #5a7df0);
}

.as-ws svg {
  margin-left: auto;
  color: var(--text-dim);
}

.as-find {
  display: flex;
  align-items: center;
  gap: 0.55em;
  height: 2.35em;
  margin-bottom: 0.7em;
  padding: 0 0.7em;
  border: 1px solid var(--line);
  border-radius: 0.65em;
  background: var(--panel);
  color: var(--text-dim);
}

.as-find kbd,
.ab kbd {
  margin-left: auto;
  padding: 0.05em 0.45em;
  border-radius: 0.4em;
  font: 500 0.78em var(--sans);
}

.as-find kbd {
  border: 1px solid var(--line);
}

.as-row {
  display: flex;
  align-items: center;
  gap: 0.55em;
  height: 2.15em;
  padding: 0 0.6em;
  border-radius: 0.55em;
  color: var(--text-body);
  white-space: nowrap;
}

.as-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.as-row em {
  margin-left: auto;
  padding-left: 0.4em;
  font-size: 0.85em;
  font-style: normal;
  color: var(--text-dim);
}

.as-row.l1 {
  padding-left: 1.5em;
}

.as-row.l2 {
  padding-left: 2.7em;
  font-size: 0.94em;
}

.as-row.l3 {
  padding-left: 4em;
  font-size: 0.94em;
  color: var(--text-soft);
}

.as-row.is-on {
  background: var(--seg);
  color: var(--text);
  font-weight: 600;
}

/* --- the page beside it ------------------------------------------------------- */

/* A column, so that whatever is last on the screen can run to its bottom edge
   when the sidebar is the taller of the two. */
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.3em 1.5em 0;
}

.app-main > :last-child:is(.am-card.is-cut, .am-cols, .inv) {
  flex: 1;
}

.am-head {
  display: flex;
  align-items: center;
  gap: 1.2em;
  min-height: 2.7em;
}

.am-title {
  font-size: 1.45em;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.am-tabs {
  display: flex;
  gap: 0.75em;
  margin-inline: auto;
  color: var(--text-soft);
  font-size: 0.92em;
  white-space: nowrap;
}

.am-tabs b {
  color: var(--text);
  font-weight: 600;
}

.am-tabs i {
  font-style: normal;
  color: var(--text-dim);
  opacity: 0.6;
}

.am-tools {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-left: auto;
}

.am-tabs + .am-tools {
  margin-left: 0;
}

.ab {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  height: 2.5em;
  padding: 0 0.95em;
  border-radius: 0.7em;
  background: var(--panel);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px rgba(38, 30, 20, 0.05);
  font-weight: 500;
  white-space: nowrap;
}

.ab.is-run {
  background: var(--coral);
  box-shadow: var(--coral-glow);
  color: #fff;
}

.ab.is-run kbd {
  margin-left: 0.2em;
  background: rgba(255, 255, 255, 0.22);
}

.ab.is-quiet {
  background: none;
  box-shadow: none;
  color: var(--text-dim);
}

/* The tabs of an editor, with its Run at the end of the same row. */
.am-strip {
  display: flex;
  align-items: stretch;
  gap: 1.6em;
  min-height: 2.9em;
  margin-top: 0.7em;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  white-space: nowrap;
}

.am-strip > span,
.am-strip > b {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 500;
}

.am-strip > b {
  margin-bottom: -1px;
  border-bottom: 2px solid var(--text);
  color: var(--text);
  font-weight: 600;
}

.am-strip > .ab {
  align-self: center;
  margin: 0 0 0.45em auto;
  color: #fff;
}

/* A count beside a word: a tab's badge, a strip's figure. */
.app em {
  font-style: normal;
}

.am-strip em,
.am-bar em {
  padding: 0.05em 0.5em;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-soft);
  font-size: 0.82em;
  font-weight: 500;
}

.am-bar em {
  margin-left: 0.45em;
}

.am-sec {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1em;
  margin-top: 1.1em;
}

.am-sec strong {
  font-size: 1.08em;
  font-weight: 600;
}

/* A switch that is on. */
.sw {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  white-space: nowrap;
}

.sw i {
  position: relative;
  width: 2.3em;
  height: 1.3em;
  border-radius: 999px;
  background: var(--coral);
}

.sw i::after {
  content: '';
  position: absolute;
  top: 0.18em;
  right: 0.18em;
  width: 0.94em;
  height: 0.94em;
  border-radius: 50%;
  background: #fff;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  height: 1.85em;
  padding: 0 0.75em;
  border-radius: 999px;
  background: var(--card);
  color: var(--text-body);
  font-size: 0.88em;
  font-weight: 500;
  white-space: nowrap;
}

.pill.is-line {
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line);
}

.pill.is-look {
  background: var(--panel);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--a-bad) 55%, transparent);
  color: var(--text);
}

.pill.is-blue {
  background: color-mix(in srgb, var(--a-run) 14%, var(--panel));
  color: color-mix(in srgb, var(--a-run) 62%, var(--text));
}

.pill.is-ok {
  background: color-mix(in srgb, var(--a-ok) 14%, var(--panel));
  color: color-mix(in srgb, var(--a-ok) 72%, var(--text));
}

.pill.is-violet {
  background: color-mix(in srgb, var(--a-violet) 13%, var(--panel));
  color: var(--a-violet);
}

.pill.is-coral {
  background: color-mix(in srgb, var(--coral) 13%, var(--panel));
  color: color-mix(in srgb, var(--coral) 82%, var(--text));
}

.dot {
  display: inline-block;
  flex: none;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--text-dim);
}

.dot.ok {
  background: var(--a-ok);
}

.dot.bad {
  background: var(--a-bad);
}

.dot.warn {
  background: var(--a-warn);
}

/* A card of the page: the table's frame, an editor, a list. The last one on a
   screen runs off its bottom edge, as a capture cut there would. */
.am-card {
  min-width: 0;
  margin-top: 1em;
  overflow: hidden;
  border-radius: 1em;
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--line);
}

.am-card.is-cut {
  border-radius: 1em 1em 0 0;
}

.am-bar {
  display: flex;
  align-items: center;
  gap: 1.3em;
  min-height: 3.1em;
  padding: 0 1.2em;
  border-bottom: 1px solid var(--line);
  font-size: 0.92em;
  white-space: nowrap;
}

.am-bar strong {
  font-weight: 600;
}

.am-bar .push {
  margin-left: auto;
}

.am-bar .soft {
  color: var(--text-soft);
}

.am-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1em;
}

.am-cols > .am-card {
  margin-top: 1em;
}

.am-cols.is-uneven {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

/* --- a table ------------------------------------------------------------------- */

.at {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.at th {
  height: 2.9em;
  padding: 0 1.1em;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.at td {
  height: 3em;
  padding: 0 1.1em;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-body);
  text-align: right;
  white-space: nowrap;
}

.at .l {
  text-align: left;
}

.at .neg {
  color: var(--a-bad);
}

.at .n {
  width: 2.6em;
  padding-right: 0;
  color: var(--text-dim);
  font-size: 0.85em;
  text-align: center;
}

.at .dot {
  margin-right: 0.6em;
  vertical-align: 0.08em;
}

.at tr.is-on td {
  background: var(--row-hl);
}

.at tr.is-fade td {
  opacity: 0.45;
}

.at.is-mono td,
.at.is-mono th {
  height: 2.5em;
  font: 500 0.9em var(--mono);
}

.at.is-mono th {
  color: var(--text-soft);
}

/* --- a query ------------------------------------------------------------------- */

.code {
  padding: 0.9em 0 1em;
  counter-reset: line;
  font: 500 0.92em / 1.8 var(--mono);
  color: var(--text-body);
}

.cl {
  display: block;
  padding-right: 1.2em;
  overflow: hidden;
  white-space: pre;
}

.cl::before {
  content: counter(line);
  counter-increment: line;
  display: inline-block;
  width: 2.4em;
  margin-right: 1.2em;
  color: var(--text-dim);
  opacity: 0.7;
  text-align: right;
}

.code .k {
  color: var(--a-violet);
}

.code .f {
  color: var(--blue-ink);
}

.code .s {
  color: var(--a-ok);
}

.code .v {
  color: var(--accent);
}

.code .c {
  color: var(--text-dim);
}

/* A query that would write: struck, with what the editor says about it. */
.cl.is-refused {
  background: color-mix(in srgb, var(--a-bad) 9%, transparent);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--a-bad) 60%, transparent);
}

.am-note {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.7em 1.2em;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.9em;
}

.am-note.is-bad {
  background: color-mix(in srgb, var(--a-bad) 7%, transparent);
  color: color-mix(in srgb, var(--a-bad) 70%, var(--text));
}

.am-note svg {
  width: 1em;
  height: 1em;
}

/* --- the mapping board --------------------------------------------------------- */

.map {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr) minmax(0, 1fr);
}

.map > * {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-width: 0;
  min-height: 3.1em;
  padding: 0.5em 1.2em;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.map > .map-h {
  min-height: 2.9em;
  border-bottom-color: var(--line);
  font-weight: 600;
}

.map > .map-g {
  grid-column: 1 / -1;
  min-height: 2.2em;
  background: var(--bg);
  color: var(--text-dim);
  font: 500 0.78em var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map code {
  font: 500 0.92em var(--mono);
}

.map .ty {
  display: grid;
  flex: none;
  place-items: center;
  width: 2em;
  height: 1.5em;
  border-radius: 0.4em;
  background: var(--card);
  color: var(--text-soft);
  font: 600 0.72em var(--mono);
}

.map-h em {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.85em;
  font-weight: 500;
}

.map-h .pill {
  height: 1.6em;
  font-size: 0.78em;
}

/* How a measure is added up: the select at the end of its cell. */
.map .agg {
  margin-left: auto;
  padding: 0.1em 0.55em;
  border-radius: 0.4em;
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-soft);
  font-size: 0.78em;
  font-weight: 600;
}

/* A row of the Normalise tab, and what it does to one value. */
.norm {
  display: flex;
  align-items: center;
  gap: 0.7em;
  min-height: 3.1em;
  padding: 0 1.2em;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

.norm code {
  font: 500 0.92em var(--mono);
}

.norm .ty {
  display: grid;
  flex: none;
  place-items: center;
  width: 2em;
  height: 1.5em;
  border-radius: 0.4em;
  background: var(--card);
  color: var(--text-soft);
  font: 600 0.72em var(--mono);
}

.norm .soft {
  margin-left: auto;
  color: var(--text-soft);
}

.norm.is-eg {
  border-bottom: 0;
}

.norm.is-eg code {
  padding: 0.1em 0.5em;
  border-radius: 0.4em;
  background: var(--card);
}

.norm.is-eg svg {
  width: 1em;
  height: 1em;
  color: var(--text-dim);
}

/* --- the row panel -------------------------------------------------------------- */

.app-main.has-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27em;
  gap: 1.2em;
  padding-right: 1.2em;
}

.app-main.has-panel > div {
  min-width: 0;
}

.app-main.has-panel > div:first-child,
.app-main.has-log > div:first-child {
  display: flex;
  flex-direction: column;
}

.app-main.has-panel > div:first-child > .am-card,
.app-main.has-log .wf {
  flex: 1;
}

.rp {
  align-self: start;
  margin-bottom: 1.2em;
  padding: 1.1em 1.3em 1.2em;
  border-radius: 1.1em;
  background: var(--panel);
  box-shadow:
    0 0 0 1px var(--line),
    0 1.4em 2.6em -1.4em rgba(38, 30, 20, 0.35);
}

.rp-who {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.rp-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5em;
  height: 2.5em;
  border-radius: 0.65em;
  background: linear-gradient(135deg, #3f8a2c, #17866b 55%, #2f6a35);
  color: #fff;
  font-size: 0.85em;
  font-weight: 700;
}

.rp-who strong {
  display: block;
  font-size: 1.15em;
  font-weight: 650;
  line-height: 1.2;
}

.rp-who small {
  display: block;
  color: var(--text-soft);
  font-size: 0.85em;
}

.rp-who em {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.85em;
  font-style: normal;
}

.rp-state {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-top: 1em;
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 0.92em;
  white-space: nowrap;
}

.rp-state strong {
  color: var(--text);
  font-weight: 600;
}

.rp-label {
  margin-top: 0.9em;
  color: var(--text-soft);
  font-size: 0.86em;
}

/* One small table a measure: each system's figure, and the gap beside the
   one that is out. */
.rp-figs {
  display: grid;
  grid-template-columns: 1fr auto 5.4em;
  font-variant-numeric: tabular-nums;
}

.rp-figs > * {
  padding: 0.36em 0;
  border-top: 1px solid var(--line-soft);
}

.rp-figs > :nth-child(3n + 2),
.rp-figs > :nth-child(3n) {
  font-weight: 600;
  text-align: right;
}

.rp-figs .h {
  padding-top: 0.8em;
  border-top: 0;
  color: var(--text-soft);
  font-size: 0.86em;
  font-weight: 400;
}

.rp-figs .neg {
  color: var(--a-bad);
}

.rp-sec {
  margin-top: 0.8em;
  border-top: 1px solid var(--line);
}

.rp-sec > strong {
  display: block;
  margin-top: 0.25em;
  font-size: 1.12em;
  font-weight: 600;
}

.rp-sec > p:not(.rp-label) {
  margin-top: 0.3em;
  color: var(--text-body);
  font-size: 0.95em;
  line-height: 1.45;
}

.rp-sec > small {
  display: block;
  margin-top: 0.6em;
  color: var(--text-dim);
  font-size: 0.84em;
}

/* The rows the answer rests on, with their total. */
.rp-ev {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-top: 0.7em;
  padding: 0.3em 0.9em;
  border-radius: 0.7em;
  background: var(--bg);
  font: 500 0.86em / 1.9 var(--mono);
  font-variant-numeric: tabular-nums;
}

.rp-ev > :nth-child(even) {
  text-align: right;
}

.rp-ev .t {
  border-top: 1px solid var(--line);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
}

.rp-fix {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-top: 0.4em;
}

.rp-fix > span:first-child {
  min-width: 0;
  font-weight: 500;
}

.rp-fix small {
  display: block;
  color: var(--text-soft);
  font-size: 0.86em;
  font-weight: 400;
}

.rp-fix .ab {
  height: 2.2em;
  margin-left: auto;
}

.rp-foot {
  display: flex;
  gap: 0.5em;
  margin-top: 1em;
  padding-top: 0.9em;
  border-top: 1px solid var(--line);
}

/* --- an investigation: the path it took ---------------------------------------- */

.canvas {
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px);
  background-size: 1.4em 1.4em;
}

.inv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 1.4em;
  align-items: start;
  margin-top: 1em;
  padding: 1.4em 1.4em 1.6em;
  border-radius: 1em 1em 0 0;
  box-shadow: 0 0 0 1px var(--line);
}

.inv-path {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.inv-card {
  position: relative;
  width: 100%;
  max-width: 23em;
  padding: 0.8em 1em 0.85em;
  border-radius: 0.9em;
  background: var(--panel);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 3px rgba(38, 30, 20, 0.06);
}

.inv-card.is-reached {
  box-shadow:
    0 0 0 1.5px var(--coral),
    0 0 0 0.35em color-mix(in srgb, var(--coral) 16%, transparent);
}

.inv-card.is-open {
  box-shadow:
    0 0 0 1.5px var(--a-run),
    0 0 0 0.35em color-mix(in srgb, var(--a-run) 14%, transparent);
}

.inv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5em;
}

.inv-top .pill {
  height: 1.7em;
  border-radius: 0.45em;
  font-size: 0.82em;
  font-weight: 600;
}

.inv-card strong {
  display: block;
  margin-top: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}

.inv-card small {
  display: block;
  margin-top: 0.3em;
  color: var(--text-soft);
  font-size: 0.86em;
}

.inv-tick {
  position: absolute;
  top: -0.55em;
  right: -0.55em;
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  background: #1f8a4c;
  box-shadow: 0 0 0 2px var(--bg);
}

.inv-tick::after {
  content: '';
  position: absolute;
  top: 0.32em;
  left: 0.5em;
  width: 0.36em;
  height: 0.62em;
  transform: rotate(45deg);
  border: solid #fff;
  border-width: 0 0.14em 0.14em 0;
}

/* The wire down from a step, with the answer it gave on it, and beside it
   the ways out it did not take. */
.inv-wire {
  display: flex;
  align-items: center;
  gap: 0.6em;
  min-height: 3.4em;
  margin-left: 2.2em;
  padding-left: 1.1em;
  border-left: 2px solid var(--a-run);
}

.inv-wire .pill {
  height: 1.7em;
  font-size: 0.82em;
  font-weight: 600;
}

.inv-wire .pill.is-taken {
  box-shadow: 0 0 0 1.5px var(--a-run);
}

.inv-wire .not {
  color: var(--text-dim);
  font-size: 0.82em;
  white-space: nowrap;
}

/* The open step, in the window a step opens in. */
.inv-step {
  overflow: hidden;
  border-radius: 0.9em;
  background: var(--panel);
  box-shadow:
    0 0 0 1px var(--line),
    0 1.4em 2.6em -1.4em rgba(38, 30, 20, 0.35);
}

.inv-step h4 {
  margin: 0;
  padding: 0.75em 1.1em 0.2em;
  font-size: 1em;
  font-weight: 600;
}

.inv-step .rp-label {
  margin: 0;
  padding: 0.6em 1.3em 0.1em;
}

.inv-step .code {
  font-size: 0.86em;
}

/* --- a workflow ---------------------------------------------------------------- */

.app-main.has-log {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 23em;
  padding: 0;
}

.app-main.has-log > div:first-child {
  min-width: 0;
  padding: 1.3em 1.3em 0 1.5em;
}

.wf {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-content: center;
  align-items: start;
  margin-top: 1em;
  padding: 2.6em 0 3em;
}

.wf-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.wf-tile {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 5em;
  height: 5em;
  border-radius: 1em;
  background: var(--panel);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 3px rgba(38, 30, 20, 0.06);
}

.wf-node.is-first .wf-tile {
  border-radius: 2.2em 1em 1em 2.2em;
  color: var(--coral);
}

.wf-node.is-blue .wf-tile {
  color: var(--blue-ink);
}

.wf-tile svg {
  width: 2em;
  height: 2em;
  stroke-width: 1.9;
}

/* The wire to the next node, from this tile's right edge to that one's left. */
.wf-node:not(.is-last)::after {
  content: '';
  position: absolute;
  top: 2.5em;
  left: calc(50% + 2.5em);
  width: calc(100% - 5em);
  border-top: 1.5px solid var(--a-wire);
}

.wf-node.is-done:not(.is-last)::after {
  border-top-color: var(--a-ok);
}

.wf-node strong {
  display: block;
  max-width: 10em;
  margin-top: 0.7em;
  font-size: 0.92em;
  font-weight: 500;
  line-height: 1.25;
}

.wf-node small {
  display: block;
  margin-top: 0.15em;
  color: var(--text-soft);
  font-size: 0.82em;
}

/* The way out a wire leaves by, written over it just past the tile. */
.wf-out {
  position: absolute;
  z-index: 2;
  top: 1.4em;
  left: calc(50% + 3.6em);
  color: var(--text-soft);
  font-size: 0.78em;
}

.wf-tick {
  position: absolute;
  z-index: 2;
  top: -0.45em;
  right: -0.45em;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background: #1f8a4c;
  box-shadow: 0 0 0 2px var(--bg);
}

.wf-tick::after {
  content: '';
  position: absolute;
  top: 0.28em;
  left: 0.45em;
  width: 0.32em;
  height: 0.56em;
  transform: rotate(45deg);
  border: solid #fff;
  border-width: 0 0.13em 0.13em 0;
}

.wf-node.is-idle {
  opacity: 0.55;
}

/* What the last execution did, step by step: the pane beside the canvas. */
.log {
  min-width: 0;
  padding: 1.1em 1.2em 1.3em;
  border-left: 1px solid var(--line);
  background: var(--panel);
}

.log-head {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
}

.log-head .pill {
  margin-left: auto;
}

.log-sub {
  margin-top: 0.2em;
  color: var(--text-soft);
  font-size: 0.86em;
}

.log ol {
  margin: 0.9em 0 0;
  padding: 0;
  list-style: none;
}

.log li {
  padding: 0.65em 0;
  border-top: 1px solid var(--line-soft);
}

.log li > span {
  display: flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 500;
}

.log li > span em {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.85em;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.log code {
  display: block;
  margin-top: 0.3em;
  padding-left: 1.2em;
  overflow: hidden;
  color: var(--text-soft);
  font: 500 0.82em / 1.6 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log code b {
  color: var(--a-ok);
  font-weight: 500;
}

/* --- the Overview's list of checks --------------------------------------------- */

.ov {
  padding-bottom: 1.4em;
}

.ov-row {
  display: grid;
  grid-template-columns: 3em minmax(0, 1.5fr) minmax(0, 1fr) 9em;
  align-items: center;
  gap: 1.1em;
  padding: 0.95em 1.3em;
  border-bottom: 1px solid var(--line-soft);
}

.ov-row:last-child {
  border-bottom: 0;
}

.ov-av {
  display: grid;
  place-items: center;
  width: 3em;
  height: 3em;
  border-radius: 0.8em;
  color: #fff;
  font-size: 0.82em;
  font-weight: 700;
}

.ov-row strong {
  display: block;
  overflow: hidden;
  font-weight: 500;
  font-size: 1.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-row small {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.92em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ov-row .st {
  display: flex;
  align-items: center;
  gap: 0.55em;
}

/* Fourteen nights: a column for each night the check had rows out. */
.ov-spark {
  display: flex;
  align-items: flex-end;
  gap: 0.22em;
  height: 1.9em;
  border-bottom: 1.5px solid var(--a-run);
}

.ov-spark i {
  flex: 1;
  border-radius: 0.15em 0.15em 0 0;
  background: color-mix(in srgb, var(--a-bad) 75%, transparent);
}

/* --- narrower: no sidebar ------------------------------------------------------ */

@container (max-width: 940px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    font-size: clamp(8px, calc(100cqw * 13 / 780), 14.5px);
  }

  .app-side,
  .app .wide {
    display: none;
  }

  .app-main.has-panel {
    grid-template-columns: minmax(0, 1fr) 24em;
  }

  .app-main.has-log,
  .am-cols.is-uneven {
    grid-template-columns: minmax(0, 1fr);
  }

  .am-cols.is-uneven {
    gap: 0;
  }

  .am-cols.is-uneven > .am-card.is-cut:not(:last-child) {
    border-radius: 1em;
  }

  .log {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .app-main.has-log > div:first-child {
    padding-right: 1.5em;
  }
}

/* --- a phone ------------------------------------------------------------------- */

@container (max-width: 640px) {
  .app {
    font-size: clamp(9px, calc(100cqw * 13 / 440), 14.5px);
  }

  .app .mid {
    display: none;
  }

  .app-main {
    padding: 1.1em 1.1em 0;
  }

  .am-tabs {
    display: none;
  }

  .am-title {
    font-size: 1.25em;
  }

  .am-tools {
    margin-left: auto;
  }

  .am-cols,
  .am-cols.is-uneven,
  .app-main.has-panel,
  .inv {
    grid-template-columns: minmax(0, 1fr);
  }

  .am-cols > .am-card.is-cut:not(:last-child) {
    border-radius: 1em;
  }

  .am-cols {
    gap: 0;
  }

  .rp {
    margin-top: 1em;
  }

  .map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
  }

  /* A meaning may take two lines here; a column's name never breaks. */
  .map > * {
    padding-inline: 0.8em;
    white-space: normal;
  }

  .at th,
  .at td {
    padding-inline: 0.7em;
  }

  /* The workflow top to bottom: a tile, its name beside it, the wire below. */
  .wf {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5em;
    padding: 1.6em 0.4em 1.8em;
  }

  .wf-node {
    flex-direction: row;
    gap: 1em;
    text-align: left;
  }

  .wf-node > div:last-child {
    min-width: 0;
  }

  .wf-tile {
    width: 3.6em;
    height: 3.6em;
  }

  .wf-tile svg {
    width: 1.5em;
    height: 1.5em;
  }

  .wf-node strong {
    max-width: none;
    margin-top: 0;
  }

  .wf-node:not(.is-last)::after {
    top: 3.6em;
    left: 1.8em;
    width: 0;
    height: 1.5em;
    border-top: 0;
    border-left: 1.5px solid var(--a-wire);
  }

  .wf-node.is-done:not(.is-last)::after {
    border-left-color: var(--a-ok);
  }

  .wf-out {
    top: 3.9em;
    left: 2.6em;
  }

  .ov-row {
    grid-template-columns: 3em minmax(0, 1fr);
  }

  .ov-row .st {
    grid-column: 2;
  }
}
