/* SAGE Legend - Magic Items Build mode styles. Phase 4b (Rome 2026-05-15).
   Used when the Library/Build toggle is set to Build inside Mystic →
   Magic Items, Armor → Magic, and Weapons → Magic. Hosts the inline
   MysticariaEditor + base-item form + Stage Custom actions. */

.mib-root {
  display: flex; flex-direction: column; gap: 10px; padding: 8px 0;
}
.mib-summary {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px;
  background: rgba(180, 160, 240, 0.06);
  border: 1px dashed rgba(180, 160, 240, 0.30);
  border-radius: 4px;
}
.mib-summary-title {
  font-weight: 600;
  color: rgba(220, 210, 250, 0.95);
  font-size: 0.95rem;
}
.mib-summary-hint {
  color: rgba(200, 190, 170, 0.65);
  font-size: 0.78rem;
  line-height: 1.45;
}
.mib-summary-hint em {
  color: rgba(232, 200, 120, 0.85);
  font-style: normal;
  font-weight: 500;
}

/* Phase 4e — base-item dropdown picker (Armor / Weapons surfaces).
   Auto-fills name + stats from SAGE_GEAR; clones full profile at stage. */
.mib-base-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(180, 160, 240, 0.08);
  border: 1px solid rgba(180, 160, 240, 0.35);
  border-radius: 4px;
}
.mib-base-picker-label {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(220, 210, 250, 0.85);
  font-weight: 600;
}
.mib-base-picker select {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(180, 160, 240, 0.45);
  border-radius: 3px;
  color: rgba(232, 220, 200, 0.95);
  font-size: 0.9rem;
  padding: 6px 10px;
  font-family: inherit;
  color-scheme: dark;
}
.mib-base-picker select option,
.mib-base-picker select optgroup {
  background: #1a1a2e;
  color: rgba(232, 220, 200, 0.95);
}
.mib-base-picker select:focus {
  outline: none;
  border-color: rgba(200, 180, 255, 0.75);
}
.mib-base-picker-info {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  color: rgba(220, 210, 180, 0.80);
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.20);
  border-radius: 3px;
}

/* Base-item form — text + number inputs in a flex row. */
.mib-base-form {
  display: flex; flex-direction: column;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(180, 160, 240, 0.28);
  border-radius: 4px;
}
.mib-base-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: flex-end;
}
.mib-base-field {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 90px;
}
.mib-base-field.mib-base-name {
  flex: 1 1 220px;
  min-width: 220px;
}
.mib-base-field span {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(200, 190, 170, 0.65);
}
.mib-base-field input {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(180, 160, 240, 0.35);
  border-radius: 3px;
  color: rgba(232, 220, 200, 0.95);
  font-size: 0.85rem;
  padding: 4px 8px;
  font-family: inherit;
  color-scheme: dark;
}
.mib-base-field input:focus {
  outline: none;
  border-color: rgba(200, 180, 255, 0.65);
}

/* Editor mount target — the MysticariaEditor renders its own chrome
   inside. We just give it room to breathe. */
.mib-editor-mount {
  margin-top: 4px;
}

/* Actions footer — Reset / Stage / Gift, matching the Library palette. */
.mib-actions {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(180, 160, 240, 0.28);
  border-radius: 4px;
}
.mib-actions-spacer { flex: 1 1 auto; }
.mib-btn {
  padding: 5px 14px;
  background: rgba(180, 160, 240, 0.18);
  border: 1px solid rgba(180, 160, 240, 0.55);
  border-radius: 3px;
  color: rgba(232, 220, 250, 0.95);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.mib-btn:hover {
  background: rgba(180, 160, 240, 0.32);
  border-color: rgba(200, 180, 255, 0.85);
}
.mib-btn-reset {
  background: transparent;
  border-color: rgba(200, 190, 170, 0.35);
  color: rgba(200, 190, 170, 0.75);
}
.mib-btn-reset:hover {
  background: rgba(200, 190, 170, 0.10);
  border-color: rgba(200, 190, 170, 0.55);
  color: var(--cream, #e8dcc8);
}
.mib-btn-gift {
  background: transparent;
  border-color: rgba(212, 175, 55, 0.45);
  color: rgba(232, 200, 120, 0.90);
}
.mib-btn-gift:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(232, 200, 120, 0.75);
  color: #f0d888;
}

/* Library / Build sub-toggle pills (above the category-pill row in
   Mystic → Magic Items, and above the layer-pill row in Armor /
   Weapons → Magic). */
.gp-magic-mode {
  display: flex; gap: 4px; margin: 6px 0 4px 0;
}
.gp-magic-mode-pill {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(180, 160, 240, 0.30);
  border-radius: 4px 4px 0 0;
  color: rgba(200, 190, 170, 0.70);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: none;
  transition: all 0.15s ease;
}
.gp-magic-mode-pill:hover {
  background: rgba(180, 160, 240, 0.15);
  color: rgba(232, 220, 250, 0.95);
  border-color: rgba(200, 180, 255, 0.50);
}
.gp-magic-mode-pill.active {
  background: rgba(180, 160, 240, 0.24);
  color: rgba(232, 220, 250, 0.98);
  border-color: rgba(200, 180, 255, 0.70);
  box-shadow: inset 0 -1px 0 rgba(200, 180, 255, 0.20);
}
