/* Copyright (c) 2026. All rights reserved. See LICENSE. */
/* The studio: the canvas is the page; the panels float over it, cut from the drawings' paper. */
:root {
  --film: #e9ece8; --paper: #fbfbf9; --graphite: #23272b; --lead: #5c636a; --rule: #cfd5d1; --rule-strong: #9aa39e;
  --blue: #7fb3c8; --ink: #2b6f9e; --red: #c8322b; --wash: #e6f0f4;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(35, 39, 43, .08), 0 6px 18px rgba(35, 39, 43, .10);
  --r: 8px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: var(--film); color: var(--graphite); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.st-app { position: fixed; inset: 0; }

/* ---- the canvas */
.st-stage { position: absolute; inset: 0; z-index: 0; outline: none; } /* its own stacking: the labels' z-indexes stay under the panels */
.st-canvas { display: block; touch-action: none; }
.st-canvas[data-tool="footprint"] { cursor: crosshair; }
.st-canvas[data-tool="building"] { cursor: copy; }
.st-labels { position: absolute; inset: 0; pointer-events: none; }
#stage:focus { outline: none; }
.st-room { padding: 0 4px; font-size: 11px; font-weight: 600; color: var(--graphite); background: rgba(251, 251, 249, .8); border-radius: 3px; white-space: nowrap; pointer-events: none; }
.st-labels.no-labels :is(.st-lot-tag, .st-bld-tag, .st-dim, .st-status) { display: none !important; }
.st-dim {
  padding: 1px 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
  color: var(--ink); background: rgba(251, 251, 249, .92); border: 1px solid var(--blue); border-radius: 10px;
  pointer-events: auto; cursor: text; user-select: none;
}
.st-dim:hover { background: var(--wash); }
.st-dim.st-sb { color: var(--lead); border-color: var(--rule); cursor: default; text-transform: capitalize; font-weight: 500; pointer-events: none; }
.st-dim.st-h { color: var(--graphite); border-color: var(--rule-strong); cursor: ns-resize; pointer-events: none; }
.st-dim-edit { width: 76px; padding: 1px 6px; font-size: 12px; font-weight: 600; border: 1.5px solid var(--ink); border-radius: 10px; outline: none; pointer-events: auto; }
.st-lot-tag { padding: 0 6px; font-size: 11.5px; font-weight: 600; color: var(--lead); white-space: nowrap; pointer-events: none;
  background: rgba(251, 251, 249, .75); border-radius: 3px; }
.st-bld-tag { padding: 1px 7px; font-size: 12px; font-weight: 650; white-space: nowrap; pointer-events: none;
  color: var(--graphite); background: rgba(251, 251, 249, .92); border: 1px solid var(--rule); border-radius: 3px; }
.st-bld-tag.on { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.st-status { padding: 3px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; color: #fff;
  background: rgba(35, 39, 43, .86); border-radius: 12px; font-variant-numeric: tabular-nums; }
.st-cursor-dim { position: absolute; z-index: 5; pointer-events: none; padding: 2px 8px; font-size: 12px; font-weight: 600;
  white-space: nowrap; color: #fff; background: var(--ink); border-radius: 10px; font-variant-numeric: tabular-nums; }

/* ---- floating chrome */
.st-top { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 60; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.st-top > * { pointer-events: auto; }
.st-chip, .st-icon, .st-seg, .st-toolbar, .st-panel, .st-pop, .st-film, .st-issues {
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: var(--shadow);
}
.st-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; cursor: pointer; text-decoration: none; font-weight: 600; font-size: 13px; }
.st-chip[aria-pressed="true"] { color: var(--paper); background: var(--graphite); border-color: var(--graphite); }
.st-sun { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 8px; font-size: 13px; cursor: default; }
.st-sun input { width: 84px; accent-color: var(--graphite); }
.st-sun output { min-width: 36px; font-variant-numeric: tabular-nums; font-weight: 500; }
.st-sun .st-play { margin-left: auto; font-size: 10px; }
#render-n { font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.75; }
.st-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; cursor: pointer; }
.st-icon svg, .st-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.st-icon:disabled { opacity: .35; cursor: default; }
.st-proj { position: relative; }
.st-proj-btn { height: 48px; padding: 0 12px 0 6px; }
.st-tile { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 7px; color: var(--paper);
  background: var(--tile, var(--ink)); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.st-proj-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; max-width: 210px; }
.st-proj-txt b { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.st-cap { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--lead); }
.st-caret { color: var(--lead); font-size: 11px; }

.st-toolbar { display: flex; align-items: center; gap: 2px; padding: 4px; margin: 0 auto; }
.st-tool { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 11px 0 9px; border: 0; border-radius: 6px; background: none; cursor: pointer; font-weight: 600; font-size: 13px; }
.st-tool kbd { font: 600 10px/1 var(--font); color: var(--lead); padding: 2px 4px; border: 1px solid var(--rule); border-radius: 3px; }
.st-tool:hover { background: var(--film); }
.st-tool[aria-pressed="true"] { color: var(--paper); background: var(--graphite); }
.st-tool[aria-pressed="true"] kbd { color: #c9cfcb; border-color: #5c636a; }
.st-road-kind { height: 32px; margin: 0 4px; font: 600 12px var(--font); border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.st-road-kind[hidden] { display: none; }
.st-toolbar .st-icon { border: 0; box-shadow: none; width: 36px; height: 36px; background: none; }
.st-toolbar .st-icon:hover:not(:disabled) { background: var(--film); }
.st-sep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--rule); }
.st-right { display: flex; align-items: center; gap: 8px; }
.st-seg { display: inline-flex; height: 40px; overflow: hidden; }
.st-seg button { border: 0; background: none; padding: 0 11px; cursor: pointer; font-size: 13px; font-weight: 600; }
.st-seg button + button { border-left: 1px solid var(--rule); }
.st-seg button[aria-pressed="true"] { color: var(--paper); background: var(--graphite); }

/* ---- popovers */
.st-pop { position: absolute; z-index: 30; padding: 8px 0; }
.st-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 14px 8px; }
.st-pop-head span { font-size: 12px; color: var(--lead); }
.st-proj-menu { top: 56px; left: 0; width: 300px; }
.st-proj-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 14px; border: 0; background: none; cursor: pointer; text-align: left; }
.st-proj-item:hover { background: var(--film); }
.st-proj-item[aria-current="true"] { background: var(--wash); }
.st-proj-item .st-tile { width: 30px; height: 30px; font-size: 11.5px; }
.st-proj-item span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.st-proj-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-proj-item small { color: var(--lead); font-size: 12px; }
.st-pop-actions { display: flex; flex-direction: column; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--rule); }
.st-pop-actions > * { padding: 7px 14px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 13.5px; }
.st-pop-actions > *:hover { background: var(--film); }
#proj-new { color: var(--ink); font-weight: 650; }
.st-danger { color: var(--red); }
.st-file { position: relative; }
.st-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.st-templates { top: 70px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 180px); overflow: auto; padding: 10px 0 12px; }
.st-tpl-blank { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.st-tpl-blank button { padding: 6px 12px; border: 1px solid var(--rule-strong); border-radius: 16px; background: var(--paper); cursor: pointer; font-size: 13px; font-weight: 600; }
.st-tpl-blank button:hover { border-color: var(--ink); color: var(--ink); }
.st-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; padding: 0 14px; }
.st-tpl { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); cursor: pointer; text-align: left; }
.st-tpl:hover, .st-tpl[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.st-tpl img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-radius: 3px; }
.st-tpl b { font-size: 13px; line-height: 1.2; }
.st-tpl small { font-size: 11.5px; color: var(--lead); line-height: 1.25; }
.st-tpl-more { margin: 10px 14px 0; }
.st-tpl-more summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink); }
.st-tpl-more h4 { margin: 10px 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lead); }
.st-tpl-more button { display: inline-block; margin: 2px 4px 2px 0; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 14px; background: none; cursor: pointer; font-size: 12.5px; }
.st-tpl-more button:hover { border-color: var(--ink); color: var(--ink); }
.st-help { top: 70px; right: 12px; width: min(400px, calc(100vw - 24px)); max-height: calc(100vh - 200px); overflow: auto; }
.st-help-lede { margin: 0; padding: 0 14px; font-size: 13px; line-height: 1.45; }
.st-help-free { margin: 8px 14px 4px; padding: 6px 10px; font-size: 12.5px; background: var(--film); box-shadow: inset 3px 0 0 var(--ink); }
.st-help-more { margin: 6px 14px 0; font-size: 13px; }
.st-help-more summary { cursor: pointer; font-weight: 650; padding: 4px 0; }
.st-help .st-help-uses { display: block; padding: 0 0 4px; }
.st-help .st-help-uses dt { white-space: normal; }
.st-help .st-help-uses dd { margin: 0 0 6px; }
.st-help-steps { margin: 2px 0 4px; padding-left: 20px; line-height: 1.4; }
.st-help-steps li { margin: 0 0 6px; }
.st-help kbd { font: 600 11px/1 var(--mono, ui-monospace, monospace); padding: 1px 4px; border: 1px solid var(--rule); border-radius: 3px; }
.st-help-pages { margin: 0; padding: 8px 14px 0; border-top: 1px solid var(--rule); font-size: 12px; color: var(--lead); }
.st-help-pages a { color: inherit; }
.st-help-h { margin: 10px 14px 6px; padding-top: 8px; border-top: 1px solid var(--rule); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lead); }
.st-queue-btn { display: inline-flex; align-items: center; gap: 6px; }
.st-ring { width: 16px; height: 16px; transform: rotate(-90deg); }
.st-ring circle { fill: none; stroke-width: 3; }
.st-ring-bg { stroke: var(--rule); }
.st-ring-fg { stroke: var(--ink); stroke-linecap: round; transition: stroke-dasharray .3s; }
.st-queue-btn.idle .st-ring { opacity: .45; }
.st-queue { top: 70px; right: 12px; width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 200px); overflow: auto; padding: 8px 14px 12px; }
.st-queue .st-pop-head { padding: 4px 0 8px; }
.st-queue-ctl { display: flex; flex-direction: column; gap: 7px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.st-queue-ctl .st-btn { align-self: flex-start; }
.st-queue-ctl .st-queue-refine { height: 30px; padding: 0; border-left: 0; }
.st-queue-ctl + .st-queue-ctl { padding-top: 10px; }
.st-queue-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-queue-run .st-more { align-self: stretch; height: 30px; padding: 0; border-left: 0; text-align: left; }
.st-queue-run .st-more b { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.st-eta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--lead); font-variant-numeric: tabular-nums; }
.st-eta.bad { color: var(--red); white-space: normal; }
.st-queue-list { margin: 0; padding: 0; list-style: none; }
.st-queue-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 12.5px; cursor: pointer; }
.st-queue-list li:last-child { border-bottom: 0; }
.st-queue-list .st-q-what { flex: 1; min-width: 0; }
.st-queue-list .st-q-what b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.st-queue-list .st-q-what small { color: var(--lead); }
.st-queue-list li.ended { opacity: .6; }
.st-queue-list .st-q-empty { color: var(--lead); cursor: default; }
.st-layers { top: 70px; right: 12px; width: min(300px, calc(100vw - 24px)); max-height: calc(100vh - 200px); overflow: auto; padding: 8px 14px 12px; }
.st-layers .st-pop-head { padding: 4px 0 8px; }
.st-layers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.st-layers-note { margin: 0 0 10px; font-size: 12px; color: var(--lead); }
.st-layer-scope { display: flex; flex-direction: column; gap: 6px; padding: 0 0 10px; }
.st-layer-scope label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; }
.st-layer-scope select { font: inherit; font-weight: 500; padding: 2px 4px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); max-width: 170px; }
.st-layer-group { padding: 8px 0 10px; border-top: 1px solid var(--rule); }
.st-layer-head { margin-bottom: 7px; }
.st-layer-head b { font-size: 12.5px; }
.st-layer-parts { margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--rule); }
.st-layer-parts .st-sub:first-child { margin-top: 8px; }
.st-help dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; padding: 0 14px 6px; font-size: 13px; }
.st-help dt { font-weight: 650; white-space: nowrap; }
.st-help dd { margin: 0; color: var(--lead); }
.st-help-contact { margin: 0; padding: 8px 14px 12px; border-top: 1px solid var(--rule); font-size: 12px; color: var(--lead); }
.st-help-contact a { color: inherit; }

/* ---- the panels */
.st-panel { position: absolute; z-index: 8; display: flex; flex-direction: column; overflow: hidden; }
.st-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 12px; border-bottom: 1px solid var(--rule); }
.st-panel-head b { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--lead); }
.st-mini { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 4px; background: none; cursor: pointer; color: var(--lead); font-size: 16px; line-height: 1; }
.st-mini:hover { background: var(--film); color: var(--graphite); }
.st-outliner { left: 12px; top: 106px; width: 240px; max-height: calc(100vh - 234px); }
.st-outliner .st-win-body { display: flex; flex-direction: column; overflow: hidden; } /* the find box stays, the lots scroll */
/* the breadcrumb (ladder.js): Land › Town › District › Block › Lot › Building, each a rung to go to */
.st-crumbs { position: absolute; left: 12px; top: 68px; z-index: 9; display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  max-width: calc(100vw - 340px); padding: 3px 6px; border-radius: 8px; background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 1px 2px rgba(35,39,43,.12); font-size: 12.5px; }
.st-crumbs:empty { display: none; }
.st-crumb { padding: 2px 6px; border: 0; border-radius: 5px; background: none; cursor: pointer; color: var(--lead); font: inherit; }
.st-crumb:hover { background: var(--film); color: var(--graphite); }
.st-crumb[aria-current="true"] { color: var(--graphite); font-weight: 600; }
.st-crumb-sep { color: var(--rule-strong); }
.st-out-find { padding: 6px 10px 2px; }
.st-out-find input { width: 100%; padding: 5px 8px; border: 1px solid var(--rule); border-radius: 6px; font: inherit; font-size: 12.5px; }
/* the town's rows: the city, its districts, a district's blocks, a block's lots (``--depth`` deep) */
.st-out-town { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 12px 4px calc(12px + var(--depth, 0) * 12px);
  border: 0; background: none; cursor: pointer; text-align: left; font-size: 12.5px; }
.st-out-town:hover { background: var(--film); }
.st-out-town[aria-current="true"] { background: var(--wash); }
.st-out-town b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.st-out-town small { color: var(--lead); font-size: 11px; white-space: nowrap; }
.st-out-city b { font-weight: 700; }
.st-out-label { margin: 8px 12px 2px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--lead); }
.st-dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.st-dl dt { color: var(--lead); }
.st-dl dd { margin: 0; }
.st-name-static { font-weight: 650; font-size: 16px; }
.st-lotplan-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 14px; }
.st-lotplan-svg svg { width: 100%; height: auto; }
.st-lotplan-floors { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }
.st-out-body { overflow: auto; padding: 4px 0 6px; }
.st-out-lot, .st-out-bld { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 12px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 13px; }
.st-out-bld { padding-left: 28px; }
.st-out-lot:hover, .st-out-bld:hover { background: var(--film); }
.st-out-lot[aria-current="true"], .st-out-bld[aria-current="true"] { background: var(--wash); }
.st-out-lot b, .st-out-bld b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.st-out-lot small, .st-out-bld small { color: var(--lead); font-size: 11.5px; white-space: nowrap; }
.st-lot-ico { flex: none; width: 14px; height: 14px; border: 1.5px dashed var(--graphite); border-radius: 2px; }
.st-tag { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; color: #fff; background: var(--tag, var(--ink)); font-size: 10.5px; font-weight: 700; }
.st-out-none { margin: 4px 12px 8px; color: var(--lead); font-size: 12.5px; line-height: 1.45; }
.st-badge { font-size: 10.5px; font-weight: 700; padding: 0 5px; border-radius: 8px; background: var(--film); color: var(--lead); }
.st-badge.ok { background: #e3f1e7; color: #2f7d4f; }
.st-badge.bad { background: #f7e1df; color: var(--red); }

.st-inspector { right: 12px; top: 72px; width: 300px; max-height: calc(100vh - 220px); overflow: auto; } /* clear of the light */
.st-insp-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--rule); }
.st-insp-head .st-cap { display: block; margin-bottom: 2px; }
.st-name { width: 100%; padding: 2px 0; border: 0; border-bottom: 1px dashed transparent; background: none; font-size: 17px; font-weight: 700; }
.st-name:hover, .st-name:focus { border-bottom-color: var(--rule-strong); outline: none; }
.st-insp-sub { margin: 2px 0 0; color: var(--lead); font-size: 12.5px; }
.st-sec { padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.st-sec:last-child { border-bottom: 0; }
.st-sec > b { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lead); }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.st-grid .wide { grid-column: span 2; }
.st-layer { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; padding: 4px 0 6px; border-top: 1px solid var(--rule); }
.st-layer > select:first-child { grid-column: span 2; }
.st-layer > .st-btn { justify-self: end; padding: 0 8px; }
.st-layer > select { min-width: 0; }
.st-f { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--lead); min-width: 0; }
.st-f input, .st-f select { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--rule-strong); border-radius: 5px; background: #fff; color: var(--graphite); font-size: 13px; }
.st-slider input[type=range] { height: 24px; padding: 0; border: 0; background: none; accent-color: var(--ink); }
.st-slider output { color: var(--graphite); font-weight: 600; }
.st-f input:focus, .st-f select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 2px rgba(127, 179, 200, .35); }
.st-unit { position: relative; }
.st-unit input { padding-right: 26px; }
.st-unit i { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--lead); font-size: 12px; pointer-events: none; }
.st-row { display: flex; flex-wrap: wrap; gap: 6px; }
.st-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--rule-strong); border-radius: 15px; background: var(--paper); cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-btn:hover { border-color: var(--graphite); }
.st-btn.primary { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.st-btn.primary:hover { background: #245d85; }
.st-btn.danger { color: var(--red); }
.st-btn[aria-pressed="true"] { color: var(--paper); background: var(--graphite); border-color: var(--graphite); }
.st-btn:disabled { opacity: .45; cursor: default; }
a.st-btn { justify-content: center; color: inherit; text-decoration: none; }
.st-stat { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; font-size: 12.5px; }
.st-stat dt { color: var(--lead); }
.st-stat dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; }
.st-tiles button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; border: 1px solid var(--rule); border-radius: 5px; background: #fff; cursor: pointer; font-size: 9.5px; color: var(--lead); line-height: 1.1; }
.st-tiles button svg { width: 26px; height: 22px; color: var(--graphite); }
.st-tiles button:hover { border-color: var(--ink); }
.st-tiles button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--wash); color: var(--ink); }
.st-note { margin: 6px 0 0; font-size: 12px; color: var(--lead); }
.st-note.bad { color: var(--red); }
.st-fold > summary { display: flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lead); }
.st-fold > summary::-webkit-details-marker { display: none; }
.st-fold > summary::before { content: ""; width: 0; height: 0; border-left: 4px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform .12s; }
.st-fold[open] > summary { margin-bottom: 8px; }
.st-fold[open] > summary::before { transform: rotate(90deg); }
.st-fold > summary:hover { color: var(--graphite); }
.st-check { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--graphite); line-height: 1.3; cursor: pointer; }
.st-check input { margin: 1px 0 0; accent-color: var(--ink); }
.st-f select:disabled { opacity: .5; }
.st-line { margin-top: 2px; }
.st-line-svg { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--rule-strong); border-radius: 5px; cursor: crosshair; touch-action: none; }
.st-line-svg .g { stroke: var(--rule-strong); stroke-width: 1; }
.st-line-svg .l { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.st-line-svg circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; cursor: grab; }
.st-line-svg circle.on, .st-line-svg circle:hover { fill: var(--ink); }
.st-sub { display: block; margin: 10px 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lead); }
.st-small { font-size: 11.5px; color: var(--lead); }
.st-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.st-rooms { display: flex; flex-direction: column; }
.st-room-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 6px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.st-room-row:hover { background: var(--film); }
.st-room-row.on { background: var(--wash); font-weight: 600; }
.st-room-row small { color: var(--lead); font-variant-numeric: tabular-nums; }
.st-chip-check { position: relative; }
.st-chip-check input { position: absolute; opacity: 0; }
.st-chip-check span { display: block; padding: 3px 9px; border: 1px solid var(--rule-strong); border-radius: 12px; font-size: 12px; cursor: pointer; }
.st-chip-check input:checked + span { color: var(--paper); background: var(--graphite); border-color: var(--graphite); }
.st-chip-check input:focus-visible + span { outline: 2px solid var(--blue); }
.st-f input:disabled { background: var(--film); color: var(--lead); }
.st-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-table th { padding: 0 2px 4px; font-size: 11px; font-weight: 600; color: var(--lead); text-align: left; }
.st-table td { padding: 1px 2px; }
.st-table td:first-child { width: 100%; color: var(--graphite); }
.st-table td:first-child select { display: block; width: 100%; max-width: 150px; height: 22px; margin-top: 1px; padding: 0 4px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; font-size: 11.5px; color: var(--lead); }
.st-table input[type=number] { width: 44px; height: 24px; padding: 0 4px; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff; font-size: 12.5px; }
.st-table input[type=number]:disabled { background: var(--film); border-color: var(--rule); }
.st-table input[type=checkbox] { margin: 0 6px; accent-color: var(--ink); }
.st-table tr.off td:first-child { color: var(--lead); }
.st-table tr.grp td { padding: 8px 2px 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--lead); }

/* ---- the primary navigation: the town's Law, Politics and Economy, along the bottom (main.js, ladder.js) */
.st-primary { position: absolute; left: 50%; bottom: 14px; z-index: 9; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: var(--shadow); }
.st-primary button { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 6px;
  background: none; cursor: pointer; font-weight: 600; font-size: 13px; }
.st-primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.st-primary button:hover:not(:disabled, [aria-current="page"]) { background: var(--film); }
.st-primary button[aria-current="page"] { color: var(--paper); background: var(--graphite); }
.st-primary button:disabled { opacity: .4; cursor: default; }
@media (max-width: 900px) { .st-primary { bottom: 10px; } .st-primary button { padding: 0 12px 0 10px; } }

/* ---- the run, over the primary navigation */
.st-run { position: absolute; left: 50%; bottom: 72px; z-index: 9; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100vw - 24px); pointer-events: none; }
.st-run > * { pointer-events: auto; }
.st-field { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 8px 0 10px; font-size: 12px; color: var(--lead); border-left: 1px solid var(--rule); white-space: nowrap; }
.st-field select { height: 30px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--graphite); cursor: pointer; }
.st-field input { width: 50px; height: 30px; padding: 0 2px; border: 0; background: none; font-size: 13px; font-weight: 600; color: var(--graphite); }
.st-field input::placeholder { color: var(--lead); font-weight: 400; }
.st-more { border-top: 0; border-right: 0; border-bottom: 0; background: none; cursor: pointer; }
.st-more b { font-size: 13px; color: var(--graphite); }
.st-more:hover b, .st-more[aria-expanded="true"] b { color: var(--ink); }
/* the Search popover opens from the Queue's, beside it */
.st-tradeoffs { top: 70px; right: 360px; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 200px); overflow: auto; padding: 8px 14px 12px; }
.st-tradeoffs .st-pop-head { padding: 4px 0 8px; }
@media (max-width: 860px) { .st-tradeoffs { right: 12px; z-index: 31; } }
.st-tradeoffs .st-search { margin-bottom: 4px; }
.st-tradeoffs fieldset { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.st-tradeoffs legend { display: none; }
.st-tradeoffs .hint { margin: 0 0 10px; font-size: 12px; color: var(--lead); }
.st-tradeoffs .cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.st-tradeoffs .cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.st-tradeoffs .span4 { grid-column: span 4; }
.st-tradeoffs .span2 { grid-column: span 2; }
.st-tradeoffs .cap { font-size: 11.5px; color: var(--lead); }
.st-tradeoffs select, .st-tradeoffs input[type=number] { width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--rule-strong); border-radius: 5px; background: #fff; font-size: 13px; }
.st-tradeoffs .seg { display: flex; gap: 4px; }
.st-tradeoffs .seg label { position: relative; flex: 1; }
.st-tradeoffs .seg input { position: absolute; opacity: 0; }
.st-tradeoffs .seg span { display: block; padding: 5px; border: 1px solid var(--rule-strong); border-radius: 5px; text-align: center; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.st-tradeoffs .seg input:checked + span { color: var(--paper); background: var(--graphite); border-color: var(--graphite); }
.st-tradeoffs .seg input:focus-visible + span { outline: 2px solid var(--blue); }
.st-tradeoffs #to-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.st-tradeoffs #to-picks label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.st-tradeoffs .to-off { opacity: .45; }
.st-film { display: flex; align-items: stretch; gap: 6px; padding: 6px; max-width: min(980px, calc(100vw - 24px)); overflow-x: auto; }
.st-opt { position: relative; display: flex; flex-direction: column; flex: none; width: 132px; padding: 4px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; cursor: pointer; text-align: left; }
.st-opt:hover { border-color: var(--rule-strong); }
.st-opt[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.st-opt .art { height: 84px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.st-opt .art svg { max-width: 100%; max-height: 84px; }
.st-opt b { font-size: 12px; margin-top: 2px; }
.st-opt small { font-size: 11px; color: var(--lead); line-height: 1.2; }
.st-opt.wait .art { color: var(--lead); font-size: 11.5px; border-radius: 4px;
  background: linear-gradient(100deg, transparent 35%, rgba(224, 145, 42, .14) 50%, transparent 65%) 0 0 / 300% 100%;
  animation: st-shimmer 1.6s linear infinite; }
@keyframes st-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.st-opt.fresh { animation: st-opt-in .45s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes st-opt-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .st-opt.fresh, .st-opt.wait .art { animation: none; } }
.st-opt.stale { opacity: .6; }
.st-opt.one { cursor: default; }
.st-opt.one:hover { border-color: var(--rule); }
.st-film-acts { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 0 4px; border-left: 1px solid var(--rule); }
.st-film-note { align-self: center; padding: 0 8px; font-size: 12px; color: var(--lead); max-width: 180px; }
.st-film-note.bad { color: var(--red); }
.st-opt.bad b { color: var(--red); }
.st-opt.prev { opacity: .75; }
.st-opt.failed { cursor: default; border-style: dashed; }
.st-opt.failed .art { align-items: flex-start; padding: 2px; font-size: 11px; line-height: 1.25; color: var(--red); }
.st-opt.failed .art span { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- the picked option's code issues, over the film (hud.js renderIssues) */
.st-issues { width: min(640px, calc(100vw - 24px)); padding: 8px 12px; font-size: 12.5px; border-left: 3px solid var(--red); }
.st-issues-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.st-issues-head b { color: var(--red); }
.st-issues-list { margin: 4px 0 0; padding-left: 22px; max-height: 30vh; overflow-y: auto; }
.st-issues-list li { line-height: 1.5; }
.st-issue { display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-issue:hover { text-decoration: underline; }
.st-issues-more { display: flex; align-items: baseline; gap: 10px; margin-top: 2px; }
.st-issues-more small { color: var(--lead); }
.st-btn.st-link { height: auto; padding: 0; border: 0; background: none; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

.st-hint { position: absolute; left: 50%; top: 104px; z-index: 7; transform: translateX(-50%); max-width: min(560px, calc(100vw - 600px));
  padding: 6px 12px; font-size: 13px; color: var(--graphite); background: rgba(251, 251, 249, .94); border: 1px solid var(--rule);
  border-radius: 16px; pointer-events: none; text-align: center; box-shadow: var(--shadow); }
.st-hint:empty { display: none; }

.st-boot { position: absolute; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; background: var(--film); color: var(--lead); font-weight: 600; }
.st-boot.err { color: var(--red); padding: 24px; text-align: center; }

/* ---- the drawings, in a window over the canvas (sheets.js) */
.st-float { position: absolute; z-index: 35; display: flex; flex-direction: column; min-width: 320px; min-height: 220px;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: var(--r); box-shadow: 0 2px 6px rgba(35,39,43,.12), 0 14px 40px rgba(35,39,43,.22);
  overflow: hidden; }
.st-float-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--rule); cursor: move; user-select: none; touch-action: none; }
.st-float-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.st-float-acts { display: flex; align-items: center; gap: 4px; flex: none; cursor: default; }
.st-float-sheet { max-width: 220px; height: 26px; font: inherit; font-size: 12px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.st-float-zoom { min-width: 40px; text-align: center; font-size: 12px; color: var(--lead); font-variant-numeric: tabular-nums; }
.st-float iframe { flex: 1; width: 100%; border: 0; background: var(--film); }
.st-float-wait { position: absolute; left: 0; right: 0; top: 50%; margin: 0; text-align: center; color: var(--lead); font-size: 13px; }
.st-float button:disabled { opacity: .45; }

/* ---- every window, popover and panel (float.js): moved by its bar, sized from its edges, folded to its bar, pinned */
.st-pop.st-win, .st-panel.st-win { display: flex; flex-direction: column; overflow: hidden; }
.st-pop.st-win.moved, .st-panel.st-win.moved { right: auto; bottom: auto; transform: none; }
.st-win-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.st-win-head { cursor: move; user-select: none; touch-action: none; }
.st-win > .st-pop-head { align-items: center; }
.st-win-btn svg { width: 14px; height: 14px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.st-win.folded .st-win-fold svg { transform: rotate(-90deg); }
.st-win-pin svg { transform: rotate(45deg); }
.st-win.pinned .st-win-pin { color: var(--paper); background: var(--graphite); }
.st-win.pinned .st-win-pin svg { transform: none; }
.st-win.folded { height: auto !important; min-height: 0 !important; max-height: none !important; }
.st-win.folded > :not(.st-win-head, .st-win-grip.e, .st-win-grip.w) { display: none !important; }
.st-win.folded > .st-float-head, .st-win.folded > .st-panel-head { border-bottom: 0; }
.st-win.folded > .st-pop-head { padding-bottom: 0; }
.st-win-grip { position: absolute; z-index: 2; touch-action: none; }
.st-win-grip.n, .st-win-grip.s { left: 10px; right: 10px; height: 5px; cursor: ns-resize; }
.st-win-grip.e, .st-win-grip.w { top: 10px; bottom: 10px; width: 5px; cursor: ew-resize; }
.st-win-grip.n { top: 0; } .st-win-grip.s { bottom: 0; } .st-win-grip.e { right: 0; } .st-win-grip.w { left: 0; }
.st-win-grip.ne, .st-win-grip.nw, .st-win-grip.se, .st-win-grip.sw { width: 12px; height: 12px; }
.st-win-grip.ne { top: 0; right: 0; cursor: nesw-resize; } .st-win-grip.sw { bottom: 0; left: 0; cursor: nesw-resize; }
.st-win-grip.nw { top: 0; left: 0; cursor: nwse-resize; } .st-win-grip.se { bottom: 0; right: 0; cursor: nwse-resize; }
.st-win-grip.se::after { content: ""; position: absolute; right: 3px; bottom: 3px; width: 6px; height: 6px;
  border-right: 1.5px solid var(--rule-strong); border-bottom: 1.5px solid var(--rule-strong); border-bottom-right-radius: 2px; }

/* ---- the rule book, in a window (rules.js, rulebook.js) */
.st-rules-body { flex: 1; min-height: 0; overflow-y: auto; }
.st-analysis-body { flex: 1; min-height: 0; overflow-y: auto; }
.st-library-body { flex: 1; min-height: 0; overflow-y: auto; container-type: inline-size; }
.st-lib-hint { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--rule); }
.st-library .lib { border-top: 0; }
@container (max-width: 640px) { .st-library .lib { grid-template-columns: minmax(0, 1fr); } }
.st-sheets-menu { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 14px; border-bottom: 1px solid var(--rule); background: var(--paper); font-size: 13px; }
.st-sheets-menu[hidden] { display: none; }
.st-an-meta { margin: 0; padding: 10px 20px; font-size: 13px; color: var(--lead); border-bottom: 1px solid var(--rule); }
.st-an-scope, .st-an-alt { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 20px; border-bottom: 1px solid var(--rule); font-size: 13px; }
.st-an-scope[hidden], .st-an-alt[hidden] { display: none; }
.st-analysis .report { border-left: 0; overflow: visible; }
.st-analysis .report.loading { opacity: .45; }
.st-rules .rb-head { padding: 12px 16px 10px; }
.st-rules .rb-head h2 { display: none; }
.st-rules .rule-list { padding: 4px 16px 24px; }
.st-rules .rb-status:not(:empty) { padding: 8px 16px 0; }
.st-count:not(:empty) { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--paper); font-size: 11px; line-height: 18px; text-align: center; }

/* ---- the minimap (minimap.js) */
.st-minimap { left: 12px; bottom: 14px; z-index: 8; padding: 4px; }
.st-minimap { width: 210px; height: 195px; } /* the canvas fills it, sized or not (minimap.js reads its size) */
.st-minimap .st-win-body { overflow: hidden; }
.st-minimap canvas { display: block; width: 100%; height: 100%; cursor: crosshair; border-radius: 4px; background: var(--film); touch-action: none; }

/* ---- the light: the sun's hour and Render (scene.js) */
.st-light { right: 12px; bottom: 14px; width: 248px; gap: 2px; padding: 4px; }
.st-light > .st-panel-head, .st-minimap > .st-panel-head { margin: -4px -4px 4px; } /* the bar the panel's width, over its padding */
.st-light .st-sun { min-height: 32px; }
.st-light-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.st-sky select { font: inherit; font-weight: 500; border: 0; background: none; color: inherit; cursor: pointer; }
.st-sun:has(input:disabled) { opacity: .45; }
.st-clock { display: flex; align-items: center; gap: 4px; padding: 0 4px 0 8px; min-height: 26px; font-size: 12px; }
.st-clock output { font-variant-numeric: tabular-nums; }
#clock-day { margin-right: auto; font-weight: 500; }
#year { flex: 1; min-width: 0; }
#year-t { flex: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted, #666); }
#pace-t { min-width: 62px; text-align: center; color: var(--lead); }
.st-sun output.st-held { opacity: .5; }
@media (max-width: 1099px) { .st-light { bottom: 120px; } }
.st-env { right: 12px; bottom: 100px; width: min(280px, calc(100vw - 24px)); padding: 8px 14px 12px; }
.st-env .st-pop-head { padding: 4px 0 8px; }
.st-env-rows { display: flex; flex-direction: column; gap: 8px; }
.st-env-rows > label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.st-env-rows > label > span { display: flex; align-items: center; gap: 4px; }
.st-env-rows input[type=number] { width: 64px; font: inherit; padding: 2px 4px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.st-env-rows input[type=date] { font: inherit; font-size: 12.5px; padding: 1px 4px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); }
.st-env-rows input[type=range] { width: 140px; accent-color: var(--graphite); }
#fall-row > span:last-child { flex-direction: column; align-items: flex-end; gap: 2px; }  /* the rain's slider, its amount under */
#fall-row output { font-size: 11.5px; color: var(--lead); }
.st-env-note { margin: -4px 0 0; font-size: 11.5px; color: var(--lead); }
.st-env-rows input[type=date] { width: 124px; }
.st-env-today { width: auto; height: auto; padding: 2px 5px; font-size: 11.5px; }
.st-env-note:empty { display: none; }
.st-env-climate { margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--lead); }
.st-env-climate b { color: inherit; font-weight: 600; }
.st-env-climate:empty { display: none; }
.st-env-day { color: var(--graphite, inherit); }
@media (max-width: 1099px) { .st-env { bottom: 206px; } }

/* ---- the frame rate meter (fps.js), over the light */
.st-fps { position: absolute; right: 324px; top: 64px; z-index: 8; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px 0 6px;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; font-size: 12px; color: var(--lead); }
.st-fps canvas { width: 60px; height: 16px; display: block; }
.st-fps b { min-width: 22px; text-align: right; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--graphite); }
.st-fps::before { content: ""; order: 3; width: 7px; height: 7px; border-radius: 50%; background: #5f9a4f; }
.st-fps[data-tone="fair"]::before { background: #d98b1f; }
.st-fps[data-tone="poor"]::before { background: var(--red); }
.st-fps[aria-expanded="true"] { border-color: var(--graphite); }
.st-fps-pop { right: 324px; top: 98px; width: min(300px, calc(100vw - 24px)); padding: 8px 14px 12px; }
.st-fps-pop .st-pop-head { padding: 4px 0 8px; }
.st-fps-rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 10px; font-size: 12.5px; }
.st-fps-rows dt { color: var(--lead); }
.st-fps-rows dd { margin: 0; font-variant-numeric: tabular-nums; }
.st-fps-keep { display: flex; gap: 6px; align-items: center; font-size: 12.5px; cursor: pointer; }
.st-fps-note { margin: 8px 0 0; font-size: 11.5px; color: var(--lead); }
@media (max-width: 900px) { .st-fps { top: auto; right: 12px; bottom: 208px; } .st-fps-pop { top: auto; right: 12px; bottom: 244px; } } /* over the Light panel */

/* the top bar on a laptop's screen: the tools' keys in their tips */
@media (max-width: 1599px) { .st-tool kbd { display: none; } }
@media (max-width: 1299px) { .st-toolbar .st-tool span { display: none; } }
@media (max-width: 1099px) { .st-right .st-seg { display: none; } } /* the views: T, C and F */

/* ---- narrow screens: the panels fold under the canvas's top and the run */
@media (max-width: 900px) {
  .st-toolbar .st-tool span, .st-tool kbd { display: none; }
  .st-right .st-seg[aria-label="Units"] { display: none; }
  .st-outliner, .st-minimap { display: none; }
  .st-float { left: 8px !important; right: 8px; top: 64px !important; width: auto !important; height: 60vh !important; }
  .st-win-grip { display: none; }
  .st-inspector { left: 12px !important; right: 12px !important; top: auto !important; bottom: 120px !important; width: auto !important; height: auto !important; max-height: 40vh !important; }
  .st-hint { max-width: calc(100vw - 24px); top: 150px; }
  .st-crumbs { top: 112px; max-width: calc(100vw - 24px); }
  .st-proj-txt { max-width: 110px; }
  .st-top { flex-wrap: wrap; }
  .st-right { flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 600px) { .st-crumbs { top: 222px; } .st-hint { top: 258px; } } /* under the bar, wrapped in three rows */
/* a district's buildings: each template with its weight */
.st-home-row { display: grid; grid-template-columns: 1fr 76px 24px; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; }
.st-home-row .st-f { margin: 0; }
/* a value's rung, beside it (ladder.js's madeBy): a link to the rung that set it */
.st-from { padding: 0 6px; border: 1px solid var(--rule-strong); border-radius: 9px; background: none; color: var(--lead); font-size: 11px; line-height: 16px; cursor: pointer; }
.st-from:hover { color: var(--graphite); border-color: var(--ink); }
.st-made dd { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* All settings (settings.js): the config as JSON, checked by its schema */
.st-allset { display: grid; gap: 8px; }
.st-json { width: 100%; min-height: 220px; resize: vertical; padding: 8px; border: 1px solid var(--rule-strong); border-radius: 4px; background: #fff;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--graphite); tab-size: 2; }
.st-errs { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--red); display: grid; gap: 3px; }
.st-errs:empty { display: none; }
.st-errs.ok { color: var(--lead); list-style: none; padding-left: 0; }

/* History (looks.js): the lots' earlier looks */
.st-history-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 6px 10px; list-style: none; }
.st-hist { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--rule); }
.st-hist img { width: 72px; height: 54px; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 4px; }
.st-hist-what { display: grid; gap: 1px; min-width: 0; }
.st-hist-what b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-hist-what small { font-size: 12px; color: var(--lead); }
.st-hist-acts { display: flex; gap: 4px; align-items: center; }

/* ---- the Settings (prefs.js): a modal, its tabs down the left (along the top on a narrow screen) */
.st-modal { width: min(740px, calc(100vw - 32px)); max-height: min(660px, calc(100vh - 48px)); padding: 0; border: 1px solid var(--rule-strong);
  border-radius: 12px; background: var(--paper); color: var(--graphite); box-shadow: 0 2px 6px rgba(35, 39, 43, .12), 0 24px 60px rgba(35, 39, 43, .28); }
.st-modal::backdrop { background: rgba(35, 39, 43, .32); }
.st-modal-in { display: flex; flex-direction: column; max-height: inherit; }
.st-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 10px 18px; border-bottom: 1px solid var(--rule); font-size: 15px; }
.st-modal-body { display: flex; flex: 1; min-height: 0; }
.st-tabs { display: flex; flex: none; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px 8px; border-right: 1px solid var(--rule); background: var(--film); border-bottom-left-radius: 12px; }
.st-tabs [role="tab"] { padding: 8px 12px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--lead); white-space: nowrap; }
.st-tabs [role="tab"]:hover { color: var(--graphite); background: rgba(251, 251, 249, .6); }
.st-tabs [role="tab"][aria-selected="true"] { color: var(--graphite); background: var(--paper); box-shadow: inset 3px 0 0 var(--ink); }
.st-tabpane { flex: 1; min-width: 0; overflow: auto; padding: 14px 18px 16px; outline: none; }
.st-set-preset { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.st-set-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-set-preset .st-set-seg { height: 36px; }
.st-set-preset .st-set-seg button { padding: 0 16px; font-size: 13px; }
.st-set-custom { font-size: 12px; font-weight: 600; color: var(--ink); }
.st-set-list { display: flex; flex-direction: column; }
.st-set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.st-set-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-set-what b { font-size: 13.5px; }
.st-set-what small { font-size: 12px; line-height: 1.35; color: var(--lead); }
.st-set-seg { flex: none; height: 30px; box-shadow: none; }
.st-set-seg button { padding: 0 10px; font-size: 12.5px; white-space: nowrap; }
.st-set-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; font-size: 12px; color: var(--lead); }
/* ---- the New project window (newproject.js): its name and land, then Generate world */
.st-newproj { width: min(460px, calc(100vw - 32px)); }
.st-newproj-body { flex: 1; min-height: 0; overflow: auto; }
.st-newproj-body .st-sec:last-child { border-bottom: 0; }
.st-newproj-seed { display: flex; gap: 6px; }
.st-newproj-seed input { flex: 1; min-width: 0; }
.st-newproj-seed .st-btn { flex: none; height: 30px; }
.st-newproj-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 14px; border-top: 1px solid var(--rule); }
.st-newproj-foot small { font-size: 12px; color: var(--lead); }
.st-newproj-foot small.bad { color: var(--red); }
.st-newproj-foot .st-row { flex: none; flex-wrap: nowrap; }
@media (max-width: 640px) {
  .st-modal-body { flex-direction: column; }
  .st-tabs { flex-direction: row; min-width: 0; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--rule); border-bottom-left-radius: 0; }
  .st-tabs [role="tab"][aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--ink); }
  .st-tabpane { padding: 12px 16px 14px; }
  .st-set-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .st-set-seg { display: flex; }
  .st-set-seg button { flex: 1; padding: 0 4px; }
  .st-set-preset .st-set-seg { flex: 1; }
  .st-set-preset .st-set-seg button { padding: 0 6px; }
}
