.npc-detail { --entity-accent: var(--lu4-accent); --entity-rule: color-mix(in srgb, var(--border) 52%, transparent); --entity-rule-strong: color-mix(in srgb, var(--border) 76%, transparent); --entity-hero-icon-size: 4.25rem; --entity-section-gap: 1rem; --npc-accent: var(--entity-accent); --npc-rule: var(--entity-rule); --npc-rule-strong: var(--entity-rule-strong); }
.npc-level { display: grid; min-width: 3rem; min-height: 2.5rem; place-content: center; padding: .25rem .625rem; border: 1px solid color-mix(in srgb, var(--npc-accent) 42%, var(--control-border)); border-radius: var(--radius-md); background: var(--control-bg); color: var(--text); text-align: center; }
.npc-level small, .npc-level strong { display: block; line-height: 1.05; }
.npc-level small { color: var(--text-muted); font-size: var(--type-badge-size); line-height: 1; font-weight: 650; }
.npc-level strong { margin-top: .15rem; font-size: .875rem; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.npc-action__external { width: .8rem; height: .8rem; stroke-width: 1.5; }

.npc-profile dd > a strong, .npc-profile dd > a small, .npc-area-more a strong, .npc-area-more a small { display: block; font-weight: inherit; }
.npc-profile small { color: var(--text-muted); font-size: var(--entity-meta-size); line-height: var(--entity-meta-line); }
.npc-area-details summary { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: 0; }
.npc-area-details summary span { min-width: 0; }
.npc-area-details .npc-area-more { display: grid; gap: .5rem; padding: .5rem 0; }
.npc-area-details .wb-disclosure__icon { margin-left: 0; flex: 0 0 1rem; }
.npc-section { grid-template-columns: minmax(0, 1fr); }
.npc-panel { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }

.npc-section--properties { gap: .65rem; }

.npc-relations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.npc-relation { position: relative; min-height: 4.5rem; padding: .625rem 1.25rem; border-bottom: 1px solid var(--npc-rule); }
.npc-relation:nth-child(odd of .npc-relation:not([hidden])):has(~ .npc-relation:not([hidden]))::after { position: absolute; top: .65rem; right: 0; bottom: .65rem; width: 1px; background: var(--npc-rule-strong); content: ""; }
.npc-relation:hover { background: var(--data-row-hover-bg); }
.npc-relation[hidden] { display: none; }

.npc-section--loot { grid-template-columns: minmax(0, 1fr); align-items: end; }
.npc-section--loot .npc-loot-switch { width: fit-content; min-width: 13rem; }
.npc-section--loot .npc-loot-table { grid-column: 1 / -1; }
.npc-loot-table { display: grid; gap: .75rem; }
.npc-loot-group { overflow: hidden; margin: 0; padding: 0; border: 1px solid var(--npc-rule-strong); border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 34%, transparent); }
.npc-loot-group__head { display: flex; min-height: 2rem; align-items: center; justify-content: space-between; gap: 1rem; padding: .35rem 1.25rem; border-bottom: 1px solid var(--npc-rule); background: var(--control-bg); color: var(--text-muted); font-size: var(--entity-meta-size); }
.npc-loot-group__head strong { color: var(--lu4-sem-probability, var(--lu4-accent)); font-size: var(--entity-body-size); font-weight: 750; font-variant-numeric: tabular-nums; }
.npc-loot-row { display: grid; grid-template-columns: minmax(0, 1fr) 7rem 9rem 14rem; min-height: 4.25rem; align-items: center; gap: var(--space-3); padding: var(--space-2) 1.25rem; border-bottom: 1px solid var(--npc-rule); }
.npc-loot-row:last-child { border-bottom: 0; }
.npc-loot-row--labels { min-height: 2rem; color: var(--text-muted); font-size: var(--entity-meta-size); }
.npc-loot-row.npc-loot-row--labels > span:first-child { text-align: left; }
.npc-loot-row__item { --wb-entity-icon-size: 2.75rem; --wb-entity-gap: var(--space-3); --wb-entity-secondary-color: var(--text-secondary); }
.npc-grade { margin-left: .4rem; }
.npc-loot-row > span:not(.npc-loot-row__item) { color: var(--text-secondary); font-size: var(--entity-body-size); font-variant-numeric: tabular-nums; text-align: right; }
.npc-loot-row.npc-loot-row--labels > span { font-size: var(--entity-meta-size); }
.npc-loot-row__effective { display: grid; grid-template-columns: auto minmax(4rem, 1fr); align-items: center; gap: .65rem; color: var(--text); font-weight: 700; }
.npc-loot-row__effective strong { color: var(--lu4-sem-probability, var(--lu4-accent)); }
.npc-loot-row__effective i { display: block; overflow: hidden; height: .25rem; border-radius: 999px; background: var(--control-hover-bg); }
.npc-loot-row__effective i::before { display: block; width: var(--npc-chance); max-width: 100%; height: 100%; border-radius: inherit; background: var(--lu4-sem-probability, var(--lu4-accent)); content: ""; }
.npc-empty { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-muted); text-align: center; }

@container (max-width: 52.5rem) {
  .npc-section, .npc-section--loot { grid-template-columns: 1fr; gap: .75rem; }
  .npc-section > :not(.npc-section__head), .npc-section--loot .npc-loot-table { grid-column: 1; }
  .npc-relations { grid-template-columns: 1fr; }
  .npc-relation::after { display: none; }
  .npc-loot-group__head { padding-right: .75rem; padding-left: .75rem; }
  .npc-loot-row { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); padding-right: .75rem; padding-left: .75rem; }
  .npc-loot-row--labels { display: none; }
  .npc-loot-row > span:not(.npc-loot-row__item) { display: grid; grid-template-columns: auto auto; gap: var(--space-2); }
  .npc-loot-row > span:not(.npc-loot-row__item)::before { content: attr(data-label); color: var(--text-muted); font-size: var(--entity-meta-size); font-weight: 500; }
  .npc-loot-row__effective i { display: none; }
  .npc-loot-row__item { grid-row: 1 / 4; align-self: start; }
}

@container (max-width: 32.5rem) {
  .npc-loot-row { grid-template-columns: minmax(0, 1fr); row-gap: .25rem; }
  .npc-loot-row__item { grid-row: auto; margin-bottom: .25rem; }
  .npc-loot-row > span:not(.npc-loot-row__item) { grid-template-columns: minmax(0, 1fr) auto; }
  .npc-loot-row > span:not(.npc-loot-row__item)::before { text-align: left; }
}
