/* The wheel's 3D tool (the website's own, on GPT's models). A toolbar across the top (the views; the wheel, the tire,
   reset); under it the stage and, beside it, the side panel (a mark's chips, the list of the marks the model shows, and
   what the part under the pointer is). The page's frame takes the height of main and keeps the tallest it has seen, so
   main fills the frame (min-height: 100vh) and the stage and the side panel share its height: the text panel and the
   stage take up what is left, and no state leaves a blank band (docs/standards/tool-handover.md, section 3). */
* { box-sizing: border-box; }
/* the page's frame takes the height of main and keeps it: a scrollbar must not change the width, for the square stage's
   height follows it (else the frame settles 9 px short, with a scrollbar); enlarged or on its own page on a wide screen,
   the stage keeps within the window */
html { scrollbar-gutter: stable; }
html, body { margin: 0; background: #f4f5f1; color: #1f2a24;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
.wh { display: grid; gap: 10px; padding: 8px; min-height: 100vh; }
@media (min-width: 800px) { .wh { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); grid-template-rows: 1fr; } }
/* the view: what to show, right above the stage; the stage takes the rest of the column's height */
.wh__view { display: grid; grid-template-rows: auto 1fr; gap: 8px; min-width: 0; }
/* the views and the wheel's own switches share the rows, as many as the width needs; the switches keep right */
.wh__top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 4px; }
.wh__tabs, .wh__tools { display: contents; }
.wh__tools > :first-child { margin-left: auto; }
.wh__tab { min-height: 36px; padding: 4px 9px; border: 1px solid #b9c6bd; border-radius: 8px; background: #fff; color: #1f2a24;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.wh__tab:hover { border-color: #0f766e; background: #eef6f2; }
.wh__tab[aria-pressed="true"] { border-color: #0f766e; background: #0f766e; color: #fff; }
.wh__tab:focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }
/* the stage is about square, within the frame's height, and grows with the index beside it */
@media (min-width: 800px) { .wh__stage { min-height: min(calc((100vw - 41px) * 0.6), calc(100vh - 110px)); } }
@media (max-width: 799px) { .wh__stage { min-height: min(calc(100vw - 16px), 680px); } }
/* the index: the rim (its mark, its parts and dimensions) and the tire (its mark, its components); then what the part
   under the pointer is, which takes the rest of the height */
.wh__side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wh__group { display: grid; gap: 5px; padding: 6px 9px 5px; border: 1px solid #d3dcd6; border-radius: 10px; background: #fff; }
.wh__gh { margin: 0; font-size: 15px; font-weight: 750; color: #0f5f59; }
.wh__group .wh__mark { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0; border: 0; background: none; }
.wh__stage { position: relative; min-width: 0; border-radius: 10px; overflow: hidden; background: #e9ece6; }
.wh__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.wh__canvas:active { cursor: grabbing; }
.wh__loading { position: absolute; inset: auto 0 45% 0; margin: 0; text-align: center; color: #5f7468; }
.wh__loading[hidden] { display: none; }
/* the wheel scrolls the page; over the stage it says, for a moment, how to zoom */
.wh__zoomhint { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); margin: 0;
  padding: 8px 14px; border-radius: 18px; background: rgba(23, 33, 28, .8); color: #fff; font-size: 15px; font-weight: 650;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .25s; }
.wh__zoomhint.is-shown { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .wh__zoomhint { transition: none; } }
/* which wheel: a switch of two halves, the chosen one filled; it holds in every view */
.wh__pick { display: inline-grid; grid-template-columns: auto auto; vertical-align: middle; border: 1px solid #0f766e; border-radius: 8px; overflow: hidden; background: #fff; }
.wh__seg { min-height: 36px; padding: 4px 9px; border: 0; background: #fff; color: #1f2a24; font: inherit; font-size: 14px;
  font-weight: 650; cursor: pointer; }
.wh__seg + .wh__seg { border-left: 1px solid #0f766e; }
.wh__seg:hover { background: #eef6f2; }
.wh__seg[aria-pressed="true"] { background: #0f766e; color: #fff; }
.wh__seg:focus-visible { outline: 3px solid #f59e0b; outline-offset: -3px; }
.wh__btn { min-height: 36px; padding: 4px 9px; border: 1px solid #b9c6bd; border-radius: 8px; background: #fff;
  color: #1f2a24; font: inherit; font-size: 14px; cursor: pointer; }
.wh__btn:hover { border-color: #0f766e; background: #eef6f2; }
.wh__btn[aria-pressed="true"] { border-color: #0f766e; background: #dcefe6; box-shadow: inset 0 -2px #0f766e; }
.wh__btn:focus-visible { outline: 3px solid #0f766e; outline-offset: 2px; }
.wh__info { flex: 1 0 auto; margin: 0; min-height: 5em; padding: 8px 11px; border-left: 3px solid #0f766e; background: #fff;
  border-radius: 0 8px 8px 0; color: #34433c; font-size: 15.5px; line-height: 1.45; }
.wh__info b { color: #1f2a24; }
/* a tire mark's part: what else can stand in its place, this tire's own one lit; then the sources, by author and page */
.wh__types { display: flex; flex-wrap: wrap; gap: 3px 4px; margin: 4px 0 5px; }
.wh__type { padding: 1px 7px; border: 1px solid #b9c6bd; border-radius: 6px; background: #f6f8f4; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.wh__type.is-on { border-color: #c2410c; background: #fff1e8; color: #9a3412; }
.wh__type.is-on b { color: #9a3412; }
.wh__src { display: block; margin-top: 4px; color: #5f7468; font-size: 12.5px; line-height: 1.35; }
/* the marks on the model: a number for a part, a letter for a dimension, a line to the place it names */
.wh__labels { position: absolute; inset: 0; pointer-events: none; }
.wh__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wh__lines line { stroke: #34433c; stroke-width: 2; }
.wh__lines circle { fill: #0f766e; stroke: #fff; stroke-width: 1.5; }
.wh__lines line.is-on { stroke: #c2410c; stroke-width: 2.4; }
.wh__lines circle.is-on { fill: #c2410c; }
.wh__callout, .wh__num { min-width: 26px; height: 26px; padding: 0 6px; border: 2px solid #34433c; border-radius: 13px;
  background: #fff; color: #1f2a24; font: inherit; font-size: 13.5px; font-weight: 750; line-height: 22px; text-align: center; }
.wh__callout { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: help; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.wh__callout.is-dim, .wh__num.is-dim { border-color: #b4532a; color: #9a3412; }
.wh__callout:hover, .wh__callout:focus-visible, .wh__callout.is-on { border-color: #c2410c; background: #c2410c; color: #fff; outline: none; }
.wh__callout[hidden] { display: none; }
/* the dimensions: thick lines with arrowheads, dashed lines out to what they measure */
.wh__lines .dim line { stroke: #b4532a; stroke-width: 3.2; stroke-linecap: round; }
.wh__lines .dim line.ext { stroke-width: 2; stroke-dasharray: 6 4; }
.wh__lines .dim polygon { fill: #b4532a; }
.wh__lines .dim.is-on line { stroke: #c2410c; stroke-width: 4; }
.wh__lines .dim.is-on line.ext { stroke-width: 2.4; }
.wh__lines .dim.is-on polygon { fill: #c2410c; }
/* the steel wheel's weld in the cut, drawn over its section so that it shows at any size */
.wh__lines polygon.weld { fill: #c99a2e; stroke: #6b4c0f; stroke-width: 1.5; stroke-linejoin: round; }
.wh__lines polygon.weld.is-on { fill: #f97316; stroke: #7c2d12; stroke-width: 2.2; }
/* the list beside the model: the same marks */
.wh__legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 6px; }
.wh__legend:empty { display: none; }
.wh__key { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 27px; padding: 1px 3px; border: 0; border-radius: 6px;
  background: none; color: #1f2a24; font: inherit; font-size: 14px; line-height: 1.12; text-align: left; cursor: pointer; }
/* a mark that this view does not show: lighter; a click shows it */
.wh__key.is-off { color: #6f7f75; }
.wh__key.is-off .wh__num { border-color: #b9c6bd; color: #6f7f75; }
.wh__sw { flex: none; width: 14px; height: 14px; margin-left: auto; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .35); }
.wh__num { flex: none; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; font-size: 12.5px; line-height: 20px; }
.wh__key:hover, .wh__key:focus-visible, .wh__key.is-on { background: #fff1e8; color: #9a3412; outline: none; }
.wh__key:hover .wh__num, .wh__key:focus-visible .wh__num, .wh__key.is-on .wh__num { border-color: #c2410c; background: #c2410c; color: #fff; }
/* the rim mark */
.wh__mark { display: grid; gap: 6px; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid #9aa7a0; }
.wh__mark[hidden] { display: none; }
.wh__mark-title { font-size: 14px; color: #5f7468; }
.wh__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.wh__times { font-size: 18px; font-weight: 700; padding: 0 2px; }
.wh__chip { min-width: 32px; min-height: 32px; padding: 1px 6px; border: 1px solid #748a79; border-radius: 6px; background: #fff;
  font: inherit; font-size: 18px; font-weight: 750; color: #1f2a24; cursor: pointer; }
.wh__chip:hover, .wh__chip:focus-visible, .wh__chip.is-on { border-color: #c2410c; background: #fff1e8; color: #9a3412; outline: none; }
.wh__pick[hidden] { display: none; }
