:root {
  color-scheme: dark;
  /* Studio visual contract. Keep the legacy aliases below because the library's
     geometry tools use them throughout their existing DOM and interaction code. */
  --ui-bg-base: #0d0d0f;
  --ui-bg-surface: #141416;
  --ui-bg-elevated: #242428;
  --ui-bg-overlay: #242428;
  --ui-bg-control: #27272b;
  --ui-bg-input: #1a1a1d;
  --ui-border-subtle: rgba(255, 255, 255, 0.06);
  --ui-border-default: rgba(255, 255, 255, 0.10);
  --ui-border-strong: rgba(255, 255, 255, 0.18);
  --ui-text-primary: #f0f0f2;
  --ui-text-secondary: #8b8b96;
  --ui-text-muted: #5c5c68;
  --ui-accent: #7c6af7;
  --ui-accent-hover: #9181f8;
  --ui-accent-muted: rgba(124, 106, 247, 0.16);
  --ui-accent-ring: rgba(124, 106, 247, 0.35);
  --ui-success: #b8f0d0;
  --ui-radius-sm: 7px;
  --ui-radius-md: 10px;
  --ui-radius-lg: 13px;
  --ui-shadow-sm: 0 1px 2px rgba(0,0,0,.28), 0 1px 3px rgba(0,0,0,.18);
  --ui-shadow-md: 0 4px 12px rgba(0,0,0,.34), 0 2px 6px rgba(0,0,0,.22);
  --ui-shadow-lg: 0 12px 32px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.28);
  --ui-inset-highlight: inset 0 1px 0 rgba(255,255,255,.05);
  --ui-transition: border-color .15s cubic-bezier(.16,1,.3,1), background-color .15s cubic-bezier(.16,1,.3,1), color .15s cubic-bezier(.16,1,.3,1), filter .15s cubic-bezier(.16,1,.3,1), opacity .15s cubic-bezier(.16,1,.3,1), box-shadow .15s cubic-bezier(.16,1,.3,1);
  --bg: var(--ui-bg-base);
  --panel: var(--ui-bg-surface);
  --line: var(--ui-border-default);
  --line-strong: var(--ui-border-strong);
  --text: var(--ui-text-primary);
  /* Legacy `--muted` is used for readable labels and helper copy, so map it to
     Studio secondary text. `--ui-text-muted` remains available for tertiary chrome. */
  --muted: var(--ui-text-secondary);
  --muted-2: var(--ui-text-secondary);
  --mint: var(--ui-accent);
  --mint-strong: #ded9ff;
  --blue: var(--ui-accent-hover);
  --amber: #efc66f;
  --red: #ee7676;
  --mono: var(--font-mono);
  --sans: var(--font-sans);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input { font: inherit; }
button { color: inherit; }

.aircraft-library {
  width: 100%; height: 100%; display: grid;
  grid-template: 58px minmax(0, 1fr) / 292px minmax(430px, 1fr) 356px;
  background:
    radial-gradient(circle at 52% 38%, rgba(79, 71, 128, 0.10), transparent 36%),
    linear-gradient(135deg, #070b0f 0%, #091017 55%, #070b0f 100%);
}
.aircraft-library.engineering-collapsed { grid-template-columns: 292px minmax(430px,1fr) 34px; }

.library-header {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between;
  min-width: 0; padding: 0 18px; border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 15, 0.92); backdrop-filter: blur(18px); z-index: 10;
}
.library-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.library-back {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 5px; color: var(--muted-2); text-decoration: none; transition: 120ms ease;
}
.library-back:hover, .library-back:focus-visible { color: var(--mint-strong); border-color: rgba(124,106,247,.5); outline: none; }
.library-brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid rgba(124,106,247,.35);
  border-radius: 7px; background: linear-gradient(145deg, rgba(124,106,247,.17), rgba(73,63,121,.1));
  color: var(--mint-strong); font: var(--fw-semibold) var(--fs-lg)/1 var(--mono);
}
.library-brand > div { display: grid; gap: 3px; }
.library-brand strong { font-size: var(--fs-md); letter-spacing: .01em; }
.library-brand div span { color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .08em; white-space: nowrap; }
.library-header-meta { display: flex; align-items: center; gap: 15px; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
.library-health { display: flex; align-items: center; gap: 7px; color: var(--muted-2); }
.library-health i { width: 6px; height: 6px; border-radius: 50%; background: #68757d; box-shadow: 0 0 0 4px rgba(104,117,125,.08); }
.library-health[data-state="ready"] i { background: var(--mint); box-shadow: 0 0 0 4px rgba(124,106,247,.10); }
.library-health[data-state="error"] i { background: var(--red); }

.variant-browser, .engineering-panel { min-height: 0; background: rgba(10, 16, 22, 0.93); }
.variant-browser { display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.browser-heading { padding: 22px 18px 15px; }
.browser-heading h1 { margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.025em; }
.asset-kind-tabs {
  display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; margin: 0 16px 10px;
  padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.012);
}
.asset-kind-tabs button {
  height: 30px; border: 1px solid transparent; border-radius: 4px; background: transparent;
  min-width: 0; padding: 0 2px; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); cursor: pointer;
}
.asset-kind-tabs button:hover { color: var(--text); }
.asset-kind-tabs button:focus-visible { outline: 1px solid var(--blue); outline-offset: 1px; color: var(--text); }
.asset-kind-tabs button.active {
  border-color: rgba(124,106,247,.25); background: rgba(124,106,247,.09); color: var(--mint-strong);
}
.variant-search { height: 36px; display: flex; align-items: center; gap: 7px; margin: 0 16px 10px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.018); color: var(--muted); }
.variant-search:focus-within { border-color: rgba(124,106,247,.4); box-shadow: 0 0 0 2px rgba(124,106,247,.05); }
.variant-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: var(--fs-2xs); }
.variant-search input::placeholder { color: #64737d; }
.variant-rail { min-height: 0; flex: 1; overflow: auto; padding: 0 10px 18px; scrollbar-width: thin; scrollbar-color: #30404a transparent; }
.family-group { margin-bottom: 9px; }
.family-label { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 8px 7px 5px; border: 0; outline: 0; background: transparent; color: #71818b; font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .12em; text-align: left; }
.family-label[data-terminal-group-toggle] { display: grid; grid-template-columns: minmax(0,1fr) auto 10px; gap: 7px; border-radius: 4px; cursor: pointer; }
.family-label[data-terminal-group-toggle] span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-label[data-terminal-group-toggle]:hover { background: rgba(255,255,255,.025); color: var(--muted-2); }
.family-label[data-terminal-group-toggle]:focus-visible { box-shadow: inset 0 0 0 1px rgba(145,129,248,.56); color: var(--text); }
.family-label[data-terminal-group-toggle] i { width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-1px); transition: transform 120ms ease; }
.family-label[data-terminal-group-toggle][aria-expanded="false"] i { transform: rotate(-45deg) translate(-1px,-1px); }
.family-label b { color: #53616a; font-weight: var(--fw-semibold); }
.family-assets[hidden] { display: none; }
.variant-card { width: 100%; display: grid; grid-template-columns: 41px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 58px; margin: 4px 0; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: rgba(255,255,255,.016); text-align: left; cursor: pointer; transition: 130ms ease; }
.variant-card:hover { border-color: var(--line); background: rgba(255,255,255,.035); }
.variant-card.active { border-color: rgba(124,106,247,.36); background: linear-gradient(90deg, rgba(124,106,247,.12), rgba(124,106,247,.025)); box-shadow: inset 2px 0 var(--mint); }
.variant-thumb { width: 41px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: radial-gradient(circle, rgba(145,129,248,.1), transparent 70%); color: #92a9b5; }
.variant-thumb svg { width: 34px; height: 24px; fill: currentColor; opacity: .88; }
.variant-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 3px; }
.variant-thumb-pending { color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .06em; }
.variant-thumb svg.terminal-icon { width: 34px; height: 27px; }
.variant-thumb svg.terminal-person-icon { width: 24px; height: 29px; }
.variant-card.active .variant-thumb { color: var(--mint-strong); }
.variant-copy { min-width: 0; display: grid; gap: 4px; }
.variant-copy strong { overflow: hidden; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); text-overflow: ellipsis; white-space: nowrap; }
.variant-copy span { overflow: hidden; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.variant-state { min-width: 0; max-width: 5.5em; display: grid; justify-items: end; gap: 6px; }
.variant-state b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
.variant-state em { padding: 3px 4px; border: 1px solid rgba(130,102,255,.32); border-radius: 3px; color: var(--blue); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); font-style: normal; letter-spacing: .06em; }
.variant-state em[data-completion-state="finish"] { border-color: var(--ui-accent-ring); background: var(--ui-accent-muted); color: #ded9ff; }
.variant-state em[data-completion-state="processing"] { border-color: rgba(145,129,248,.38); background: rgba(145,129,248,.07); color: var(--blue); }
.variant-state em[data-completion-state="processing-v1"] { border-color: rgba(239,198,111,.52); background: rgba(239,198,111,.10); color: var(--amber); box-shadow: 0 0 10px rgba(239,198,111,.08); }
.variant-state i { width: 6px; height: 6px; border-radius: 50%; background: #68757d; }
.variant-state i.published { background: var(--mint); }
.variant-state i.estimated { background: var(--amber); }
.browser-legend { display: flex; gap: 13px; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
.browser-legend span { display: flex; align-items: center; gap: 5px; }
.browser-legend i { width: 5px; height: 5px; border-radius: 50%; }
.browser-legend .is-published { background: var(--mint); }.browser-legend .is-estimated { background: var(--amber); }
.variant-empty { display: grid; gap: 7px; padding: 30px 12px; color: var(--muted); text-align: center; }
.variant-empty strong { color: var(--muted-2); font-size: var(--fs-2xs); }.variant-empty span { font-size: var(--fs-2xs); line-height: 1.5; }

.aircraft-stage { min-width: 0; min-height: 0; position: relative; display: grid; grid-template-rows: 69px 36px minmax(0, 1fr) 74px; overflow: hidden; }
.aircraft-stage::before { content: ""; position: absolute; inset: 105px 0 74px; pointer-events: none; background-image: linear-gradient(rgba(131,123,176,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(131,123,176,.035) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(circle at center, black, transparent 78%); }
.stage-title { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.stage-title > div:first-child { min-width: 0; display: grid; gap: 5px; }
.stage-title span { color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .1em; }
.stage-title h2 { overflow: hidden; margin: 0; font-size: var(--fs-xl); font-weight: var(--fw-semibold); letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.stage-badges { display: flex; gap: 6px; }
.stage-badges span { padding: 6px 7px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.02); color: var(--muted-2); font-size: var(--fs-2xs); }
#stageStatus[data-state="finish"] { border-color: var(--ui-accent-ring); background: var(--ui-accent-muted); color: #ded9ff; }
#stageStatus[data-state="processing"] { border-color: rgba(145,129,248,.38); background: rgba(145,129,248,.07); color: var(--blue); }
#stageStatus[data-state="processing-v1"] { border-color: rgba(239,198,111,.52); background: rgba(239,198,111,.10); color: var(--amber); box-shadow: 0 0 12px rgba(239,198,111,.08); }
.stage-toolbar { position: relative; z-index: 3; display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 0 13px; border-bottom: 1px solid var(--line); background: rgba(8,13,18,.68); scrollbar-width: none; }
.stage-toolbar::-webkit-scrollbar { display: none; }
.stage-toolbar > span { flex: 1; }
.stage-toolbar button { height: 25px; flex: 0 0 auto; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); cursor: pointer; }
.stage-toolbar button:hover { color: var(--text); }.stage-toolbar button.active { border-color: var(--line-strong); background: rgba(255,255,255,.04); color: var(--mint-strong); }
.stage-viewport { min-width: 0; min-height: 0; position: relative; overflow: hidden; }
.stage-viewport canvas { width: 100%; height: 100%; display: block; outline: none; }
.aircraft-measurements { position: absolute; z-index: 5; inset: 0; overflow: hidden; pointer-events: none; }
.aircraft-measurements[hidden] { display: none; }
.aircraft-measurements > span { position: absolute; top: 10px; left: 13px; padding: 5px 7px; border: 1px solid rgba(145,129,248,.3); border-radius: 3px; background: rgba(7,11,15,.74); color: #b8a1f3; font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .08em; }
.aircraft-measurements output { position: absolute; display: block; max-width: min(330px,42vw); padding: 5px 8px; border: 1px solid rgba(145,129,248,.7); border-radius: 3px; background: rgba(7,11,15,.88); color: #dbe9ff; font: var(--fw-semibold) var(--fs-2xs)/1.2 var(--mono); letter-spacing: .02em; white-space: nowrap; transform: translate(-50%,-50%); box-shadow: 0 2px 9px rgba(0,0,0,.28); }
.aircraft-measurements output[data-measurement="wheelbase"] { border-color: rgba(124,106,247,.78); color: #baf2df; }
.aircraft-measurements output[data-contract-state="fail"] { border-color: rgba(255,93,93,.9); color: #ffb0b0; }
.aircraft-measurements output[data-contract-state="unavailable"] { border-color: rgba(173,201,217,.28); color: var(--muted); }
.stage-loading { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 9px; background: rgba(7,11,15,.72); color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); transition: opacity .25s; }
.stage-loading[hidden] { display: none; }
.stage-watermark, .stage-model-state { position: absolute; z-index: 3; bottom: 10px; color: rgba(173,201,217,.46); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .08em; pointer-events: none; }
.stage-watermark { left: 13px; }.stage-model-state { right: 13px; padding: 5px 6px; border: 1px solid rgba(173,201,217,.12); border-radius: 3px; background: rgba(7,11,15,.48); }
/* People preview: motion, speed, level of detail and crowd test over the stage. */
.people-preview-toolbar { position: absolute; z-index: 4; top: 8px; right: 8px; width: 178px; max-height: calc(100% - 44px); overflow-y: auto; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 7px 8px; border: 1px solid rgba(124,106,247,.3); border-radius: 4px; background: rgba(7,11,15,.82); color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1.3 var(--font-sans); letter-spacing: .04em; }
.people-preview-toolbar[hidden] { display: none; }
.people-preview-toolbar label { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 5px; }
.people-preview-toolbar select, .people-preview-toolbar input[type="range"] { min-width: 0; font: inherit; color: inherit; }
.people-preview-toolbar select { min-height: 22px; padding: 0 4px; border: 1px solid rgba(173,201,217,.2); border-radius: 3px; background: rgba(12,18,24,.9); }
.people-preview-motion { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid rgba(173,201,217,.2); border-radius: 3px; overflow: hidden; }
.people-preview-motion button { min-height: 22px; padding: 0 9px; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.people-preview-motion button.active { background: rgba(124,106,247,.34); color: #ece9ff; }
.people-preview-speed input[type="range"] { width: 100%; accent-color: var(--mint); }
.people-preview-speed output { grid-column: 1 / -1; color: #d9d4ff; }
.people-preview-stats { padding-top: 5px; border-top: 1px solid rgba(173,201,217,.12); color: rgba(199,192,255,.86); white-space: normal; }
.component-legend { position: absolute; z-index: 4; right: 13px; bottom: 42px; display: grid; grid-template-columns: repeat(2,auto); gap: 5px 9px; padding: 8px 9px; border: 1px solid rgba(173,201,217,.2); border-radius: 5px; background: rgba(7,11,15,.84); backdrop-filter: blur(8px); pointer-events: none; }
.component-legend[hidden] { display: none; }
.component-legend span { display: flex; align-items: center; gap: 5px; color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
.component-legend span::before { width: 7px; height: 7px; border-radius: 2px; background: #9ba9b1; content: ''; }
.component-legend [data-part="fuselage"]::before { background: #7b53ff; }.component-legend [data-part="wing"]::before { background: #ff5d5d; }.component-legend [data-part="tail"]::before { background: #ff9d3d; }
.component-legend [data-part="engine"]::before { background: #62df74; }.component-legend [data-part="pylon"]::before { background: #ffd43b; }.component-legend [data-part="gear"]::before { background: #564fe0; }
.component-legend [data-part="tire"]::before { background: #171a20; border: 1px solid #778089; }.component-legend [data-part="propeller"]::before { background: #b98cff; }
.component-legend [data-part="glazing"]::before { background: #291b5a; border: 1px solid #685e95; }.component-legend [data-part="door"]::before { background: #f2e35f; }
.stage-metrics { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); border-top: 1px solid var(--line); background: rgba(8,13,18,.80); }
.stage-metrics > div { min-width: 0; display: grid; align-content: center; gap: 7px; padding: 0 16px; border-right: 1px solid var(--line); }
.stage-metrics > div:last-child { border-right: 0; }.stage-metrics span { color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .11em; }.stage-metrics strong { font: var(--fw-semibold) var(--fs-lg)/1 var(--mono); }

.engineering-panel { display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.engineering-panel-header { height: 47px; flex: 0 0 47px; display: grid; grid-template-columns: minmax(0,1fr) 30px; border-bottom: 1px solid var(--line); }
.engineering-tabs { min-width: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.engineering-tabs button { position: relative; border: 0; background: transparent; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); cursor: pointer; }
.engineering-tabs button::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 2px; background: transparent; }
.engineering-tabs button.active { color: var(--mint-strong); }.engineering-tabs button.active::after { background: var(--mint); }
.engineering-tabs button:disabled { color: rgba(126,143,153,.36); cursor: not-allowed; }
.engineering-panel-toggle { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted-2); font-size: var(--fs-2xs); cursor: pointer; }
.engineering-panel.is-collapsed .engineering-panel-header { height: 100%; flex: 1; grid-template-columns: 1fr; border-bottom: 0; }
.engineering-panel.is-collapsed .engineering-tabs,.engineering-panel.is-collapsed .engineering-scroll,.engineering-panel.is-collapsed .engineering-actions { display: none; }
.engineering-panel.is-collapsed .engineering-panel-toggle { width: 100%; height: 100%; border-left: 0; writing-mode: vertical-rl; }
.engineering-scroll { min-height: 0; flex: 1; overflow: auto; padding: 12px; scrollbar-width: thin; scrollbar-color: #30404a transparent; }
.info-panel { display: grid; gap: 10px; }.info-panel[hidden] { display: none; }
.planform-card, .data-block { border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.018); overflow: hidden; }
.building-parameter-panel { display: grid; gap: 9px; padding: 10px; border: 1px solid rgba(124,106,247,.22); border-radius: 6px; background: rgba(124,106,247,.035); }
.building-parameter-panel[hidden] { display: none; }
.building-parameter-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.building-parameter-panel > header div { min-width: 0; display: grid; gap: 4px; }
.building-parameter-panel > header span { color: var(--mint); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .1em; }
.building-parameter-panel > header strong { overflow: hidden; color: var(--text); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.building-parameter-panel > header b { flex: 0 0 auto; padding: 4px 5px; border: 1px solid rgba(124,106,247,.28); border-radius: 3px; color: var(--mint); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .06em; }
.building-parameter-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.building-parameter-fields:empty::after { grid-column: 1/-1; padding: 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1.4 var(--font-sans); content: 'Dimensions use the existing Studio geometry authority.'; }
.building-parameter-fields label { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: #091118; }
.building-parameter-fields label[hidden] { display: none; }
.building-parameter-fields span { overflow: hidden; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); text-overflow: ellipsis; white-space: nowrap; }
.building-parameter-fields input,.building-parameter-fields select { min-width: 0; width: 48px; height: 24px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 3px; outline: 0; background: #060c11; color: var(--text); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); }
.building-parameter-fields select { width: 92px; }
.building-parameter-fields input:focus,.building-parameter-fields select:focus { border-color: rgba(124,106,247,.55); }
.building-parameter-fields i { color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); font-style: normal; }
.building-parameter-panel > p { margin: 0; color: var(--muted-2); font-size: var(--fs-2xs); line-height: 1.45; }
.building-parameter-panel > a { color: var(--blue); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); text-decoration: none; }
.building-parameter-panel > output { padding-top: 7px; border-top: 1px solid var(--line); color: var(--mint); font: var(--fw-semibold) var(--fs-2xs)/1.35 var(--font-sans); letter-spacing: .04em; }
.terminal-parameter-panel { display: grid; gap: 10px; padding: 10px; border: 1px solid rgba(145,129,248,.24); border-radius: 6px; background: linear-gradient(145deg,rgba(145,129,248,.055),rgba(124,106,247,.025)); }
.aircraft-library[data-active-asset-kind="terminal"] .aircraft-stage { background: radial-gradient(circle at 47% 42%,rgba(35,13,255,.055),transparent 42%),radial-gradient(circle at 73% 67%,rgba(255,46,166,.025),transparent 30%),#071018; }
.aircraft-library[data-active-asset-kind="terminal"] .stage-model-state { border-color: rgba(35,13,255,.28); background: rgba(4,14,20,.78); color: #c7c0ff; box-shadow: 0 0 18px rgba(34,12,232,.08); }
.aircraft-library[data-active-asset-kind="ground_vehicle"] .aircraft-stage { background: radial-gradient(circle at 48% 48%,rgba(196,222,224,.052),transparent 46%),radial-gradient(circle at 72% 72%,rgba(104,95,177,.026),transparent 31%),#071116; }
.aircraft-library[data-active-asset-kind="ground_vehicle"] .stage-model-state { border-color: rgba(166,205,207,.24); background: rgba(5,14,18,.8); color: #d7e9e8; box-shadow: 0 0 18px rgba(115,106,190,.055); }
.aircraft-library[data-active-asset-kind="building"] .aircraft-stage { background: radial-gradient(circle at 48% 46%,rgba(218,226,218,.048),transparent 47%),radial-gradient(circle at 70% 70%,rgba(89,82,154,.024),transparent 30%),#071116; }
.aircraft-library[data-active-asset-kind="building"] .stage-model-state { border-color: rgba(177,200,197,.23); background: rgba(5,14,18,.8); color: #dce7e2; box-shadow: 0 0 18px rgba(120,115,182,.05); }
.aircraft-library[data-active-asset-kind="terminal"] .terminal-parameter-panel { border-color: rgba(35,13,255,.34); background: linear-gradient(145deg,rgba(34,12,232,.075),rgba(255,46,166,.025) 58%,rgba(34,255,114,.025)); box-shadow: inset 0 1px rgba(255,255,255,.035),0 8px 22px rgba(0,0,0,.16); }
.aircraft-library[data-active-asset-kind="terminal"] .terminal-parameter-panel > header b,.aircraft-library[data-active-asset-kind="terminal"] .terminal-parameter-panel > output { color: #8377ff; text-shadow: 0 0 10px rgba(35,13,255,.26); }
.terminal-parameter-panel[hidden] { display: none; }
.terminal-parameter-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.terminal-parameter-panel > header div { min-width: 0; display: grid; gap: 4px; }
.terminal-parameter-panel > header span { color: var(--blue); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .1em; }
.terminal-parameter-panel > header strong { overflow: hidden; color: var(--text); font-size: var(--fs-2xs); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.terminal-parameter-panel > header b { flex: 0 0 auto; max-width: 108px; overflow: hidden; padding: 4px 5px; border: 1px solid rgba(124,106,247,.28); border-radius: 3px; color: var(--mint); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .05em; text-overflow: ellipsis; white-space: nowrap; }
.terminal-parameter-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(132px,1fr)); gap: 6px; }
.terminal-parameter-fields:empty::after { grid-column: 1/-1; padding: 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1.4 var(--font-sans); content: 'This asset uses its retained Incheon-inspired default proportions.'; }
.terminal-parameter-fields label { min-width: 0; min-height: 38px; display: grid; grid-template-columns: minmax(0,1fr) minmax(52px,82px) auto; align-items: center; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; background: #091118; }
.terminal-parameter-fields label[hidden] { display: none; }
.terminal-parameter-fields span { min-width: 0; color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1.25 var(--font-sans); overflow-wrap: anywhere; }
.terminal-parameter-fields input,.terminal-parameter-fields select { min-width: 0; width: 100%; height: 25px; padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 3px; outline: 0; background: #060c11; color: var(--text); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); }
.terminal-parameter-fields input[type="checkbox"] { justify-self: end; width: 15px; height: 15px; padding: 0; accent-color: var(--mint); }
.terminal-parameter-fields .terminal-readonly-parameter { min-width: 0; color: var(--mint); font: var(--fw-semibold) var(--fs-2xs)/1.25 var(--mono); text-align: right; }
.terminal-parameter-fields input:focus,.terminal-parameter-fields select:focus { border-color: rgba(145,129,248,.64); box-shadow: 0 0 0 1px rgba(145,129,248,.10); }
.terminal-parameter-fields [data-normalized-by-authority="true"] { border-color: rgba(124,106,247,.84); color: #dcfff5; box-shadow: 0 0 0 1px rgba(124,106,247,.18),0 0 12px rgba(124,106,247,.12); }
.terminal-parameter-fields i { min-width: 10px; color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); font-style: normal; }
.terminal-parameter-panel > p { margin: 0; color: var(--muted-2); font-size: var(--fs-2xs); line-height: 1.5; }
.aircraft-library[data-terminal-security-non-overlap="1"] #terminalDesignNotes { color: #bfeadd; }
.aircraft-library[data-terminal-security-non-overlap="0"] #terminalDesignNotes { color: #ff9bb2; }
.terminal-parameter-panel > a { color: var(--blue); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); text-decoration: none; }
.terminal-parameter-panel > output { padding-top: 7px; border-top: 1px solid var(--line); color: var(--mint); font: var(--fw-semibold) var(--fs-2xs)/1.4 var(--font-sans); letter-spacing: .035em; }
.terminal-authoring-hint { display: grid; gap: 5px; padding: 8px; border: 1px solid rgba(255,46,166,.25); border-left: 2px solid rgba(35,13,255,.65); border-radius: 4px; background: linear-gradient(90deg,rgba(35,13,255,.04),rgba(255,46,166,.035)); }
.terminal-authoring-hint[hidden] { display: none; }
.terminal-authoring-hint strong { color: #ff72c4; font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .08em; }
.terminal-authoring-hint span { color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1.45 var(--font-sans); }
.terminal-path-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.terminal-path-actions button { min-height: 28px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 4px; background: rgba(255,255,255,.025); color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1.2 var(--font-sans); cursor: pointer; }
.terminal-path-actions button:first-child { border-color: rgba(124,106,247,.38); color: var(--mint-strong); }
.terminal-path-actions button:first-child.active { background: rgba(124,106,247,.14); box-shadow: inset 0 0 0 1px rgba(124,106,247,.14); }
.terminal-path-actions button:focus-visible { outline: 1px solid var(--blue); outline-offset: 1px; }
.terminal-path-actions button:disabled { opacity: .36; cursor: not-allowed; }
.terminal-authoring-hint > output { min-height: 26px; padding: 7px 8px; border-radius: 3px; background: rgba(0,0,0,.15); color: #9d94ff; font: var(--fw-semibold) var(--fs-2xs)/1.45 var(--font-sans); }
.stage-viewport canvas[data-terminal-path-draw="true"] { cursor: crosshair; touch-action: none; outline: 1px solid rgba(124,106,247,.42); outline-offset: -1px; }
.planform-card > header, .data-block > header { height: 31px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid var(--line); }
.planform-card header span, .data-block header span { color: var(--muted-2); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .11em; }
.planform-card header b, .data-block header b { color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
#planformCanvas { width: 100%; height: 368px; display: block; background: radial-gradient(circle, rgba(82,74,128,.10), transparent 70%); }
.planform-key { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 8px; border-top: 1px solid var(--line); color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); }
.planform-key[hidden] { display: none; }
.planform-key span { padding: 2px 4px; border-radius: 2px; color: #071015; font-weight: var(--fw-semibold); }.planform-key .p1 { margin-left: 0; background: var(--blue); }.planform-key .p2 { margin-left: 7px; background: var(--mint); }
.planform-key .collision { width: 11px; height: 0; margin-left: 7px; padding: 0; border-top: 1px dashed var(--amber); border-radius: 0; }
.planform-key .dimension-line { width: 13px; height: 0; margin-left: 0; padding: 0; border-top: 1px solid var(--blue); border-radius: 0; }
.planform-key .extrema-dot { width: 6px; height: 6px; margin-left: 7px; padding: 0; border-radius: 50%; background: var(--amber); }
.data-block dl { display: grid; grid-template-columns: 1fr auto; gap: 0; margin: 0; padding: 3px 10px; }
.data-block dt, .data-block dd { margin: 0; padding: 7px 0; border-bottom: 1px solid rgba(173,201,217,.07); font-size: var(--fs-2xs); }
.data-block dt { color: var(--muted); }.data-block dd { color: var(--text); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); text-align: right; }.data-block dt:last-of-type, .data-block dd:last-of-type { border-bottom: 0; }
.performance-data-block dl { grid-template-columns: minmax(0,1fr) minmax(120px,1.25fr); }
.performance-data-block dd { display: grid; justify-items: end; gap: 3px; }
.performance-data-block dd strong { color: var(--text); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); }
.performance-data-block dd small { max-width: 210px; overflow-wrap: anywhere; color: var(--muted); font: var(--fw-medium) var(--fs-2xs)/1.4 var(--mono); }
.performance-data-block dd small a { color: var(--blue); text-decoration: none; }
.performance-data-block dd small em { color: var(--mint); font-style: normal; }
.performance-verification { margin: 0; padding: 8px 10px; border-top: 1px solid rgba(173,201,217,.07); color: var(--muted); font: var(--fw-semibold) var(--fs-2xs)/1.4 var(--font-sans); }
.performance-verification[data-state="verified"] { color: var(--mint); }
.performance-verification[data-state="partial"] { color: var(--amber); }
.engineering-actions { flex: 0 0 auto; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: rgba(7,11,15,.86); }
.engineering-actions > div { min-height: 14px; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.4; }

/* Tablets and narrow windows (901-1120px): two columns, browser beside the
   stage, the engineering panel full width below; the document scrolls. */
@media (max-width: 1120px) {
  html, body { height: auto; min-height: 100%; overflow: visible; }
  .aircraft-library { min-height: 100vh; height: auto; grid-template: 58px max(430px, 62vh) auto / 250px minmax(0,1fr); }
  .library-header { position: sticky; top: 0; }.variant-browser { grid-row: 2; }.aircraft-stage { grid-row: 2; }.engineering-panel { min-height: 720px; grid-column: 1 / -1; grid-row: 3; }.engineering-scroll { overflow: visible; }
  .aircraft-library.engineering-collapsed { grid-template: 58px max(430px, 62vh) 34px / 250px minmax(0,1fr); }
  .asset-kind-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .engineering-panel.is-collapsed { min-height: 34px; }
}

/* Studio parity layer -----------------------------------------------------
   These overrides intentionally leave every DOM id, event target and layout
   region intact. They only align the Asset Library's visual hierarchy with
   Studio's compact operational glass system. */
html { background: var(--ui-bg-base); scrollbar-color: rgba(255,255,255,.16) rgba(0,0,0,.78); }
body {
  background:
    radial-gradient(circle at 52% 32%, rgba(124,106,247,.055), transparent 34%),
    linear-gradient(145deg, #0d0d0f 0%, #141416 52%, #0d0d0f 100%);
}
.aircraft-library {
  background:
    radial-gradient(circle at 51% 36%, rgba(124,106,247,.05), transparent 35%),
    linear-gradient(145deg, rgba(20,20,22,.98), rgba(13,13,15,.99));
}
.aircraft-stage,
.aircraft-library[data-active-asset-kind="terminal"] .aircraft-stage,
.aircraft-library[data-active-asset-kind="ground_vehicle"] .aircraft-stage,
.aircraft-library[data-active-asset-kind="building"] .aircraft-stage {
  background: radial-gradient(circle at 50% 44%, rgba(124,106,247,.045), transparent 44%), var(--ui-bg-base);
}
.library-header {
  border-color: var(--ui-border-subtle);
  background: color-mix(in srgb, var(--ui-bg-elevated) 82%, transparent);
  box-shadow: var(--ui-shadow-sm), var(--ui-inset-highlight);
  backdrop-filter: blur(18px) saturate(124%);
  -webkit-backdrop-filter: blur(18px) saturate(124%);
}
.library-back,
.library-brand-mark {
  border-radius: var(--ui-radius-sm);
  border-color: var(--ui-border-default);
  background: color-mix(in srgb, var(--ui-bg-control) 88%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.library-brand-mark {
  border-color: color-mix(in srgb, var(--ui-accent) 34%, var(--ui-border-default));
  background: linear-gradient(145deg, var(--ui-accent-muted), rgba(124,106,247,.035));
  color: var(--ui-accent-hover);
}
.library-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
}
.library-back:hover,
.library-back:focus-visible {
  color: var(--ui-accent-hover);
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
}
.library-health[data-state="ready"] i {
  background: var(--ui-success);
  box-shadow: 0 0 0 4px rgba(61,214,140,.1);
}
.variant-state em[data-completion-state="finish"],
#stageStatus[data-state="finish"] {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: #ded9ff;
  box-shadow: inset 0 0 0 1px rgba(124,106,247,.08);
}
.variant-browser,
.engineering-panel {
  background: color-mix(in srgb, var(--ui-bg-elevated) 88%, transparent);
  backdrop-filter: blur(16px) saturate(112%);
  -webkit-backdrop-filter: blur(16px) saturate(112%);
}
.variant-browser { border-right-color: var(--ui-border-subtle); }
.engineering-panel { border-left-color: var(--ui-border-subtle); }
.browser-heading h1,
.stage-title h2 { color: var(--ui-text-primary); letter-spacing: -.02em; }
.asset-kind-tabs {
  border-color: var(--ui-border-subtle);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--ui-bg-control) 78%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.asset-kind-tabs button,
.stage-toolbar button,
.engineering-tabs button {
  font-family: var(--sans);
  transition: var(--ui-transition);
}
.asset-kind-tabs button { border-radius: var(--ui-radius-sm); }
.asset-kind-tabs button:hover,
.stage-toolbar button:hover,
.engineering-tabs button:hover { color: var(--ui-text-primary); background: rgba(255,255,255,.025); }
.asset-kind-tabs button.active,
.stage-toolbar button.active {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: var(--ui-accent-hover);
  box-shadow: inset 0 0 0 1px rgba(124,106,247,.08);
}
.variant-search {
  border-color: var(--ui-border-default);
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--ui-bg-input) 90%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.variant-search:focus-within {
  border-color: var(--ui-accent-ring);
  box-shadow: 0 0 0 2px var(--ui-accent-muted), var(--ui-inset-highlight);
}
.variant-card {
  border-radius: var(--ui-radius-sm);
  background: color-mix(in srgb, var(--ui-bg-control) 48%, transparent);
  transition: var(--ui-transition), transform .12s ease;
}
.variant-card:hover {
  border-color: var(--ui-border-default);
  background: color-mix(in srgb, var(--ui-bg-overlay) 72%, transparent);
  transform: translateY(-1px);
}
.variant-card.active {
  border-color: var(--ui-accent-ring);
  background: linear-gradient(90deg, var(--ui-accent-muted), rgba(124,106,247,.025));
  box-shadow: inset 2px 0 var(--ui-accent), var(--ui-inset-highlight);
}
.variant-thumb {
  border-color: var(--ui-border-subtle);
  border-radius: var(--ui-radius-sm);
  background: radial-gradient(circle, rgba(124,106,247,.1), rgba(20,20,22,.38) 72%);
}
.variant-card.active .variant-thumb { color: var(--ui-accent-hover); }
.aircraft-stage::before {
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
}
.stage-title,
.stage-toolbar,
.stage-metrics,
.engineering-panel-header,
.engineering-actions {
  border-color: var(--ui-border-subtle);
  background: color-mix(in srgb, var(--ui-bg-elevated) 76%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.stage-toolbar,
.stage-metrics,
.engineering-actions {
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
}
.engineering-tabs button.active { color: var(--ui-accent-hover); }
.engineering-tabs button.active::after { background: var(--ui-accent); }
.stage-badges span,
.stage-model-state,
.planform-card,
.data-block,
.building-parameter-panel,
.terminal-parameter-panel {
  border-color: var(--ui-border-default);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--ui-bg-control) 72%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.building-parameter-panel,
.terminal-parameter-panel {
  background: linear-gradient(145deg, rgba(124,106,247,.065), rgba(36,36,40,.82));
}
.building-parameter-fields label,
.terminal-parameter-fields label,
.terminal-parameter-fields input,
.terminal-parameter-fields select {
  border-color: var(--ui-border-default);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-bg-input);
  color: var(--ui-text-primary);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}
:where(button, a, input, select, textarea):focus-visible {
  outline: none;
  border-color: var(--ui-accent-ring);
  box-shadow: 0 0 0 2px var(--ui-accent-muted);
}
:where(button, a, input, select, textarea) { transition: var(--ui-transition); }
* { scrollbar-color: rgba(255,255,255,.16) rgba(0,0,0,.78); }

.aircraft-metadata-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--ui-border-default);
  border-radius: var(--ui-radius-md);
  background: color-mix(in srgb, var(--ui-bg-control) 72%, transparent);
  box-shadow: var(--ui-inset-highlight);
}
.aircraft-metadata-panel[hidden] { display: none; }
.aircraft-metadata-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.aircraft-metadata-panel > header div,
.aircraft-metadata-panel label { display: grid; gap: 5px; }
.aircraft-metadata-panel > header span,
.aircraft-metadata-panel label > span {
  color: var(--ui-text-muted);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .08em;
}
.aircraft-metadata-panel > header strong { color: var(--ui-text-primary); }
.aircraft-metadata-panel > header b {
  color: var(--ui-accent-hover);
  font-size: var(--fs-2xs);
  letter-spacing: .06em;
}
.aircraft-metadata-panel input,
.aircraft-metadata-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--ui-border-default);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-bg-input);
  color: var(--ui-text-primary);
  padding: 8px 9px;
  font: inherit;
  resize: vertical;
}
.aircraft-metadata-panel input[readonly] {
  color: var(--ui-text-muted);
  cursor: default;
}
.aircraft-metadata-panel small {
  color: var(--ui-text-muted);
  font-size: var(--fs-2xs);
  line-height: 1.45;
}
.aircraft-metadata-actions {
  display: grid;
  gap: 7px;
}
.aircraft-metadata-actions button {
  justify-self: start;
  border: 1px solid var(--ui-accent-ring);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-accent-muted);
  color: var(--ui-accent-hover);
  padding: 7px 10px;
  font: inherit;
  font-weight: var(--fw-semibold);
  cursor: pointer;
}
.aircraft-metadata-actions button:disabled { opacity: .55; cursor: wait; }
.aircraft-metadata-actions output {
  color: var(--ui-text-muted);
  font-size: var(--fs-2xs);
  line-height: 1.4;
}
.aircraft-metadata-actions output[data-state="error"] { color: #ff9b84; }

/* Asset Library settings ------------------------------------------------- */
.asset-settings-workspace[hidden] { display: none; }
.asset-settings-workspace {
  min-width: 0;
  min-height: 0;
  grid-column: 2 / -1;
  display: grid;
  grid-template-rows: auto 42px minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 0, rgba(124,106,247,.08), transparent 33%),
    var(--ui-bg-base);
}
.aircraft-library[data-active-asset-kind="settings"] .aircraft-stage,
.aircraft-library[data-active-asset-kind="settings"] .engineering-panel { display: none; }
.aircraft-library[data-active-asset-kind="settings"] .browser-legend { visibility: hidden; }
.asset-settings-header {
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--ui-border-subtle);
  background: color-mix(in srgb, var(--ui-bg-surface) 86%, transparent);
}
.asset-settings-header > div:first-child { min-width: 0; }
.asset-settings-header h2 { margin: 0 0 4px; font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
.asset-settings-header p { margin: 0; color: var(--ui-text-secondary); font-size: var(--fs-2xs); line-height: 1.45; }
.asset-settings-source {
  max-width: 360px;
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--ui-text-secondary);
  text-align: right;
}
.asset-settings-source span { color: var(--ui-success); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); letter-spacing: .08em; }
.asset-settings-source strong { color: var(--ui-text-primary); font: var(--fw-semibold) var(--fs-2xs)/1.2 var(--mono); }
.asset-settings-source small { overflow-wrap: anywhere; font: var(--fw-semibold) var(--fs-2xs)/1.3 var(--font-sans); }
.asset-settings-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--ui-border-subtle);
  background: color-mix(in srgb, var(--ui-bg-control) 54%, transparent);
}
.asset-settings-toolbar > span { color: var(--ui-text-secondary); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
.asset-settings-toolbar button {
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid var(--ui-border-default);
  border-radius: var(--ui-radius-sm);
  background: var(--ui-bg-control);
  color: var(--ui-text-secondary);
  font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans);
  cursor: pointer;
}
.asset-settings-toolbar button:hover,
.asset-settings-toolbar button:focus-visible {
  border-color: var(--ui-accent-ring);
  background: var(--ui-accent-muted);
  color: var(--ui-text-primary);
  outline: none;
}
.asset-settings-toolbar button:disabled { opacity: .55; cursor: wait; }
.asset-settings-scroll {
  min-height: 0;
  overflow: auto;
  padding: 18px 24px 32px;
  scrollbar-width: thin;
}
.asset-settings-section {
  margin: 0 0 14px;
  border: 1px solid var(--ui-border-subtle);
  border-radius: var(--ui-radius-md);
  overflow: hidden;
  background: color-mix(in srgb, var(--ui-bg-surface) 92%, transparent);
  box-shadow: var(--ui-shadow-sm), var(--ui-inset-highlight);
}
.asset-settings-section > header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--ui-border-subtle);
}
.asset-settings-section > header > div { min-width: 0; display: grid; gap: 4px; }
.asset-settings-section > header strong { color: var(--ui-text-primary); font-size: var(--fs-2xs); }
.asset-settings-section > header small { color: var(--ui-text-muted); font-size: var(--fs-2xs); line-height: 1.35; }
.asset-settings-section > header b { color: var(--ui-accent-hover); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); white-space: nowrap; }
.asset-settings-value-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.asset-settings-value {
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(88px,auto);
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ui-border-subtle);
}
.asset-settings-value:nth-child(odd) { border-right: 1px solid var(--ui-border-subtle); }
.asset-settings-value dt,
.asset-settings-value dd { min-width: 0; margin: 0; }
.asset-settings-value dt { display: grid; gap: 3px; }
.asset-settings-value dt strong { color: var(--ui-text-secondary); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); }
.asset-settings-value dt small { overflow: hidden; color: var(--ui-text-muted); font: var(--fw-medium) var(--fs-2xs)/1.2 var(--font-sans); text-overflow: ellipsis; white-space: nowrap; }
.asset-settings-value dd { overflow-wrap: anywhere; color: var(--ui-text-primary); font: var(--fw-semibold) var(--fs-2xs)/1.35 var(--mono); text-align: right; }
.asset-settings-value[data-value-type="mode"] dd { color: var(--ui-success); }
.settings-category-card {
  width: 100%;
  min-height: 63px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 4px 0;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  background: rgba(255,255,255,.016);
  color: var(--ui-text-secondary);
  text-align: left;
  cursor: pointer;
}
.settings-category-card:hover { border-color: var(--ui-border-default); background: rgba(255,255,255,.035); }
.settings-category-card.active { border-color: var(--ui-accent-ring); background: var(--ui-accent-muted); box-shadow: inset 2px 0 var(--ui-accent); }
.settings-category-icon { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--ui-border-default); border-radius: var(--ui-radius-sm); background: var(--ui-bg-control); color: var(--ui-accent-hover); font: var(--fw-semibold) var(--fs-2xs)/1 var(--font-sans); }
.settings-category-copy { min-width: 0; display: grid; gap: 4px; }
.settings-category-copy strong { color: var(--ui-text-primary); font-size: var(--fs-2xs); }
.settings-category-copy small { overflow: hidden; font-size: var(--fs-2xs); line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.settings-category-count { color: var(--ui-text-muted); font: var(--fw-semibold) var(--fs-2xs)/1 var(--mono); }
.asset-api-health-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--ui-border-subtle); color: var(--ui-text-secondary); font-size: var(--fs-2xs); }
.asset-api-health-list { display: grid; }
.asset-api-health-row { min-height: 54px; display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px 13px; border-bottom: 1px solid var(--ui-border-subtle); }
.asset-api-health-row:last-child { border-bottom: 0; }
.asset-api-health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-text-muted); }
.asset-api-health-row[data-state="healthy"] .asset-api-health-dot { background: var(--ui-success); }
.asset-api-health-row[data-state="degraded"] .asset-api-health-dot { background: var(--amber); }
.asset-api-health-row[data-state="down"] .asset-api-health-dot { background: var(--red); }
.asset-api-health-copy { min-width: 0; display: grid; gap: 4px; }
.asset-api-health-copy strong { color: var(--ui-text-primary); font-size: var(--fs-2xs); }
.asset-api-health-copy small { overflow: hidden; color: var(--ui-text-secondary); font: var(--fw-semibold) var(--fs-2xs)/1.3 var(--font-sans); text-overflow: ellipsis; white-space: nowrap; }
.asset-api-health-row a { max-width: 170px; overflow: hidden; color: var(--ui-accent-hover); font: var(--fw-semibold) var(--fs-2xs)/1.3 var(--font-sans); text-overflow: ellipsis; white-space: nowrap; }
.asset-settings-empty { padding: 38px 18px; color: var(--ui-text-secondary); font-size: var(--fs-2xs); line-height: 1.5; text-align: center; }
@media (max-width: 1120px) {
  .asset-settings-value-list { grid-template-columns: minmax(0,1fr); }
  .asset-settings-value:nth-child(odd) { border-right: 0; }
}
@media (max-width: 1120px) {
  .aircraft-library[data-active-asset-kind="settings"] { grid-template: 58px minmax(560px,calc(100vh - 58px)) / 250px minmax(0,1fr); }
  .asset-settings-workspace { grid-column: 2; grid-row: 2; }
  .asset-settings-header { align-items: flex-start; padding: 14px 18px; }
  .asset-settings-source { max-width: 280px; }
  .asset-settings-scroll { padding: 14px 18px 24px; }
}

/* Phones (900px and below): one column. The stage comes first at a fixed
   share of the screen, the browser and the engineering panel stack under it
   and the document scrolls. The 3D viewer keeps OrbitControls' own touch. */
@media (max-width: 900px) {
  .aircraft-library,
  .aircraft-library.engineering-collapsed { grid-template: 58px auto auto auto / minmax(0,1fr); }
  .library-header { gap: 10px; padding: 0 12px; }
  .library-header-meta { min-width: 0; gap: 10px; }
  .library-health b { display: none; }
  .stage-title { gap: 10px; padding: 0 12px; }
  .stage-title > div:first-child { flex: 1 1 auto; }
  .stage-badges { min-width: 0; flex: 0 1 auto; }
  #stageVersion { display: none; }
  .stage-watermark { display: none; }
  #libraryCount { display: none; }
  .aircraft-stage { grid-row: 2; grid-column: 1; height: 56vh; height: 56dvh; min-height: 340px; }
  .variant-browser { grid-row: 3; grid-column: 1; border-right: 0; border-top: 1px solid var(--line); }
  .variant-rail { max-height: 52vh; }
  .engineering-panel { grid-row: 4; grid-column: 1; min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .engineering-panel.is-collapsed { min-height: 34px; }
  .engineering-panel.is-collapsed .engineering-panel-toggle { height: 34px; writing-mode: horizontal-tb; }
  .aircraft-library[data-active-asset-kind="settings"] { grid-template: 58px auto minmax(560px, auto) / minmax(0,1fr); }
  .aircraft-library[data-active-asset-kind="settings"] .variant-browser { grid-row: 2; }
  .asset-settings-workspace { grid-column: 1; grid-row: 3; }
}

/* Coarse pointers: 16px form text so iOS does not zoom the page on focus. */
@media (pointer: coarse) {
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  body select,
  body textarea { font-size: max(var(--fs-lg), 16px) !important; }
}

/* Lucide icons (ui-core icon()): --icon-sm in text controls, --icon-md in icon-only buttons. */
.aircraft-library .bp-icon { width: var(--icon-sm); height: var(--icon-sm); flex: none; }
.library-back .bp-icon { width: var(--icon-md); height: var(--icon-md); }
.variant-search > .bp-icon { color: var(--muted); }
