/* 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: 14px 12px; }
@media (max-width: 760px) { .explorer.mesh .stage { grid-template-columns: 1fr 1fr; } }
.explorer.mesh figure { margin: 0; }
.explorer.mesh .cv { position: relative; width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--panel-2); }
.explorer.mesh .cv.wide { aspect-ratio: auto; height: 220px; }
.explorer.mesh .cv canvas { width: 100%; height: 100%; display: block; }
.explorer.mesh figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 6px; 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; border-radius: 4px; }
.explorer.mesh .ctl select { width: 100%; font: inherit; font-size: 0.9rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); margin-top: 4px; }
.explorer.mesh .legend { display: flex; gap: 16px; font-size: 0.82rem; color: var(--muted); margin-top: 6px; }
.explorer.mesh .legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.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; } }
.explorer.mesh .ctl input.box { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.explorer.mesh .speedctl input[type=range] { width: 110px; accent-color: var(--accent); }
.explorer.mesh .speedctl .val { font-family: ui-monospace, Menlo, monospace; color: var(--text); min-width: 1.5em; text-align: right; }
.explorer.mesh .ctl sup { font-size: 0.7em; color: var(--faint); margin-left: 1px; }
.explorer.mesh .scopenote { font-size: 0.78rem; color: var(--faint); }
/* 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: #c9a24a; }
.explorer.mesh .glass .stream { stroke: #c9a24a; stroke-width: 0.8; stroke-dasharray: 1 1.2; animation: glass-fall 0.5s linear infinite; transition: opacity 0.3s; }
@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, .explorer.mesh .best a { color: var(--accent); }
.explorer.gate .stage { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .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(--warn); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.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; } }
/* 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;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); 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 .bname i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.explorer.mesh .board .bbar { display: block; height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; margin-right: 58px; position: relative; }
.explorer.mesh .board .bbar b { display: block; height: 100%; border-radius: 4px; transition: width 0.2s; }
.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; }
.explorer.gate .drop { display: block; margin: 10px 0 4px; padding: 16px; border: 1.5px dashed var(--border); border-radius: 10px; text-align: center; color: var(--muted); cursor: pointer; font-size: 0.92rem; }
.explorer.gate .drop:hover, .explorer.gate .drop.over { border-color: var(--accent); color: var(--text); }
.explorer.gate .drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.explorer.gate .drop u { color: var(--accent); }
.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); background: color-mix(in srgb, var(--panel-2) 78%, transparent); 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; }
@media (max-width: 600px) { .explorer.mesh .best table.diag { font-size: 0.8rem; } .explorer.mesh .best table.diag th, .explorer.mesh .best table.diag td { padding: 6px 4px; } }
/* /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 */
.explorer.gate .meshbar label[title] > span:first-child, .explorer.gate #rounds [title] { text-decoration: underline dotted; text-decoration-color: var(--faint); text-underline-offset: 3px; cursor: help; }
.explorer.gate .meshbar { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* /decision-mesh: 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;
  background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; }
.explorer #race-statustext { color: var(--muted); font-size: 0.88rem; flex: 1 1 260px; }
.explorer #race-statusbar .buttons { display: flex; gap: 8px; margin-left: auto; }
@media (max-width: 600px) { .explorer #race-statusbar { top: 3.5rem; } }
.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; gap: 10px; margin: 1.6rem 0 0; }
.explorer .dm-end a { font-weight: 600; font-size: 0.9rem; padding: 0.55rem 1rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text); }
.explorer .dm-end a:hover { border-color: var(--accent); text-decoration: none; }
.explorer .dm-end a.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
