/* GPL-3.0-or-later. Shared studio surfaces for the parts bench and flight picker. */
body.editor, .workshop-aircraft-dialog {
  --studio-bg: var(--ui-bg);
  --studio-panel: var(--ui-surface);
  --studio-raised: var(--ui-raised);
  --studio-line: var(--ui-border);
  --studio-text: var(--ui-text);
  --studio-muted: var(--ui-muted);
  --studio-accent: var(--ui-accent);
  --studio-light: radial-gradient(ellipse at 52% 37%, color-mix(in srgb,var(--ui-raised) 65%,var(--ui-muted)) 0%, var(--ui-raised) 47%, var(--ui-surface) 100%);
  --green: var(--studio-accent);
  --line: var(--studio-line);
  --muted: var(--studio-muted);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--studio-text);
  background: var(--studio-bg);
}
.workshop-aircraft-dialog {
  --aircraft-bg: var(--studio-bg); --aircraft-panel: var(--studio-panel);
  --aircraft-line: var(--studio-line); --aircraft-text: var(--studio-text);
  --aircraft-muted: var(--studio-muted); --aircraft-accent: var(--studio-accent);
}
.editor button, .editor input, .editor select, .editor summary,
.workshop-aircraft-dialog :is(input, select, button, a) { font-family: inherit; }
.editor :is(button, input, select, summary, a):focus-visible,
.workshop-aircraft-dialog :focus-visible { outline: 3px solid var(--ui-accent); outline-offset: 2px; }
.editor > header, .workshop-aircraft-dialog .aircraft-header {
  background: var(--studio-bg); border: 0; gap: 9px;
}
.editor .wordmark { color: var(--studio-text); font: 650 16px/1.2 "Segoe UI",sans-serif; letter-spacing: 0; }
.editor > header button, .editor-menu > summary, .editor .assembly-exit, .workshop-aircraft-dialog button,
.workshop-aircraft-dialog .aircraft-workshop {
  color: var(--studio-text); background: var(--studio-raised); border: 1px solid transparent;
  border-radius: 12px; font-weight: 550;
}
.editor .editor-save, .workshop-aircraft-dialog .aircraft-confirm, .editor .workshop-dialog .primary {
  background: var(--studio-accent); color: var(--ui-on-accent); border-color: transparent;
}
.editor .editor-save:hover, .workshop-aircraft-dialog .aircraft-confirm:hover:not(:disabled) { background: var(--ui-accent); }
.editor .editor-menu > div, .editor .garage-filters > div, .editor .workshop-dialog {
  background: var(--studio-panel); color: var(--studio-text); border: 1px solid var(--studio-line); border-radius: 18px;
  box-shadow: 0 18px 60px var(--ui-shadow);
}
.editor .workshop-dialog::backdrop { background: var(--ui-scrim); }
.editor .workshop-dialog :is(button,input,select), .editor .start-bar button { background: var(--studio-raised); color: var(--studio-text); border-color: var(--studio-line); border-radius: 10px; }
.editor main { padding-top: 0; }
.editor .assembly-stage, .workshop-aircraft-dialog .aircraft-stage {
  background: var(--studio-light); border: 0; border-radius: 22px; overflow: hidden;
}
.editor .stage-heading { border: 0; padding: 16px 18px 4px; gap: 12px; align-items: center; }
.editor .stage-heading h2, .aircraft-stage-top h2 {
  color: var(--ui-text); font: 680 clamp(18px,2vw,30px)/1.12 "Segoe UI",sans-serif;
  letter-spacing: -.035em; text-transform: none;
}
.editor .stage-heading h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor .preview-actions { flex: none; }
.editor .preview-actions button, .editor .preview-info button {
  background: var(--ui-surface); color: var(--ui-text); border: 0; border-radius: 11px; padding-inline: 11px; font-weight: 560;
}
.editor .preview-actions button[aria-pressed=true] { background: var(--ui-accent); color: var(--ui-on-accent); }
.editor .attachment-column .attachment-slot {
  background: color-mix(in srgb,var(--ui-surface) 90%,transparent); color: var(--ui-text); border: 1px solid var(--ui-surface); border-radius: 14px;
  box-shadow: 0 4px 16px transparent; min-height: 50px; padding: 8px 11px;
}
.editor .attachment-column .attachment-slot:is(:hover,.active,[aria-pressed=true]) { background: var(--ui-accent); color: var(--ui-on-accent); border-color: var(--ui-accent); }
.editor .attachment-name { font: 620 13px/1.2 "Segoe UI",sans-serif; letter-spacing: 0; text-transform: none; }
.editor .attachment-sign { color: var(--ui-accent); }
.editor .attachment-detail, .editor .attachment-status, .editor .vtx-reason { color: var(--ui-muted); }
.editor .attachment-slot:is(:hover,.active) :is(.attachment-sign,.attachment-detail,.attachment-status,.vtx-reason) { color: var(--ui-on-accent); }
.editor .slot-connections path { stroke: var(--ui-border); opacity: .38; }
.editor .slot-connections path.active { stroke: var(--ui-accent); opacity: .9; }
.editor .slot-connections circle { fill: var(--ui-accent); }
.editor .preview-info, .editor .stage-disclaimer, .editor #stage-caption p, .editor .stage-mass small { color: var(--ui-muted); }
.editor #stage-caption { border-color: var(--studio-line); color: var(--ui-text); }
.editor .stage-mass { color: var(--ui-text); }
.editor .editor-dock { gap: 2px; height: 42px; align-items: stretch; padding: 3px; border-radius: 15px; background: var(--studio-panel); }
.editor .editor-dock button { color: var(--studio-muted); border: 0; border-radius: 12px; background: transparent; font-weight: 600; min-height: 32px; }
.editor .editor-dock button[aria-pressed=true] { background: var(--studio-accent); color: var(--ui-on-accent); }
.editor .catalog-column, .editor .build-panel, .workshop-aircraft-dialog .aircraft-spec {
  background: var(--studio-panel); border: 0; border-radius: 19px; box-shadow: none; color: var(--studio-text);
}
.editor .compact-catalog { --catalog-surface: var(--studio-raised); --catalog-edge: var(--studio-line); gap: 8px; }
.editor .compact-catalog :is(.editor-section select,.toolbar input,.garage-filters>summary,.catalog-frame-facets select),
.editor .build-panel :is(input,select), .editor .customization-controls select {
  background: var(--studio-raised); color: var(--studio-text); border: 1px solid var(--studio-line); border-radius: 10px;
}
.editor .catalog-current-part:not([hidden]) { padding: 7px 10px; background: var(--ui-hover); color: var(--ui-text); border-radius: 11px; }
.editor .compact-catalog .results-line,.editor .compact-catalog .editor-section,.editor .customization-controls small,.editor .catalog-tile-text small { color: var(--studio-muted); }
.editor .compact-catalog .catalog-tiles { grid-template-columns: minmax(0,1fr); gap: 2px; }
.editor .catalog-group h3 { color: var(--ui-muted); border: 0; letter-spacing: .04em; font-size: 10px; }
.editor .compact-catalog .catalog-tile {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 5px 9px;
  padding: 8px; background: transparent; border: 1px solid transparent; border-radius: 13px; box-shadow: none; color: var(--studio-text);
}
.editor .compact-catalog .catalog-tile:hover { background: var(--ui-raised); }
.editor .compact-catalog .catalog-tile:has([data-candidate][aria-pressed=true]) { background: var(--ui-hover); border-color: var(--ui-accent); }
.editor .compact-catalog .catalog-tile-preview {
  grid-column: 1; grid-row: 1; grid-template-columns: 60px minmax(0,1fr); align-items: center; gap: 9px; min-height: 44px;
}
.editor .catalog-thumb { height: 46px; aspect-ratio: auto; border-radius: 9px; background: var(--ui-input); color: var(--ui-muted); }
.editor .catalog-tile-text { padding: 0; }
.editor .catalog-tile-text strong { font-size: 12px; }
.editor .compact-catalog .catalog-install {
  grid-column: 2; grid-row: 1; width: auto; margin: 0; min-height: 34px; max-width: 94px; padding: 5px 9px;
  border-radius: 11px; background: var(--ui-raised); color: var(--ui-accent); border: 0;
}
.editor .compact-catalog .catalog-install:disabled { color: var(--ui-muted); background: transparent; }
.editor .catalog-tile-blocker, .editor .catalog-card-options, .editor .catalog-inline-details { grid-column: 1/-1; }
.editor .catalog-choice-modes button { border-radius: 9px; border-color: var(--studio-line); background: var(--studio-raised); color: var(--studio-text); }
.editor .catalog-choice-modes button[aria-pressed=true] { background: var(--studio-accent); color: var(--ui-on-accent); }
.editor .catalog-change, .editor .catalog-inline-details dl div { border-color: var(--studio-line); }
.editor .catalog-change b { color: var(--studio-accent); }
.editor .workshop-library { width: min(640px,calc(100vw - 24px)); max-height: 90dvh; }
.editor .workshop-library .workshop-ready-list { max-height: 50dvh; }
.editor .workshop-library .saved-row { border: 0; border-bottom: 1px solid var(--studio-line); padding: 12px 3px; background: transparent; gap: 6px; }
.editor .workshop-library .saved-row small { display: block; color: var(--studio-muted); }
.editor .workshop-library h3 { margin: 14px 0 4px; font-size: 15px; }
.workshop-aircraft-dialog .aircraft-toolbar, .workshop-aircraft-dialog .aircraft-footer { border: 0; }
.workshop-aircraft-dialog .aircraft-layout { padding: 0 16px; gap: 12px; }
.workshop-aircraft-dialog .aircraft-stage-top .aircraft-family { color: var(--ui-accent); }
.workshop-aircraft-dialog .aircraft-stage-top h2 { max-width: 80%; }
.workshop-aircraft-dialog .aircraft-navigation {
  position: absolute; inset: auto 10px 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.workshop-aircraft-dialog .aircraft-navigation select, .workshop-aircraft-dialog .aircraft-position {
  position: static; transform: none; background: var(--ui-surface); color: var(--ui-text); border: 0; border-radius: 12px;
}
.workshop-aircraft-dialog .aircraft-navigation select { width: min(350px,65%); color-scheme: inherit; text-overflow: ellipsis; }
.workshop-aircraft-dialog .aircraft-arrow { border: 0; border-radius: 50%; width: 46px; min-height: 46px; color: var(--ui-text); background: var(--ui-surface); }
.workshop-aircraft-dialog .aircraft-arrow::before {
  content: ''; width: 14px; height: 18px; background: currentColor;
  clip-path: polygon(10% 7%,40% 7%,90% 50%,40% 93%,10% 93%,60% 50%);
}
.workshop-aircraft-dialog .aircraft-prev::before { transform: scaleX(-1); }
.workshop-aircraft-dialog .aircraft-arrow:hover:not(:disabled) { background: var(--ui-hover); }
.workshop-aircraft-dialog .aircraft-search, .workshop-aircraft-dialog .aircraft-sort select {
  border-radius: 12px; background: var(--studio-raised); color: var(--studio-text); border-color: var(--studio-line);
}
.workshop-aircraft-dialog .aircraft-filters button[aria-pressed=true] { background: var(--ui-hover); color: var(--ui-text); border-color: transparent; }
.workshop-aircraft-dialog .aircraft-spec { padding: 18px; }
.workshop-aircraft-dialog .aircraft-metrics .aircraft-datum { border: 0; border-radius: 12px; background: var(--studio-raised); }
.workshop-aircraft-dialog .aircraft-payload { border-radius: 12px; }
@media (max-width:780px) {
  .editor .stage-heading { padding: 5px 8px; gap: 5px; }
  .editor .stage-heading h2 { font-size: 15px; }
  .editor .preview-actions button { padding-inline: 5px; }
  .editor .attachment-column .attachment-slot { padding: 3px 5px; min-height: 29px; border-radius: 9px; }
  .editor .attachment-name { font-size: 10px; }
  .editor .assembly-stage,.workshop-aircraft-dialog .aircraft-stage { border-radius: 14px; }
  .editor .compact-catalog .catalog-tile { padding: 5px; }
  .editor .wordmark { display: none; }
  .editor > header:has(.assembly-exit-actions) .assembly-exit-actions { justify-content: stretch; }
  .workshop-aircraft-dialog .aircraft-layout { padding: 0 8px; gap: 8px; }
  .workshop-aircraft-dialog .aircraft-navigation { bottom: 7px; }
}
@media (max-width:390px) {
  .editor .stage-heading h2 { font-size: 13px; }
  .editor .catalog-tile-text strong { font-size: 11px; }
}
body.editor, .workshop-aircraft-dialog { color-scheme: inherit; }
.editor :is(.build-panel,.catalog-column,.editor-menu,dialog) :is(input,select,button,summary) {
  background-color: var(--ui-input); color: var(--ui-text); border-color: var(--studio-line);
}
.editor .build-slot, .editor .build-slot button, .editor .card, .editor dialog,
.editor #assembly-issue, .editor .customization-controls { background-color: var(--ui-surface); color: var(--ui-text); border-color: var(--studio-line); }
.editor .build-panel :is(dt,small,.small-note), .editor .inspector-close, .editor .catalog-frame-facets label,
.editor .catalog-inline-details :is(dt,p), .editor .workshop-summary dd small, .editor .catalog-change { color: var(--ui-muted); }
.editor :is(.catalog-tile-blocker,.catalog-card-options p,.check-row.unknown) { color: var(--ui-warning); }
.editor .check-row.fail, .editor #remove-selected { color: var(--ui-danger); }
.editor .check-row.pass { color: var(--ui-success); }
.editor .assembly-stage.inspection-mode { background: var(--studio-light); }
.editor .editor-menu .ui-theme-picker { padding-top: 12px; }
.workshop-aircraft-dialog .aircraft-only-mine input { background: var(--ui-input); border-color: var(--ui-border); }
.workshop-aircraft-dialog .aircraft-only-mine input:checked { background: var(--ui-accent); }
.workshop-aircraft-dialog .aircraft-only-mine input:checked::before { background: var(--ui-on-accent); }
@media(max-width:780px) {
 .editor[data-inspector-open=true] .assembly-stage :is(.attachment-column,.slot-connections) { display: none; }
 .editor .stage-heading h2 { display: block; }
 .editor .customization-controls small { display: none; }
 .workshop-aircraft-dialog .aircraft-spec { overflow: visible; }
}
@media(max-width:550px) {
 .workshop-aircraft-dialog .aircraft-toolbar { display: grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; }
 .workshop-aircraft-dialog .aircraft-filters { grid-column:1/-1; }
 .workshop-aircraft-dialog .aircraft-search { width:100%; }
}
@media(max-width:780px) and (orientation:portrait) {
 .editor .stage-heading { display:grid; grid-template-columns:minmax(0,1fr) auto; }
 .editor .stage-heading h2 { display:block; width:auto; }
 .editor .stage-heading .preview-actions { width:auto; }
}
.workshop-aircraft-dialog :is(.aircraft-navigation,.aircraft-arrow)[hidden] { display: none; }
.editor .compact-catalog .catalog-tile-preview { background:transparent; color:inherit; }
.editor .catalog-tile:has(.catalog-install:disabled) .catalog-tile-text { opacity: .9; }
