/* Visual fleet workspace. Load after ui-fleet.css; no Fleet Painter selectors. */
.fleet-builder {
  --fw-line: #284954;
  --fw-muted: #a0bac5;
  --fw-panel: #0b1c27e8;
  --fw-heading: var(--ui-heading, 'GFA Command', 'Segoe UI', sans-serif);
}
.fleet-builder:has(.fb-workspace) .fb-shell { width: min(100%, 1800px); max-width: 1800px; }
.fleet-builder:has(.fb-workspace) .fb-header { gap: 12px; padding: 12px 28px; }
.fleet-builder:has(.fb-workspace) .fb-header > div { flex: 1; }
.fleet-builder:has(.fb-workspace) .fb-header h1 { font-size: 26px; }
.fleet-builder:has(.fb-workspace) .fb-header .eyebrow { margin-bottom: 3px; font-size: 10px; }
.fleet-builder:has(.fb-workspace) .fb-header p:last-child { margin-top: 5px; font-size: 12px; }
.fleet-builder:has(.fb-workspace) .mission-lock-summary { margin: 0; padding: 9px 28px; min-height: 40px; border-inline: 0; }
.fleet-builder:has(.fb-workspace) .mission-lock-summary p { margin: 0; font-size: 12px; }
.fleet-builder:has(.fb-workspace) .fb-tabs { padding-top: 10px; }
.fleet-builder:has(.fb-workspace) .fb-tabs button { padding-block: 10px; }
.fleet-builder .fb-mission-options[hidden] { display: none; }
.fleet-builder .fb-mission-options { border-bottom: 1px solid var(--fw-line); }
.fleet-builder .fb-mission-options > summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 28px; color: var(--fw-muted); font-size: 12px; list-style: none; }
.fleet-builder .fb-mission-options > summary > svg { width: 16px; height: 16px; }
.fleet-builder .fb-mission-options[open] > summary > svg { transform: rotate(180deg); }
.fleet-builder .fb-mission-options > summary::-webkit-details-marker { display: none; }
.fleet-builder .fb-file-menu { position: relative; }
.fleet-builder .fb-file-menu > summary { display: flex; align-items: center; gap: 18px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--fw-line); list-style: none; font-size: 12px; }
.fleet-builder .fb-file-menu > summary > svg { width: 14px; height: 14px; transform: rotate(180deg); }
.fleet-builder .fb-file-menu > summary::-webkit-details-marker { display: none; }
.fleet-builder .fb-file-menu > div { position: absolute; bottom: calc(100% + 8px); left: 0; width: 240px; max-width: calc(100vw - 36px); display: grid; gap: 8px; padding: 12px; background: #0a1b26; border: 1px solid #477a8b; box-shadow: 0 -8px 24px #0006; }
.fleet-builder .fb-file-menu > div small { color: var(--fw-muted); font-size: 11px; }
.fleet-builder:has(.fb-workspace) .fb-body { grid-template-columns: minmax(0, 1fr) 248px; gap: 24px; padding-top: 16px; }
.fleet-builder .fb-roster :is(.fb-workspace, .fb-identity, .fb-groups, .fb-visual-group, .fb-ship-tile, .fb-ship-content) { min-width: 0; }
.fleet-builder .fb-workspace { --fb-team-fill: transparent; display: block; min-width: 0; }
.fleet-builder .fb-workspace [hidden] { display: none !important; }
.fleet-builder .fb-workspace-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; min-width: 0; margin-bottom: 14px; }
.fleet-builder .fb-workspace-heading > div:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 5px 12px; min-width: 0; flex: 1 1 210px; }
.fleet-builder .fb-workspace-heading > div:first-child > .eyebrow { grid-column: 1 / -1; margin: 0; }
.fleet-builder .fb-workspace-heading > div:first-child > small { margin: 0; font-size: 11px; }
.fleet-builder .fb-workspace-heading .eyebrow { margin: 0 0 5px; font-size: 11px; letter-spacing: .19em; }
.fleet-builder .fb-workspace-heading h2 { margin: 0; color: #e8f5fa; font: 700 27px/1.1 var(--fw-heading); letter-spacing: .04em; }
.fleet-builder .fb-workspace-heading :is(p:not(.eyebrow), small, .fb-counts) { margin: 7px 0 0; color: var(--fw-muted); font-size: 12px; }
.fleet-builder .fb-workspace-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.fleet-builder :is(.fb-workspace-tools, .fb-workspace-actions) > button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fleet-builder :is(.fb-workspace-tools, .fb-workspace-actions) > button > svg { width: 18px; height: 18px; flex-shrink: 0; }
.fleet-builder :is(.fb-workspace-tools, .fb-workspace-actions, .fb-colour-panel, .fb-visual-group) button {
  min-height: 44px; max-width: 100%; padding: 10px 13px; border: 1px solid #355c6b; border-radius: 2px;
  background: #102833; color: #d5eaf1; box-shadow: none; font: 600 13px/1.35 var(--fw-heading); cursor: pointer;
}
.fleet-builder :is(.fb-workspace-tools, .fb-workspace-actions, .fb-colour-panel, .fb-visual-group) button:hover:not(:disabled) { background: #163641; border-color: #71cbd9; box-shadow: none; }
.fleet-builder :is(.fb-workspace-tools, .fb-workspace-actions, .fb-colour-panel, .fb-visual-group) button:disabled { cursor: not-allowed; }
.fleet-builder :is(.fb-identity, .fb-colour-panel, .fb-visual-group) :is(input:not([type=checkbox]):not([type=radio]), select) { min-width: 0; max-width: 100%; min-height: 44px; border-radius: 2px; }
.fleet-builder :is(.fb-workspace, .fb-identity, .fb-workspace-actions, .fb-visual-group, .fb-overview) :is(button, input, select, summary):focus-visible { outline: 2px solid #8ae6ef; outline-offset: 3px; box-shadow: none; }
.fleet-builder .fb-colour-menu { position: relative; min-width: 0; }
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer, .fb-ship-catalogue, .fb-overview) > summary {
  display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 12px; color: #bbd5df;
  font-size: 12px; line-height: 1.4; list-style: none; cursor: pointer; overflow-wrap: anywhere;
}
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer, .fb-ship-catalogue, .fb-overview) > summary::-webkit-details-marker { display: none; }
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer, .fb-ship-catalogue, .fb-overview) > summary::after { content: '+'; margin-left: auto; color: #83cbd9; font: 500 19px/1 var(--fw-heading); }
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer, .fb-ship-catalogue, .fb-overview)[open] > summary::after { content: '−'; }
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer) > summary:has(> svg:last-child)::after { display: none; }
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer) > summary > svg:last-child { width: 16px; height: 16px; flex-shrink: 0; margin-left: auto; color: #83cbd9; }
.fleet-builder :is(.fb-colour-menu, .fb-group-settings, .fb-command-drawer)[open] > summary > svg:last-child { transform: rotate(180deg); }
.fleet-builder .fb-colour-swatch { width: 12px; height: 12px; border: 1px solid #cce9ed55; border-radius: 2px; flex-shrink: 0; }
.fleet-builder .fb-colour-menu > summary { border: 1px solid #355c6b; border-radius: 2px; background: #102833; }
.fleet-builder .fb-colour-menu[open] { z-index: 5; }
.fleet-builder .fb-colour-panel {
  position: absolute; top: calc(100% + 8px); right: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; width: 390px; max-width: calc(100vw - 48px); padding: 18px; border: 1px solid #477a8b;
  background: #0a1b26; box-shadow: 0 12px 28px #0006;
}
.fleet-builder .fb-colour-panel > * { min-width: 0; }
.fleet-builder .fb-colour-panel > small { grid-column: 1 / -1; color: var(--fw-muted); font-size: 11px; line-height: 1.5; }
.fleet-builder .fb-colour-panel :is(.fb-paint-bar, .fb-fields) { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; background: none; }
.fleet-builder .fb-colour-panel :is(.fb-paint-bar, .fb-fields) > label { min-width: 0; flex: 1 1 100%; }
.fleet-builder .fb-colour-panel input[type=color] { width: 100%; padding: 4px; }
.fleet-builder .fb-player.fb-identity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 14px; margin: 0 0 18px; padding: 0; border: 0; background: none; }
.fleet-builder .fb-identity { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 14px; margin-bottom: 10px; }
.fleet-builder .fb-identity > label { gap: 4px; }
.fleet-builder .fb-identity > * { min-width: 0; }
.fleet-builder .fb-identity .fb-faction-guide { grid-column: 1 / -1; padding: 10px 12px; border-width: 0 0 0 2px; background: #10263190; }
.fleet-builder .fb-workspace > .fb-faction-guide { margin-bottom: 16px; padding: 10px 12px; border-width: 0 0 0 2px; background: #10263190; }
.fleet-builder .fb-workspace-actions { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.fleet-builder .fb-workspace-actions > button[data-action="generate"] { color: #201c11; background: linear-gradient(115deg, #e8cc81, #bd9141); border-color: #f0dca2; box-shadow: inset 0 1px #fff5d15e, 0 0 16px #dfb75c15; }
.fleet-builder .fb-workspace-actions > button[data-action="generate"]:hover:not(:disabled) { color: #17130b; background: #f1d991; border-color: #fff0be; }
.fleet-builder .fb-workspace-actions .fb-command-menu { display: contents; position: static; margin: 0; padding: 0; border: 0; background: none; }
.fleet-builder .fb-command-menu > summary { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 10px 13px; border: 1px solid #477c8d; list-style: none; color: #daf3f6; font: 600 13px/1.35 var(--fw-heading); }
.fleet-builder .fb-command-menu > summary::-webkit-details-marker { display: none; }
.fleet-builder .fb-command-menu > summary small { font-size: 11px; color: #93c1cf; }
.fleet-builder .fb-command-menu > summary > svg { width: 16px; height: 16px; }
.fleet-builder .fb-command-menu[open] > summary > svg { transform: rotate(180deg); }
.fleet-builder .fb-command-panel { position: relative; order: 1; flex: 1 0 100%; width: 100%; max-height: min(55vh, 460px); overflow: auto; padding: 16px; border: 1px solid #477c8d; background: #0a1b26; }
.fleet-builder .fb-command-panel .fb-checks { margin: 0; }
.fleet-builder .fb-command-panel .fb-checks label { min-height: 44px; }
.fleet-builder .fb-command-choice { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-content: start; min-width: 0; }
.fleet-builder .fb-command-readout { grid-column: 1 / -1; position: sticky; top: 0; z-index: 1; box-sizing: border-box; height: 112px; overflow: auto; padding: 12px; border: 1px solid #34596b; background: #102735; color: #b5d5df; font-size: 13px; line-height: 1.5; }
.fleet-builder .fb-command-readout strong { color: #dff5ff; }
.fleet-builder .fb-command-readout p { margin: 6px 0 0; }
.fleet-builder .fb-command-choice > label { margin: 0; }
.fleet-builder .fb-command-choice > .fb-command-info { align-self: start; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; color: #91b8c6; font: 600 14px/1 var(--fw-heading); }
.fleet-builder .fb-command-info:hover, .fleet-builder .fb-command-info:focus-visible, .fleet-builder .fb-command-info[aria-expanded="true"] { color: #d5f5ff; background: #183746; }
.fleet-builder .fb-command-choice > .fb-command-description { display: block; position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; padding: 0; pointer-events: none; color: #b5d5df; font: 400 12px/1.5 var(--ui-body, 'Segoe UI', sans-serif); }
.fleet-builder .fb-command-description > small { white-space: nowrap; color: #7fa5b4; }
.fleet-builder .fb-command-choice:hover > .fb-command-description,
.fleet-builder .fb-command-choice:focus-within > .fb-command-description,
.fleet-builder .fb-command-choice[data-help-open="true"] > .fb-command-description { display: block; }
.fleet-builder .fb-workspace-actions > :last-child:not(:first-child) { margin-left: auto; }
.fleet-builder .fb-workspace-actions > span { max-width: 260px; color: var(--fw-muted); font-size: 11px; line-height: 1.5; }
.fleet-builder .fb-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 22px; }
.fleet-builder .fb-group.fb-visual-group {
  position: relative; margin: 0; padding: 0 16px 16px; border: 1px solid var(--fw-line); border-radius: 3px;
  background: var(--fw-panel); box-shadow: none;
}
.fleet-builder .fb-visual-group::before { content: ''; position: absolute; top: -1px; left: 16px; width: 46px; height: 2px; background: var(--fb-team, #6acbdc); pointer-events: none; }
.fleet-builder .fb-visual-group::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-right: 1px solid #66adbd; border-bottom: 1px solid #66adbd; pointer-events: none; }
.fleet-builder .fb-visual-group > .fb-group-content { padding: 0; }
.fleet-builder .fb-visual-group > .fb-group-editor { gap: 0; }
.fleet-builder .fb-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 14px 0 10px; }
.fleet-builder .fb-group-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fleet-builder .fb-group-title > small { color: var(--fb-team, #74c6d5); font: 600 11px/1.4 var(--fw-heading); letter-spacing: .13em; text-transform: uppercase; }
.fleet-builder .fb-group-title h3 { margin: 0; color: #e5f2f8; font: 700 22px/1.1 var(--fw-heading); letter-spacing: .025em; overflow-wrap: anywhere; }
.fleet-builder .fb-group-title :is(p, span) { margin: 0; color: var(--fw-muted); font-size: 11px; line-height: 1.5; }
.fleet-builder .fb-group-metrics { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; flex: 0 0 auto; font: 600 15px/1.2 var(--fw-heading); font-variant-numeric: tabular-nums; color: #d2e5ee; }
.fleet-builder .fb-group-metrics small { color: var(--fw-muted); font: 11px/1.4 'Segoe UI', sans-serif; }
.fleet-builder .fb-thrust { display: grid; grid-template-columns: 19px auto; align-items: center; gap: 3px 5px; color: #91dae6; font: 700 22px/1 var(--fw-heading); }
.fleet-builder .fb-thrust svg { display: block; width: 19px; height: 23px; flex-shrink: 0; }
.fleet-builder .fb-thrust small { grid-column: 1 / -1; text-align: center; font-size: 9px; letter-spacing: .08em; }
.fleet-builder .fb-group-points { display: grid; gap: 4px; text-align: right; }
.fleet-builder .fb-group-points strong { font-size: 22px; }
.fleet-builder .fb-group-points small { font-size: 9px; letter-spacing: .08em; }
.fleet-builder .fb-visual-group > .fb-group-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; }
.fleet-builder .fb-visual-group .fb-group-toolbar:has([open]),
.fleet-builder .fb-visual-group .fb-command-drawer[open],
.fleet-builder .fb-visual-group .fb-group-roster { grid-column: 1 / -1; }
.fleet-builder .fb-group-toolbar { display: grid; gap: 0; margin: 0 0 14px; border-block: 1px solid var(--fw-line); }
.fleet-builder .fb-group-settings { min-width: 0; }
.fleet-builder .fb-group-settings > summary { padding-inline: 0; }
.fleet-builder .fb-group-settings[open] > summary { color: #e0f1f6; }
.fleet-builder .fb-group-setup { min-width: 0; padding: 4px 0 16px; }
.fleet-builder .fb-visual-group :is(.fb-setup-fields, .fb-command-fields) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fleet-builder .fb-visual-group .fb-fields > label { min-width: 0; }
.fleet-builder .fb-visual-group .fb-group-flags { gap: 7px; }
.fleet-builder .fb-visual-group .fb-group-flags .fb-check { min-height: 44px; padding: 9px 11px; background: #0c202b; }
.fleet-builder .fb-visual-group .fb-commander.fb-command-drawer { margin: 0 0 16px; padding: 0; border: 0; border-block: 1px solid var(--fw-line); border-radius: 0; background: #0d222a80; }
.fleet-builder .fb-command-drawer > summary { color: #d8d2b5; }
.fleet-builder .fb-command-drawer > summary svg { width: 17px; height: 17px; flex-shrink: 0; color: #d4bd7c; }
.fleet-builder .fb-command-drawer > div { min-width: 0; padding: 4px 12px 16px; }
.fleet-builder .fb-visual-group .fb-section-heading { gap: 8px; margin-bottom: 12px; }
.fleet-builder .fb-visual-group .fb-section-heading h3 { font-size: 16px; }
.fleet-builder .fb-visual-group .fb-group-roster > .fb-help { margin: 0 0 12px; }
.fleet-builder .fb-visual-group .fb-ships.fb-visual-ships { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 10px; align-items: stretch; }
.fleet-builder .fb-ship-tile:has(.fb-miniature-svg[data-wide="true"]) { grid-column: span 2; }
.fleet-builder .fb-ship-tile {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0;
  min-width: 0; padding: 44px 10px 10px; border: 1px solid #24424f80; border-radius: 2px; background: #07172040;
}
.fleet-builder .fb-ship-tile:has(.fb-command-star[aria-pressed=true]) { border-color: #77714f; }
.fleet-builder .fb-visual-group .fb-command-star {
  position: absolute; z-index: 1; top: 5px; left: 5px; display: grid; place-items: center; width: 44px; height: 44px;
  min-height: 44px; padding: 11px; border-color: transparent; background: transparent; color: #73929f;
}
.fleet-builder .fb-command-star svg { width: 21px; height: 21px; }
.fleet-builder .fb-visual-group .fb-command-star[aria-pressed=true] { color: #e5c983; background: #c7ad5714; border-color: #aa965a80; }
.fleet-builder .fb-miniature { display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; min-width: 0; min-height: 102px; width: 100%; margin: 0 auto 10px; color: var(--fb-team, #74c6d5); pointer-events: none; }
.fleet-builder .fb-miniature > svg { display: block; flex-shrink: 0; max-width: none; min-height: 0; overflow: visible; }
.fleet-builder .fb-ship-caption { min-width: 0; text-align: center; }
.fleet-builder .fb-ship-caption h4 { margin: 0 0 4px; color: #e2eff6; font: 600 17px/1.15 var(--fw-heading); overflow-wrap: anywhere; }
.fleet-builder .fb-ship-caption h4.fb-no-art { color: #ff9697; }
.fleet-builder .fb-ship-caption small { display: block; color: var(--fw-muted); font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.fleet-builder .fb-visual-group .fb-ship.fb-ship-options { position: static; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.fleet-builder .fb-visual-group .fb-ship-options > summary.fb-upgrade-toggle {
  position: absolute; top: 5px; right: 5px; display: flex; align-items: center; justify-content: center; flex-direction: row;
  gap: 5px; min-height: 44px; max-width: calc(100% - 58px); padding: 10px 8px; border: 1px solid transparent;
  border-radius: 2px; color: #a2c5d2; background: transparent; font: 600 12px/1.25 var(--fw-heading); list-style: none;
}
.fleet-builder .fb-ship-options > summary::-webkit-details-marker { display: none; }
.fleet-builder .fb-upgrade-toggle svg { width: 18px; height: 18px; flex-shrink: 0; }
.fleet-builder .fb-visual-group .fb-ship-options[open] > summary.fb-upgrade-toggle { color: #b9f0f5; border-color: #386574; background: #112e3b; }
.fleet-builder .fb-ship-tile:has(.fb-ship-options[open]) { grid-column: 1 / -1; border-color: #477989; }
.fleet-builder .fb-ship-tile:has(.fb-ship-options[open]) .fb-miniature { width: 100%; }
.fleet-builder .fb-visual-group .fb-ship-content { min-width: 0; width: 100%; margin-top: 16px; padding: 16px 2px 0; border-top: 1px solid var(--fw-line); }
.fleet-builder .fb-visual-group .fb-ship-content :is(.fb-help, .fb-statline) { overflow-wrap: anywhere; }
.fleet-builder .fb-visual-group .fb-loadout { margin-top: 16px; padding-top: 14px; }
.fleet-builder .fb-visual-group .fb-loadout-row { gap: 10px; min-height: 44px; }
.fleet-builder .fb-visual-group .fb-loadout-row > span { min-width: 0; overflow-wrap: anywhere; }
.fleet-builder .fb-visual-group .fb-loadout-row input { min-height: 44px !important; }
.fleet-builder .fb-visual-group .fb-loadout-row select { flex: 0 1 55%; width: 55%; }
.fleet-builder .fb-visual-group .fb-ship-paint { gap: 10px; }
.fleet-builder .fb-visual-group .fb-ship-paint label { min-width: 0; flex-basis: 180px; }
.fleet-builder .fb-visual-group .fb-remove { min-height: 44px; color: #e0a8a4; background: transparent; }
.fleet-builder .fb-visual-group .fb-add-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 202px; padding: 18px 10px; border: 1px dashed #3c6474; background: #0b202940; color: #92ceda; }
.fleet-builder .fb-add-tile svg { width: 28px; height: 28px; }
.fleet-builder .fb-add-tile small { color: var(--fw-muted); font-size: 11px; }
.fleet-builder .fb-ship-catalogue { grid-column: 1 / -1; min-width: 0; margin-top: 14px; border: 1px solid #355c6b; background: #081923; }
.fleet-builder .fb-ship-catalogue > summary { color: #c7e7ee; }
.fleet-builder .fb-catalogue-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 12px; border-top: 1px solid var(--fw-line); }
.fleet-builder .fb-catalogue-toolbar > :is(label, input) { flex: 1 1 160px; min-width: 0; }
.fleet-builder .fb-catalogue-toolbar .fb-ship-source { flex: 1 1 180px; margin: 0; }
.fleet-builder .fb-ship-catalogue > label { margin: 0 12px 12px; min-width: 0; }
.fleet-builder .fb-ship-catalogue > .fb-quick-add { padding-top: 12px; border-top: 1px solid var(--fw-line); }
.fleet-builder .fb-catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 8px; padding: 0 12px 12px; max-height: 440px; overflow: auto; overscroll-behavior: contain; }
.fleet-builder .fb-catalogue-ship:has(.fb-miniature-svg[data-wide="true"]) { grid-column: span 2; }
.fleet-builder .fb-visual-group .fb-catalogue-ship { display: grid; justify-items: center; align-content: start; gap: 8px; min-width: 0; padding: 10px 8px; border-color: #294855; background: #0b212c; text-align: center; overflow-wrap: anywhere; }
.fleet-builder .fb-catalogue-ship > svg { display: block; width: 100%; height: 92px; }
.fleet-builder .fb-catalogue-ship > svg:last-child { width: 18px; height: 18px; color: #7fb4c5; }
.fleet-builder .fb-catalogue-ship .fb-miniature { width: 100%; margin-bottom: 0; }
.fleet-builder .fb-catalogue-ship span { max-width: 100%; }
.fleet-builder .fb-catalogue-ship small { display: block; margin-top: 3px; color: var(--fw-muted); font: 11px/1.4 'Segoe UI', sans-serif; }
.fleet-builder .fb-visual-group > .fb-loaded-craft,
.fleet-builder .fb-visual-group .fb-group-roster > .fb-loaded-craft { margin: 16px 0 0; padding-top: 12px; gap: 10px 14px; border-top: 1px solid var(--fw-line); }
.fleet-builder .fb-visual-group .fb-loaded-wing { min-width: 0; max-width: 100%; color: #b8cfd8; }
.fleet-builder .fb-visual-group .fb-loaded-wing > span { min-width: 0; overflow-wrap: anywhere; }
.fleet-builder .fb-retained-ship { background: #11232888; border-style: dashed; }
.fleet-builder .fb-retained-badge { display: inline-block; justify-self: center; max-width: 100%; margin-top: 9px; padding: 4px 7px; color: #b5cbbf; background: #9dc6ae12; border: 1px solid #466357; font: 600 10px/1.4 var(--fw-heading); letter-spacing: .05em; overflow-wrap: anywhere; }
.fleet-builder .fb-overview { min-width: 0; margin-block: 18px; border-block: 1px solid var(--fw-line); }
.fleet-builder .fb-overview .fb-fleet-preview { margin: 0 0 14px; border: 0; box-shadow: none; }
.fleet-builder:has(.fb-workspace) .fb-validation { position: sticky; top: 16px; order: 0; padding: 16px; background: #0c202bdc; border-color: var(--fw-line); box-shadow: none; }
.fleet-builder:has(.fb-workspace) .fb-validation h2 { font: 700 21px/1.15 var(--fw-heading); }
.fleet-builder:has(.fb-workspace) .fb-validation > ul { max-height: 32vh; overflow-y: auto; }
.fleet-builder:has(.fb-workspace) .fb-validation li { margin-bottom: 8px; }
.fleet-builder:has(.fb-workspace) .fb-validation summary { display: flex; align-items: center; min-height: 44px; }
.fleet-builder:has(.fb-workspace) .fb-totals { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.fleet-builder:has(.fb-workspace) .fb-totals > div { padding: 0; border: 0; background: none; }

@media (max-width: 1200px) {
  .fleet-builder:has(.fb-workspace) .fb-body { grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; padding-inline: 22px; }
  .fleet-builder .fb-groups { gap: 16px; }
  .fleet-builder .fb-group.fb-visual-group { padding-inline: 12px; }
  .fleet-builder .fb-group-heading { align-items: start; gap: 10px; }
  .fleet-builder .fb-group-metrics { flex-direction: column; gap: 7px; }
}
@media (max-width: 1099px) {
  .fleet-builder:has(.fb-workspace) .fb-body { grid-template-columns: minmax(0, 1fr) 236px; }
  .fleet-builder .fb-groups { grid-template-columns: minmax(0, 1fr); }
  .fleet-builder .fb-group-metrics { flex-direction: row; }
  .fleet-builder:has(.fb-workspace) .fb-validation { order: 0; }
}
@media (max-width: 800px) {
  .fleet-builder:has(.fb-workspace) .fb-body { grid-template-columns: minmax(0, 1fr); }
  .fleet-builder:has(.fb-workspace) .fb-validation { position: static; }
  .fleet-builder:has(.fb-workspace) .fb-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .fleet-builder:has(.fb-workspace) .fb-header { flex-wrap: wrap; justify-content: flex-end; padding: 14px 16px; gap: 8px; }
  .fleet-builder:has(.fb-workspace) .fb-header > div { flex: 1 1 100%; min-width: 0; }
  .fleet-builder:has(.fb-workspace) .fb-footer { flex-direction: row; align-items: center; gap: 12px; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
  .fleet-builder:has(.fb-workspace) .fb-footer .fb-deploy { width: auto; min-width: 0; flex: 1; }
  .fleet-builder:has(.fb-workspace) .fb-body { gap: 18px; padding: 18px 14px 24px; }
  .fleet-builder .fb-workspace-heading { gap: 14px; margin-bottom: 18px; }
  .fleet-builder .fb-workspace-heading > div:first-child { display: block; }
  .fleet-builder .fb-workspace-tools { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .fleet-builder .fb-workspace-tools > button { width: 100%; }
  .fleet-builder .fb-workspace-tools:has(.fb-colour-menu[open]) { display: flex; }
  .fleet-builder .fb-workspace-tools:has(.fb-colour-menu[open]) > button { width: auto; }
  .fleet-builder .fb-colour-menu[open] { width: 100%; }
  .fleet-builder .fb-colour-panel { position: static; width: 100%; max-width: 100%; margin-top: 8px; padding: 14px; box-shadow: none; }
  .fleet-builder .fb-player.fb-identity,
  .fleet-builder .fb-identity { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fleet-builder .fb-workspace-actions { gap: 8px; }
  .fleet-builder .fb-workspace-actions > :last-child:not(:first-child) { margin-left: 0; }
  .fleet-builder .fb-group.fb-visual-group { padding: 0 10px 12px; }
  .fleet-builder .fb-group-heading { padding: 17px 2px 12px; }
  .fleet-builder .fb-group-title h3 { font-size: 21px; }
  .fleet-builder .fb-group-metrics { flex-direction: column; font-size: 14px; }
  .fleet-builder .fb-visual-group .fb-ships.fb-visual-ships { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fleet-builder .fb-ship-tile { padding-inline: 7px; }
  .fleet-builder .fb-visual-group .fb-ship-options > summary.fb-upgrade-toggle { width: 44px; max-width: 44px; padding: 11px; }
  .fleet-builder .fb-upgrade-toggle > span { display: none; }
  .fleet-builder .fb-miniature { min-height: 116px; }
  .fleet-builder .fb-ship-tile:has(.fb-miniature-svg[data-wide="true"]),
  .fleet-builder .fb-catalogue-ship:has(.fb-miniature-svg[data-wide="true"]) { grid-column: 1 / -1; }
  .fleet-builder .fb-ship-caption h4 { font-size: 16px; }
  .fleet-builder .fb-visual-group .fb-add-tile { min-height: 212px; }
  .fleet-builder .fb-visual-group :is(.fb-setup-fields, .fb-command-fields, .fb-trait-grid, .fb-checks) { grid-template-columns: minmax(0, 1fr); }
  .fleet-builder .fb-command-drawer > div { padding-inline: 10px; }
  .fleet-builder .fb-visual-group .fb-group-flags .fb-check { flex: 1 1 auto; }
  .fleet-builder .fb-visual-group .fb-loadout-row input { flex-basis: 68px; width: 68px !important; }
  .fleet-builder .fb-catalogue-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 380px; padding-inline: 8px; }
  .fleet-builder .fb-catalogue-toolbar { padding-inline: 8px; }
  .fleet-builder:has(.fb-workspace) .fb-footer button { min-height: 44px; }
}
@media (max-width: 420px) {
  .fleet-builder .fb-ship-tile:has(.fb-miniature-svg[data-compact="false"]),
  .fleet-builder .fb-catalogue-ship:has(.fb-miniature-svg[data-compact="false"]) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .fleet-builder :is(.fb-workspace, .fb-visual-group) * { transition: none; animation: none; }
}
/* Visible source-page portraits, shared with the battle commander rules panel. */
.character-portrait{display:flex;align-items:center;gap:16px;margin:14px 0;padding:12px;border:1px solid #335765;background:linear-gradient(115deg,#102c36a0,#09151c80);min-width:0}
.character-portrait-art{width:96px;height:96px;display:block;flex:none;border-radius:50%;pointer-events:none;filter:drop-shadow(0 0 5px #7ad7ed20)}
.character-portrait-art>svg{display:block;width:100%;height:100%;overflow:visible}
.fb-command-portrait{display:block;width:36px;height:36px;pointer-events:none}
.fb-command-portrait .character-portrait-art{width:36px;height:36px}
.fleet-builder .fb-commander-portraits-toggle{display:flex;flex-direction:row;align-items:center;gap:7px;color:#a8c6d1;font-size:12px;min-height:44px;white-space:nowrap}
.character-portrait figcaption{font-family:var(--font-display,inherit);font-size:14px;color:#e0f7ff;overflow-wrap:anywhere}
.character-portrait small{display:block;margin-top:7px;color:#9ebbc7;font-size:11px}
.fb-pella-choice{display:grid;gap:7px;max-width:540px;padding:12px;border-left:2px solid #c8b473;background:#172b30}
.fb-pella-choice small{color:#afc5cd;font-size:12px}
.rules-notes .character-portrait-art{width:64px;height:64px}
@media(max-width:480px){.character-portrait{gap:10px;padding:8px}.character-portrait-art{width:76px;height:76px}}
