/* Loadout Builder — base layout, progress, footer */

/* lo-wrap kombiniert mit dz-main: dz-main bringt sidebar/topbar margin,
   lo-wrap fokussiert content. Kein zentriertes max-width — der dz-main
   Layout-Versatz bleibt erhalten. */
.lo-wrap {
  padding: 16px 24px 100px;
  color: #c9d1d9;
}

/* Alpha-Banner */
.lo-alpha-banner {
  display: flex; align-items: center; gap: 10px;
  background: rgba(226,35,69,0.08); border: 1px solid rgba(226,35,69,0.4);
  border-left-width: 4px;
  padding: 10px 14px; border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px; color: #c9d1d9; line-height: 1.4;
}
.lo-alpha-tag {
  background: #E22345; color: #fff; padding: 2px 8px; border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px; flex-shrink: 0;
}
.lo-alpha-banner a { color: #E22345; text-decoration: underline; }

/* Progress-Bar */
.lo-progress ol {
  display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px;
  flex-wrap: wrap;
}
.lo-progress li {
  flex: 1; min-width: 100px;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 6px;
  background: #0D1117; border: 1px solid rgba(255,255,255,0.06);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #6b7280;
}
.lo-progress li.active {
  background: rgba(226,35,69,0.1); border-color: #E22345; color: #fff;
}
.lo-progress li.done { color: #c9d1d9; }
.lo-progress li .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.05); font-weight: 700; font-size: 11px;
}
.lo-progress li.active .num { background: #E22345; color: #fff; }

/* Step-Container */
.lo-step { min-height: 50vh; }

/* Footer — respektiert Sidebar-Versatz damit Zurueck-Button sichtbar bleibt */
.lo-footer {
  position: fixed; bottom: 0; right: 0;
  left: var(--sidebar-width, 0);
  background: #0a0e14; border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 24px; display: flex; align-items: center; justify-content: space-between;
  z-index: 50;
}
.lo-footer-left { display: flex; gap: 8px; align-items: center; }
@media (max-width: 768px) {
  .lo-footer { left: 0; }
}
.lo-btn-primary, .lo-btn-ghost {
  padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 600;
  border: 1px solid transparent; transition: all 0.15s;
}
.lo-btn-primary { background: #E22345; color: #fff; }
.lo-btn-primary:hover { background: #ff2e54; }
.lo-btn-primary:disabled { background: #161b22; color: #6b7280; cursor: not-allowed; }
.lo-btn-ghost { background: transparent; color: #c9d1d9; border-color: rgba(255,255,255,0.1); }
.lo-btn-ghost:hover { background: rgba(255,255,255,0.05); }

.lo-chip {
  padding: 6px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.05); font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Item-Search-Modal */
.lo-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.lo-modal {
  width: 90%; max-width: 720px; max-height: 80vh; overflow: hidden;
  background: #0D1117; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; display: flex; flex-direction: column;
}
.lo-modal-head {
  display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lo-modal-search {
  flex: 1; background: #161b22; border: 1px solid rgba(255,255,255,0.06);
  padding: 8px 12px; border-radius: 4px; color: #c9d1d9; font-size: 14px;
}
.lo-modal-close {
  background: transparent; border: none; color: #c9d1d9; font-size: 20px; cursor: pointer;
  padding: 0 12px;
}
.lo-modal-title { padding: 8px 12px; color: #6b7280; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.lo-modal-grid {
  flex: 1; overflow-y: auto; padding: 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 8px;
}
.lo-modal-card {
  background: #161b22; border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px; padding: 10px; cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.lo-modal-card:hover { border-color: #E22345; background: rgba(226,35,69,0.08); }
.lo-modal-card img { width: 48px; height: 48px; object-fit: contain; display: block; margin: 0 auto 6px; }
.lo-modal-card-name { font-size: 11px; color: #c9d1d9; line-height: 1.2; word-break: break-word; }
.lo-modal-card-meta { font-size: 10px; color: #6b7280; margin-top: 4px; }
.lo-modal-loading, .lo-modal-empty { padding: 24px; text-align: center; color: #6b7280; grid-column: 1/-1; }

/* Action-Menu (Slot-Klick wenn gefuellt) */
.lo-action-menu {
  width: 90%; max-width: 380px;
  background: #0D1117; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 16px;
}
.lo-action-head { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.lo-action-title { font-size: 15px; color: #fff; font-weight: 600; }
.lo-action-sub { font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.lo-action-list { display: flex; flex-direction: column; gap: 6px; }
.lo-action-btn {
  background: #161b22; border: 1px solid rgba(255,255,255,0.06); color: #c9d1d9;
  padding: 12px 14px; border-radius: 6px; cursor: pointer; text-align: left;
  font-size: 13px; transition: all 0.15s;
}
.lo-action-btn:hover:not(.disabled) { border-color: #E22345; background: rgba(226,35,69,0.08); }
.lo-action-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.lo-action-hint { font-size: 10px; color: #6b7280; margin-top: 2px; }

/* Attachment-Sub-Modal */
.lo-attach-modal { max-width: 560px; }
.lo-attach-list {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.lo-attach-row {
  display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center;
}
.lo-attach-slot-label {
  font-size: 11px; text-transform: uppercase; color: #6b7280; letter-spacing: 0.5px;
}
.lo-attach-item {
  background: #161b22; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; padding: 8px 12px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #c9d1d9;
  transition: all 0.15s;
}
.lo-attach-item:hover { border-color: #E22345; }
.lo-attach-item.empty { color: #6b7280; font-style: italic; }
.lo-attach-item.filled { background: rgba(226,35,69,0.08); border-color: #E22345; }
.lo-attach-item img { width: 28px; height: 28px; object-fit: contain; }

/* Step 1 — Character (Multi-Select) */
.lo-char-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.lo-char-count {
  font-size: 12px; color: #6b7280; margin-right: 8px;
}
.lo-char-action {
  background: #161b22; border: 1px solid rgba(255,255,255,0.06); color: #c9d1d9;
  padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 11px;
  transition: all 0.15s;
}
.lo-char-action:hover { border-color: #E22345; color: #fff; }
.lo-char-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; margin-bottom: 24px;
}
.lo-char-card {
  background: #0D1117; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; padding: 6px; cursor: pointer; text-align: center;
  transition: all 0.15s; position: relative;
  filter: grayscale(70%) opacity(0.5);
}
.lo-char-card:hover { border-color: rgba(226,35,69,0.5); filter: grayscale(30%) opacity(0.85); }
.lo-char-card.active {
  border-color: #E22345; background: rgba(226,35,69,0.1);
  filter: none;
}
.lo-char-card img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  display: block; border-radius: 4px; margin-bottom: 4px;
}
.lo-char-name {
  font-size: 11px; color: #c9d1d9; font-weight: 500;
}
.lo-char-gender {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1;
}

/* Step 1 — Vibe */
.lo-sub { color: #6b7280; margin-bottom: 16px; }
.lo-vibe-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.lo-vibe-card {
  background: #0D1117; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 20px; text-align: center; cursor: pointer;
  transition: all 0.15s;
}
.lo-vibe-card:hover { border-color: rgba(226,35,69,0.5); }
.lo-vibe-card.active { border-color: #E22345; background: rgba(226,35,69,0.1); }
.lo-vibe-card svg, .lo-vibe-card i { width: 36px; height: 36px; color: #E22345; }
.lo-vibe-label { font-size: 16px; font-weight: 600; margin-top: 12px; color: #fff; }
.lo-vibe-desc { font-size: 12px; color: #6b7280; margin-top: 4px; line-height: 1.4; }
.lo-vibe-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  color: #c9d1d9; font-size: 13px;
}

/* Step 2 — Silhouette */
.lo-silhouette {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  grid-template-rows: repeat(7, auto);
  grid-template-areas:
    "eyewear  .          head"
    "vest     body       mask"
    "belt     body       top"
    "gloves   body       pants"
    "armband  body       footwear"
    ".        .          backpack"
    "sl       hands      sr";
  gap: 8px; margin-bottom: 16px;
}
.lo-slot {
  background: #0D1117; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px; padding: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 80px; transition: all 0.15s;
}
.lo-slot:hover { border-color: #E22345; }
.lo-slot.filled { background: rgba(226,35,69,0.08); border-color: #E22345; }
.lo-slot-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; }
.lo-slot-empty { font-size: 24px; color: #6b7280; opacity: 0.4; font-weight: 300; line-height: 1; }
.lo-slot-icon { width: 40px; height: 40px; object-fit: contain; display: block; }
.lo-slot-item { font-size: 10px; color: #c9d1d9; word-break: break-word; text-align: center; line-height: 1.2; }
.lo-slot-att-badge {
  position: absolute; top: 4px; right: 4px;
  background: #E22345; color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px;
  pointer-events: none;
}
.lo-slot { position: relative; }
.lo-body {
  background: #161b22; border-radius: 6px; display: flex;
  align-items: center; justify-content: center;
  opacity: 0.35; min-height: 100%; min-width: 60px;
}
.lo-body svg, .lo-body i { width: 48px; height: 48px; color: #6b7280; }

@media (max-width: 720px) {
  .lo-silhouette { grid-template-columns: 1fr 1fr; grid-template-areas: none; }
  .lo-silhouette > * { grid-area: unset !important; }
  .lo-body { display: none; }
}

/* Step 3 — Cargo */
.lo-cargo-block {
  background: #0D1117; border-radius: 8px; padding: 12px; margin-bottom: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.lo-cargo-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #c9d1d9; margin-bottom: 10px;
}
.lo-cargo-counter { color: #6b7280; }
.lo-cargo-grid {
  display: grid; gap: 2px; background: #0a0e14;
  border-radius: 4px; padding: 4px; max-width: 100%;
}
.lo-cargo-cell {
  background: #161b22; border-radius: 2px; cursor: pointer;
  transition: background 0.1s;
}
.lo-cargo-cell:hover { background: rgba(226,35,69,0.2); }
.lo-cargo-item {
  background: rgba(226,35,69,0.25); border: 1px solid #E22345;
  border-radius: 3px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  font-size: 9px; color: #c9d1d9; padding: 2px;
  word-break: break-word; text-align: center;
}
.lo-cargo-item img { max-width: 80%; max-height: 80%; object-fit: contain; }
.lo-cargo-item:hover { background: rgba(226,35,69,0.5); }
.lo-cargo-item:active { cursor: grabbing; }
.lo-cargo-item-dragging { opacity: 0.4; }

/* X-Button zum Entfernen (oben rechts, sichtbar on hover) */
.lo-cargo-x {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #161b22; color: #fff; border: 1px solid #E22345;
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
  z-index: 2;
}
.lo-cargo-item:hover .lo-cargo-x { opacity: 1; }
.lo-cargo-x:hover { background: #E22345; }

/* "..." Menu-Button (oben links, on hover) */
.lo-cargo-menu {
  position: absolute; top: -6px; left: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #161b22; color: #c9d1d9; border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
  z-index: 2;
}
.lo-cargo-item:hover .lo-cargo-menu { opacity: 1; }
.lo-cargo-menu:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* Attachment-Badge auf Cargo-Item (unten links) */
.lo-cargo-att-badge {
  position: absolute; bottom: 2px; left: 2px;
  background: rgba(226,35,69,0.9); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 4px; border-radius: 6px;
  pointer-events: none; z-index: 1;
}

/* Step 3 — Sidebar */
/* Main-Spalte mit minmax(0,...) damit sie schrumpfen darf, Sidebar bekommt mehr
   Breite (360px). Cargo-Blocks selbst sind via max-width gedeckelt damit sie
   bei breiten Screens nicht riesig werden. */
.lo-cargo-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px;
  align-items: start;
}
#lo-cargo-container > .lo-cargo-block { max-width: 560px; }

/* Sidebar bleibt beim Scrollen sichtbar; Suche+Chips bleiben oben fix,
   nur die Item-Liste scrollt intern.
   var(--topbar-height, 64px) entspricht dem fixen Topbar-Offset aus
   design-system.css; -100px Luft fuer den fixen Footer. */
.lo-cargo-sidebar {
  background: #0D1117; border-radius: 8px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: calc(var(--topbar-height, 64px) + 16px);
  max-height: calc(100vh - var(--topbar-height, 64px) - 100px);
  display: flex; flex-direction: column;
  min-height: 0;
}
.lo-cargo-sidebar .lo-cargo-list {
  flex: 1; overflow-y: auto; min-height: 0;
}
.lo-cargo-search {
  width: 100%; background: #161b22; border: 1px solid rgba(255,255,255,0.06);
  padding: 6px 10px; border-radius: 4px; color: #c9d1d9; font-size: 12px;
  margin-bottom: 8px;
}
.lo-cargo-list {
  display: flex; flex-direction: column; gap: 8px;
}
.lo-cargo-list-hint {
  font-size: 10px; color: #6b7280;
  padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 4px;
}
.lo-cargo-cat-header {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  color: #E22345; font-weight: 600;
  padding: 6px 4px 2px;
  border-top: 1px solid rgba(226,35,69,0.15);
}
.lo-cargo-cat-header:first-child { border-top: none; }
.lo-cargo-cat-items {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
}

/* Cargo-Filter-Chips (Kategorien) */
.lo-cat-chips {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-bottom: 10px;
  max-height: 80px; overflow-y: auto;
  flex-shrink: 0;
}
.lo-cargo-search { flex-shrink: 0; }
.lo-cat-chip {
  background: #161b22; border: 1px solid rgba(255,255,255,0.06); color: #c9d1d9;
  padding: 3px 8px; border-radius: 10px; cursor: pointer; font-size: 10px;
  white-space: nowrap; transition: all 0.15s;
}
.lo-cat-chip:hover { border-color: rgba(226,35,69,0.6); }
.lo-cat-chip.active { background: #E22345; border-color: #E22345; color: #fff; }
.lo-cargo-source {
  background: #161b22; border: 1px solid rgba(255,255,255,0.04);
  border-radius: 4px; padding: 6px 4px; cursor: grab;
  text-align: center; font-size: 9px; color: #c9d1d9; word-break: break-word;
  transition: all 0.15s;
}
.lo-cargo-source:hover { border-color: #E22345; }
.lo-cargo-source:active { cursor: grabbing; }
.lo-cargo-source img { width: 28px; height: 28px; object-fit: contain; display: block; margin: 0 auto 4px; }

@media (max-width: 720px) {
  .lo-cargo-layout { grid-template-columns: 1fr; }
}

/* Step 4 — Variants */
.lo-var-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px; background: #0D1117; border-radius: 6px; margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}
.lo-var-label {
  min-width: 120px; font-size: 11px; text-transform: uppercase; color: #6b7280;
  letter-spacing: 0.5px;
}
.lo-var-options { display: flex; gap: 8px; flex-wrap: wrap; }
.lo-var-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 12px;
  background: #161b22; border: 1px solid rgba(255,255,255,0.06); color: #c9d1d9;
}
.lo-var-opt.active { background: rgba(226,35,69,0.15); border-color: #E22345; color: #fff; }
.lo-var-opt input { margin: 0; }

/* Step 5 — Finish */
.lo-finish-card {
  background: #0D1117; border-radius: 8px; padding: 24px;
  border: 1px solid rgba(255,255,255,0.06); max-width: 640px;
}
.lo-finish-summary {
  display: flex; gap: 24px; margin-bottom: 16px; font-size: 13px; color: #c9d1d9;
}
.lo-fin-name {
  width: 100%; background: #161b22; border: 1px solid rgba(255,255,255,0.06);
  padding: 10px 14px; border-radius: 6px; color: #c9d1d9; font-size: 14px;
  margin-bottom: 12px;
}
.lo-fin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lo-fin-msg { margin-top: 12px; font-size: 12px; color: #c9d1d9; }

/* Step 5 — How-to-use Help-Block */
.lo-finish-howto {
  background: #0D1117; border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px; padding: 16px 20px;
  margin-top: 16px; max-width: 720px;
  color: #c9d1d9;
}
.lo-finish-howto > summary {
  cursor: pointer; font-size: 14px; font-weight: 600; color: #fff;
  list-style: none; padding: 4px 0;
  display: flex; align-items: center; gap: 8px;
}
.lo-finish-howto > summary::-webkit-details-marker { display: none; }
.lo-finish-howto > summary::before {
  content: '▸'; color: #E22345; font-size: 12px; transition: transform 0.15s;
  display: inline-block;
}
.lo-finish-howto[open] > summary::before { transform: rotate(90deg); }
.lo-finish-howto-body {
  font-size: 13px; line-height: 1.55;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.lo-finish-howto-body ol, .lo-finish-howto-body ul {
  padding-left: 22px; margin: 0 0 10px;
}
.lo-finish-howto-body ol li, .lo-finish-howto-body ul li {
  margin-bottom: 10px;
}
.lo-finish-howto-body h4 {
  margin: 18px 0 8px; font-size: 13px; color: #fff;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.lo-finish-howto-body code {
  background: #161b22; padding: 1px 6px; border-radius: 3px;
  font-size: 12px; color: #ffb86b; font-family: ui-monospace, Menlo, monospace;
}
.lo-finish-howto-body pre {
  background: #161b22; border: 1px solid rgba(255,255,255,0.04);
  padding: 10px 12px; border-radius: 4px;
  font-size: 12px; color: #c9d1d9; font-family: ui-monospace, Menlo, monospace;
  overflow-x: auto; margin: 8px 0;
  white-space: pre;
}
.lo-finish-howto-body pre code { background: none; padding: 0; color: inherit; }
.lo-finish-howto-body a { color: #E22345; text-decoration: underline; }
.lo-finish-howto-body a:hover { color: #ff2e54; }
.lo-finish-howto-body strong { color: #fff; }
.lo-finish-howto-body em { color: #c9d1d9; font-style: italic; }

/* Share-View */
.lo-share-table {
  width: 100%; border-collapse: collapse; margin-bottom: 16px;
}
.lo-share-table td {
  padding: 6px 12px; border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.lo-share-table td:first-child {
  text-transform: uppercase; color: #6b7280; font-size: 11px; width: 140px;
}
