/* Materials and finishes by kind of goods (/materials, pages/materials.js). */
.mat-kinds {
  position: relative;
  display: flex;
  gap: 6px;
  margin: 0 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
/* The kinds stay on one line (a wrapped row left one kind alone on the second line); when they do not fit, the row scrolls sideways and the cut-off edge fades out. */
.mat-kinds.more-right {
  mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent);
}
.mat-kinds.more-left {
  mask-image: linear-gradient(90deg, transparent, #000 48px);
}
.mat-kinds.more-left.more-right {
  mask-image: linear-gradient(
    90deg,
    transparent,
    #000 48px,
    #000 calc(100% - 48px),
    transparent
  );
}
.mat-kinds::-webkit-scrollbar {
  display: none;
}
.mat-kinds a {
  flex: none;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
  color: #4a5370;
  white-space: nowrap;
}
.mat-kinds a:hover {
  border-color: #bac1ed;
}
.mat-kinds a[aria-current='page'] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.mat-kind {
  padding: 28px 32px 32px;
}
.mat-kind-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
}
.mat-kind-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
}
.mat-kind-head p {
  margin: 0;
  color: #4a5370;
  line-height: 1.7;
}
.mat-legend {
  display: grid;
  gap: 6px;
  margin: 0;
  flex: none;
  font-size: 13px;
  color: #5c6680;
}
.mat-legend div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mat-legend dt {
  width: 64px;
}
.mat-legend dd {
  margin: 0;
}
.mat-caution {
  margin: 20px 0 4px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f4f5f9;
  color: #5c6680;
  font-size: 13px;
  line-height: 1.7;
}
.mat-section {
  padding-top: 24px;
}
.mat-section + .mat-section {
  margin-top: 28px;
  border-top: 1px solid var(--line);
}
.mat-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mat-section-head h3 {
  margin: 0;
  font-size: 17px;
}
.mat-count {
  margin-left: auto;
  font-size: 13px;
  color: #8a92a8;
}
.mat-section-note {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #5c6680;
}
.mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.mat-grid > li {
  display: flex;
}
.mat-item {
  position: relative;
  display: flex;
  flex: 1;
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: inherit;
  font-weight: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.mat-item:hover {
  border-color: #bac1ed;
  background: #fff;
  box-shadow: 0 4px 14px rgba(32, 36, 55, 0.08);
}
.mat-3d {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  background: #f0f1f5;
  color: #5c6680;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.mat-item:hover .mat-3d {
  background: var(--blue);
  color: #fff;
}
.mat-swatch {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(32, 36, 55, 0.12);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6);
}
.mat-text {
  min-width: 0;
}
.mat-text strong {
  display: block;
  font-size: 14px;
  line-height: 1.5;
}
.mat-text p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: #5c6680;
}
.mat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.mat-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.mat-tag-basic {
  background: #e8f6ee;
  color: #1f7a4a;
}
.mat-tag-pro {
  background: #eceefe;
  color: #3f4bc4;
}
.mat-tag-start {
  background: #fff1dc;
  color: #94560a;
}
.mat-tag-fixed {
  background: #f0f1f5;
  color: #5c6680;
}
.mat-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
}
/* The 3D preview of one material (material-preview.js): a dark stage like the workshop's. */
.mat-preview {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #202437;
  overflow: auto;
}
.mat-preview::backdrop {
  background: rgba(16, 18, 26, 0.55);
}
.mat-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 18px 20px 12px;
}
.mat-preview-kind {
  margin: 0 0 2px;
  font-size: 12px;
  color: #5c6680;
}
.mat-preview-head h2 {
  margin: 0;
  font-size: 20px;
}
.mat-preview-close {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
}
.mat-preview-stage {
  position: relative;
  height: min(440px, 56dvh);
  background: #15171c;
}
.mat-preview-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
.mat-preview-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: #c9cede;
  font-size: 14px;
  text-align: center;
}
.mat-preview-status[hidden] {
  display: none;
}
.mat-preview-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 0;
}
.mat-preview-lights {
  display: flex;
  gap: 6px;
  margin-right: auto;
}
.mat-preview-lights:empty {
  display: none;
}
.mat-preview-tools button {
  padding: 7px 14px;
  font-size: 13px;
}
.mat-preview-reset {
  margin-left: auto;
}
.mat-preview-lights button[aria-pressed='true'] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.mat-preview-note {
  margin: 10px 20px 0;
  font-size: 13px;
  line-height: 1.7;
  color: #4a5370;
}
.mat-preview-hint {
  margin: 6px 20px 18px;
  font-size: 12px;
  color: #8a92a8;
}
@media (max-width: 760px) {
  .mat-kind {
    padding: 20px 16px 24px;
    border-radius: 18px;
  }
  .mat-kind-head {
    flex-direction: column;
    gap: 14px;
  }
  .mat-kind-head h2 {
    font-size: 20px;
  }
  .mat-grid {
    grid-template-columns: 1fr;
  }
}
/* 小口・厚みのプレビューの拡大の窓（material-preview.js が枠の中を別のカメラで描く）。 */
.mat-preview-loupe {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: min(36%, 200px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}
.mat-preview-loupe[hidden] {
  display: none;
}
.mat-preview-loupe span {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(16, 18, 26, 0.7);
  color: #fff;
  font-size: 11px;
}
