/* Material edit panel */
#materialEditPanel .group-content {
  gap: 0.45rem;
  padding: 0.62rem;
}

#materialEditPanel .material-current-card {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  border-radius: 15px;
}

#materialEditPanel .material-current-top {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 0.58rem;
  align-items: stretch;
}

#materialEditPanel .material-current-preview-wrap {
  position: relative;
  width: 98px;
  min-width: 98px;
  height: 98px;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #000;
}

#materialEditPanel .material-current-preview {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

#materialEditPanel .material-current-summary {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 5px 0px;
}

#materialEditPanel .material-current-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

#materialEditPanel .material-current-head .label {
  padding: 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

#materialEditPanel .material-current-type {
  font-size: 0.68rem;
  line-height: 1;
  padding: 0.2rem 0.38rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.32);
  color: rgba(255, 255, 255, 0.92);
  font-variant-numeric: tabular-nums;
}

#materialEditPanel .material-current-name {
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
}

#materialEditPanel .material-current-meta {
  font-size: 0.71rem;
  color: rgba(255, 255, 255, 0.74);
}

#materialEditPanel .material-current-maps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.36rem;
}

#materialEditPanel .material-current-map {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.42rem;
  min-height: 28px;
  padding: 8px;
  border-radius: 7px;
  background: rgb(0 0 0 / 50%);
  min-width: 0;
}

#materialEditPanel .material-current-map.is-disabled {
  opacity: 0.74;
  border-style: dashed;
}

#materialEditPanel .material-current-map-thumb {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

#materialEditPanel .material-current-map-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#materialEditPanel .material-current-map-label {
  font-size: 0.72rem;
  font-weight: 550;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materialEditPanel .material-current-map-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#materialEditPanel .material-current-map-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #8dd4ff;
  cursor: pointer;
}

#materialEditPanel .material-current-maps-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0.2rem 0.35rem;
  border-radius: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.69rem;
}

#materialEditPanel .info-row {
  gap: 0.28rem;
}

#materialEditPanel .info-row.edit-row {
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
}

#materialEditPanel .info-row .label {
  font-size: 0.82rem;
  opacity: 1;
  padding-left: 0;
  padding-bottom: 2px;
}

#materialEditPanel .material-edit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.81rem;
  color: var(--text);
}

#materialEditPanel .material-edit-value {
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.9;
  font-variant-numeric: tabular-nums;
  padding: 0.2rem 0.38rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

#materialEditPanel .fields.inline {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.35rem;
  align-items: center;
}

#materialEditPanel .fields.inline.material-bloom-fields {
  grid-template-columns: auto 1fr;
}

#materialEditPanel .fields.fields-uv {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

#materialEditPanel .material-bloom-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.45rem;
  min-height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.36);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.72rem;
  white-space: nowrap;
}

#materialEditPanel .material-bloom-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #8dd4ff;
}

#materialEditPanel .material-edit-row input[type="range"] {
  width: 100%;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 0px solid transparent;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#materialEditPanel .material-edit-row input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

#materialEditPanel .material-edit-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgb(39, 88, 208);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

#materialEditPanel .material-edit-row input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
}

#materialEditPanel .material-edit-row input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgb(39, 88, 208);
}

#materialEditPanel .material-edit-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgb(39, 88, 208);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

#materialEditPanel .material-edit-row input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#materialEditPanel .material-edit-row input[type="color"] {
  height: 28px;
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.42);
}

#materialEditPanel #materialEditUvScaleX,
#materialEditPanel #materialEditUvScaleY {
  min-height: 30px;
  padding: 0.3rem 0.42rem;
  border-radius: 8px;
  font-size: 0.82rem;
  border: 1px solid;
  border-color: rgba(255, 255, 255, 0.18);
}

#materialEditPanel .actions.wide {
  gap: 0.5rem;
}

#materialEditPanel #materialEditReset {
  min-height: 32px;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

/* Material library standalone panel */
.material-library-standalone {
  height: 100%;
  overflow: hidden;
}

.material-library-standalone .material-library-layout {
  height: 100%;
}

.material-library-standalone .material-library-grid {
  max-height: 100%;
  overflow-y: auto;
  padding: 10px 0px 10px 0px;
}

/* Material library panel shell */
#materialLibraryPanel {
  grid-column: span 1;
  min-width: 0;
  width: 100%;
}

/* Material variant panel actions */
#materialVariantsPanel .actions {
  flex-wrap: nowrap;
}

#materialVariantsPanel .actions button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* Material variant modals */
/* Variant modal styling */
#variantModal .modal {
  width: min(520px, 100%);
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#variantModal .modal-header {
  margin: 0;
  padding: 1rem;
  background: var(--canvas-button-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

#variantModal .modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgb(255, 255, 255);
}

#variantModal .modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.5);
  color: rgb(255, 255, 255);
}

#variantModal .modal-close:hover {
  background: var(--canvas-button-bg-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

#variantModal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
  background: var(--canvas-button-bg);
}

#variantModal .form-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
}

#variantModal label {
  opacity: 0.5;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgb(255, 255, 255);
  padding-left: 5px;
}

#variantModal input[type="text"],
#variantModal input[type="color"],
#variantModal input[type="file"] {
  width: 100%;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: rgb(255, 255, 255);
  font-size: 0.9rem;
}

#variantModal input[type="text"] {
  height: 40px;
  padding: 0 10px;
  font-weight: 600;
}

#variantModal input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

#variantModal input[type="text"]:focus-visible,
#variantModal input[type="color"]:focus-visible,
#variantModal input[type="file"]:focus-visible {
  outline: none;
}

#variantModal input[type="color"] {
  padding: 0.22rem;
  height: 42px;
  cursor: pointer;
}

#variantModal input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

#variantModal input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

#variantModal input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 6px;
}

#variantModal input[type="file"] {
  padding: 10px;
}

#variantModal input[type="file"]::file-selector-button {
  margin-right: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.45);
  color: rgb(255, 255, 255);
  border-radius: 25px;
  padding: 0.36rem 0.7rem;
  cursor: pointer;
}

#variantThumbPreview {
  margin-top: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  overflow: hidden;
  max-width: 220px;
}

#variantThumbPreview img {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  display: block;
}

#variantModal .modal-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 0;
  padding: 0 0.75rem 0.75rem;
  background: var(--canvas-button-bg);
}

#variantModal .modal-footer button {
  flex: 1 1 0;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.5);
  color: rgb(255, 255, 255);
  font-size: 0.9rem;
}

#variantModal .modal-footer button:hover,
#variantModal .modal-footer button:focus-visible {
  background: var(--canvas-button-bg-hover);
  border-color: rgba(255, 255, 255, 0.22);
  outline: none;
}

#variantModal #saveVariantModal {
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.22);
}

/* Update model / keep variants prompt */
#updateVariantPrompt .modal {
  width: min(420px, 100%);
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

#updateVariantPrompt .modal-header {
  margin: 0;
  padding: 1rem;
  background: var(--canvas-button-bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}

#updateVariantPrompt .modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: rgb(255, 255, 255);
}

#updateVariantPrompt .modal-body {
  padding: 0.75rem;
  background: var(--canvas-button-bg);
}

#updateVariantPrompt .modal-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

#updateVariantPrompt .modal-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 0;
  padding: 0 0.75rem 0.75rem;
  background: var(--canvas-button-bg);
}

#updateVariantPrompt .modal-footer button {
  flex: 1 1 0;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.5);
  color: rgb(255, 255, 255);
  font-size: 0.9rem;
  font-weight: 600;
}

#updateVariantPrompt .modal-footer button:hover,
#updateVariantPrompt .modal-footer button:focus-visible {
  background: var(--canvas-button-bg-hover);
  border-color: rgba(255, 255, 255, 0.22);
  outline: none;
}

#updateVariantPrompt #keepUpdateVariant {
  border-color: rgba(255, 255, 255, 0.24);
}

/* Material variants */
.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 0.5rem;
}

.variant-thumb {
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  cursor: pointer;
}

.variant-thumb img {
  width: 100%;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.variant-thumb label {
  font-size: 0.8rem;
  text-align: center;
  opacity: 0.8;
  color: rgb(255, 255, 255);
}

.variant-thumb.active {
  background-color: rgba(0, 0, 0, 0.5);
}

.variant-thumb:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* Material readonly variant state */
/* Allow selecting variants even when the group is locked/read-only. */
.group.readonly .variant-thumb {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

/* Material library */
.material-library-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.filter-column {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 200px;
  max-height: 100%;
  min-height: 0;
}

.filter-column-materials {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 100%;
  min-height: 0;
}

.filter-title {
  margin: 10px 0 0.35rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  padding: 10px 0px 10px 0px;
}

.filter-btn {
  width: 100%;
  text-align: left;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--group);
  color: black;
}

.filter-btn.active {
  background-color: rgb(150 150 94);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.material-library-layout .material-library-grid {
  margin-top: 0;
}

.material-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 200px));
  justify-content: start;
  align-content: start;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.material-library-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
}

.material-library-filter-row {
  margin-bottom: 0.1rem;
}

.material-library-filter-row[hidden] {
  display: none !important;
}

.material-library-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.material-library-tab {
  min-height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}

.material-library-tab + .material-library-tab {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.material-library-tab:hover,
.material-library-tab:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: rgb(255, 255, 255);
  outline: none;
}

.material-library-tab.is-active {
  background: var(--canvas-button-bg-active);
  color: rgb(255, 255, 255);
}

.material-custom-add-btn {
  width: 100%;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.5);
  color: rgb(255, 255, 255);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.material-custom-add-btn:hover:not(:disabled),
.material-custom-add-btn:focus-visible {
  background: var(--canvas-button-bg-hover);
  border-color: rgba(255, 255, 255, 0.28);
  outline: none;
}

.material-custom-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.group-actions .material-custom-add-btn {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
}

.material-library-sidebar #materialLibraryFilters {
  width: 100%;
}

.material-library-grid-compact {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.45rem;
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 0.65rem;
  padding-top: 0.65rem;
}

.material-library-grid-compact .material-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center;
  max-width: none;
  padding: 0.45rem 0.52rem;
  gap: 0.58rem;
  border-radius: 15px;
  background: rgb(38, 38, 38);
}

.material-library-grid-compact .material-card-swatch {
  position: relative;
  width: 76px;
  min-width: 76px;
  min-height: 76px;
  height: 76px;
  aspect-ratio: 1 / 1;
  border-radius: 15px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgb(0 0 0 / 50%);
  overflow: hidden;
}

.material-library-grid-compact .material-card-swatch::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background-color: var(--swatch-color, #94a3b8);
  background-image: var(--material-thumb-image, none);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.material-library-grid-compact .material-card-swatch::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.12) 25%, rgba(255, 255, 255, 0) 52%), radial-gradient(circle at 70% 76%, rgba(0, 0, 0, 0.35) 6%, rgba(0, 0, 0, 0) 50%);
  pointer-events: none;
}

.material-library-grid-compact .material-card-text {
  align-self: center;
  gap: 0.2rem;
}

.material-library-grid-compact .material-card-title {
  font-size: 0.78rem;
  line-height: 1.22;
}

.material-library-grid-compact .material-card-ral-code {
  font-size: 0.72rem;
}

.material-library-grid-compact .material-card-ral-name {
  font-size: 0.67rem;
}

.material-library-grid-compact .material-card-meta {
  font-size: 0.66rem;
  opacity: 0.74;
  line-height: 1.2;
  color: white;
}

.material-library-grid-compact .material-card-actions {
  width: 72px;
  min-width: 72px;
  grid-template-columns: 1fr;
  gap: 0.28rem;
}

.material-library-grid-compact .material-card-apply,
.material-library-grid-compact .material-card-remove {
  height: 26px;
  border-radius: 6px;
  font-size: 0.63rem;
  padding: 0.2rem 0.34rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

#materialBrowserPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#materialBrowserPanel:not(.collapsed) {
  min-height: 500px;
}

#materialBrowserPanel.collapsed {
  height: auto;
  flex: 0 0 auto;
}

#materialBrowserPanel .group-content.material-library-sidebar {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0px;
  gap: 0px;
}

#materialBrowserPanel .material-library-tabs {
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
}

#materialBrowserPanel.collapsed .material-library-tabs {
  display: none;
}

@media (max-width: 900px) {
  .material-library-layout {
    grid-template-columns: 1fr;
  }
  .filter-column {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .filter-btn {
    flex: 1 1 45%;
    min-width: 140px;
  }
  .panel-header-row {
    padding: 1rem;
  }
}

/* Material cards and modals */
.material-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 15px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  max-width: 200px;
}

.material-card.active {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.material-card:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.material-card-swatch {
  width: 100%;
  min-height: 112px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: var(--swatch-color, #94a3b8);
  background-image: var(--material-thumb-image, none);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.material-card-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.material-card-title {
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgb(255, 255, 255);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.material-card-ral-code {
  display: block;
  font-weight: 600;
  line-height: 1.1;
}

.material-card-ral-name {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  line-height: 1.1;
}

.material-card-meta {
  font-size: 0.78rem;
  opacity: 0.8;
}

.material-card-actions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 0.4rem;
  width: 100%;
}

.material-card-apply,
.material-card-remove {
  width: 100%;
  padding: 0.3rem 0.6rem;
  height: 32px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: rgb(255, 255, 255);
  font-size: 0.75rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.material-card-remove:hover,
.material-card-remove:focus-visible {
  border-color: var(--text);
  outline: none;
}

.material-card-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.material-card-apply:hover:not(:disabled),
.material-card-apply:focus-visible {
  border-color: var(--text);

  outline: none;
}

.material-card-apply:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.material-library-empty {
  padding: 0.8rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.82rem;
  text-align: center;
}

#customMaterialModal.modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

#customMaterialModal .modal {
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 24px));
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgb(30, 30, 30);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

#customMaterialModal .modal-header {
  flex: 0 0 auto;
  min-height: 58px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgb(30, 30, 30);
}

#customMaterialModal .modal-header h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  color: rgba(248, 250, 255, 0.98);
}

#customMaterialModal .business-modal-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 0;
  border-radius: 999px;
  background: rgb(38, 38, 38);
  color: rgb(255, 255, 255);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

#customMaterialModal .business-modal-close:hover,
#customMaterialModal .business-modal-close:focus-visible {
  background: rgb(48, 48, 48);
  outline: none;
}

#customMaterialModal .modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: rgb(30, 30, 30);
  scrollbar-width: none;
}

#customMaterialModal .modal-body::-webkit-scrollbar {
  display: none;
}

.custom-material-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  min-height: 0;
}

.custom-material-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.custom-material-preview-panel {
  align-items: center;
  align-self: start;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  padding: 18px;
  position: sticky;
  top: 0;
}

.custom-material-preview-heading {
  align-items: center;
  color: rgba(186, 194, 205, 0.9);
  display: flex;
  font-size: 12px;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 18px;
  width: 100%;
}

.custom-material-preview-swatch {
  --preview-shine-opacity: 0.58;
  --preview-shadow-opacity: 0.38;
  --preview-sphere-opacity: 1;
  --preview-glow-size: 0px;
  --preview-emissive-color: transparent;
  aspect-ratio: 1 / 1;
  background-color: var(--swatch-color, #94a3b8);
  background-image: var(--material-thumb-image, none);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow:
    inset -28px -34px 44px rgba(0, 0, 0, var(--preview-shadow-opacity)),
    inset 18px 16px 28px rgba(255, 255, 255, 0.1),
    0 0 var(--preview-glow-size) var(--preview-emissive-color);
  display: block;
  max-width: 230px;
  min-height: 0;
  opacity: var(--preview-sphere-opacity);
  overflow: hidden;
  position: relative;
  width: min(230px, 100%);
}

.custom-material-preview-swatch::before {
  background: radial-gradient(circle at 29% 23%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 18%, rgba(255, 255, 255, 0) 45%), radial-gradient(circle at 66% 74%, rgba(0, 0, 0, 0.35) 6%, rgba(0, 0, 0, 0) 48%);
  border-radius: inherit;
  content: "";
  inset: 0;
  opacity: var(--preview-shine-opacity);
  pointer-events: none;
  position: absolute;
}

.custom-material-preview-swatch::after {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 56%, rgba(0, 0, 0, 0.38) 100%);
  border-radius: inherit;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.custom-material-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.custom-material-grid {
  display: grid;
  gap: 10px 12px;
}

.custom-material-grid-primary {
  grid-template-columns: minmax(0, 2fr) minmax(150px, 1fr);
}

.custom-material-grid-controls {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(96px, 0.7fr);
}

.custom-material-grid-ranges {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.custom-material-form .form-row {
  display: grid;
  margin: 0;
  gap: 6px;
  min-width: 0;
}

.custom-material-form label {
  color: rgba(205, 214, 226, 0.92);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

.custom-material-form input[type="text"],
.custom-material-form input[type="number"],
.custom-material-form select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgb(38, 38, 38);
  color: rgba(245, 247, 250, 0.96);
  padding: 8px 10px;
  font-size: 12px;
}

.custom-material-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  padding-right: 36px;
}

.custom-material-form select::-ms-expand {
  display: none;
}

.custom-material-form input[type="text"]:focus,
.custom-material-form input[type="number"]:focus,
.custom-material-form select:focus {
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}

.custom-material-form input[type="color"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgb(38, 38, 38);
  padding: 4px;
}

.custom-material-form input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.custom-material-form input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}

.custom-material-form input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}

.custom-material-form input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 100%;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

.custom-material-form input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.custom-material-form input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgb(39, 88, 208);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

.custom-material-form input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.custom-material-form input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgb(39, 88, 208);
}

.custom-material-form input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgb(39, 88, 208);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

.custom-material-map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.custom-material-map-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin: 0;
  padding: 8px 8px 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgb(38, 38, 38);
  cursor: pointer;
}

.custom-material-map-field:hover,
.custom-material-map-field:focus-within {
  border-color: rgba(39, 88, 208, 0.72);
  background: rgb(42, 42, 42);
}

.custom-material-map-field > span:first-child {
  color: rgba(245, 248, 255, 0.95);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-material-form input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.custom-material-file-action {
  justify-self: end;
  min-width: 72px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: rgb(255, 255, 255);
  border-radius: 999px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.custom-material-map-field[data-file-set] .custom-material-file-action {
  background: rgb(39, 88, 208);
  color: rgb(255, 255, 255);
}

.custom-material-map-field[data-file-set] {
  border-color: rgba(39, 88, 208, 0.72);
}

.custom-material-status {
  min-height: 16px;
  color: rgba(186, 194, 205, 0.92);
  font-size: 12px;
  line-height: 1.25;
}

.custom-material-status[data-tone="error"] {
  color: #ff9e9e;
}

#customMaterialModal .modal-actions {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding-top: 0;
}

#customMaterialModal .modal-actions button {
  min-width: 96px;
  min-height: 38px;
  border-radius: 999px;
  border: 0;
  background: rgb(38, 38, 38);
  color: rgb(255, 255, 255);
  font-size: 12px;
  font-weight: 700;
  padding: 0 16px;
}

#customMaterialModal .modal-actions button:hover,
#customMaterialModal .modal-actions button:focus-visible {
  background: rgb(44, 44, 44);
  outline: none;
}

#customMaterialModal .modal-actions .primary {
  background: rgb(39, 88, 208);
  color: rgb(255, 255, 255);
}

#customMaterialModal .modal-actions .primary:hover,
#customMaterialModal .modal-actions .primary:focus-visible {
  background: rgb(35, 79, 192);
}

@media (max-width: 700px) {
  .custom-material-layout {
    grid-template-columns: 1fr;
  }

  .custom-material-preview-panel {
    min-height: 260px;
    position: static;
  }

  .custom-material-preview-swatch {
    width: min(190px, 100%);
  }

  .custom-material-grid-primary,
  .custom-material-grid-controls,
  .custom-material-grid-ranges,
  .custom-material-map-grid {
    grid-template-columns: 1fr;
  }

  .custom-material-map-field {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

#materialInfoModal.modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  z-index: 1300;
}

#materialInfoModal .modal {
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 24px));
  max-height: min(820px, calc(100dvh - 32px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgb(30, 30, 30);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

#materialInfoModal .modal-header {
  flex: 0 0 auto;
  align-items: center;
  min-height: 58px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgb(30, 30, 30);
}

#materialInfoModal #materialInfoTitle {
  margin: 0;
  color: rgba(248, 250, 255, 0.98);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

#materialInfoModal .business-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgb(38, 38, 38);
  color: rgb(255, 255, 255);
  cursor: pointer;
  transition: background 0.16s ease;
}

#materialInfoModal .business-modal-close:hover,
#materialInfoModal .business-modal-close:focus-visible {
  background: rgb(48, 48, 48);
  outline: none;
}

#materialInfoModal .material-info-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  background: rgb(30, 30, 30);
  scrollbar-width: none;
}

#materialInfoModal .material-info-body::-webkit-scrollbar {
  display: none;
}

#materialInfoModal .material-info-body .muted[hidden] {
  display: none;
}

#materialInfoModal .material-info-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  margin: 0;
  word-break: break-word;
}

#materialInfoModal .material-info-detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 14px;
}

#materialInfoModal .material-info-preview-panel,
#materialInfoModal .material-info-map-panel,
#materialInfoModal .material-info-form-grid {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

#materialInfoModal .material-info-preview-panel {
  display: flex;
  align-items: center;
  align-self: start;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  padding: 18px;
  position: sticky;
  top: 0;
}

#materialInfoModal .material-info-preview-swatch {
  aspect-ratio: 1 / 1;
  width: min(230px, 100%);
  max-width: 230px;
  min-height: 0;
  display: block;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background-color: var(--swatch-color, #94a3b8);
  background-image: var(--material-thumb-image, none);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow:
    inset -28px -34px 44px rgba(0, 0, 0, var(--preview-shadow-opacity, 0.35)),
    inset 18px 16px 28px rgba(255, 255, 255, 0.1),
    0 0 var(--preview-glow-size, 0px) var(--preview-emissive-color, transparent);
  opacity: var(--preview-sphere-opacity, 1);
}

#materialInfoModal .material-info-preview-swatch::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 29% 23%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 18%, rgba(255, 255, 255, 0) 45%), radial-gradient(circle at 66% 74%, rgba(0, 0, 0, 0.35) 6%, rgba(0, 0, 0, 0) 48%);
  opacity: var(--preview-shine-opacity, 0.55);
  pointer-events: none;
}

#materialInfoModal .material-info-preview-swatch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 56%, rgba(0, 0, 0, 0.38) 100%);
  pointer-events: none;
}

#materialInfoModal .material-info-preview-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 16px;
  color: rgba(186, 194, 205, 0.9);
  font-size: 12px;
}

#materialInfoModal .material-info-preview-meta span:not(:last-child)::after {
  content: "/";
  margin-left: 10px;
  color: rgba(186, 194, 205, 0.5);
}

#materialInfoModal .material-info-map-panel,
#materialInfoModal .material-info-form-grid {
  padding: 12px;
}

#materialInfoModal .material-info-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#materialInfoModal .material-info-map-tile {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 68px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgb(38, 38, 38);
}

#materialInfoModal .material-info-map-tile.has-map,
#materialInfoModal .material-info-map-tile.has-pending-map {
  border-color: rgba(39, 88, 208, 0.72);
}

#materialInfoModal .material-info-map-thumb {
  align-self: center;
  aspect-ratio: 1 / 1;
  width: 52px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgb(30, 30, 30);
}

#materialInfoModal .material-info-map-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#materialInfoModal .material-info-map-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 25%, transparent 25%) 0 0 / 10px 10px,
    linear-gradient(135deg, transparent 75%, rgba(255, 255, 255, 0.08) 75%) 0 0 / 10px 10px,
    rgb(34, 34, 34);
}

#materialInfoModal .material-info-map-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

#materialInfoModal .material-info-map-info span {
  overflow: hidden;
  color: rgba(245, 248, 255, 0.95);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materialInfoModal .material-info-map-info small {
  margin-top: 5px;
  color: rgba(186, 194, 205, 0.72);
  font-size: 11px;
  line-height: 1.25;
}

#materialInfoModal .material-info-map-action {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 24px;
  margin-top: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 248, 255, 0.95);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

#materialInfoModal .material-info-map-tile.has-pending-map .material-info-map-action {
  background: rgb(39, 88, 208);
  color: rgb(255, 255, 255);
}

#materialInfoModal .material-info-map-action input {
  display: none;
}

#materialInfoModal .material-info-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 12px;
}

#materialInfoModal .material-info-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

#materialInfoModal .material-info-field-wide {
  grid-column: 1 / -1;
}

#materialInfoModal .material-info-label {
  color: rgba(205, 214, 226, 0.92);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
}

#materialInfoModal .material-info-value,
#materialInfoModal .material-info-field input,
#materialInfoModal .material-info-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgb(38, 38, 38);
  color: rgba(245, 247, 250, 0.96);
  font-size: 12px;
}

#materialInfoModal .material-info-value {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 8px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materialInfoModal .material-info-field input,
#materialInfoModal .material-info-field select {
  padding: 8px 10px;
}

#materialInfoModal .material-info-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23FFFFFF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 12px 8px;
  padding-right: 36px;
}

#materialInfoModal .material-info-field select::-ms-expand {
  display: none;
}

#materialInfoModal .material-info-field input[type="color"] {
  padding: 4px;
}

#materialInfoModal .material-info-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

#materialInfoModal .material-info-field input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 5px;
}

#materialInfoModal .material-info-field input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 5px;
}

#materialInfoModal .material-info-field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 18px;
  min-height: 18px;
  padding: 0;
}

#materialInfoModal .material-info-field input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

#materialInfoModal .material-info-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgb(39, 88, 208);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

#materialInfoModal .material-info-field input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

#materialInfoModal .material-info-field input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: rgb(39, 88, 208);
}

#materialInfoModal .material-info-field input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgb(39, 88, 208);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
}

#materialInfoModal .material-info-field input:focus,
#materialInfoModal .material-info-field select:focus {
  border-color: rgba(255, 255, 255, 0.32);
  outline: none;
}

#materialInfoModal .material-info-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgb(30, 30, 30);
}

#materialInfoModal .material-info-footer-left,
#materialInfoModal .material-info-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#materialInfoModal .material-info-status {
  min-height: 16px;
  overflow: hidden;
  color: rgba(186, 194, 205, 0.92);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#materialInfoModal .material-info-status[data-tone="error"] {
  color: #ff9b9b;
}

#materialInfoModal .material-info-status[data-tone="success"] {
  color: #9be7b0;
}

#materialInfoModal .material-info-primary,
#materialInfoModal .material-info-secondary,
#materialInfoModal .material-info-danger {
  min-width: 96px;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: rgb(255, 255, 255);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition:
    background 0.16s ease,
    opacity 0.16s ease;
}

#materialInfoModal .material-info-primary {
  background: rgb(39, 88, 208);
}

#materialInfoModal .material-info-primary:hover,
#materialInfoModal .material-info-primary:focus-visible {
  background: rgb(35, 79, 192);
  outline: none;
}

#materialInfoModal .material-info-secondary {
  background: rgb(38, 38, 38);
}

#materialInfoModal .material-info-secondary:hover,
#materialInfoModal .material-info-secondary:focus-visible {
  background: rgb(44, 44, 44);
  outline: none;
}

#materialInfoModal .material-info-danger {
  background: rgb(38, 38, 38);
  color: rgb(255, 212, 212);
}

#materialInfoModal .material-info-danger:hover,
#materialInfoModal .material-info-danger:focus-visible {
  background: rgba(75, 20, 20, 0.8);
  outline: none;
}

#materialInfoModal .material-info-primary:disabled,
#materialInfoModal .material-info-secondary:disabled,
#materialInfoModal .material-info-danger:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 900px) {
  #materialInfoModal .material-info-detail-layout,
  #materialInfoModal .material-info-form-grid {
    grid-template-columns: 1fr;
  }

  #materialInfoModal .material-info-preview-panel {
    min-height: 260px;
    position: static;
  }

  #materialInfoModal .material-info-preview-swatch {
    max-width: 220px;
    width: min(220px, 100%);
  }
}

@media (max-width: 640px) {
  #materialInfoModal.modal-backdrop {
    padding: 12px;
  }

  #materialInfoModal .modal {
    max-height: 92vh;
  }

  #materialInfoModal .material-info-body {
    padding: 12px;
  }

  #materialInfoModal .material-info-map-grid {
    grid-template-columns: 1fr;
  }
}

/* Material info modal platform styling */
#materialInfoModal.modal-backdrop {
  background: rgba(0, 0, 0, 0.62);
}

#materialInfoModal .modal {
  width: min(820px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  background: rgb(30, 30, 30);
  border: 0;
  border-radius: 15px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  color: rgb(255, 255, 255);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

#materialInfoModal .modal-header {
  min-height: 0;
  margin: 0;
  padding: 14px 16px;
  background: rgb(30, 30, 30);
  border-bottom: 1px solid rgb(38, 38, 38);
}

#materialInfoModal #materialInfoTitle {
  color: rgb(255, 255, 255);
  font-size: 1rem;
  font-weight: 600;
}

#materialInfoModal .business-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  background: rgb(30, 30, 30);
  border: 0;
  border-radius: 999px;
  color: rgb(255, 255, 255);
  line-height: 0;
}

#materialInfoModal .business-modal-close svg {
  display: block;
  width: 18px;
  height: 18px;
}

#materialInfoModal .business-modal-close:hover,
#materialInfoModal .business-modal-close:focus-visible {
  background: rgb(38, 38, 38);
  border: 0;
  outline: none;
}

#materialInfoModal .material-info-body {
  padding: 16px;
  background: rgb(30, 30, 30);
}

#materialInfoModal .material-info-grid {
  gap: 10px;
}

#materialInfoModal .material-info-detail-layout {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 10px;
}

#materialInfoModal .material-info-preview-panel,
#materialInfoModal .material-info-map-panel,
#materialInfoModal .material-info-form-grid {
  background: rgb(30, 30, 30);
  border: 0;
  border-radius: 12px;
}

#materialInfoModal .material-info-preview-panel {
  min-height: 0;
  padding: 0 0 6px;
  position: static;
}

#materialInfoModal .material-info-preview-swatch {
  width: min(170px, 100%);
  max-width: 170px;
  border-color: rgba(255, 255, 255, 0.12);
}

#materialInfoModal .material-info-preview-meta {
  color: rgba(255, 255, 255, 0.58);
}

#materialInfoModal .material-info-map-panel,
#materialInfoModal .material-info-form-grid {
  padding: 0;
}

#materialInfoModal .material-info-map-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#materialInfoModal .material-info-map-tile {
  min-height: 62px;
  background: rgb(38, 38, 38);
  border: 0;
  border-radius: 10px;
}

#materialInfoModal .material-info-map-thumb {
  background: rgb(30, 30, 30);
  border: 0;
  border-radius: 8px;
}

#materialInfoModal .material-info-map-info span {
  color: rgb(255, 255, 255);
  font-weight: 600;
}

#materialInfoModal .material-info-map-info small,
#materialInfoModal .material-info-label {
  color: rgba(255, 255, 255, 0.58);
  opacity: 1;
}

#materialInfoModal .material-info-map-action {
  background: rgb(30, 30, 30);
  border: 0;
  border-radius: 999px;
  color: rgb(255, 255, 255);
  box-shadow: none;
}

#materialInfoModal .material-info-map-action:hover,
#materialInfoModal .material-info-map-action:focus-visible {
  background: rgb(38, 38, 38);
  outline: none;
}

#materialInfoModal .material-info-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#materialInfoModal .material-info-field {
  gap: 6px;
}

#materialInfoModal .material-info-value,
#materialInfoModal .material-info-field input,
#materialInfoModal .material-info-field select {
  min-height: 40px;
  background: rgb(38, 38, 38);
  border: 0;
  border-radius: 10px;
  color: rgb(255, 255, 255);
  font-size: 0.9rem;
}

#materialInfoModal .material-info-field input:focus,
#materialInfoModal .material-info-field select:focus {
  background: rgb(38, 38, 38);
  border-color: rgb(54, 54, 54);
  outline: none;
}

#materialInfoModal .material-info-footer {
  min-height: 0;
  padding: 16px;
  background: rgb(30, 30, 30);
  border-top: 1px solid rgb(38, 38, 38);
}

#materialInfoModal .material-info-status {
  color: rgba(255, 255, 255, 0.58);
}

#materialInfoModal .material-info-primary,
#materialInfoModal .material-info-secondary,
#materialInfoModal .material-info-danger {
  min-height: 36px;
  background: rgb(30, 30, 30);
  border: 0;
  border-radius: 999px;
  color: rgb(255, 255, 255);
  box-shadow: none;
  font-size: 0.9rem;
}

#materialInfoModal .material-info-primary {
  background: rgb(39, 88, 208);
  font-weight: 600;
}

#materialInfoModal .material-info-primary:hover,
#materialInfoModal .material-info-primary:focus-visible {
  background: rgb(35, 79, 192);
}

#materialInfoModal .material-info-secondary:hover,
#materialInfoModal .material-info-secondary:focus-visible,
#materialInfoModal .material-info-danger:hover,
#materialInfoModal .material-info-danger:focus-visible {
  background: rgb(38, 38, 38);
  border: 0;
  outline: none;
}

#materialInfoModal .material-info-danger {
  color: rgb(255, 212, 212);
}

@media (max-width: 640px) {
  #materialInfoModal .material-info-detail-layout,
  #materialInfoModal .material-info-map-grid {
    grid-template-columns: 1fr;
  }

  #materialInfoModal .material-info-form-grid {
    grid-template-columns: 1fr;
  }

  #materialInfoModal .material-info-footer {
    align-items: stretch;
    flex-direction: column;
  }

  #materialInfoModal .material-info-footer-left,
  #materialInfoModal .material-info-actions {
    width: 100%;
  }

  #materialInfoModal .material-info-actions button {
    flex: 1 1 0;
  }
}
