/* deck.css — Deck Builder Panel */

/* ---- Deck toggle button ---- */
#btnDeckToggle {
  position: relative;
  display: none; /* shown by deck.init() */
}
.deck-count-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--accent);
  color: #060a12;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  padding: 0 3px;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
}

/* ---- Deck panel overlay (mobile dim) ---- */
#deckPanelOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 655;
}
#deckPanelOverlay.hidden { display: none; }

/* ---- Deck panel ---- */
#deckPanel {
  position: fixed;
  top: 56px; /* below header */
  right: 0;
  bottom: 0;
  width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 660;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
#deckPanel.open {
  transform: translateX(0);
}

/* Mobile: full screen */
@media (max-width: 640px) {
  #deckPanel {
    width: 100%;
    top: 0;
  }
}

/* ---- Panel header ---- */
.deck-panel-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

/* Row 1: title bar (同 rules-panel-header) */
.deck-panel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.deck-panel-title-text {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

/* Row 2: deck name + action buttons */
.deck-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 6px;
}
#deckNameInput {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
}
#deckNameInput:focus { border-color: var(--accent); }

.deck-panel-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}
.deck-action-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}


.deck-action-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.deck-action-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Validation bar (row 3) ---- */
#deckValidBar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 11px;
  padding: 4px 12px 6px;
  min-height: 24px;
}
.deck-color-chip {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: var(--surface2);
}
.deck-color-chip.color-青   { background: rgba(59,130,246,0.25); color: #93c5fd; }
.deck-color-chip.color-緑   { background: rgba(34,197,94,0.20);  color: #86efac; }
.deck-color-chip.color-赤   { background: rgba(239,68,68,0.22);  color: #fca5a5; }
.deck-color-chip.color-紫   { background: rgba(168,85,247,0.22); color: #d8b4fe; }
.deck-color-chip.color-白   { background: rgba(200,202,212,0.20); color: #e2e8f0; }
.dv-ok    { color: #4ade80; }
.dv-warn  { color: var(--accent); }
.dv-error { color: #f87171; font-weight: 600; }

/* ---- Deck tabs ---- */
.deck-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.deck-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 4px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.deck-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.deck-tab:hover:not(.active) { color: var(--text); }

/* ---- Panel body ---- */
.deck-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.deck-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.deck-tab-content.hidden { display: none; }

/* ---- Deck section ---- */
.deck-section {
  margin-bottom: 4px;
}
.deck-section-hd {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 3px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.dsh-label { flex: 1 1 auto; }
.dsh-cnt {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
}
.dsh-select {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.15s, color 0.15s;
}
.dsh-select:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.dcg-token .dcg-ctrl { display: none; }
.dcg-token .dcg-rm   { display: none; }

/* ---- Deck entry ---- */
.deck-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--border);
}
.deck-entry:hover { background: var(--surface2); }
.deck-entry-img {
  width: 36px;
  height: 50px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--surface2);
}
.deck-entry-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.deck-entry-name {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-entry-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-entry-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.deck-entry-qty {
  font-size: 13px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  color: var(--accent);
}
.dqb {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.dqb:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.dqb:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- Empty state ---- */
.deck-empty {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px 12px;
}
.deck-loading { font-size: 12px; color: var(--text-muted); padding: 12px; }

/* ---- My List ---- */
.deck-my-list-header {
  padding: 8px 12px;
}
#btnDeckNew {
  display: block;
  width: calc(100% - 24px);
  margin: 8px 12px 4px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--accent);
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
  text-align: center;
}
#btnDeckNew:hover { border-color: var(--accent); background: var(--accent-dim); }

.deck-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.deck-list-item.active { background: var(--accent-dim); }
.dli-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dli-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dli-meta { font-size: 10px; color: var(--text-muted); }
.dli-name-row { display: flex; align-items: center; gap: 4px; }
.dli-rename-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.5;
}
.dli-rename-btn:hover { opacity: 1; color: var(--accent); }
.dli-rename-input {
  flex: 1;
  min-width: 0;
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  padding: 2px 6px;
  outline: none;
}
.dli-actions { display: flex; gap: 4px; flex-shrink: 0; }
.dli-copy {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.dli-copy:hover { border-color: var(--accent); color: var(--accent); }
.dli-sel, .dli-del {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.dli-sel:hover:not(.cur) { border-color: var(--accent); color: var(--accent); }
.dli-sel.cur { border-color: var(--accent); color: var(--accent); opacity: 0.6; cursor: default; }
.dli-del:hover { border-color: #f87171; color: #f87171; }
.dli-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dli-colors { display: flex; gap: 3px; }
.dli-supply-badges { display: flex; gap: 3px; margin-top: 5px; }
.dli-supply-icon { display: inline-flex; opacity: 0.18; }
.dli-supply-icon.reg { opacity: 1; }
.dli-supply-icon svg { width: 11px; height: 15px; }

/* ---- Supply inline section ---- */
#deckSupplyInline {
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.deck-supply-hd {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.deck-supply-hd:hover { color: var(--text); }
.deck-supply-hd .dsh-label { flex: 1; }
.deck-supply-hd .dsh-cnt { color: var(--accent); font-weight: 700; }
.deck-supply-hd .dsh-chevron { font-size: 12px; color: var(--text-muted); }
#deckSupplyInline.collapsed .deck-supply-body { display: none; }

/* ---- Supply slots (category-based) ---- */
.supply-slot {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.supply-slot-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.supply-product {
  display: flex;
  align-items: center;
  gap: 10px;
}
.supply-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--surface2);
  flex-shrink: 0;
}
.supply-img-empty { border: 1px dashed var(--border); }
.supply-img-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.supply-img-icon svg { width: 38px; height: 38px; }
.supply-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.supply-name {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supply-link {
  font-size: 11px;
  color: #ff9900;
  text-decoration: none;
  font-weight: 600;
}
.supply-link:hover { text-decoration: underline; }
.supply-add-btn, .supply-change-btn {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.supply-add-btn:hover, .supply-change-btn:hover { border-color: var(--accent); color: var(--accent); }
.supply-editor {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.supply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.supply-preview img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--surface2);
  flex-shrink: 0;
}
.supply-preview-title {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}
.supply-search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.supply-search-row .deck-input { flex: 1; min-width: 0; }
.supply-url-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.supply-url-row .deck-input { flex: 1; min-width: 0; }
.supply-amazon-search-btn {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #ff9900;
  color: #000;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.supply-amazon-search-btn:hover { background: #e68a00; }
.supply-editor-actions { display: flex; gap: 6px; align-items: center; }
.supply-cancel-btn {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.supply-cancel-btn:hover { color: var(--text); }

/* ---- Supply (legacy rows) ---- */
.deck-supply-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}
.dsr-info { flex: 1; min-width: 0; }
.dsr-name { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsr-note { font-size: 10px; color: var(--text-muted); display: block; }
.dsr-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.dsr-amazon {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  background: #ff9900;
  color: #000;
  text-decoration: none;
  font-weight: 600;
}
.dsr-add, .dsr-rem {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.dsr-add:hover { border-color: var(--accent); color: var(--accent); }
.dsr-add.added { border-color: #4ade80; color: #4ade80; }
.dsr-rem:hover { border-color: #f87171; color: #f87171; }

.deck-supply-form {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.deck-input {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
  width: 100%;
}
.deck-input:focus { border-color: var(--accent); }
.deck-input::placeholder { color: var(--text-muted); }
.dsf-actions { display: flex; gap: 6px; align-items: center; }
.deck-amazon-btn {
  flex: 1;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #ff9900;
  color: #000;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
}

/* ---- Add control on card grid ---- */
.deck-add-ctrl {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 54px;
  background: rgba(4,8,18,0.82);
  flex-direction: column;
  z-index: 3;
}
body.deck-panel-open .deck-add-ctrl {
  display: flex;
}
.deck-add-ctrl.dac-list {
  top: 0;
  height: auto;
  width: 88px;
  border-radius: 4px 0 0 4px;
  background: rgba(4,8,18,0.82);
}
/* Wide table (PC) deck control column */
.deck-add-ctrl.dac-tbl {
  position: relative;
  top: auto; bottom: auto; left: auto; right: auto;
  height: 40px;
  width: 88px;
  border-radius: 4px;
  background: rgba(4,8,18,0.72);
}
/* Vertically centered variant — grid card & modal image overlays use this so the
   panel doesn't cover the printed AP/HP stats near the bottom of the card art */
.deck-add-ctrl.dac-center {
  top: 70%;
  bottom: auto;
  transform: translateY(-50%);
  border-radius: 8px;
}
/* Modal only: narrow to 80% width so it doesn't overlap the prev/next variant nav buttons */
.deck-add-ctrl.dac-modal {
  left: 10%;
  right: 10%;
}
.dac-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s;
}
.dac-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.dac-btn.dac-blocked { opacity: 0.35; cursor: not-allowed; }
/* qty=0: full-width + */
.dac-add {
  flex: 1;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  width: 100%;
}
.dac-add:hover:not(:disabled) { background: rgba(201,165,90,0.2); }
/* 1段目: ✕ (左) | MAX (右) */
.dac-row1 {
  display: flex;
  flex: none;
  height: 50%;
  box-sizing: border-box;
  border-bottom: 2px solid rgba(255,255,255,0.18);
}
.dac-clr {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #f87171;
  border-right: 2px solid rgba(255,255,255,0.18);
}
.dac-clr:hover:not(:disabled) { background: rgba(248,113,113,0.18); }
.dac-max {
  flex: 1;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.dac-max:hover:not(:disabled) { background: rgba(201,165,90,0.2); }
.dac-max:disabled { color: var(--text-muted); }
/* 2段目: － | 枚数 | ＋ */
.dac-row2 {
  display: flex;
  flex: none;
  height: 50%;
  box-sizing: border-box;
}
.dac-dec, .dac-inc {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.dac-dec:hover:not(:disabled),
.dac-inc:hover:not(:disabled) { background: rgba(201,165,90,0.18); }
.dac-qty {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* card-thumb needs position: relative and overflow: hidden */

/* ---- Deck content grid ---- */
.deck-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px 8px 8px;
}
.dcg-item {
  position: relative;
  aspect-ratio: 215 / 300;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
}
.dcg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--surface2);
}
/* 枚数バッジ — 右上、円形 */
.dcg-qty {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  background: rgba(6,10,18,0.78);
  border-radius: 50%;
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
/* 下部: － ＋ */
.dcg-ctrl {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: rgba(6,10,18,0.85);
  display: flex;
  align-items: center;
}
.dcg-dec, .dcg-inc {
  flex: 1;
  height: 28px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.dcg-dec { border-right: 2px solid rgba(255,255,255,0.18); }
.dcg-dec:hover, .dcg-inc:hover { background: rgba(201,165,90,0.2); }
.dcg-inc:disabled,
.dcg-inc.dcg-blocked { color: var(--text-muted); opacity: 0.45; cursor: not-allowed; }

/* ---- Deck action bar (replaces FAB + float button) ---- */
.deck-action-bar {
  position: fixed;
  bottom: calc(20px + var(--dlv-offset, 0px));
  right: 16px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  z-index: 650;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s, bottom 0.2s;
}
.deck-action-bar.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* PC: デッキパネルが開いているときパネルの左隣に表示 */
.deck-action-bar.dab-beside-panel {
  right: 376px; /* 360px panel + 16px gap */
}

/* ---- Live LV distribution bar (card select mode, panel minimized) ---- */
.deck-lv-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 640;
  background: rgba(4,8,18,0.92);
  border-top: 1px solid var(--border);
  padding: 6px 12px 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
}
.deck-lv-bar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.dlv-hdrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 6px;
}
.deck-lv-bar.collapsed .dlv-hdrow { margin-bottom: 0; }
/* 分布エリア左上の明示的な開閉タブ（プレーンテキストの見出しだと押せることが
   分かりにくいという指摘を受け、枠付きの小さなボタンとして独立させた） */
.dlv-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px 0 auto; /* 右端寄せ。.deck-lv-barの右padding(12px)に4px足し、カード-画面端間と同程度の16pxの余白にする */
  padding: 3px 10px 3px 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
}
.dlv-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.dlv-chevron { font-size: 12px; }
/* タブの横に常時表示するタイプ内訳（折りたたみ中も見えるようdlv-chartとは別扱い） */
.dlv-type-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}
.dlv-type-item b { color: var(--text); font-weight: 700; margin-left: 3px; }
.deck-lv-bar.collapsed .dlv-chart { display: none; }
.dlv-chart { max-width: 480px; }

#hamburgerMenu.open { z-index: 680; }
.hamburger-overlay:not(.hidden) { z-index: 670; }
.dab-pill {
  position: relative;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  transition: filter 0.15s;
}
.dab-pill:hover { filter: brightness(1.08); }
.dab-count-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: #060a12;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 4px;
  line-height: 18px;
  text-align: center;
}
.dab-primary {
  background: var(--accent);
  color: #060a12;
}
.dab-secondary {
  background: rgba(6,10,18,0.85);
  color: var(--accent);
  border: 1px solid rgba(201,165,90,0.5);
  font-size: 13px;
  padding: 10px 16px;
  backdrop-filter: blur(6px);
}

/* ---- Toast ---- */
.deck-toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 18px;
  white-space: normal;
  width: min(360px, calc(100vw - 32px));
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 700;
}
.deck-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- Card select bar ---- */
.deck-select-bar {
  flex-shrink: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
#btnDeckSelectCards {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #060a12;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  text-align: center;
}
#btnDeckSelectCards:hover { filter: brightness(1.1); }


/* ---- Share modal ---- */
.deck-share-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.deck-share-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: min(320px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dsm-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.dsm-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}
.dsm-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.dsm-close:hover { color: var(--text); background: var(--surface2); }
.dsm-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dsm-fixed-note {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  padding: 6px 10px;
  background: var(--surface2);
  border-radius: 6px;
  border-left: 2px solid var(--accent);
}
.dsm-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dsm-checks-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dsm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}
.dsm-check input { cursor: pointer; accent-color: var(--accent); width: 14px; height: 14px; }
.dsm-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dsm-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}
.dsm-btn:hover { border-color: var(--accent); color: var(--accent); }
.dsm-btn-primary {
  background: var(--accent);
  color: #060a12;
  border-color: var(--accent);
  font-weight: 700;
}
.dsm-btn-primary:hover { filter: brightness(1.08); color: #060a12; border-color: var(--accent); }

/* ---- Share preview modal ---- */
.share-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.share-preview-modal {
  width: min(480px, 100%);
  max-height: 92vh;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #1a2840;
}
.share-preview-header {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  background: #0d1828;
  border-bottom: 1px solid #1a2840;
  flex-shrink: 0;
}
.sph-title { flex: 1; font-size: 14px; font-weight: 600; color: #c9d8eb; }
.sph-close {
  background: none;
  border: none;
  color: #6b7e99;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.sph-close:hover { color: #e2e8f0; }
.share-preview-body {
  background: #060a12;
  color: #e2e8f0;
  font-family: sans-serif;
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
}
.share-preview-footer {
  background: #060a12;
  padding: 10px 14px 16px;
  border-top: 1px solid #1a2840;
  flex-shrink: 0;
}
/* settings panel */
.spm-settings {
  padding: 8px 14px 6px;
  background: #0d1828;
  border-bottom: 1px solid #1a2840;
  flex-shrink: 0;
}
.spm-settings-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin-bottom: 6px;
}
.spm-settings-label {
  font-size: 10px;
  color: #6b7e99;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.spm-settings-sep {
  width: 1px;
  height: 14px;
  background: #1a2840;
  flex-shrink: 0;
}
.spm-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #c9d8eb;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.spm-radio {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #c9d8eb;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.spm-text-input {
  flex: 1;
  background: #060a12;
  border: 1px solid #1a2840;
  border-radius: 4px;
  color: #c9d8eb;
  font-size: 12px;
  padding: 5px 8px;
  min-width: 0;
}
.spm-text-input:focus { outline: none; border-color: #c9a55a55; }

/* footer buttons */
.spf-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}
.spf-deck-btn,
.spf-dl-btn {
  flex: 1;
  padding: 11px 6px;
  background: transparent;
  color: #c9d8eb;
  border: 1px solid #1a2840;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.spf-deck-btn:hover,
.spf-dl-btn:hover { border-color: #c9a55a55; color: #c9a55a; }
.spf-img-share-btn {
  flex: 1;
  padding: 11px 6px;
  background: #c9a55a;
  color: #060a12;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.spf-img-share-btn:hover { filter: brightness(1.08); }
.spf-img-share-btn:disabled,
.spf-dl-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.spf-msg { margin: 0 0 8px; font-size: 12px; color: #8899aa; text-align: center; }

/* ---- TCG+ filter hint section ---- */
/* .spm-settings/.share-preview-footer と同じ「枠なし・上ボーダーのみの全幅パネル」方式に
   揃える（2026-08-08、独立した角丸ボーダーボックスだとモーダル幅より狭く見えるため変更） */
.tcgp-hint {
  display: block;
  margin: 0;
  border: none;
  border-top: 1px solid #1a2840;
  background: #0d1828;
}
.tcgp-hint-summary {
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #c9a55a;
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.tcgp-hint-summary::-webkit-details-marker { display: none; }
.tcgp-hint-summary::after { content: ' ▾'; color: #6b7e99; }
.tcgp-hint[open] .tcgp-hint-summary::after { content: ' ▴'; }
.tcgp-hint-body { padding: 0 14px 12px; }
.tcgp-hint-note {
  font-size: 11px;
  color: #6b7e99;
  margin: 0 0 8px;
  line-height: 1.5;
}
.tcgp-hint-list { margin: 0; }
.tcgp-hint-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #1a284066;
  font-size: 12px;
}
.tcgp-hint-row:last-child { border-bottom: none; }
.tcgp-hint-row dt { flex: 0 0 auto; min-width: 92px; color: #8899aa; margin: 0; }
.tcgp-hint-row dd { margin: 0; color: #c9d8eb; font-weight: 600; text-align: left; }
/* カードセットは件数によって長くなるため、ラベルの右ではなく下にモーダル幅いっぱいで表示し、
   カードセットごとに改行する（2026-08-08、色/出典タイトルの1行レイアウトから分離） */
.tcgp-hint-row-block { flex-direction: column; gap: 2px; }
.tcgp-hint-row-block dd { width: 100%; }
.tcgp-hint-row-block dd > div + div { margin-top: 2px; }

/* ---- Analytics Modal ---- */
.da-subtab-content.hidden { display: none; }

.da-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.da-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: min(520px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.da-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.da-modal-title { font-size: 14px; font-weight: 700; color: var(--accent); }
.da-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.da-modal-close:hover { color: var(--text); background: var(--surface2); }
.da-modal-body { overflow-y: auto; flex: 1; }

.da-section {
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
}
.da-section:last-child { border-bottom: none; }
.da-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.da-section-meta { font-weight: 400; text-transform: none; letter-spacing: 0; }

/* Donut */
.da-donut-wrap { display: flex; align-items: center; gap: 16px; }
.da-donut-legend { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.da-legend-item { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.da-legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.da-legend-label { flex: 1; color: var(--text-muted); }
.da-legend-val { font-weight: 700; color: var(--text); }

/* Distribution type filter (multi-select) */
.da-type-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.da-type-chip {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.da-type-chip.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.da-type-chip:hover:not(.active) { color: var(--text); }

/* Distribution sub-tabs */
.da-subtabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.da-subtab {
  flex: 1;
  background: none;
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 8px;
  cursor: pointer;
}
.da-subtab:last-child { border-right: none; }
.da-subtab.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
.da-subtab:hover:not(.active) { color: var(--text); }

/* Burst probability */
.da-burst-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.da-burst-label { font-size: 11px; color: var(--text-muted); width: 22px; flex-shrink: 0; }
.da-burst-bar-wrap { flex: 1; height: 10px; background: var(--surface2); border-radius: 5px; overflow: hidden; }
.da-burst-bar { height: 100%; background: var(--accent); border-radius: 5px; transition: width 0.3s; }
.da-burst-pct { font-size: 11px; font-weight: 700; color: var(--text); width: 38px; text-align: right; }

/* Pilot-Unit */
.da-pilot-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
.da-pilot-row:last-child { border-bottom: none; }
.da-pilot-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.da-pilot-link-count { font-size: 10px; color: var(--accent); margin-bottom: 4px; }
.da-pilot-units { display: flex; flex-wrap: wrap; gap: 3px; }
.da-unit-chip {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
}
.da-no-link { font-size: 10px; color: var(--text-muted); }

/* Opening hand */
.da-hand-display { display: flex; gap: 3px; margin-bottom: 8px; min-height: 74px; }
.da-hand-card {
  flex: 1;
  aspect-ratio: 215 / 300;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface2);
}
.da-hand-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.da-hand-btn {
  width: 100%;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  margin-bottom: 8px;
}
.da-hand-btn:hover { border-color: var(--accent); }
.da-hand-desc { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.da-hand-table { margin-top: 0; }
.da-hand-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.da-hand-row:last-child { border-bottom: none; }
.da-hand-header { color: var(--text-muted); font-size: 10px; border-bottom: 1px solid var(--border); }
.da-hand-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.da-hand-qty { color: var(--text-muted); flex-shrink: 0; }
.da-hand-pct { font-weight: 700; color: var(--accent); width: 38px; text-align: right; }
.da-card-no { font-size: 9px; color: var(--text-muted); font-weight: 400; flex-shrink: 0; }

/* Turn planner */
.da-section-title-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.da-section-title-row .da-section-title { margin-bottom: 0; }
.da-help-btn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.da-help-btn:hover { border-color: var(--accent); color: var(--accent); }
.da-help-panel {
  display: none;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.6;
}
.da-help-panel.open { display: block; }
.da-help-panel p { margin: 0 0 4px; }
.da-help-panel ul { margin: 0; padding-left: 14px; }
.da-help-panel li { margin-bottom: 2px; }
.da-planner-chip .da-card-no { color: var(--text-muted); font-weight: 400; }
.da-planner-legend { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; }
.da-planner-legend-a { font-weight: 700; color: var(--accent); }
.da-planner-legend-b { font-weight: 700; color: #5b9cf6; }
.da-planner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
  max-height: 110px;
  overflow-y: auto;
}
.da-planner-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: border-color 0.15s, color 0.15s;
}
.da-planner-chip:hover { border-color: var(--text-muted); }
.da-planner-chip[data-group="A"] { border-color: var(--accent); color: var(--text); background: var(--accent-dim); }
.da-planner-chip[data-group="B"] { border-color: #5b9cf6; color: var(--text); background: rgba(91,156,246,0.12); }
.da-chip-badge {
  display: none;
  font-size: 9px;
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.da-planner-chip[data-group="A"] .da-chip-badge { display: inline-flex; background: var(--accent); color: #1a1400; }
.da-planner-chip[data-group="B"] .da-chip-badge { display: inline-flex; background: #5b9cf6; color: #fff; }
.da-planner-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.da-planner-turn-label { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.da-turns-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.da-turns-step {
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.da-turns-step:hover { background: var(--accent-dim); color: var(--accent); }
.da-turns-val {
  min-width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface2);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 0 4px;
  line-height: 28px;
}
.da-reset-btn {
  padding: 0 10px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}
.da-reset-btn:hover { border-color: var(--text-muted); color: var(--text); }
.da-calc-btn {
  flex: 1;
  padding: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.da-calc-btn:hover { background: rgba(201,165,90,0.22); }
.da-planner-result { margin-top: 4px; }
.da-result-label { font-size: 10px; color: var(--text-muted); margin-bottom: 2px; line-height: 1.5; word-break: break-all; }
.da-result-turn  { font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.da-result-prob  { font-size: 22px; font-weight: 700; color: var(--accent); }
.da-result-bar-wrap { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.da-result-bar { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.da-result-msg { font-size: 11px; color: var(--text-muted); }

/* Trait cluster — wider label override */
.da-trait-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.da-trait-label { font-size: 11px; color: var(--text-muted); width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Speed metrics */
.da-speed-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.da-speed-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.da-speed-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.da-speed-val { font-size: 20px; font-weight: 700; color: var(--text); }
.da-speed-sep { width: 1px; height: 36px; background: var(--border); flex-shrink: 0; }

/* ---- AIデッキ診断（軸B: da-ai-*、軸A: dw-*） ---- */
.da-ai-note { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.da-ai-goal-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.da-ai-goal-chip {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.da-ai-goal-chip input { accent-color: var(--accent); }
.da-ai-run-btn {
  width: 100%;
  padding: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.da-ai-run-btn:hover:not(:disabled) { background: rgba(201,165,90,0.22); }
.da-ai-run-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.da-ai-result { margin-top: 10px; }
.da-ai-loading, .da-ai-empty { font-size: 11px; color: var(--text-muted); padding: 6px 0; }
.da-ai-goal-result { margin-bottom: 12px; }
.da-ai-goal-result:last-child { margin-bottom: 0; }
.da-ai-goal-label { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.da-ai-card-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.da-ai-card-row:last-child { border-bottom: none; }
.da-ai-card-thumb { width: 32px; height: 44px; object-fit: cover; border-radius: 3px; flex-shrink: 0; background: var(--surface2); }
.da-ai-card-info { flex: 1; min-width: 0; }
.da-ai-card-name { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.da-ai-card-reason { font-size: 10px; color: var(--text-muted); }
.da-ai-add-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.da-ai-add-btn:hover:not(:disabled) { background: var(--accent-dim); }
.da-ai-add-btn:disabled { border-color: var(--border); color: var(--text-muted); cursor: default; }

/* 軸A: デッキ作成ウィザード */
.dw-modal { width: min(420px, 100%); }
.dw-modal .da-modal-body { padding: 14px; }
.dw-field { margin-bottom: 12px; }
.dw-field label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.dw-field input[type="number"], .dw-field input[type="text"], .dw-field select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  padding: 7px 9px;
}
.dw-radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.dw-radio-group label { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text); margin: 0; }
.dw-radio-group input { accent-color: var(--accent); }
.dw-radio-group label:has(input:disabled) { opacity: 0.4; }
.dw-result { margin-top: 12px; }
.dw-result-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}
.dw-result-thumbs { display: flex; gap: 3px; margin-bottom: 6px; }
.dw-result-thumbs img { width: 36px; height: 50px; object-fit: cover; border-radius: 3px; background: var(--surface2); }
.dw-result-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.dw-result-reason { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; }
.dw-result-actions { display: flex; gap: 8px; }
.dw-import-btn, .dw-analyze-btn {
  flex: 1;
  padding: 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.dw-import-btn { background: var(--accent-dim); border: 1px solid var(--accent); color: var(--accent); }
.dw-import-btn:hover { background: rgba(201,165,90,0.22); }
.dw-analyze-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); }
.dw-analyze-btn:hover { color: var(--text); border-color: var(--text-muted); }
.dw-empty-cta {
  display: block;
  margin: 10px auto 0;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.dw-empty-cta:hover { background: rgba(201,165,90,0.22); }
.dw-empty-cta-wrap { padding: 10px 12px; text-align: center; }
.dw-empty-cta-wrap .dw-empty-cta { margin: 0; }

/* ---- Light mode overrides ---- */
html[data-theme="light"] {
  #deckPanel { background: #f4f6fb; border-left-color: #c8d0e0; }
  #deckNameInput { background: #fff; border-color: #c8d0e0; color: #1e293b; }
  .deck-action-btn { background: #e8ecf4; border-color: #c8d0e0; color: #1e293b; }
  .dqb { background: #e8ecf4; border-color: #c8d0e0; color: #1e293b; }
  .deck-entry:hover { background: #edf0f8; }
  .deck-list-item.active { background: rgba(122,88,20,0.08); }
  .deck-input { background: #fff; border-color: #c8d0e0; color: #1e293b; }
  .deck-supply-row { border-bottom-color: #c8d0e0; }
  .deck-toast { background: #f4f6fb; border-color: #c8d0e0; color: #1e293b; }
  #btnDeckNew { background: #edf0f8; border-color: #c8d0e0; }
  .da-unit-chip    { background: #edf0f8; border-color: #c8d0e0; }
  .da-burst-bar-wrap { background: #e8ecf4; }
  .da-hand-card    { background: #e8ecf4; }
  .da-hand-btn     { background: #edf0f8; border-color: #c8d0e0; }
  .da-planner-chip { background: #edf0f8; border-color: #c8d0e0; }
  .da-planner-chip[data-group="A"] { background: var(--accent-dim); border-color: var(--accent); }
  .da-planner-chip[data-group="B"] { background: rgba(91,156,246,0.12); border-color: #5b9cf6; }
  .da-turns-stepper { border-color: #c8d0e0; }
  .da-turns-step { background: #edf0f8; border-color: #c8d0e0; color: #1e293b; }
  .da-turns-val { background: #fff; border-color: #c8d0e0; color: #1e293b; }
  .da-result-bar-wrap { background: #e8ecf4; }
}
