/* Nine-slice frames from the Forest Enamel handoff preserve the carved corners. */
.modal.enamel-modal {
  container-type: inline-size;
  isolation: isolate;
  width: min(382px, 100%);
  height: min(704px, 100%);
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  overflow: visible;
  color: #fff0d9;
}
.enamel-modal::before, .enamel-modal .enamel-item::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: none;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: none;
  pointer-events: none;
  border-image-repeat: stretch;
}
.enamel-modal::before {
  border-image-source: url('./assets/forest-enamel/window.webp');
  border-image-slice: 159 132 157 130 fill;
  border-image-width: 26.963cqw 22.513cqw 26.702cqw 22.251cqw;
}
.enamel-modal .modal-head.has-helper {
  position: relative;
  flex: none;
  min-height: 112px;
  height: auto;
  padding: 50px 78px 20px;
  background: none;
}
.enamel-modal .modal-title {
  margin: 0;
  font: clamp(19px, 6cqw, 25px)/1.12 var(--font-display);
  color: #fff0d9;
  text-shadow: 0 2px 2px #08141e;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.enamel-modal .modal-caption { margin-top: 7px; font-size: 12px; color: #cbdad9; }
.enamel-modal .modal-body {
  min-height: 0;
  padding: 0 max(28px, 7.5cqw) 24px;
  margin-bottom: 36px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-color: #608c7d #172c2d;
}
.enamel-modal .enamel-badge {
  top: 27px;
  left: 30px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  overflow: visible;
}
.enamel-modal .enamel-badge img { display: block; position: absolute; object-fit: contain; object-position: center; }
.enamel-modal .enamel-badge-frame { inset: 0; width: 100%; height: 100%; }
.enamel-modal .enamel-badge-icon { inset: 20%; width: 60%; height: 60%; }
.enamel-badge span {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  border: 1px solid #81aa82;
  border-radius: 50%;
  background: #163e31;
  color: #fff0d9;
  font: 800 11px/12px var(--font-body);
}
.enamel-modal .close-modal {
  display: grid;
  place-items: center;
  top: 24px;
  right: 17px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: url('./assets/forest-enamel/close.webp') center / 31px 31px no-repeat;
  color: #fff0d9;
  box-shadow: none;
  font-size: 21px;
  line-height: 1;
}
.enamel-modal .tab-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0 0 11px;
  padding: 0;
  background: none;
  border: 0;
}
.enamel-modal .tab-switch button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #cbdad9;
  box-shadow: none;
  font-size: 14px;
  font-weight: 800;
}
.enamel-modal .tab-switch button > span {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 44px;
  background: url('./assets/forest-enamel/tab-inactive.webp') center / 100% 100% no-repeat;
}
.enamel-modal .tab-switch button[aria-selected="true"] > span {
  color: #fff0d9;
  background-image: url('./assets/forest-enamel/tab-active.webp');
}
.enamel-catalog { display: grid; gap: 14px; }
.enamel-modal .mentor-intro {
  padding: 0;
  margin: 4px 6px 17px;
  border: 0;
  background: none;
  color: #cbdad9;
  font-size: 13px;
  line-height: 1.4;
}
.enamel-modal .enamel-item {
  container-type: inline-size;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 172px;
  margin: 0;
  padding: 22px 18px 23px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.enamel-modal .enamel-item::before {
  border-image-source: url('./assets/forest-enamel/item-card.webp');
  border-image-slice: 101 112 48 112 fill;
  border-image-width: 48px 53px 23px 53px;
}
.enamel-modal .enamel-item .item-art {
  display: grid;
  place-items: start center;
  grid-column: auto;
  grid-row: auto;
  width: 58px;
  height: 103px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  align-self: start;
}
.enamel-modal .enamel-item .item-art > img {
  display: block;
  width: 100%;
  height: 103px;
  max-width: 100%;
  object-fit: contain;
}
.enamel-modal .enamel-item .item-art > img.enamel-env { border: 1px solid #709683; border-radius: 6px; object-fit: cover; }
.enamel-modal .enamel-item .item-art > .slate-work { width: 58px; height: 58px; }
/* Keep the shared icon layers proportional; legacy mentor image sizes cropped both layers. */
.enamel-modal .enamel-item .slate-work .slate-stone { inset: 0; width: 100%; height: 100%; max-width: none; }
.enamel-modal .enamel-item .slate-work .slate-insert { inset: 2%; width: 96%; height: 96%; max-width: none; }
.enamel-modal .enamel-item .shop-text { min-width: 0; grid-column: auto; }
.enamel-modal .enamel-item .shop-name { margin: 0; color: #fff0d9; font-size: 15px; line-height: 1.18; overflow-wrap: anywhere; }
.enamel-modal .enamel-item .shop-desc { margin: 6px 0 0; color: #cbdad9; font-size: 13px; line-height: 1.32; }
.enamel-modal .enamel-item .item-effect { margin: 6px 0 0; color: #ffe0a5; font-size: 12px; line-height: 1.32; font-weight: 800; }
.enamel-modal .enamel-item .mentor-reward { color: #ead1fb; }
.enamel-modal .enamel-item .shop-action { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; grid-column: auto; width: 100%; min-width: 0; max-width: none; margin-top: 12px; }
.enamel-modal .enamel-item .enamel-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: stretch;
  justify-content: stretch;
  width: min(128px, 100%);
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  box-shadow: none;
  color: #ffe0a5;
  font-size: 16px;
  font-weight: 800;
}
.enamel-modal .enamel-action-face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  padding: 10px 15px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-image: url('./assets/forest-enamel/action-buy.webp') 22 42 26 42 fill / 11px 21px 13px 21px stretch;
}
.enamel-modal .enamel-equip .enamel-action-face { color: #fff0d9; border-image-source: url('./assets/forest-enamel/action-equip.webp'); }
.enamel-modal .enamel-action-face .currency-art { width: 21px; height: 21px; flex: none; }
.enamel-modal .enamel-action:focus-visible { outline: 2px solid #d6f2db; outline-offset: 3px; }
.enamel-modal .enamel-action:disabled { opacity: 1; filter: none; }
.enamel-modal .enamel-action:disabled .enamel-action-face { opacity: .7; }
.enamel-modal .enamel-action:not(:disabled):active { translate: none; }
.enamel-modal .enamel-action:not(:disabled):active .enamel-action-face { transform: translateY(1px); }
.enamel-modal .enamel-item .purchased {
  display: inline-block;
  margin-top: 0;
  padding: 10px 14px;
  border: 1px solid #608d72;
  border-radius: 5px;
  color: #cbf0d2;
  background: #12352a;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
}
@media (max-width: 350px) {
  .enamel-modal .modal-head.has-helper { padding-inline: 68px; }
  .enamel-modal .enamel-badge { left: 24px; }
  .enamel-modal .close-modal { right: 20px; }
  .enamel-modal .enamel-item { grid-template-columns: 44px minmax(0,1fr); gap: 8px; padding-inline: 15px; }
  .enamel-modal .enamel-item .item-art, .enamel-modal .enamel-item .item-art > .slate-work { width: 44px; }
  .enamel-modal .enamel-item .item-art > .slate-work { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .enamel-modal .enamel-action:not(:disabled):active .enamel-action-face { transform: none; }
}

/* Artwork stays left; titles, effects/descriptions and actions share the right column. */
.enamel-modal .enamel-item.catalog-card {
  grid-template-columns: minmax(64px, 30%) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 224px;
  padding: 23px 22px;
}
.enamel-modal .catalog-card .shop-name {
  font-size: 20px;
  line-height: 24px;
  text-align: left;
}
.enamel-modal .enamel-item.catalog-card .item-art {
  grid-row: 1;
  grid-column: 1;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 100%;
  height: 158px;
  margin: 0;
}
.enamel-modal .enamel-item.catalog-card .item-art > img {
  width: 100%;
  height: 158px;
  object-fit: contain;
}
.enamel-modal .enamel-item.catalog-card .item-art > img.enamel-env {
  width: 100%;
  height: auto;
  max-height: 158px;
  object-fit: contain;
}
.enamel-modal .enamel-item.catalog-card .item-art > .slate-work {
  width: min(76px, 100%);
  height: auto;
  aspect-ratio: 1;
}
.enamel-modal .catalog-card .shop-text {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  gap: 8px;
  align-content: center;
}
.enamel-modal .catalog-card .shop-desc { margin: 0; font-size: 14px; line-height: 19px; overflow-wrap: anywhere; }
/* All equip states occupy exactly the same rows and outer dimensions. */
.enamel-modal .enamel-item.cosmetic-card { height: 224px; }
.enamel-modal .cosmetic-card .shop-text { grid-template-rows: 48px 44px 48px; }
.enamel-modal .cosmetic-card .item-effect {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  text-align: left;
}
.enamel-modal .enamel-item.catalog-card .shop-action {
  grid-row: auto;
  grid-column: auto;
  height: 48px;
  margin: 0;
  justify-content: flex-start;
}
.enamel-modal .cosmetic-equipped { color: #fff0d9; }
