:root {
  /* Stacking layers, low to high. Every z-index in this file and src/ui/controls/*.css reads one (guard: test/zlayers.test.ts).
     in1 to in4: order inside one element (sticky table heads, a window's grip and controls, a drawer). hud: text and controls over
     space (arrival banner, first-person title, key hints, cinematic hint, fleet warp, jump overlay), under every window. win: the
     windows, stacked from here by the window manager (src/ui/wm.ts) below bar. bar: top bar and dock. title, titlemenu: the title
     cover and the menus over it. guide: the guide panel (its highlights take the z of the window they ring, src/ui/onboard.ts).
     menu: the context menu. modal, modal2: dialogs and the picker opened over one. pop: what a control opens in any layer (a
     dropdown list, a tooltip, the hold cue), so it shows over a dialog. drag: the drag ghost. mark: the release watermark. */
  --z-hud: 100; --z-title: 9000;
  --bg: rgba(11, 13, 17, 0.9); --line: #2c323c; --text: #d9d5c9; --dim: #8a8f98;
  --amber: #ffb454; --good: #7fd88f; --bad: #ff5a48;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05060a; color: var(--text); font: 12px/1.35 var(--sans); user-select: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > div { position: absolute; pointer-events: auto; }
/* --top and --dock are set from the measured top bar and dock. --rcol is the right column of HUD panels. */
#ui { }
.panel { background: var(--bg); border: 1px solid var(--line); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); } .good { color: var(--good); } .bad { color: var(--bad); }
button { font: 11px var(--sans); color: var(--text); background: #1c2129; border: 1px solid #3a424e; padding: 3px 8px; cursor: pointer; letter-spacing: 0.02em; }
button:hover { border-color: var(--amber); color: #fff; }
button.pri { background: #3a2a10; border-color: var(--amber); color: var(--amber); }
button.warn { border-color: #7a2a22; color: var(--bad); }
button.on { background: var(--amber); color: #14100a; border-color: var(--amber); }
button:disabled { opacity: 0.35; cursor: default; border-color: #3a424e; color: var(--text); }
.bar { position: relative; height: 14px; background: #0c0e12; border: 1px solid #2c323c; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.bar span { position: absolute; inset: 0; font: 10px/12px var(--mono); text-align: center; color: #fff; text-shadow: 0 0 3px #000; }
/* Numbers keep their columns; a long name with its tags stays on one line, cut, with the whole in the row's tooltip. */
/* --lift: set by wm.ts where the panel would meet the ship console (a narrow screen): it moves up by that much and keeps its top. */
/* The details scroll; the actions stay in view at the bottom. */
/* The system line in the HUD Location section (`placeLine`): its parts spaced as in the top bar. */
/* The station's and the refit window's base layout, kept under the width-class rules (`.mw`, `.nw`) and named columns by `:where`. */
#splash { inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4, 5, 8, 0.72); z-index: var(--z-title); }
#splash .box { width: 440px; padding: 28px; text-align: center; }
#splash h1 { font: 700 34px var(--mono); letter-spacing: 0.4em; color: var(--amber); margin: 0 0 6px; }
#splash button { font-size: 13px; padding: 8px 22px; margin: 14px 4px 0; } .off { color: #4a4f58; text-decoration: line-through; }

/* Glass HUD */
.panel { background: linear-gradient(180deg, rgba(14, 19, 27, 0.66), rgba(8, 11, 16, 0.72)); border: 1px solid rgba(150, 190, 230, 0.16); backdrop-filter: blur(14px) saturate(1.25); -webkit-backdrop-filter: blur(14px) saturate(1.25); box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05); }
button { background: rgba(30, 38, 50, 0.7); border-color: rgba(150, 190, 230, 0.22); }
button.pri { background: rgba(120, 80, 20, 0.35); }

/* Minimal white glass theme. Colour is reserved for meaning: hostile, damage, good or bad, security. */
:root { --text: #e9eff5; --dim: rgba(222, 233, 245, 0.52); --amber: #ffffff; --good: #9be7b8; --bad: #ff7466; --line: rgba(255, 255, 255, 0.12); --glass: rgba(14, 20, 28, 0.36); }
html, body { color: var(--text); font-weight: 400; letter-spacing: 0.01em; }
.panel { background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08); clip-path: none; border-radius: 2px; }
button { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.88); border-radius: 2px; transition: background 0.12s, border-color 0.12s; }
button:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.6); color: #fff; }
button.pri { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.7); color: #fff; }
button.pri:hover { background: rgba(255, 255, 255, 0.9); color: #0b1016; }
button.on { background: rgba(255, 255, 255, 0.92); border-color: #fff; color: #0b1016; }
button.warn { border-color: rgba(255, 116, 102, 0.5); color: var(--bad); }
button:disabled { opacity: 0.28; border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.88); background: none; }
/* A sticky header row hides the rows that scroll under it. */ .off { color: rgba(255, 255, 255, 0.22); }
.bar { background: rgba(255, 255, 255, 0.08); border: none; height: 12px; }
#splash { background: rgba(4, 6, 10, 0.55); } #splash h1 { color: #fff; font-weight: 400; letter-spacing: 0.6em; }

/* Ship console */

/* Fitting */

/* Segmented meters: every bar is a row of micro pills. */
.bar { height: 5px; background: rgba(255, 255, 255, 0.1); -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px); border-radius: 0; }
.bar span { display: none; }
/* Monochrome data: emphasis by weight and opacity, not hue. */

/* Window manager. Every window is a column: a fixed header and a body that scrolls inside the window. */
/* Dock: one button per window, the menu at the bottom. A lit bar marks an open window, a short dim one a minimised window. */
/* A glass element, or the tooltip, with no content is never shown (a blurred empty square otherwise). */
:is(.panel):empty { display: none !important; }
/* Split panes: a tree on the left, a splitter, the detail on the right. Below 540px of width the tree becomes an overlay. */
/* Tree */

/* Icons */
/* Debug */
/* Fitting: slot callouts around the hull */
/* Slot labels on the diagram's axis, in HTML so they keep their size while the drawing stretches. */
/* Industry planner */
button.start { margin-left: auto; padding: 7px 22px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }

/* Native feel: nothing is selectable except long-form text and inputs. */
html, body, #ui, #ui * { -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
input { -webkit-user-select: text; user-select: text; }
body { cursor: default; -webkit-touch-callout: none; overscroll-behavior: none; }
/* Context menu */
/* Industry graph */
/* The note takes the rest of the row, or a row of its own when the name leaves it too little room. */

/* Info sheets */
/* Planets */

/* Heat and buffs */

/* Factions and agents */

/* Give box */
/* The system's name on arrival: an on-air caption at the upper left, clear of the subject. */
/* The system view's title bar (src/ui/ui.ts `sysViewBar`): top centre of the free area until moved. */
/* The system view in the top bar (src/ui/ui.ts `sysViewTop`): one row; the place line shortens first, the controls never drop. */
/* A full screen view: the underside of the top bar breathes a glow in the look's yellow (`fullView`) while it shows (a static glow
   with reduced motion); the mark keeps a plain yellow outline at `tint`; minimise and close are plain controls. Opacity of a glow
   layer only, a line along the bar, apart from the guide's pale blue pulsing ring. */
/* The view's controls sit in the row after the wallet and the training line (not the windows' absolute corner of `.wctl`); those
   items shorten with an ellipsis before anything overlaps. */
/* The short form the banner settles to after its reading time: smaller and quieter, until it fades. */
/* Planet view windows */

/* Scanner window over the system view, and the hacking window. */
/* Narrow screens: the console sits between the left and right columns; column panels stay above it (wm.ts stack). */

/* One scrollbar for every scrolling element. */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.22); border-radius: 0; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }
*::-webkit-scrollbar-track, *::-webkit-scrollbar-corner { background: transparent; }
/* Fitting in space, at a capital's refit bay: the station fitting tab in a window of its own. */
/* Star map: the map shrinks on short screens so it and its key fit without scrolling. */
/* Star map zoom and pan (src/ui/mapview.ts): the map owns its drag and pinch; hidden system names show on hover or focus. */
/* Structure status: layers, state and timers of a base, the same in every window. */
/* Status chips, effective security, faction stages */
/* Warp disruption, refusals, align progress, line of fire */
/* Speed gauge: the arc is the throttle. */
/* Round status badges: dark glass disc with a soft glow by tone, one arc on the glow's edge for a share or countdown (no track),
   text in the tooltip. */
/* Cinematic camera: no interface. */
body.title #ui > :not(#splash):not(#menu):not(#settings):not(#guide):not(#mark):not(#report) { visibility: hidden !important; }
/* The title is one on-air line over the picture: no panel, no scrim. */
#splash { background: none; cursor: pointer; }
/* The input hint (src/ui/hint.ts): a glass strip of key caps and what they do, clear of the dock bar. */
#hint { position: fixed; left: 0; right: 0; width: fit-content; margin: 0 auto; bottom: 64px; transform: translateX(var(--hx, 0px)); z-index: var(--z-hud); pointer-events: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; max-width: min(92vw, 1000px); padding: 9px 16px; font: var(--hs)/1.35 var(--sans); color: var(--hc); text-shadow: 0 1px 2px rgb(0 0 0 / var(--hshade)); white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.18s, visibility 0s 0.18s; }
#hint.on { opacity: 1; visibility: visible; transition: opacity 0.18s; }
/* The name of a view on entering it (src/ui/hint.ts). */
@media (prefers-reduced-motion: reduce) { #hint, #hint.on { transition: none; } }
/* Dock entry state mark, and key hints in menus. */
/* Slider: thin track, bright fill, small handle, monospace value. --p is the position. */
/* Debug Flows page */
/* Settings window */
/* Debug tools: result line of the last action on the page, the picked row of a table */
/* Menu: one column of buttons. */

/* Module button: face and icon only at rest. A state lights the face and puts a soft glow round it in its tone (`rt-*` from
   `modLook`); a sweep (cycle, paste repair, reactivation delay) is the one arc, on the glow's inner edge. Damage is a tint rising
   in the face, heat a small bar on top, the reason a mark at the upper right, charges at the lower right. A short pulse on change. */
/* Health lost: a tint that rises from the bottom of the face to the share lost, its top edge brighter. */
/* Overheat: a short bar on top, hollow when set for the next cycle, lit while the module runs hot. */
/* Effects on a target: small discs that glow by tone, hostile from the left and assisting from the right, under the lock card so
   the strip keeps its height. Yours glow brighter with a dot. Every kind keeps a slot, so a change fades in place. */

/* Sound test page of the debug window (src/ui/soundtest.ts) */

/* Work on targets (targetui.ts): the lock number in its colour key, one icon per module of yours on the lock with its cycle as a
   sweep and its state as a tone, then your drones. The same key marks module buttons, drone rows, overview rows and brackets. */
/* Market window sub tabs (marketui.ts) */
/* Jobs desk (jobsui.ts) */
/* Industry screen grouping (industryTab) */

/* Interface system: tokens and the shared components of src/ui/html.ts. DESIGN.md "Interface rules" says what to use for what. */
:root { --s2: 4px; --s3: 6px; --s4: 8px; --s5: 12px; --fs-sm: 10px;
  /* Relation toward you (src/data/stance.ts): one colour each, read by lists and the canvas brackets. */
}
/* The owner control (src/ui/controls/owner.ts) and the chip that marks a row's owner in a mixed list. */
.form { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--s3) var(--s5); align-items: start; }
.hint { font-size: var(--fs-sm); line-height: 1.4; color: var(--dim); white-space: normal; }
.why { font: var(--fs-sm)/1.4 var(--sans); color: var(--bad); white-space: normal; text-align: left; }
.mt { margin-top: var(--s4); }
.hint.mt { margin-top: var(--s2); } .wrap { white-space: normal; } .my { margin: var(--s4) 0; }
/* A form or text inside a settings group lines up with its rows: labels past the change mark (`.srst` and the row gap). */
/* Active effects on a ship (effectsui.ts): tone mark, name, source, time, then what it changes. */
/* The HUD info stack (src/ui/hudstack.ts): no frame, text over the scene with the HUD's shadow and a faint backing on the left. */
/* Spacing between blocks of a page: a note, a key-value block, a table and a hint never touch. */
/* A wide table scrolls sideways inside its page instead of being cut. */
/* The job terms card (`JobsUI.cardHtml`). */
/* The Pilot window (pilotui.ts). */

/* The onboarding guide (src/ui/onboard.ts): its panel in the hint's glass, white on glass, the highlight rings, cues and labels. */
/* Touch and pen (src/ui/touch.ts): what owns its gesture takes the finger from the browser; no long press callout; the hold cue; menu
   items tall enough for a finger on a coarse pointer. */
 #ui { -webkit-touch-callout: none; }

/* Page guards (src/ui/pageguard.ts): no page zoom by pinch or double tap, no pull to refresh, bounce or history swipe; the
   interface inside the notch and the home indicator while the picture fills the screen. */
html { touch-action: pan-x pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
#ui { inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
/* A job in progress in its window (src/ui/jobsui.ts `progressBlock`): the stages named under the dots. */
/* The release line (src/ui/ui.ts `markText`): over everything, takes no input, inside the margin windows keep. */
/* The feedback window (src/ui/reportui.ts). */
/* The send row stays in view at the bottom of the window while the parts above it scroll. */
/* A file dragged over the window: the whole window takes it. */
/* The Feedback dock entry (look report.dock): a teal glyph on a tile with a solid rim, set apart at the dock's foot; a red dot while
   errors logged since the last report wait. Unlike the guide's pale blue ring and the system view's yellow glow, it does not glow. */
/* The account window (src/ui/accountui.ts). */
/* Layout at any window size (DESIGN.md interface rules, Layout). wm.ts marks a window `nw` under look `windows.narrow` px of its own
   width and `xn` under `windows.tight`: these rules read the window's width, not the screen's. */
/* A text field or text area in a form row takes the row's width. */
/* Forms put the label over its field. */
/* Column layouts stack. */
/* Tables: cells marked `wrap` wrap at a readable width (below), the rest keep one line; a table still too wide scrolls sideways in
   the pane that scrolls it, with the header row and, under `nw`, the first column kept in view (one scroller, so both stay sticky). */
/* Tab rows wrap. */
/* Window controls and tabs big enough for a finger on a coarse pointer. */
/* Star map: the map and its side panel side by side; under `mw` the panel goes under the map. */
/* The resize grip never sits over the last row: the body keeps room for it at its end. */
/* A wrapping text cell keeps a readable width; the jobs table's first column too. */
/* A small free area (wm.ts `small`, under look `windows.full` px): the station window takes the width the ship panel kept. */
/* Fitting (station tab and the refit window): hardware, the fit, its figures. Under `mw` the figures go under the other two; under
   `nw` all three stack and the tab scrolls. */
/* Industry planner: inputs, blueprint, outputs in a row; under `nw` one column with the flow arrows turned down. */
/* A small free area: the ship console is centred in it (no room beside the right column); the Selected panel rises above it. */

/* The game's controls (src/ui/controls). Nothing native shows: the hidden input only takes keys and input method text. */
/* Number: mono, right aligned, unit after it, steppers at the end. */
/* Search: a lens before the text and a clear mark while it holds text. */
/* Multi-line text. */
/* A field with its reason line under it. */
/* Dropdown: a field-shaped button, and one floating list. */
/* Checkbox and toggle. */
/* Modal prompt and confirm: the title, a part that scrolls, the actions always in view. --kmgap is look `windows.dialogGap`. */
:root { }
 #ui button:focus-visible { outline: 1px solid rgba(127, 216, 255, 0.8); outline-offset: 1px; }
/* Price field button and the price picker. */
/* Tooltips that were the browser's: plain text under the element. */
