:root {
  color-scheme: dark;
  --bg: #161b24;
  --ink: #f4f7fb;
  --muted: #aeb8c8;
  --panel: rgba(38, 46, 63, 0.94);
  --panel-strong: rgba(48, 56, 76, 0.96);
  --panel-soft: rgba(31, 38, 52, 0.88);
  --field: #273140;
  --field-2: #303a4d;
  --line: rgba(126, 143, 168, 0.22);
  --line-strong: rgba(191, 207, 228, 0.2);
  --blue: #9ac4ef;
  --mint: #71e6c1;
  --meat: #ff8d68;
  --gold: #f7c84b;
  --gold-dark: #b97f17;
  --danger: #ff8b82;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #11151d;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(13, 17, 25, 0.58), rgba(13, 17, 25, 0.74)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 28px),
    #1b202b;
  color: var(--ink);
  font-size: 17px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 92px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(29, 36, 49, 0.86);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-strong), 0 10px 24px rgba(0, 0, 0, 0.3);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.nav-link {
  display: grid;
  place-items: center;
  min-width: 118px;
  height: 42px;
  border: 1px solid rgba(170, 190, 218, 0.22);
  border-radius: 8px;
  border-color: rgba(170, 190, 218, 0.22);
  background: rgba(38, 47, 64, 0.86);
  color: var(--ink);
  padding: 0 17px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px rgba(0, 0, 0, 0.2);
}

.nav-link:hover {
  filter: brightness(1.08);
}

.nav-link.active {
  border-color: rgba(113, 230, 193, 0.52);
  background: #2e8373;
  color: #f5fffb;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--mint);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
}

h1 {
  font-size: 36px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.26);
}

h2 {
  font-size: 20px;
}

.status {
  min-width: 220px;
  color: #d4e7ff;
  text-align: right;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

main {
  padding: 42px 24px 36px;
}

.split {
  width: min(1960px, calc(100vw - 64px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  color: #c8d3e3;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

select,
input {
  width: 100%;
  height: 50px;
  border: 1px solid rgba(170, 190, 218, 0.22);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -3px 8px rgba(0, 0, 0, 0.16);
}

select {
  cursor: pointer;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  left: 13px;
  top: 50%;
  color: #c8d3e3;
  font-size: 22px;
  line-height: 1;
  transform: translateY(-52%);
  pointer-events: none;
}

.search-field input {
  padding-left: 42px;
}

select:focus,
input:focus {
  border-color: rgba(113, 230, 193, 0.72);
  box-shadow: 0 0 0 3px rgba(113, 230, 193, 0.13), inset 0 -3px 8px rgba(0, 0, 0, 0.16);
}

.button-row {
  display: flex;
  gap: 8px;
  min-width: 0;
}

button {
  height: 50px;
  border: 1px solid rgba(226, 247, 255, 0.18);
  border-radius: 8px;
  background: #2e8373;
  color: var(--ink);
  padding: 0 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 18px rgba(0, 0, 0, 0.2);
}

button:hover {
  filter: brightness(1.08);
}

button.secondary {
  border-color: rgba(170, 190, 218, 0.18);
  background: #313b4f;
}

.panel-heading span {
  color: #b7c8dc;
  font-size: 12px;
}

.split {
  display: grid;
  grid-template-columns: 420px minmax(900px, 1fr) 310px;
  gap: 20px;
  margin-top: 0;
}

.favorites-panel {
  min-height: 660px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(29, 35, 48, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.favorites-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 778px;
  overflow: auto;
  padding: 10px;
}

.favorite-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 30px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border: 1px solid rgba(255, 198, 77, 0.36);
  border-radius: 8px;
  background: rgba(56, 63, 84, 0.94);
  padding: 6px 12px 6px 8px;
}

.favorite-chip img {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.favorite-chip span {
  overflow: hidden;
  font-size: 15px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-chip small {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.favorite-chip-remove {
  display: grid;
  grid-column: 3;
  grid-row: 1 / span 2;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.favorite-chip-remove:hover {
  background: rgba(255, 255, 255, 0.08);
}

.empty-inline {
  align-self: center;
  color: var(--muted);
  padding: 0 8px;
}

.favorite-chip,
.world-option,
.monster-chip,
.drop-card,
.item-option,
.map-tile,
.detail-link-button,
.inline-link-button,
.gear-head,
.socket-card {
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.inventory,
.results {
  min-height: 660px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(29, 35, 48, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.world-view,
.map-view,
.character-view {
  width: min(1960px, calc(100vw - 64px));
  margin: 0 auto;
}

.world-view,
.character-view {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 20px;
}

.map-view {
  display: grid;
  grid-template-columns: minmax(900px, 1fr) 420px;
  gap: 20px;
}

.world-list-panel,
.world-detail-panel,
.map-panel,
.map-detail-panel {
  min-height: 660px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(29, 35, 48, 0.88);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-panel {
  overflow: auto;
}

.map-detail-panel {
  overflow: visible;
}

.world-list,
.world-details {
  padding: 12px;
}

.world-details {
  position: relative;
}

.world-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 732px;
  overflow: auto;
}

.world-option {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 62px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(47, 55, 74, 0.9);
  color: var(--ink);
  padding: 9px 12px;
  text-align: left;
}

.world-option span,
.world-hero {
  display: grid;
  gap: 4px;
}

.monster-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(10, 15, 24, 0.58);
  object-fit: contain;
  padding: 5px;
}

.monster-avatar.large {
  width: 58px;
  height: 58px;
}

.monster-avatar.small {
  width: 34px;
  height: 34px;
  padding: 4px;
}

.world-option small,
.world-hero > span,
.monster-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.world-option b {
  color: var(--gold);
  font-size: 12px;
}

.world-option.active,
.monster-chip:hover,
.character-option:hover {
  border-color: rgba(255, 198, 77, 0.55);
  background: rgba(64, 72, 96, 0.98);
}

.character-option {
  grid-template-columns: 52px 1fr auto;
}

.leaderboard-character-main {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.leaderboard-class-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.94;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.35));
}

.character-option > b {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.character-option > b small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.rank-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(247, 200, 75, 0.25);
  border-radius: 8px;
  background: rgba(247, 200, 75, 0.1);
  color: var(--gold);
  font-size: 13px;
  font-weight: 950;
}

.character-detail-panel {
  overflow: hidden;
}

.character-hero {
  grid-template-columns: minmax(190px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 0;
  border-color: rgba(113, 230, 193, 0.28);
  background:
    linear-gradient(135deg, rgba(113, 230, 193, 0.1), rgba(19, 25, 35, 0.52) 42%),
    rgba(19, 25, 35, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.character-title-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.character-title-block strong {
  color: #f8fbff;
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.24);
}

.character-title-block small {
  color: #a8d9ff;
  font-size: 12px;
  font-weight: 950;
}

.attribute-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(64px, 1fr));
  align-items: center;
  gap: 8px;
}

.attribute-chip {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.55);
  padding: 6px 8px;
}

.attribute-chip img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.attribute-chip span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.attribute-chip b,
.mini-row b {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.attribute-chip strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1;
}

.character-gear-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  align-items: start;
  gap: 12px;
}

.gear-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.55);
  padding: 12px;
}

.gear-card > .empty-inline {
  align-self: start;
  padding: 0;
}

.gear-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 4px;
  color: inherit;
  text-align: left;
}

.gear-head:hover,
.gear-head:focus-visible {
  border-color: rgba(113, 230, 193, 0.44);
  background: rgba(47, 67, 78, 0.45);
}

.gear-head img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.gear-head span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.gear-head strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.gear-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gear-head > b {
  min-width: 40px;
  border: 1px solid rgba(113, 230, 193, 0.3);
  border-radius: 7px;
  background: rgba(113, 230, 193, 0.09);
  color: var(--mint);
  padding: 7px 8px;
  text-align: center;
}

.mini-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  color: #dbe8f7;
  font-size: 13px;
  line-height: 1.35;
}

.mini-row span {
  overflow-wrap: anywhere;
}

.socket-list {
  display: grid;
  align-content: start;
  gap: 7px;
}

.socket-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  align-self: start;
  width: 100%;
  height: auto;
  min-height: 56px;
  border: 1px solid rgba(247, 200, 75, 0.16);
  border-radius: 7px;
  background: rgba(247, 200, 75, 0.06);
  padding: 8px;
  color: inherit;
  text-align: left;
}

.socket-card:hover,
.socket-card:focus-visible {
  border-color: rgba(247, 200, 75, 0.42);
  background: rgba(247, 200, 75, 0.12);
}

.socket-card.boss-card {
  border-color: rgba(255, 93, 101, 0.28);
  background: rgba(255, 93, 101, 0.08);
}

.socket-card img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.socket-card span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.socket-card b {
  color: #ffe58a;
  font-size: 13px;
  line-height: 1.15;
}

.socket-card small,
.socket-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.3;
}

.socket-card em .stat-green,
.gear-stats .stat-green {
  color: #67e85d;
  font-weight: 950;
}

.socket-card em .stat-red,
.gear-stats .stat-red {
  color: #ff5d65;
  font-weight: 950;
}

.gear-stats {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gear-stats li {
  border-radius: 6px;
  background: rgba(10, 15, 24, 0.36);
  color: #dbe8f7;
  padding: 7px 8px;
  font-size: 12px;
  line-height: 1.3;
}

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

.skill-chip-grid span,
.unmapped-skill-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 999px;
  background: rgba(19, 25, 35, 0.55);
  padding: 8px 10px;
}

.skill-chip-grid b,
.unmapped-skill-list b {
  overflow: hidden;
  color: #dbe8f7;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-chip-grid small,
.unmapped-skill-list small {
  flex: 0 0 auto;
  color: var(--mint);
  font-size: 12px;
  font-weight: 950;
}

.unmapped-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.unmapped-skill-list span {
  min-width: 70px;
  justify-content: center;
  border-style: dashed;
  opacity: 0.72;
}

.class-tree-stack {
  display: grid;
  gap: 14px;
}

.class-tree {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.42);
  padding: 12px;
}

.class-tree-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.class-tree-title strong {
  color: var(--ink);
  font-size: 17px;
}

.class-tree-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.skill-reference-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.skill-reference-grid span {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  border: 1px solid rgba(154, 196, 239, 0.12);
  border-radius: 8px;
  background: rgba(10, 15, 24, 0.36);
  padding: 7px 9px;
}

.skill-reference-grid img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
}

.skill-reference-grid b {
  overflow: hidden;
  color: #dbe8f7;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-reference-grid small {
  color: var(--mint);
  font-size: 11px;
  font-weight: 950;
}

.skill-reference-grid em {
  border: 1px solid rgba(247, 200, 75, 0.22);
  border-radius: 999px;
  background: rgba(247, 200, 75, 0.08);
  color: #ffe58a;
  padding: 2px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.map-tile.active,
.map-tile:hover,
.map-tile:focus-visible {
  border-color: rgba(73, 231, 139, 0.95);
  background: rgba(73, 231, 139, 0.06);
  box-shadow: 0 0 0 2px rgba(73, 231, 139, 0.3);
}

.world-hero {
  border: 1px solid rgba(154, 196, 239, 0.16);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.45);
  padding: 14px;
}

.world-hero-image {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
}

.world-hero > span > strong {
  font-size: 24px;
}

.map-grid {
  position: relative;
  aspect-ratio: 2136 / 1362;
  min-width: 1120px;
  padding: 0;
  background:
    linear-gradient(rgba(15, 20, 30, 0.08), rgba(15, 20, 30, 0.08)),
    url("/assets/world-map.png") center / cover no-repeat;
}

.map-tile {
  position: absolute;
  left: var(--tile-x);
  top: var(--tile-y);
  width: var(--tile-w);
  height: var(--tile-h);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  min-height: 0;
  border: 3px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 8px;
  text-align: center;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

.map-tile strong {
  opacity: 0;
  font-size: 14px;
  line-height: 1.05;
  white-space: normal;
  transition: opacity 120ms ease;
}

.map-tile span {
  opacity: 0;
  color: #f3f4f6;
  font-size: 12px;
  font-weight: 900;
  transition: opacity 120ms ease;
}

.monster-grid,
.drop-grid,
.tag-list {
  display: grid;
  gap: 8px;
}

.monster-chip {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  height: auto;
  min-height: 66px;
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.55);
  padding: 9px 12px;
  text-align: left;
}

.monster-chip .monster-avatar.small {
  width: 44px;
  height: 44px;
}

.monster-chip span {
  display: grid;
  gap: 3px;
}

.monster-chip strong {
  font-size: 16px;
  line-height: 1.1;
}

.monster-chip small {
  font-size: 12px;
  line-height: 1.15;
}

.element-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--element-color);
  font-weight: 900;
}

.element-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}

.weakness-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weakness-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid rgba(154, 196, 239, 0.18);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.55);
  padding: 7px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.weakness-chip.strong {
  border-color: rgba(113, 230, 193, 0.34);
  background: rgba(38, 77, 65, 0.35);
}

.weakness-chip.resist {
  border-color: rgba(255, 139, 130, 0.32);
  background: rgba(79, 38, 48, 0.32);
}

.weakness-chip b {
  color: var(--mint);
  font-size: 13px;
}

.weakness-chip.resist b {
  color: var(--danger);
}

.hover-drop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 6px;
}

.hover-drop-grid span {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.hover-drop-grid img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.hover-drop-grid b {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

.hover-drop-grid small {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.empty-hover {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-drop-preview-head {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.map-drop-preview-head span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-drop-preview-head strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-drop-preview-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-drop-popout {
  position: absolute;
  top: var(--popout-y, 70px);
  right: calc(100% + 14px);
  z-index: 50;
  display: none;
  width: min(560px, calc(100vw - 510px));
  max-height: min(520px, calc(100vh - 190px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(113, 230, 193, 0.34);
  border-radius: 10px;
  background: rgba(18, 24, 34, 0.98);
  padding: 12px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.46);
}

.map-drop-popout.visible {
  display: grid;
  gap: 10px;
}

.map-drop-popout h3 {
  margin: 0;
  color: #dffbef;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.map-drop-popout::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -8px;
  width: 14px;
  height: 14px;
  border-top: 1px solid rgba(113, 230, 193, 0.34);
  border-right: 1px solid rgba(113, 230, 193, 0.34);
  background: rgba(18, 24, 34, 0.98);
  transform: rotate(45deg);
}

.drop-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.drop-grid span,
.drop-card {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  width: 100%;
  height: auto;
  min-height: 56px;
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.55);
  padding: 8px;
  color: inherit;
  text-align: left;
}

.drop-card:hover,
.detail-link-button:hover,
.inline-link-button:hover {
  border-color: rgba(113, 230, 193, 0.55);
  background: rgba(47, 67, 78, 0.72);
}

.drop-grid img {
  grid-row: span 2;
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.drop-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tag-list {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.tag-list span {
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 999px;
  background: rgba(19, 25, 35, 0.55);
  padding: 7px 10px;
  color: #dbe8f7;
  font-size: 12px;
  font-weight: 900;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(31, 39, 55, 0.92);
}

.listing-heading {
  align-items: end;
  flex-wrap: wrap;
}

.listing-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  min-width: 0;
}

.listing-controls button {
  height: 38px;
}

.listing-controls button {
  padding-inline: 12px;
}

.inventory-heading {
  display: flex;
}

.inventory-heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.clear-button-compact {
  height: 34px;
  padding-inline: 12px;
  font-size: 12px;
}

.item-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 31, 43, 0.72);
}

.item-search-row {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 31, 43, 0.52);
}

.item-filter-row select {
  height: 44px;
}

.item-filter-row label {
  gap: 5px;
}

.item-panel-search {
  min-width: 0;
}

.item-panel-search .search-field input {
  height: 42px;
  font-size: 15px;
}

.item-panel-search .search-field span {
  font-size: 18px;
}

.item-list {
  display: grid;
  gap: 8px;
  max-height: 706px;
  overflow: auto;
  padding: 10px;
}

.item-option {
  position: relative;
  display: grid;
  grid-template-columns: 50px 1fr auto 36px;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: auto;
  min-height: 76px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(47, 55, 74, 0.9);
  padding: 10px 12px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.item-tooltip {
  position: absolute;
  right: 44px;
  bottom: calc(100% - 6px);
  z-index: 20;
  display: none;
  max-width: 310px;
  border: 1px solid rgba(113, 230, 193, 0.32);
  border-radius: 8px;
  background: rgba(19, 25, 35, 0.98);
  color: #dbe8f7;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
  pointer-events: none;
  white-space: normal;
}

.item-option:hover .item-tooltip,
.item-option:focus-visible .item-tooltip {
  display: block;
}

.item-option:hover {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(57, 66, 88, 0.96);
}

.item-option.active {
  border-color: rgba(255, 198, 77, 0.55);
  background: rgba(64, 72, 96, 0.98);
}

.item-option img {
  width: 48px;
  height: 48px;
  border-radius: 9px;
  background: rgba(15, 18, 25, 0.42);
  object-fit: contain;
  padding: 2px;
}

.item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.item-copy strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-copy small {
  width: fit-content;
  border: 1px solid rgba(154, 196, 239, 0.22);
  border-radius: 999px;
  color: #c7ddf8;
  background: rgba(34, 45, 63, 0.7);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.item-stock {
  min-width: 34px;
  border-radius: 999px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.favorite-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: #b8c4d5;
  font-size: 20px;
  line-height: 1;
}

.favorite-toggle.active {
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.favorite-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.databank-link {
  display: inline-flex;
  align-items: center;
  height: 30px;
  border: 1px solid rgba(113, 230, 193, 0.42);
  border-radius: 8px;
  color: #dffbef;
  background: rgba(46, 131, 115, 0.55);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.databank-link:hover {
  filter: brightness(1.08);
}

.listing-body {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(280px, 320px);
  gap: 10px;
  padding: 10px;
  background: rgba(29, 35, 48, 0.98);
}

.table-wrap {
  position: relative;
  overflow: auto;
  max-height: 744px;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.price-col {
  width: 300px;
}

.refine-col {
  width: 104px;
}

.count-col {
  width: 116px;
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #1d2635;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.32);
}

thead {
  position: relative;
  z-index: 5;
}

th button {
  width: 100%;
  height: auto;
  min-height: 26px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #b9cee4;
  padding: 0;
  text-align: left;
}

.column-filter {
  display: grid;
  gap: 6px;
  width: 82px;
  min-width: 82px;
}

.column-filter select {
  height: 28px;
  border-radius: 7px;
  padding: 0 9px;
  font-size: 12px;
}

tbody tr {
  background: rgba(47, 55, 74, 0.92);
}

tbody tr:hover {
  background: rgba(58, 67, 90, 0.98);
}

tbody td:first-child {
  border-radius: 10px 0 0 10px;
}

tbody td:last-child {
  border-radius: 0 10px 10px 0;
}

td.price {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #ffe58a;
  font-weight: 950;
}

.row-item-name {
  min-width: 96px;
  max-width: 190px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-item-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: rgba(12, 16, 23, 0.45);
  object-fit: contain;
  padding: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.coin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid #ffef6b;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff489 0 14%, transparent 15%),
    radial-gradient(circle, #ffd84e 0 45%, #efaa1f 46% 70%, #9f6c12 71%);
  box-shadow: 0 0 0 2px rgba(126, 87, 14, 0.45), 0 2px 0 rgba(0, 0, 0, 0.22);
}

td.empty {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.item-details {
  min-height: 210px;
  border: 1px solid rgba(126, 143, 168, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(38, 48, 66, 0.96), rgba(26, 33, 46, 0.96));
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.detail-head {
  display: grid;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.detail-head img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  background: rgba(12, 16, 23, 0.45);
  object-fit: contain;
  padding: 3px;
}

.detail-head strong {
  display: block;
  font-size: 19px;
  line-height: 1.2;
}

.detail-head span {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.item-details p {
  margin: 0 0 12px;
  color: #d3ddea;
  font-size: 15px;
  line-height: 1.5;
}

.slot-badge {
  width: fit-content;
  margin: -2px 0 12px;
  border: 1px solid rgba(247, 200, 75, 0.28);
  border-radius: 7px;
  background: rgba(247, 200, 75, 0.1);
  color: #ffe58a;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
}

.item-details ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-details li {
  border: 1px solid rgba(154, 196, 239, 0.14);
  border-radius: 7px;
  background: rgba(19, 25, 35, 0.55);
  color: #dbe8f7;
  padding: 10px 11px;
  font-size: 14px;
  line-height: 1.35;
}

.item-details .stat-green {
  color: #67e85d;
  font-weight: 950;
}

.item-details .stat-red {
  color: #ff5d65;
  font-weight: 950;
}

.detail-section {
  margin-top: 16px;
  border-top: 1px solid rgba(126, 143, 168, 0.18);
  padding-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.2;
}

.detail-section p {
  margin: 0 0 8px;
}

.detail-section p span,
.detail-link-list span,
.detail-link-button,
.inline-link-button {
  color: #5fa6ff;
  font-weight: 900;
}

.detail-link-button,
.inline-link-button {
  display: inline-grid;
  width: 100%;
  height: auto;
  min-height: 0;
  justify-content: start;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 4px 6px;
  text-align: left;
}

.inline-link-button {
  display: inline;
  width: auto;
  padding: 0;
  vertical-align: baseline;
}

.detail-link-list {
  display: grid;
  gap: 5px;
  color: #dce8f7;
  font-size: 15px;
  line-height: 1.35;
}

.detail-link-list b {
  color: var(--ink);
}

.detail-link-list small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.error {
  color: var(--danger);
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(17, 21, 30, 0.48);
}

::-webkit-scrollbar-thumb {
  border: 3px solid rgba(17, 21, 30, 0.48);
  border-radius: 999px;
  background: #798698;
}

@media (max-width: 1420px) {
  .split {
    grid-template-columns: 380px minmax(0, 1fr);
  }

  .world-view,
  .map-view,
  .character-view {
    grid-template-columns: 1fr;
  }

  .map-grid {
    min-width: 1040px;
  }

  .favorites-panel {
    grid-column: 1 / -1;
    min-height: auto;
  }

  .favorites-list {
    display: flex;
    overflow-x: auto;
  }

  .favorite-chip {
    width: auto;
    min-width: 170px;
  }
}

@media (max-width: 1100px) {
  .button-row {
    grid-column: span 2;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .listing-body {
    grid-template-columns: 1fr;
  }

  .listing-heading {
    display: grid;
    grid-template-columns: 1fr;
  }

  .listing-controls .button-row {
    width: 100%;
  }

  .item-filter-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .app-nav {
    flex-wrap: wrap;
  }

  .map-grid {
    min-width: 980px;
  }
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    padding: 18px;
  }

  .status {
    min-width: 0;
    text-align: left;
  }

  main {
    padding: 28px 14px 14px;
  }

  .split {
    width: min(100%, calc(100vw - 28px));
  }

  .world-view,
  .map-view,
  .character-view {
    width: min(100%, calc(100vw - 28px));
  }

  .character-gear-grid {
    grid-template-columns: 1fr;
  }

  .character-hero {
    grid-template-columns: 1fr;
  }

  .attribute-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .app-nav {
    gap: 8px;
  }

  .nav-link {
    min-width: 96px;
  }

  .button-row {
    grid-column: auto;
  }

  .split {
    gap: 14px;
  }
}
