/* =====================================================================
   style.css — 色の作り方（絵の具の混色） ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（結果表示は sg-result）。
   共有CSS変数にはフォールバックを付ける。ダークテーマでも見えるように。
   ===================================================================== */

.cm-section-title {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0 0 4px;
}
.cm-section-desc {
  color: var(--sg-muted, #666);
  font-size: 0.88rem;
  margin: 0 0 12px;
}

/* ---------- 基本色の凡例 ---------- */
.cm-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 12px;
}
.cm-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cm-legend__swatch {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.cm-legend__body {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.cm-legend__name {
  font-weight: 700;
  font-size: 0.92rem;
}
.cm-legend__note {
  font-size: 0.74rem;
  color: var(--sg-muted, #777);
}

/* ---------- 系統フィルタ ---------- */
.cm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.cm-filter {
  border: 1px solid var(--sg-border, #e5e7eb);
  background: var(--sg-surface, #fff);
  color: var(--sg-text, #1a1a1a);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}
.cm-filter:hover {
  border-color: var(--sg-primary, #3b5bdb);
}
.cm-filter.is-active {
  background: var(--sg-primary, #3b5bdb);
  border-color: var(--sg-primary, #3b5bdb);
  color: #fff;
  font-weight: 600;
}

/* ---------- 作りたい色のグリッド ---------- */
.cm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.cm-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--sg-border, #e5e7eb);
  border-radius: var(--sg-radius, 10px);
  background: var(--sg-surface, #fff);
  color: var(--sg-text, #1a1a1a);
  cursor: pointer;
  text-align: center;
  transition: transform 0.08s ease, border-color 0.1s ease, box-shadow 0.1s ease;
}
.cm-cell:hover {
  transform: translateY(-2px);
  border-color: var(--sg-primary, #3b5bdb);
}
.cm-cell:active {
  transform: translateY(0);
}
.cm-cell.is-selected {
  border-color: var(--sg-primary, #3b5bdb);
  box-shadow: 0 0 0 2px var(--sg-primary, #3b5bdb);
}
.cm-cell__swatch {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.cm-cell__name {
  font-size: 0.76rem;
  line-height: 1.25;
  font-weight: 600;
}

/* ---------- レシピ表示 ---------- */
.cm-recipe-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.cm-recipe-swatch {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.cm-recipe-title {
  min-width: 0;
}
.cm-recipe-name {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}
.cm-recipe-hex {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--sg-muted, #777);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.cm-mix-label {
  margin-bottom: 8px;
}
.cm-mix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  margin-bottom: 12px;
}
.cm-mix__sep {
  font-weight: 700;
  color: var(--sg-muted, #777);
  padding: 0 2px;
}

/* 材料チップ（基本色の小さな四角＋ラベル） */
.cm-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 7px;
  border: 1px solid var(--sg-border, #e5e7eb);
  border-radius: 999px;
  background: var(--sg-surface-2, rgba(0, 0, 0, 0.03));
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.cm-chip__dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.cm-chip__label {
  color: var(--sg-text, #1a1a1a);
}

.cm-tip {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--sg-text, #1a1a1a);
}

/* ダークテーマ微調整（共有CSSが .sg-dark を付与する想定） */
.sg-dark .cm-filter,
.sg-dark .cm-cell {
  background: var(--sg-surface, #1f2430);
  color: var(--sg-text, #e8eaf0);
}
.sg-dark .cm-chip {
  background: var(--sg-surface-2, rgba(255, 255, 255, 0.06));
}
