/* Built by Alpas Made.
 *
 * Kinetic Terrain page styles. Tool CSS only: every color, font, radius and size comes from
 * design/tokens.css (--kc-* and --kt-*). The design check (scripts/design-check.py) refuses any
 * other color, any font outside the tokens, radii off the scale and spacing off the 4px grid.
 *
 * Order: head, Area field, viewport, steps and controls, facts, result (the KT rule, UI-PROPOSAL section 1).
 * From 900px the steps and controls sit in the 320px column beside the viewport, from the top of the
 * workspace, and the facts under the viewport; below, they stack under it. One exception, for David's scroll
 * budget (2026-10-14): on a phone's Area step the steps and the card come before the map, so Continue is
 * within 1.5 screens. Steps, tabs, tools and buttons are Oswald 600 uppercase -0.03em (David's rule for tool
 * controls); reading text is Inter. Every tapped thing is at least 44px.
 */

/* hidden means hidden: a component's display rule must never show a [hidden] element */
.tr [hidden], .tr-drawer [hidden], .tr-drawer[hidden] { display: none !important; }

/* ------------------------------------------------------------ head */
.tr .tr-tagline { margin: 4px 0 0; font-size: 15px; color: var(--kc-prose); }
.tr .tr-member-use strong { color: var(--kc-text); font-weight: 600; }
.tr .tr-member-use strong:first-child { color: var(--kc-gold); }
.tr .tr-download-license { margin: 12px 0 0; padding-left: 12px; border-left: 2px solid var(--kc-line-hover); font-size: 13px; line-height: 1.45; color: var(--kc-prose); }
.tr-download-license strong, .tr-download-license span { display: block; }
.tr-download-license strong { color: var(--kc-text); font-weight: 600; }
.tr-world-filename { overflow-wrap: anywhere; }

/* tool controls in Oswald: buttons, steps, tabs, tools */
.tr .kt-btn-red, .tr .kt-btn-2, .tr-drawer .kt-btn-2 { font: 600 16px/1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; }
.tr .kt-seg button, .tr-drawer .kt-seg button { min-height: var(--kt-target); font: 600 14px/1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; }
.tr .kt-link, .tr-drawer .kt-link { font: 600 15px/1.2 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; }

/* Start over in the tool's head (src/app.js startOver), Oswald like every tool control (the rule above). From
   600 px the head's third column, beside the title block; under 600 px a 44 px icon beside the tagline (its
   words in aria-label), since a third column there would push the Members pill under the name and the phone's
   scroll budgets would lose a line (measured: the head 70 to 102 px at 375; beside the tagline it stays 70) */
.tr-headsub { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tr .tr-headsub .tr-tagline { flex: 1 1 auto; min-width: 0; margin: 0; }
.tr-startover svg { width: 16px; height: 16px; }
/* the icon takes 36 px of the row (no more than the tagline's two lines at 375) while it stays a 44 px target */
.tr .tr-startover--icon { flex: none; width: var(--kt-target); margin-block: -4px; padding: 0; }
.tr .tr-startover--icon svg { width: 20px; height: 20px; }
@media (min-width: 600px) { .tr .tr-startover--icon { display: none; } }
@media (max-width: 599px) { .tr .tr-startover--wide { display: none; } }
.tr-head-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; }
@media (max-width: 599px) {
  .tr .kt-ws__head:not([data-world-navigation]) .tr-head-actions { display: none; }
  .tr .kt-ws__head[data-world-navigation] .tr-startover--wide { display: inline-flex; }
  .tr .kt-ws__head[data-world-navigation] .tr-startover--icon { display: none; }
  .tr .tr-head-actions .kt-btn-2 { padding-inline: 12px; }
}

/* ------------------------------------------------------------ a visitor's preview (ROADMAP decision 36; src/app.js setMode) */
/* tr-visitor on <body>: signed out, signed in without a membership, or a membership that ended. The gate card steps
   aside for the slim join bar (the mockup's state visitor-default), whose line and links the script fills */
body.tr-visitor .kt-gate-host { display: none; }
.tr-memberbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 4px 8px 4px 16px; border: 1px solid var(--kt-member-edge); border-radius: var(--kc-radius-callout); background: var(--kt-member-tint); }
.tr-memberbar p { flex: 1 1 320px; min-width: 0; margin: 0; font-size: 14px; line-height: 1.45; color: var(--kc-prose); }
.tr-memberbar .kt-pill { flex: none; }
.tr-memberbar__acts { display: flex; flex-wrap: wrap; gap: 0 20px; }
.tr .tr-memberbar .kt-link { min-height: var(--kt-target); font-size: 14px; }
/* on a phone the bar shows on the Area step only, so Size's Continue stays within 1.5 screens (375 x 812: 1,233 px
   with it on Grand Canyon, against 1,218; scripts/fold-budget.mjs detailPhone) */
/* No :has() on the page: a :has() rule watching [hidden] makes Chrome restyle the page on every DOM insert (the
   review of plan item 1g measured a dropdown's row inserts at 38 ms instead of 14 with 4x CPU slowdown). src/app.js sets the step (data-step on .tr) and the three states
   below (data-cancel, data-no3d, data-tools3d) beside the hidden attributes they mirror. */
@media (max-width: 599px) { .tr[data-step="detail"] .tr-memberbar { display: none; } }
/* Try one: the six showcase chips (src/app.js tryArea) */
.tr-try { display: grid; gap: 8px; min-width: 0; }
/* the Make step's pair where Build was: two links styled as the row's buttons, the red one never alone */
.tr-members { display: grid; gap: 12px; }
.tr-members .tr-sum b { color: var(--kc-text); font-weight: 600; }
.tr .tr-members .tr-row > a { flex: 1 1 0; min-width: 0; padding-inline: 12px; justify-content: center; text-align: center; text-decoration: none; }

/* What it makes: a visitor's only, under the tool; the six showcase renders, then what the tool does */
.tr .tr-demo { display: none; }
body.tr-visitor .tr .tr-demo { display: flex; flex-direction: column; gap: 16px; }
.tr-demo__six { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 900px) { .tr-demo__six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tr-demo__six figure { display: grid; gap: 8px; margin: 0; min-width: 0; }
.tr-demo__six figcaption { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--kc-text); overflow-wrap: anywhere; }
.tr-demo__img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-card); }
.tr-demo__gets { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.tr-demo__gets li { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--kc-line-row); border-radius: var(--kc-radius-callout); background: var(--kc-card); font-size: 14px; line-height: 1.45; }
.tr-demo__gets b { color: var(--kc-text); font-weight: 600; }
.tr-demo__gets span { color: var(--kc-muted); }
/* the how-to guide line under What it makes: the section's gap spaces it, and the link takes the tool's link color
   as on kc-tools Fill and Scatter (not the browser's default link color; review of 2026-11-11) */
.tr .tr-demo__guide { margin: 0; }
.tr .tr-demo__guide a { color: var(--kc-flag); text-underline-offset: 3px; }

/* ------------------------------------------------------------ workspace */
.tr .tr-work { display: grid; gap: 16px; min-width: 0; }

/* choosing the area: the head with Clear, "Search a place", then the dropdowns (src/ui/picker.js)
   two to a row from 600 px or three from 640 px (data-cols, set so the last row never holds one alone) and one to a row on
   phones. From 1,088 px wide (the finder is the size container) it is six equal columns (David,
   2026-10-27; below): Search a place, Ready-made areas, Country, State or province, Parks and forests and Other worlds
   on the first row; a second row only when County (under State or province, its child) or Clear shows. The search's hint is for screen readers and the box's tooltip only (David,
   2026-10-15: no lone line under the search that pushes the map down). The head is kept for screen readers only. */
/* container-type makes the finder its own layer: z-index 20 keeps the search list over the map and the card
   below it (under the sidebar's peek at 30 and the data library at 50). No max-width: the finder spans the
   workspace, as the map and the step column below it do, so the five columns get all the room there is. */
.tr-find { position: relative; z-index: 20; min-width: 0; container-type: inline-size; }
.tr-find__in { display: grid; gap: 12px; min-width: 0; }
.tr-find .kt-meta { margin: 0; }
.tr-pick__end { display: none; }
.tr-find__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--kt-target); }
.tr .tr-find__head .kt-link { min-height: var(--kt-target); padding: 0 4px; }
.tr .tr-pick__lbl { font: 600 14px/1.2 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--kc-prose); }
.tr-pick { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.tr-pick__f { display: grid; gap: 8px; min-width: 0; align-content: start; }
/* the native selects before src/ui/combo.js draws them (it hides them once the page script runs): the box's own
   size, so nothing jumps */
.tr-select { width: 100%; min-width: 0; height: var(--kt-target); padding: 0 0 0 8px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-raised); color: var(--kc-text); font: 400 16px/1.2 var(--kc-body); color-scheme: dark; }
/* the searchable dropdown (src/ui/combo.js, plan item 1g; the approved mockup's .mk-dd, mockups/final-ui css/mock.css):
   the box shows the chosen name and wraps a long one to a second line (nothing cut, nothing shrinks); the panel under
   it holds the filter, the count line while a filter is typed, and the list, every row at least 44 px. Phones (under
   600 px): the panel is the column's width. Hover only where there is a mouse (iOS drops a tap that changes on hover). */
.kt-combo { position: relative; min-width: 0; }
.tr .kt-combo__btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; min-height: var(--kt-target); padding: 8px 8px 8px 12px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-raised); color: var(--kc-text); font: 400 16px/1.2 var(--kc-body); text-align: left; cursor: pointer; }
.tr .kt-combo__btn[aria-expanded="true"] { border-color: var(--kt-select); }
.tr .kt-combo__btn:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.tr .kt-combo__btn:disabled { color: var(--kc-muted); cursor: default; }
.kt-combo__val { min-width: 0; overflow-wrap: break-word; }
.kt-combo__btn svg { flex: none; width: 16px; height: 16px; color: var(--kc-muted); }
.kt-combo__pop { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; display: none; gap: 8px; width: max(100%, 340px); padding: 8px; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-card); box-shadow: var(--kt-float-shadow); }
.kt-combo--open .kt-combo__pop { display: grid; }
.kt-combo--right .kt-combo__pop { left: auto; right: 0; }
.kt-combo--up .kt-combo__pop { top: auto; bottom: calc(100% + 4px); }
.kt-combo__facets { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px; }
.tr .kt-combo__facet { display:grid;gap:4px;min-width:0;margin:0; }
.kt-combo__facet > span { font:400 13px/1.4 var(--kc-body);color:var(--kc-muted); }
.tr .kt-combo__facet select { width:100%;min-width:0;height:44px;font:400 13px var(--kc-body); }
.tr .kt-combo__clear-facets { align-self:end;width:100%;min-height:44px;padding:0 8px; }
.kt-combo__facets--no-region .kt-combo__clear-facets { grid-column:1 / -1; }
.kt-combo__facet[hidden] { display:none; }
.kt-combo--facets .kt-combo__pop { width:max(100%,420px);overflow-y:auto; }
@media(max-width:599px) {
  .kt-combo--facets .kt-combo__pop { width:100%; }
  .kt-combo__facet { grid-column:1 / -1; }
  .tr .kt-combo__clear-facets { grid-column:1 / -1; }
}
.tr .kt-combo__filter { width: 100%; flex: none; font-variant-numeric: normal; -webkit-appearance: none; appearance: none; }
.kt-combo__filter::placeholder { color: var(--kc-muted); }
.kt-combo__filter::-webkit-search-cancel-button { display: none; }
.kt-combo__filter:focus-visible, .kt-combo__list:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.kt-combo__count { margin: 0 4px; font-size: 13px; line-height: 1.4; color: var(--kc-muted); }
.kt-combo__count:empty { position: absolute; width: 1px; height: 1px; margin: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* empty: out of sight, still a live region */
.kt-combo__list { position: relative; display: flex; flex-direction: column; gap: 4px; max-height: 376px; overflow: auto; overscroll-behavior: contain; }
.kt-combo__list > * { flex: none; }
/* rows out of the list's view skip layout until scrolled to (tools/combo-bench.mjs); the size is the content box,
   28 px plus the 16 px padding: a 44 px row (44 made unseen rows 60 px, so the chosen row opened cut off) */
.kt-combo__opt { content-visibility: auto; contain-intrinsic-size: auto 28px; }
.kt-combo__opt { display: grid; align-content: center; min-height: var(--kt-target); padding: 8px 12px; border-radius: var(--kc-radius-callout); color: var(--kc-prose); font: 400 15px/1.3 var(--kc-body); cursor: pointer; }
.kt-combo__opt.is-active { background: var(--kc-raised); color: var(--kc-text); }
@media (hover: hover) { .kt-combo__opt:hover { background: var(--kc-raised); color: var(--kc-text); } .tr .kt-combo__btn:hover:not(:disabled) { border-color: var(--kc-line-hover); } }
.kt-combo__opt b { font-weight: 500; color: var(--kc-text); overflow-wrap: break-word; }
.kt-combo__opt mark { background: none; color: var(--kt-select); font-weight: 600; }
.kt-combo .tr-group { margin: 8px 12px 0; }
/* a picture row (Other worlds' fantasy styles, src/ui/combo.js data-img and data-sub): the 48 px picture, then the
   name and its line (the approved mockup mockups/fantasy-ui css/fantasy.css) */
.kt-combo__opt--pic { grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; align-items: center; contain-intrinsic-size: auto 48px; }
.kt-combo__opt--pic img { display: block; width: 48px; height: 48px; border-radius: var(--kc-radius-callout); object-fit: cover; }
.kt-combo__t { display: grid; gap: 4px; min-width: 0; }
.kt-combo__sub { font-size: 13px; color: var(--kc-muted); overflow-wrap: break-word; }
/* the parks switch (an action row, src/ui/combo.js) stays in view at the foot of a long list (Parks and forests) */
.kt-combo__opt--act { position: sticky; bottom: 0; z-index: 1; content-visibility: visible; background: var(--kc-card); box-shadow: 0 -1px 0 var(--kc-border); }
@media (max-width: 599px) {
  .kt-combo__pop { width: 100%; }
  /* one to a row: Other worlds last, as in the approved mockup (it sits before Parks and forests in the markup for the
     600 to 919 px rows, src/ui/picker.js layoutFor) */
  .tr-pick__f[data-level="other"] { order: 1; }
}
@media (min-width: 600px) {
  .tr-pick[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* the 416-unit list takes a row of its own: no column holds its longest names (src/ui/picker.js) */
  .tr-pick[data-allparks] .tr-pick__f[data-level="park"] { grid-column: 1 / -1; }
}
/* three to a row from 640 px: below it a third of the row is under the 190 px a dropdown needs for its names at the
   12 px floor (the old five-column finder's State or province floor), so data-cols 3 stays one to a row there */
@media (min-width: 640px) {
  .tr-pick[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tr-search { display: grid; gap: 8px; min-width: 0; }
.tr-search__box { position: relative; }
.tr-search input { width: 100%; height: 48px; padding: 0 56px 0 16px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-callout); background: var(--kc-raised); color: var(--kc-text); font: 400 16px/1.2 var(--kc-body); -webkit-appearance: none; appearance: none; }
.tr-search input::-webkit-search-cancel-button { display: none; }
.tr-search input::placeholder { color: var(--kc-muted); }
/* three equal columns from a 920 px finder up to the six (below): Search a place, Ready-made areas and Country on the
   first row, State or province, Parks and forests and Other worlds on the second, County beside State or province when
   it shows and Clear at the end */
@container (min-width: 920px) {
  .tr-find__in { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; align-items: start; }
  .tr-find__head { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .tr .tr-find__head .kt-link { display: none; }
  .tr-search input { height: var(--kt-target); }
  .tr-pick { display: contents; }
  .tr-pick__f[data-level="park"] { order: 1; }
  .tr-pick__f[data-level="other"] { order: 2; }
  .tr-pick[data-allparks] .tr-pick__f[data-level="park"] { grid-column: 1 / -1; }
  .tr-pick__end { order: 3; display: flex; grid-column: -2; justify-self: end; align-self: end; min-height: var(--kt-target); }
  .tr .tr-pick__end .kt-link { min-height: var(--kt-target); padding: 0 4px; }
  .tr-find__line { order: 4; grid-column: 1 / -1; }
  .tr-results { min-width: 360px; }
}
/* one row of six from a 1,088 px finder (a 1,280 px window with the sidebar closed; David 2026-10-27: every top-row box
   the same width and one line tall): Search a place, Ready-made areas, Country, State or province, Parks and forests and
   Other worlds in equal columns (at least 174 px each). County and Clear sit on the second row, County under State or
   province. The waiting dropdowns say what comes first in short words ("Country first", "State first",
   src/ui/picker.js), so every empty box holds one line; a long chosen name still wraps to a second line rather than
   being cut (src/ui/combo.js). The search's placeholder "Place or coordinates" is 15 px here and its clear button only
   shows with text in the box, so the empty box needs no room for it. From 920 to 1,087 px they are three equal columns
   (above); under 920 px the search has a row of its own and the dropdowns go two or three to a row (data-cols). */
@container (min-width: 1088px) {
  .tr-find__in { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 8px; align-items: start; }
  .tr-find__head { position: absolute; width: 1px; height: 1px; min-height: 0; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .tr .tr-find__head .kt-link { display: none; }
  .tr-search { grid-column: 1; grid-row: 1; }
  .tr-search input { height: var(--kt-target); padding-left: 12px; font-size: 15px; }
  .tr-search input:placeholder-shown { padding-right: 12px; }
  .tr-pick { display: contents; }
  .tr-pick__f { grid-row: 1; }
  .tr-pick__f[data-level="county"] { grid-row: 2; grid-column: 4; }
  .tr-pick[data-allparks] .tr-pick__f[data-level="park"] { grid-row: 3; grid-column: 2 / -1; }
  .tr-pick__end { display: flex; grid-row: 2; grid-column: -2; justify-self: end; align-self: end; min-height: var(--kt-target); }
  .tr .tr-pick__end .kt-link { min-height: var(--kt-target); padding: 0 4px; }
  .tr-find__line { grid-column: 1 / -1; }
  .tr-pick__f[data-level="other"] { grid-row: 1; grid-column: 6; }
  .tr-results { min-width: 360px; }
}
.tr-search input:hover { border-color: var(--kc-line-hover); }
.tr-search input:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.tr-search__clear { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: var(--kt-target); height: var(--kt-target); padding: 0; border: 0; border-radius: var(--kc-radius-control); background: none; color: var(--kc-muted); cursor: pointer; }
.tr-search__clear:hover { color: var(--kc-text); background: var(--kc-card); }
.tr-search__clear svg { width: 16px; height: 16px; }
.tr-results { position: absolute; z-index: 25; top: 52px; left: 0; right: 0; display: grid; gap: 4px; padding: 8px; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-card); box-shadow: var(--kt-float-shadow); max-height: 420px; overflow: auto; }
.tr-match { display: grid; gap: 4px; min-height: 56px; width: 100%; padding: 8px 12px; border: 0; border-radius: var(--kc-radius-callout); background: var(--kc-raised); color: var(--kc-text); text-align: left; cursor: pointer; }
.tr-match:hover { background: var(--kc-border); }
.tr-match b { font-weight: 500; font-size: 15px; color: var(--kc-text); overflow-wrap: anywhere; }
.tr-match span { font-size: 13px; color: var(--kc-muted); font-variant-numeric: tabular-nums; }
.tr-match--thumb { grid-template-columns: 48px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.tr-match img { display: block; width: 48px; height: 48px; }
.tr-match__t { display: grid; gap: 4px; min-width: 0; }
.tr-match--more b { font: 600 15px/1.2 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; }
.tr-group { margin: 4px 4px 0; font: 700 11px/1.4 var(--kc-body); letter-spacing: 0.02em; text-transform: uppercase; color: var(--kc-muted); overflow-wrap: anywhere; }
.tr-search__status, .tr-search__credit { margin: 8px 4px; color: var(--kc-muted); font: 400 13px/1.5 var(--kc-body); overflow-wrap: anywhere; }
.tr-search__credit a { color: inherit; text-underline-offset: 3px; }

/* the step strip: three equal steps on one row down to 320 px; never scrolls sideways */
.tr-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tr-steps li { flex: 1 1 0; min-width: 0; display: flex; }
.tr-steps button { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--kt-target); padding: 0 16px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-card); color: var(--kc-muted); font: 600 16px/1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; cursor: pointer; }
.tr-steps button:hover:not([disabled]) { color: var(--kc-text); border-color: var(--kc-line-hover); }
.tr-steps button[aria-current="step"] { background: var(--kc-raised); border-color: var(--kc-line-hover); color: var(--kc-text); }
.tr-steps button[disabled] { cursor: default; opacity: 0.6; }
.tr-steps__n { font: 500 13px/1 var(--kc-mono); letter-spacing: 0; }

/* ------------------------------------------------------------ viewport */
.tr .tr-view { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tabs tools" "stage stage" "credits credits"; }
.tr-tabs { grid-area: tabs; display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border-bottom: 1px solid var(--kc-hairline); }
.tr .tr-tools { grid-area: tools; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 8px; border-bottom: 1px solid var(--kc-hairline); }
.tr-stage { grid-area: stage; }
.tr-credits { grid-area: credits; }
.tr-tab, .tr-tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--kt-target); min-width: var(--kt-target); padding: 0 16px; border: 1px solid transparent; border-radius: var(--kc-radius-control); background: none; white-space: nowrap; cursor: pointer; }
.tr-tool { border-color: var(--kc-line-ui); background: var(--kc-card); }
/* the type and color carry .tr, as .kt-seg does above: the shared reset .kt-root button { font: inherit;
   color: inherit } (0,1,1) outranks one class, which left these in Inter 400 (round 2 re-judge) */
.tr .tr-tab, .tr .tr-tool { font: 600 15px/1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--kc-muted); }
.tr .tr-tool { color: var(--kc-text); }
.tr-tab:hover, .tr-tool:hover { color: var(--kc-text); background: var(--kc-raised); }
.tr-tab[aria-selected="true"] { background: var(--kc-raised); border-color: var(--kc-line-ui); color: var(--kc-text); }
.tr-tool[aria-pressed="true"], .tr-tool[aria-expanded="true"] { background: var(--kc-raised); border-color: var(--kt-select); color: var(--kc-text); }
.tr-tool svg { width: 16px; height: 16px; flex: none; }
#trMapTools { justify-content: flex-start; }
#trMapTools .tr-maparea { align-self: center; margin-left: auto; padding: 0 8px; text-align: right; }
#trDrawList { left: 0; right: auto; }
.tr-map-zoom { position: absolute; z-index: 8; top: 12px; right: 12px; display: flex; gap: 8px; }
.tr-map-zoom__button { display: grid; place-items: center; width: var(--kt-target); height: var(--kt-target); padding: 0; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-card); color: var(--kc-text); font: 600 22px/1 var(--kc-display); cursor: pointer; }
.tr-map-zoom__button:hover { background: var(--kc-raised); }
.tr-map-zoom__button[aria-pressed="true"] { border-color: var(--kc-red); }
.tr-zoom-drag { position: absolute; z-index: 7; border: 2px dashed var(--kc-prose); pointer-events: none; }
.tr-zoom-drag[hidden] { display: none; }
.tr-map-zoom__button svg { width: 18px; height: 18px; }
.tr-map-zoom[hidden] { display: none; }

/* the layer menu */
.tr-menu { position: relative; }
.tr-menu__list { position: absolute; z-index: 25; top: 52px; right: 0; display: grid; gap: 4px; width: 240px; padding: 8px; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-card); box-shadow: var(--kt-float-shadow); }
.tr-menu__item { display: grid; gap: 4px; min-height: var(--kt-target); width: 100%; padding: 8px 12px; border: 0; border-radius: var(--kc-radius-callout); background: none; color: var(--kc-prose); text-align: left; cursor: pointer; }
.tr-menu__item:hover { background: var(--kc-raised); color: var(--kc-text); }
.tr-menu__item[aria-checked="true"] { background: var(--kc-raised); color: var(--kc-text); box-shadow: inset 0 0 0 1px var(--kc-line-ui); }
.tr-menu__item b { font-size: 15px; font-weight: 500; }
.tr-menu__item span { font-size: 13px; color: var(--kc-muted); }
.tr-menu__divider { height: 1px; margin: 4px 8px; background: var(--kc-hairline); }

.tr-stage { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; min-height: 280px; max-height: 62vh; background: var(--kc-ground); overflow: hidden; }
.tr-coverage-legend { position: absolute; z-index: 6; left: 12px; bottom: 12px; display: grid; gap: 8px; width: max-content; max-width: min(320px, calc(100% - 24px)); max-height: 42%; overflow: auto; padding: 8px 12px; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-card); color: var(--kc-text); box-shadow: var(--kt-float-shadow); font: 400 12px/1.35 var(--kc-body); }
.tr-coverage-legend[hidden] { display: none; }
.tr-coverage-legend > b { font: 600 13px/1.2 var(--kc-display); letter-spacing: -0.02em; text-transform: uppercase; }
.tr-coverage-legend p { margin: 0; color: var(--kc-muted); }
.tr-coverage-legend__row { display: flex; align-items: center; gap: 8px; min-height: 16px; }
.tr-coverage-legend__swatch { flex: none; width: 14px; height: 14px; border: 1px solid var(--kc-line-ui); border-radius: 4px; }
/* from 900 px the page measures the room under what sits above the map (src/app.js fitStage) */
.tr-view[data-fit] .tr-stage { aspect-ratio: auto; height: var(--tr-stage-h); min-height: 0; max-height: none; }
.tr-map, .tr-3d { position: absolute; inset: 0; }
/* a fantasy land in place of the map (ROADMAP decision 51): the whole land in view, never cropped */
.fx-land { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.tr .fx-num { margin: 0 4px 0 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* a fantasy land's sliders on the area card: the label and its word on one line, the slider, one plain line */
.fx-slider__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tr .fx-slider .tr-range { display: block; width: 100%; }
.fx-sliders { display: grid; gap: 16px; }
.tr .fx-seed { flex: 0 1 112px; width: 112px; }
.tr-3d canvas { display: block; width: 100%; height: 100%; touch-action: none; }
/* the 3D view's compass (src/ui/preview.js): bottom left in the stage, clear of the view tools above the stage,
   the hint at its top and the "Preview only" line under it; it takes no pointer, so a drag over it still turns
   the model. 52 px; 44 px on the phone's 16:9 stage (about 191 px tall at 375) */
.tr-compass { position: absolute; z-index: 2; left: 12px; bottom: 12px; width: 52px; height: 52px; pointer-events: none; }
.tr-compass svg { display: block; width: 100%; height: 100%; }
.tr-compass__ring { fill: var(--kc-card); fill-opacity: 0.9; stroke: var(--kc-line-ui); stroke-width: 1.5; }
.tr-compass__north { fill: var(--kc-red); }
.tr-compass__south { fill: var(--kc-muted); }
.tr-compass__l { font: 600 12px/1 var(--kc-display); text-transform: uppercase; fill: var(--kc-prose); }
.tr-compass__l--n { font-size: 18px; fill: var(--kc-red); }
/* the light dial (src/ui/preview.js), beside the compass in the same size: north up, a sun on the ring; it takes the
   pointer (a drag on it moves the light, never the model) and does not scroll the page on a phone */
.tr-light { position: absolute; z-index: 2; left: 72px; bottom: 12px; width: 52px; height: 52px; border-radius: 50%; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tr-light:active { cursor: grabbing; }
.tr-light:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.tr-light svg { display: block; width: 100%; height: 100%; }
.tr-light__ring { fill: var(--kc-card); fill-opacity: 0.9; stroke: var(--kc-line-ui); stroke-width: 1.5; }
.tr-light__track { fill: none; stroke: var(--kc-line-ui); stroke-width: 1; stroke-dasharray: 2 3; }
.tr-light__north { fill: var(--kc-muted); }
.tr-light__beam { stroke: var(--kt-select); stroke-width: 1.5; stroke-opacity: 0.6; }
.tr-light__sun circle { fill: var(--kt-select); }
.tr-light__sun line { stroke: var(--kt-select); stroke-width: 1.8; stroke-linecap: round; }
/* Map on model (ROADMAP decision 52, the approved mockup mockups/map-drape; src/ui/drape.js): a chip beside the light
   dial, then, while it is on, the map's strength slider and its percent, all on one card; on a phone the chip is a
   44 px icon (its words kept for screen readers) and the slider shorter */
.tr-drape { position: absolute; z-index: 2; left: 132px; bottom: 12px; display: flex; align-items: center; gap: 8px; height: 52px; max-width: calc(100% - 144px); padding: 0 4px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-pill); background: var(--kc-card); }
.tr-drape.is-on { padding-right: 12px; }
.tr-drape:not(.is-on) { padding-right: 12px; }
.tr .tr-drape__btn { display: inline-flex; flex: none; align-items: center; gap: 8px; min-height: var(--kt-target); padding: 0 12px; border: 1px solid transparent; border-radius: var(--kc-radius-pill); background: none; color: var(--kc-muted); font: 600 13px/1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.tr .tr-drape__btn svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tr .tr-drape__btn:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.tr .tr-drape__btn[aria-pressed="true"] { color: var(--kc-text); border-color: var(--kt-select); background: var(--kc-raised); }
.tr .tr-drape__btn[aria-pressed="false"] { color: var(--kc-muted); border-color: var(--kc-line-ui); background: var(--kc-raised); }
.tr .tr-drape__btn[aria-busy="true"] svg { animation: tr-drape-busy 0.8s ease-in-out infinite alternate; }
.tr-drape__maps { flex: 0 1 144px; min-width: 0; }
.tr-drape__maps .kt-combo { width: 100%; }
.tr .tr-drape__maps .kt-combo__btn { min-height: var(--kt-target); padding: 8px 8px 8px 12px; font: 600 13px/1.2 var(--kc-display); text-transform: uppercase; }
.tr-drape__maps .kt-combo__pop { width: max(100%, 340px); }
@keyframes tr-drape-busy { to { opacity: 0.3; } }
@media (hover: hover) { .tr .tr-drape__btn:hover { color: var(--kc-text); } }
@media (prefers-reduced-motion: reduce) { .tr .tr-drape__btn[aria-busy="true"] svg { animation: none; opacity: 0.5; } }
.tr .tr-drape .tr-range { flex: 0 1 120px; width: 120px; min-width: 56px; }
.tr-drape__pct { flex: none; min-width: 4ch; color: var(--kc-text); font: 600 13px/1 var(--kc-display); letter-spacing: -0.03em; text-align: right; }
.tr-drape:not(.is-on) .tr-range, .tr-drape:not(.is-on) .tr-drape__pct { display: none; }
/* its credit (src/app.js drapeCredit): the 2D map's compact box (.tr-attrib: "Powered by Esri" and Show sources), over
   the 3D view's bottom right as the map's own credit sits on the map, never reaching over the chip and its slider
   (--tr-dclear, the chip's right edge, src/app.js drapeCredit); on a phone, and where less than 240 px is left beside
   the chip (data-dunder), the line under the view. The Streets line (data-kind line) has no button, so its own padding */
.tr .tr-attrib.tr-dcredit { grid-area: stage; align-self: end; justify-self: end; position: relative; z-index: 4; min-width: 0; max-width: calc(100% - var(--tr-dclear, 464px)); }
.tr .tr-attrib.tr-dcredit[data-kind="line"] { padding-block: 4px; }
.tr .tr-view[data-dunder] { grid-template-areas: "tabs tools" "stage stage" "credits credits" "dcredit dcredit"; }
.tr .tr-view[data-dunder] .tr-attrib.tr-dcredit { grid-area: dcredit; position: static; justify-self: stretch; justify-content: flex-start; max-width: none; border-radius: 0; border-top: 1px solid var(--kc-hairline); padding: 0 12px; text-align: left; }
.tr .tr-view[data-dunder] .tr-attrib.tr-dcredit[data-kind="line"] { padding-block: 8px; }
/* the start banner: small, at the top of the map, never over the place the member steers to */
.tr-empty { position: absolute; z-index: 3; top: 12px; left: 12px; right: 12px; justify-self: center; display: flex; align-items: center; gap: 8px; max-width: 48ch; padding: 8px 12px; border-radius: var(--kc-radius-callout); background: var(--kc-card); border: 1px solid var(--kc-border); color: var(--kc-prose); pointer-events: none; }
.tr-empty vector-mark { flex: none; }
.tr-empty p { margin: 0; font-size: 14px; line-height: 1.45; }
.tr-maphint { position: absolute; z-index: 4; left: 12px; right: 12px; top: 12px; margin: 0; justify-self: center; max-width: 48ch; padding: 8px 12px; border-radius: var(--kc-radius-callout); background: var(--kc-card); border: 1px solid var(--kc-border); color: var(--kc-prose); font-size: 14px; line-height: 1.45; text-align: center; }
/* the map's own messages sit under its four buttons, so the buttons never cover the words (the GPS route mockup; the
   buttons end at 56 px, 52 px on a phone). The 3D stage's message has no buttons over it and stays at the top */
#trMap > .tr-empty, #trMap > .tr-maphint { top: 64px; }
@media (max-width: 420px) { #trMap > .tr-empty, #trMap > .tr-maphint { top: 60px; } }
/* Esri's credit on the map (Topo and Satellite): bottom right, 12 px, on an opaque card so it reads over
   imagery; it wraps and is never cut or hidden (Esri's attribution rules) */
.tr-attrib { position: absolute; z-index: 2; right: 0; bottom: 0; max-width: min(100%, 560px); margin: 0; padding: 4px 8px; border-top-left-radius: var(--kc-radius-callout); background: var(--kc-card); color: var(--kc-prose); font-size: 12px; line-height: 1.45; text-align: right; overflow-wrap: anywhere; }
.tr-attrib a { color: var(--kc-text); text-underline-offset: 3px; }
/* at every width the data credits fold behind Show sources and "Powered by Esri" always shows, as Esri's own maps
   do (break-it review: the Satellite credits covered a fifth of the map at 375 px; David 2026-10-16: on a laptop the
   Topo and Satellite credits took three lines of the map) */
.tr .tr-attrib__more { display: none; min-height: var(--kt-target); margin-left: 8px; padding: 0 4px; border: 0; background: none; color: var(--kc-text); font: 600 12px/1.2 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; vertical-align: middle; }
.tr .tr-attrib { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; column-gap: 4px; padding-block: 0; }
.tr .tr-attrib[hidden] { display: none; }
.tr .tr-attrib:not([hidden]) .tr-attrib__more { display: inline-flex; align-items: center; }
.tr .tr-attrib:not([data-open]) .tr-attrib__src { display: none; }
.tr .tr-attrib[data-open] .tr-attrib__src { flex: 1 1 100%; padding-top: 4px; }
.tr-maplegend { color: var(--kc-prose); }
.tr .tr-mapname { align-self: center; margin: 0; }
.tr-mapnote { color: var(--kc-text); }
.tr .tr-credits { margin: 0; padding: 8px 12px; border-top: 1px solid var(--kc-hairline); font-size: 12px; line-height: 1.5; }
.tr .tr-credits a { color: var(--kc-muted); text-underline-offset: 3px; }
.tr .tr-credits a:hover { color: var(--kc-text); }
/* the preview notice on the 3D stage, top left (bottom right when compact): before a build an amber "Quick preview" badge (the flag amber of
   tokens.css, never red, never a button) and one line with the real numbers; after it a quiet line. It takes no
   pointer, so a drag over it still turns the model; it stays clear of the center, the compass (bottom left) and
   the view tools (above the stage) */
.tr-pvnote { position: absolute; z-index: 3; top: 12px; left: 12px; display: flex; align-items: flex-start; gap: 8px; max-width: min(52ch, calc(100% - 24px)); margin: 0; padding: 8px 12px; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-callout); background: var(--kc-card); color: var(--kc-prose); font-size: 13px; line-height: 1.45; pointer-events: none; }
.tr-pvnote__badge { flex: none; padding: 0 8px; border: 1px solid var(--kc-flag); border-radius: var(--kc-radius-pill); color: var(--kc-flag); font: 600 12px/20px var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; white-space: nowrap; }
.tr-pvnote__text { min-width: 0; overflow-wrap: anywhere; }
.tr-pvnote[data-kind="file"] { padding: 4px 8px; border-color: var(--kc-hairline); color: var(--kc-muted); font-size: 12px; }
/* compact (data-compact, src/app.js): on a phone's 16:9 stage, and wherever the model carries tile numbers (the top
   rows' numbers sit under the top left), the badge and two words go to the top right on one line (the bottom corners
   hold the compass, the light dial and Map on model, and its credit: the approved mockup mockups/map-drape), and the
   sentence goes under the stage */
.tr-pvnote[data-compact] { top: 8px; left: auto; right: 8px; bottom: auto; max-width: calc(100% - 16px); padding: 4px 8px; font-size: 12px; white-space: nowrap; }
/* IGN's short credit under a model made from Spain's IGN data (its terms ask for it at the foot of the viewer) */
.tr .tr-viewcredit { display: block; }

/* MapLibre, the parts the map needs from its stylesheet (its own CSS file is not shipped) */
.tr .maplibregl-map { position: absolute; inset: 0; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.tr .maplibregl-canvas { position: absolute; left: 0; top: 0; }
.tr .maplibregl-canvas-container.maplibregl-interactive { cursor: grab; user-select: none; }
.tr .maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }
.tr .maplibregl-canvas-container.maplibregl-touch-zoom-rotate, .tr .maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas { touch-action: pan-x pan-y; }
.tr .maplibregl-canvas-container.maplibregl-touch-drag-pan, .tr .maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas { touch-action: pinch-zoom; }
.tr .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan, .tr .maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas { touch-action: none; }
.tr .maplibregl-ctrl-top-left, .tr .maplibregl-ctrl-top-right, .tr .maplibregl-ctrl-bottom-left, .tr .maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 2; }
.tr .tr-drawing .maplibregl-canvas-container, .tr .tr-drawing .maplibregl-canvas { cursor: crosshair; touch-action: none; }

/* ------------------------------------------------------------ controls column */
.tr-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
/* the step panels' own headings repeat the step strip right above them: kept for screen readers only */
.tr .tr-controls .kt-panel__h { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tr .tr-controls { position: relative; }
@media (min-width: 900px) {
  .tr .tr-grid { grid-template-rows: auto 1fr; }
  .tr .tr-grid > .tr-view { grid-column: 1; grid-row: 1; }
  .tr[data-step="make"] .tr-grid > .tr-view { position: sticky; top: 16px; align-self: start; }
  .tr[data-step="make"] .tr-grid > .tr-side { grid-row: 1; }
  .tr .tr-grid > .tr-side { grid-column: 2; grid-row: 1 / span 2; }
  .tr .tr-grid > .tr-facts { grid-column: 1; grid-row: 2; }
  /* three steps in the 320 px column */
  .tr-side .tr-steps button { padding: 0 8px; font-size: 15px; }
}
@media (max-width: 899px) {
  .tr[data-step="area"] .tr-grid > .tr-side { order: -1; }
}
.tr .tr-controls .kt-panel__grp { gap: 16px; }
.tr-field { display: grid; gap: 8px; min-width: 0; }
.tr-field .kt-meta, .tr-field .tr-err { margin: 0; }
.tr-inrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tr-input { flex: 1 1 96px; min-width: 0; width: 96px; height: var(--kt-target); padding: 0 12px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-raised); color: var(--kc-text); font: 400 16px/1.2 var(--kc-body); font-variant-numeric: tabular-nums; }
.tr-input:hover { border-color: var(--kc-line-hover); }
.tr-input:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.tr-input--wide { width: 100%; }
.tr .tr-seg { flex: 1 1 auto; }
/* a choice of three long labels (the island rule): one under the other, words wrapping */
.tr .kt-seg.tr-seg--wrap { display: grid; grid-template-columns: minmax(0, 1fr); }
.tr .tr-seg--wrap button { white-space: normal; padding: 8px 12px; line-height: 1.2; }
/* Finishing bit (fantasy lands, Size > Show more settings): four equal choices on one row at every width (mockup fx-bit) */
.tr .kt-seg.tr-bitseg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tr .tr-bitseg button { min-width: 0; padding-left: 4px; padding-right: 4px; white-space: nowrap; }
/* the Size step, tight enough that Continue stays on a laptop's first screen with Tiles and Coordinates showing
   (David, 2026-10-15: "Fix for the laptop."; scripts/fold-budget.mjs) */
.tr .tr-controls [data-step-panel="detail"] { gap: 12px; }
[data-step-panel="detail"] .tr-field { gap: 4px; }
/* a label beside its one-row field (Width), as Bed and Coordinates */
.tr-inlbl { flex: none; margin-right: 4px; }
/* Coordinates: the name beside two short choices on one row (the choices under it when the row is too narrow) */
.tr-coordrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.tr .tr-coordrow .kt-seg button { flex: 1 1 auto; white-space: nowrap; }
/* the relief choices: one row of six (side by side with no gap, so each is 46 px wide in the 320 px column; only
   the pressed one has a fill), two rows of three under 360 px; no choice is ever alone on a row */
.tr .kt-seg.tr-zpick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.tr .tr-zpick button { min-width: 0; padding: 0 4px; }
@media (max-width: 359px) {
  .tr .kt-seg.tr-zpick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
}
.tr-znote { color: var(--kc-text); }
.tr-unit { font-size: 14px; color: var(--kc-muted); }
/* Fit my bed: "Bed [12] by [12] in" on one row at every width (the two fields share what is left) */
.tr-bed { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* Printer or CNC above the Bed numbers: the open list keeps to the field (the side column is under its 340 px) */
.tr-bedpick { display: grid; gap: 8px; min-width: 0; }
.tr-bedpick + .tr-bed { margin-top: 8px; }
.tr-bedpick .kt-combo__pop { width: 100%; }
.tr-bed .tr-input { flex: 1 1 0; width: 0; }
/* By count: Tiles across and Tiles down, each field at least 56 px; under 360 px one pair to a row */
.tr-count { display: grid; grid-template-columns: auto minmax(56px, 1fr) auto minmax(56px, 1fr); }
.tr-count .tr-input { width: auto; }
@media (max-width: 359px) {
  .tr-count { grid-template-columns: auto minmax(56px, 1fr); }
}
.tr-range { flex: 1 1 160px; min-width: 0; height: var(--kt-target); margin: 0; accent-color: var(--kt-select); }
/* the custom relief right under the relief choices (David, 2026-10-15: "they're related"): one row, its value beside
   it. The track is thin in its 44 px box, so the row tucks 4 px into the gap above and 8 px into the space below
   (never over a choice's hit area), which keeps Size's Continue in its fold budgets (scripts/fold-budget.mjs) */
.tr-exagrow { margin: -4px 0 -8px; }
@media (max-width: 599px) {
  /* the phone's Size column, tight enough that Continue stays within 1.5 screens with By count and the custom relief */
  .tr .tr-controls [data-step-panel="detail"] { gap: 8px; }
  .tr .kt-seg.tr-zpick { padding-block: 0; }
  .tr [data-step-panel="detail"] .tr-field .kt-meta { line-height: 1.3; }
}
.tr-out { min-width: 48px; text-align: right; font: 600 16px/1 var(--kc-display); letter-spacing: -0.02em; color: var(--kc-text); font-variant-numeric: tabular-nums; }
.tr-err { font-size: 13px; line-height: 1.4; color: var(--kc-text); }
.tr .tr-tog { padding: 0; }
.tr .tr-more { justify-self: start; }
.tr-morebox { display: grid; gap: 16px; padding-top: 12px; border-top: 1px solid var(--kc-hairline); }
.tr-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-row > .kt-btn-2, .tr-row > .kt-btn-red { flex: 1 1 0; min-width: 0; padding-inline: 12px; }
/* Make: Change size pairs with Build before a build and with Download STL after it (Build hides then, src/app.js);
   while building Build (off) pairs with Cancel, so the row always holds two buttons */
.tr-row--build[data-cancel] #trMakeBack { display: none; }
.tr-sum { margin: 0; font-size: 14px; line-height: 1.5; color: var(--kc-prose); }
.tr-limit { font-size: 14px; line-height: 1.45; color: var(--kc-text); }
.tr-progress { display: grid; gap: 8px; font-size: 14px; color: var(--kc-prose); }
.tr-progress vector-mark { --vector-ink: var(--kt-vector-bone); }
.tr-bar { height: 4px; border-radius: var(--kc-radius-pill); background: var(--kc-raised); overflow: hidden; }
.tr-bar i { display: block; height: 100%; width: 0; background: var(--kc-text); transition: width 0.2s ease; }

/* the area card */
.tr-area { display: grid; gap: 12px; min-width: 0; }
.tr-area__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tr-area__head .kt-meta { margin: 4px 0 0; }
.tr-area__name { margin: 0; font: 600 24px/1.1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--kc-heading); overflow-wrap: anywhere; }
.tr-icons { display: flex; gap: 4px; flex: none; }
.tr-icon { display: grid; place-items: center; width: var(--kt-target); height: var(--kt-target); padding: 0; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-card); color: var(--kc-text); cursor: pointer; }
.tr-icon:hover:not([disabled]) { background: var(--kc-raised); }
.tr-icon[disabled] { opacity: 0.6; cursor: default; }
.tr-icon svg { width: 20px; height: 20px; }
.tr-line { margin: 0; font-size: 15px; line-height: 1.5; color: var(--kc-prose); overflow-wrap: anywhere; }
.tr-line b { color: var(--kc-text); font-weight: 600; }
.tr-small { font-size: 13px; color: var(--kc-muted); }
.tr-warnline { color: var(--kc-text); }
.tr-notice { grid-template-columns: minmax(0, 1fr); }
.tr-areamore { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--kc-hairline); }
.tr-areamore .tr-areamore { padding-top: 0; border-top: 0; }
#trAreaMain, #trAreaHead { display: grid; gap: 12px; min-width: 0; }
#trAreaMain:empty, #trPartBox:empty, #trShapeBox:empty { display: none; }
/* the card's GPS route block: a plain .tr-field under Continue (the approved GPS route mockup) */
.tr-route { padding-top: 12px; border-top: 1px solid var(--kc-hairline); }
.tr-route .tr-line { font-size: 14px; }
/* a file with several routes: its short list is as wide as the card, so it never reaches over the map */
.tr-route .kt-combo__pop { width: 100%; }
/* a track's name from the member's file may be one long word: it wraps inside the row, never past the card */
.tr-route .kt-combo__opt { grid-template-columns: minmax(0, 1fr); }
.tr-route .kt-combo__opt b { min-width: 0; overflow-wrap: anywhere; }
/* Make's GPS route row (the page's label-beside-field row, as Width on the Size step) and its line size fold, as 3D print
   colors' fold (the approved GPS route mockup) */
.tr-routerow .tr-seg { flex: 1 1 0; min-width: 0; }
.tr-route-body { display: grid; gap: 8px; min-width: 0; }
.tr-route-body .kt-meta, .tr-route-body .tr-err { margin: 0; }
.tr-routesize { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tr-routenum { display: grid; gap: 4px; min-width: 0; }
.tr-routenum .tr-input { width: 100%; }
.tr .tr-credlink { justify-self: start; }
.tr-chip--more { color: var(--kc-prose); }
/* related places: buttons that wrap inside their line, 44 px tall */
.tr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.tr-chips__lbl { font-size: 14px; color: var(--kc-muted); }
.tr-chip { min-height: var(--kt-target); max-width: 100%; padding: 4px 12px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-pill); background: var(--kc-card); color: var(--kc-text); text-align: left; overflow-wrap: anywhere; cursor: pointer; }
/* in Oswald like the tool's other controls (break-it review); .tr outranks the shared button reset */
.tr .tr-chip { font: 600 14px/1.2 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; }
.tr-chip:hover { background: var(--kc-raised); border-color: var(--kc-line-hover); }
.tr-chip:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
/* an action inside a line of the card (Drop what will not carve, Cut away lake) */
.tr .tr-inlink { display: inline-flex; align-items: center; min-height: var(--kt-target); vertical-align: middle; }
.tr .tr-inlink[aria-pressed="true"] { color: var(--kt-select); }
.tr-srclist { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; line-height: 1.45; color: var(--kc-prose); }

/* facts */
.tr-facts__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px 16px; margin: 0; }
.tr-facts__list div { display: grid; gap: 4px; min-width: 0; }
.tr-facts__list dt { font: 700 11px/1.4 var(--kc-body); letter-spacing: 0.02em; text-transform: uppercase; color: var(--kc-muted); }
.tr-facts__list dd { margin: 0; font: 600 20px/1.1 var(--kc-display); letter-spacing: -0.02em; color: var(--kc-text); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tr-facts__list dd small { display: block; margin-top: 4px; font: 400 13px/1.4 var(--kc-body); letter-spacing: 0; color: var(--kc-muted); }
.tr-factsum { margin: 0; font-size: 15px; line-height: 1.5; color: var(--kc-prose); }
.tr .tr-factstoggle { justify-self: start; }
.tr-flag { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--kc-radius-callout); background: var(--kc-raised); border: 1px solid var(--kt-billing); font-size: 14px; line-height: 1.45; color: var(--kc-text); }
.tr-flag p { margin: 0; }
.tr-flag .kt-link { justify-self: start; }
/* the notice right above a step's action row (src/app.js stopNotice): the flag's amber edge, its ways out inside */
.tr-stopnote b { font-weight: 600; }
.tr .tr-flag__ways .kt-link { min-height: var(--kt-target); }
.tr-termsnote { margin: 0; }
.tr-flag__ways { display: flex; flex-wrap: wrap; gap: 0 24px; }
.tr-facts .kt-meta { margin: 0; }

/* result */
/* a file row: badge, name and size, and its own compact Download at the right (never a button alone on a row) */
.tr-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--kc-radius-callout); background: var(--kc-raised); border: 1px solid var(--kc-hairline); }
.tr .tr-file__dl { padding: 0 16px; }
.tr-file > .tr-badge { min-width: 44px; text-align: center; }
.tr-file--info { grid-template-columns: auto minmax(0, 1fr); }
.tr-file b { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; } /* the last resort: a name breaks at its underscores first (result.fileNameHtml) */
.tr-file span:not(.tr-badge) { display: block; font-size: 13px; line-height: 1.45; color: var(--kc-muted); }
.tr-badge { display: inline-block; padding: 4px 8px; border-radius: var(--kc-radius-tag); background: var(--kc-border); color: var(--kc-text); font: 700 10px/1.2 var(--kc-body); letter-spacing: 0.02em; text-transform: uppercase; }
.tr .tr-loc { padding: 0; }
.tr-tilesum { margin: 0; font-size: 13px; line-height: 1.5; color: var(--kc-muted); }
/* the honest lines: two quiet lines, the rest under Show details */
.tr-honesty { display: grid; gap: 8px; margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--kc-muted); }
.tr-honesty p { margin: 0; overflow-wrap: anywhere; }
.tr .tr-honlink { justify-self: start; }
.tr-honmore { display: grid; gap: 8px; }
.tr-quiet { font-size: 14px; color: var(--kc-muted); }

/* the footer: the membership line, then the links (moved into the shared policies row by src/app.js, which
   styles them; these rules hold when that row is missing) */
.tr .tr-legalnote { margin: 0; max-width: 80ch; font-size: 13px; line-height: 1.45; }
.tr-legal { display: flex; flex-wrap: wrap; gap: 0 24px; font-size: 13px; line-height: 1.45; }
.tr-legal a { display: inline-flex; align-items: center; min-height: var(--kt-target); color: var(--kc-muted); text-underline-offset: 3px; }
.tr-legal a:hover { color: var(--kc-text); }
/* the data library opener among the footer links (round 5 judge: it took the tool's top right) */
.tr .tr-footlink { display: inline-flex; align-items: center; min-height: var(--kt-target); padding: 0; border: 0; background: none; color: var(--kc-muted); font: 400 13px/1.45 var(--kc-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tr .tr-footlink:hover { color: var(--kc-text); }
.tr .tr-footlink:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
/* Feedback: the floating button on wide screens, the footer link under 900 px, where the button would cover the dropdowns and the map */
.tr .tr-fblink { display: none; }
.kcfb-btn { min-height: var(--kt-target); }
@media (max-width: 899px) { .tr .tr-fblink { display: inline-flex; } .kcfb-btn { display: none !important; } }
/* while a GPS route block or row is on screen, the footer link takes the button's place on wide screens too (David, 2026-11-11: "Yes, hide it there") */
@media (min-width: 900px) {
  body[data-route-feedback] .kcfb-btn { display: none !important; }
  body[data-route-feedback] .tr .tr-fblink { display: inline-flex; }
}

/* the footer dialog (what the browser fetches, and the credits): the design system's popup, 12 px corners, the float
   shadow, black at 0.72 behind, a 44 px Close beside the title. The head stays put and the body scrolls, the credits
   filter held at the body's top while the list scrolls under it */
.tr-dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-card); color: var(--kc-text); box-shadow: var(--kt-float-shadow); overflow: hidden; }
.tr-dialog[open] { display: flex; flex-direction: column; }
.tr-dialog__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding-bottom: 24px; }
.tr-dialog::backdrop { background: var(--kt-dim, rgba(0, 0, 0, 0.72)); }
.tr-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--kc-hairline); }
.tr-dialog__head .kt-h3 { min-width: 0; overflow-wrap: anywhere; }
.tr-dialog__text { margin: 0; padding: 16px 24px 0; font-size: 15px; line-height: 1.6; color: var(--kc-prose); overflow-wrap: anywhere; }
.tr-dialog a { color: var(--kc-text); text-underline-offset: 3px; }
.tr-dialog__sub { margin: 0; padding: 16px 24px 0; font: 600 15px/1.3 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--kc-heading); }
/* the credits: the filter (sticky), then one group per country or region, each line in two short paragraphs */
.tr-credfind { position: sticky; top: 0; z-index: 1; display: grid; gap: 8px; margin-top: 16px; padding: 12px 24px; border-block: 1px solid var(--kc-hairline); background: var(--kc-card); }
.tr-credfind .kt-label { margin: 0; }
.tr .tr-credfilter { width: 100%; flex: none; font-variant-numeric: normal; }
.tr-dialog__note { margin: 0; font-size: 15px; line-height: 1.6; color: var(--kc-prose); overflow-wrap: anywhere; }
.tr-dialog__count { margin: 0; }
.tr-credall { padding: 0 24px; }
.tr-credgroup__h { margin: 0; padding: 16px 0 4px; font: 600 14px/1.3 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--kc-heading); }
.tr-credlist { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.tr-cred p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--kc-prose); overflow-wrap: anywhere; }
.tr-cred p:first-child { color: var(--kc-text); }
.tr-cred__id, .tr-cred__note { color: var(--kc-muted); }
.tr-cred__off { display: block; color: var(--kc-flag); }
/* "Credits for this file", the small link beside Download (src/app.js shows it with Download) */
.tr-credrow { margin: 0; }
.tr .tr-credfile { display: inline-flex; align-items: center; min-height: var(--kt-target); color: var(--kc-muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.tr .tr-credfile:hover { color: var(--kc-text); }
.tr .tr-credfile:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }


/* ------------------------------------------------------------ the data library drawer */
.tr-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; display: flex; flex-direction: column; width: min(560px, 100%); background: var(--kc-card); border-left: 1px solid var(--kc-border); box-shadow: var(--kt-float-shadow); color: var(--kc-text); font: 400 16px/1.6 var(--kc-body); }
.tr-drawer *, .tr-drawer *::before, .tr-drawer *::after { box-sizing: border-box; }
.tr-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 16px 16px 24px; border-bottom: 1px solid var(--kc-hairline); }
.tr-drawer__close { display: grid; place-items: center; width: var(--kt-target); height: var(--kt-target); border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-card); color: var(--kc-text); cursor: pointer; }
.tr-drawer__close:hover { background: var(--kc-raised); }
.tr-drawer__close:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; }
.tr-drawer__close svg { width: 16px; height: 16px; }
.tr-drawer__body { flex: 1 1 auto; overflow: auto; display: grid; gap: 16px; align-content: start; padding: 24px; }
.tr-drawer .kt-seg { display: flex; }
.tr-drawer .kt-seg button { flex: 1 1 0; }
.tr-libl { display: grid; gap: 8px; }
.tr-ds { border: 1px solid var(--kc-border); border-radius: var(--kc-radius-panel); background: var(--kc-raised); }
.tr-ds summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; min-height: 56px; padding: 12px 16px; cursor: pointer; list-style: none; }
.tr-ds summary::-webkit-details-marker { display: none; }
.tr-ds summary .kt-meta { grid-column: 1; }
.tr-ds summary .kt-pill { grid-column: 2; grid-row: 1 / span 2; }
.tr-ds__name { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.tr-ds__card { display: grid; gap: 8px; margin: 0; padding: 0 16px 16px; }
.tr-ds__card div { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 12px; font-size: 14px; line-height: 1.45; }
.tr-ds__card dt { color: var(--kc-muted); }
.tr-ds__card dd { margin: 0; color: var(--kc-prose); overflow-wrap: anywhere; }
.tr-ds__acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; padding: 0 16px 16px; }

/* ------------------------------------------------------------ phones */
@media (max-width: 899px) {
  .tr-stage { aspect-ratio: auto; height: 56vh; min-height: 240px; max-height: none; }
  /* Size and Make: a 16:9 view (about 193 px at 375), so the relief choices, Continue and Build sit close below
     (within 1.5 screens at 375 by 812: scripts/fold-budget.mjs detailPhone and makePhone; break-it review: Build
     sat at 1,369 px under a 455 px view, and Continue at 1,582 px under a 324 px one) */
  .tr[data-step="detail"] .tr-view .tr-stage,
  .tr[data-step="make"] .tr-view .tr-stage { height: auto; aspect-ratio: 16 / 9; min-height: 176px; }
  .tr-compass { left: 8px; bottom: 8px; width: 44px; height: 44px; }
  .tr-light { left: 56px; bottom: 8px; width: 44px; height: 44px; }
  .tr-drape { left: 104px; bottom: 8px; height: 46px; max-width: calc(100% - 112px); padding: 0; }
  .tr-drape.is-on { padding-right: 8px; }
  .tr .tr-drape__btn { width: var(--kt-target); padding: 0; justify-content: center; }
  .tr .tr-drape__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tr-drape__maps { flex-basis: 116px; }
  .tr-drape__maps .kt-combo__pop { width: max(100%, min(340px, calc(100vw - 32px))); }
  .tr .tr-drape .tr-range { flex: 0 1 88px; width: 88px; }
  .tr-drape__pct { min-width: 3.5ch; font-size: 12px; }
  .tr .tr-attrib.tr-dcredit { grid-area: dcredit; position: static; justify-self: stretch; justify-content: flex-start; max-width: none; border-radius: 0; border-top: 1px solid var(--kc-hairline); padding: 0 12px; text-align: left; }
  .tr .tr-attrib.tr-dcredit[data-kind="line"] { padding-block: 8px; }
  /* the map tools are a row of 44px targets ABOVE the map, so Draw and Map layers are on the first screen (round 1
     review); the tab row shows only once there is a 3D view to switch to */
  .tr .tr-view { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tabs" "tools" "stage" "credits" "dcredit"; }
  .tr .tr-tools { justify-content: stretch; flex-wrap: nowrap; }
  .tr .tr-tabs[data-no3d] { display: none; }
  .tr .tr-tools > .tr-tool, .tr .tr-tools > .tr-menu { flex: 1 1 0; }
  .tr .tr-menu > .tr-tool { width: 100%; }
  /* the 3D view's two tools: 44 px icons on the tabs' row, their words kept for screen readers (aria-label) */
  .tr .tr-view[data-tools3d] { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tabs tools" "stage stage" "credits credits" "dcredit dcredit"; }
  .tr #trModelTools { justify-content: flex-end; }
  .tr #trModelTools > .tr-tool { flex: none; width: var(--kt-target); padding: 0; }
  .tr #trModelTools .tr-tool__t { display: none; }
  .tr #trModelTools .tr-tool svg { display: block; width: 20px; height: 20px; }
}
@media (max-width: 599px) {
  .tr-ds__card div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* a file row on a phone: the badge, then the name across the whole row, then the size with Download
     at its right, so a long name wraps between its words (confirm round 4: beside the button it had
     114 px at 320 and broke inside words) and the button still shares its row with text */
  .tr-file { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "badge badge" "name name" "size dl"; row-gap: 4px; }
  .tr-file > .tr-badge { grid-area: badge; justify-self: start; margin-bottom: 4px; }
  .tr-file > .tr-file__text { display: contents; }
  .tr-file__text > b { grid-area: name; }
  .tr-file__text > span { grid-area: size; }
  .tr-file > .tr-file__dl { grid-area: dl; }
  .tr-file--info { grid-template-areas: "badge badge" "name name" "size size"; }
}
@media (max-width: 420px) {
  .tr-steps button { padding: 0 8px; font-size: 15px; }
  .tr-tab, .tr-tool { padding: 0 12px; }
  /* Draw and Map layers share a row by their short labels, so neither is ever cut */
  .tr .tr-tools > .tr-tool, .tr .tr-tools > .tr-menu { flex: 1 1 auto; }
  .tr #trMapTools .tr-maparea { display: none; }
  .tr-map-zoom { top: 8px; right: 8px; }
  .tr-drawer__head { padding: 12px 12px 12px 16px; }
  .tr-drawer__body { padding: 16px; }
  .tr-area__name { font-size: 20px; }
}
/* under 340 px both labels fit only without their icons (round 2 re-judge: with icons from 334 px up) */
@media (max-width: 339px) {
  .tr-tool svg { display: none; }
  /* Download all (ZIP) beside Build the model: on a 320 px phone its words may take two lines, never cut */
  .tr .tr-row--build > .kt-btn-2, .tr .tr-row--build > .kt-btn-red { white-space: normal; text-align: center; line-height: 1.2; padding-block: 4px; }
}

/* Optional exports stay folded in Your files, outside the compact Make controls. */
.tr-extra { border-top: 1px solid var(--kc-line-row); margin-top: 16px; padding-top: 16px; }
.tr-extra-panel { padding: 16px; min-width: 0; }
.tr-extra-panel .tr-extra { border: 0; margin: 0; padding: 0; }
.tr-extra-preview-status { margin: 8px 0; font: 400 13px/1.5 var(--kc-body); color: var(--kc-muted); }
.tr-extra > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-family: var(--kc-display); font-weight: 600; letter-spacing: -0.03em; text-transform: uppercase; }
.tr-extra > summary::before { content: '+'; }
.tr-extra[open] > summary::before { content: '−'; }
.tr-extra > summary > span { margin-left: auto; text-transform: none; letter-spacing: normal; }
.tr-extra-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.tr-extra-select { display: grid; gap: 8px; min-width: 0; }
.tr-extra-fields select { display: block; width: 100%; min-height: 44px; font-family: var(--kc-display); font-weight: 600; letter-spacing: -0.03em; }
.tr-extra-fields select[hidden] { display: none; }
.tr-extra-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tr-extra-fields label { display: grid; gap: 8px; min-width: 0; }
.tr-extra-number { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tr-extra-number input { width: 100%; min-width: 0; }
.tr-color-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin: 12px 0; }
.tr-color-legend span { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--kc-muted); font-size: 13px; }
.tr-color-legend { margin: 0; }
/* each swatch's color is the class's own, set from engine/landcover.js LANDCOVER_CLASSES by src/ui/print-colors.js */
.tr-color-legend i { width: 14px; height: 14px; flex: 0 0 14px; border: 1px solid var(--kc-line-ui); border-radius: 50%; }
.tr-extra-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.tr-extra-actions > button { min-height: 44px; }
.tr-extra > p { margin: 12px 0; }
.tr-extra-actions:has([data-extra-preview]:not([hidden])) > button:not([hidden]) { flex: 1 1 calc(50% - 8px); min-width: 0; padding-inline: 8px; white-space: normal; font-size: 14px; }
/* Download SVG and Download DXF share their row in the narrow side panel too (no lone button, at 1280 as on phones) */
.tr-extra-actions:has([data-extra-dxf]:not([hidden])) > button:not([hidden]) {
  flex: 1 1 calc(50% - 8px); min-width: 0; padding-inline: 8px; white-space: normal; font-size: 14px;
}
@media (max-width: 360px) {
  .tr-extra-grid { grid-template-columns: minmax(0, 1fr); }
  .tr-extra-actions { flex-wrap: wrap; gap: 8px; }
  .tr-extra-actions > button { flex: 1 1 100%; min-width: 0; white-space: normal; padding-right: 8px; padding-left: 8px; font-size: 13px; }
  .tr-extra-actions:has([data-extra-dxf]:not([hidden])) > [data-extra-make],
  .tr-extra-actions:has([data-extra-dxf]:not([hidden])) > [data-extra-dxf] { flex-basis: calc(50% - 4px); }
}

/* Planet and ocean workspace: the existing Earth controls retain their state when this view is open. */
.tr-work[data-world] > .tr-grid { display: none; }
.tr-work[data-world] .tr-search,
.tr-work[data-world] .tr-pick__f:not([data-level="other"]),
.tr-work[data-world] .tr-pick__end { display: none; }
.tr-work[data-world] .tr-find__in, .tr-work[data-world] .tr-pick { display: block; }
.tr-work[data-world] .tr-pick__f[data-level="other"] { max-width: 320px; }
.tr-world-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.tr-world-view { min-width: 0; overflow: hidden; }
.tr-world-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px; }
.tr-world-tools > span { flex: 1 1 auto; }
.tr-world-tools button { min-height: 44px; }
.tr-world-tools button[aria-pressed="true"] { background: var(--kc-raised); border-color: var(--kc-line-hover); }
.tr-world-stage { position: relative; width: 100%; height: 440px; overflow: hidden; }
@media (min-width: 801px) { .tr-world-stage { height: var(--tr-world-height, 440px); } }
.tr-world-loading, .tr-world-empty { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 16px; background: var(--kc-ground); text-align: center; }
.tr-world-loading[hidden] { display: none; }
.tr-world-empty[hidden] { display: none; }
.tr-world-empty > div { max-width: 36ch; }
.tr-world-empty h2 { margin: 8px 0; font-size: 20px; }
.tr-world-loading > div { max-width: 36ch; }
.tr-world-loading h2 { margin: 8px 0; font-size: 20px; }
.tr-world-loading p { margin: 8px 0; }
.tr-world-loading vector-mark { --vector-ink: var(--kt-vector-bone); }
.tr-space-wait { width: 80px; height: 56px; color: var(--kc-prose); overflow: visible; }
.tr-wait-icon { width: 80px; height: 56px; color: var(--kc-prose); overflow: visible; }
.tr-wait-icon__float { animation: tr-space-hover 1.8s ease-in-out infinite; }
.tr-ocean-wait__wave { animation: tr-ocean-wave 2s ease-in-out infinite; }
.tr-ocean-wait__bubbles { animation: tr-ocean-bubbles 2s ease-in-out infinite; }
.tr-fantasy-wait__ridge { stroke-dasharray: 220; animation: tr-fantasy-ridge 2.8s ease-in-out infinite; }
.tr-fantasy-wait__contours { animation: tr-space-beam 2s ease-in-out infinite; }
.tr-maphint--waiting { display: flex; align-items: center; justify-content: center; gap: 12px; }
.tr-maphint--waiting[hidden], .tr-progress__themed[hidden] { display: none; }
.tr-progress vector-mark[hidden] { display: none; }
.tr-maphint--waiting .tr-wait-icon, .tr-progress__themed .tr-wait-icon { width: 48px; height: 36px; flex: 0 0 48px; }
@keyframes tr-ocean-wave { 50% { transform: translateX(3px); } }
@keyframes tr-ocean-bubbles { 0% { transform: translateY(3px); opacity: .3; } 70% { transform: translateY(-5px); opacity: 1; } 100% { transform: translateY(-9px); opacity: 0; } }
@keyframes tr-fantasy-ridge { 0%, 100% { stroke-dashoffset: 35; opacity: .5; } 50% { stroke-dashoffset: 0; opacity: 1; } }
.tr-space-wait[hidden] { display: none; }
.tr-space-wait__craft { animation: tr-space-hover 1.8s ease-in-out infinite; }
.tr-space-wait__beam { animation: tr-space-beam 1.2s ease-in-out infinite; }
@keyframes tr-space-hover { 50% { transform: translateY(3px); } }
@keyframes tr-space-beam { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .tr-space-wait__craft, .tr-space-wait__beam { animation: none; }
  .tr-wait-icon__float, .tr-ocean-wait__wave, .tr-ocean-wait__bubbles, .tr-fantasy-wait__ridge, .tr-fantasy-wait__contours { animation: none; }
}
.tr-lunar-markers { position: absolute; inset: 0; pointer-events: none; }
.tr-lunar-markers[hidden] { display: none; }
.tr-lunar-pin { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; border: 0; padding: 0; background: transparent; color: var(--kc-prose); cursor: pointer; pointer-events: auto; }
.tr-lunar-pin > span:first-child { display: grid; place-items: center; width: 28px; height: 28px; margin: auto; border: 2px solid var(--kc-prose); border-radius: 50%; background: var(--kc-card); font: 600 15px var(--kc-display); }
.tr-lunar-pin[aria-pressed="true"] > span:first-child { border-color: var(--kc-red); background: var(--kc-red); }
.tr-lunar-label { position: absolute; display: flex; align-items: center; gap: 4px; top: 40px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 156px; padding: 4px 8px; border-radius: var(--kc-radius-tag); background: var(--kc-card); color: var(--kc-prose); font: 600 12px var(--kc-body); pointer-events: none; }
.tr-lunar-label[hidden] { display: none; }
.tr-lunar-label img { flex: none; width: 20px; height: 20px; }
.tr-lunar-pin.is-approximate > span:first-child { border-style: dashed; }
.tr-lunar-pin:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 2px; border-radius: 50%; }
.tr-planet-sites { position: absolute; left: 8px; top: 60px; min-height: 44px; }
.tr-planet-sites[hidden], .tr-lunar-sites[hidden] { display: none; }
.tr-lunar-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tr-lunar-actions > * { flex: 1 1 auto; min-height: 44px; white-space: normal; text-align: center; }
.tr-lunar-sites h3 { margin: 12px 0 8px; font: 600 20px var(--kc-display); }
.tr-lunar-sites h3 { display: flex; align-items: center; gap: 8px; }
.tr-lunar-flag { flex: none; width: 28px; height: 28px; object-fit: contain; }
.tr-lunar-flag[hidden] { display: none; }
.tr-lunar-sites .kt-combo__val { flex: 1; }
.tr-lunar-sites .kt-combo__opt--pic { grid-template-columns: 28px minmax(0, 1fr); }
.tr-lunar-sites .kt-combo__opt--pic img { width: 28px; height: 28px; object-fit: contain; border-radius: 50%; }
.tr-lunar-sites > summary::before { content: '+'; margin-right: 8px; }
.tr-lunar-sites[open] > summary::before { content: '−'; }
.tr-world-model, .tr-planet-map { position: relative; width: 100%; height: 100%; }
.tr-world-lighting { position:absolute;left:12px;bottom:12px;z-index:2;display:flex;flex-wrap:wrap;align-items:center;gap:8px;max-width:calc(100% - 24px); }
.tr-world-lighting .tr-world-drape { position:relative;left:auto;bottom:auto;max-width:100%; }
.tr-world-map-credit, .tr-world-map-notice { position:absolute;top:8px;right:8px;max-width:calc(100% - 16px);padding:8px;background:var(--kc-card);border-radius:var(--kc-radius-control);font:11px/1.4 var(--kc-body);color:var(--kc-prose); }
.tr-world-map-credit a { color:inherit; }
.tr-world-map-credit[hidden], .tr-world-map-notice[hidden] { display:none; }
.tr-world-lighting[hidden] { display:none; }
.tr-world-lighting .tr-light { position:relative;left:auto;bottom:auto;flex-shrink:0; }
.tr-world-brightness { display:grid;grid-template-columns:96px 34px;align-items:center;column-gap:4px;padding:4px 8px;border:1px solid var(--kc-line-ui);border-radius:var(--kc-radius-control);background:var(--kc-card);color:var(--kc-prose);font:11px var(--kc-body); }
.tr-world-brightness span { grid-column:1 / -1; }
.tr-world-brightness input { width:96px;height:44px;accent-color:var(--kt-select); }
.tr-world-brightness output { font:600 11px var(--kc-body); }
@media(max-width:800px) {
  .tr-world-lighting { bottom:8px; }
  .tr-world-lighting .tr-world-drape { flex-basis:100%;height:48px;padding:0 8px; }
  .tr-world-lighting .tr-world-drape .tr-drape__btn { width:auto;padding:0 8px;font-size:12px; }
  .tr-world-lighting .tr-world-drape .tr-drape__t { position:static;width:auto;height:auto;clip:auto;overflow:visible; }
  .tr-world-lighting .tr-world-drape .tr-drape__maps { flex-basis:92px; }
  .tr-world-lighting .tr-world-drape .tr-range { width:56px;min-width:40px; }
  .tr-world-lighting .tr-world-drape.has-maps { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);height:auto;gap:8px;padding:4px 8px; }
  .tr-world-lighting .tr-world-drape.has-maps .tr-drape__btn { width:100%;justify-content:center; }
  .tr-world-lighting .tr-world-drape.has-maps .tr-drape__maps { min-width:0; }
  .tr-world-lighting .tr-world-drape.has-maps .tr-range { grid-column:1;width:100%;min-width:0; }
  .tr-world-lighting .tr-world-drape.has-maps .tr-drape__pct { grid-column:2; }
  .tr-world-lighting .tr-world-drape .kt-combo__pop { left:auto;right:0;max-width:calc(100vw - 64px); }
  .tr-world-loading { padding: 8px; }
  .tr-world-loading h2 { margin: 4px 0; font-size: 18px; }
  .tr-world-loading p { margin: 4px 0; }
  .tr-space-wait { width: 64px; height: 44px; }
  .tr-world-loading .tr-wait-icon { width: 64px; height: 44px; }
  .tr-world-lighting .tr-light { width:44px;height:44px; }
  .tr-world-brightness { grid-template-columns:auto 64px 30px;padding:0 8px; }
  .tr-world-brightness span { grid-column:auto; }
  .tr-world-brightness input { width:64px; }
}
.tr-world-model[hidden], .tr-planet-map[hidden] { display: none; }
.tr-ocean-map { position:relative;width:100%;height:100%; }
.tr-ocean-map[hidden] { display:none; }
.tr-selection-move { position:absolute;z-index:2;transform:translate(-50%,-50%);width:44px;height:44px;border:1px solid var(--kt-select);border-radius:var(--kc-radius-control);background:var(--kc-card);color:var(--kt-select);font:24px/1 var(--kc-body);cursor:move;touch-action:none; }
.tr-selection-move[hidden] { display:none; }
.tr-selection-move svg { width:24px;height:24px;vertical-align:middle; }
.tr-selection-move:focus-visible { outline:2px solid var(--kc-focus);outline-offset:2px; }
.tr-ocean-canvas { position:absolute;inset:0;z-index:0; }
/* Stacking: map and its selection move handle, then the pins, then the tools, zoom buttons and credit. */
.tr-ocean-markers { z-index:3; }
.tr-ocean-markers .tr-lunar-pin.is-over-move { pointer-events:none; }
.tr-ocean-markers .tr-lunar-label.is-up { top:auto;bottom:40px; }
.tr-ocean-tools { position:absolute;left:8px;top:8px;z-index:4;display:flex;flex-direction:column;gap:8px;max-width:calc(100% - 176px); }
.tr-ocean-tools select { width:144px;max-width:100%;min-height:44px;font:600 13px var(--kc-display); }
.tr-ocean-tools button[hidden] { display:none; }
.tr-ocean-credit { position:absolute;left:0;right:0;bottom:0;z-index:4;background:var(--kc-ground);padding:4px 8px;font-size:11px;max-height:72px;overflow:auto; }
.tr-ocean-map .tr-map-zoom { top:8px;right:8px; }
.tr-planet-map canvas { width: 100%; height: 100%; cursor: grab; }
.tr-planet-draw { position: absolute; left: 8px; top: 8px; min-height: 44px; width: 144px; max-width: calc(100% - 120px); min-width: 112px; font: 600 13px var(--kc-display); z-index: 2; }
.tr-planet-sites { z-index: 2; }
.tr-planet-finish { position: absolute; top: 112px; left: 8px; min-height: 44px; z-index: 2; }
.tr-planet-finish[hidden] { display: none; }
.tr-planet-map .tr-map-zoom { top: 8px; right: 8px; }
.tr-planet-credit { position: absolute; bottom: 4px; left: 8px; padding: 4px 8px; background: var(--kc-ground); }
.tr-world-stage canvas { display: block; max-width: 100%; touch-action: none; }
.tr-world-hint { margin: 0; padding: 8px 12px; }
.tr-world-panel { min-width: 0; padding: 16px; }
.tr-world-panel .tr-input, .tr-world-panel .tr-select { width: 100%; min-height: 44px; }
.tr-world-panel label { display: block; margin-top: 12px; }
.tr-world-panel p { overflow-wrap: anywhere; }
.tr-world-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tr-world-size-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tr-world-size-fields > div { min-width: 0; }
.tr-world-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.tr-world-steps button { min-width: 0; min-height: 44px; padding: 8px; }
.tr-world-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tr-world-actions button { flex: 1 1 auto; min-height: 44px; min-width: 0; white-space: normal; }
.tr-world-credit { margin-top: 12px; }
.tr-world-credit summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.tr-world-panel label.tr-world-location { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.tr-world-location input { flex: 0 0 auto; width: 20px; height: 20px; }
@media (max-width: 800px) {
  .tr-world-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .tr-world-stage { height: 240px; }
  #trWorldWorkspace[data-view="map"] .tr-world-stage { height: 196px; }
  #trWorldWorkspace[data-step="size"] .tr-world-stage { height: 136px; }
  #trWorldWorkspace[data-step="make"] .tr-world-stage { height: 176px; }
  #trWorldWorkspace[data-view="model"] .tr-world-stage { height:304px; }
  #trWorldWorkspace[data-step="size"][data-view="model"] .tr-world-stage { height:200px; }
  #trWorldWorkspace[data-step="make"][data-view="model"] .tr-world-stage { height:240px; }
  .tr-world-tools > [data-world-title] { position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap; }
  .tr-world-tools { display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tr-world-tools button { min-width:0;padding:0 12px; }
  .tr-world-panel { padding:12px; }
  .tr-world-panel label { margin-top:8px; }
}
.tr-lake-bottom { margin-top: 16px; }
.tr-lake-row { margin-top: 8px; }
.tr-lake-row label { display: flex; align-items: center; min-height: 44px; gap: 8px; }
.tr-lake-row button { min-height: 44px; margin-top: 8px; }
.tr-lake-search input { min-height: 44px; width: 100%; margin-top: 8px; }
.tr-lake-list { max-height: 240px; overflow-y: auto; }

/* 3D print colors on the Make step (src/ui/print-colors.js; docs/COLOR-3MF-PLAN-2026-11-06.md and its mockup). The swatch
   and band colors are the filaments' own (engine/filaments.js), set by the script; text on them is a token. */
.tr-colors { min-width: 0; }
/* the 3D view, right under Change size and Download STL; the fold under it is .tr-extra, as More files and shapes */
.tr-colors-view { display: grid; gap: 8px; min-width: 0; }
.tr-colors-view[hidden] + .tr-colors-fold { margin-top: 0; }
/* during a 3MF job the block's switches are off and look it, as the other off controls do */
.tr .tr-colors-view .kt-seg button:disabled, .tr .tr-colors-body .kt-seg button:disabled, .tr .tr-colors-sets button:disabled { opacity: 0.6; cursor: default; color: var(--kc-muted); }
.tr-colors-body { display: grid; gap: 12px; margin-top: 12px; min-width: 0; }
/* Download 3MF, the block's one red: off, it stays dim under the pointer (design/tokens.css brightens every red on hover) */
.tr .tr-colors .kt-btn-red:disabled:hover { background: var(--kc-red-button); }
.tr-colors[hidden], .tr-colors [hidden] { display: none; }
.tr-colors-height, .tr-colors-cover { display: grid; gap: 12px; min-width: 0; }
.tr-colors p { margin: 0; }
.tr-colors .kt-seg { display: flex; width: 100%; }
.tr-colors .kt-seg button { flex: 1 1 0; min-width: 0; }
.tr-colors-sets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tr .tr-colors-sets button { display: grid; gap: 4px; align-content: center; justify-items: start; min-width: 0; min-height: var(--kt-target); padding: 8px; background: var(--kc-raised); border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); color: var(--kc-text); font: 600 12px/1.15 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.tr .tr-colors-sets button[aria-pressed="true"] { border-color: var(--kc-text); }
.tr .tr-colors-sets button:disabled { cursor: default; }
.tr-colors-sw { display: flex; width: 100%; height: 8px; border-radius: 2px; overflow: hidden; }
.tr-colors-sw i { flex: 1 1 0; }
.tr-colors-bar { position: relative; display: flex; height: var(--kt-target); touch-action: pan-y; }
.tr-colors-band { display: grid; place-items: center; min-width: 0; overflow: hidden; white-space: nowrap; font: 600 12px/1 var(--kc-body); color: var(--kc-ground); }
.tr-colors-band--dark { color: var(--kc-text); }
.tr-colors-band--plate > span { padding: 4px; border-radius: 4px; background: var(--kc-ground); color: var(--kc-text); }
.tr-colors-band:first-child { border-radius: 6px 0 0 6px; }
.tr-colors-band:nth-last-child(1 of .tr-colors-band) { border-radius: 0 6px 6px 0; }
.tr-colors-div { position: absolute; top: 0; bottom: 0; width: var(--kt-target); transform: translateX(-50%); cursor: ew-resize; touch-action: pan-y; }
.tr-colors-div::after { content: ''; position: absolute; left: calc(50% - 2px); top: 4px; bottom: 4px; width: 4px; border-radius: 2px; background: var(--kc-text); box-shadow: 0 0 0 1px var(--kc-ground); }
.tr-colors-div:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: -2px; border-radius: 6px; }
.tr-colors-ends { display: flex; justify-content: space-between; gap: 12px; font: 400 13px/1.3 var(--kc-body); color: var(--kc-muted); }
.tr-colors-actions { align-items: center; }
/* the filament picker (mockups/picker): one button per color, the list under them while one is open */
.tr-colors-fil { display: grid; gap: 8px; min-width: 0; }
.tr-colors-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
/* three colors: one row of three, never one button alone on a row; the swatch over the name so the name has the width */
.tr-colors-chips[data-n="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr .tr-colors-chips[data-n="3"] .tr-colors-chip, .tr .tr-colors-ghost[data-n="3"] { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 4px 8px; font-size: 12px; }
/* the open list sits in the grid right after its color's button (the tab order) and is drawn under every button */
.tr-colors-chips > .tr-colors-panel { grid-column: 1 / -1; order: 1; }
.tr .tr-colors-chip { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: var(--kt-target); padding: 4px 12px; background: var(--kc-raised); border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); color: var(--kc-text); font: 400 13px/1.2 var(--kc-body); text-align: left; overflow-wrap: break-word; cursor: pointer; }
.tr .tr-colors-chip[aria-expanded="true"] { border-color: var(--kc-text); }
.tr .tr-colors-chip:disabled { cursor: default; }
.tr-colors-chip > i { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--kc-line-ui); }
.tr-colors-chip > span { min-width: 0; }
/* the grip, the swap's drag states (mockups/swap) */
.tr .tr-colors-chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tr-colors-chip > .tr-colors-grip { flex: 0 0 auto; margin-left: auto; color: var(--kc-muted); font: 400 14px/1 var(--kc-body); letter-spacing: -2px; }
.tr-colors-grip::before { content: '\22EE\22EE'; }
.tr-colors-chips[data-n="3"] .tr-colors-chip { position: relative; }
/* the lifted copy is position: fixed, which holds its absolute grip as relative does on the button */
.tr-colors-chips[data-n="3"] .tr-colors-chip > .tr-colors-grip, .tr-colors-ghost[data-n="3"] > .tr-colors-grip { position: absolute; top: 8px; right: 8px; }
/* narrow phones: the room goes to the name, so no filament name breaks inside a word (measured for all 55 at 320) */
@media (max-width: 374px) {
  .tr .tr-colors-chips:not([data-n="3"]) .tr-colors-chip, .tr .tr-colors-ghost:not([data-n="3"]) { gap: 4px; padding: 4px 8px; }
}
/* a GPS route's chip (GPS route 3MF plan section 4) is one more chip in the grid, counted in data-n, with no grip (it is no
   swap target). Five chips (SWITCH 1 off): a row of three over a row of two, never one alone */
.tr-colors-chips[data-n="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tr-colors-chips[data-n="5"] > .tr-colors-chip { grid-column: span 2; }
.tr-colors-chips[data-n="5"] > .tr-colors-chip:nth-of-type(n+4) { grid-column: span 3; }
.tr .tr-colors-chips[data-n="5"] > .tr-colors-chip:nth-of-type(-n+3) { position: relative; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 4px 8px; font-size: 12px; }
.tr-colors-chips[data-n="5"] > .tr-colors-chip:nth-of-type(-n+3) > .tr-colors-grip { position: absolute; top: 8px; right: 8px; }
/* Land cover: the route's chip beside its line, so it never stands alone; its list under both */
.tr-colors-routerow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: center; min-width: 0; }
.tr-colors-routerow[data-chip="0"] > p { grid-column: 1 / -1; }
.tr-colors-routerow > p { margin: 0; min-width: 0; }
.tr-colors-routerow > .tr-colors-panel { grid-column: 1 / -1; order: 1; }
.tr .tr-colors-chip--from { opacity: 0.35; border-style: dashed; }
.tr .tr-colors-chip--to { border-color: var(--kc-text); box-shadow: 0 0 0 1px var(--kc-text); }
.tr .tr-colors-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; border-color: var(--kc-text); box-shadow: var(--kt-float-shadow); }
.tr-colors-chip b { font-weight: 600; margin-right: 4px; }
.tr-colors-panel { display: grid; gap: 8px; min-width: 0; padding: 8px; border: 1px solid var(--kc-line-ui); border-radius: var(--kc-radius-control); background: var(--kc-raised); }
.tr-colors-panelh { font: 600 13px/1.3 var(--kc-body); color: var(--kc-text); }
.tr-colors-fam { margin-top: 4px; font: 600 11px/1 var(--kc-display); letter-spacing: -0.03em; text-transform: uppercase; color: var(--kc-muted); }
/* five a row: 30 PLA Basic and 25 PLA Matte fill every row, so no swatch sits alone; 5 x 44 px and 4 px gaps fit at 320 */
.tr-colors-grid { display: grid; grid-template-columns: repeat(5, minmax(var(--kt-target), 1fr)); gap: 4px; }
.tr .tr-colors-grid button { min-width: var(--kt-target); height: var(--kt-target); padding: 0; border: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--kc-line-ui); cursor: pointer; }
.tr .tr-colors-grid button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--kc-ground), 0 0 0 4px var(--kc-text); }
.tr .tr-colors-grid button:focus-visible { outline: 2px solid var(--kc-focus); outline-offset: 4px; }
.tr-colors-panelrow > .kt-btn-2 { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.15; text-align: center; }
.tr-colors-beside { flex: 1 1 0; min-width: 0; }
