/* Stadtwerk UI stylesheet. Pixel-art DOM UI over the WebGL2 map canvas. All authored in 1x UI pixels; #ui is zoomed
   by the UI scale (src/ui/scale.js). 9-slice frames come from --img-* variables generated by src/ui/theme.js, symbol
   glyphs from --g-* masks (src/ui/glyphs.js). Font: the siblings' pixel font (fonts/pixel*.woff2), 12px = 1:1.
   Sections 1-8 are forked from Spannungsfeld (originally Lumenforge); the art pass replaces palette and frames
   (M1 / M11, gfx/ART_GUIDE.md).
   Sections: 1 base  2 kit  4 overlays  5 screens  6 game shell  7 help viewer  8 accessibility  9 settings
   10 lobby details and status screens  11 Stadtwerk game screen (M0) */

/* ============================================================ 1 base */

@font-face {
  font-family: 'SW Pixel';
  src: url('fonts/pixel.woff2') format('woff2'), url('fonts/pixel.ttf') format('truetype');
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: 'SW Pixel';
  src: url('fonts/pixel-bold.woff2') format('woff2'), url('fonts/pixel-bold.ttf') format('truetype');
  font-weight: 700;
  font-display: block;
}

:root {
  --ink: #07080a;
  --deep: #0d0e11;
  --well: #0e0f12;
  --face: #17191e;
  --face2: #1d2026;
  --face3: #23262d;
  --steel: #3b4049;
  --steel-hi: #6b717c;
  --steel-hi2: #8d939d;
  --steel-lo: #2c3037;
  --brass: #d9963a;
  --brass-dk: #7a4e1c;
  --brass-hi: #ffd27a;
  --amber: #f0a83c;
  --amber-dk: #b8701e;
  --rust: #a8502a;
  --violet: #9b4dff;
  --violet-dk: #4a1f73;
  --violet-hi: #d17dff;
  --magenta: #e04ca8;
  --cyan: #4fe3ff;
  --cyan-dk: #1a6b80;
  --cyan-hi: #b8f6ff;
  --teal: #2fc7a0;
  --teal-dk: #146b5c;
  --text: #ece4d0;
  --dim: #a39b8a;
  --mute: #6d685e;
  --red: #e0503a;
  --green: #7fd35a;
  --good: #7fd35a;
  --warn: #f0a83c;
  --bad: #e0503a;
  --gloam: #9b4dff;
  --font: 'SW Pixel', 'DejaVu Sans Mono', 'Menlo', 'Consolas', monospace;
  /* text size factor for every font size up to 16px (headings stay); the pixel font is drawn on 12px, normal text
     is 14px (user 2026-11-08: 12px tired the eyes); Menu -> Display -> Text size sets large / xl (guide.css) */
  --fz: 1.1667;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0b0c0f;
  color: var(--text);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  text-rendering: optimizeSpeed;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

#ui {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  image-rendering: pixelated;
}

#ui > * {
  position: absolute;
  inset: 0;
}

#screens > *,
#windows > *,
#overlay > *,
#top > *,
#hud > * {
  pointer-events: auto;
}

#windows,
#overlay,
#top {
  pointer-events: none;
}

/* Floating helpers never take the pointer (they sit under the cursor). */
#top > .drag-ghost,
#top > .drag-ghost *,
#top > .tooltip,
#overlay > .toasts {
  pointer-events: none !important;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin: 0;
  font-weight: 400;
}

mark {
  background: none;
  color: var(--brass-hi);
  text-decoration: underline;
  text-underline-offset: 2px;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 1px;
}

::selection {
  background: var(--amber-dk);
  color: #fff;
}

/* Scrollbars: thin steel rail with a brass-edged thumb. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--steel) var(--well);
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--well);
  box-shadow: inset 1px 0 var(--ink);
}
::-webkit-scrollbar-thumb {
  background: var(--steel);
  box-shadow: inset 1px 1px var(--steel-hi), inset -1px -1px var(--steel-lo), 0 0 0 1px var(--ink);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--steel-hi);
}
::-webkit-scrollbar-corner {
  background: var(--well);
}

.bold,
b,
strong {
  font-weight: 700;
}

.dim {
  color: var(--dim);
}
.mute {
  color: var(--mute);
}
.good {
  color: var(--good);
}
.warn {
  color: var(--warn);
}
.bad {
  color: var(--bad);
}
.cyan {
  color: var(--cyan);
}
.violet {
  color: var(--violet-hi);
}
.teal {
  color: var(--teal);
}
.brass {
  color: var(--brass-hi);
}

.caps {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.big {
  font-size: 24px;
  line-height: 26px;
}

.huge {
  font-size: 36px;
  line-height: 38px;
}

.shadow {
  text-shadow: 1px 1px 0 var(--ink);
}

.spacer {
  flex: 1;
}

.row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ============================================================ 2 kit */

/* Glyph: 9x9 mask, takes the current colour. */
.g {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  background: currentColor;
  -webkit-mask: var(--g) no-repeat center / 9px 9px;
  mask: var(--g) no-repeat center / 9px 9px;
  image-rendering: pixelated;
  vertical-align: -1px;
}
.g-blank {
  background: none;
}
.g.g2 {
  width: 18px;
  height: 18px;
  -webkit-mask-size: 18px 18px;
  mask-size: 18px 18px;
}

.icon {
  display: block;
  flex: none;
  image-rendering: pixelated;
}

/* Frames */
.frame {
  border: 4px solid transparent;
  border-image: var(--img-frame) 4 fill / 4px stretch;
}
.frame-gloam {
  border: 4px solid transparent;
  border-image: var(--img-frame-gloam) 4 fill / 4px stretch;
}
.frame-cyan {
  border: 4px solid transparent;
  border-image: var(--img-frame-cyan) 4 fill / 4px stretch;
}
.plate {
  border: 2px solid transparent;
  border-image: var(--img-plate) 2 fill / 2px stretch;
}
.plate-solid {
  border: 2px solid transparent;
  border-image: var(--img-plate-solid) 2 fill / 2px stretch;
}
.inset {
  border: 2px solid transparent;
  border-image: var(--img-inset) 2 fill / 2px stretch;
}
.frame-tip {
  border: 2px solid transparent;
  border-image: var(--img-tip) 2 fill / 2px stretch;
}

/* Key cap */
.kbd {
  display: inline-block;
  min-width: 13px;
  height: 13px;
  padding: 0 3px;
  font-size: calc(12px * var(--fz));
  line-height: calc(11px * var(--fz));
  text-align: center;
  color: var(--brass-hi);
  background: var(--deep);
  box-shadow: inset 0 0 0 1px var(--brass-dk), inset 0 -2px 0 0 #2a1c0c;
  white-space: nowrap;
  vertical-align: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.kbd-in {
  margin-left: 6px;
  margin-right: -4px;
  background: rgba(0, 0, 0, 0.35);
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 24px;
  padding: 3px 10px 1px;
  border-style: solid;
  border-color: transparent;
  border-width: 2px 2px 4px;
  border-image: var(--img-btn) 2 2 4 fill / 2px 2px 4px stretch;
  background: none;
  color: var(--text);
  text-shadow: 1px 1px 0 var(--ink);
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.btn:hover {
  border-image-source: var(--img-btn-hover);
}
.btn:active:not(:disabled),
.btn.on {
  border-image-source: var(--img-btn-down);
  padding-top: 4px;
  padding-bottom: 0;
}
.btn:focus-visible {
  outline: 1px solid var(--brass-hi);
  outline-offset: 1px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: default;
  filter: grayscale(0.6);
}
.btn .g {
  margin-top: -1px;
}
.btn-primary {
  border-image-source: var(--img-btn-primary);
  color: #1a0f04;
  text-shadow: 1px 1px 0 rgba(255, 230, 170, 0.45);
  font-weight: 700;
}
.btn-primary:hover {
  border-image-source: var(--img-btn-primary-hover);
}
.btn-primary:active:not(:disabled) {
  border-image-source: var(--img-btn-primary-down);
}
.btn-primary .kbd-in {
  color: #2a1804;
  background: rgba(255, 230, 170, 0.35);
  box-shadow: inset 0 0 0 1px rgba(60, 30, 4, 0.6);
}
.btn-danger {
  border-image-source: var(--img-btn-danger);
  color: #fff;
}
.btn-danger:hover {
  border-image-source: var(--img-btn-danger-hover);
}
.btn-danger:active:not(:disabled) {
  border-image-source: var(--img-btn-danger-down);
}
.btn-cyan {
  border-image-source: var(--img-btn-cyan);
  color: #021a20;
  text-shadow: 1px 1px 0 rgba(220, 250, 255, 0.4);
  font-weight: 700;
}
.btn-cyan:hover {
  border-image-source: var(--img-btn-cyan-hover);
}
.btn-cyan:active:not(:disabled) {
  border-image-source: var(--img-btn-cyan-down);
}
.btn-ghost {
  border-image: none;
  border-color: transparent;
  color: var(--dim);
}
.btn-ghost:hover {
  color: var(--brass-hi);
  border-image: none;
  background: rgba(240, 168, 60, 0.08);
}
.btn-sm {
  height: 20px;
  padding: 1px 6px 0;
  border-width: 2px 2px 3px;
  border-image-width: 2px 2px 3px;
}
.btn-sm:active:not(:disabled) {
  padding-top: 2px;
  padding-bottom: 0;
}
.btn-lg {
  height: 34px;
  padding: 6px 18px 2px;
  font-size: calc(12px * var(--fz));
  letter-spacing: 1px;
  text-transform: uppercase;
}
.btn-lg:active:not(:disabled) {
  padding-top: 8px;
  padding-bottom: 0;
}
.btn-xl {
  height: 40px;
  font-size: 24px;
  padding: 7px 22px 3px;
  letter-spacing: 1px;
}

/* Icon buttons: square, flat until hovered */
.ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  box-shadow: none;
}
.ibtn:hover {
  color: var(--brass-hi);
  background: rgba(255, 210, 122, 0.08);
  box-shadow: inset 0 0 0 1px var(--steel-lo);
}
.ibtn:active {
  background: rgba(0, 0, 0, 0.3);
}
.ibtn.on {
  color: var(--ink);
  background: var(--amber);
  box-shadow: inset 0 1px var(--brass-hi), inset 0 -1px var(--amber-dk), 0 0 0 1px var(--ink);
}

/* Text inputs */
.text-input,
.search-input,
.step-input,
select.select {
  display: block;
  width: 100%;
  height: 24px;
  padding: 4px 6px 2px;
  border: 2px solid transparent;
  border-image: var(--img-inset) 2 fill / 2px stretch;
  background: none;
  color: var(--text);
  user-select: text;
  -webkit-user-select: text;
  caret-color: var(--amber);
}
.text-input:focus,
.search-input:focus,
.step-input:focus {
  border-image-source: var(--img-inset-focus);
}
.text-input::placeholder,
.search-input::placeholder {
  color: var(--mute);
}
.text-input.big-input {
  height: 32px;
  font-size: 24px;
  line-height: 24px;
  padding: 4px 8px 2px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 120px;
}
.search .search-input {
  padding-left: 19px;
  padding-right: 20px;
}
.search .search-input::-webkit-search-cancel-button {
  display: none;
}
.search-g {
  position: absolute;
  left: 6px;
  top: 7px;
  color: var(--mute);
  pointer-events: none;
}
.search:focus-within .search-g {
  color: var(--amber);
}
.search-clear {
  position: absolute;
  right: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0;
  background: none;
  color: var(--mute);
}
.search-clear:hover {
  color: var(--brass-hi);
}
.search.has-text .search-clear {
  display: flex;
}

/* Toggle */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  min-height: 20px;
}
.tg-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.tg-track {
  position: relative;
  flex: none;
  width: 26px;
  height: 14px;
  background: var(--well);
  box-shadow: inset 1px 1px var(--ink), inset -1px -1px var(--steel-lo), 0 0 0 1px var(--ink);
}
.tg-knob {
  position: absolute;
  left: 1px;
  top: 1px;
  width: 12px;
  height: 12px;
  background: var(--steel-hi);
  box-shadow: inset 1px 1px var(--steel-hi2), inset -1px -1px var(--steel), 0 0 0 1px var(--ink);
  transition: left 80ms steps(3);
}
.tg-input:checked + .tg-track {
  background: #3a2a10;
}
.tg-input:checked + .tg-track .tg-knob {
  left: 13px;
  background: var(--amber);
  box-shadow: inset 1px 1px var(--brass-hi), inset -1px -1px var(--amber-dk), 0 0 0 1px var(--ink);
}
.tg-input:focus-visible + .tg-track {
  outline: 1px solid var(--amber);
  outline-offset: 2px;
}
.tg-text {
  display: flex;
  flex-direction: column;
}
.tg-hint {
  color: var(--mute);
}

/* Slider */
.slider {
  display: grid;
  grid-template-columns: 1fr 160px 48px;
  align-items: center;
  gap: 10px;
  min-height: 22px;
}
.sl-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 14px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.sl-input::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, var(--amber) 0 var(--fill, 0%), var(--well) var(--fill, 0%) 100%);
  box-shadow: inset 0 1px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--ink), 0 1px 0 1px var(--steel-lo);
}
.sl-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 14px;
  margin-top: -4px;
  background: var(--steel-hi);
  box-shadow: inset 1px 1px var(--steel-hi2), inset -1px -1px var(--steel), 0 0 0 1px var(--ink);
}
.sl-input:hover::-webkit-slider-thumb,
.sl-input:focus-visible::-webkit-slider-thumb {
  background: var(--brass-hi);
  box-shadow: inset 1px 1px #fff3cc, inset -1px -1px var(--brass), 0 0 0 1px var(--ink);
}
.sl-input:focus-visible {
  outline: none;
}
.sl-value {
  text-align: right;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
}

/* Segmented choice */
.seg {
  display: inline-flex;
  gap: 0;
  padding: 2px;
  background: var(--well);
  box-shadow: inset 1px 1px var(--ink), inset -1px -1px var(--steel-lo);
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 2px 10px 0;
  border: 0;
  background: transparent;
  color: var(--dim);
}
.seg-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.seg-btn.on {
  color: #1a0f04;
  background: var(--amber);
  box-shadow: inset 0 1px var(--brass-hi), inset 0 -1px var(--amber-dk), 0 0 0 1px var(--ink);
  text-shadow: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  padding: 0 4px;
  box-shadow: inset 0 -1px var(--ink);
}
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 3px 10px 0;
  border: 3px solid transparent;
  border-bottom-width: 1px;
  border-image: var(--img-tab) 3 3 1 fill / 3px 3px 1px stretch;
  background: none;
  color: var(--dim);
  margin-bottom: 0;
}
.tab:hover {
  border-image-source: var(--img-tab-hover);
  color: var(--text);
}
.tab.on {
  height: 24px;
  border-image: var(--img-tab-on) 3 3 0 fill / 3px 3px 0 stretch;
  border-bottom-width: 0;
  color: var(--brass-hi);
  padding-bottom: 1px;
}
.tab-badge {
  min-width: 12px;
  height: 11px;
  padding: 0 2px;
  font-size: calc(12px * var(--fz));
  line-height: calc(11px * var(--fz));
  color: var(--ink);
  background: var(--amber);
  text-align: center;
}
.tabs-v {
  flex-direction: column;
  align-items: stretch;
  box-shadow: inset -1px 0 var(--ink);
  padding: 4px 0;
}
.tabs-v .tab {
  justify-content: flex-start;
}

/* Progress bar */
.pbar {
  position: relative;
  height: 12px;
  background: var(--well);
  box-shadow: inset 1px 1px var(--ink), 0 0 0 1px var(--ink), 0 1px 0 1px var(--steel-lo);
  overflow: hidden;
}
.pb-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(180deg, var(--brass-hi) 0 1px, var(--amber) 1px 70%, var(--amber-dk) 70%);
  box-shadow: 1px 0 var(--ink);
}
.pb-cyan .pb-fill {
  background: linear-gradient(180deg, var(--cyan-hi) 0 1px, var(--cyan) 1px 70%, var(--cyan-dk) 70%);
}
.pb-violet .pb-fill {
  background: linear-gradient(180deg, var(--violet-hi) 0 1px, var(--violet) 1px 70%, var(--violet-dk) 70%);
}
.pb-teal .pb-fill {
  background: linear-gradient(180deg, #8affdc 0 1px, var(--teal) 1px 70%, var(--teal-dk) 70%);
}
.pb-red .pb-fill {
  background: linear-gradient(180deg, #ff9a8a 0 1px, var(--red) 1px 70%, #7a1a14 70%);
}
.pb-seg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--segs) - 1px), var(--ink) calc(100% / var(--segs) - 1px) calc(100% / var(--segs)));
}
.pb-text {
  position: absolute;
  inset: 0;
  text-align: center;
  line-height: calc(12px * var(--fz));
  color: #fff;
  text-shadow: 1px 0 var(--ink), -1px 0 var(--ink), 0 1px var(--ink), 0 -1px var(--ink);
  white-space: nowrap;
  z-index: 1;
}
.pbar.thin {
  height: 4px;
}
.pbar.thin .pb-fill {
  background: var(--amber);
}
.pbar.thin.pb-cyan .pb-fill {
  background: var(--cyan);
}
.pbar.thin.pb-violet .pb-fill {
  background: var(--violet);
}
.pbar.thin.pb-teal .pb-fill {
  background: var(--teal);
}

/* List */
.list {
  overflow-y: auto;
  overflow-x: hidden;
  border: 2px solid transparent;
  border-image: var(--img-inset) 2 fill / 2px stretch;
  padding: 1px;
}
.list:focus-visible {
  border-image-source: var(--img-inset-focus);
  outline: none;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 2px 6px;
  cursor: pointer;
  color: var(--text);
}
.list-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}
.list-row:hover {
  background: rgba(240, 168, 60, 0.08);
}
.list-row.sel {
  background: rgba(240, 168, 60, 0.18);
  box-shadow: inset 2px 0 var(--amber);
  color: var(--brass-hi);
}
.list-empty {
  padding: 16px;
  text-align: center;
  color: var(--mute);
}

/* Section header: engraved label with a rule */
.section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--steel-lo);
  box-shadow: 0 1px var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field-label {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.field-hint {
  color: var(--mute);
}
.field-error {
  min-height: 14px;
  color: var(--red);
  margin-top: 4px;
}

.stepper {
  display: inline-flex;
  align-items: center;
}
.stepper .step-input {
  width: 44px;
  text-align: center;
}
.step-btn {
  width: 18px;
  height: 24px;
  border: 0;
  padding: 0;
  background: var(--face2);
  color: var(--dim);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.step-btn:hover {
  color: var(--brass-hi);
}

/* Chips and badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
  padding: 1px 5px 0;
  background: var(--face2);
  color: var(--dim);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 0 0 1px var(--ink);
  white-space: nowrap;
}
.chip-amber {
  color: var(--ink);
  background: var(--amber);
  box-shadow: inset 0 1px var(--brass-hi), inset 0 -1px var(--amber-dk), 0 0 0 1px var(--ink);
}
.chip-cyan {
  color: var(--cyan);
  background: #0c2a32;
  box-shadow: inset 0 0 0 1px var(--cyan-dk), 0 0 0 1px var(--ink);
}
.chip-violet {
  color: var(--violet-hi);
  background: #1f0f30;
  box-shadow: inset 0 0 0 1px var(--violet-dk), 0 0 0 1px var(--ink);
}
.chip-teal {
  color: var(--teal);
  background: #0b2621;
  box-shadow: inset 0 0 0 1px var(--teal-dk), 0 0 0 1px var(--ink);
}
.chip-red {
  color: #ffb0a0;
  background: #3a120c;
  box-shadow: inset 0 0 0 1px #7a2a1a, 0 0 0 1px var(--ink);
}


/* ============================================================ 4 overlays */

.tooltip {
  position: absolute;
  z-index: 9000;
  max-width: calc(300px * var(--fz));
  min-width: 60px;
  padding: 5px 7px 6px;
  border: 2px solid transparent;
  border-image: var(--img-tip) 2 fill / 2px stretch;
  pointer-events: none;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tooltip.tt-gloam {
  border-image-source: var(--img-tip-gloam);
}
.tt-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 1px;
}
.tt-head .icon {
  width: 32px;
  height: 32px;
  background: var(--well);
  box-shadow: inset 1px 1px var(--ink), 0 0 0 1px var(--steel-lo);
}
.tt-titles {
  flex: 1;
  min-width: 0;
}
.tt-title {
  font-weight: 700;
  color: var(--brass-hi);
}
.tt-gloam .tt-title {
  color: var(--violet-hi);
}
.tt-sub {
  color: var(--dim);
}
.tt-tag {
  align-self: flex-start;
  padding: 1px 4px 0;
  background: var(--face2);
  color: var(--dim);
  box-shadow: 0 0 0 1px var(--ink);
}
.tt-text {
  color: var(--text);
  white-space: pre-line;
}
.tt-detail {
  color: var(--dim);
}
.tt-lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tt-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.tt-l {
  color: var(--dim);
}
.tt-v {
  color: var(--text);
  text-align: right;
}
.tt-line.good .tt-v {
  color: var(--good);
}
.tt-line.bad .tt-v {
  color: var(--bad);
}
.tt-line.cyan .tt-v {
  color: var(--cyan);
}
.tt-warn {
  color: var(--red);
}
.tt-sep {
  height: 1px;
  background: var(--steel-lo);
  margin: 1px -2px;
}
.tt-more {
  color: var(--mute);
}
.tt-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding-top: 3px;
  border-top: 1px solid var(--steel-lo);
  color: var(--dim);
}
.tt-key {
  display: flex;
  gap: 4px;
  align-items: center;
}

.toasts {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 8000;
}
.toast {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 4px;
  border: 2px solid transparent;
  border-image: var(--img-tip) 2 fill / 2px stretch;
  color: var(--text);
  text-shadow: 1px 1px 0 var(--ink);
  animation: toast-in 180ms steps(4);
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.toast .g {
  color: var(--brass);
}
.toast-good .g {
  color: var(--good);
}
.toast-warn .g {
  color: var(--amber);
}
.toast-gloam {
  border-image-source: var(--img-tip-gloam);
}
.toast-gloam .g {
  color: var(--violet-hi);
}
.toast-cyan .g {
  color: var(--cyan);
}
.toast-out {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 240ms steps(4), transform 240ms steps(4);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.modal-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 8, 0.6);
  background-image: var(--img-scan);
  z-index: 7000;
  pointer-events: auto;
  animation: fade-in 120ms steps(3);
}
.modal-back.modal-out {
  opacity: 0;
  transition: opacity 110ms steps(2);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.modal {
  min-width: 340px;
  max-width: min(640px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.5));
  animation: win-in 140ms steps(4);
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  margin: -1px -1px 0;
  padding: 0 10px;
  background: linear-gradient(180deg, #343941, #2a2e35);
  box-shadow: inset 0 1px var(--steel-hi), inset 0 -1px var(--brass-dk), 0 1px var(--ink);
  color: var(--brass-hi);
}
.modal-head h2 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--ink);
}
.modal-danger .modal-head {
  background: linear-gradient(180deg, #3a2448, #2a1838);
  box-shadow: inset 0 1px #7a4ab0, inset 0 -1px var(--violet-dk), 0 1px var(--ink);
  color: var(--violet-hi);
}
.modal-body {
  padding: 14px 14px 10px;
  overflow: auto;
}
.modal-text {
  color: var(--text);
  line-height: calc(16px * var(--fz));
  max-width: 460px;
}
.modal-text + .text-input {
  margin-top: 10px;
}
.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--ink);
  box-shadow: inset 0 1px var(--steel-lo);
}

.cmenu {
  position: absolute;
  z-index: 9500;
  min-width: 170px;
  padding: 3px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.5));
}
.cmenu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 1px 6px 0;
  border: 0;
  background: none;
  color: var(--text);
  text-align: left;
}
.cmenu-item .g {
  color: var(--brass);
}
.cmenu-item:hover:not(:disabled),
.cmenu-item:focus {
  background: rgba(240, 168, 60, 0.18);
  color: var(--brass-hi);
}
.cmenu-item:disabled {
  color: var(--mute);
}
.cmenu-item.danger {
  color: var(--violet-hi);
}
.cmenu-label {
  flex: 1;
}
.cmenu-sep {
  height: 1px;
  margin: 3px 2px;
  background: var(--steel-lo);
  box-shadow: 0 1px var(--ink);
}


/* ============================================================ 5 screens */

#screens {
  overflow: hidden;
}
.title-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  z-index: 0;
}
.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
body:not(.ready) .screen {
  visibility: hidden;
}

/* login */
.login-screen {
  align-items: center;
  justify-content: center;
}
.login-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.login-panel {
  width: 380px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.45));
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  margin: -1px -1px 0;
  padding: 0 10px;
  background: linear-gradient(180deg, #343941, #2a2e35);
  box-shadow: inset 0 1px var(--steel-hi), inset 0 -1px var(--brass-dk), 0 1px var(--ink);
  color: var(--brass-hi);
}
.panel-head h2 {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 var(--ink);
}
.panel-body {
  padding: 16px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-actions {
  margin-top: 2px;
}
.upper {
  text-transform: uppercase;
}
.login-status {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--ink);
  box-shadow: inset 0 1px var(--steel-lo);
  color: var(--mute);
  display: flex;
  align-items: center;
  gap: 6px;
}
.login-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--mute);
  box-shadow: 0 0 0 1px var(--ink);
}
.login-status.st-online::before {
  background: var(--teal);
}
.login-status.st-connecting::before {
  background: var(--amber);
  animation: blink 0.6s steps(2) infinite;
}


/* create dialog */
.create-modal {
  width: 640px;
}
.create-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cf-row {
  display: flex;
  gap: 14px;
}
.cf-name {
  flex: 1;
}
.cf-seed {
  width: 200px;
}
.cf-seed .row {
  gap: 4px;
}
.diff-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.diff-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px 10px;
  border: 2px solid transparent;
  border-image: var(--img-slot) 2 fill / 2px stretch;
  background: none;
  text-align: left;
  color: var(--dim);
  min-height: 132px;
}
.diff-card:hover {
  border-image-source: var(--img-slot-hover);
}
.diff-card.on {
  border-image-source: var(--img-slot-sel);
  color: var(--text);
}
.diff-card.on::after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: -2px;
  height: 2px;
  background: var(--amber);
}
.dc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.dc-name {
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.diff-card.on .dc-name {
  color: var(--brass-hi);
}
.dc-tag {
  margin-left: auto;
  padding: 1px 4px 0;
  color: var(--ink);
  background: var(--teal);
  box-shadow: inset 0 1px #8affdc, 0 0 0 1px var(--ink);
}
.dc-pips {
  display: inline-flex;
  gap: 2px;
}
.dc-pip {
  width: 4px;
  height: 8px;
  background: var(--steel-lo);
  box-shadow: 0 0 0 1px var(--ink);
}
.dc-casual .dc-pip.on {
  background: var(--teal);
}
.dc-standard .dc-pip.on {
  background: var(--amber);
}
.dc-hard .dc-pip.on {
  background: var(--violet);
}
.dc-short {
  color: var(--brass);
}
.dc-hard .dc-short {
  color: var(--violet-hi);
}
.dc-casual .dc-short {
  color: var(--teal);
}
.dc-text {
  line-height: calc(15px * var(--fz));
  color: var(--dim);
}


/* ============================================================ 5 screens (lobby look) */
.login-screen {
  background: radial-gradient(ellipse at 50% 35%, #1a3442 0%, #0e1a22 60%, #0a1218 100%);
}
.brand {
  text-align: center;
}
.brand-title {
  font: 700 48px/52px var(--font);
  color: var(--brass-hi);
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 var(--ink);
}
.brand-sub {
  margin-top: 6px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 2px;
}
.brand-tag {
  margin-top: 4px;
  color: var(--dim);
}

/* lobby */
.lobby-screen {
  background: radial-gradient(ellipse at 50% 20%, #15303e 0%, #0e1a22 55%, #0a1218 100%);
}
.lobby-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
}
.lobby-brand {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lobby-who {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lobby-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 16px 10px;
}
.lobby-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.lobby-title {
  margin: 0;
  font: 700 24px/26px var(--font);
  color: var(--brass-hi);
  text-shadow: 2px 2px 0 var(--ink);
}
.city-grid {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  align-content: start;
  gap: 12px;
  padding: 2px;
}
.city-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 12px;
  outline: none;
}
.city-card:focus-visible {
  box-shadow: 0 0 0 2px var(--amber);
}
.cc-top {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.cc-titles {
  flex: 1;
  min-width: 0;
}
.cc-title {
  margin: 0 0 6px;
  font: 700 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cc-stats {
  display: flex;
  gap: 16px;
}
.cc-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cc-warn {
  font-size: calc(12px * var(--fz));
}
.cc-foot {
  display: flex;
  align-items: center;
}
.lobby-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 0;
  color: var(--dim);
}
.lobby-foot {
  padding-top: 8px;
  text-align: center;
}
.chip.diff-casual {
  color: #b8ffe6;
  background: var(--teal-dk);
}
.chip.diff-standard {
  color: var(--brass-hi);
  background: var(--brass-dk);
}
.chip.diff-hard {
  color: #f0d4ff;
  background: var(--violet-dk);
}
.fold {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--brass);
  cursor: pointer;
}
.fold .g {
  transition: transform 0.12s;
}
.fold.open .g {
  transform: rotate(90deg);
}
.cf-advanced {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--brass-dk);
}
.cf-advanced[hidden] {
  display: none;
}
.delete-modal .text-input {
  width: 100%;
}
/* ============================================================ 7 help viewer */
.help-modal {
  width: min(820px, calc(100vw - 32px));
}
.help-view {
  display: flex;
  gap: 14px;
  min-height: 320px;
  /* vh inside the zoomed #ui layer: divide by the UI scale, or the window grows past the screen at 1.5x (M10 U21) */
  max-height: calc(62vh / var(--ui-scale, 1));
}
.help-nav {
  flex: none;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--p-slate1) transparent;
}
.help-nav.more-down {
  mask-image: linear-gradient(#000 calc(100% - 36px), transparent);
}
.help-nav.more-up {
  mask-image: linear-gradient(transparent, #000 36px);
}
.help-nav.more-up.more-down {
  mask-image: linear-gradient(transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
.help-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  color: var(--dim);
  text-align: left;
  cursor: pointer;
}
.help-link:hover,
.help-link.on {
  background: var(--face2);
  color: var(--text);
}
.help-link.on .help-link-title {
  color: var(--brass-hi);
}
.help-link-title {
  font-weight: 700;
}
.help-link-blurb {
  color: var(--mute);
}
.help-body {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding-right: 6px;
}
.help-title {
  margin: 0 0 10px;
  font: 700 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  color: var(--brass-hi);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.help-p {
  margin: 0 0 10px;
  line-height: calc(16px * var(--fz));
}
.help-tip {
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
  padding: 6px 8px;
  background: rgba(47, 199, 160, 0.12);
  color: #b8ffe6;
  line-height: calc(16px * var(--fz));
}
.help-keys {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 10px;
  align-items: center;
}
.help-key {
  display: contents;
}
.gloss-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.gloss-item.on {
  outline: 1px solid var(--amber);
}
.gloss-term {
  font-weight: 700;
  color: var(--brass-hi);
}
.gloss-text {
  color: var(--dim);
  line-height: calc(16px * var(--fz));
}

/* ============================================================ 8 accessibility */
:root[data-fx='minimal'] *,
:root[data-fx='minimal'] *::before,
:root[data-fx='minimal'] *::after {
  transition: none !important;
  animation: none !important;
}

/* settings window */
.menu-modal {
  width: min(620px, calc(100% - 32px));
}
.menu-pagebody {
  min-height: 260px;
}
.menu-page {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menu-row {
  flex-wrap: wrap;
}
.menu-row .menu-label {
  min-width: 110px;
}
.menu-keys2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 14px;
}
.key-btn {
  min-width: 56px;
  cursor: pointer;
}
.key-btn.wait {
  color: var(--p-goldhi);
  box-shadow: inset 0 0 0 1px var(--p-gold);
}
.menu-key.fixed .kbd {
  opacity: 0.6;
}
/* ---------------------------------------------------------------- M10 lobby: map thumbnail, Ziele, start choice */
.cc-body {
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.cc-thumb {
  flex: none;
  width: 96px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b1a22;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.cc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cc-thumb-year {
  font: 700 18px/20px var(--font);
  color: var(--dim);
}
.cc-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}
.cc-meters {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ccm {
  display: grid;
  grid-template-columns: 76px 1fr 22px;
  align-items: center;
  gap: 6px;
}
.ccm-name {
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccm-bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.ccm-fill {
  display: block;
  height: 100%;
  background: var(--p-slate1);
}
.ccm-fill.good {
  background: var(--p-green);
}
.ccm-fill.warn {
  background: var(--p-gold);
}
.ccm-fill.bad {
  background: #e0604a;
}
.ccm-v {
  text-align: right;
  color: var(--text);
}
.cc-stats {
  flex-wrap: wrap;
  gap: 4px 14px;
}
.start-cols {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
}
.sc-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sc-head {
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.start-card {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 4px 6px;
  border: 2px solid transparent;
  border-image: var(--img-slot) 2 fill / 2px stretch;
  background: none;
  color: var(--dim);
  text-align: left;
}
.start-card:hover {
  border-image-source: var(--img-slot-hover);
}
.start-card.on {
  border-image-source: var(--img-slot-sel);
  color: var(--text);
}
.sc-year {
  flex: none;
  color: var(--brass-hi);
}
.sc-name {
  min-width: 0;
}
.sc-desc {
  margin-top: 6px;
  color: var(--dim);
  min-height: 14px;
}
@media (max-width: 700px) {
  .start-cols,
  .diff-cards {
    grid-template-columns: 1fr;
  }
  .diff-card {
    min-height: 0;
  }
  .create-modal {
    width: calc(100vw - 16px);
  }
  .city-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- M10 status screens (loading, connection, version, error) */
.status-screen {
  position: fixed;
  inset: 0;
  z-index: 9800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, #15303e 0%, #0e1a22 60%, #0a1218 100%);
  pointer-events: auto;
  animation: st-in 160ms ease-out;
}
.st-conn,
.st-version,
.st-error {
  background: rgba(6, 12, 16, 0.82);
}
.status-screen.st-out {
  opacity: 0;
  transition: opacity 180ms ease-in;
}
@keyframes st-in {
  from {
    opacity: 0;
  }
}
.st-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(640px, 100%);
  text-align: center;
}
.st-small {
  width: min(440px, 100%);
  padding: 16px 18px;
  background: var(--p-ink, #10161b);
  box-shadow: 0 0 0 2px #2b3a44, 0 6px 0 rgba(0, 0, 0, 0.4);
}
.st-scene {
  width: 100%;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px #000, 0 4px 0 rgba(0, 0, 0, 0.35);
}
.st-title {
  font: 700 18px/20px var(--font);
  color: var(--brass-hi);
  text-shadow: 2px 2px 0 var(--ink);
  overflow-wrap: anywhere;
}
.st-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font: 700 calc(14px * var(--fz)) / calc(16px * var(--fz)) var(--font);
  color: var(--brass-hi);
}
.st-bar {
  width: min(320px, 80%);
  height: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.st-bar-fill {
  display: block;
  width: 30%;
  height: 100%;
  background: var(--amber);
  animation: st-bar 1.1s ease-in-out infinite alternate;
}
@keyframes st-bar {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(340%);
  }
}
.st-sub {
  color: var(--text);
}
.st-text,
.st-tip {
  margin: 0;
  color: var(--dim);
  line-height: calc(15px * var(--fz));
  max-width: 520px;
}
.st-tip-k {
  color: var(--brass-hi);
}
.st-detail {
  max-width: 100%;
  margin: 0;
  padding: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #f0a090;
  background: rgba(0, 0, 0, 0.35);
}
.st-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
:root[data-fx='minimal'] .st-bar-fill,
:root[data-fx='reduced'] .st-bar-fill {
  animation: none;
  width: 100%;
  opacity: 0.6;
}

/* colour-blind palette (settings): good / bad meters as blue / magenta, never green / red alone */
:root:not([data-cb='off']) .m-good .gg-fill,
:root:not([data-cb='off']) .akz-fill.m-good,
:root:not([data-cb='off']) .rp-land-fill.c-green {
  background: linear-gradient(180deg, #b8e0f5 0 1px, #4e9fc8 1px 4px, #2a6a90 4px);
}
:root:not([data-cb='off']) .m-bad .gg-fill,
:root:not([data-cb='off']) .akz-fill.m-bad,
:root:not([data-cb='off']) .rp-land-fill.c-red {
  background: linear-gradient(180deg, #f5b8de 0 1px, #d04aa0 1px 4px, #8a2468 4px);
}
:root:not([data-cb='off']) .gg-arrow.up,
:root:not([data-cb='off']) .pg-row.up .pg-to,
:root:not([data-cb='off']) .fx-good .fx-val {
  color: #7fc4ef;
}
:root:not([data-cb='off']) .gg-arrow.down,
:root:not([data-cb='off']) .pg-row.down .pg-to,
:root:not([data-cb='off']) .fx-bad .fx-val {
  color: #f08ad0;
}
/* reduced motion: short, no looping */
:root[data-fx='reduced'] *,
:root[data-fx='reduced'] *::before,
:root[data-fx='reduced'] *::after {
  animation-duration: 1ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 1ms !important;
}

/* ============================================================ 11 Stadtwerk game screen (M0) */
/* the top bar (PLAN §D8): city name left, clock and speed in the middle, city money and the menu right */
.topbar {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: auto !important;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 10px;
  pointer-events: auto;
}
.tb-left,
.tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tb-right {
  justify-content: flex-end;
}
.tb-title {
  font-weight: 700;
  color: var(--brass-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-mid {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-clock {
  min-width: 150px;
  padding: 3px 8px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
  background: rgba(7, 8, 10, 0.55);
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.tb-speeds {
  display: flex;
  gap: 2px;
}
.tb-speed,
.tb-icon {
  min-width: 28px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  color: var(--dim);
  font: 700 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  background: rgba(7, 8, 10, 0.45);
  box-shadow: inset 0 0 0 1px #2a2f3a;
  cursor: pointer;
}
.tb-speed:hover,
.tb-icon:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.tb-speed.on {
  color: var(--ink);
  background: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass-hi);
}
.tb-money {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.tb-paused {
  position: absolute;
  left: 50%;
  top: 44px;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%);
  padding: 3px 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brass-hi);
  background: rgba(7, 8, 10, 0.6);
  pointer-events: none !important;
}
.tile-readout {
  position: absolute;
  left: 8px;
  right: auto !important;
  top: auto !important;
  bottom: 8px;
  padding: 2px 6px;
  color: var(--dim);
  background: rgba(7, 8, 10, 0.5);
  pointer-events: none !important;
}
.tile-readout:empty {
  display: none;
}
/* the new-city dialog: map choice + seed */
.cf-seed .row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.cf-mapdesc {
  margin-top: 4px;
  min-height: 28px;
}
.cc-stats .cc-v {
  margin-left: auto;
}

/* ============================================================ 12 Stadtwerk game UI (M3) */
/* layout at the 1280 x 720 UI reference: top bar 36, toolbar left (44 wide), dock right (300), info-view strip and
   tool options at the bottom, legend top-left next to the toolbar. Containers never take the pointer; their cards do. */
.topbar {
  z-index: 20;
}
.tb-left {
  gap: 8px;
}
.tb-mid {
  gap: 6px;
}
.tb-clock {
  border: 0;
  font: 700 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  cursor: pointer;
}
.tb-clock:hover {
  box-shadow: inset 0 0 0 1px var(--brass);
}
.tier-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  min-width: 70px;
  padding: 2px 6px 3px;
  border: 0;
  color: var(--brass-hi);
  font: 700 calc(12px * var(--fz)) / calc(12px * var(--fz)) var(--font);
  background: rgba(7, 8, 10, 0.45);
  box-shadow: inset 0 0 0 1px #2a2f3a;
  cursor: pointer;
}
.tier-badge:hover {
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.tier-bar,
.pk-bar,
.mbar {
  position: relative;
  display: block;
  height: 3px;
  background: var(--ink);
  box-shadow: 0 0 0 1px #2a2f3a;
}
.tier-fill,
.pk-fill,
.mbar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: var(--brass);
}
.tb-plan {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  color: var(--dim);
  font: 700 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  background: rgba(7, 8, 10, 0.45);
  box-shadow: inset 0 0 0 1px #2a2f3a;
  cursor: pointer;
}
.tb-plan:hover {
  color: var(--text);
}
.tb-plan.on {
  color: #021a20;
  background: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--cyan-hi);
}
.tb-paused.plan {
  color: var(--cyan-hi);
  box-shadow: inset 0 0 0 1px var(--cyan-dk);
}
.hud-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  color: var(--text);
  font: 700 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  white-space: nowrap;
  background: rgba(7, 8, 10, 0.35);
  box-shadow: inset 0 0 0 1px #23262d;
  cursor: pointer;
}
.hud-item:hover {
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.hud-item .g {
  color: var(--brass);
}
.hud-item.neg .hv-v {
  color: var(--bad);
}
.hi-wl {
  max-width: 230px;
}
.hi-wl .wl-wish {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dim);
  font-weight: 400;
}
.hi-wl.warn .wl-wish {
  color: var(--amber);
}
.hi-wl.warn .g {
  color: var(--amber);
}
.hi-peak {
  color: var(--dim);
}
.hi-peak .g {
  color: #e0a64a;
}
.pk-bar {
  width: 34px;
}
.pk-label {
  font-weight: 400;
}

/* left toolbar */
.toolbar {
  position: absolute;
  left: 6px;
  top: 44px;
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  z-index: 12;
}
.tb-groups {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tg-btn {
  position: relative;
  width: 36px;
  height: 34px;
  border: 0;
  color: var(--dim);
  background: rgba(7, 8, 10, 0.35);
  box-shadow: inset 0 0 0 1px #23262d;
  cursor: pointer;
}
.tg-btn:hover {
  color: var(--brass-hi);
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.tg-btn.open {
  color: var(--brass-hi);
  background: var(--face3);
  box-shadow: inset 0 0 0 1px var(--brass);
}
.tg-btn.on {
  color: var(--ink);
  background: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass-hi), inset 0 -2px 0 var(--brass-dk);
}
.tg-btn.locked {
  opacity: 0.4;
  filter: grayscale(1);
}
.tg-btn.locked::after {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 5px;
  height: 5px;
  background: var(--mute);
}
.tg-small {
  height: 24px;
}
.tg-btn.dim {
  opacity: 0.4;
}
.tb-sep {
  width: 28px;
  height: 2px;
  margin: 3px 0;
  background: var(--steel-lo);
}

/* fly-out */
.flyout {
  position: absolute;
  left: 54px;
  top: 44px;
  width: 248px;
  max-height: calc(100% - 100px);
  overflow-y: auto;
  padding: 4px;
  z-index: 13;
}
.fl-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 5px;
  color: var(--brass-hi);
  font-weight: 700;
  border-bottom: 1px solid var(--steel-lo);
  margin-bottom: 3px;
}
.fl-title {
  flex: 1;
}
.fl-sub {
  padding: 5px 4px 2px;
  color: var(--mute);
  font-size: calc(12px * var(--fz));
  text-transform: uppercase;
  letter-spacing: 1px;
}
.fl-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  height: 24px;
  padding: 0 6px;
  border: 0;
  color: var(--text);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  text-align: left;
  background: none;
  cursor: pointer;
}
.fl-item:hover {
  background: rgba(240, 168, 60, 0.1);
  color: var(--brass-hi);
}
.fl-item.on {
  background: rgba(240, 168, 60, 0.18);
  color: var(--brass-hi);
  box-shadow: inset 2px 0 0 var(--brass);
}
.fl-item.locked {
  color: var(--mute);
  cursor: default;
}
.fl-item .g {
  color: var(--brass);
}
.fl-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fl-cost {
  color: var(--dim);
}
.fl-sw {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  box-shadow: 0 0 0 1px var(--ink);
}

/* tool options bar + plan bar + info-view strip (bottom) */
.bcol {
  position: absolute;
  left: 58px;
  right: 312px;
  bottom: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none !important;
  z-index: 11;
}
.bcol > * {
  pointer-events: auto;
}
.bottom-row {
  align-self: stretch;
  display: flex;
  justify-content: flex-start;
  pointer-events: none !important;
}
.tool-opts {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 2px 6px;
}
.to-head {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-right: 8px;
  border-right: 1px solid var(--steel-lo);
  color: var(--brass-hi);
  font-weight: 700;
  white-space: nowrap;
}
.to-body {
  display: flex;
  align-items: center;
  min-width: 0;
}
.to-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.to-label {
  color: var(--mute);
}
.to-hint {
  color: var(--mute);
  white-space: nowrap;
}
.to-gap {
  width: 4px;
}
.to-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.to-segb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border: 0;
  color: var(--dim);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  background: var(--face2);
  cursor: pointer;
  white-space: nowrap;
}
.to-segb:hover:not(:disabled) {
  color: var(--text);
  background: var(--face3);
}
.to-segb.on {
  color: var(--ink);
  background: var(--brass);
}
.to-segb:disabled {
  color: var(--mute);
  cursor: default;
}
.to-dists .to-segb {
  max-width: 120px;
}
.to-dists .to-segb span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.to-status {
  max-width: 260px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--dim);
}
.to-status:empty {
  display: none;
}
.st-rej {
  display: flex;
  align-items: center;
  max-width: 100%;
  color: #ffb0a0;
}
.st-rej > span:not(.g) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-rej .g {
  color: var(--bad);
  flex: none;
  margin-right: 4px;
}
.to-esc {
  margin-left: auto;
}
.tool-opts .stepper .step-input {
  width: 28px;
  height: 20px;
}
.tool-opts .step-btn {
  height: 20px;
}

.plan-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  color: var(--cyan-hi);
}
.pl-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pl-sum {
  color: var(--text);
}
.pl-warn {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #ffb0a0;
}
.pl-warn:empty {
  display: none;
}

.views {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 2px;
  pointer-events: auto;
}
.vw-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border: 0;
  color: var(--dim);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  background: rgba(7, 8, 10, 0.4);
  cursor: pointer;
  white-space: nowrap;
}
.vw-btn:hover:not(:disabled) {
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.vw-btn.on {
  color: var(--ink);
  background: var(--brass);
}
.vw-btn:disabled {
  opacity: 0.4;
}
.vw-key {
  color: var(--mute);
  font-size: calc(12px * var(--fz));
}
.vw-btn.on .vw-key {
  color: var(--brass-dk);
}

/* legend of the active info view (top left, next to the toolbar) */
.legend {
  position: absolute;
  left: 58px;
  top: 44px;
  width: 210px;
  padding: 4px 6px 5px;
  z-index: 10;
}
.lg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
  color: var(--brass-hi);
  font-weight: 700;
}
.lg-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 260px;
  overflow-y: auto;
}
.lg-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 14px;
}
.lg-sw {
  flex: none;
  width: 14px;
  height: 10px;
  box-shadow: 0 0 0 1px var(--ink);
}
.lg-na {
  background: repeating-linear-gradient(45deg, #3b4049 0 2px, transparent 2px 4px) !important;
}
.lg-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

/* cursor readout */
.cursor-info {
  position: absolute;
  min-width: 140px;
  max-width: 260px;
  padding: 4px 7px 5px;
  pointer-events: none !important;
  z-index: 30;
}
.cursor-info.bad {
  border-image-source: var(--img-tip-gloam);
}
.ci-title {
  color: var(--brass-hi);
  font-weight: 700;
}
.ci-text {
  color: var(--dim);
}
.ci-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.ci-line span:first-child {
  color: var(--dim);
}
.ci-cost .ci-v {
  color: var(--brass-hi);
  font-weight: 700;
}
.ci-rej {
  display: flex;
  gap: 5px;
  margin-top: 3px;
  color: #ffb0a0;
}
.ci-rej .g {
  color: var(--bad);
  margin-top: 2px;
}
.ci-fix {
  color: var(--text);
  padding-left: 14px;
}

/* right column: dock + minimap */
.rcol {
  position: absolute;
  right: 6px;
  top: 44px;
  bottom: 6px;
  width: calc(300px * var(--fz));
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none !important;
  z-index: 11;
}
.dock {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none !important;
}
.dock-tabs {
  display: flex;
  gap: 2px;
  pointer-events: auto;
}
.dock-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  height: 20px;
  padding: 0 6px;
  border: 0;
  color: var(--dim);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  background: rgba(7, 8, 10, 0.6);
  cursor: pointer;
}
.dock-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dock-tab.on {
  color: var(--brass-hi);
  background: var(--face2);
  box-shadow: inset 0 2px 0 var(--brass);
}
.dock-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  pointer-events: auto;
}
.dock-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 2px 4px;
  border-bottom: 1px solid var(--steel-lo);
}
.dock-icon .g {
  color: var(--brass);
}
.dock-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brass-hi);
  font-weight: 700;
}
.dock-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 2px 2px;
}
.minimap {
  position: relative;
  flex: none;
  align-self: flex-end;
  width: 196px;
  height: 196px;
  pointer-events: auto;
}
.mm-canvas,
.mm-view {
  position: absolute;
  left: 0;
  top: 0;
  width: 192px;
  height: 192px;
  image-rendering: pixelated;
}
.mm-view {
  cursor: pointer;
}

/* panel content */
.pn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--steel-lo);
  color: var(--brass);
  font-size: calc(12px * var(--fz));
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pn-head .help-btn {
  margin: -3px 0;
}
.pn-empty {
  padding: 16px 6px;
  color: var(--mute);
  text-align: center;
}
.pn-note {
  display: flex;
  gap: 6px;
  margin: 3px 0;
  padding: 4px 6px;
  color: var(--text);
  background: rgba(79, 227, 255, 0.06);
  box-shadow: inset 2px 0 0 var(--cyan-dk);
}
.pn-note .g {
  flex: none;
  margin-top: 2px;
  color: var(--cyan);
}
.pn-note.note-warn {
  background: rgba(240, 168, 60, 0.08);
  box-shadow: inset 2px 0 0 var(--amber-dk);
}
.pn-note.note-warn .g {
  color: var(--amber);
}
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 17px;
}
.kv-k {
  color: var(--dim);
  white-space: nowrap;
}
.kv-v {
  min-width: 0;
  text-align: right;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kv.warn .kv-v {
  color: var(--amber);
}
.kv-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mbar {
  width: 60px;
  height: 5px;
}
.mbar-fill.good {
  background: var(--good);
}
.mbar-fill.bad {
  background: var(--bad);
}
.pill {
  display: inline-block;
  padding: 1px 5px 0;
  color: var(--dim);
  background: var(--face2);
  box-shadow: 0 0 0 1px var(--ink);
  white-space: nowrap;
}
.pill-ok {
  color: #bff0a8;
  background: #16301a;
  box-shadow: inset 0 0 0 1px #2c5c2a;
}
.pill-bad {
  color: #ffb0a0;
  background: #3a120c;
  box-shadow: inset 0 0 0 1px #7a2a1a;
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}
.btn.dim {
  opacity: 0.5;
}
.btn-cost {
  color: var(--dim);
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 0;
  border: 0;
  color: var(--brass-hi);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  background: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mute {
  color: var(--mute);
}
.insp-where {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--mute);
}
.insp-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 4px 0 4px;
}
.it-name {
  color: var(--text);
  font-weight: 700;
}
.causes {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 2px 0 0;
}
.cause {
  display: flex;
  gap: 6px;
  color: var(--dim);
}
.cause .cs {
  width: 8px;
  text-align: center;
  font-weight: 700;
}
.cause.up .cs {
  color: var(--good);
}
.cause.down .cs {
  color: var(--bad);
}

/* Waiting List */
.wl-tot {
  padding: 2px 0 2px;
}
.wcard {
  margin: 4px 0 6px;
  padding: 5px 7px 6px;
  background: rgba(7, 8, 10, 0.4);
  box-shadow: inset 0 0 0 1px var(--steel-lo);
}
.wcard.has-why {
  box-shadow: inset 0 0 0 1px var(--steel-lo), inset 2px 0 0 var(--amber);
}
.wc-who {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--text);
  font-weight: 700;
}
.wc-who .g {
  color: var(--brass);
}
.wc-line {
  display: flex;
  gap: 6px;
}
.wc-k {
  flex: none;
  width: 76px;
  color: var(--mute);
}
.wc-d {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.wc-miss {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
}
.wc-miss .g {
  margin-top: 2px;
}
.wc-miss.bad {
  color: var(--amber);
}
.wc-miss.ok {
  color: var(--good);
}
.wc-fix {
  padding-left: 15px;
  color: var(--text);
}
.wc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 5px;
}

/* district panel */
.dp-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 4px;
}
.dp-sw {
  flex: none;
  width: 12px;
  height: 12px;
  box-shadow: 0 0 0 1px var(--ink);
}
.dp-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 700;
}
.dp-title .to-gap {
  flex: 1;
}
.prof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
}
.prof-grid.small .prof-card {
  min-height: 20px;
  padding: 2px 5px;
}
.prof-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-height: 34px;
  padding: 4px 6px;
  border: 0;
  color: var(--text);
  font: 400 calc(12px * var(--fz)) / calc(14px * var(--fz)) var(--font);
  text-align: left;
  background: var(--face2);
  box-shadow: inset 0 0 0 1px var(--ink);
  cursor: pointer;
}
.prof-card:hover:not(:disabled) {
  background: var(--face3);
  box-shadow: inset 0 0 0 1px var(--brass-dk);
}
.prof-card.on {
  color: var(--ink);
  background: var(--brass);
  box-shadow: inset 0 0 0 1px var(--brass-hi);
}
.prof-card.on .pc-mix {
  color: var(--brass-dk);
}
.prof-card.locked {
  color: var(--mute);
}
.prof-card:disabled {
  cursor: default;
}
.pc-name {
  font-weight: 700;
}
.pc-mix {
  color: var(--dim);
}
.mix {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mix-tri {
  width: 132px;
  height: 116px;
  cursor: crosshair;
  image-rendering: pixelated;
}
.mix-legend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--dim);
}
.mix-v {
  margin-top: 4px;
  color: var(--brass-hi);
  font-weight: 700;
}
.to-seg-wrap {
  margin: 2px 0;
}
.pol {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 2px 0;
}
.pol-name {
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pol.locked .pol-name {
  color: var(--mute);
}
.char {
  display: flex;
  align-items: center;
  gap: 6px;
}
.char-hex {
  width: 132px;
  height: 132px;
}
.char-rows {
  flex: 1;
}
.char-row {
  display: flex;
  gap: 4px;
}
.char-row span:first-child {
  flex: 1;
  color: var(--dim);
}
.char-v {
  width: 22px;
  text-align: right;
}
.char-d {
  width: 26px;
  text-align: right;
  color: var(--mute);
}
.char-d.up {
  color: var(--good);
}
.char-d.down {
  color: var(--bad);
}

/* new-district dialog */
.newdist-modal {
  width: 560px;
}
.newdist {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.newdist .prof-grid {
  grid-template-columns: 1fr 1fr 1fr;
}
.prof-desc {
  min-height: 58px;
  padding: 5px 7px;
  background: rgba(7, 8, 10, 0.4);
  box-shadow: inset 0 0 0 1px var(--steel-lo);
}
.pd-title {
  color: var(--brass-hi);
  font-weight: 700;
}
.pd-text {
  color: var(--text);
}
.pd-mix {
  margin-top: 2px;
  color: var(--dim);
}

/* agenda stub */
.ag-item {
  display: flex;
  gap: 6px;
  margin: 3px 0;
  padding: 4px 6px;
  background: rgba(7, 8, 10, 0.4);
}
.ag-item .g {
  margin-top: 2px;
  color: var(--cyan);
}
.ag-item.sev-warn .g {
  color: var(--amber);
}
.ag-item.sev-severe .g {
  color: var(--bad);
}
.ag-fix {
  color: var(--dim);
}

/* glossary terms inside texts (ui/lexlink.js): an inline button with a dotted underline */
.lx-u {
  display: inline;
  padding: 0;
  border: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  background: none;
  text-decoration: underline dotted var(--brass);
  text-underline-offset: 3px;
  cursor: help;
}
.lx-u:hover {
  color: var(--brass-hi);
}
