/* Custom size panel: unit switch, thickness stepper, material and size type. */
.custom-size-panel {
  margin-top: 16px;
  padding: 14px 14px 12px;
  border: 1px solid var(--ui-rule-soft, #3d444d);
  border-radius: 6px;
  background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
}
.custom-size-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.custom-size-head h2 {
  margin: 0;
  color: var(--ui-text, #e4e7ea);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .02em;
}
.unit-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--ui-rule, #484e55);
  border-radius: 999px;
  background: #151a21;
}
.unit-switch button {
  min-width: 42px;
  height: 26px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--ui-muted, #9ba2aa);
  font-size: 11px;
  cursor: pointer;
}
.unit-switch button.active {
  background: #3a332e;
  color: #e7cf9a;
}
.custom-dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.custom-dimension {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: var(--ui-muted, #9ba2aa);
  font-size: 11px;
}
.custom-input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #4d5560;
  border-radius: 4px;
  background: #12171e;
}
.custom-input-wrap:focus-within {
  border-color: var(--ui-accent, #c9a45c);
  box-shadow: 0 0 0 2px rgba(201, 164, 92, .12);
}
.custom-input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ui-text, #e4e7ea);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.custom-input-wrap em {
  flex: 0 0 auto;
  padding-left: 6px;
  color: var(--ui-subtle, #737b84);
  font-size: 11px;
  font-style: normal;
}
.custom-block { margin-top: 13px; }
.custom-block-title {
  margin-bottom: 6px;
  color: var(--ui-text, #d8dde3);
  font-size: 11px;
  font-weight: 500;
}
.custom-block-title small {
  color: var(--ui-subtle, #737b84);
  font-size: 9px;
  font-weight: 400;
}
.thickness-stepper {
  display: flex;
  align-items: center;
  height: 42px;
  overflow: hidden;
  border: 1px solid #4d5560;
  border-radius: 4px;
  background: #12171e;
}
.thickness-stepper button {
  width: 48px;
  height: 100%;
  border: 0;
  background: rgba(255, 255, 255, .045);
  color: #e7cf9a;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.thickness-stepper button:hover { background: rgba(201, 164, 92, .16); }
.thickness-stepper input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ui-text, #e4e7ea);
  font-size: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.material-field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid #4d5560;
  border-radius: 4px;
  background: #12171e;
}
.material-field:focus-within { border-color: var(--ui-accent, #c9a45c); }
.material-dot {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.material-field select {
  flex: 1;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ui-text, #e4e7ea);
  font-size: 13px;
  cursor: pointer;
}
.size-type-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.size-type-switch button {
  height: 38px;
  border: 1px solid #4d5560;
  border-radius: 4px;
  background: #161c23;
  color: var(--ui-muted, #9ba2aa);
  font-size: 12px;
  cursor: pointer;
}
.size-type-switch button:hover { border-color: #6c7480; color: #dfe5ea; }
.size-type-switch button.active {
  border-color: var(--ui-accent, #c9a45c);
  background: #2a251c;
  color: #e7cf9a;
  box-shadow: inset 0 0 0 1px rgba(201, 164, 92, .32);
}
.custom-size-hint {
  margin: 10px 0 0;
  color: var(--ui-subtle, #7f8a99);
  font-size: 10px;
  line-height: 1.6;
}
.native-dimension-fields[hidden] { display: none !important; }

@media (max-width: 520px) {
  .custom-dimension-grid { grid-template-columns: 1fr; }
  .size-type-switch { grid-template-columns: 1fr; }
}
