.bfh-sim-root { box-sizing: border-box; overflow-x: hidden; }
.bfh-sim-root *, .bfh-sim-root *:before, .bfh-sim-root *:after { box-sizing: inherit; }
.bfh-sim-shell { font-size: 14px; line-height: 1.5; min-width: 0; }
.bfh-toolbar, .bfh-tabs, .bfh-member-head, .bfh-party-header { display: flex; gap: 8px; align-items: center; }
 .bfh-toolbar, .bfh-tabs, .bfh-userbox, .bfh-message, .bfh-layout, .bfh-battle-actions { margin-bottom: 16px; }
.bfh-toolbar { flex-wrap: wrap; width: fit-content; max-width: 100%; }
.bfh-toolbar-group { display: flex; flex-wrap: wrap; gap: 8px; }
.bfh-inline-box { display: inline-block; width: fit-content; max-width: 100%; }
.bfh-userbox, .bfh-message, .bfh-battle-actions { width: fit-content; max-width: 100%; }
.bfh-message, .bfh-userbox { padding-right: 18px; }
.bfh-battle-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bfh-toolbar button, .bfh-tabs button, .bfh-member-head button, .bfh-link-button, .bfh-more-button, .bfh-swap-button, .bfh-clear-member, .bfh-copy-button {
  padding: 8px 12px; border: 1px solid #cfd4dc; background: #fff; border-radius: 8px; cursor: pointer;
}
.bfh-toolbar button.bfh-primary { font-weight: 700; }
.bfh-tabs button.active { border-color: #111; font-weight: 700; }
.bfh-fixed-layout { display: grid; grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1.58fr); gap: 10px; align-items: start; max-width: 100%; }
.bfh-layout.manual { display: grid; grid-template-columns: 1fr; }
.bfh-sidebar, .bfh-party, .bfh-userbox, .bfh-message, .bfh-member-card {
  border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 12px;
}
.bfh-message.success { border-color: #95d5b2; }
.bfh-message.error { border-color: #ef9a9a; }
.bfh-sticky-box { position: static; display: grid; gap: 10px; min-width: 0; }
.bfh-picker-banner { padding: 8px 10px; border-radius: 10px; background: #111; color: #fff; font-size: 12px; }
.bfh-asset-tools { display: grid; gap: 8px; margin-bottom: 8px; }
.bfh-asset-tools input, .bfh-field input, .bfh-field select {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 8px; background: #fff;
}
.bfh-asset-meta { color: #666; font-size: 12px; }
.bfh-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; max-height: 520px; overflow: auto; padding-right: 4px; }
.bfh-asset-card {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; min-height: 70px;
  border: 1px solid #dbe2ea; border-radius: 10px; background: #fff; cursor: pointer;
}
.bfh-card-info {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #cfd4dc; background: #fff; font-size: 10px; line-height: 1; padding: 0; display: inline-flex; align-items: center; justify-content: center; z-index: 5; pointer-events: auto;
}
.bfh-asset-card img, .bfh-modal-image, .bfh-order-token img { width: 40px; height: 40px; object-fit: contain; }
.bfh-broken-image { opacity: 0.35; }
.bfh-asset-card small { color: #666; font-size: 10px; }
.bfh-empty { color: #666; padding: 8px 0; }
.bfh-more-wrap { margin-top: 8px; text-align: center; }
.bfh-main { display: grid; gap: 12px; min-width: 0; justify-items: stretch; align-content: start; }
.bfh-main.full { grid-template-columns: 1fr; }
.bfh-field { display: grid; gap: 6px; margin-bottom: 10px; }
.bfh-field.compact { margin-bottom: 0; min-width: 160px; }
.bfh-filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bfh-chip { padding: 6px 10px; border: 1px solid #cfd4dc; background: #fff; border-radius: 999px; cursor: pointer; font-size: 12px; }
.bfh-chip.active { border-color: #111; font-weight: 700; }
.bfh-toggle-row { font-size: 12px; color: #444; }
.bfh-toggle-row label { display: inline-flex; align-items: center; gap: 6px; }
.bfh-asset-card.is-assigned { border-color: #111; box-shadow: inset 0 0 0 1px #111; }
.bfh-asset-card.is-pick-target { background: #f8fafc; }
.bfh-assigned-badge { display: inline-block; padding: 2px 6px; border-radius: 999px; background: #f1f5f9; color: #111; font-size: 10px; }


.bfh-sidebar, .bfh-main { min-width: 0; }
.bfh-fixed-layout > .bfh-sidebar, .bfh-fixed-layout > .bfh-main {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}
.bfh-fixed-layout > .bfh-main { padding-right: 6px; }
.compact-party { width: 100%; max-width: 100%; padding: 8px 10px; }
.compact-party .bfh-party-header { margin-bottom: 6px; }
.compact-party h3 { margin: 0; }
.compact-party .bfh-field.compact { min-width: 132px; }
.compact-party .bfh-party-header { justify-content: space-between; align-items: end; gap: 8px; }
.bfh-compact-grid { display: grid; grid-template-columns: 1fr; gap: 6px; justify-items: stretch; }
.bfh-compact-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 5px 6px; background: #fbfdff; min-width: 0; width: 100%; max-width: 100%; }
.bfh-compact-card.is-selected { border-color: #111827; box-shadow: inset 0 0 0 2px #111827; background: #eef6ff; }
.bfh-compact-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.bfh-compact-head strong { font-size: 12px; }
.bfh-clear-member { padding: 2px 6px; font-size: 10px; }
 .bfh-picker-stack { display: grid; gap: 8px; margin-top: 8px; }
.bfh-picker-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bfh-picker-item { display: grid; justify-items: center; gap: 4px; }
.bfh-picker-item label { font-size: 10px; color: #475569; }
.bfh-order-block { display: grid; gap: 6px; }
.bfh-order-row { display: grid; grid-template-columns: 42px 18px 42px 18px 42px; gap: 4px; align-items: center; justify-content: start; }
.bfh-order-token { position: relative; width: 42px; height: 42px; min-height: 42px; border: 1px solid #cfd4dc; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; }
.bfh-order-token.is-active { border-color: #0f172a; box-shadow: 0 0 0 2px #0f172a, 0 0 0 5px rgba(59,130,246,0.18); background: #eff6ff; }
.bfh-order-token img { width: 40px; height: 40px; object-fit: contain; }
.bfh-order-badge { position: absolute; top: 2px; left: 3px; font-size: 8px; line-height: 1; padding: 2px 3px; border-radius: 999px; background: rgba(15,23,42,0.9); color: #fff; }
.bfh-search-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.bfh-search-button { padding: 8px 10px; border: 1px solid #cfd4dc; background: #fff; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.bfh-card-badge { position: absolute; top: 4px; left: 4px; font-size: 9px; line-height: 1; padding: 2px 4px; border-radius: 999px; background: rgba(15,23,42,0.9); color: #fff; }
.bfh-slot-wrap { position: relative; }
.bfh-picker-slot {
  width: 52px; height: 52px; border: 1px solid #cfd4dc; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
}
.bfh-picker-slot.is-active { border-color: #111; box-shadow: inset 0 0 0 2px #111; }
.bfh-slot-plus { font-size: 18px; color: #94a3b8; line-height: 1; }
.bfh-slot-clear {
  position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #cfd4dc; background: #fff; cursor: pointer; font-size: 10px; line-height: 1;
}
.bfh-swap-button { padding: 0; min-width: 0; width: 18px; height: 18px; font-size: 9px; border: 1px solid #cfd4dc; background: #fff; border-radius: 6px; cursor: pointer; }

.bfh-member-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.bfh-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 99999;
}
.bfh-modal {
  position: relative; max-width: 420px; width: 100%; background: #fff; border-radius: 14px; padding: 20px; display: grid; gap: 8px;
}
.bfh-modal-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #cfd4dc; background: #fff; cursor: pointer;
}
.bfh-param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 6px 0; }
.bfh-param-grid div { padding: 4px 8px; border: 1px solid #edf2f7; border-radius: 8px; background: #f8fafc; font-size: 12px; }
.bfh-modal-scroll { max-height: min(80vh, 720px); overflow-y: auto; }
.bfh-detail-block { display: grid; gap: 6px; margin-top: 6px; }
.bfh-detail-subtitle { font-weight: 700; font-size: 12px; color: #334155; }
.bfh-detail-skill-title { font-size: 12px; color: #0f172a; }
.bfh-detail-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.bfh-detail-list li { font-size: 12px; line-height: 1.5; }
.bfh-detail-condition, .bfh-detail-fallback { font-size: 12px; line-height: 1.5; color: #334155; }


.bfh-tabs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.bfh-tabs-row > .bfh-tabs {
  margin-bottom: 0;
}
.bfh-stealth-tab {
  margin-left: 0;
  min-width: 40px;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: transparent !important;
  box-shadow: none !important;
  opacity: 0;
}
.bfh-stealth-tab:hover,
.bfh-stealth-tab:focus,
.bfh-stealth-tab.active {
  border-color: transparent !important;
  color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0;
}

@media (max-width: 1180px) { .bfh-fixed-layout { grid-template-columns: minmax(130px, 0.38fr) minmax(0, 1.62fr); } .bfh-party-header h3 { font-size: 18px; } .bfh-fixed-layout > .bfh-sidebar, .bfh-fixed-layout > .bfh-main { max-height: calc(100vh - 180px); } }

.bfh-copy-button{font-size:13px;}
.bfh-copy-button.bfh-primary{font-weight:700;}

.bfh-deck-grid { display: grid; gap: 10px; }
.bfh-deck-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 10px; }
.bfh-deck-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: start; margin-bottom: 8px; }
.bfh-deck-card-head strong { font-size: 14px; }
.bfh-deck-card-head small { display:block; color:#64748b; font-size:11px; }
.bfh-deck-actions { display:flex; gap:6px; flex-wrap: wrap; }
.bfh-deck-preview { display:grid; gap: 6px; }
.bfh-deck-member { display:flex; align-items:center; gap:8px; }
.bfh-deck-member.empty { opacity: 0.55; }
.bfh-deck-member-pos { width: 18px; font-size: 11px; color:#475569; text-align:center; }
.bfh-deck-order-row { display:grid; grid-template-columns: 42px 18px 42px 18px 42px; gap: 4px; align-items:center; }
.bfh-deck-token { position:relative; width:42px; height:42px; border:1px solid #cfd4dc; border-radius:10px; background:#fff; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.bfh-deck-token img { width:40px; height:40px; object-fit:contain; }
.bfh-deck-swap { display:inline-flex; align-items:center; justify-content:center; font-size:10px; color:#64748b; }


.bfh-detail-mini{font-size:12px;font-weight:600;margin:6px 0 4px;color:#555}.bfh-skill-section{margin-bottom:8px}.bfh-skill-empty,.bfh-skill-fallback{font-size:13px;color:#555}.bfh-modal-scroll{max-height:min(78vh,720px);overflow:auto;}


/* v036 visual refresh */
.bfh-sim-root {
  --bfh-bg: #f5f7fb;
  --bfh-surface: #ffffff;
  --bfh-surface-muted: #f8fafc;
  --bfh-border: #d8e1ec;
  --bfh-border-strong: #b9c6d8;
  --bfh-text: #152033;
  --bfh-text-muted: #607086;
  --bfh-accent: #2b5fff;
  --bfh-accent-soft: #e9f0ff;
  --bfh-success: #1f9d61;
  --bfh-success-soft: #ebfbf3;
  --bfh-danger: #d14343;
  --bfh-danger-soft: #fff0f0;
  --bfh-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --bfh-shadow-md: 0 10px 24px rgba(15, 23, 42, 0.08);
  color: var(--bfh-text);
}
.bfh-sim-shell {
  color: var(--bfh-text);
  max-width: 1320px;
  margin: 0 auto;
}
.bfh-sim-shell h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  color: var(--bfh-text);
}
.bfh-sim-shell h3 + .bfh-asset-tools,
.bfh-sim-shell h3 + .bfh-asset-grid {
  margin-top: 10px;
}
.bfh-toolbar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  padding: 14px;
  border: 1px solid var(--bfh-border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-toolbar-group {
  gap: 10px;
}
.bfh-toolbar-group:last-child {
  justify-content: flex-end;
}
.bfh-toolbar button,
.bfh-tabs button,
.bfh-member-head button,
.bfh-link-button,
.bfh-more-button,
.bfh-swap-button,
.bfh-clear-member,
.bfh-copy-button,
.bfh-search-button {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px solid var(--bfh-border);
  background: var(--bfh-surface);
  color: var(--bfh-text);
  font-weight: 600;
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .12s ease;
}
.bfh-toolbar button:hover,
.bfh-tabs button:hover,
.bfh-member-head button:hover,
.bfh-link-button:hover,
.bfh-more-button:hover,
.bfh-swap-button:hover,
.bfh-clear-member:hover,
.bfh-copy-button:hover,
.bfh-search-button:hover {
  border-color: var(--bfh-border-strong);
  background: #fdfefe;
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-toolbar button:active,
.bfh-tabs button:active,
.bfh-member-head button:active,
.bfh-link-button:active,
.bfh-more-button:active,
.bfh-swap-button:active,
.bfh-clear-member:active,
.bfh-copy-button:active,
.bfh-search-button:active {
  transform: translateY(1px);
}
.bfh-toolbar button.bfh-primary,
.bfh-copy-button.bfh-primary {
  background: var(--bfh-accent);
  border-color: var(--bfh-accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(43, 95, 255, 0.22);
}
.bfh-toolbar button.bfh-primary:hover,
.bfh-copy-button.bfh-primary:hover {
  background: #214fe0;
  border-color: #214fe0;
}
.bfh-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--bfh-border);
  border-radius: 16px;
  background: var(--bfh-surface-muted);
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-tabs button {
  min-height: 34px;
  padding: 8px 14px;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}
.bfh-tabs button.active {
  background: var(--bfh-surface);
  border-color: var(--bfh-border);
  color: var(--bfh-text);
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-userbox,
.bfh-message,
.bfh-battle-actions,
.bfh-sidebar,
.bfh-party,
.bfh-member-card {
  border-color: var(--bfh-border);
  border-radius: 18px;
  background: var(--bfh-surface);
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-userbox,
.bfh-message {
  padding: 12px 16px;
  font-size: 13px;
}
.bfh-userbox {
  color: var(--bfh-text-muted);
}
.bfh-message {
  color: var(--bfh-text);
}
.bfh-message.success {
  background: var(--bfh-success-soft);
  border-color: #b9e6cd;
  color: #11653f;
}
.bfh-message.error {
  background: var(--bfh-danger-soft);
  border-color: #f1b4b4;
  color: #9c2d2d;
}
.bfh-battle-actions {
  padding: 10px;
  gap: 10px;
}
.bfh-fixed-layout {
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}
.bfh-sidebar,
.bfh-party,
.bfh-member-card {
  padding: 14px;
}
.bfh-sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}
.bfh-picker-banner {
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1b2538 0%, #2b3a55 100%);
  color: #fff;
  letter-spacing: .01em;
}
.bfh-asset-tools {
  gap: 10px;
  margin-bottom: 10px;
}
.bfh-asset-tools input,
.bfh-field input,
.bfh-field select {
  min-height: 40px;
  border-color: var(--bfh-border);
  border-radius: 12px;
  color: var(--bfh-text);
  background: var(--bfh-surface);
}
.bfh-asset-tools input:focus,
.bfh-field input:focus,
.bfh-field select:focus {
  outline: none;
  border-color: rgba(43,95,255,.45);
  box-shadow: 0 0 0 4px rgba(43,95,255,.12);
}
.bfh-search-row {
  grid-template-columns: 1fr 88px;
  gap: 8px;
}
.bfh-filter-row {
  gap: 8px;
}
.bfh-chip {
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bfh-surface);
  color: var(--bfh-text-muted);
  font-weight: 600;
}
.bfh-chip.active {
  background: var(--bfh-accent-soft);
  border-color: rgba(43,95,255,.28);
  color: #1744ca;
}
.bfh-asset-meta,
.bfh-toggle-row,
.bfh-picker-item label,
.bfh-detail-subtitle,
.bfh-detail-condition,
.bfh-detail-fallback,
.bfh-card small,
.bfh-deck-card-head small {
  color: var(--bfh-text-muted);
}
.bfh-asset-grid {
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
  max-height: 560px;
}
.bfh-asset-card {
  min-height: 74px;
  padding: 8px 6px;
  border-radius: 14px;
  border-color: #dfe6ef;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
}
.bfh-asset-card:hover {
  border-color: rgba(43,95,255,.32);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}
.bfh-asset-card.is-assigned {
  border-color: rgba(43,95,255,.34);
  box-shadow: inset 0 0 0 1px rgba(43,95,255,.26), 0 8px 18px rgba(43,95,255,.08);
}
.bfh-asset-card.is-pick-target {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}
.bfh-card-info,
.bfh-slot-clear {
  border-color: var(--bfh-border);
  background: rgba(255,255,255,.96);
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-card-info {
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  color: var(--bfh-text-muted);
}
.bfh-card-badge {
  top: 4px;
  left: 4px;
  background: rgba(21,32,51,.92);
}
.bfh-assigned-badge {
  background: #eff4ff;
  color: #2f4ca8;
  font-weight: 700;
}
.compact-party {
  padding: 12px 14px;
}
.compact-party .bfh-party-header {
  margin-bottom: 10px;
  align-items: center;
}
.compact-party .bfh-field.compact {
  min-width: 128px;
}
.bfh-compact-grid {
  gap: 10px;
}
.bfh-compact-card {
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcff 100%);
  border-color: #dfe6ef;
}
.bfh-compact-card.is-selected {
  border-color: rgba(43,95,255,.35);
  box-shadow: inset 0 0 0 1px rgba(43,95,255,.3), 0 10px 20px rgba(43,95,255,.08);
  background: linear-gradient(180deg, #fbfdff 0%, #eef4ff 100%);
}
.bfh-compact-head {
  margin-bottom: 8px;
}
.bfh-compact-head strong {
  font-size: 12px;
  color: var(--bfh-text-muted);
  font-weight: 700;
  letter-spacing: .02em;
}
.bfh-clear-member {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 10px;
}
.bfh-order-row {
  grid-template-columns: 50px 20px 50px 20px 50px;
  gap: 6px;
}
.bfh-order-token,
.bfh-picker-slot,
.bfh-deck-token {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  border-color: var(--bfh-border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}
.bfh-order-token img,
.bfh-asset-card img,
.bfh-modal-image,
.bfh-picker-slot img,
.bfh-deck-token img {
  border-radius: 10px;
}
.bfh-order-token.is-active,
.bfh-picker-slot.is-active {
  border-color: rgba(43,95,255,.36);
  background: linear-gradient(180deg, #fbfdff 0%, #edf3ff 100%);
  box-shadow: inset 0 0 0 1px rgba(43,95,255,.3), 0 8px 18px rgba(43,95,255,.12);
}
.bfh-order-badge {
  background: rgba(21,32,51,.92);
  font-size: 8px;
}
.bfh-swap-button {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border-radius: 8px;
  font-size: 9px;
  color: var(--bfh-text-muted);
}
.bfh-slot-plus {
  color: #9aa8bc;
}
.bfh-modal-backdrop {
  backdrop-filter: blur(6px);
  background: rgba(10, 15, 25, 0.52);
}
.bfh-modal {
  max-width: 460px;
  border-radius: 20px;
  padding: 22px;
  border: 1px solid rgba(216,225,236,.9);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}
.bfh-modal h3 {
  font-size: 18px;
}
.bfh-modal-image {
  width: 64px;
  height: 64px;
}
.bfh-modal-close {
  border-color: var(--bfh-border);
}
.bfh-param-grid {
  gap: 8px 10px;
}
.bfh-param-grid div {
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--bfh-surface-muted);
  border-color: #e7edf5;
}
.bfh-detail-block {
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid #eef2f7;
}
.bfh-detail-subtitle {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bfh-detail-mini {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bfh-text-muted);
}
.bfh-skill-section {
  padding: 8px 10px;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  background: var(--bfh-surface-muted);
}
.bfh-deck-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.bfh-deck-card {
  border-radius: 16px;
  padding: 12px;
  border-color: var(--bfh-border);
  box-shadow: var(--bfh-shadow-sm);
}
.bfh-deck-card-head {
  margin-bottom: 10px;
}
.bfh-deck-preview {
  gap: 8px;
}
.bfh-deck-member {
  padding: 6px;
  border-radius: 12px;
  background: var(--bfh-surface-muted);
}
.bfh-deck-swap {
  color: var(--bfh-text-muted);
}
@media (max-width: 1100px) {
  .bfh-toolbar {
    grid-template-columns: 1fr;
  }
  .bfh-toolbar-group:last-child {
    justify-content: flex-start;
  }
  .bfh-fixed-layout {
    grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.1fr);
  }
}
@media (max-width: 860px) {
  .bfh-fixed-layout {
    grid-template-columns: 1fr;
  }
  .bfh-fixed-layout > .bfh-sidebar,
  .bfh-fixed-layout > .bfh-main {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .bfh-sidebar {
    order: 2;
  }
  .bfh-main {
    order: 1;
  }
  .bfh-tabs {
    width: auto;
    max-width: 100%;
    overflow-x: auto;
  }
}


.bfh-manual-importer { margin-bottom: 12px; }
.bfh-manual-deck-preview { margin-top: 10px; }


.bfh-side-attacker {
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  border-color: #cfe1ff;
}
.bfh-side-defender {
  background: linear-gradient(180deg, #fff8f7 0%, #fff0ee 100%);
  border-color: #f1d0ca;
}
.bfh-member-card.bfh-side-attacker.is-pick-target,
.bfh-party.bfh-side-attacker .bfh-member-card.is-pick-target {
  box-shadow: inset 0 0 0 2px #4c89ff;
}
.bfh-member-card.bfh-side-defender.is-pick-target,
.bfh-party.bfh-side-defender .bfh-member-card.is-pick-target {
  box-shadow: inset 0 0 0 2px #e46c5d;
}
.bfh-inline-actions button.is-active-target-button {
  background: #1f4fd6;
  border-color: #1f4fd6;
  color: #fff;
  font-weight: 700;
}
.bfh-manual-library-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.bfh-manual-library-col {
  flex: 1 1 320px;
  min-width: 0;
}
.bfh-manual-chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.bfh-segmented {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bfh-segment {
  padding: 7px 12px;
  border: 1px solid #cfd4dc;
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
}
.bfh-segment.is-active {
  background: #1f4fd6;
  border-color: #1f4fd6;
  color: #fff;
  font-weight: 700;
}
.bfh-order-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bfh-order-preset {
  padding: 8px 10px;
  border: 1px solid #cfd4dc;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
}
.bfh-order-preset.is-active {
  background: #eaf1ff;
  border-color: #1f4fd6;
  color: #1f4fd6;
  font-weight: 700;
}

.manual-order-row { align-items:center; gap:8px; }
.bfh-manual-order-token {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:56px;
  height:40px;
  padding:0 12px;
  border:1px solid #d0d7de;
  border-radius:10px;
  background:#fff;
  font-weight:700;
}
.bfh-manual-sphere-picker-actions {
  display:flex;
  gap:12px;
  margin-top:14px;
}
.bfh-manual-sphere-picker-actions .bfh-primary {
  flex:1 1 auto;
}

.bfh-inline-actions { display:flex; gap:6px; flex-wrap:wrap; }
.bfh-member-card.is-swap-selected,
.bfh-compact-card.is-swap-selected { box-shadow: inset 0 0 0 2px #0f172a, 0 0 0 3px rgba(59,130,246,0.18); }
.bfh-inline-actions button.is-swap-selected-button { background:#0f172a; border-color:#0f172a; color:#fff; font-weight:700; }

.bfh-battle-result{display:inline-flex;align-items:center;justify-content:center;min-width:72px;padding:8px 12px;border-radius:999px;font-weight:800;letter-spacing:.04em;font-size:14px;border:1px solid rgba(148,163,184,.35);background:#f8fafc;color:#0f172a;}
.bfh-battle-result.is-win{background:#ecfdf5;color:#166534;border-color:#86efac;}
.bfh-battle-result.is-lose{background:#fef2f2;color:#b91c1c;border-color:#fca5a5;}
