/* The tire-radius activity (the website's own tool, on GPT's model). The three steps and Reset across the top; the stage
   (the side view, the dimensions, the roll's three rigid wheels) with the clip's controls under it; and the panel: the
   step's radius with its reason, and the chart and table of the three radii. On a wide frame the panel stands beside the
   stage, which is about square, as both views are (the wheel and its gauge; the tire's road and the three lanes); on a
   narrow one everything stacks. The page's frame takes the height of main and keeps the tallest it has seen, so main
   fills the frame (min-height: 100vh), the stage takes up what is left, and the panel's text keeps one height
   (docs/standards/tool-handover.md, section 3). */
* { box-sizing: border-box; }
/* a scrollbar must not change the width (the stage's height follows it) */
html { scrollbar-gutter: stable; }
html, body { margin: 0; background: #f4f5f1; color: #1f2a24; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
sub { line-height: 0; }   /* a subscript must not make its line taller: the value line keeps one height in every step */
.tr { display: grid; gap: 8px; padding: 8px; min-height: 100vh; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "bar" "stage" "time" "panel"; grid-template-rows: auto minmax(0, 1fr) auto auto; }
.tr__bar { grid-area: bar; }
.tr__stage { grid-area: stage; }
.tr__time { grid-area: time; }
.tr__panel { grid-area: panel; }
@media (min-width: 820px) {
  .tr { grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr); grid-template-areas: "bar bar" "stage panel" "time panel";
    grid-template-rows: auto minmax(0, 1fr) auto; }
}

/* the steps */
.tr__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tr__steps { display: flex; flex-wrap: wrap; gap: 6px; }
.tr__step { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 4px 11px 4px 6px; border: 1px solid #b9c6bd;
  border-radius: 8px; background: #fff; color: #1f2a24; font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; }
.tr__n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 12px; background: #dcefe6; color: #0f5f59;
  font-size: 13px; font-weight: 800; }
.tr__step:hover { border-color: #0f766e; background: #eef6f2; }
.tr__step[aria-current="step"] { border-color: #0f766e; background: #0f766e; color: #fff; }
.tr__step[aria-current="step"] .tr__n { background: #fff; color: #0f766e; }
.tr__reset { margin-left: auto; }
.tr__btn { min-height: 38px; padding: 4px 12px; border: 1px solid #b9c6bd; border-radius: 8px; background: #fff; color: #1f2a24;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tr__btn:hover:not(:disabled) { border-color: #0f766e; background: #eef6f2; }
.tr__btn:disabled { color: #8a978f; cursor: default; }
.tr__step:focus-visible, .tr__btn:focus-visible, .tr__go:focus-visible, .tr__scrub input:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* the stage: about square, as tall as the panel beside it on a wide frame */
.tr__stage { position: relative; min-height: min(calc(100vw - 16px), 560px); border-radius: 10px; overflow: hidden; background: #e9ece6; }
@media (min-width: 820px) { .tr__stage { min-height: calc((100vw - 39px) * 0.56); } }
.tr__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.tr__marks { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.tr__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tr__cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: rgba(233, 236, 230, .35); }
.tr__go { min-height: 48px; padding: 8px 22px; border: 0; border-radius: 999px; background: #0f766e; color: #fff; font: inherit; font-size: 17px;
  font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(15, 47, 43, .25); }
.tr__go:hover { background: #0f5f59; }
.tr__note { margin: 0; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: #34433c; font-size: 13.5px; }
.tr__loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: rgba(233, 236, 230, .7); }
.tr__loading p { margin: 0; color: #34433c; font-weight: 600; }
.tr__loading progress { width: min(260px, 60vw); accent-color: #0f766e; }

/* on the model: the radius between its two points; in the roll, the lanes, their wheels, and the tire's stop */
.tr__marks text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.tr__marks .dim { stroke: #0f5f59; stroke-width: 3; stroke-linecap: round; }
.tr__marks .dim__halo { stroke: #fff; stroke-width: 7; stroke-linecap: round; opacity: .8; }
.tr__marks .dim__text { font-size: 15px; font-weight: 750; fill: #0f3f3b; }
.tr__marks .pt { fill: #c2410c; stroke: #fff; stroke-width: 1.5; }
.tr__marks .tag { font-size: 12.5px; font-weight: 650; fill: #7c2d12; }
.tr__marks .lane { stroke: #8f9b94; stroke-width: 2; }
.tr__marks .lane__start { stroke: #5f7468; stroke-width: 2; }
.tr__marks .lane__text { font-weight: 700; }
.tr__marks .guide { stroke: #1f2a24; stroke-width: 1.5; stroke-dasharray: 6 4; }

/* the clip: play, replay, the time with its three segments (1 s, 2 s, 4 s long) */
.tr__time { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tr__play { min-width: 72px; }
.tr__scrub { display: grid; gap: 1px; min-width: 0; }
.tr__scrub input { width: 100%; margin: 0; accent-color: #0f766e; }
.tr__segs { display: grid; grid-template-columns: 1fr 2fr 4fr; gap: 2px; padding: 0 8px; }
.tr__segs span { height: 15px; border-radius: 3px; background: #dfe6e1; color: #5f7468; font-size: 11px; font-weight: 700; line-height: 15px; text-align: center; }
.tr__segs span.is-on { background: #0f766e; color: #fff; }
.tr__clock { min-width: 54px; font-variant-numeric: tabular-nums; font-weight: 650; text-align: right; }

/* the panel: the step and its radius; the chart and the table */
.tr__panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (min-width: 600px) and (max-width: 819px) { .tr__panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.tr__box { display: flex; flex-direction: column; gap: 6px; padding: 9px 12px 10px; border: 1px solid #d3dcd6; border-radius: 10px; background: #fff; }
.tr__now { flex: 1 0 auto; }
.tr__h { margin: 0; font-size: 15.5px; font-weight: 750; color: #0f5f59; }
.tr__value { margin: 0; font-size: 22px; font-weight: 750; color: #0f3f3b; font-variant-numeric: tabular-nums; }
.tr__value-name { display: block; font-size: 13.5px; font-weight: 600; color: #5f7468; }
.tr__text { margin: 0; color: #34433c; line-height: 1.45; }
.tr__chart { display: block; width: 100%; height: auto; overflow: visible; }
.tr__chart text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.tr__chart .ch__axis { stroke: #34433c; stroke-width: 1.5; }
.tr__chart .ch__tick { stroke: #5f7468; stroke-width: 1; }
.tr__chart .ch__num { font-size: 9.5px; fill: #5f7468; }
.tr__chart .ch__label { font-size: 11px; font-weight: 750; }
.tr__chart .ch__tire { fill: #1f2a24; stroke: #fff; stroke-width: 1.5; }
.tr__chart .ch__tirelabel { font-size: 10.5px; font-weight: 700; fill: #1f2a24; }
.tr__chart .ch__note { font-size: 11px; fill: #5f7468; }
.tr__table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.tr__table thead th:nth-child(1) { width: 52%; }
.tr__table thead th:nth-child(2) { width: 20%; }
.tr__table th, .tr__table td { padding: 3px 5px; border-bottom: 1px solid #e3e9e5; text-align: left; vertical-align: baseline; }
.tr__table thead th { color: #5f7468; font-size: 12.5px; font-weight: 650; }
.tr__table tbody th { font-weight: 600; }
.tr__table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tr__sw { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: 0; }
.tr__sw--unloaded { background: #2563eb; }
.tr__sw--rolling { background: #ea580c; }
.tr__sw--loaded { background: #7c3aed; }

/* the poster (tools/make_tire_radii_poster.mjs): the stage alone, the whole window, no scrollbar's gutter */
html.is-poster { scrollbar-gutter: auto; overflow: hidden; }
.is-poster .tr { display: block; padding: 0; }
.is-poster .tr > :not(.tr__stage), .is-poster .tr__poster, .is-poster .tr__cover, .is-poster .tr__loading, .is-poster .tr__marks { display: none !important; }
.is-poster .tr__stage { position: fixed; inset: 0; min-height: 0; border-radius: 0; }
