/* Loadout workbench: compact head, live ship values, equipment list beside the slot editor.
   Everything here is scoped to .hss-loadout-page; shared parts live in hysec-universe-ui.css. */
.hss-shell .hss-workspace-page:has(> .hss-loadout-page .hss-loadout-studio) { display: flex; flex-direction: column; padding-block: 18px 0; overflow: hidden; }
.hss-shell .hss-loadout-page { container: hss-loadout / inline-size; display: flex; flex-direction: column; min-height: 0; color: var(--hsu-text); }
.hss-shell .hss-loadout-page:has(.hss-loadout-studio) { flex: 1 1 auto; height: 100%; }
.hss-shell .hss-loadout-page .mud-button-root.hss-surface-button { min-height: 36px; padding: 6px 14px; border-radius: var(--hsu-radius-sm) !important; font-size: var(--hsu-text-sm); font-weight: 600; text-transform: none; letter-spacing: 0; box-shadow: none; }
.hss-shell .hss-loadout-page .mud-button-text.hss-surface-button { border: 0; background: transparent; }
.hss-shell .hss-loadout-page .mud-button-filled-warning.hss-surface-button { border: 1px solid var(--hsu-accent); background: var(--hsu-accent); color: #17130d; }
.hss-shell .hss-loadout-page .mud-button-outlined.hss-surface-button { border: 1px solid var(--hsu-line-strong); }
.hss-shell .hss-loadout-page button.hss-surface-button { font: inherit; color: inherit; cursor: pointer; }
.hss-shell .hss-loadout-page button.hss-surface-button:disabled { cursor: default; opacity: .5; }
.hss-shell .hss-loadout-page :is(button, summary, a, input, select):focus-visible { outline: 2px solid var(--hsu-accent); outline-offset: -2px; }
.hss-shell .hss-loadout-page kbd { padding: 0 5px; border: 1px solid var(--hsu-line-strong); border-radius: 4px; font: inherit; font-size: .72rem; color: var(--hsu-text); }
.lo-hint { margin: 0; color: var(--hsu-text-muted); font-size: var(--hsu-text-sm); }
.hss-shell .hss-loadout-page .lo-size { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 5px; border: 1px solid var(--hsu-line-strong); border-radius: 4px; color: #c8b995; font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hss-shell .hss-loadout-page .lo-size.crafted { border-color: var(--hsu-accent-line); color: var(--hsu-accent-strong); }
.hss-shell .hss-loadout-page .lo-quality { padding: 1px 6px; border: 1px solid var(--hsu-accent-line); border-radius: 4px; color: var(--hsu-accent-strong); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.hss-shell .hss-loadout-page .improved { color: #97c9b0; }
.hss-shell .hss-loadout-page .degraded { color: #e6a48c; }

/* Head: way back, ship, build and every save action in one line. */
.hss-shell .hss-loadout-page .lo-head { flex: 0 0 auto; align-items: center; margin: 0 0 6px; gap: 10px 20px; }
.hss-shell .hss-loadout-page .lo-head .hsu-page-title { flex-flow: row wrap; align-items: baseline; column-gap: 14px; row-gap: 2px; flex-basis: 260px; }
.hss-shell .hss-loadout-page .lo-head .hsu-crumbs { flex-basis: 100%; }
.hss-shell .hss-loadout-page .lo-head h1 { font-size: clamp(1.35rem, 1.1rem + .8cqi, 1.75rem); }
.hss-shell .hss-loadout-page .lo-head .hsu-page-title > p { font-size: var(--hsu-text-sm); }
.hss-shell .hss-loadout-page .lo-head .hsu-page-actions { gap: 6px 10px; }
.hss-shell .hss-loadout-page .lo-build-switch { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; min-height: 40px; padding: 4px 8px 4px 10px; border: 1px solid var(--hsu-line-strong); border-radius: var(--hsu-radius-sm); background: var(--hsu-surface); color: var(--hsu-text); text-align: left; }
.hss-shell .hss-loadout-page .lo-build-switch:hover { border-color: var(--hsu-accent-line); }
.lo-build-switch > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.lo-build-switch small { color: var(--hsu-text-faint); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.lo-build-switch strong { overflow: hidden; color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); text-overflow: ellipsis; white-space: nowrap; }
.lo-build-switch > svg:first-child { color: var(--hsu-accent); }
.hss-shell .hss-loadout-page .lo-save-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; background: transparent; color: var(--hsu-text-muted); font-size: var(--hsu-text-xs); font-weight: 600; white-space: nowrap; }
.lo-save-state > svg { font-size: 1rem; }
.lo-save-state.saved > svg { color: var(--hsu-ok); }
.lo-save-state.dirty { color: var(--hsu-warn); }
.lo-save-state.dirty > svg { font-size: .55rem; }
.lo-save-state.saving > svg, .lo-save-state.pending > svg { animation: lo-spin 1.2s linear infinite; }
.hss-shell .hss-loadout-page button.lo-save-state.failed { color: var(--hsu-danger); text-decoration: underline; text-underline-offset: 3px; }
.lo-history { display: inline-flex; gap: 2px; }
.hss-shell .hss-loadout-page .lo-history .mud-icon-button { width: 34px !important; height: 34px !important; border-radius: var(--hsu-radius-sm) !important; }

/* First save: name and visibility inline below the head, Enter saves, Esc closes. */
.lo-save-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 0 0 12px; padding: 12px 16px; border: 1px solid var(--hsu-accent-line); border-radius: var(--hsu-radius); background: var(--hsu-accent-soft); animation: lo-rise .18s ease-out; }
.lo-save-prompt-copy { display: flex; flex-direction: column; gap: 2px; }
.lo-save-prompt-copy strong { color: var(--hsu-text-strong); }
.lo-save-prompt-copy small { color: var(--hsu-text-muted); font-size: var(--hsu-text-xs); }
.hss-shell .hss-loadout-page .lo-save-prompt .lo-save-prompt-name { flex: 1 1 220px; max-width: 360px; margin: 0; }
.lo-save-prompt-actions { display: flex; gap: 6px; margin-left: auto; }
.hss-shell .hss-loadout-page > .hsu-alert { flex: 0 0 auto; margin: 0 0 10px; }

/* Studio: values bar on top, the active view fills the rest; the energy panel docks or slides over. */
.hss-shell .hss-loadout-page .hss-loadout-studio { position: relative; display: grid; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
.lo-bar { grid-column: 1 / -1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin: 0 0 14px; border-bottom: 1px solid var(--hsu-line); }
.hss-shell .hss-loadout-page .lo-bar .hsu-tabs { position: static; flex: 0 0 auto; margin: 0; border: 0; background: transparent; }
.lo-impact { display: flex; flex: 1 1 420px; align-items: center; justify-content: flex-end; gap: 6px 28px; margin: 0; padding: 6px 0; }
.lo-kpi { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lo-kpi dt { display: flex; align-items: center; gap: 5px; color: var(--hsu-text-faint); font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.lo-kpi dt svg { font-size: .95rem; }
.lo-kpi dd { position: relative; display: flex; align-items: baseline; gap: 8px; margin: 0; }
.lo-kpi dd strong { color: var(--hsu-text-strong); font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lo-kpi dd small { color: var(--hsu-text-faint); font-size: .7rem; white-space: nowrap; }
.lo-kpi.changed.improved dd small { color: #97c9b0; }
.lo-kpi.changed.degraded dd small { color: #e6a48c; }
.lo-kpi.offline dd strong { color: var(--hsu-text-muted); }
.lo-kpi-flash { padding: 0 6px; border-radius: 4px; background: var(--hsu-bg); font-size: .72rem; font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; animation: lo-flash 6s ease forwards; }
.lo-kpi-flash.improved { color: #a9dcc1; box-shadow: 0 0 0 1px rgba(151, 201, 176, .35); }
.lo-kpi-flash.degraded { color: #f0b39c; box-shadow: 0 0 0 1px rgba(230, 164, 140, .35); }
.hss-shell .hss-loadout-page .lo-energy-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px; border: 1px solid var(--hsu-line-strong); border-radius: var(--hsu-radius-sm); background: transparent; color: var(--hsu-text); text-align: left; }
.lo-energy-chip > span { display: flex; flex-direction: column; line-height: 1.2; }
.lo-energy-chip strong { font-size: var(--hsu-text-sm); }
.lo-energy-chip small { color: var(--hsu-text-muted); font-size: .7rem; white-space: nowrap; }
.lo-energy-chip > svg:first-child { color: var(--hsu-accent); }
.hss-shell .hss-loadout-page .lo-energy-chip.warning { border-color: rgba(231, 177, 93, .55); }
.lo-energy-chip.warning small, .lo-energy-chip.warning > svg:first-child { color: var(--hsu-warn); }
.hss-shell .hss-loadout-page .lo-energy-chip[aria-expanded="true"] { border-color: var(--hsu-accent-line); background: var(--hsu-accent-soft); }

/* Equipment list (left) and slot editor (right). */
.lo-fit { position: relative; grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); min-height: 0; }
.lo-slots { display: flex; flex-direction: column; min-height: 0; padding-right: 14px; border-right: 1px solid var(--hsu-line); }
.lo-system-filter { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; }
.lo-system-filter .hsu-chip { white-space: nowrap; }
.lo-system-filter .hsu-chip small { color: var(--hsu-text-faint); font-size: .68rem; }
.lo-revealing { padding: 0 0 8px; color: var(--hsu-text-faint); font-size: var(--hsu-text-xs); }
.lo-slots-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding-bottom: 12px; scrollbar-width: thin; }
.lo-group + .lo-group { margin-top: 6px; }
.lo-group-head { position: sticky; top: 0; z-index: 1; margin: 0; background: var(--hsu-bg); }
.hss-shell .hss-loadout-page .lo-group-head button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 4px 8px; border: 0; border-bottom: 1px solid var(--hsu-line); background: transparent; color: var(--hsu-text-strong); text-align: left; }
.hss-shell .hss-loadout-page .lo-group-head button:disabled { opacity: 1; cursor: default; }
.lo-group-head button > svg:first-child { color: var(--hsu-accent); }
.lo-group-head span { font-size: var(--hsu-text-sm); font-weight: 700; }
.lo-group-head small { margin-left: auto; color: var(--hsu-text-faint); font-size: .7rem; font-weight: 500; }
.lo-chevron { color: var(--hsu-text-faint); transition: transform .15s ease; }
[aria-expanded="false"] > .lo-chevron { transform: rotate(-90deg); }
.lo-slot-list { display: flex; flex-direction: column; padding: 4px 0; }
.lo-slot-line { display: flex; align-items: stretch; min-width: 0; }
.lo-slot-line.nested { padding-left: calc(14px + var(--lo-depth, 0) * 10px); }
.lo-slot-line > .lo-slot { flex: 1 1 auto; }
.hss-shell .hss-loadout-page .lo-slot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 6px 8px; border: 0; border-radius: var(--hsu-radius-sm) !important; background: transparent; color: var(--hsu-text); text-align: left; transition: background-color .12s ease; }
.hss-shell .hss-loadout-page .lo-slot.nested { min-height: 44px; border-left: 1px solid var(--hsu-line); border-radius: 0 var(--hsu-radius-sm) var(--hsu-radius-sm) 0 !important; }
.lo-slot-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lo-slot-copy small { overflow: hidden; color: var(--hsu-text-faint); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.lo-slot-copy strong { overflow: hidden; color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.hss-shell .hss-loadout-page .lo-slot:not(:disabled):hover { background: var(--hsu-surface-hover); }
.hss-shell .hss-loadout-page .lo-slot.selected { background: var(--hsu-accent-soft); box-shadow: inset 2px 0 var(--hsu-accent); }
.hss-shell .hss-loadout-page .lo-slot.selected .lo-slot-copy strong { color: var(--hsu-accent-strong); }
.hss-shell .hss-loadout-page .lo-slot.locked .lo-slot-copy strong { color: var(--hsu-text-muted); font-weight: 500; }
.lo-mark { flex: 0 0 auto; }
.lo-mark.changed { width: 8px; height: 8px; border-radius: 50%; background: var(--hsu-accent); box-shadow: 0 0 0 3px var(--hsu-accent-soft); }
.lo-mark.locked { color: var(--hsu-text-faint); font-size: .9rem !important; }
.lo-assembly { padding: 2px 0 4px; }
.lo-assembly-head { display: flex; align-items: center; }
.hss-shell .hss-loadout-page .lo-assembly-title { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; min-height: 42px; padding: 6px 8px; border: 0; border-radius: var(--hsu-radius-sm) !important; background: transparent; color: var(--hsu-text); text-align: left; }
.lo-assembly-title > svg:first-child { color: var(--hsu-text-faint); }
.lo-assembly-title > span { display: flex; flex-direction: column; min-width: 0; }
.lo-assembly-title small { overflow: hidden; color: var(--hsu-text-faint); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.lo-assembly-title strong { overflow: hidden; color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); text-overflow: ellipsis; white-space: nowrap; }
.lo-assembly-title .lo-chevron { margin-left: auto; }
.hss-shell .hss-loadout-page .lo-assembly-title:not(:disabled):hover { background: var(--hsu-surface-hover); }
.hss-shell .hss-loadout-page .lo-icon-btn { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 34px; border: 0; border-radius: var(--hsu-radius-sm) !important; background: transparent; color: var(--hsu-text-faint); }
.hss-shell .hss-loadout-page .lo-icon-btn:not(:disabled):hover { background: var(--hsu-surface-hover); color: var(--hsu-accent-strong); }
.hss-shell .hss-loadout-page .lo-icon-btn.selected { color: var(--hsu-accent-strong); background: var(--hsu-accent-soft); }
.lo-fixed-list { display: flex; flex-direction: column; margin: 0; padding: 4px 0; list-style: none; }
.lo-fixed-list > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px; }
.lo-slots-foot { padding: 8px 0 12px; border-top: 1px solid var(--hsu-line); }
.hss-shell .hss-loadout-page .lo-slots-foot .hsu-link-button { color: var(--hsu-text-muted); font-weight: 500; }

.lo-editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-left: 24px; }
.lo-editor-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 20px; padding-bottom: 12px; }
.hss-shell .hss-loadout-page .lo-back { display: none; align-items: center; justify-content: flex-start; gap: 6px; flex-basis: 100%; padding: 4px 0; border: 0; background: transparent; color: var(--hsu-text-muted); font-size: var(--hsu-text-sm); font-weight: 600; }
.lo-editor-title { display: flex; flex: 1 1 240px; flex-direction: column; gap: 2px; min-width: 0; }
.lo-editor-title small { color: var(--hsu-accent); font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.lo-editor-title h2 { margin: 0; color: var(--hsu-text-strong); font-size: 1.3rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.lo-installed { display: flex; flex: 0 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 6px 12px; border-left: 2px solid #8ca995; background: rgba(255, 255, 255, .02); }
.lo-installed > svg { color: #98b9a3; }
.lo-installed > span { display: flex; flex-direction: column; min-width: 0; }
.lo-installed small { color: var(--hsu-text-faint); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; }
.lo-installed strong { display: flex; align-items: center; gap: 8px; color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); }
.lo-installed-metric { display: flex; flex-direction: column; align-items: flex-end; color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lo-installed-metric small { color: var(--hsu-text-faint); font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lo-candidate-head { display: flex; justify-content: space-between; gap: 10px; padding: 4px 10px 6px 8px; color: var(--hsu-text-faint); font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lo-editor-body { display: grid; flex: 1 1 auto; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: 24px; min-height: 0; }
.lo-editor-body[data-editable="false"] { grid-template-columns: minmax(0, 1fr); }
.lo-candidates { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.lo-candidate-tools { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.hss-shell .hss-loadout-page .lo-candidate-tools .mud-input-control { margin: 0; }
.lo-candidate-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--hsu-text-faint); font-size: var(--hsu-text-xs); }
.lo-candidate-meta > span:first-child { margin-right: auto; }
.lo-sort { display: inline-flex; align-items: center; gap: 6px; }
.lo-sort > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hss-shell .hss-loadout-page .lo-sort select { padding: 4px 6px; border: 1px solid var(--hsu-line); border-radius: 4px; background: var(--hsu-surface); color: var(--hsu-text); font: inherit; font-size: var(--hsu-text-xs); }
.hss-shell .hss-loadout-page .lo-filter-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--hsu-line); border-radius: 4px !important; background: transparent; color: var(--hsu-text-muted); font-size: var(--hsu-text-xs); font-weight: 600; }
.hss-shell .hss-loadout-page .lo-filter-toggle.active, .hss-shell .hss-loadout-page .lo-filter-toggle[aria-expanded="true"] { border-color: var(--hsu-accent-line); color: var(--hsu-accent-strong); }
.lo-candidate-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 0 4px; animation: lo-rise .15s ease-out; }
.hss-shell .hss-loadout-page .lo-candidate-filters .mud-input-control { margin: 0; }
.lo-search-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--hsu-text-muted); font-size: var(--hsu-text-xs); }
.lo-progress { flex: 0 0 auto; }
.lo-candidate-list { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 120px; overflow: auto; overscroll-behavior: contain; border-top: 1px solid var(--hsu-line); scrollbar-width: thin; }
.hss-shell .hss-loadout-page .lo-candidate { display: grid; flex: 0 0 auto; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "size copy key" ". tag tag"; align-items: center; gap: 2px 10px; padding: 10px 10px 10px 8px; border: 0; border-bottom: 1px solid var(--hsu-line); border-radius: 0 !important; background: transparent; color: var(--hsu-text); text-align: left; transition: background-color .12s ease; }
.lo-candidate > .lo-size { grid-area: size; }
.lo-candidate-copy { grid-area: copy; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lo-candidate-copy strong { color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); font-weight: 600; overflow-wrap: anywhere; }
.lo-candidate-copy small { overflow: hidden; color: var(--hsu-text-faint); font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.lo-candidate-key { grid-area: key; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-variant-numeric: tabular-nums; }
.lo-candidate-key strong { color: var(--hsu-text); font-size: var(--hsu-text-xs); font-weight: 600; white-space: nowrap; }
.lo-candidate-key small { color: var(--hsu-text-faint); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.lo-candidate-key.improved small { color: #97c9b0; }
.lo-candidate-key.degraded small { color: #e6a48c; }
.lo-tag { grid-area: tag; justify-self: start; }
.hss-shell .hss-loadout-page .lo-candidate:not(:disabled):hover { background: var(--hsu-surface-hover); }
.hss-shell .hss-loadout-page .lo-candidate.installed { box-shadow: inset 2px 0 #8ca995; }
.hss-shell .hss-loadout-page .lo-candidate.preview { background: var(--hsu-accent-soft); box-shadow: inset 2px 0 var(--hsu-accent); }
.hss-shell .hss-loadout-page .lo-candidate.requested { box-shadow: inset 2px 0 var(--hsu-accent-line); }
.hss-shell .hss-loadout-page .lo-more { align-self: center; margin: 10px 0; }

.lo-compare { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 0 8px 24px 0; scrollbar-width: thin; }
.lo-compare-section { display: flex; flex-direction: column; gap: 16px; }
.lo-compare-section.loading { opacity: .85; }
.lo-compare-section > .hsu-link-button { align-self: flex-start; margin: 0; }
.lo-compare-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.lo-compare-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lo-compare-head small { color: var(--hsu-text-faint); font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.lo-compare-head h3 { margin: 0; color: var(--hsu-text-strong); font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.lo-commit { position: sticky; top: 0; z-index: 2; padding: 0 0 12px; border-bottom: 1px solid var(--hsu-line); background: var(--hsu-bg); }
.lo-commit small { color: var(--hsu-accent); }
.lo-commit-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.lo-highlights dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px 28px; margin: 0; }
.lo-highlights dl > div { display: flex; flex-direction: column; gap: 3px; }
.lo-highlights dt { color: var(--hsu-text-muted); font-size: var(--hsu-text-xs); }
.lo-highlights dd { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.lo-highlights dd strong { font-size: 1.55rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.lo-highlights dd small { color: var(--hsu-text-faint); font-size: .74rem; font-variant-numeric: tabular-nums; }
.lo-highlights > div:not(.improved):not(.degraded) dd strong { color: var(--hsu-text-strong); }
.lo-switches { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; color: var(--hsu-text-muted); font-size: var(--hsu-text-xs); }
.lo-switches em { margin-right: 6px; color: var(--hsu-text-faint); font-style: normal; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.lo-guide { display: flex; align-items: flex-start; gap: 10px; margin: 24px 0 0; padding: 14px 0 0; border-top: 1px solid var(--hsu-line); color: var(--hsu-text-muted); font-size: var(--hsu-text-sm); line-height: 1.6; }
.lo-guide > svg { margin-top: 3px; color: var(--hsu-accent); }
.lo-guide strong { color: var(--hsu-text-strong); }
.lo-values { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 24px; margin: 0; }
.lo-values dt { color: var(--hsu-text-faint); font-size: var(--hsu-text-xs); }
.lo-values dd { margin: 3px 0 0; color: var(--hsu-text-strong); font-size: var(--hsu-text-md); font-variant-numeric: tabular-nums; }
.lo-more-values { border-top: 1px solid var(--hsu-line); }
.lo-more-values > summary { padding: 12px 0; color: var(--hsu-text-muted); font-size: var(--hsu-text-sm); font-weight: 600; cursor: pointer; }
.lo-more-values > summary:hover { color: var(--hsu-text-strong); }
/* Base from .hsu-table; the inspector keeps its compact, right-aligned columns. */
.lo-table { table-layout: fixed; }
.hss-shell .hss-loadout-page .lo-table :is(th, td) { padding: 9px 8px; border: 0; border-bottom: 1px solid var(--hsu-line); background: transparent; font-size: var(--hsu-text-xs); text-align: right; overflow-wrap: anywhere; }
.hss-shell .hss-loadout-page .lo-table th:first-child { width: 34%; padding-left: 0; text-align: left; }
.hss-shell .hss-loadout-page .lo-table thead th { white-space: normal; }
.hss-shell .hss-loadout-page .lo-table tbody th { color: var(--hsu-text); font-weight: 500; }
.hss-shell .hss-loadout-page .lo-table tbody th small { margin-top: 0; }

.lo-toast { position: absolute; left: 50%; bottom: 18px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border: 1px solid rgba(151, 201, 176, .35); border-radius: var(--hsu-radius); background: #12161a; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); transform: translateX(-50%); animation: lo-toast .22s ease-out; }
.lo-toast > svg { color: #97c9b0; }

/* Energy simulation: a band between the values bar and the work area. It never covers the editor;
   the work area gives up the band's height while it is open. */
.hss-shell .hss-loadout-page[data-energy="open"] .hss-loadout-studio { grid-template-rows: auto auto minmax(0, 1fr); }
.hss-shell .hss-loadout-page[data-energy="open"] :is(.lo-fit, .hss-fitting-performance, .lo-build) { grid-row: 3; }
.hss-shell .hss-loadout-page .hss-flight-dock { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(400px, 460px) minmax(200px, 240px) minmax(0, 1fr); grid-template-areas: "head head head" "power meters values"; align-items: start; gap: 6px 28px; min-height: 0; max-height: clamp(200px, 32vh, 270px); margin: 0 0 14px; padding: 0 4px 14px 0; overflow: auto; overscroll-behavior: contain; border: 0; border-bottom: 1px solid var(--hsu-line-strong); border-radius: 0; background: transparent; box-shadow: none; animation: lo-rise .18s ease-out; }
.hss-shell .hss-loadout-page .hss-flight-dock > .hss-fitting-readings { grid-area: head; }
.hss-shell .hss-loadout-page .hss-flight-dock > .hss-fitting-power-controls { grid-area: power; }
.hss-shell .hss-loadout-page .hss-flight-dock > .hss-flight-live { display: contents; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-loadout-analysis-rail { display: contents; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-console:not(.hss-fitting-power-controls) { grid-area: meters; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-dynamic-telemetry { grid-area: values; min-width: 0; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-telemetry-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); column-gap: 20px; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-fitting-readings > header { flex-direction: row; align-items: baseline; gap: 12px; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-fitting-readings > header strong { font-size: 1rem; }
/* In the band the presets and the reserve sit beside the towers, and long lists scroll in place. */
.hss-shell .hss-loadout-page .hss-flight-dock .hss-fitting-power-controls { grid-template-columns: minmax(0, 1fr) 118px; grid-template-areas: "title title" "towers readout" "towers presets"; align-items: start; column-gap: 16px; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-console-title { grid-area: title; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-towers { grid-area: towers; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-readout { grid-area: readout; flex-direction: column; align-items: flex-start; gap: 2px; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-presets { grid-area: presets; flex-direction: column; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-analysis-note { display: none; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-telemetry-list { max-height: 170px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hss-shell .hss-loadout-page .hss-fitting-readings { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hss-fitting-readings > header { display: flex; flex-direction: column; gap: 4px; }
.hss-fitting-readings > header strong { font-size: 1.1rem; font-weight: 600; }
.hss-shell .hss-loadout-page .hss-fitting-power-controls { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; height: auto; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-fitting-power-controls .hss-power-console-title { margin: 0; padding: 0; }
.hss-shell .hss-loadout-page .hss-fitting-power-controls .hss-power-towers { display: grid; grid-template-columns: repeat(var(--power-channel-count, 8), minmax(0, 1fr)); align-items: end; gap: 5px; padding: 0; margin: 0; border: 0; background: transparent; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-stack { height: calc(var(--power-stack-steps, 6) * 14px + 22px); width: min(32px, 94%); gap: 3px; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-segment { flex-basis: calc(var(--power-block-weight, 1) * 14px - 3px); min-height: 11px; border-radius: 2px !important; transform: none; background: #ffffff08; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-segment.active { background: #bb9452; border-color: #c49a55; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-master { height: auto; min-height: 38px; padding: 5px 0; gap: 3px; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-master > svg { display: none; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-master strong { font-size: .7rem; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-master small { font-size: .65rem; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-readout { display: flex; margin: 0; padding: 4px 0 8px; border: 0; background: transparent; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-readout small { font-size: .7rem; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-readout strong { font-size: 1rem; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-presets { display: flex; gap: 6px; margin: 0; }
.hss-shell .hss-loadout-page .hss-flight-dock .hss-power-presets button { flex: 0 0 auto; min-height: 30px; padding: 5px 6px; border-radius: 4px; font-size: .75rem; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-loadout-analysis-rail { height: auto; max-height: none; overflow: visible; margin: 0; padding: 0 8px 0 0; border: 0; background: transparent; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-power-console { padding: 0; border: 0; background: transparent; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-dynamic-telemetry { padding: 0; background: transparent; border: 0; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-telemetry-list > article { padding: 8px 0; background: transparent; border: 0; border-bottom: 1px solid #ffffff0c; border-radius: 0; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-telemetry-icon { border: 0; background: transparent; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-resource-meter { padding: 0 0 16px; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-resource-meter > small { font-size: .72rem; }
.hss-shell .hss-loadout-page .hss-flight-live .hss-power-meta > span { padding: 8px 0; border: 0; border-radius: 0; background: transparent; }
.hss-shell .hss-loadout-page .hss-analysis-note { font-size: .75rem; line-height: 1.6; }

/* Performance view. */
.hss-shell .hss-loadout-page .hss-fitting-performance { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 0; background: transparent; }
.hss-shell .hss-loadout-page .hss-fitting-performance-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 24px 0; }
.hss-shell .hss-loadout-page .hss-fitting-performance :is(.hss-loadout-analysis-rail, .hss-power-console, .hss-analysis-overview) { display: block; padding: 0; height: auto; overflow: visible; border: 0; background: transparent; box-shadow: none; }
.hss-shell .hss-loadout-page .hss-fitting-performance .hss-analysis-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; align-items: start; }
.hss-performance-section > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; list-style: none; cursor: pointer; font-size: 1rem; }
.hss-performance-section > summary::-webkit-details-marker { display: none; }
.hss-performance-section > summary > svg:last-child { margin-left: auto; }
.hss-performance-section { border-top: 1px solid var(--hsu-line-strong); }
.hss-performance-section .hss-analysis-card-icon { width: 28px; height: 28px; border: 0; background: transparent; box-shadow: none; }
.hss-performance-body { padding: 8px 0 20px; }
.hss-performance-body .hss-analysis-stat-list dd { white-space: normal; overflow-wrap: anywhere; }
.hss-fitting-performance[data-focus="damage"] .hss-performance-section.damage,
.hss-fitting-performance[data-focus="defense"] .hss-performance-section.defense,
.hss-fitting-performance[data-focus="flight"] .hss-performance-section.flight,
.hss-fitting-performance[data-focus="systems"] .hss-performance-section.systems,
.hss-fitting-performance[data-focus="sensors"] .hss-performance-section.sensors,
.hss-fitting-performance[data-focus="hull"] .hss-performance-section.hull { order: -1; }

/* Build management: this build, what changed, all builds of the ship. */
.lo-build { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr) minmax(260px, 340px); align-items: start; gap: 28px 40px; min-height: 0; overflow: auto; padding: 4px 8px 32px 0; }
.lo-build > section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lo-build > section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--hsu-line); }
.lo-build h2 { margin: 0; color: var(--hsu-text-strong); font-size: var(--hsu-text-lg); font-weight: 700; }
.lo-build h3 { margin: 16px 0 0; color: var(--hsu-text-strong); font-size: var(--hsu-text-md); font-weight: 700; }
.lo-build > section > header small { color: var(--hsu-text-faint); font-size: var(--hsu-text-xs); }
.hss-shell .hss-loadout-page .lo-build .mud-input-control { margin: 0; }
.lo-field { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; color: var(--hsu-text-muted); font-size: var(--hsu-text-sm); }
.lo-build-actions { display: flex; flex-wrap: wrap; gap: 4px 6px; padding-top: 4px; }
.lo-change-list, .lo-builds { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.hss-shell .hss-loadout-page .lo-change-list button { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--hsu-line); border-radius: 0 !important; background: transparent; color: var(--hsu-text); text-align: left; }
.lo-change-list button > span, .lo-builds button > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lo-change-list small, .lo-builds small { color: var(--hsu-text-faint); font-size: .72rem; }
.lo-change-list strong, .lo-builds strong { color: var(--hsu-text-strong); font-size: var(--hsu-text-sm); font-weight: 600; }
.hss-shell .hss-loadout-page .lo-change-list button:hover { background: var(--hsu-surface-hover); }
.lo-builds > li { display: flex; align-items: center; border-bottom: 1px solid var(--hsu-line); }
.hss-shell .hss-loadout-page .lo-builds button { display: flex; flex: 1 1 auto; align-items: center; gap: 10px; min-width: 0; padding: 10px 6px; border: 0; border-radius: 0 !important; background: transparent; color: var(--hsu-text); text-align: left; }
.hss-shell .hss-loadout-page .lo-builds button:disabled { opacity: 1; }
.lo-builds button > svg { color: var(--hsu-text-faint); }
.lo-builds li.current button > svg { color: var(--hsu-accent); }
.lo-builds em { margin-left: auto; color: var(--hsu-accent); font-size: .68rem; font-style: normal; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.hss-shell .hss-loadout-page .lo-builds button:not(:disabled):hover { background: var(--hsu-surface-hover); }

/* Start without ship. */
.hss-shell .hss-loadout-page .lo-start { margin: 8px 0 24px; }
.lo-recent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.lo-recent-label { margin-right: 4px; color: var(--hsu-text-faint); font-size: var(--hsu-text-xs); font-weight: 600; }

.hss-loadout-delete-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; padding: 12px 0; border-block: 1px solid rgba(var(--error-rgb), .3); }
.hss-loadout-delete-confirm > span { flex: 1 1 260px; }
.hss-loadout-delete-confirm strong, .hss-loadout-delete-confirm small { display: block; }
.hss-loadout-delete-confirm small { color: var(--mud-palette-text-secondary); }
.hss-loadout-delete-confirm .hss-loadout-delete-error { flex-basis: 100%; margin: 0; }

@keyframes lo-rise { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes lo-toast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes lo-slide { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes lo-spin { to { transform: rotate(360deg); } }
@keyframes lo-flash { 0% { opacity: 0; transform: translateY(3px); } 6%, 85% { opacity: 1; transform: none; } 100% { opacity: .9; } }

/* Respond to the app window, independently of the monitor. */
@container hss-loadout (max-width: 1180px) {
    .lo-impact { flex-basis: 100%; justify-content: flex-start; order: 3; padding-top: 0; }
    .lo-bar { gap: 4px 20px; padding-bottom: 6px; }
    .lo-fit { grid-template-columns: minmax(230px, 280px) minmax(0, 1fr); }
    .lo-editor { padding-left: 18px; }
    .lo-editor-body { grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 18px; }
    .lo-build { grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); }
    .lo-build-list { grid-column: 1 / -1; }
}
/* Below this width the list and the editor take turns. */
@container hss-loadout (max-width: 980px) {
    .lo-fit { grid-template-columns: minmax(0, 1fr); }
    .lo-fit[data-editor="closed"] .lo-editor, .lo-fit[data-editor="open"] .lo-slots { display: none; }
    .lo-slots { padding-right: 0; border-right: 0; }
    .lo-editor { padding-left: 0; }
    .hss-shell .hss-loadout-page .lo-back { display: inline-flex; }
}
@container hss-loadout (max-width: 760px) {
    .hss-shell .hss-loadout-page .hss-flight-dock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head head" "power meters" "values values"; max-height: 42vh; }
    /* One scrolling column: alternatives first, the comparison below with a sticky install bar. */
    .lo-editor { overflow: auto; overscroll-behavior: contain; }
    .lo-editor-body { display: flex; flex: 0 0 auto; flex-direction: column; gap: 18px; }
    .lo-candidates { flex: 0 0 auto; }
    .lo-candidate-list { flex: 0 0 auto; max-height: min(360px, 45vh); }
    .lo-compare { overflow: visible; padding-right: 0; }
    .lo-installed { flex-basis: 100%; }
    .lo-impact { gap: 6px 18px; }
    .lo-kpi dd small { display: none; }
    .lo-build { grid-template-columns: minmax(0, 1fr); }
    .lo-candidate-filters { grid-template-columns: minmax(0, 1fr); }
    .hss-shell .hss-loadout-page .hss-fitting-performance .hss-analysis-card-grid { grid-template-columns: minmax(0, 1fr); }
    .lo-save-prompt-actions { margin-left: 0; }
}
@container hss-loadout (max-width: 520px) {
    .lo-history { display: none; }
    .lo-build-switch { max-width: 180px; }
}
/* Short windows: give the height to the editor. */
@container hss-main (max-height: 760px) {
    .hss-shell .hss-loadout-page .lo-head .hsu-page-title > p { display: none; }
    .lo-bar { margin-bottom: 8px; }
    .lo-editor-head { padding-bottom: 8px; }
    .lo-highlights dd strong { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    .hss-shell .hss-loadout-page *, .hss-shell .hss-loadout-page *::before, .hss-shell .hss-loadout-page *::after { animation: none !important; transition: none !important; }
}
