/**
 * 設定「案件ステータス」行: 表示名・色・保存を横一列に。
 * バッジ色モーダル: タイルを1行（狭い画面は横スクロール）、最前面表示の補助。
 */

/* ステータス行フォームを1行に（狭い幅では折り返し） */
.status-row-form__grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
}

.status-row-form__grid .field {
  margin-bottom: 0 !important;
  min-width: 0;
}

.status-row-form__grid .field:first-child {
  flex: 1 1 10rem;
  min-width: 6rem;
}

.status-row-form__grid .field:nth-child(2) {
  flex: 0 1 auto;
}

.status-row-form__grid .status-row-form__submit {
  flex: 0 0 auto;
  margin-left: auto;
}

.status-row-form__grid .field-label-like {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: var(--muted, #5c6570);
}

.status-row-form__preview {
  margin: 0.35rem 0 0;
}

@media (max-width: 56rem) {
  .status-row-form__grid {
    flex-wrap: wrap;
  }

  .status-row-form__grid .status-row-form__submit {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

/* テーブル内でモーダルが欠けないようセルははみ出し可（dialog は JS で body へ移動） */
.data td:has(form.status-row-form) {
  overflow: visible;
  vertical-align: top;
}

/* モーダル: ビューポートの左右・上下の中央（dialog を body に移してもずれない） */
.lcm-badge-preset-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: max-content;
  max-width: min(32rem, calc(100vw - 1.5rem));
  max-height: min(90vh, calc(100vh - 2rem));
  border: none;
  z-index: 2147483000;
  overflow: auto;
  box-sizing: border-box;
  /* 背後の一覧が透けないよう不透明白（テーマの半透明パネルに上書きされないようにする） */
  background-color: #ffffff;
  background-image: none;
  color: #212529;
  opacity: 1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lcm-badge-preset-dialog__head,
.lcm-badge-preset-dialog__defaults,
.lcm-badge-preset-dialog__foot {
  background-color: #ffffff;
}

.lcm-badge-preset-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

/* 色タイル: 10 色を常に 1 行・均等幅（モックのようにスクロールバー不要に近づける） */
.lcm-badge-preset-dialog__grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(0.2rem, 1.2vw, 0.4rem);
  padding: 0.85rem 1rem 0.35rem;
  overflow-x: visible;
  align-items: stretch;
}

.lcm-badge-preset-tile {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  height: auto;
  max-height: none;
  padding: 0;
  box-sizing: border-box;
}

.lcm-badge-preset-tile__swatch {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-sizing: border-box;
}
