:root:has(.loadout-bar) { scroll-padding-bottom: 105px; }
.loadout-class-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 14px;
}
.loadout-class-row .class-tabs {
  flex-wrap: wrap;
  overflow: visible;
}
.loadout-mode.detail-toggle {
  grid-column: 3;
  min-height: 36px;
  border-color: var(--line);
  background: #232427;
  color: var(--text);
}
.loadout-mode:hover, .loadout-mode:focus-visible { border-color: #8f9092; }
.loadout-mode.detail-toggle.loadout-mode-entry { border-color: var(--red); color: #ff8a90; }
.loadout-mode-entry:hover, .loadout-mode-entry:focus-visible { background: #381e21; }
.loadout-mode-icon { width: 16px; height: 16px; flex: none; fill: #232427; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#loadout-mode-help { margin: 0; color: #bfc0c2; font-size: 0.75rem; }
.loadout-mode-banner {
  position: sticky;
  top: 0;
  z-index: 6;
  border-bottom: 1px solid #974641;
  background: #431c1d;
  background-image: linear-gradient(#431c1de8, #431c1de8), var(--topography, none);
  background-size: cover;
  background-position: center;
}
.loadout-mode-banner-inner {
  max-width: 1450px;
  margin: auto;
  padding: 10px max(5vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.loadout-mode-banner-inner p { margin: 2px 0 0; color: #f0cbca; font-size: 0.75rem; }
.loadout-mode-banner-inner button { flex: none; min-height: 44px; }
.loadout-bar p,
.loadout-drawer-bar p {
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 3px 0 0;
}
.loadout-saved {
  color: var(--gain);
  border: 1px solid var(--gain);
  font-size: 0.6875rem;
  font-weight: 750;
  padding: 2px 6px;
  white-space: nowrap;
}
.loadout-bar,
.loadout-drawer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #242629;
}
.loadout-shared-detail-bar { flex-wrap: wrap; }
.loadout-shared-detail-bar > :first-child { min-width: 0; }
.loadout-bar {
  position: sticky;
  z-index: 5;
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid #55595f;
  box-shadow: 0 5px 25px #0008;
}
.loadout-bar strong span {
  color: var(--muted);
  font-size: 0.8125rem;
  margin-left: 4px;
}
.loadout-bar-actions { display: flex; align-items: center; gap: 12px; }
.loadout-drawer-bar {
  flex: none;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line);
}
.loadout-bar button,
.loadout-drawer-bar button {
  flex: none;
  min-height: 44px;
}
.loadout-modal { width: min(690px, calc(100% - 30px)); }
.loadout-modal .modal-head { margin-bottom: 12px; }
.loadout-modal .class-tabs,
.loadout-shared .class-tabs { margin-bottom: 14px; }
.loadout-review-status { color: var(--muted); margin: 0 0 12px; }
.loadout-slot-list {
  display: grid;
  gap: 1px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.loadout-slot-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #242629;
  min-height: 60px;
}
.loadout-slot-list li div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.loadout-slot-list li span,
.loadout-slot-list li strong,
.loadout-slot-list li small { display: block; }
.loadout-slot-list li span,
.loadout-slot-list li small { color: var(--muted); font-size: 0.75rem; }
.loadout-slot-list li strong { margin: 2px 0; }
.loadout-slot-list li.loadout-slot-clickable { padding: 0; }
.loadout-slot-open {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.loadout-slot-open:hover, .loadout-slot-open:focus-visible { border-color: var(--red); background: #381e21; }
.loadout-slot-open:focus-visible { outline-offset: -3px; }
.loadout-slot-list .loadout-slot-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.loadout-slot-content strong { color: var(--text); font-size: 0.875rem; }
.slot-options button.shared-attachment:disabled { opacity: .4; cursor: default; }
.slot-options button.shared-attachment.active:disabled { opacity: 1; }
.loadout-slot-list .loadout-unavailable strong,
.loadout-form-error { color: var(--amber); }
.loadout-slot-image {
  width: 72px;
  height: 44px;
  object-fit: contain;
}
.loadout-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.loadout-actions .button,
.loadout-slot-list button { min-height: 44px; }
.loadout-actions a.button { display: inline-flex; align-items: center; text-decoration: none; }
.loadout-review-actions { justify-content: flex-end; }
.loadout-clear-class { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 148px; }
.loadout-clear-icon { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.loadout-clear-class.is-confirming { background: var(--red); border-color: var(--red); color: var(--text); }
.loadout-share-classes {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  margin: 15px 0;
}
.loadout-share-classes label {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 10px;
  min-height: 36px;
  margin: 0;
}
.loadout-share-classes input { width: auto; }
.loadout-share-classes label:has(input:disabled) { color: var(--muted); }
.loadout-form-error:empty { display: none; }
.loadout-shared { max-width: 690px; }
.loadout-shared-hero > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1120px) {
  .loadout-class-row { grid-template-columns: minmax(0, 1fr) auto; }
  .loadout-mode.detail-toggle { grid-column: 2; grid-row: 1; }
  #loadout-mode-help { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 959px) {
  .loadout-drawer-bar { position: sticky; top: var(--loadout-drawer-head-height, 58px); z-index: 1; }
}
@media (max-width: 700px) {
  .loadout-mode-banner-inner { padding: 8px 16px; }
  .loadout-drawer-bar { padding: 10px 16px; }
  .loadout-bar { padding: 8px 12px; }
  .loadout-class-row { gap: 4px 8px; align-items: start; }
  .loadout-class-row .class-tabs button { gap: 4px; padding-inline: 6px; min-height: 40px; }
  .loadout-class-row .class-icon { width: 16px; height: 16px; }
  .loadout-mode.detail-toggle { min-height: 44px; }
  .loadout-bar-actions { flex-direction: column-reverse; align-items: flex-end; gap: 4px; }
  .loadout-modal { width: 100%; }
  .loadout-slot-image { width: 50px; }
  .loadout-slot-open { gap: 8px; }
  .loadout-slot-list li:has([data-loadout-action="clear-slot"]) { flex-wrap: wrap; }
  .loadout-slot-list li:has([data-loadout-action="clear-slot"]) .loadout-slot-content { flex-basis: 65%; }
}
@media (max-width: 365px) {
  .loadout-mode-banner-inner { flex-wrap: wrap; }
  .loadout-shared-detail-bar { align-items: flex-start; }
  .loadout-slot-open { flex-wrap: wrap; }
  .loadout-class-row .class-tabs { gap: 4px; }
  .loadout-class-row .class-tabs button { padding-inline: 4px; }
  .loadout-class-row .class-icon { display: none; }
  .loadout-mode.detail-toggle { padding-inline: 6px; }
}
