/* the Decision Mesh demo: on top of the explorer's tokens and components (noisestate/explorer.css) */
.explorer.mesh .meshbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px 16px; }
.explorer.mesh .meshbar select { width: 100%; }
.explorer.mesh .stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 18px; }   /* room for the pencil: a box's lines stray a few px outside it */
@media (max-width: 760px) { .explorer.mesh .stage { grid-template-columns: 1fr 1fr; gap: 16px 16px; } }
.explorer.mesh figure { margin: 0; }
.explorer.mesh .cv { position: relative; width: 100%; aspect-ratio: 1; }   /* no ruled box: its edge is pencil (below) */
.explorer.mesh .cv canvas { width: 100%; height: 100%; display: block; }
.explorer.mesh figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 11px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.explorer.mesh figcaption b { color: var(--text); font-weight: 650; }
.explorer.mesh figcaption span { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }
.explorer.mesh label.check { display: inline-flex; gap: 6px; align-items: center; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.explorer.mesh label.check input { accent-color: var(--accent); }
.explorer.mesh .scale { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--faint); font-family: ui-monospace, Menlo, monospace; }
.explorer.mesh .scale i { display: inline-block; width: 140px; height: 8px; }
.explorer.mesh .ctl select { width: 100%; font: inherit; font-size: 0.9rem; color: var(--text); margin-top: 4px; }   /* its line and chevron are the site's (partials/header.html) */
.explorer.mesh .meshbar .ctl { display: flex; flex-direction: column; justify-content: space-between; }
@media (min-width: 700px) { .explorer.mesh .meshbar .ctl label { white-space: nowrap; } }
/* the page's patience, beside the chip (mesh-demo.js) */
.explorer.mesh .glass { width: 14px; height: 20px; flex: none; overflow: visible; }
.explorer.mesh .glass .frame { fill: none; stroke: var(--muted); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.explorer.mesh .glass .sand { fill: var(--c2); }
.explorer.mesh .glass .stream { stroke: var(--c2); stroke-width: 0.8; stroke-dasharray: 1 1.2; animation: glass-fall 0.5s linear infinite paused; transition: opacity 0.3s; }   /* mesh-demo.js runs it while the race does */
@keyframes glass-fall { to { stroke-dashoffset: -2.2; } }
@media (prefers-reduced-motion: reduce) { .explorer.mesh .glass .stream { animation: none; } }
/* /gate */
.explorer.gate .tries { font-size: 0.92rem; color: var(--muted); margin: 0 0 16px; max-width: 820px; }
.explorer.gate .tries a { color: var(--accent); }
.explorer.gate .stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 600px) { .explorer.gate .stage { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; } }
.explorer.gate #cvtruth { touch-action: none; }
.explorer.gate .brushrow { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.explorer.gate button.small { padding: 3px 10px; font-size: 0.82rem; }
.explorer.gate i.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }
.explorer.gate .cap { font-size: 0.72rem; color: var(--c2); margin-left: 4px; }   /* the word in the page's orange, no chip */
.explorer.gate .cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
@media (max-width: 600px) { .explorer.gate .cards { grid-template-columns: 1fr 1fr; } .explorer.gate .card .v { font-size: 1.15rem; } }
/* on a phone the status line holds room for a result's usual three lines, so neither the first result nor a short one
   moves the canvases under it (gate.js also keeps the line's height while a fit runs) */
@media (max-width: 600px) { .explorer.gate #statustext { min-height: 3lh; } }
/* the standings, in the stage's sixth cell */
.explorer.mesh .board { aspect-ratio: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 14px 16px;
  font-size: 0.86rem; }
.explorer.mesh .board .bhead { color: var(--muted); font-size: 0.8rem; }
.explorer.mesh .board .brow { display: grid; grid-template-columns: 1fr; gap: 4px; }
.explorer.mesh .board .bname { color: var(--muted); display: flex; align-items: center; gap: 7px; }
.explorer.mesh .board .brow.lead .bname { color: var(--text); font-weight: 650; }
.explorer.mesh .board .bbar { display: block; height: 8px; margin-right: 58px; position: relative; }
/* each error is one pencil stroke as long as the error: a single ribbon, heavier where the pencil lands and thin where
   it lifts, stretched to the length. The leader's is drawn firmer. Ink only: each stroke is named above it */
.explorer.mesh .board .bbar b { display: block; height: 100%; transition: width 0.2s; background: var(--muted); opacity: 0.8; transform-origin: 0 50%;
  -webkit-mask: var(--stroke) 0 0 / 100% 100% no-repeat; mask: var(--stroke) 0 0 / 100% 100% no-repeat; }
.explorer.mesh .board .brow.lead .bbar b { background: var(--text); opacity: 1; transform: scaleY(1.3); }
.explorer.mesh .board { --stroke: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8' preserveAspectRatio='none'%3E%3Cpath d='M1,3.49L9,3.36L16,3.42L24,3.45L31,3.54L39,3.64L47,3.65L54,3.54L62,3.41L70,3.37L77,3.39L85,3.39L92,3.36L100,3.39L108,3.55L115,3.75L123,3.86L130,3.86L138,3.85L146,3.86L153,3.84L161,3.70L169,3.49L176,3.34L184,3.37L191,3.65L199,3.72L199,4.10L191,4.44L184,4.98L176,5.26L169,5.31L161,5.27L153,5.24L146,5.27L138,5.29L130,5.23L123,5.15L115,5.15L108,5.22L100,5.26L92,5.19L85,5.08L77,5.02L70,5.03L62,5.00L54,4.91L47,4.86L39,4.92L31,5.08L24,5.18L16,5.20L9,5.20L1,4.95Z'/%3E%3C/svg%3E"); }
.explorer.mesh .board .brow { position: relative; }
.explorer.mesh .board .bval { position: absolute; right: 0; bottom: -3px; font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; color: var(--text); }
.explorer.mesh .board .bfoot { color: var(--faint); font-size: 0.75rem; }
@media (max-width: 760px) { .explorer.mesh .board { padding: 10px; gap: 7px; font-size: 0.78rem; } .explorer.mesh .board .bhead, .explorer.mesh .board .bfoot { display: none; } }
/* /gate: fitting a visitor's own CSV */
.explorer.gate .own h2 { margin-top: 0; }
.explorer.gate .own .caption { max-width: 820px; }
/* where a file is dropped: an area marked off by one light pencil line a side (js/scribble.js), which darkens under the
   pointer and turns to the accent while a file is held over it or the chooser has the keyboard */
.explorer.gate .drop { display: block; position: relative; margin: 14px 0 8px; padding: 18px 16px; border: 1px solid transparent; text-align: center; color: var(--muted); cursor: pointer; font-size: 0.92rem; }
.explorer.gate .drop > .scr { --scr-opacity: 0.42; }
.explorer.gate .drop:hover { color: var(--text); }
.explorer.gate .drop:hover > .scr { opacity: 0.8; }
.explorer.gate .drop:is(.over, :focus-within) { color: var(--text); }
.explorer.gate .drop:is(.over, :focus-within) > .scr { color: var(--accent); opacity: 1; }
.explorer.gate .drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* (hands, 11-09) "choose a file" is a link in the page's manner (.explorer a: the accent, no line; a line under the pointer), not the browser's underlined <u> */
.explorer.gate .drop u { color: var(--accent); text-decoration: none; }
@media (hover: hover) { .explorer.gate .drop:hover u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; } }
.explorer.gate .colpick { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-top: 10px; }
.explorer.gate .colpick .ctl { min-width: 150px; }
.explorer.gate .ownmsg { margin: 8px 0 0; font-size: 0.88rem; color: var(--muted); min-height: 1.2em; }
.explorer.gate .ownmsg.bad { color: var(--warn); }
.explorer.gate .stage.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; }
@media (max-width: 760px) { .explorer.gate .stage.two { grid-template-columns: 1fr; } }
/* axis names on the plots of a visitor's data */
.explorer.gate .cv .ax { position: absolute; font: 0.72rem ui-monospace, Menlo, monospace; color: var(--text); text-shadow: 0 0 3px var(--ground), 0 0 1px var(--ground); padding: 1px 5px; border-radius: 4px; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.explorer.gate .cv .ax.x { left: 50%; bottom: 4px; transform: translateX(-50%); }
.explorer.gate .cv .ax.y { left: 4px; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; max-width: none; max-height: 92%; }
/* the error chart's key, above the canvas; on a phone the Best-RMSE table fits the width */
.explorer.mesh #curvekey { flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
/* /gate: rounds that admitted nothing, greyed (gate.js report) */
.explorer.gate #rounds tr.none td { color: var(--faint); }
.explorer.gate #rounds tr.none td b { font-weight: 400; }
.explorer.gate #rounds tr.none i.dot { opacity: 0.35; }
/* /gate: a label or heading with a gloss in its title is marked, so the tooltip can be found. (hands, 11-09) the mark is
   the notes' one for "this word has an explanation": the faint pencil stroke under it (images/marks/gloss-pencil-*.svg,
   css/study-note.css), the site's blue under the pointer; it was a dotted underline */
.explorer.gate .meshbar label[title] > span:first-child, .explorer.gate #rounds [title] { cursor: help; }
.explorer.gate .meshbar label[title] > span:first-child, .explorer.gate #rounds :is(span[title], th[title] > span) { padding-bottom: 0.2em;
  background: url(../images/marks/gloss-pencil-light.svg) 0 100% / 100% 0.36em no-repeat; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.dark .explorer.gate .meshbar label[title] > span:first-child, .dark .explorer.gate #rounds :is(span[title], th[title] > span) { background-image: url(../images/marks/gloss-pencil-dark.svg); }
/* the control labels are whole boxes a line high (flex items), so their stroke is lifted to sit as close under the words as it does in the table */
.explorer.gate .meshbar label[title] > span:first-child { padding-bottom: 0; background-position: 0 calc(100% - 1px); }
@media (hover: hover) {
  .explorer.gate .meshbar label[title]:hover > span:first-child, .explorer.gate #rounds :is(span[title]:hover, th[title]:hover > span) { background-image: url(../images/marks/gloss-pencil-light-on.svg); }
  .dark .explorer.gate .meshbar label[title]:hover > span:first-child, .dark .explorer.gate #rounds :is(span[title]:hover, th[title]:hover > span) { background-image: url(../images/marks/gloss-pencil-dark-on.svg); }
}
.explorer.gate .meshbar { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* the sliders (css/sliders.css) keep the 26px the fields' row was laid out with, so what follows does not move */
.explorer.gate .meshbar input[type=range] { margin-bottom: 2px; }
/* /decisionmesh: the live fit, the story (gate-how.css), the race and the tail are sibling blocks of one page */
.dmesh > .explorer + .explorer, .dmesh > .gatehow + .explorer, .dmesh > .skip-pill + .explorer { padding-top: 2rem; }
.dmesh > .explorer:not(:last-child) { padding-bottom: 1rem; }
.dmesh h2.sect { font-family: Newsreader, "Iowan Old Style", Georgia, serif; font-weight: 500; font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; scroll-margin-top: 4.5rem; }
.dmesh .gatehow h2.sect { color: var(--ink); }
.dmesh .gatehow .howhead { scroll-margin-top: 4.5rem; }
.explorer.race .geoms { margin: 0 0 16px; padding-left: 1.2rem; max-width: 820px; color: var(--muted); }
.explorer.race .geoms li { margin: 0 0 6px; }
.explorer.race .geoms b { color: var(--text); font-weight: 650; }
.explorer.race .caption { margin: 12px 0 0; }
/* the race's status bar: the explorer's #statusbar, under its own id */
.explorer #race-statusbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; position: sticky; top: 4rem; z-index: 5;
  padding: 10px 0; margin-bottom: 18px; min-height: 64px; }   /* room for two lines of status, so nothing below moves as the text changes */
/* the bar stays put over the pictures as they scroll, so it is a patch of the paper. It has no box: the patch is a
   little wider than the pictures' pencil frames and thins out along its lower edge, so they slide under paper, not
   under a ruled line */
.explorer #race-statusbar::before { content: ""; position: absolute; inset: -12px -9px -6px; z-index: -1;
  background: var(--ground) var(--paper-img) 0 var(--paper-y, 0px) / 768px 768px fixed; background-blend-mode: var(--patch-blend);
  -webkit-mask: linear-gradient(#000 calc(100% - 12px), transparent); mask: linear-gradient(#000 calc(100% - 12px), transparent); }
.explorer.race .chip { background: none; padding: 0 2px 0 0; }   /* the state is a word on the paper; only "Growing" is lit */
.explorer.race .chip:is(.ok, .idle) { color: var(--muted); }
.explorer.race .chip.busy { color: var(--accent); }
.explorer #race-statustext { color: var(--muted); font-size: 0.88rem; flex: 1 1 260px; }
.explorer #race-statusbar .buttons { display: flex; gap: 10px; margin-left: auto; }
@media (max-width: 600px) { .explorer #race-statusbar { position: static; padding: 0; margin-bottom: 20px; min-height: 0; }   /* not stuck on a phone, as the bar of the live fit is not: no patch */
  .explorer #race-statusbar::before { display: none; } }
/* the race's boxes: no ruled rounded rectangles. Only the five pictures get the heavy hand: each side of a picture's
   box is a pencil line gone over two or three times (js/scribble.js; the seeds are in the template, so every box has
   its own lines and keeps them), and the picture is cut to the first stroke of each side, so it ends on a pencil line.
   The buttons and the two checkboxes get one light pencil line a side. Everything else sits on the paper unboxed: the
   panel that held it all, the status bar, the chip's pill, the standings and their tracks */
.explorer.mesh { --scr-ink: var(--text); }
.explorer.race .cv > .scr { --scr-opacity: 0.44; }
.explorer.gate .cv > .scr { --scr-opacity: 0.38; }   /* the three pictures of the live fit: the same hand, a touch lighter and one pass fewer, as the page has eight framed pictures */
.explorer.race .panel { background: none; border: 0; border-radius: 0; padding: 0; }
.explorer.race .board { padding-left: 4px; padding-right: 4px; }
/* the buttons, on the whole page: one light pencil line a side; the pencil darkens under the pointer and turns to the
   accent when pressed or focused (scribble.js draws the focus). This overrides the explorer's ruled button
   (noisestate/explorer.css) on this page, so its buttons match the race's */
.explorer.mesh button:is(.primary, .secondary) { border-color: transparent; border-radius: 0; background: none !important; color: var(--text); padding: 7px 14px; filter: none; }
.explorer.mesh button.primary { color: var(--accent); font-weight: 600; }
.explorer.mesh button.small { padding: 3px 10px; }
.explorer.mesh #race-playbtn { min-width: 4.8em; }   /* wide enough for Pause, so Play and Pause share one box */
.explorer.mesh button:hover:not(:disabled) > .scr { opacity: 0.95; }
.explorer.mesh button:active:not(:disabled) > .scr { color: var(--accent); opacity: 1; }
.explorer.mesh label.check { position: relative; }
.explorer.mesh label.check > .scr { --scr-opacity: 0.7; --scr-tick: var(--accent); }
.explorer #results-rounds { transition: opacity 0.2s; }
.explorer #results-rounds.stale { opacity: 0.55; }
/* the end of the page: the detail page and the two engines */
.explorer .dm-end { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.7rem; margin: 1.6rem 0 0; }
/* links to other pages, not actions, so they carry no box: text links, as at the feet of the dissertation's cover and
   story (dissertation/opening.css). The main one is in the accent, a little larger, on the pencil underline mark; the
   others are semibold ink with a faint underline */
.explorer .dm-end a { --pad: 0.6rem; position: relative; font-weight: 600; font-size: 0.95rem; padding: var(--pad) 0; color: var(--text);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); }
.explorer .dm-end a:hover { color: var(--accent); text-decoration-color: currentColor; }
.explorer .dm-end a.primary { color: var(--accent); font-size: 1.12rem; text-decoration: none; }
.explorer .dm-end a.primary::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(var(--pad) - 5px); height: 6px; pointer-events: none;
  background: currentColor; -webkit-mask: url(../images/marks/underline.svg) 0 0 / 100% 100% no-repeat; mask: url(../images/marks/underline.svg) 0 0 / 100% 100% no-repeat; }
@media (pointer: coarse) { .explorer .dm-end a { --pad: 0.8rem; } }   /* about 48px of touch height */

/* dark theme: the rasters are light inks on a flat dark ground (#2a2b30). As on the home page's cards, the filter
   takes that ground to black and screen lays black onto the paper as the paper itself, so the grain runs under the
   pictures; in light they are multiplied (partials/header.html) */
.dark .explorer.mesh .cv canvas { mix-blend-mode: screen; filter: brightness(0.852) contrast(1.418); }
/* a color key goes onto the paper the way its pictures do, so the key shows the colors the pictures show */
.dark .explorer.mesh .scale i { mix-blend-mode: screen; filter: brightness(0.852) contrast(1.418); }
html:not(.dark) .explorer.mesh .scale i { mix-blend-mode: multiply; }
