/* ============================================================
   11-dict-manager.css — 辞書一覧・一括編集テーブル(admin・V2-① 段3)
   全画面モーダル(§8: body直下appendChild + 2クラスhidden)。配色は既存トークン。
   ============================================================ */

.dict-mgr-modal {
  position: fixed;
  inset: 0;
  z-index: 11000;                 /* dictEditModal(12000)より背面=詳細編集は前面に重なる */
  display: flex;
  flex-direction: column;
  background: var(--bg-base, #0D0D12);
  color: var(--text-primary, #E2E8F0);
}
.dict-mgr-modal.modal-hidden { display: none; }

.dict-mgr-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  flex: 0 0 auto;
}
.dict-mgr-title { font-size: 16px; font-weight: 700; }
.dict-mgr-count-badge {
  font-size: 12px;
  color: var(--store-theme-color, #F5A623);
  font-weight: 700;
}
.dict-mgr-close {
  margin-left: auto;
  background: none; border: none;
  color: var(--text-tertiary, #94A3B8);
  font-size: 22px; line-height: 1;
  padding: 4px 8px; cursor: pointer;
}

/* フィルタ行 */
.dict-mgr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  flex: 0 0 auto;
}
.dict-mgr-filters select,
.dict-mgr-filters input {
  font-size: 16px;               /* iOSズーム防止 */
  padding: 8px 10px;
  background: var(--bg-card, #141821);
  color: var(--text-primary, #E2E8F0);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  color-scheme: dark;
}
.dict-mgr-filters .dict-mgr-search { flex: 1 1 180px; min-width: 0; }
.dict-mgr-note { font-size: 12px; color: var(--text-tertiary, #94A3B8); }

/* 一括ツールバー(選択時のみ表示) */
.dict-mgr-bulkbar {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-card, #141821);
  border-bottom: 1px solid var(--store-theme-color, #F5A623);
  flex: 0 0 auto;
}
.dict-mgr-bulkbar.is-on { display: flex; }
.dict-mgr-bulkbar .dict-mgr-selcount { font-weight: 700; color: var(--store-theme-color, #F5A623); font-size: 13px; }
.dict-mgr-bulkbar select,
.dict-mgr-bulkbar input {
  font-size: 16px; padding: 7px 9px;
  background: var(--bg-base, #0D0D12);
  color: var(--text-primary, #E2E8F0);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: 7px; color-scheme: dark;
}
.dict-mgr-bulkbar input.dict-mgr-bulk-maker { width: 130px; }
.dict-mgr-bulkbar input.dict-mgr-bulk-alias { width: 150px; }
.dict-mgr-repl { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-tertiary, #94A3B8); }
.dict-mgr-bulkbar input.dict-mgr-repl-in { width: 92px; }
.dict-mgr-btn {
  font-size: 14px; padding: 8px 12px;
  background: var(--store-theme-color, #F5A623); color: #fff;
  border: none; border-radius: 7px; cursor: pointer; font-weight: 700;
}
.dict-mgr-btn.is-ghost {
  background: none; color: var(--text-tertiary, #94A3B8);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12)); font-weight: 400;
}
.dict-mgr-btn.is-ghost.is-active {
  background: var(--danger-dim, rgba(255, 77, 79, 0.15));
  color: var(--danger, #FF4D4F); border-color: var(--danger, #FF4D4F);
}

/* テーブル */
.dict-mgr-tablewrap { flex: 1 1 auto; overflow: auto; }
.dict-mgr-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 13px; }
.dict-mgr-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg-card, #141821);
  border-bottom: 1px solid var(--border-strong, rgba(255, 255, 255, 0.15));
  padding: 8px 10px; text-align: left; white-space: nowrap;
  color: var(--text-tertiary, #94A3B8); font-weight: 600;
}
.dict-mgr-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  vertical-align: middle;
}
.dict-mgr-table tr.is-selected td { background: rgba(245, 166, 35, 0.10); }
.dict-mgr-thumb {
  width: 34px; height: 46px; object-fit: contain;
  background: var(--bg-base, #0D0D12); border-radius: 4px; display: block;
}
.dict-mgr-frozen { color: var(--text-tertiary, #94A3B8); }

/* ── 列幅(table-layout:fixed)。matchKey/容量/大分類は非編集=最小幅、
      名前・小分類・メーカー(編集対象)に幅を厚く配分。狭幅では非編集列を隠す。 ── */
.col-ck     { width: 34px; text-align: center; padding-left: 6px; padding-right: 6px; }
.col-img    { width: 44px; }
.col-name   { width: auto; word-break: break-word; }          /* 残り幅を最大配分 */
.col-mk     { width: 120px; color: var(--text-tertiary, #94A3B8);
              overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }  /* 非編集=省略表示 */
.col-vol    { width: 62px; white-space: nowrap; }
.col-main   { width: 88px; }
.col-detail { width: 148px; word-break: break-word; }
.col-maker  { width: 176px; word-break: break-word; }
.col-alias  { width: 48px; text-align: center; }
.col-act    { width: 66px; text-align: center; white-space: nowrap; }

/* 狭い画面: 非編集の matchKey を隠す(まず一番不要なものから) */
@media (max-width: 900px) {
  .col-mk { display: none; }
}
/* さらに狭い: 大分類(小分類から自動導出=冗長)・容量も隠して編集列を優先 */
@media (max-width: 640px) {
  .col-main, .col-vol { display: none; }
  .col-detail { width: 130px; }
  .col-maker  { width: 130px; }
  .col-img    { width: 38px; }
  .dict-mgr-table { font-size: 12px; }
  .dict-mgr-table td, .dict-mgr-table thead th { padding: 6px 6px; }
}
.dict-mgr-editable { cursor: text; border-radius: 5px; }
.dict-mgr-editable:hover { background: rgba(255, 255, 255, 0.05); outline: 1px dashed var(--border-subtle, rgba(255,255,255,0.15)); }
.dict-mgr-cell-input {
  width: 100%; font-size: 14px; padding: 4px 6px;
  background: var(--bg-base, #0D0D12); color: var(--text-primary, #E2E8F0);
  border: 1px solid var(--store-theme-color, #F5A623); border-radius: 5px; color-scheme: dark;
}
.dict-mgr-cell-select {
  font-size: 14px; padding: 4px 6px; max-width: 200px;
  background: var(--bg-base, #0D0D12); color: var(--text-primary, #E2E8F0);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12)); border-radius: 5px; color-scheme: dark;
}
.dict-mgr-main-cell { color: var(--text-tertiary, #94A3B8); white-space: nowrap; }
.dict-mgr-row-actions { white-space: nowrap; }
.dict-mgr-row-btn {
  background: none; border: none; font-size: 15px; padding: 2px 6px; cursor: pointer; opacity: 0.8;
}
.dict-mgr-row-btn:hover { opacity: 1; }
.dict-mgr-added-badge { font-size: 10px; color: var(--store-theme-color, #F5A623); margin-left: 4px; }
.dict-mgr-empty { padding: 40px 16px; text-align: center; color: var(--text-tertiary, #94A3B8); }
.dict-mgr-check { width: 18px; height: 18px; accent-color: var(--store-theme-color, #F5A623); }
