/* css/sidebar-left.css  —  왼쪽 사이드바: 모듈 카드 · 벽 크기 · 카테고리 구분 · 색상 스와치 · 프리셋 카드
   로드 순서 2/5: 캐스케이드(나중 규칙이 이긴다)가 원래 순서에 의존하므로 index.html 의 <link> 순서를 바꾸지 않는다. */

/* ── Left Sidebar ── */
#left {
  background: var(--white); border-right: 1px solid var(--border);
  overflow-y: auto; display: flex; flex-direction: column;
}
#left::-webkit-scrollbar { width: 2px; }
#left::-webkit-scrollbar-thumb { background: var(--border); }

.sec { padding: 11px 14px; border-bottom: 1px solid var(--border); }
.sec:last-child { border-bottom: none; flex: 1; }

.sec-label {
  font-size: 10px; letter-spacing: .20em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.sec-label::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Module cards */
.mod-list { display: flex; flex-direction: column; gap: 2px; }

.mod-card {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 8px; cursor: grab;
  border: 1px solid transparent; border-radius: 2px;
  transition: background .12s, border-color .12s;
  user-select: none;
}
.mod-card:hover  { background: var(--surface); border-color: var(--border); }
.mod-card:active { cursor: grabbing; }

.mod-icon { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface); border-radius: 3px; overflow: hidden; }
.mod-icon img { width: 38px; height: 38px; object-fit: contain; display: block; }
.mod-info { flex: 1; min-width: 0; }
.mod-name { font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-dim  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.mod-price{ font-size: 11px; color: var(--muted); flex-shrink: 0; }

/* Space size inputs */
.space-row {
  display: flex; align-items: center; gap: 6px;
}
.space-inp {
  width: 56px;
  font-family: var(--font); font-size: 11px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 4px 7px; outline: none;
  -moz-appearance: textfield;
}
.space-inp::-webkit-inner-spin-button { display: none; }
.space-inp:focus { border-color: var(--border2); }
.space-unit { font-size: 11px; color: var(--muted); }
.space-sep  { font-size: 11px; color: var(--dim); }
.space-hint { font-size: 11px; color: var(--dim); margin-top: 6px; letter-spacing: .04em; }
.wall-help  { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* Category dividers inside palette */
.cat-divider {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dim); margin: 10px 0 4px;
  padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.cat-divider:first-child { margin-top: 0; }
.cat-empty {
  font-size: 11px; color: var(--dim); padding: 4px 8px 6px;
  letter-spacing: .04em;
}
.mod-card--auto {
  cursor: default; opacity: .65;
}
.mod-card--auto:hover { background: transparent; border-color: transparent; }
.auto-dim { font-size: 11px; color: var(--muted); letter-spacing: .06em;
  background: var(--surface); padding: 1px 5px; border-radius: 2px; margin-left: 3px; vertical-align: middle; }

/* Finish swatches — card style (프리셋과 동일 구조) */
.sw-group { margin-bottom: 8px; }
.sw-group:last-child { margin-bottom: 0; }
.sw-group-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 4px;
}
.sw-card-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sw-card {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
  cursor: pointer; border: 1px solid var(--border);
  font-family: var(--font); overflow: hidden;
  transition: border-color .12s;
}
.sw-card:hover { border-color: var(--border2); }
.sw-card.on { border-color: var(--accent); border-width: 2px; }
.sw-card-label {
  font-size: 11px; letter-spacing: .06em;
  color: rgba(255,255,255,0.88);
  text-align: center; line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}

/* Presets */
.preset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.preset-card {
  display: flex; flex-direction: column;
  cursor: pointer; transition: border-color .12s, background .12s;
  border: 1px solid var(--border); background: transparent;
  font-family: var(--font); padding: 0; overflow: hidden;
}
.preset-card:hover { border-color: var(--accent); background: var(--surface); }
.preset-card.active { border-color: var(--accent); border-width: 2px; }
.preset-card.active .preset-card-label { color: var(--accent); font-weight: 500; }
.preset-card-img-wrap {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: var(--surface); overflow: hidden;
}
.preset-card-svg {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center; padding: 10%;
}
.preset-card-svg svg { width: 100%; height: 100%; }
.preset-card-img-over {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; background: var(--surface);
  transition: opacity .2s;
}
/* legacy fallback */
.preset-card-img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: contain;
  background: var(--surface); display: block;
}
.preset-card-no-img {
  width: 100%; aspect-ratio: 1 / 1; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: .06em; color: var(--dim);
}
.preset-card-label {
  font-size: 11px; letter-spacing: .06em; color: var(--muted);
  text-align: center; padding: 5px 4px; line-height: 1;
}
.preset-card:hover .preset-card-label { color: var(--accent); }
