.atlas-ship-studio[hidden], #atlas-vehicle-workbench[hidden], .fleet-art [hidden], .fleet-stage [hidden] {
  display: none !important;
}

.tool-layout:has(> #tool-main :is(#atlas-vehicle-directory, #atlas-fleet-manager)) {
  grid-template-columns: minmax(0, 1fr);
}

#engineering-feedback label {
  display: block;
  margin-bottom: 6px;
  color: #b8d8de;
  font-size: 12px;
}
#engineering-suggestion {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 10px;
  resize: vertical;
  border: 1px solid #365766;
  border-radius: 8px;
  background: #0b1e2a;
  color: #ecf8f9;
  font: inherit;
}
.engineering-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.engineering-feedback-actions a { color: #a8f2e8; }
#engineering-feedback-response:empty { display: none; }

.fleet-directory, .fleet-workbench, .fleet-picker {
  --fleet-ink: #ecf8f9;
  --fleet-muted: #a6c7d0;
  --fleet-accent: #a8f2e8;
  --fleet-line: #365766;
  --fleet-surface: #0e2533;
  color: var(--fleet-ink);
}

.fleet-directory { margin-bottom: 16px; }
.fleet-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.fleet-heading h3, .fleet-pane h4, .fleet-selected h4 {
  margin: 0 0 4px;
  font-family: var(--font-display);
}
.fleet-heading p, .fleet-selected p, .fleet-feedback { margin: 4px 0; }
.fleet-heading p, .fleet-selected p, .fleet-selected small, .fleet-feedback,
.fleet-small, .fleet-pane small, .fleet-option small, .fleet-ship-photo figcaption {
  color: var(--fleet-muted);
}

.fleet-directory-controls, .fleet-picker-controls, .fleet-buildbar,
.fleet-buildbar form, .fleet-toggle, .fleet-preset, .fleet-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}
.fleet-directory-controls > label { flex: 1 1 180px; }
.fleet-directory-controls > label:last-child { flex-grow: 2; }
.fleet-buildbar form { flex: 2 1 258px; }
.fleet-buildbar label, .fleet-picker-controls label:first-child { flex: 1 1 160px; }
.fleet-directory label, .fleet-workbench label, .fleet-picker label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--fleet-muted);
}
.fleet-directory input, .fleet-directory select, .fleet-workbench input,
.fleet-workbench select, .fleet-picker input[type="search"] {
  width: 100%;
  min-height: 39px;
  padding: 5px 8px;
  border: 1px solid var(--fleet-line);
  border-radius: 7px;
  color: var(--fleet-ink);
  background: #0b1e2a;
  color-scheme: dark;
}
.fleet-directory #fleet-retry { margin-top: 10px; }
.fleet-perseus-view { margin-top: 10px; }
.fleet-perseus-view[hidden] { display: none; }
.fleet-directory-footer { align-items: center; margin-top: 10px; }
.fleet-manager-roster { border-top: 1px solid var(--fleet-line); padding-top: 18px; margin-top: 20px; }
.fleet-manager-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill,minmax(min(100%,255px),1fr)); }
.fleet-manager-card { min-width: 0; background: var(--fleet-surface); border: 1px solid var(--fleet-line); border-radius: 9px; overflow: hidden; }
.fleet-manager-card .fleet-vehicle-art { min-height: 116px; border: 0; border-radius: 0; }
.fleet-manager-card .fleet-vehicle-art img { height: 132px; }
.fleet-manager-card-body { padding: 12px; display: grid; gap: 8px; justify-items: start; }
.fleet-manager-card h4, .fleet-manager-card p { margin: 0; overflow-wrap: anywhere; }
.fleet-manager-card h4 { font-size: 16px; }
.fleet-manager-card p, .fleet-manager-links small { color: var(--fleet-muted); font-size: 12px; }
.fleet-manager-card a.ase-btn { text-decoration: none; }
.fleet-manager-card details { width: 100%; }
.fleet-manager-card summary { cursor: pointer; color: var(--fleet-accent); font-size: 13px; }
.fleet-manager-links { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.fleet-manager-links li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; overflow-wrap: anywhere; }
.fleet-manager-edit { display: grid; gap: 8px; margin-top: 8px; }
.fleet-source, .fleet-pips { color: var(--fleet-accent); }
.fleet-feedback:empty { display: none; }
.fleet-buildbar { margin-bottom: 12px; }
.fleet-visuals, .fleet-fit-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr));
}
.fleet-visuals, .fleet-fit-grid { margin-top: 12px; }
.fleet-fit-workspace { align-items: start; }
.fleet-fit-column { display: grid; min-width: 0; gap: 12px; }
.fleet-visuals-3d { display: flex; flex-wrap: wrap; align-items: start; }
.fleet-visuals-3d .fleet-selected { flex: 1 1 235px; }
.fleet-stage {
  flex: 2 1 465px;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--fleet-line);
  border-radius: 11px;
  background: #091c28;
}
.fleet-stage-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 7px; }
.fleet-stage-controls .fleet-toggle { margin: 0; }
.fleet-stage-controls > button { margin-inline-start: auto; }
.fleet-stage iframe { display: block; width: 100%; height: clamp(410px, 46vh, 560px); border: 0; }
.fleet-stage .fleet-ship-photo { border: 0; border-radius: 0; }
.fleet-stage .fleet-vehicle-art img { height: clamp(180px, 34vw, 440px); }
.fleet-ship-photo, .fleet-selected, .fleet-pane {
  min-width: 0;
  margin: 0;
  padding: 13px;
  border: 1px solid var(--fleet-line);
  border-radius: 11px;
  background: var(--fleet-surface);
}
.fleet-ship-photo { display: grid; grid-template-rows: 1fr auto; gap: 7px; }
.fleet-ship-photo figcaption { font-size: 11px; }
.fleet-art {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 86px;
  margin: 5px 0;
  border-radius: 7px;
  background: #091c28;
}
.fleet-art img, .fleet-art svg { display: block; width: 100%; height: 96px; object-fit: contain; }
.fleet-vehicle-art { min-height: 180px; margin: 0; }
.fleet-vehicle-art img { height: clamp(180px, 24vw, 315px); }
.fleet-art-fallback {
  width: 100%;
  text-align: center;
  padding: 8px;
  color: var(--fleet-muted);
  font-size: 12px;
}
.fleet-art-fallback svg { max-width: 170px; margin-inline: auto; }
.fleet-location, .fleet-small, .fleet-feedback { font-size: 12px; }
.fleet-actions { margin-top: 9px; }
.fleet-craft { margin-top: 10px; }
.fleet-craft summary { cursor: pointer; color: var(--fleet-accent); font-size: 12px; }
.fleet-craft form {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,140px),1fr));
  gap: 8px;
  margin-top: 8px;
}
.fleet-catalog .fleet-heading { align-items: center; }
.fleet-catalog .fleet-catalog-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
}
.fleet-catalog .fleet-catalog-toggle input {
  width: 1em;
  min-height: 0;
  margin: 0;
  accent-color: #8de4d1;
}
.fleet-catalog-results {
  display: grid;
  gap: 6px;
  max-height: min(410px, 44vh);
  margin-top: 10px;
  padding: 3px 5px 3px 3px;
  overflow: auto;
  color-scheme: dark;
  scrollbar-gutter: stable;
}
#fleet-hardpoints, #fleet-inspector { scroll-margin-top: 85px; }
.fleet-assembly, .fleet-hardpoint-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--fleet-line);
  border-radius: 8px;
  color: var(--fleet-ink);
  background: #0b1e2a;
  overflow-wrap: anywhere;
}
.fleet-assembly > summary, .fleet-hardpoint-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}
.fleet-assembly > summary {
  grid-template-columns: .65rem minmax(0,1fr) auto;
  list-style: none;
  border-radius: 7px;
}
.fleet-assembly > summary::-webkit-details-marker { display: none; }
.fleet-assembly > summary::before {
  content: '';
  width: 5px;
  height: 5px;
  border: solid var(--fleet-accent);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
}
.fleet-assembly[open] > summary::before { transform: rotate(45deg); }
.fleet-assembly[open] > summary { background: #142e3d; }
.fleet-assembly:has([aria-pressed="true"]) > summary { color: var(--fleet-accent); }
.fleet-assembly-body { padding: 7px 8px 8px; }
.fleet-branch-tree {
  display: grid;
  gap: 5px;
  list-style: none;
  border-inline-start: 1px solid #3d6474;
  margin: 5px 0 0 8px;
  padding-inline-start: 8px;
}
.fleet-hardpoint-card span small { display: block; margin-top: 2px; }
.fleet-hardpoint-card > small, .fleet-assembly > summary > small { white-space: nowrap; }
.fleet-branch-label, .fleet-attachment-branch summary { display: block; padding: 5px; color: var(--fleet-muted); }
.fleet-attachment-branch summary { display: list-item; cursor: pointer; font-size: 12px; }
.fleet-attachment-branch summary small { margin-inline-start: 3px; }
.fleet-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,115px),1fr));
  gap: 6px;
}
.fleet-metrics > div, .fleet-power-rows > div,
.fleet-option {
  color: var(--fleet-ink);
  background: #0b1e2a;
  border: 1px solid var(--fleet-line);
  border-radius: 7px;
  padding: 8px;
  text-align: left;
  overflow-wrap: anywhere;
}
.fleet-option { cursor: pointer; }
.fleet-metrics small { display: block; }
#fleet-fit-data .fleet-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
.fleet-hardpoint-card[aria-pressed="true"], .fleet-toggle button[aria-pressed="true"],
.fleet-buildbar button[aria-pressed="true"] {
  background: #205065;
  border-color: #8cded9;
  color: #fff;
}
.fleet-toggle, .fleet-preset { margin-bottom: 5px; }
.fleet-power-rows { display: grid; gap: 5px; }
.fleet-compare { overflow-x: auto; }
.fleet-compare table { width: 100%; text-align: left; border-collapse: collapse; }
.fleet-compare th, .fleet-compare td { padding: 8px; border-bottom: 1px solid var(--fleet-line); }

.fleet-picker {
  width: min(calc(100% - 20px), 780px);
  max-height: min(85dvh, 850px);
  padding: 15px;
  border: 1px solid #72c0ca;
  border-radius: 13px;
  background: var(--fleet-surface);
  overscroll-behavior: contain;
}
.fleet-picker::backdrop { background: #050c15cc; }
.fleet-picker .fleet-crafted-filter { display: flex; align-items: center; min-height: 39px; }
.fleet-options { display: grid; gap: 6px; }
.fleet-option {
  display: grid;
  grid-template-columns: minmax(66px, 110px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.fleet-option small { display: block; }
.fleet-option .fleet-art { min-height: 62px; margin: 0; }
.fleet-option .fleet-art img, .fleet-option .fleet-art svg { height: 64px; }
.fleet-option:hover, .fleet-hardpoint-card:hover, .fleet-assembly:hover { border-color: var(--fleet-accent); }
.fleet-directory :focus-visible, .fleet-workbench :focus-visible, .fleet-picker :focus-visible {
  outline: 2px solid var(--fleet-accent);
  outline-offset: 2px;
}
