/* ── ベースラベル（選択中の市販用土） ── */
#base-label {
  display: none;
  font-size: 11px;
  color: #7C3AED;
  font-family: sans-serif;
  font-weight: 600;
  background: #F5F3FF;
  border: 1px solid #DDD6FE;
  border-radius: 6px;
  padding: 5px 10px;
}

/* ── 市販の用土リスト ── */
#commercial-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
}

.commercial-item {
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: sans-serif;
  touch-action: manipulation;
}

.commercial-item:hover {
  border-color: #7C3AED;
  background: #F5F3FF;
}

.commercial-item.selected {
  border-color: #7C3AED;
  background: #F5F3FF;
}

.commercial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.commercial-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.commercial-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.commercial-category {
  font-size: 11px;
  color: #FFFFFF;
  background: #9CA3AF;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}

.commercial-desc {
  font-size: 11px;
  color: #9CA3AF;
}

/* ── 鉢サイズボタン ── */
.size-btn {
  padding: 8px 16px;
  border: 1.5px solid #E5E7EB;
  background: #FFFFFF;
  color: #374151;
  font-size: 16px;
  font-family: sans-serif;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s;
  touch-action: manipulation;
}
.size-btn.active             { background: #16A34A; color: #FFFFFF; border-color: #16A34A; }
.size-btn:hover:not(.active) { border-color: #16A34A; color: #16A34A; background: #F0FDF4; }

/* ── 物体リスト ── */
#obj-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
#obj-list::-webkit-scrollbar       { height: 3px; }
#obj-list::-webkit-scrollbar-track { background: transparent; }
#obj-list::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 2px; }

/* ── 資材アコーディオン ── */
.mat-accordion {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mat-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: #F3F4F6;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: sans-serif;
  color: #6B7280;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
}

.mat-accordion-arrow {
  font-size: 14px;
  color: #9CA3AF;
  transition: transform 0.2s;
  display: inline-block;
}

.mat-accordion-header.open .mat-accordion-arrow {
  transform: rotate(180deg);
}

.mat-accordion-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mat-accordion-body[hidden] { display: none; }

/* ── 物体カード ── */
.obj-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 140px;
}

.obj-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.obj-name {
  font-size: 14px;
  font-family: sans-serif;
  font-weight: 700;
  color: #111827;
  flex-shrink: 0;
}

/* タグは名前行の中でスペースを埋める */
.obj-name-row .mat-tags {
  flex: 1;
  flex-wrap: nowrap;
  overflow: hidden;
  min-width: 0;
  gap: 3px;
}

/* ── 操作行: 左情報(固定幅) / スライダー / 数値 の3カラム ── */
.obj-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.obj-left-info {
  flex-shrink: 0;
  width: 90px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.obj-main-row .ratio-row {
  flex: 1;
  min-width: 0;
  gap: 6px;
}

.obj-sizes { display: flex; gap: 3px; }

.obj-size-btn {
  padding: 3px 8px;
  border: 1.5px solid #E5E7EB;
  background: #FFFFFF;
  color: #374151;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s;
  touch-action: manipulation;
}
.obj-size-btn.active                        { background: #16A34A; color: #FFFFFF; border-color: #16A34A; }
.obj-size-btn:hover:not(.active):not(:disabled) { border-color: #16A34A; color: #16A34A; background: #F0FDF4; }
.obj-size-btn:disabled                      { opacity: 0.35; cursor: default; }

/* ── 比率スライダー ── */
.ratio-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.ratio-slider { flex: 1; min-width: 0; accent-color: #16A34A; cursor: pointer; }
.ratio-slider:disabled { opacity: 0.3; cursor: default; }
.ratio-val {
  font-size: 15px;
  color: #374151;
  font-family: sans-serif;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.ratio-val-zero { color: #D1D5DB; font-weight: 400; }

/* ── 資材情報行（タグ + サイズ選択 + 粒径） ── */
.obj-size-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.obj-size-row .obj-sizes {
  flex-shrink: 0;
}

.size-grain-info {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.size-grain-dot {
  border-radius: 50%;
  background: #9CA3AF;
  flex-shrink: 0;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}

.size-grain-label {
  font-size: 11px;
  color: #111827;
  font-family: sans-serif;
  font-weight: 700;
}

.size-grain-hint {
  font-size: 9px;
  color: #B0BAC8;
  font-family: sans-serif;
}

/* ── プリセット帯 ── */
#preset-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#preset-bar[hidden] { display: none; }

.preset-label {
  font-size: 11px;
  font-weight: 700;
  color: #9CA3AF;
  font-family: sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.preset-btns {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.preset-btn {
  height: 30px;
  padding: 0 12px;
  border: 1.5px solid #E5E7EB;
  border-radius: 9999px;
  background: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  color: #6B7280;
  font-family: sans-serif;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
  white-space: nowrap;
  touch-action: manipulation;
}
.preset-btn:hover { background: #F9FAFB; color: #374151; border-color: #D1D5DB; }
.preset-btn.active {
  background: #EFF6FF;
  border-color: #93C5FD;
  color: #1D4ED8;
  font-weight: 600;
}

/* ── 資材タグ ── */
.mat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.mat-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  font-family: sans-serif;
  padding: 1px 5px;
  border-radius: 9999px;
  line-height: 1.6;
}
.mat-tag[data-tag="有機"]     { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.mat-tag[data-tag="無機"]     { background: #F1F5F9; color: #334155; border: 1px solid #CBD5E1; }
.mat-tag[data-tag="排水"]     { background: #DBEAFE; color: #1D4ED8; border: 1px solid #93C5FD; }
.mat-tag[data-tag="通気"]     { background: #F0F9FF; color: #0369A1; border: 1px solid #BAE6FD; }
.mat-tag[data-tag="保水"]     { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.mat-tag[data-tag="保肥"]     { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.mat-tag[data-tag="バランス"] { background: #F3F4F6; color: #6B7280; border: 1px solid #E5E7EB; }
