/* src/ui/fonts.css */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 400; font-display: swap; src: url(fonts/fraunces-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 600; font-display: swap; src: url(fonts/fraunces-latin-600-normal.woff2) format('woff2'); }

/* src/ui/theme.css */
/* Design tokens. The look is CDE / Motif: every surface is a "colour set" of a
   background, a lighter top shadow, a darker bottom shadow and a select colour,
   and depth comes from two-pixel bevels rather than blur or drop shadows.
   The palette is a dusk take on it: slate chrome, cream text, amber for whatever is active. */
:root {
  /* set 1: window chrome and controls */
  --c-bg: #5d6780;  --c-ts: #8e98b1;  --c-bs: #2b3144;  --c-sel: #4a5369;  --c-fg: #f3edda;
  /* set 2: the active window's frame and title bar */
  --a-bg: #b8763f;  --a-ts: #e2a970;  --a-bs: #6a3f1b;  --a-sel: #975c2c;  --a-fg: #fff7e3;
  /* set 3: inactive title bars, the front panel, secondary chrome */
  --p-bg: #4b5468;  --p-ts: #7a849c;  --p-bs: #232838;  --p-sel: #3b4356;  --p-fg: #dcd6c4;
  /* set 4: sunken wells: lists, readouts, text fields */
  --w-bg: #171b28;  --w-ts: #2c3346;  --w-bs: #0a0c13;  --w-sel: #2a3a58;  --w-fg: #d9e1ea;
  /* set 5: the accent, for default buttons and progress */
  --k-bg: #4f9a94;  --k-ts: #8fd0c8;  --k-bs: #224f4b;  --k-sel: #3c7c77;  --k-fg: #f4fffb;

  --good: #86c98a;  --warn: #e6bd58;  --bad: #e27a6c;  --dim: #9aa3b8;  --amber: #f0b060;
  --e-electric: #f2c14e;  --e-plasma: #ff7a59;  --e-gravitic: #9d8cff;  --e-vacuum: #6fe3d2;
  /* item tile colours by category */
  --cat-raw: #a6815b;  --cat-mat: #6f8fb3;  --cat-comp: #7f9a6b;  --cat-kit: #b98bc4;  --cat-data: #d8b25a;

  --bevel: 2px;
  --font-ui: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'DejaVu Sans Mono', Consolas, monospace;
  --font-log: 'Fraunces', Georgia, serif;
  --space: #080a12;
}
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--space); }
#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * { pointer-events: auto; }

/* src/gfx/labels.css */
/* Name tags on the map. Small Motif tags: flat fill, one-pixel bevel, no blur. */
.df-label {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: baseline; gap: 7px;
  padding: 2px 7px 3px;
  font: 500 calc(11px * var(--ui-scale, 1))/1.3 var(--font-ui);
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--p-fg);
  background: var(--p-bg);
  border: 1px solid;
  border-color: var(--p-ts) var(--p-bs) var(--p-bs) var(--p-ts);
  box-shadow: 0 0 0 1px #07080e;
  opacity: 0;
  transition: opacity 0.16s linear;
  will-change: transform, opacity;
  user-select: none;
}
.df-label.on { opacity: 1; }
.df-label b { font-weight: 600; }
.df-label i { font: 400 calc(10px * var(--ui-scale, 1))/1.3 var(--font-mono); font-style: normal; color: var(--dim); }
/* a short leader back towards the object */
.df-label::before {
  content: ''; position: absolute; top: 50%; left: -9px; width: 7px; height: 0;
  border-top: 1px solid var(--p-ts);
}
.df-label--flip::before { left: auto; right: -9px; }

.df-label--sel {
  color: var(--a-fg); background: var(--a-bg);
  border-color: var(--a-ts) var(--a-bs) var(--a-bs) var(--a-ts);
  z-index: 3;
}
.df-label--sel i { color: #ffe3bd; }
.df-label--sel::before { border-top-color: var(--a-ts); }

.df-label--hov { background: var(--c-bg); border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); color: var(--c-fg); z-index: 2; }
.df-label--hov i { color: #cdd3e2; }

.df-label--dest { background: var(--w-bg); border-color: var(--w-bs) var(--w-ts) var(--w-ts) var(--w-bs); color: var(--amber); z-index: 1; }
.df-label--dest i { color: var(--dim); }
.df-label--dest::before { border-top-color: var(--amber); }

/* ambient tags: quieter, sunken instead of raised */
.df-label--amb {
  padding: 1px 5px 2px;
  font-weight: 400; font-size: calc(10.5px * var(--ui-scale, 1));
  color: #c3cbdb;
  background: rgba(16, 19, 29, 0.82);
  border-color: var(--w-bs) var(--w-ts) var(--w-ts) var(--w-bs);
  box-shadow: none;
}
.df-label--amb.on { opacity: 0.86; }
.df-label--amb b { font-weight: 500; }
.df-label--amb::before { border-top-color: #3a4359; }

.df-gfx-debug {
  position: fixed; left: 8px; bottom: 8px; max-width: 70vw; max-height: 50vh; overflow: hidden;
  font: 11px/1.35 var(--font-mono); color: #ffb0a0; white-space: pre-wrap; pointer-events: none; z-index: 99;
}

/* src/ui/desk.css */
/* Everything that is not a generic widget: the front panel, the things pinned
   to the desktop, and the insides of each window. */

/* ── Front Panel ─────────────────────────────────────────────────────────── */
.fp {
  z-index: 6000; position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: fit-content; max-width: 100%;
  display: flex; align-items: stretch; gap: 3px; padding: 3px;
  --bg: var(--p-bg); --ts: var(--p-ts); --bs: var(--p-bs); --sel: var(--p-sel); --fg: var(--p-fg);
  background: var(--bg); color: var(--fg);
  border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); box-shadow: 0 0 0 1px #07080d;
}
.fp-grip {
  width: 13px; flex: none; border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='1' height='1' fill='%237a849c'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23232838'/%3E%3C/svg%3E");
}
.fp-side { display: flex; gap: 1px; }
.fp-ctl { display: flex; flex-direction: column; align-items: stretch; width: 62px; flex: none; }
.fp-arrow { height: 11px; border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); position: relative; }
.fp-arrow.has:hover { background: color-mix(in srgb, var(--bg) 86%, #fff); }
.fp-arrow.has:active { border-color: var(--bs) var(--ts) var(--ts) var(--bs); }
.fp-arrow.has::after { content: ''; position: absolute; left: 50%; top: 1px; margin-left: -5px; border: 5px solid transparent; border-top: 0; border-bottom: 5px solid var(--ts); }
.fp-btn {
  height: 58px; padding: 0; margin: 0; display: grid; place-items: center; position: relative; color: inherit; font: inherit;
  background: var(--bg); border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); outline: none; cursor: default;
}
.fp-btn:hover { background: color-mix(in srgb, var(--bg) 84%, #fff); }
.fp-btn:active { border-color: var(--bs) var(--ts) var(--ts) var(--bs); background: var(--sel); }
.fp-btn:active > .pix { transform: translate(1px, 1px); }
.fp-btn:focus-visible { box-shadow: inset 0 0 0 1px var(--amber); }
.fp-led { position: absolute; top: 3px; right: 3px; width: 8px; height: 5px; background: #1b2030; border: 1px solid #0b0d14; }
.fp-btn.on .fp-led { background: #8df08a; box-shadow: inset 1px 1px 0 #d7ffd2; }
.fp-btn.hint { animation: hint 0.9s steps(2, jump-none) infinite; }
.fp-btn.blink .fp-led { animation: ledblink 0.7s steps(2, jump-none) infinite; }
.fp-btn.blink .fp-badge { background: var(--bad); }
@keyframes hint { from { border-color: var(--ts) var(--bs) var(--bs) var(--ts); } to { border-color: var(--amber); } }
@keyframes ledblink { from { background: #1b2030; } to { background: #ffb347; } }
.fp-badge.warn { background: var(--warn); color: #241405; }
.fp-badge { position: absolute; left: 3px; top: 2px; min-width: 14px; height: 13px; padding: 0 3px; background: var(--k-bg); color: #fff; font: 600 10px/12px var(--font-mono); border: 1px solid #10131c; }
.fp-lbl { font-size: 10px; line-height: 13px; height: 13px; text-align: center; white-space: nowrap; overflow: hidden; letter-spacing: 0.01em; }
.fp-mid { display: flex; flex-direction: column; gap: 3px; padding: 3px 5px; margin: 0 3px; border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); background: var(--sel); justify-content: center; }
.fp-lcd {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 7px; background: #0e1119; color: var(--amber);
  border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); font-family: var(--font-mono);
}
.fp-lcd .col { flex: 1; min-width: 0; line-height: 1.05; }
.fp-uni { font-size: 9px; letter-spacing: 0.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-sub { font-size: 9px; letter-spacing: 0.1em; color: #8d6a3c; white-space: nowrap; }
.fp-pct { font-size: 18px; font-weight: 500; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; text-shadow: 0 0 6px rgba(240, 176, 96, 0.35); }
.fp-busy { width: 6px; height: 6px; flex: none; background: #2a2418; border: 1px solid #000; }
.fp-busy.go { animation: busy 0.6s steps(3) 1; }
@keyframes busy { 0%, 60% { background: #9dff9a; } 100% { background: #2a2418; } }
.fp-ws { display: grid; grid-template-columns: repeat(3, 76px); gap: 2px; }
.ws-btn {
  height: 23px; padding: 0 4px; margin: 0; position: relative; font: 600 11.5px/1 var(--font-ui); color: var(--fg); cursor: default; outline: none;
  background: var(--bg); border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); overflow: hidden;
}
.ws-btn:hover:not(.off):not(.on) { background: color-mix(in srgb, var(--bg) 84%, #fff); }
.ws-btn.on { background: var(--a-bg); color: var(--a-fg); border-color: var(--a-bs) var(--a-ts) var(--a-ts) var(--a-bs); }
.ws-btn.off { color: color-mix(in srgb, var(--fg) 34%, var(--bg)); }
.ws-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: var(--f, 0%); background: var(--k-ts); }
.ws-btn.off .ws-bar { display: none; }
.ws-ship { position: absolute; left: 3px; top: 50%; margin-top: -4px; border: 4px solid transparent; border-left: 6px solid var(--amber); border-right: 0; display: none; }
.ws-btn.here .ws-ship { display: block; }
.ws-btn.on.here .ws-ship { border-left-color: #fff7e3; }

/* ── Desktop cards: directive, ship strip, toasts ────────────────────────── */
.dock { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none !important; }
.dock > * { pointer-events: auto; }
.card { background: var(--c-bg); color: var(--c-fg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); box-shadow: 0 0 0 1px #07080d, 3px 3px 0 rgba(0, 0, 0, 0.25); }
.card-t { display: flex; align-items: center; gap: 6px; padding: 1px 3px 1px 4px; font-weight: 600; font-size: 12px; background: var(--p-bg); color: var(--p-fg); border-bottom: 2px solid var(--c-bs); }
.card-t .pix { width: 16px; height: 16px; }
.card-b { width: 16px; height: 14px; flex: none; border: 2px solid; border-color: var(--p-ts) var(--p-bs) var(--p-bs) var(--p-ts); position: relative; }
.card-b::after { content: ''; position: absolute; left: 3px; right: 3px; top: 4px; height: 2px; background: var(--p-ts); }
.card-b:active { border-color: var(--p-bs) var(--p-ts) var(--p-ts) var(--p-bs); }
.card-c { padding: 6px 9px 8px; display: flex; flex-direction: column; gap: 3px; }
.directive { width: 304px; flex: none; }
.directive.folded { width: 230px; }
.directive.folded .card-c { padding: 3px 8px 4px; }
.directive.flash { animation: flash 1.2s steps(6) 1; }
@keyframes flash { 0%, 40%, 80% { border-color: var(--amber); } 20%, 60%, 100% { border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); } }
.dir-t { font-weight: 600; font-size: 14px; }
.dir-d { font-size: 12.5px; line-height: 1.42; color: #e7e1cd; }
.dir-r { margin-top: 4px; gap: 4px 10px; }
.strip { position: absolute; left: calc(50% - 270px); width: 540px; top: 0; display: flex; align-items: center; gap: 10px; padding: 5px 10px 6px; }
.strip-ico { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: none; }
.strip-scale { font: 600 8px/1 var(--font-mono); letter-spacing: 0.1em; color: var(--amber); }
.strip-main { font-weight: 600; }
.strip-sub { font-size: 11.5px; color: #dcd6c4; margin-bottom: 3px; }
.strip .col.grow { cursor: pointer; }
#ui.narrow .strip { position: static; width: auto; flex: 1 1 0; min-width: 0; }
.toasts { z-index: 7000; position: absolute; right: 8px; bottom: calc(var(--fp-h, 96px) + 8px); width: 300px; display: flex; flex-direction: column-reverse; gap: 4px; pointer-events: none !important; }
.toast {
  pointer-events: auto; display: flex; gap: 8px; align-items: center; padding: 4px 8px; font-size: 12px; line-height: 1.3;
  background: var(--p-bg); color: var(--p-fg); border: 2px solid; border-color: var(--p-ts) var(--p-bs) var(--p-bs) var(--p-ts);
  box-shadow: 0 0 0 1px #07080d, 3px 3px 0 rgba(0, 0, 0, 0.3); animation: toastin 0.16s steps(4);
}
.toast.out { opacity: 0; transition: opacity 0.35s; }
.toast.k-major, .toast.k-directive { border-color: var(--a-ts) var(--a-bs) var(--a-bs) var(--a-ts); background: var(--a-sel); color: var(--a-fg); }
@keyframes toastin { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Shared window furniture ─────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 6px 8px; padding: 7px 8px 6px; flex: none; flex-wrap: wrap; min-height: 38px; }
.statusbar { display: flex; align-items: center; gap: 10px; padding: 4px 8px 5px; flex: none; font-size: 12px; flex-wrap: wrap; }
.win-client > .well, .tabpage > .well, .col > .well.grow { margin: 0 8px 8px; }
.msec {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 3px; font: 600 10.5px/1.3 var(--font-ui); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--amber);
}
.msec > span:first-child { flex: none; }
.msec::after { content: ''; flex: 1; height: 2px; border-top: 1px solid rgba(0, 0, 0, 0.5); border-bottom: 1px solid rgba(255, 255, 255, 0.12); order: 5; }
.well .msec { position: sticky; top: 0; z-index: 2; background: var(--w-bg); }
.tier { font: 500 9px/13px var(--font-mono); color: var(--dim-here, #c0c7d8); border: 1px solid currentColor; padding: 0 3px; flex: none; }
.badge { font: 600 9.5px/14px var(--font-mono); padding: 0 5px; border: 1px solid currentColor; text-transform: uppercase; letter-spacing: 0.05em; flex: none; }
.badge.wonder { color: #ffe9a8; }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px #10131c; }
.swatch.star { border-radius: 0; background: var(--amber); transform: rotate(45deg) scale(0.8); }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 2px 10px; }
.kv > div:nth-child(odd) { background: rgba(255, 255, 255, 0.035); }
.kv .kv-sep { height: 1px; padding: 0; background: var(--w-ts); margin: 4px 0; }
.kv.plain > div { padding: 2px 0; background: none; justify-content: flex-start; }
.kv.plain > div > span:first-child { width: 112px; flex: none; color: var(--amber); }
.irow { display: flex; align-items: center; gap: 8px; padding: 3px 8px; min-height: 26px; }
.well .irow:hover { background: var(--w-sel); }
.pips { display: inline-flex; gap: 2px; flex: none; }
.pips > i { width: 6px; height: 6px; background: var(--c-sel); border: 1px solid var(--c-bs); }
.pips > i.on { background: var(--amber); border-color: #6a3f1b; }
.pips.r1 > i.on { background: #b9c2d4; } .pips.r2 > i.on { background: #86c98a; } .pips.r3 > i.on { background: #6f9bd6; } .pips.r4 > i.on { background: #f0b060; }
.rio { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; }
.arr { color: var(--dim); margin: 0 1px; font-size: 11px; }

/* ── Factory ─────────────────────────────────────────────────────────────── */
.fac-head { flex: none; }
.fac-meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 6px 12px; padding: 8px 8px 0; }
.emeter { display: flex; gap: 7px; align-items: center; min-width: 0; --ec: var(--amber); }
.emeter .gauge { --gc: var(--ec); height: 12px; }
.emeter .row { white-space: nowrap; gap: 4px; min-width: 0; }
.emeter .row > .b { overflow: hidden; text-overflow: ellipsis; }
.emeter.bays { --ec: #b9c2d4; }
.e-sym { width: 24px; height: 24px; flex: none; display: grid; place-items: center; background: var(--ec); color: #10131c; font: 600 12px/1 var(--font-mono); border: 1px solid; border-color: color-mix(in srgb, var(--ec) 50%, #fff) color-mix(in srgb, var(--ec) 55%, #000) color-mix(in srgb, var(--ec) 55%, #000) color-mix(in srgb, var(--ec) 50%, #fff); outline: 1px solid #10131c; }
.e-short { color: #fff; background: var(--bad); font: 600 9px/12px var(--font-mono); padding: 0 3px; animation: blink 1s steps(2, jump-none) infinite; }
@keyframes blink { from { opacity: 1; } to { opacity: 0.35; } }
.echip { display: inline-flex; gap: 3px; align-items: center; font: 500 11px/1 var(--font-mono); flex: none; }
.echip > i { font-style: normal; width: 14px; height: 14px; background: var(--ec); color: #10131c; display: grid; place-items: center; font-weight: 600; font-size: 9px; outline: 1px solid #10131c; }
.fac-list { padding-bottom: 6px; }
.mgrp { margin: 3px 4px 0; }
.mhdr {
  display: flex; align-items: center; gap: 4px 9px; padding: 3px 6px 3px 4px; min-height: 32px; flex-wrap: wrap;
  background: var(--c-bg); color: var(--c-fg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts);
}
.fold { width: 14px; height: 14px; flex: none; position: relative; visibility: hidden; }
.fold.can { visibility: visible; }
.fold::after { content: ''; position: absolute; left: 3px; top: 2px; border: 5px solid transparent; border-top: 7px solid var(--c-fg); border-bottom: 0; }
.mgrp.folded .fold::after { left: 4px; top: 2px; border: 5px solid transparent; border-left: 7px solid var(--c-fg); border-right: 0; }
.fold.can:hover::after { filter: brightness(1.4); }
.mname { font-weight: 600; min-width: 112px; }
.mk { font: 500 10px/14px var(--font-mono); padding: 0 4px; background: var(--c-sel); border: 1px solid var(--c-bs); color: var(--amber); flex: none; }
.mcount { font-size: 11px; }
.mbody { padding: 2px 0 3px; }
.mup { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 3px 6px 3px 26px; background: var(--c-sel); color: var(--c-fg); border: 2px solid; border-color: var(--c-bs) var(--c-ts) var(--c-ts) var(--c-bs); border-top: 0; }
.rrow { display: grid; grid-template-columns: 76px minmax(84px, 120px) minmax(120px, 1fr) 56px 44px 32px 88px; align-items: center; gap: 8px; padding: 1px 8px 1px 6px; min-height: 26px; }
.rrow:hover { background: var(--w-sel); }
.stp { display: flex; align-items: center; }
.stp-n { width: 30px; text-align: center; font-size: 12px; }
.rname { font-size: 12.5px; display: flex; align-items: center; gap: 5px; min-width: 0; }
.rnet { text-align: right; font-size: 11px; }
.rnet.dim { color: #606a85; }
.newtag { font: 600 8.5px/12px var(--font-mono); letter-spacing: 0.06em; padding: 0 3px; background: var(--amber); color: #241405; border: 1px solid #6a3f1b; flex: none; }
.btn.hint { animation: hintb 0.9s steps(2, jump-none) infinite; }
@keyframes hintb { from { box-shadow: none; } to { box-shadow: 0 0 0 2px var(--amber); } }
.rrate { text-align: right; font-size: 11px; }
.ract { min-width: 0; }
.rstat { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-run { color: var(--good); } .st-warn { color: var(--warn); } .st-bad { color: var(--bad); } .st-full { color: var(--dim); } .st-idle { color: #606a85; }

/* ── Cargo and the item inspector ────────────────────────────────────────── */
.crow { display: grid; grid-template-columns: 28px minmax(84px, 1fr) 22px 100px 44px 58px; gap: 8px; align-items: center; padding: 1px 8px; min-height: 28px; cursor: pointer; }
.crow:hover { background: var(--w-sel); }
.c-amt, .c-rate { text-align: right; font-size: 11px; white-space: nowrap; }
.c-name { font-size: 12.5px; }
.i-head { display: flex; gap: 12px; padding: 10px 10px 6px; flex: none; }
.i-name { font-weight: 600; font-size: 15px; }
.i-desc { font: 400 13.5px/1.4 var(--font-log); color: #ece5cf; margin-top: 3px; }
.i-stock { padding: 0 10px 8px; display: flex; flex-direction: column; gap: 3px; flex: none; }
.i-amt { font-size: 19px; font-weight: 500; }
.i-note { padding: 2px 8px 6px; }
.i-body .irow { cursor: default; }

/* ── Research, megastructures, legacy ────────────────────────────────────── */
.research > .well { margin: 8px 0 8px 8px; }
.era-list { width: 176px; flex: none; padding: 2px 0; }
.era { display: flex; gap: 6px; padding: 3px 8px; align-items: center; font-size: 12.5px; }
.era:hover { background: var(--w-sel); }
.era.on { background: var(--a-bg); color: var(--a-fg); font-weight: 600; }
.era-sep { height: 1px; background: var(--w-ts); margin: 3px 0; }
.data-bar { display: flex; gap: 4px 14px; flex-wrap: wrap; }
.tech-list { padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.tcard { background: var(--c-bg); color: var(--c-fg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); padding: 6px 9px 7px; display: flex; flex-direction: column; gap: 4px; flex: none; }
.tcard.done { background: var(--p-sel); border-color: var(--p-sel); color: var(--dim); }
.tcard.locked { background: var(--p-sel); border: 2px solid var(--p-bs); color: var(--dim); }
.tcard.wait { background: var(--p-bg); }
.t-name { font-weight: 600; font-size: 14px; }
.t-desc { font-size: 12.5px; line-height: 1.4; }
.t-fx { display: flex; flex-wrap: wrap; gap: 3px 5px; font-size: 11px; }
.t-fx > span { background: var(--c-sel); border: 1px solid var(--c-bs); padding: 0 5px; color: #cdeeea; }
.tcard.done .t-fx > span, .tcard.locked .t-fx > span { background: none; color: inherit; }
.t-need { font-size: 12px; }
.t-state { font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; flex: none; }
.t-foot { margin-top: 2px; }
.segs { display: flex; gap: 2px; }
.segs > i { flex: 1; height: 9px; background: var(--w-bg); border: 1px solid var(--c-bs); }
.segs > i.on { background: var(--amber); border-color: #6a3f1b; }
.trait { display: flex; flex-direction: column; padding: 2px 0; }
.shelf { display: flex; align-items: flex-end; gap: 2px; min-height: 124px; padding: 6px 6px 0; background: var(--w-bg); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); border-bottom: 7px solid #6b4a2b; overflow-x: auto; }
.spine { width: 28px; height: 112px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 0 4px; --sc: #8b5e3c; background: var(--sc); color: #fff3d6; border: 2px solid; border-color: color-mix(in srgb, var(--sc) 60%, #fff) color-mix(in srgb, var(--sc) 55%, #000) color-mix(in srgb, var(--sc) 55%, #000) color-mix(in srgb, var(--sc) 60%, #fff); }
.spine > span { writing-mode: vertical-rl; font: 600 11px var(--font-log); white-space: nowrap; overflow: hidden; max-height: 80px; }
.spine > i { font: 500 9px var(--font-mono); font-style: normal; }
.spine.c1 { --sc: #3f6f6a; height: 104px; } .spine.c2 { --sc: #5a5486; height: 116px; } .spine.c3 { --sc: #7d4a45; height: 108px; } .spine.c4 { --sc: #4d6a8c; height: 100px; }

/* ── Ship ────────────────────────────────────────────────────────────────── */
.sysrow { display: flex; align-items: center; gap: 12px; padding: 7px 9px; border: 1px solid var(--bs); box-shadow: inset 1px 1px 0 var(--ts), 1px 1px 0 var(--ts); flex: none; }
.sysrow .col { gap: 2px; }
.lv { font-size: 11px; color: var(--amber); }
.sys-fx { font-size: 11px; color: #cdeeea; }

/* ── Inspector ───────────────────────────────────────────────────────────── */
.n-head { display: flex; gap: 11px; align-items: center; padding: 9px 10px 7px; flex: none; }
.n-name { font-weight: 600; font-size: 15px; flex: 1 1 0; min-width: 0; }
.n-body { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.n-desc { font: 400 13.5px/1.45 var(--font-log); color: #ece5cf; }
.n-lore { font-size: 13.5px; border-left: 2px solid var(--amber); padding-left: 8px; }
.n-warn { border: 1px solid var(--bad); padding: 4px 8px; color: #ffd6cf; background: #40262a; font-size: 12.5px; }
.n-body .msec { padding: 4px 0 0; color: var(--c-fg); }
.n-act { margin-top: 2px; }
.n-body .n-deps .irow { min-height: 26px; padding: 1px 8px; }
.n-foot { flex: none; display: flex; flex-direction: column; gap: 5px; padding: 7px 10px 9px; border-top: 1px solid var(--bs); box-shadow: inset 0 1px 0 var(--ts); }
.n-orb {
  --oc: #9aa3b8; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--oc); position: relative;
  box-shadow: inset -7px -7px 0 rgba(0, 0, 0, 0.32), inset 3px 3px 0 rgba(255, 255, 255, 0.28), 0 0 0 1px #10131c;
}
.n-orb.sm { width: 18px; height: 18px; box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.32), inset 2px 2px 0 rgba(255, 255, 255, 0.28), 0 0 0 1px #10131c; }
.n-orb.k-star, .n-orb.k-binary { box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.14), inset 0 0 0 4px rgba(255, 255, 255, 0.3), 0 0 0 1px #10131c, 0 0 0 4px color-mix(in srgb, var(--oc) 35%, transparent); }
.n-orb.sm.k-star, .n-orb.sm.k-binary { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3), 0 0 0 1px #10131c, 0 0 0 2px color-mix(in srgb, var(--oc) 35%, transparent); }
.n-orb.k-blackhole { background: #05060a; box-shadow: 0 0 0 1px #10131c, inset 0 0 0 5px var(--oc), inset 0 0 0 7px #10131c; }
.n-orb.sm.k-blackhole { box-shadow: 0 0 0 1px #10131c, inset 0 0 0 3px var(--oc), inset 0 0 0 4px #10131c; }
.n-orb.k-void { background: transparent; box-shadow: inset 0 0 0 3px var(--oc), 0 0 0 1px #10131c; }
.n-orb.sm.k-void { box-shadow: inset 0 0 0 2px var(--oc), 0 0 0 1px #10131c; }
.n-orb.k-nebula, .n-orb.k-cluster, .n-orb.k-globular { border-radius: 38% 62% 55% 45% / 55% 42% 58% 45%; }
.n-orb.k-galaxy, .n-orb.k-elliptical, .n-orb.k-disk { transform: scaleY(0.52) rotate(-18deg); }
.n-orb.k-anomaly, .n-orb.k-string { border-radius: 0; transform: rotate(45deg) scale(0.74); }
.n-orb.k-ring::after, .n-orb.k-belt::after, .n-orb.k-pulsar::after { content: ''; position: absolute; left: -22%; right: -22%; top: 44%; height: 12%; background: color-mix(in srgb, var(--oc) 60%, #fff); box-shadow: 0 0 0 1px #10131c; transform: rotate(-16deg); }
.n-orb.k-unknown { background: #3a4258; box-shadow: inset 0 0 0 2px #606a85, 0 0 0 1px #10131c; }
.n-orb.k-unknown::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; color: #9aa3b8; font: 600 16px var(--font-mono); }
.n-orb.sm.k-unknown::after { font-size: 10px; }

/* ── Outposts ────────────────────────────────────────────────────────────── */
.oprow { display: flex; align-items: center; gap: 9px; padding: 3px 8px; min-height: 36px; }
.oprow:hover { background: var(--w-sel); }
.op-name { width: 150px; flex: none; cursor: pointer; line-height: 1.2; }
.op-name:hover .b { color: var(--amber); }
.op-lv { width: 38px; flex: none; color: var(--amber); font-size: 11px; }
.oprow.empty .op-lv { color: #606a85; }
.op-deps { display: flex; flex-wrap: wrap; gap: 2px 9px; }

/* ── Field guide and log ─────────────────────────────────────────────────── */
.g-cap { padding: 7px 10px 5px; flex: none; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 6px; padding: 6px; align-content: start; }
.g-grid.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.g-card { background: var(--c-bg); color: var(--c-fg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); padding: 6px 9px 7px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.g-card.unk { background: transparent; border: 1px dashed #3d455c; color: var(--dim); }
.g-card.wonder { border-color: #e2c27a #7a5a22 #7a5a22 #e2c27a; }
.g-card.signal, .g-card.marker { margin: 6px; }
.g-desc { font: 400 13px/1.4 var(--font-log); color: #ece5cf; }
.g-lore { font-size: 13.5px; border-left: 2px solid var(--amber); padding-left: 8px; }
.g-setdesc { padding: 0 8px; }
.g-tiles { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px 8px; }
.g-totals { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 8px 8px 2px; flex: none; }
.g-totals > div { display: flex; flex-direction: column; align-items: center; padding: 4px 2px; font-size: 11px; text-align: center; background: var(--w-bg); color: var(--w-fg); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); }
.g-totals b { font: 500 19px/1.2 var(--font-mono); color: var(--amber); }
.g-when { width: 92px; flex: none; } .g-kind { width: 78px; flex: none; }
.logrow { display: flex; gap: 9px; padding: 5px 8px; align-items: flex-start; border-bottom: 1px solid #202637; font-size: 12.5px; line-height: 1.4; }
.logrow .prose { font-size: 13.5px; }
.logrow .pix { margin-top: 2px; }

/* ── Settings ────────────────────────────────────────────────────────────── */
.s-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.s-lbl { width: 64px; flex: none; } .s-val { width: 38px; text-align: right; }
.slider { -webkit-appearance: none; appearance: none; flex: 1; height: 14px; margin: 0; outline: none; background: linear-gradient(90deg, var(--k-bg) var(--f, 50%), var(--w-bg) var(--f, 50%)); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 20px; background: var(--c-bg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); box-shadow: inset 4px 0 0 -3px var(--c-bs), inset -4px 0 0 -3px var(--c-ts); }
.slider::-moz-range-thumb { width: 10px; height: 16px; border-radius: 0; background: var(--c-bg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); }
.frame .tog { display: flex; }


/* ── Windows adapt to their own width, not the screen's ──────────────────── */
.desk .win .win-client { container-type: inline-size; }
@container (max-width: 640px) {
  .rrow { grid-template-columns: 76px minmax(84px, 1fr) minmax(96px, 1.2fr) 62px 94px; }
  .rrow .rnet, .rrow .ract { display: none; }
}
@container (max-width: 470px) {
  .rrow { grid-template-columns: 76px 1fr auto; grid-template-areas: "stp name rate" "io io stat"; row-gap: 2px; padding-top: 4px; padding-bottom: 5px; }
  .rrow .stp { grid-area: stp; } .rrow .rname { grid-area: name; } .rrow .rrate { grid-area: rate; }
  .rrow .rio { grid-area: io; } .rrow .rstat { grid-area: stat; text-align: right; }
  .rt-row { grid-template-columns: minmax(120px, 1fr) 52px 70px 84px; }
  .rt-row .rt-srcw, .rt-hd > span:nth-child(2) { display: none; }
  .mup { padding-left: 8px; }
  .mup > .small { flex: 1 1 100%; }
  .era-list { width: 124px; }
  .oprow { flex-wrap: wrap; }
}
@container (max-width: 400px) {
  .crow { grid-template-columns: 28px minmax(60px, 1fr) 84px 54px; }
  .crow .tier, .crow .c-bar { display: none; }
  .sysrow { flex-direction: column; align-items: stretch; gap: 6px; }
  .sysrow .btn { align-self: flex-end; }
}

/* ── Segmented switch ────────────────────────────────────────────────────── */
.seg { display: inline-flex; flex: none; }
.seg-b { display: flex; align-items: center; min-height: 22px; padding: 0 9px; font-size: 12px; font-weight: 500; background: var(--bg); border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); }
.seg-b:hover:not(.on) { background: color-mix(in srgb, var(--bg) 86%, #fff); }
.seg-b.on { border-color: var(--bs) var(--ts) var(--ts) var(--bs); background: var(--sel); color: var(--amber); font-weight: 600; }

/* ── Research tree ───────────────────────────────────────────────────────── */
.col > .well.grow.ttree-view { margin-bottom: 4px; cursor: grab; background-image: radial-gradient(#252b3d 1px, transparent 1px); background-size: 16px 16px; }
.ttree-view.panning { cursor: grabbing; }
.ttree { position: relative; }
.tlines { position: absolute; left: 0; top: 0; pointer-events: none; }
.tl-shadow { fill: none; stroke: #0a0c13; stroke-width: 4; stroke-linejoin: miter; }
.tl { fill: none; stroke: #48516a; stroke-width: 2; stroke-linejoin: miter; }
.tl.on { stroke: var(--k-bg); }
.tnode {
  position: absolute; display: flex; align-items: center; gap: 6px; padding: 0 7px 0 9px; cursor: default;
  --bg: var(--c-bg); --ts: var(--c-ts); --bs: var(--c-bs); --fg: var(--c-fg);
  background: var(--bg); color: var(--fg); border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts);
  font-size: 12px; font-weight: 500; line-height: 1.15;
}
.tnode:hover { filter: brightness(1.1); }
.tn-name { flex: 1; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tn-mark, .tn-key { width: 9px; height: 9px; flex: none; border: 1px solid #10131c; background: #3a4258; }
.tn-key { display: inline-block; margin-right: 5px; vertical-align: -1px; }
.tnode.done { --bg: #3f4b62; --fg: #d3e6e2; border-color: var(--c-bs) var(--c-ts) var(--c-ts) var(--c-bs); }
.tnode.done .tn-mark, .tn-key.done { background: var(--k-bg); }
.tnode.can { --bg: var(--k-bg); --ts: var(--k-ts); --bs: var(--k-bs); --fg: var(--k-fg); font-weight: 600; }
.tnode.can .tn-mark, .tn-key.can { background: #fff7e3; transform: rotate(45deg) scale(0.85); }
.tnode.ready .tn-mark, .tn-key.ready { background: var(--amber); transform: rotate(45deg) scale(0.85); }
.tnode.wait { --fg: #f1dfae; }
.tnode.wait .tn-mark, .tn-key.wait { background: var(--warn); }
.tnode.locked { --bg: #1e2434; --fg: #7f89a3; border: 2px solid #2f374c; }
.tnode.locked .tn-mark, .tn-key.locked { background: #1e2434; border-color: #48516a; }
.tnode.sel { outline: 2px solid var(--amber); outline-offset: 1px; z-index: 1; }
/* A stub on the left edge: this one also needs something from an earlier era. */
.tn-stub { position: absolute; left: -11px; top: 50%; width: 9px; height: 2px; margin-top: -1px; background: #48516a; }
.tn-stub::before { content: ''; position: absolute; left: -4px; top: -3px; width: 6px; height: 6px; background: #48516a; border: 1px solid #0a0c13; transform: rotate(45deg); }
.tn-stub.on, .tn-stub.on::before { background: var(--k-bg); }
.tlegend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; padding: 0 10px 5px; font-size: 11px; flex: none; }
.research.as-tree > .col > .well.grow { margin-left: 8px; }
.research.as-tree .tdetail { margin-left: 8px; }
.tdetail { flex: none; margin: 0 8px 8px; max-height: 44%; overflow: auto; }

/* ── Recipe tree ─────────────────────────────────────────────────────────── */
.rt-bar { padding-top: 5px; }
.rt-row { display: grid; grid-template-columns: minmax(150px, 1.7fr) minmax(70px, 1fr) 52px 70px 84px; gap: 8px; align-items: center; padding: 0 8px 0 4px; min-height: 26px; }
.rt-srcw { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rt-srcw > .rt-src { flex: 1 1 0; min-width: 0; }
.rt-row:hover { background: var(--w-sel); }
.rt-row.root { background: rgba(255, 255, 255, 0.045); }
.rt-row.root .rt-link { font-weight: 600; }
.rt-hd { position: sticky; top: 0; z-index: 2; background: var(--w-bg); min-height: 20px; font: 600 9.5px/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: #8f99b0; border-bottom: 1px solid #252b3d; }
.rt-hd:hover { background: var(--w-bg); }
.rt-hd > span:nth-child(n+3) { text-align: right; }
.rt-hd > span:last-child { text-align: left; }
.rt-name { display: flex; align-items: center; gap: 4px; min-width: 0; align-self: stretch; }
.rt-hd > span:first-child { padding-left: 20px; }
/* Indent guides, one faint rule per level. */
.rt-ind { flex: none; align-self: stretch; background-image: repeating-linear-gradient(90deg, transparent 0 6px, #2f374c 6px 7px, transparent 7px 12px); }
.rt-row .fold::after { border-top-color: var(--w-fg); }
.rt-row.folded .fold::after { left: 4px; top: 2px; border: 5px solid transparent; border-left: 7px solid var(--w-fg); border-right: 0; }
.rt-link { font-size: 12.5px; cursor: pointer; }
.rt-link:hover { color: var(--amber); }
.rt-row.leaf .rt-name > span { color: #b9c2d4; font-size: 12.5px; }
.rt-src { font-size: 11px; color: #8f99b0; }
.rt-need, .rt-have { text-align: right; font-size: 11px; }
.btn.rt-alt { font: 600 10px/1 var(--font-mono); width: 18px; min-height: 18px; color: var(--amber); }

/* ── Small screens ───────────────────────────────────────────────────────── */
.compact .dock { flex-direction: column; gap: 4px; top: 4px; left: 4px; right: 4px; }
.compact .directive, .compact .directive.folded { width: auto; align-self: stretch; }
.compact .strip { position: static; width: auto; align-self: stretch; }
.compact .fp { width: 100%; overflow-x: auto; justify-content: flex-start; }
.compact .toasts { width: auto; left: 8px; }
.compact .rrow { grid-template-columns: 76px 1fr auto; grid-template-areas: "stp name rate" "io io stat"; row-gap: 2px; padding-top: 4px; padding-bottom: 5px; }
.compact .rrow .stp { grid-area: stp; } .compact .rrow .rname { grid-area: name; } .compact .rrow .rrate { grid-area: rate; }
.compact .rrow .rio { grid-area: io; } .compact .rrow .rstat { grid-area: stat; text-align: right; }
.compact .rrow .ract, .compact .rrow .rnet { display: none; }
.compact .crow { grid-template-columns: 28px minmax(60px, 1fr) 96px 58px; }
.compact .crow .tier, .compact .crow .c-bar { display: none; }
.compact .op-name { width: 110px; }
.compact .era-list { width: 120px; }
.compact .g-totals { grid-template-columns: repeat(3, 1fr); }
.compact .btn.buy { flex-wrap: wrap; max-width: 100%; white-space: normal; }
.compact .btn .chips { flex-wrap: wrap; }
.compact .mhdr .mname { min-width: 0; }
.compact .toasts .toast:nth-child(n+3) { display: none; }
.slider::-moz-range-track { background: transparent; border: 0; }

/* src/ui/fleet.css */
/* ── The Fleet window (co-op) ───────────────────────────────────────────── */
.fl-bar { min-height: 30px; padding-bottom: 2px; }
.fl-led { width: 9px; height: 9px; flex: none; background: var(--warn); border: 1px solid #10131c; box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.45); }
.fl-led.ok { background: var(--good); }
.fl-led.bad { background: var(--bad); }
.fl-intro p { margin: 0 0 6px; line-height: 1.45; }
.fl-intro p.prose { font-size: 14.5px; }
.fl-lbl { width: 78px; flex: none; color: var(--amber); font-size: 12px; }
.fl-err { padding: 5px 8px; border: 1px solid currentColor; }
.fl-msg { padding: 4px 8px 2px; min-height: 20px; line-height: 1.35; }
.fl-msg:empty { display: none; }

/* roster */
.fl-code {
  font-size: 26px; font-weight: 500; letter-spacing: 0.12em; line-height: 1; padding: 9px 14px 8px; flex: none; color: var(--amber);
  background: var(--w-bg); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); user-select: text; -webkit-user-select: text; cursor: text;
}
.fl-codein { text-transform: uppercase; letter-spacing: 0.08em; }
.fl-codein::placeholder { letter-spacing: 0.08em; }
.fl-ships { margin: 0; }
.fl-ship { display: grid; grid-template-columns: minmax(110px, 1.5fr) minmax(86px, 1fr) 46px 62px 62px 40px; gap: 8px; align-items: center; padding: 3px 8px; min-height: 28px; }
.fl-ship > span { min-width: 0; }
.fl-ship > span:nth-child(n + 4) { text-align: right; font-size: 12px; }
.fl-ship.hd { min-height: 20px; font: 600 9.5px/1.3 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); border-bottom: 1px solid #202637; }
.fl-ship.me { background: rgba(240, 176, 96, 0.08); }
.fl-ship:not(.hd):hover { background: var(--w-sel); }

/* freight */
/* The page scrolls as a whole when the window is short; otherwise the hold list takes the spare height. */
.fl-scroll { display: flex; flex-direction: column; min-height: 0; }
.fl-cols { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(300px, 1.3fr); gap: 8px; padding: 0 8px; flex: 1 0 auto; min-height: 236px; }
/* the hold list never sets the height of the row; it fills whatever the pod column needs */
.fl-left { contain: size; }
.fl-left, .fl-right { min-height: 0; min-width: 0; }
.fl-left > .well, .fl-right > .well { margin: 0 !important; }
.fl-find { padding-bottom: 4px; }
.fl-stock { min-height: 96px; }
.fl-srow { display: flex; align-items: center; gap: 7px; padding: 2px 8px; min-height: 26px; cursor: pointer; }
.fl-srow:hover:not(.no) { background: var(--w-sel); }
.fl-srow.no { cursor: default; color: #7f89a3; }
.fl-srow.no .tile { opacity: 0.5; }
.fl-srow.picked { color: var(--amber); }
.fl-why { color: var(--warn); opacity: 0.85; white-space: nowrap; }
.fl-add { width: 14px; flex: none; text-align: center; font: 600 13px/1 var(--font-mono); color: var(--good); }
.fl-amt { color: #b9c2d4; }
.fl-right .msec { padding: 0 0 3px; }
.fl-pod { padding: 1px 0; }
.fl-prow { display: flex; align-items: center; gap: 6px; padding: 3px 6px; min-height: 36px; border-bottom: 1px solid #202637; }
.fl-prow:last-child { border-bottom: 0; }
.fl-prow.blank { min-height: 28px; padding-left: 8px; }
.fl-pname { min-width: 0; line-height: 1.15; }
.fl-num { width: 78px; flex: none; text-align: right; font-size: 12px; }
.fl-num.over { box-shadow: 0 0 0 1px var(--bad); }
.fl-prow .seg-b { padding: 0 6px; font-size: 11px; min-height: 20px; cursor: pointer; }
.fl-line { margin-top: 6px; }
.fl-right .fl-msg { padding: 5px 0 4px; }
.fl-acthead { padding-top: 8px; flex: none; }
.fl-act { flex: 0 0 96px; margin: 0 8px 8px; }
.fl-arow { display: flex; align-items: baseline; gap: 8px; padding: 3px 8px; font-size: 12.5px; line-height: 1.35; border-bottom: 1px solid #202637; }
.fl-dir { width: 10px; flex: none; font-style: normal; font-size: 9px; color: var(--amber); }
.fl-arow.k-in .fl-dir { color: var(--good); }
.fl-arow.k-error .fl-dir { color: var(--bad); font-weight: 700; font-size: 12px; }
.fl-arow.k-error { color: #f0c0b8; }
.fl-when { width: 62px; flex: none; }

/* cabinet */
.g-card.fl-theirs { background: var(--p-bg); }

/* projects */
.fl-cost { display: flex; flex-direction: column; gap: 3px; padding: 2px 0; }
.fl-crow { display: grid; grid-template-columns: 22px minmax(96px, 1.1fr) minmax(50px, 1fr) 98px 70px auto; gap: 8px; align-items: center; min-height: 32px; }
.fl-cname { min-width: 0; line-height: 1.15; }
.fl-have { text-align: right; }
.fl-crow .fl-num { width: 70px; }
.tcard .fl-msg { padding-left: 0; }

/* the inspector's marker control */
.fl-mark { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

@container (max-width: 560px) {
  .fl-cols { grid-template-columns: 1fr; }
  .fl-left { contain: none; }
  .fl-stock { max-height: 150px; flex: none; }
  .fl-ship { grid-template-columns: minmax(96px, 1.4fr) 46px 62px 62px; }
  .fl-ship > span:nth-child(2), .fl-ship > span:nth-child(6) { display: none; }
  .fl-crow { grid-template-columns: 22px minmax(80px, 1fr) 90px 62px auto; }
  .fl-crow .gauge { display: none; }
  .fl-code { font-size: 20px; padding: 7px 10px 6px; }
}

/* src/ui/motif.css */
/* The Motif widget set: bevels, buttons, wells, toggles, gauges, tabs, menus,
   scrollbars and window frames. Every widget draws with the five local
   variables of whatever colour set it sits in. */

#ui {
  --bg: var(--c-bg); --ts: var(--c-ts); --bs: var(--c-bs); --sel: var(--c-sel); --fg: var(--c-fg);
  font: 13px/1.3 var(--font-ui); color: var(--c-fg); cursor: default;
  user-select: none; -webkit-user-select: none; -webkit-font-smoothing: antialiased;
}
#ui *, #ui *::before, #ui *::after { box-sizing: border-box; }
#ui [hidden] { display: none !important; }
.s-c { --bg: var(--c-bg); --ts: var(--c-ts); --bs: var(--c-bs); --sel: var(--c-sel); --fg: var(--c-fg); }
.s-a { --bg: var(--a-bg); --ts: var(--a-ts); --bs: var(--a-bs); --sel: var(--a-sel); --fg: var(--a-fg); }
.s-p { --bg: var(--p-bg); --ts: var(--p-ts); --bs: var(--p-bs); --sel: var(--p-sel); --fg: var(--p-fg); }
.s-w { --bg: var(--w-bg); --ts: var(--w-ts); --bs: var(--w-bs); --sel: var(--w-sel); --fg: var(--w-fg); }
.s-k { --bg: var(--k-bg); --ts: var(--k-ts); --bs: var(--k-bs); --sel: var(--k-sel); --fg: var(--k-fg); }
.s-c, .s-a, .s-p, .s-w, .s-k { background: var(--bg); color: var(--fg); }

.pix { image-rendering: pixelated; display: block; flex: none; }
.out { border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); }
.in { border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim-here, #c0c7d8); }
.well, .tip { --dim-here: #8f99b0; }
.good { color: var(--good); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.grow { flex: 1 1 0; min-width: 0; min-height: 0; }
.row { display: flex; align-items: center; gap: 6px; }
.col { display: flex; flex-direction: column; }
.wrap { flex-wrap: wrap; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.pad { padding: 8px; }
.b { font-weight: 600; }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  font: inherit; font-weight: 500; color: var(--fg); background: var(--bg);
  border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts);
  padding: 2px 10px; min-height: 24px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; cursor: default; outline: none; position: relative; margin: 0; flex: none;
}
.btn:hover:not(.off) { background: color-mix(in srgb, var(--bg) 86%, #fff); }
.btn:active:not(.off), .btn.down {
  border-color: var(--bs) var(--ts) var(--ts) var(--bs); background: var(--sel);
}
.btn:active:not(.off) > *, .btn.down > * { transform: translate(1px, 1px); }
.btn:focus-visible { outline: 1px solid var(--amber); outline-offset: 1px; }
.btn.off { color: color-mix(in srgb, var(--fg) 58%, var(--bg)); }
.btn.off .tile { filter: saturate(0.75) brightness(0.92); }
.btn.sm { min-height: 20px; padding: 0 6px; font-size: 12px; }
.btn.sq { width: 22px; min-height: 22px; padding: 0; }
.btn.wide { width: 100%; }
/* Motif's default button sits in a sunken ring. */
.btn.def { margin: 4px; box-shadow: 0 0 0 2px var(--c-bg), -1px -1px 0 3px var(--c-bs), 1px 1px 0 3px var(--c-ts); }
/* A purchase that can be made right now lights up in the accent set. */
.btn.buy.can { --bg: var(--k-bg); --ts: var(--k-ts); --bs: var(--k-bs); --sel: var(--k-sel); --fg: var(--k-fg); }
.btn.buy { gap: 8px; padding: 2px 8px; }
.btn.buy .lbl { font-weight: 600; }
.btn.shake { animation: shake 0.18s linear; }
@keyframes shake { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* ── Wells, frames, separators ───────────────────────────────────────────── */
.well { background: var(--w-bg); color: var(--w-fg); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs); }
.scroll { overflow: auto; overscroll-behavior: contain; }
.sep { height: 2px; flex: none; border-top: 1px solid var(--bs); border-bottom: 1px solid var(--ts); margin: 6px 0; }
.vsep { width: 2px; align-self: stretch; flex: none; border-left: 1px solid var(--bs); border-right: 1px solid var(--ts); margin: 0 4px; }
.frame { position: relative; border: 1px solid var(--bs); box-shadow: inset 1px 1px 0 var(--ts), 1px 1px 0 var(--ts); padding: 12px 8px 8px; margin-top: 8px; }
.frame > .frame-t { position: absolute; top: -9px; left: 8px; background: var(--bg); padding: 0 5px; font-weight: 600; font-size: 12px; }
.hd { font-weight: 600; font-size: 12px; letter-spacing: 0.02em; }

/* ── Text field ──────────────────────────────────────────────────────────── */
.field {
  background: var(--w-bg); color: var(--w-fg); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs);
  font: inherit; padding: 1px 6px; height: 24px; outline: none; min-width: 0; user-select: text; -webkit-user-select: text; cursor: text;
}
.field::placeholder { color: #66708a; }
.field:focus { box-shadow: 0 0 0 1px var(--amber); }
textarea.field { width: 100%; display: block; height: auto; resize: none; font: 11px/1.35 var(--font-mono); padding: 4px 6px; word-break: break-all; }

/* ── Toggles: square for check, diamond for radio ────────────────────────── */
.tog { display: inline-flex; align-items: center; gap: 7px; min-height: 22px; padding: 0 2px; }
.tog > i {
  width: 13px; height: 13px; flex: none; background: var(--bg);
  border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts);
}
.tog.on > i { border-color: var(--bs) var(--ts) var(--ts) var(--bs); background: var(--amber); }
.tog.radio > i { transform: rotate(45deg) scale(0.86); }
.tog:hover > i { filter: brightness(1.12); }
.tog.off { color: color-mix(in srgb, var(--fg) 42%, var(--bg)); }

/* ── Gauges ──────────────────────────────────────────────────────────────── */
.gauge {
  height: 14px; background: var(--w-bg); border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs);
  position: relative; overflow: hidden; min-width: 30px; --gc: var(--k-bg);
}
.gauge > i { position: absolute; left: 0; top: 0; bottom: 0; width: var(--f, 0%); background: var(--gc); }
.gauge > i::after { content: ''; position: absolute; inset: 0; border-top: 1px solid rgba(255, 255, 255, 0.35); border-bottom: 1px solid rgba(0, 0, 0, 0.3); }
.gauge.seg > i { -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px); }
.gauge > span { position: absolute; inset: 0; display: grid; place-items: center; font: 500 10px/1 var(--font-mono); color: #fff; text-shadow: 1px 1px 0 #000, -1px 0 0 #000, 0 -1px 0 #000; }
.gauge.thin { height: 8px; }
.gauge.amber { --gc: var(--amber); } .gauge.bad { --gc: var(--bad); } .gauge.warn { --gc: var(--warn); } .gauge.good { --gc: var(--good); }

/* ── Notebook tabs ───────────────────────────────────────────────────────── */
.tabs { display: flex; align-items: flex-end; gap: 1px; padding: 6px 8px 0; flex: none; border-bottom: 2px solid var(--ts); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 2px solid; border-color: var(--ts) var(--bs) var(--ts) var(--ts); border-bottom: 0;
  padding: 2px 11px 2px; background: var(--sel); color: color-mix(in srgb, var(--fg) 78%, var(--bg)); font-weight: 500; white-space: nowrap; margin-bottom: 0;
}
.tab:hover { color: var(--fg); }
.tab.on { background: var(--bg); color: var(--fg); padding: 4px 11px 4px; margin-bottom: -2px; font-weight: 600; position: relative; }
.tabpage { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }

/* ── Menus and option menus ──────────────────────────────────────────────── */
.menu {
  position: fixed; z-index: 9000; background: var(--c-bg); color: var(--c-fg); padding: 2px; min-width: 120px;
  border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
  max-height: calc(70vh / var(--ui-scale, 1)); overflow-y: auto;
}
.mi { border: 2px solid transparent; padding: 1px 12px 1px 8px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mi:hover { border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); }
.mi.off { color: color-mix(in srgb, var(--c-fg) 42%, var(--c-bg)); }
.mi.off:hover { border-color: transparent; }
.mi .acc { margin-left: auto; padding-left: 18px; font-size: 11px; color: var(--dim); }
.mi.on::before { content: ''; width: 7px; height: 7px; background: var(--amber); border: 1px solid var(--c-bs); margin-left: -4px; transform: rotate(45deg); }
.menu.marks .mi:not(.on) { padding-left: 23px; }
.opt { justify-content: space-between; padding: 2px 6px 2px 8px; gap: 10px; }
.opt::after { content: ''; width: 12px; height: 7px; flex: none; background: var(--bg); border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); }

/* ── Tooltips ────────────────────────────────────────────────────────────── */
.tip {
  position: fixed; z-index: 9999; background: #f2e8bd; color: #191b24; border: 1px solid #10131c; padding: 3px 7px;
  font-size: 12px; line-height: 1.35; max-width: 340px; pointer-events: none !important; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45); white-space: pre-line;
}
.tip .dim { color: #6a6650; }
.tip { --dim-here: #6a6650; }
.tip .bad { color: #a8281c; } .tip .good { color: #2f6b34; }
.tip b { font-weight: 600; }
.tip-costs { margin-top: 3px; border-top: 1px solid #b9ad7c; padding-top: 3px; }
.tip-cost { display: flex; justify-content: space-between; gap: 18px; font-variant-numeric: tabular-nums; }

/* ── Scrollbars ──────────────────────────────────────────────────────────── */
#ui ::-webkit-scrollbar { width: 17px; height: 17px; }
#ui ::-webkit-scrollbar-track { background: var(--c-sel); border: 2px solid; border-color: var(--c-bs) var(--c-ts) var(--c-ts) var(--c-bs); }
#ui ::-webkit-scrollbar-thumb { background: var(--c-bg); border: 2px solid; border-color: var(--c-ts) var(--c-bs) var(--c-bs) var(--c-ts); min-height: 24px; }
#ui ::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--c-bg) 86%, #fff); }
#ui ::-webkit-scrollbar-thumb:active { background: var(--c-sel); }
#ui ::-webkit-scrollbar-corner { background: var(--c-bg); }
#ui ::-webkit-scrollbar-button { display: none; }
#ui ::-webkit-scrollbar-button:single-button { display: block; width: 17px; height: 15px; background-color: var(--c-sel); background-repeat: no-repeat; background-position: center; }
#ui ::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='11'%3E%3Cpath d='M6.5 1 12 10H1Z' fill='%235d6780'/%3E%3Cpath d='M6.5 1 1 10' stroke='%238e98b1' stroke-width='1.6' fill='none'/%3E%3Cpath d='M1 10H12L6.5 1' stroke='%232b3144' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); border: 2px solid; border-color: var(--c-bs) var(--c-ts) transparent var(--c-bs); }
#ui ::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='11'%3E%3Cpath d='M6.5 10 12 1H1Z' fill='%235d6780'/%3E%3Cpath d='M1 1H12' stroke='%238e98b1' stroke-width='1.6' fill='none'/%3E%3Cpath d='M1 1 6.5 10' stroke='%238e98b1' stroke-width='1.6' fill='none'/%3E%3Cpath d='M12 1 6.5 10' stroke='%232b3144' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); border: 2px solid; border-color: transparent var(--c-ts) var(--c-ts) var(--c-bs); }
#ui ::-webkit-scrollbar-button:single-button:horizontal { width: 15px; height: 17px; }
#ui * { scrollbar-color: var(--c-bg) var(--c-sel); }
@supports selector(::-webkit-scrollbar) { #ui * { scrollbar-color: auto; } }

/* ── Item tiles and cost chips ───────────────────────────────────────────── */
.tile {
  --tc: var(--cat-raw); width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; position: relative;
  background: var(--tc); color: #10131c; font: 600 10.5px/1 var(--font-ui); letter-spacing: -0.2px; white-space: nowrap; overflow: hidden;
  border: 1px solid; border-color: color-mix(in srgb, var(--tc) 50%, #fff) color-mix(in srgb, var(--tc) 55%, #000) color-mix(in srgb, var(--tc) 55%, #000) color-mix(in srgb, var(--tc) 50%, #fff);
  outline: 1px solid #10131c; outline-offset: 0; margin: 1px;
}
.tile.c-raw { --tc: var(--cat-raw); } .tile.c-mat { --tc: var(--cat-mat); } .tile.c-comp { --tc: var(--cat-comp); }
.tile.c-kit { --tc: var(--cat-kit); } .tile.c-data { --tc: var(--cat-data); }
.tile.unk { --tc: #353c50; color: #7f89a3; }
.tile.sm { width: 22px; height: 22px; font-size: 10px; }
.tile.lg { width: 46px; height: 46px; font-size: 17px; letter-spacing: -0.3px; }
.tile.lg > b { position: absolute; top: 1px; left: 3px; font: 500 8px/1 var(--font-mono); opacity: 0.7; }
.tile.link:hover { filter: brightness(1.18); outline-color: var(--amber); z-index: 1; }
.tile.w3 { font-size: 9.5px; letter-spacing: -0.6px; } .tile.sm.w3 { font-size: 8.5px; letter-spacing: -0.7px; } .tile.lg.w3 { font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 3px; font: 500 11px/1 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.short > span:not(.tile) { color: var(--bad); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 3px 9px; align-items: center; }
.btn .chips { flex-wrap: nowrap; }
.btn.off .chip.short > span:not(.tile) { color: color-mix(in srgb, var(--bad) 80%, var(--bg)); }
.qty { display: inline-flex; align-items: center; gap: 1px; font: 500 10.5px/1 var(--font-mono); }
.qty > span { opacity: 0.85; }

/* ── Windows ─────────────────────────────────────────────────────────────── */
.desk { position: absolute; inset: 0; pointer-events: none !important; overflow: hidden; }
.desk > * { pointer-events: auto; }
.win {
  --bg: var(--p-bg); --ts: var(--p-ts); --bs: var(--p-bs); --sel: var(--p-sel); --fg: var(--p-fg);
  position: absolute; display: flex; flex-direction: column; min-width: 180px; min-height: 80px;
  background: var(--bg); color: var(--fg); padding: 4px;
  border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts);
  box-shadow: 0 0 0 1px #07080d, 4px 4px 0 rgba(0, 0, 0, 0.28);
}
.win.active { --bg: var(--a-bg); --ts: var(--a-ts); --bs: var(--a-bs); --sel: var(--a-sel); --fg: var(--a-fg); }
.win.opening { animation: winopen 0.11s steps(4) both; }
@keyframes winopen { from { clip-path: inset(46% 46% 46% 46%); } to { clip-path: inset(-8px); } }
.win-title { display: flex; height: 22px; flex: none; }
.win-tb { width: 22px; flex: none; background: var(--bg); border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); position: relative; }
.win-tb:hover { background: color-mix(in srgb, var(--bg) 86%, #fff); }
.win-tb:active { border-color: var(--bs) var(--ts) var(--ts) var(--bs); background: var(--sel); }
.win-tb::after { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--bg); border: 1px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts); }
.win-tb.menu-b::after { width: 12px; height: 4px; }
.win-tb.min-b::after { width: 4px; height: 4px; }
.win-tb.max-b::after { width: 12px; height: 12px; }
.win.maxed .win-tb.max-b::after { border-color: var(--bs) var(--ts) var(--ts) var(--bs); }
.win-name {
  flex: 1 1 0; min-width: 0; border: 2px solid; border-color: var(--ts) var(--bs) var(--bs) var(--ts);
  text-align: center; font-weight: 600; line-height: 17px; padding: 0 8px; cursor: default; touch-action: none;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.win-client {
  flex: 1 1 0; min-height: 0; background: var(--c-bg); color: var(--c-fg); display: flex; flex-direction: column; overflow: hidden;
  --bg: var(--c-bg); --ts: var(--c-ts); --bs: var(--c-bs); --sel: var(--c-sel); --fg: var(--c-fg);
  border: 2px solid; border-color: var(--bs) var(--ts) var(--ts) var(--bs);
}
.win .win-client { border-color: var(--p-bs) var(--p-ts) var(--p-ts) var(--p-bs); }
.win.active .win-client { border-color: var(--a-bs) var(--a-ts) var(--a-ts) var(--a-bs); }
/* Resize handles: edges, plus an L at each corner with the classic notch. */
.rz { position: absolute; z-index: 2; touch-action: none; }
.rz.n { top: -2px; left: 26px; right: 26px; height: 6px; cursor: ns-resize; }
.rz.s { bottom: -2px; left: 26px; right: 26px; height: 6px; cursor: ns-resize; }
.rz.w { left: -2px; top: 26px; bottom: 26px; width: 6px; cursor: ew-resize; }
.rz.e { right: -2px; top: 26px; bottom: 26px; width: 6px; cursor: ew-resize; }
.rz.nw, .rz.se { cursor: nwse-resize; } .rz.ne, .rz.sw { cursor: nesw-resize; }
.rz.h { width: 28px; height: 6px; } .rz.v { width: 6px; height: 28px; }
.rz.nw { top: -2px; left: -2px; } .rz.ne { top: -2px; right: -2px; } .rz.sw { bottom: -2px; left: -2px; } .rz.se { bottom: -2px; right: -2px; }
.rz.h::after, .rz.v::after { content: ''; position: absolute; }
.rz.h::after { top: 0; width: 2px; height: 6px; border-left: 1px solid var(--bs); border-right: 1px solid var(--ts); }
.rz.v::after { left: 0; height: 2px; width: 6px; border-top: 1px solid var(--bs); border-bottom: 1px solid var(--ts); }
.rz.nw.h::after, .rz.sw.h::after { right: 0; } .rz.ne.h::after, .rz.se.h::after { left: 0; }
.rz.nw.v::after, .rz.ne.v::after { bottom: 0; } .rz.sw.v::after, .rz.se.v::after { top: 0; }
.win.fixed .rz { display: none; }
.win.maxed .rz { display: none; }

/* Minimised windows sit on the desktop as icons. */
.deskicons { position: absolute; left: 10px; bottom: calc(var(--fp-h, 96px) + 10px); display: flex; flex-direction: row; flex-wrap: wrap-reverse; gap: 8px; max-width: 420px; pointer-events: none !important; }
.deskicon { pointer-events: auto; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.deskicon > div { background: var(--p-bg); border: 2px solid; border-color: var(--p-ts) var(--p-bs) var(--p-bs) var(--p-ts); padding: 4px; box-shadow: 0 0 0 1px #07080d; }
.deskicon > span { font-size: 11px; background: var(--p-bg); color: var(--p-fg); padding: 0 4px; border: 1px solid #07080d; max-width: 74px; }
.deskicon:hover > div { background: color-mix(in srgb, var(--p-bg) 86%, #fff); }

/* ── Dialogs ─────────────────────────────────────────────────────────────── */
.modal { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(5, 6, 10, 0.45); z-index: 8000; }
.modal .win { position: relative; max-width: min(560px, calc(94vw / var(--ui-scale, 1))); }
.dlg { padding: 14px 14px 8px; display: flex; gap: 14px; align-items: flex-start; }
.dlg-body { flex: 1; min-width: 0; line-height: 1.45; }
.dlg-body p { margin: 0 0 8px; }
.dlg-btns { display: flex; justify-content: center; gap: 10px; padding: 6px 10px 10px; flex-wrap: wrap; }
.dlg-btns .btn { min-width: 84px; }
.prose { font: 400 14.5px/1.5 var(--font-log); color: #fbf5e4; }

/* ── Small screens: windows become full-width sheets ─────────────────────── */
.compact .win { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - var(--fp-h, 96px)) !important; }
.compact .win .rz { display: none; }
.compact .modal .win { width: auto !important; height: auto !important; }
.compact .deskicons { display: none; }
.modal .win { height: auto; min-height: 0; }
.modal .win .win-client { flex: none; overflow: visible; }

