.item-row {
  grid-template-columns: 38px minmax(0, 1fr) 132px 66px 96px 16px;
}

.item-row__ico {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-row__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.item-row__cat {
  justify-self: center;
  text-align: center;
}

.item-row__lvl,
.item-row__price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--dms-navy-900, #0e1b4d);
}

.item-row__lvl small,
.item-row__price small {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--dms-muted, #6b7280);
}

.item-badge--cash {
  background: linear-gradient(135deg, #7b1fa2, #b23bd6) !important;
}

.item-badge--dpshop {
  background: linear-gradient(135deg, #b8860b, #e0a92e) !important;
}

.item-badge--ssbp {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
}

.item-badge--ssbe {
  background: linear-gradient(135deg, #15803d, #22c55e) !important;
}

.item-badge--quest {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--dms-accent, #f82249), var(--dms-accent-2, #ff5b7b));
}

.item-hero__art {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  max-width: 200px;
}

.item-hero__img {
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(14, 27, 77, .28));
}

.item-hero__img--pet {
  max-width: 200px;
  max-height: 200px;
}

@media (max-width: 767px) {
  .quest-hero__npc.item-hero__art { max-width: 100%; }
  .item-hero__img { max-width: 120px; }
  .item-hero__img--pet { max-width: 150px; }
}

.item-statgroup__h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dms-muted, #6b7280);
  margin: 14px 0 6px;
}

.item-statgroup__h:first-child { margin-top: 0; }

.item-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.item-stat--wide { grid-column: 1 / -1; }

.item-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.item-stat__l {
  font-size: 12px;
  font-weight: 600;
  color: var(--dms-muted, #6b7280);
}

.item-stat__v {
  font-size: 15px;
  font-weight: 700;
  color: var(--dms-navy-900, #0e1b4d);
}

.item-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--dms-navy-700, #1d2f6b);
}

.item-none {
  color: var(--dms-muted, #6b7280);
  font-size: 14px;
  margin: 0;
}

.item-teachlist,
.item-srclist,
.item-questlist,
.item-maplist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-teach {
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.item-teach b { display: block; font-size: 14px; color: var(--dms-navy-900, #0e1b4d); }
.item-teach span { font-size: 12px; color: var(--dms-muted, #6b7280); }

.item-cardbox {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-cardbox__img { width: 44px; height: 44px; object-fit: contain; }
.item-cardbox__who b { display: block; font-size: 14px; color: var(--dms-navy-900, #0e1b4d); }
.item-cardbox__who span { font-size: 12px; color: var(--dms-muted, #6b7280); }

.item-srcgroup__h {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dms-muted, #6b7280);
  margin: 14px 0 6px;
}

.item-srcgroup__h:first-child { margin-top: 0; }

.item-src {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.item-src__ico {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-src__img { max-width: 100%; max-height: 100%; object-fit: contain; }

.item-src__name {
  min-width: 0;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--dms-navy-900, #0e1b4d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-src__name small { color: var(--dms-muted, #6b7280); font-weight: 600; }

.item-src__qty {
  font-size: 12px;
  font-weight: 600;
  color: var(--dms-muted, #6b7280);
  white-space: nowrap;
}

.item-src__rate {
  grid-column: -2;
  font-size: 13px;
  font-weight: 700;
  color: var(--dms-accent, #f82249);
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

.item-src__token {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-left: 3px;
  object-fit: contain;
}

.item-chip--period {
  color: #8a5606;
  background: rgba(199, 125, 10, .16);
}

.item-chip--choice {
  color: #12703d;
  background: rgba(31, 157, 87, .16);
}

.item-maker__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.item-maker__meta span {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--dms-navy-700, #1d2f6b);
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.item-recipe {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.item-ingredient {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.item-ingredient img { width: 28px; height: 28px; object-fit: contain; }
.item-ingredient span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13.5px; color: var(--dms-navy-900, #0e1b4d); }
.item-ingredient em { margin-left: auto; flex: none; font-style: normal; font-size: 12px; font-weight: 700; color: var(--dms-muted, #6b7280); }

.item-maprow,
.item-questrow {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
  color: var(--dms-navy-900, #0e1b4d);
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}

.item-maprow:hover,
.item-questrow:hover {
  transform: translateY(-1px);
  box-shadow: var(--dms-shadow, 0 6px 16px rgba(14, 27, 77, .12));
}

.item-questrow--plain { cursor: default; }
.item-questrow--plain:hover { transform: none; box-shadow: none; }

.item-maprow i,
.item-questrow i { color: var(--dms-accent, #f82249); font-size: 13px; flex: none; }
.item-questrow__ico { width: 16px; height: 16px; object-fit: contain; flex: none; }
.item-maprow span,
.item-questrow span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.item-questrow img.q-ico-20 { flex: none; }
.item-questrow__x { margin-left: auto; flex: none; font-size: 12px; font-weight: 700; color: var(--dms-muted, #6b7280); }

.item-list--nolvl .item-row {
  grid-template-columns: 38px minmax(0, 1fr) 132px 96px 16px;
}

.lib-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.lib-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}

.lib-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--dms-shadow, 0 6px 16px rgba(14, 27, 77, .12));
}

.lib-tile i {
  font-size: 18px;
  color: var(--dms-accent, #f82249);
  margin-bottom: 4px;
}

.lib-tile__ico { height: 28px; width: auto; margin-bottom: 4px; object-fit: contain; }
.lib-tile b { font-size: 14.5px; color: var(--dms-navy-900, #0e1b4d); }
.lib-tile span { font-size: 12px; color: var(--dms-muted, #6b7280); }

.lib-typenav { margin-bottom: 12px; }

.lib-typenav__head {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--dms-muted, #6b7280);
  margin: 0 0 6px;
}

.lib-typenav__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.lib-tile--type { flex-direction: row; align-items: center; gap: 8px; padding: 9px 10px; }
.lib-tile--type .lib-tile__ico { height: 28px; width: 28px; margin-bottom: 0; flex: none; }
.lib-tile--type b { font-size: 13px; line-height: 1.25; min-width: 0; }
.lib-tile--type:hover { transform: translateY(-1px); }

.lib-divider {
  height: 1px;
  margin: 2px 0 16px;
  background: var(--dms-border, rgba(14, 27, 77, .10));
}

.ssb-poolgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.ssb-poolbreak {
  grid-column: 1 / -1;
  height: 1px;
  margin: 2px 0;
  background: var(--dms-border, rgba(14, 27, 77, .10));
}

.ssb-pooltile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}

.ssb-pooltile:hover {
  transform: translateY(-2px);
  box-shadow: var(--dms-shadow, 0 6px 16px rgba(14, 27, 77, .12));
}

.ssb-pooltile b { font-size: 14px; color: var(--dms-navy-900, #0e1b4d); }
.ssb-pooltile span { font-size: 12px; color: var(--dms-muted, #6b7280); }

.ssb-pooltile.is-active {
  border-color: rgba(248, 34, 73, .45);
  box-shadow: inset 0 0 0 1px rgba(248, 34, 73, .18);
}

.ssb-active {
  position: absolute;
  top: 10px;
  right: 10px;
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--dms-accent, #f82249), var(--dms-accent-2, #ff5b7b));
}

.ssb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ssb-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.ssb-item__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ssb-item__name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--dms-navy-900, #0e1b4d);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.ssb-item__name:hover { color: var(--dms-accent, #f82249); }

.ssb-item__rate {
  grid-column: -2;
  font-size: 13px;
  font-weight: 700;
  color: var(--dms-accent, #f82249);
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

.ssb-prev {
  flex: none;
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
  background: #fff;
  color: var(--dms-navy-900, #0e1b4d);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .12s ease, border-color .12s ease;
}

.ssb-prev:hover {
  border-color: var(--dms-accent, #f82249);
  color: var(--dms-accent, #f82249);
}

.ssb-prevbox {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed var(--dms-border, rgba(14, 27, 77, .18));
  background: var(--dms-paper-2, #f7f8fc);
  color: var(--dms-muted, #6b7280);
  font-size: 12.5px;
}

.ssb-prevbox img { max-width: 100%; max-height: 220px; object-fit: contain; }

.mount-preview__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 12px;
  border-radius: 12px;
  background: var(--dms-paper-2, #f7f8fc);
  border: 1px solid var(--dms-border, rgba(14, 27, 77, .10));
}

.mount-preview__img { max-width: 100%; max-height: 240px; object-fit: contain; }

.mount-preview__fail {
  display: none;
  color: var(--dms-muted, #6b7280);
  font-size: 12.5px;
}

.mount-preview.is-fail .mount-preview__img { display: none; }
.mount-preview.is-fail .mount-preview__fail { display: block; }

.mount-preview__spin {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  animation: mp-spin .8s linear infinite;
}
.mount-preview.is-ready .mount-preview__spin,
.mount-preview.is-fail .mount-preview__spin { display: none; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mount-preview__spin { animation: none; } }

.mount-preview__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mount-preview__cap {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dms-muted, #6b7280);
}

.mount-preview__pick { max-width: 240px; }

.item-src__ico--fa {
  color: var(--dms-accent, #f82249);
  font-size: 15px;
}

a.item-src {
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}

a.item-src:hover {
  transform: translateY(-1px);
  box-shadow: var(--dms-shadow, 0 6px 16px rgba(14, 27, 77, .12));
}

@media (max-width: 767px) {
  .item-row {
    grid-template-columns: 38px minmax(0, 1fr) 60px 16px;
    grid-template-areas: none;
  }
  .item-list--nolvl .item-row {
    grid-template-columns: 38px minmax(0, 1fr) 16px;
  }
  .item-row .quest-row__ico,
  .item-row .quest-row__main,
  .item-row .quest-row__chev { grid-area: auto; }
  .item-row__cat,
  .item-row__price {
    display: none;
  }
  .lib-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lib-typenav__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
