:root {
  --bg: #101a26;
  --panel: rgba(13, 29, 43, 0.92);
  --panel-strong: #0f2333;
  --line: rgba(173, 213, 255, 0.14);
  --text: #ecf5ff;
  --muted: #9eb8cf;
  --accent: #ffb347;
  --accent-2: #65d6ce;
  --positive: #69db7c;
  --negative: #ff8f8f;
  --line-subtle: rgba(173, 213, 255, 0.12);
  --line-faint: rgba(173, 213, 255, 0.1);
  --control-bg: rgba(6, 15, 23, 0.78);
  --surface-card: linear-gradient(180deg, rgba(16, 38, 53, 0.72), rgba(9, 22, 31, 0.76));
  --radius-control: 14px;
  --radius-menu: 16px;
  --radius-panel: 18px;
  --radius-card: 22px;
  --radius-pill: 999px;
  --control-height: 48px;
  --control-height-compact: 43px;
  --icon-size-small: 28px;
  --icon-size-medium: 34px;
  --icon-size-large: 42px;
  --table-header-height: 36px;
  --table-row-height: 52px;
  --scrollbar-color: rgba(173, 213, 255, 0.42) rgba(7, 17, 25, 0.68);
  --scrollbar-track: linear-gradient(180deg, rgba(7, 17, 25, 0.72), rgba(13, 28, 39, 0.82));
  --scrollbar-thumb: linear-gradient(180deg, rgba(173, 213, 255, 0.52), rgba(101, 214, 206, 0.48));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(255, 179, 71, 0.72), rgba(101, 214, 206, 0.58));
  /* Official IdleMMO quality palette. Keep every quality treatment based on
     these tokens so filters, tables, cards, tooltips, EXP and Bosses agree. */
  --quality-standard: #d1d5db;
  --quality-standard-border: rgb(55 65 81 / 0.4);
  --quality-standard-background: #161d2a;
  --quality-refined: #4d76d6;
  --quality-refined-border: rgb(77 118 214 / 0.3);
  --quality-refined-background: #152951;
  --quality-premium: #1fd60b;
  --quality-premium-border: rgb(31 214 11 / 0.3);
  --quality-premium-background: #16382b;
  --quality-epic: #c0392b;
  --quality-epic-border: rgb(192 57 43 / 0.3);
  --quality-epic-background: #421d25;
  --quality-legendary: #f7bd1e;
  --quality-legendary-border: rgb(247 189 30 / 0.3);
  --quality-legendary-background: #3d3222;
  --quality-mythic: #f48a00;
  --quality-mythic-border: rgb(194 65 12 / 0.3);
  --quality-mythic-background: linear-gradient(to bottom right, #764430, #492f31);
  --quality-mythic-text: linear-gradient(90deg, #f48a00, #da5b00);
  --quality-unique: #b417f4;
  --quality-unique-border: rgb(126 34 206 / 0.3);
  --quality-unique-background: linear-gradient(to bottom right, #7c598e, #4e2760);
  --quality-unique-text: linear-gradient(90deg, #b417f4, #8006b5);
}

html {
  background:
    radial-gradient(circle at top left, rgba(101, 214, 206, 0.1), transparent 24%),
    radial-gradient(circle at bottom right, rgba(101, 214, 206, 0.08), transparent 20%),
    linear-gradient(180deg, #0a1520 0%, #0d1a27 52%, #0b1621 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  padding-bottom: 92px;
  overflow-x: hidden;
  background: transparent;
}

body.modal-open {
  overflow: hidden;
}

.page-shell {
  width: 100%;
  max-width: 2400px;
  margin: 24px auto 40px;
  padding: 0 12px;
}

.hero {
  display: grid;
  gap: 0;
  padding: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(16, 42, 57, 0.96), rgba(10, 29, 41, 0.96) 70%, rgba(20, 42, 31, 0.7) 145%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.hero-topbar {
  display: grid;
  grid-template-columns: minmax(240px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-width: 0;
  padding: 17px 22px 14px;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.hero-brand h1 {
  min-width: 0;
}

.hero-brand-logo {
  display: block;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.32));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  overflow: hidden;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
}

/* EXP planner */
.exp-panel {
  overflow: visible;
}

.exp-panel-header {
  display: block;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.exp-panel-heading {
  min-width: 0;
}

.exp-panel-header h2 {
  margin: 3px 0 5px;
}

.exp-panel-header p,
.exp-field-note,
.exp-accuracy-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.exp-kicker {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.exp-workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
}

.exp-setup {
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(3, 13, 20, 0.2);
}

.exp-stage {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  padding: 0 0 20px;
}

.exp-stage-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(101, 214, 206, 0.4);
  border-radius: 50%;
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.07);
  font-size: 0.72rem;
  font-weight: 800;
}

.exp-stage-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}

.exp-stage-heading > strong {
  font-size: 0.86rem;
}

.exp-character-stage {
  display: block;
  padding-bottom: 0;
}

.exp-character-list {
  display: grid;
  gap: 7px;
}

.exp-character-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: rgba(8, 23, 34, 0.76);
  text-align: left;
}

.exp-character-card:hover,
.exp-character-card.active {
  border-color: rgba(101, 214, 206, 0.48);
  background: rgba(31, 85, 91, 0.28);
}

.exp-character-card.has-character-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(8, 23, 34, 0.8);
}

.exp-character-card.has-character-art::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 18, 28, 0.9) 0%, rgba(5, 18, 28, 0.72) 56%, rgba(5, 18, 28, 0.88) 100%),
    linear-gradient(0deg, rgba(5, 18, 28, 0.34), rgba(5, 18, 28, 0.08)),
    var(--exp-character-bg) center 35% / cover no-repeat;
  content: "";
  opacity: 0.68;
  transition: opacity 180ms ease, transform 240ms ease;
}

.exp-character-card.has-character-art:hover::before,
.exp-character-card.has-character-art.active::before {
  opacity: 0.86;
  transform: scale(1.025);
}

.exp-character-card img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.exp-character-fallback {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px dashed rgba(101, 214, 206, 0.4);
  border-radius: 50%;
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.07);
  font-weight: 800;
}

.exp-character-sync {
  display: grid;
  justify-items: end;
  min-width: 54px;
}

.exp-character-sync small:last-child {
  color: var(--accent-2);
  font-size: 0.62rem;
}

.exp-character-card .exp-character-fallback {
  width: 36px;
  height: 36px;
}

.exp-character-card strong,
.exp-character-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-character-card small {
  margin-top: 2px;
  color: var(--muted);
}

.exp-character-card.custom img {
  display: grid;
  place-items: center;
  background: rgba(255, 191, 52, 0.1);
}

.exp-select {
  width: 100%;
}

.exp-skill-stage {
  margin-top: 17px;
  padding: 12px 14px 10px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(90deg, rgba(101, 214, 206, 0.07), transparent 45%),
    rgba(3, 15, 23, 0.48);
}

.exp-skill-stage .exp-stage-heading {
  margin-bottom: 9px;
}

.exp-skill-bar {
  display: flex;
  gap: 7px;
  padding: 1px 1px 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(101, 214, 206, 0.42) rgba(3, 15, 23, 0.35);
  scrollbar-width: thin;
}

.exp-skill-bar::-webkit-scrollbar {
  height: 6px;
}

.exp-skill-bar::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(3, 15, 23, 0.35);
}

.exp-skill-bar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(101, 214, 206, 0.42);
}

.exp-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(5, 18, 27, 0.72);
  font-size: 0.76rem;
  font-weight: 750;
}

.exp-skill-chip:hover {
  border-color: rgba(101, 214, 206, 0.35);
  color: var(--text);
  background: rgba(101, 214, 206, 0.09);
}

.exp-skill-chip.active {
  border-color: rgba(255, 191, 52, 0.42);
  color: #fff0c2;
  background: linear-gradient(135deg, rgba(255, 191, 52, 0.16), rgba(101, 214, 206, 0.08));
  box-shadow: inset 0 -2px 0 rgba(255, 191, 52, 0.52);
}

.exp-skill-chip .exp-select-option-icon {
  width: 19px;
  height: 19px;
}

.exp-skill-mobile-select {
  display: none;
}

.exp-skill-stage > .exp-field-note {
  margin-top: 4px;
}

.exp-select-menu {
  max-height: 270px;
}

.exp-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.exp-select-option:hover,
.exp-select-option.active {
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.1);
}

.exp-select-option > span:last-child {
  min-width: 0;
}

.exp-select-option strong,
.exp-select-option small {
  display: block;
}

.exp-select-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.7rem;
}

.exp-select-option-icon,
.exp-select-value-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  color: var(--accent-2);
}

.exp-select-option-icon svg,
.exp-select-value-icon svg {
  width: 19px;
  height: 19px;
}

#expSkillLabel,
#expGatheringToolLabel {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

#expSkillSelect .multi-filter-toggle,
#expGatheringToolSelect .multi-filter-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

#expSkillSelect .multi-filter-toggle::after,
#expGatheringToolSelect .multi-filter-toggle::after {
  grid-column: 2;
  grid-row: 1;
  line-height: 1;
}

#expSkillLabel,
#expGatheringToolLabel {
  grid-column: 1;
  grid-row: 1;
  overflow: hidden;
}

#expGatheringToolLabel > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#expGatheringToolLabel small {
  color: var(--muted);
}

.exp-level-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.exp-level-grid input,
.exp-combat-controls select,
.exp-stat-field input {
  width: 100%;
}

.exp-objectives {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(2, 13, 20, 0.72);
}

.exp-objective {
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
}

.exp-objective:hover,
.exp-objective.active {
  color: var(--text);
  background: rgba(255, 191, 52, 0.13);
}

.exp-combat-route-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.exp-combat-route-options[hidden] {
  display: none;
}

.exp-combat-route-options .boss-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
}

.exp-combat-route-options .boss-switch-track {
  width: 36px;
  height: 21px;
  flex-basis: 36px;
}

.exp-combat-route-options .boss-switch-thumb {
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
}

.exp-combat-route-options input:checked + .boss-switch-track .boss-switch-thumb {
  transform: translateX(15px);
}

.exp-start-progress {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(101, 214, 206, 0.18);
  border-radius: 10px;
  background: rgba(3, 15, 23, 0.5);
}

#expCombatSetup .exp-start-progress {
  margin-top: 12px;
}

.exp-start-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.exp-start-progress strong {
  color: var(--text);
}

.exp-start-progress-track {
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(173, 213, 255, 0.13);
}

.exp-start-progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.exp-main {
  min-width: 0;
  padding: 20px;
}

.exp-plan-setup {
  position: relative;
}

.exp-plan-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(210px, 0.7fr) minmax(260px, 1fr);
  align-items: start;
  gap: 14px;
}

.exp-control-label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.82rem;
}

.exp-dungeon-effectiveness-field {
  min-width: 0;
}

.exp-dungeon-effectiveness-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.exp-dungeon-effectiveness-heading strong {
  padding: 3px 8px;
  border: 1px solid rgba(101, 214, 206, 0.3);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.09);
  font-size: 0.75rem;
}

.exp-effectiveness-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: start;
  min-height: 49px;
  padding-top: 8px;
}

.exp-effectiveness-colors {
  position: absolute;
  top: 12px;
  right: 8%;
  left: 8%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #344454 0 22%, #24815e 22% 67%, #b39735 67% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.exp-effectiveness-colors::after {
  position: absolute;
  inset: auto auto 0 0;
  width: var(--effectiveness-selection, 29%);
  height: 2px;
  border-radius: 999px;
  background: #a7fff6;
  box-shadow: 0 0 7px rgba(101, 214, 206, 0.65);
  content: "";
  transition: width 180ms ease;
}

.exp-effectiveness-track button {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.exp-effectiveness-track button:hover,
.exp-effectiveness-track button.active {
  border: 0;
  background: transparent;
  color: var(--text);
}

.exp-effectiveness-track button > span {
  width: 15px;
  height: 15px;
  border: 3px solid #132838;
  border-radius: 50%;
  background: #728595;
  box-shadow: 0 0 0 1px rgba(173, 213, 255, 0.18);
}

.exp-effectiveness-track button.is-passed > span {
  background: #56a99b;
}

.exp-effectiveness-track button.active > span {
  width: 19px;
  height: 19px;
  margin: -2px;
  border-color: #e3fffc;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(101, 214, 206, 0.24), 0 0 12px rgba(101, 214, 206, 0.42);
}

.exp-effectiveness-track button small {
  padding: 2px 5px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.64rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-effectiveness-track button.active small {
  color: #dffffb;
  background: rgba(101, 214, 206, 0.14);
  font-weight: 800;
}

.exp-calculation-effects {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 12px;
  background: rgba(3, 15, 23, 0.52);
}

.exp-effects-title {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.exp-effect-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.exp-effect-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid rgba(101, 214, 206, 0.24);
  border-radius: 999px;
  color: #b9fff7;
  background: rgba(32, 101, 105, 0.18);
  font-size: 0.72rem;
  white-space: nowrap;
}

.exp-effect-badge strong {
  color: var(--text);
}

.exp-effect-badge.source-membership {
  border-color: rgba(255, 191, 52, 0.3);
  color: #ffe2a8;
  background: rgba(255, 191, 52, 0.1);
}

.exp-effect-badge.excluded,
.exp-effect-badge.base,
.exp-effect-empty {
  color: var(--muted);
}

.exp-effect-badge.excluded,
.exp-effect-badge.weather-excluded,
.exp-effect-badge.weather-partial {
  border-color: rgba(255, 176, 76, 0.35);
  border-style: dashed;
  background: rgba(255, 176, 76, 0.06);
}

.exp-effect-badge.weather-included {
  border-color: rgba(70, 224, 181, 0.38);
  background: rgba(39, 171, 139, 0.11);
}

.exp-effect-weather-names {
  color: var(--text);
  font-weight: 700;
}

.exp-effect-badge-state {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 1px 6px;
  border: 1px solid rgba(255, 176, 76, 0.42);
  border-radius: 999px;
  color: #ffd08a;
  background: rgba(255, 176, 76, 0.12);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.weather-included .exp-effect-badge-state {
  border-color: rgba(70, 224, 181, 0.48);
  color: #8fffe0;
  background: rgba(39, 171, 139, 0.17);
}

.exp-effect-badge-state::before {
  content: "×";
  margin-right: 4px;
  font-size: 0.78rem;
  line-height: 1;
}

.weather-included .exp-effect-badge-state::before {
  content: "✓";
}

.weather-partial .exp-effect-badge-state::before {
  content: "◐";
}

.exp-effect-empty {
  font-size: 0.75rem;
}

.exp-forecast-state {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(3, 15, 23, 0.72);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.exp-forecast-state.is-loading {
  color: var(--accent);
  border-color: rgba(255, 191, 52, 0.3);
}

.exp-forecast-state.is-ready {
  color: var(--positive);
  border-color: rgba(105, 219, 154, 0.28);
}

.exp-forecast-state.is-warning {
  color: var(--negative);
  border-color: rgba(255, 143, 143, 0.28);
}

.exp-forecast-message {
  margin: 12px 0 0;
  padding: 8px 10px;
  border-left: 2px solid rgba(255, 143, 143, 0.72);
  color: #ffc1c1;
  background: rgba(255, 143, 143, 0.07);
  font-size: 0.76rem;
}

.endgame-item-icon.exp-tool-item-icon,
.exp-tool-fallback,
.exp-tool-empty {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.exp-tool-fallback,
.exp-tool-empty {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(3, 15, 23, 0.82);
}

.exp-tool-fallback svg {
  width: 18px;
  height: 18px;
}

.exp-context-card,
.exp-route-card,
.exp-alternative-card {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(8, 23, 34, 0.76);
}

.exp-context-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.exp-context-heading h3 {
  margin: 3px 0 0;
}

.exp-training-pet-picker {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(4, 15, 23, 0.72);
  color: var(--text);
  text-align: left;
}

.exp-training-pet-picker:hover {
  border-color: rgba(101, 214, 206, 0.48);
  background: rgba(31, 85, 91, 0.2);
}

.exp-training-pet-picker:disabled {
  cursor: default;
  opacity: 0.7;
}

.exp-training-pet-picker img,
.exp-training-pet-empty {
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.exp-training-pet-picker img {
  object-fit: contain;
}

.exp-training-pet-empty {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(101, 214, 206, 0.35);
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.07);
  font-weight: 800;
}

.exp-training-pet-picker > span:nth-child(2) {
  min-width: 0;
}

.exp-training-pet-picker strong,
.exp-training-pet-picker small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-training-pet-picker small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.exp-training-pet-action {
  padding: 5px 9px;
  border: 1px solid rgba(101, 214, 206, 0.2);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.07);
  font-size: 0.72rem;
  font-weight: 700;
}

.exp-combat-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(330px, 1.1fr);
  gap: 22px;
}

.exp-loadout {
  position: relative;
  min-height: 470px;
  border: 1px solid rgba(101, 214, 206, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 45%, rgba(24, 110, 131, 0.18), transparent 40%),
    linear-gradient(145deg, rgba(5, 18, 28, 0.82), rgba(8, 25, 37, 0.56));
}

@media (min-width: 981px) {
  .exp-loadout {
    background:
      linear-gradient(rgba(2, 10, 17, 0.04), rgba(2, 10, 17, 0.18)),
      url("./assets/equipBG.webp") center / contain no-repeat,
      radial-gradient(circle at 50% 45%, rgba(24, 110, 131, 0.12), transparent 48%),
      #030b12;
  }

  .exp-silhouette {
    display: none;
  }
}

.exp-silhouette {
  position: absolute;
  inset: 90px 34% 55px;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 48% 48% 38% 38%;
  background: linear-gradient(180deg, rgba(30, 67, 84, 0.35), rgba(2, 10, 16, 0.8));
  box-shadow: 0 0 45px rgba(60, 188, 205, 0.08);
}

.exp-silhouette::before {
  position: absolute;
  top: -62px;
  left: 50%;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 50%;
  background: #08151f;
  content: "";
  transform: translateX(-50%);
}

.exp-gear-slot {
  position: absolute;
  display: grid;
  width: 70px;
  min-height: 62px;
  place-items: center;
  overflow: hidden;
  padding: 5px;
  border: 1px solid rgba(255, 191, 52, 0.28);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(3, 15, 23, 0.92);
  font-size: 0.66rem;
  text-align: center;
}

.exp-gear-slot:hover {
  border-color: var(--accent);
  color: var(--text);
}

.exp-gear-slot.is-disabled {
  cursor: not-allowed;
  border-style: dashed;
  border-color: rgba(173, 213, 255, 0.12);
  color: rgba(173, 213, 255, 0.42);
  background: rgba(3, 15, 23, 0.58);
}

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

.exp-gear-tier {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 1px 4px;
  border: 1px solid rgba(101, 214, 206, 0.4);
  border-radius: 999px;
  color: var(--accent-2);
  background: #06131d;
  font-size: 0.58rem;
  line-height: 1.2;
}

.slot-head { top: 16px; left: calc(50% - 35px); }
.slot-chest { top: 150px; left: calc(50% - 35px); }
.slot-hands { top: 105px; right: max(22px, calc(50% - 210px)); }
.slot-legs { top: 270px; left: calc(50% - 35px); }
.slot-feet { bottom: 29px; left: calc(50% - 35px); }
.slot-weapon { top: 190px; left: max(20px, calc(50% - 210px)); }
.slot-offhand { top: 210px; right: max(22px, calc(50% - 210px)); }
.slot-pet { bottom: 28px; right: max(22px, calc(50% - 210px)); }

.exp-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.exp-stat-field {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.exp-stat-field span {
  color: var(--muted);
  font-size: 0.78rem;
}

.exp-stat-field input {
  padding: 6px;
  text-align: right;
}

.stat-label-compact {
  display: none;
}

.exp-stat-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--accent-2);
}

.exp-stat-icon img,
.exp-stat-icon svg {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.exp-secondary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
}

.exp-secondary-heading small {
  color: var(--muted);
  font-size: 0.68rem;
}

.exp-primary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.exp-primary-grid article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border: 1px solid rgba(101, 214, 206, 0.14);
  border-radius: 12px;
  background: rgba(8, 26, 38, 0.68);
}

.exp-primary-grid article > span:nth-child(2) {
  display: grid;
  min-width: 0;
}

.exp-primary-grid small {
  color: var(--muted);
  font-size: 0.65rem;
}

.exp-primary-grid strong { font-size: 0.84rem; }

.exp-primary-grid em {
  color: var(--accent-2);
  font-size: 0.67rem;
  font-style: normal;
  text-align: right;
}

.exp-primary-empty {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.exp-primary-empty small { color: var(--muted); }

.exp-equipment-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: min(62vh, 560px);
  margin-top: 12px;
  overflow-y: auto;
}

.exp-equipment-picker-panel {
  width: min(760px, calc(100vw - 32px));
}

.exp-equipment-picker-panel > input {
  width: 100%;
}

.exp-equipment-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 64px auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(4, 15, 23, 0.72);
  text-align: left;
}

.exp-equipment-option.active {
  border-color: rgba(101, 214, 206, 0.48);
  background: rgba(31, 85, 91, 0.2);
}

.exp-equipment-option-empty {
  grid-template-columns: 44px minmax(0, 1fr);
}

.exp-equipment-option-empty .exp-equipment-option-copy > strong,
.exp-equipment-option-empty .exp-equipment-option-copy > small {
  display: block;
}

.exp-equipment-option-empty .exp-equipment-option-copy > small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.69rem;
}

.exp-pet-equipment-option {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.exp-pet-equipment-option.is-custom {
  grid-template-columns: 44px minmax(0, 1fr) 92px auto;
}

.exp-equipment-option-copy {
  min-width: 0;
}

.exp-equipment-option-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.exp-equipment-option-title strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-equipment-option-title .pet-quality {
  flex: 0 0 auto;
  padding: 2px 6px;
  font-size: 0.61rem;
}

.exp-equipment-option-copy > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.69rem;
  text-transform: capitalize;
}

.exp-equipment-option-copy .exp-equipment-stat-preview {
  color: var(--accent-2);
  line-height: 1.25;
}

.exp-equipment-stat-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.exp-equipment-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border: 1px solid rgba(101, 214, 206, 0.14);
  border-radius: 999px;
  color: #b9d7e8;
  background: rgba(101, 214, 206, 0.05);
  font-size: 0.66rem;
  line-height: 1;
}

.exp-equipment-stat-chip .exp-stance-xp-icon {
  width: 13px;
  height: 13px;
  flex-basis: 13px;
}

.exp-equipment-stat-empty {
  color: var(--muted);
  font-size: 0.69rem;
}

.exp-equipment-tier-control {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

.exp-equipment-tier-control input {
  width: 64px;
  padding: 6px 7px;
  text-align: center;
}

.exp-equipment-tier-control .number-stepper {
  grid-template-columns: 25px minmax(34px, 1fr) 25px;
  width: 92px;
  border-radius: 10px;
}

.exp-equipment-tier-control .number-stepper-button {
  min-height: 34px;
}

.exp-equipment-tier-control .number-stepper input[type="number"] {
  padding: 6px 2px;
}

.exp-equipment-tier-control select {
  width: 64px;
  min-height: 36px;
  padding: 6px 23px 6px 9px;
  border: 1px solid rgba(101, 214, 206, 0.28);
  border-radius: 10px;
  color: var(--text);
  background-color: rgba(2, 13, 20, 0.92);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.exp-equipment-tier-control select:hover,
.exp-equipment-tier-control select:focus {
  border-color: var(--accent-2);
}

.exp-equipment-tier-control select:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.7;
}

.exp-equipment-option img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.exp-equipment-item-icon {
  width: 44px;
  height: 44px;
}

@media (max-width: 680px) {
  .exp-equipment-option {
    grid-template-columns: 44px minmax(0, 1fr) 58px;
  }

  .exp-equipment-option > [data-exp-equipment] {
    grid-column: 2 / 4;
    width: 100%;
  }

  .exp-pet-equipment-option > [data-exp-combat-pet] {
    grid-column: 2 / 4;
    width: 100%;
  }

  .exp-pet-equipment-option.is-custom {
    grid-template-columns: 44px minmax(0, 1fr) 92px;
  }
}

.exp-empty-state {
  display: grid;
  min-height: 128px;
  place-items: center;
  align-content: center;
  padding: 22px 10px;
  color: var(--muted);
  text-align: center;
}

.exp-empty-state[hidden],
.exp-results[hidden] {
  display: none;
}

.exp-empty-state h3 {
  margin: 15px 0 5px;
  color: var(--text);
}

.exp-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(101, 214, 206, 0.25);
  border-radius: 50%;
}

.exp-orbit::before,
.exp-orbit::after {
  position: absolute;
  inset: 12px -13px;
  border: 1px solid rgba(255, 191, 52, 0.2);
  border-radius: 50%;
  content: "";
  transform: rotate(35deg);
}

.exp-orbit::after {
  transform: rotate(-35deg);
}

.exp-orbit span {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(255, 191, 52, 0.45);
}

.exp-results {
  transition: opacity 160ms ease;
}

.exp-results.is-refreshing {
  opacity: 0.55;
  pointer-events: none;
}

.exp-option-identity {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: inherit !important;
}

.exp-option-identity > span:last-child {
  min-width: 0;
}

.exp-route-sequence {
  flex-wrap: nowrap;
  gap: 7px;
  max-width: 100%;
}

.exp-route-sequence-node {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.exp-route-sequence-node > span:last-child:not(.endgame-item-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-route-arrow {
  flex: 0 0 auto;
  color: var(--muted) !important;
  font-size: 0.84rem;
}

.exp-route-more {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted) !important;
  font-size: 0.7rem;
}

.exp-route-icon-fallback {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(3, 15, 23, 0.72);
}

.endgame-item-icon.exp-route-icon,
.exp-route-icon {
  width: var(--icon-size-large);
  height: var(--icon-size-large);
  flex: 0 0 var(--icon-size-large);
}

.endgame-item-icon.exp-route-icon.compact,
.exp-route-icon.compact {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.exp-route-icon img,
.exp-route-icon svg,
.enemy-tooltip-loot-icon img,
.endgame-item-icon img,
.database-loot-primary-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exp-result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(120px, 0.6fr));
  gap: 10px;
  margin-bottom: 15px;
}

.exp-result-metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(8, 23, 34, 0.8);
}

.exp-result-metric > span,
.exp-route-step small {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.exp-result-metric > strong {
  display: block;
  margin-top: 5px;
  font-size: 1.12rem;
}

.exp-xp-metric {
  display: flex;
  flex-direction: column;
}

.exp-stance-xp {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid rgba(173, 213, 255, 0.11);
  cursor: help;
}

.exp-stance-xp.is-focused {
  grid-template-columns: 1fr;
}

.exp-stance-xp-stat {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 4px;
  color: #b9d7e8;
  font-size: 0.7rem;
}

.exp-stance-xp-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: var(--accent-2);
}

.exp-stance-xp-icon img,
.exp-stance-xp-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exp-stance-xp-stat strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-result-metric.primary {
  border-color: rgba(255, 191, 52, 0.3);
  background: linear-gradient(135deg, rgba(255, 191, 52, 0.1), rgba(8, 23, 34, 0.82));
}

.has-location-art {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.has-location-art::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 20, 30, 0.96) 0%, rgba(6, 20, 30, 0.78) 58%, rgba(6, 20, 30, 0.9) 100%),
    linear-gradient(0deg, rgba(6, 20, 30, 0.5), rgba(6, 20, 30, 0.15)),
    var(--exp-location-bg) center 44% / cover no-repeat;
  content: "";
  opacity: 0.72;
  transition: opacity 180ms ease;
}

.exp-result-metric.primary.has-location-art::before {
  background:
    linear-gradient(90deg, rgba(6, 20, 30, 0.95) 0%, rgba(6, 20, 30, 0.69) 62%, rgba(6, 20, 30, 0.86) 100%),
    linear-gradient(0deg, rgba(255, 191, 52, 0.08), rgba(6, 20, 30, 0.1)),
    var(--exp-location-bg) center 44% / cover no-repeat;
  opacity: 0.78;
}

.exp-result-metric.primary strong {
  color: var(--accent);
  font-size: 1.35rem;
}

.exp-result-metric.time {
  border-color: rgba(101, 214, 206, 0.38);
  background:
    linear-gradient(145deg, rgba(101, 214, 206, 0.13), rgba(8, 23, 34, 0.86));
}

.exp-result-metric.time > span::before {
  margin-right: 6px;
  color: var(--accent-2);
  content: "◷";
}

.exp-result-metric.time > strong {
  color: #d9fffb;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 0 20px rgba(101, 214, 206, 0.22);
}

.exp-result-balance {
  display: inline-flex !important;
  align-items: center;
  width: 100%;
  min-height: 24px;
  cursor: help;
}

.exp-economic-pair {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 0.82fr);
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.exp-economic-pair > span:not(.exp-economic-separator) {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.exp-economic-separator {
  width: 1px;
  height: 20px;
  background: rgba(173, 213, 255, 0.16);
}

.exp-economic-rate {
  color: var(--muted);
  font-size: 0.72em;
}

.exp-combat-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: 13px;
}

.exp-combat-controls .field {
  min-width: 0;
}

.exp-combat-controls input {
  width: 100%;
}

.exp-combat-baseline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 14px;
}

.exp-session-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 14px;
}

.exp-session-summary > span {
  padding: 5px 9px;
  border: 1px solid rgba(255, 179, 71, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 179, 71, 0.06);
  font-size: 0.72rem;
}

.exp-session-summary strong {
  color: var(--text);
}

.exp-dungeon-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 14px;
}

.exp-dungeon-summary > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 12px;
  background: rgba(8, 29, 42, 0.62);
}

.exp-dungeon-summary small,
.exp-dungeon-summary em {
  color: var(--muted);
  font-size: 0.69rem;
  font-style: normal;
}

.exp-dungeon-summary strong {
  color: var(--text);
  font-size: 0.83rem;
}

.exp-dungeon-loot {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 12px;
  background: rgba(8, 29, 42, 0.62);
}

.exp-dungeon-loot > small {
  padding-top: 11px;
}

.exp-dungeon-loot > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.exp-dungeon-loot-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
}

.exp-dungeon-loot-item .exp-dungeon-loot-primary {
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.exp-dungeon-loot-item .exp-dungeon-recipe-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  z-index: 2;
  width: 16px;
  height: 16px;
  padding: 1px;
  border: 1px solid rgba(101, 214, 206, 0.34);
  border-radius: 5px;
  background: var(--surface-strong);
  object-fit: contain;
}

.exp-dungeon-loot-item > em,
.exp-dungeon-loot-item > small {
  position: absolute;
  z-index: 1;
  padding: 0 3px;
  border-radius: 4px;
  color: var(--text);
  background: rgba(4, 18, 28, 0.88);
  font-size: 0.57rem;
  line-height: 1.3;
}

.exp-dungeon-overview {
  display: grid;
  gap: 14px;
}

.exp-dungeon-overview .exp-session-summary {
  margin: -4px 0 0;
}

.exp-dungeon-route-strip {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 13px;
  background: rgba(7, 25, 37, 0.58);
}

.exp-dungeon-route-node {
  display: grid;
  grid-template-columns: 28px 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(3, 15, 23, 0.48);
}

.exp-dungeon-route-node > img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.exp-dungeon-route-node > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.exp-dungeon-route-node small {
  color: var(--muted);
  font-size: 0.68rem;
}

.exp-dungeon-potion-note {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 179, 71, 0.2);
  border-radius: 12px;
  background: rgba(255, 179, 71, 0.06);
}

.exp-dungeon-potion-note img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.exp-dungeon-potion-note span {
  display: grid;
  gap: 2px;
}

.exp-dungeon-potion-note small {
  color: var(--muted);
  font-size: 0.7rem;
}

.exp-dungeon-catalog-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 3px;
}

.exp-dungeon-catalog-heading h3,
.exp-dungeon-catalog-heading p {
  margin: 0;
}

.exp-dungeon-catalog-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.exp-dungeon-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exp-dungeon-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 25, 37, 0.76);
  isolation: isolate;
}

.exp-dungeon-card.has-location-art::before {
  opacity: 0.34;
}

.exp-dungeon-card.is-route {
  border-color: rgba(101, 214, 206, 0.48);
  box-shadow: inset 3px 0 0 rgba(101, 214, 206, 0.74);
}

.exp-dungeon-card.is-danger {
  opacity: 0.76;
}

.exp-dungeon-card > summary {
  display: grid;
  grid-template-columns: 23px 46px minmax(120px, 1fr) auto repeat(3, minmax(70px, 0.42fr));
  align-items: center;
  gap: 9px;
  min-height: 78px;
  padding: 10px;
  cursor: pointer;
  list-style: none;
}

.exp-dungeon-card > summary::-webkit-details-marker {
  display: none;
}

.exp-dungeon-card[open] .exp-dungeon-expand-cue,
.exp-dungeon-table-expand.active {
  color: var(--accent-2);
  border-color: rgba(101, 214, 206, 0.35);
  background: rgba(101, 214, 206, 0.08);
}

.exp-dungeon-card[open] .exp-dungeon-expand-cue::before,
.exp-dungeon-table-expand.active::before {
  transform: rotate(45deg) translate(-1px, -1px);
}

.exp-dungeon-card-image {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 12px;
  background: rgba(3, 15, 23, 0.68);
}

.exp-dungeon-card-image img,
.exp-dungeon-card-image svg {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.exp-dungeon-card-copy,
.exp-dungeon-card-metric {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.exp-dungeon-card-copy strong,
.exp-dungeon-card-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-dungeon-card-copy small,
.exp-dungeon-card-metric small {
  color: var(--muted);
  font-size: 0.64rem;
}

.exp-dungeon-card-metric strong {
  color: var(--text);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.exp-dungeon-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(3, 15, 23, 0.58);
  font-size: 0.62rem;
  white-space: nowrap;
}

.exp-dungeon-status.is-route,
.exp-dungeon-status.is-available {
  border-color: rgba(101, 214, 206, 0.3);
  color: var(--accent-2);
}

.exp-dungeon-status.is-warning {
  border-color: rgba(255, 191, 52, 0.28);
  color: var(--accent);
}

.exp-dungeon-status.is-danger {
  border-color: rgba(255, 112, 112, 0.28);
  color: #ff9f9f;
}

.exp-dungeon-expanded {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.exp-dungeon-power {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 11px;
  background: rgba(3, 15, 23, 0.56);
  cursor: help;
}

.exp-dungeon-power > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.66rem;
}

.exp-dungeon-power-track {
  position: relative;
  display: block;
  height: 10px;
  margin: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #344454 0 33%, #24815e 33% 67%, #b39735 67% 100%);
}

.exp-dungeon-power-track > b {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 3px solid #c1ccd5;
  border-radius: 50%;
  background: #516274;
  transform: translate(-50%, -50%);
}

.exp-dungeon-threshold {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: rgba(101, 214, 206, 0.88);
  transform: translateX(-50%);
}

.exp-dungeon-power > small {
  color: var(--muted);
  font-size: 0.64rem;
}

.exp-dungeon-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.exp-dungeon-detail-grid > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(173, 213, 255, 0.08);
  border-radius: 9px;
  background: rgba(3, 15, 23, 0.38);
}

.exp-dungeon-detail-grid small,
.exp-dungeon-detail-grid em {
  color: var(--muted);
  font-size: 0.61rem;
  font-style: normal;
}

.exp-dungeon-detail-grid strong {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}

.exp-dungeon-detail-grid img {
  width: 15px;
  height: 15px;
}

.exp-dungeon-table-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.exp-dungeon-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.exp-dungeon-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  table-layout: fixed;
}

.exp-dungeon-table th,
.exp-dungeon-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.7rem;
}

.exp-dungeon-table th:first-child,
.exp-dungeon-table td:first-child {
  width: 24%;
}

.exp-dungeon-table-row.is-route {
  background: rgba(101, 214, 206, 0.05);
  box-shadow: inset 3px 0 0 rgba(101, 214, 206, 0.68);
}

.exp-dungeon-table-row td:nth-child(3) {
  display: table-cell;
}

.exp-dungeon-table-row td:nth-child(3) small {
  display: block;
  color: var(--muted);
}

.exp-dungeon-table-expand {
  margin-right: 7px;
}

.exp-dungeon-table-name-cell {
  display: flex;
  align-items: center;
  min-width: 0;
}

.exp-dungeon-table-identity {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 38px);
  vertical-align: middle;
}

.exp-dungeon-table-identity img {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.exp-dungeon-table-identity > span {
  display: grid;
  min-width: 0;
}

.exp-dungeon-table-identity strong,
.exp-dungeon-table-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-dungeon-table-identity small {
  color: var(--muted);
}

.exp-dungeon-table-details > td {
  padding: 11px;
  background: rgba(3, 15, 23, 0.48);
}

.exp-dungeon-table-details .exp-dungeon-expanded {
  padding: 0;
}

@media (max-width: 1300px) {
  .exp-dungeon-catalog {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .exp-dungeon-loot {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .exp-dungeon-loot > small {
    padding-top: 0;
  }

  .exp-dungeon-catalog-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .exp-dungeon-catalog-heading .boss-view-switch {
    width: 100%;
  }

  .exp-dungeon-catalog-heading .boss-view-button {
    flex: 1 1 0;
  }

  .exp-dungeon-card > summary {
    grid-template-columns: 23px 42px repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .exp-dungeon-card-image {
    width: 42px;
    height: 42px;
  }

  .exp-dungeon-card-copy {
    grid-column: 3 / -1;
  }

  .exp-dungeon-status {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .exp-dungeon-card-metric:nth-last-child(3) {
    grid-column: 2 / 3;
  }

  .exp-dungeon-card-metric:nth-last-child(2) {
    grid-column: 3 / 5;
  }

  .exp-dungeon-card-metric:last-child {
    grid-column: 5 / 6;
  }

  .exp-dungeon-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exp-dungeon-route-node {
    grid-template-columns: 25px 34px minmax(0, 1fr);
    padding: 5px;
  }

  .exp-dungeon-route-node > img {
    width: 34px;
    height: 34px;
  }
}

.exp-dungeon-loot-item > em {
  top: 1px;
  left: 1px;
}

.exp-dungeon-loot-item > small {
  right: 1px;
  bottom: 1px;
}

.exp-forecast-step-summary,
.exp-forecast-step-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exp-forecast-step-badges {
  margin-left: 2px;
}

.exp-forecast-step-badge {
  width: 18px;
  height: 18px;
  cursor: help;
  font-size: 0.58rem;
}

.exp-forecast-step-badge.is-partial {
  color: var(--accent);
  background: rgba(255, 191, 52, 0.1);
}

.exp-combat-baseline > span {
  padding: 5px 9px;
  border: 1px solid rgba(101, 214, 206, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(101, 214, 206, 0.06);
  font-size: 0.72rem;
}

.exp-combat-baseline > span:first-child,
.exp-combat-baseline strong {
  color: var(--text);
}

.exp-combat-location-identity {
  min-width: 0;
}

.exp-encounter-mix {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.exp-encounter-mix:not(.detailed) .exp-encounter-chip + .exp-encounter-chip {
  margin-left: -8px;
}

.exp-encounter-mix:not(.detailed) .exp-route-icon {
  border: 2px solid #102738;
  border-radius: 50%;
  background: #071722;
}

.exp-encounter-mix.detailed {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.exp-encounter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.exp-encounter-mix.detailed .exp-encounter-chip {
  padding: 4px 7px 4px 4px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 10px;
  background: rgba(4, 17, 26, 0.55);
}

.exp-encounter-chip > span:last-child {
  min-width: 0;
}

.exp-encounter-chip strong,
.exp-encounter-chip small {
  display: block;
}

.exp-encounter-chip strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-encounter-chip small {
  font-size: 0.66rem;
}

.exp-route-step.exp-combat-route-step {
  display: block;
  padding: 11px 0;
}

.exp-combat-route-summary {
  display: grid;
  grid-template-columns: 34px 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.exp-combat-route-summary.has-location-art {
  margin-inline: 2px;
  padding: 7px 9px;
  border-radius: 11px;
}

.exp-combat-route-step[open] > .exp-combat-route-summary.has-location-art::before {
  opacity: 0.18;
}

.exp-combat-route-summary::-webkit-details-marker {
  display: none;
}

.exp-combat-route-summary:hover .exp-combat-route-title > strong,
.exp-combat-route-summary:focus-visible .exp-combat-route-title > strong {
  color: var(--accent-2);
}

.exp-combat-route-details {
  margin: 8px 34px 0 62px;
  padding: 9px 11px 11px;
  border: 1px solid rgba(101, 214, 206, 0.12);
  border-radius: 12px;
  background: rgba(3, 15, 23, 0.42);
}

.exp-route-expand {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent-2);
  font-size: 0.86rem;
  font-weight: 800;
  transition: color 160ms ease, transform 160ms ease;
}

.exp-combat-route-step[open] .exp-route-expand {
  color: var(--accent-2);
  transform: rotate(180deg);
}

.exp-combat-route-copy {
  min-width: 0;
}

.exp-combat-route-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.exp-combat-route-title > strong {
  min-width: 0;
}

.exp-combat-route-title .exp-encounter-mix {
  flex: 0 0 auto;
}

.exp-combat-route-title .exp-route-icon.compact {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

.exp-combat-step-detail {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.7rem;
}

.exp-step-detail-label {
  font-weight: 700;
}

.exp-step-detail-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.exp-weather-chip,
.exp-economy-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(101, 214, 206, 0.2);
  border-radius: 999px;
  color: #bde9e5;
  background: rgba(101, 214, 206, 0.07);
  white-space: nowrap;
}

.exp-weather-chip.is-neutral {
  border-color: rgba(173, 213, 255, 0.12);
  color: var(--muted);
  background: rgba(173, 213, 255, 0.04);
}

.exp-economy-chip {
  min-height: 22px;
  padding: 2px 7px 2px 3px;
  color: var(--text);
}

.exp-economy-item-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.exp-economy-empty {
  color: var(--muted);
  font-style: italic;
}

.exp-combat-step-detail > strong,
.exp-combat-step-net strong {
  color: var(--text);
  white-space: nowrap;
}

.exp-combat-step-net {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
  color: var(--muted);
  font-size: 0.7rem;
}

.exp-gold-value,
.exp-balance-metric .exp-result-balance {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 4px 8px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 9px;
  background: rgba(3, 15, 23, 0.55);
  font-variant-numeric: tabular-nums;
}

.exp-gold-value.is-profit,
.exp-gold-value.is-return,
.exp-balance-metric.is-profit .exp-result-balance {
  border-color: rgba(105, 219, 124, 0.24);
  color: var(--positive);
  background: rgba(105, 219, 124, 0.07);
}

.exp-gold-value.is-cost,
.exp-balance-metric.is-cost .exp-result-balance {
  border-color: rgba(255, 143, 143, 0.24);
  color: #ffc2a8;
  background: rgba(255, 143, 143, 0.07);
}

.exp-route-timing {
  min-width: 145px;
  text-align: right;
}

.enemy-tooltip-loot {
  display: grid;
  gap: 5px;
}

.enemy-tooltip-loot-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.enemy-tooltip-loot-icon {
  display: grid;
  width: 30px;
  height: 30px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(173, 213, 255, 0.13);
  border-radius: 8px;
  background: rgba(3, 15, 23, 0.65);
}

.enemy-tooltip-loot-row strong,
.enemy-tooltip-loot-row small {
  display: block;
}

.enemy-tooltip-loot-row strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enemy-tooltip-loot-row small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.66rem;
}

.exp-route-timing > strong {
  display: block;
  color: #d9fffb;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.exp-route-timing > small {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.exp-route-timing > small span {
  padding: 3px 6px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 7px;
  background: rgba(3, 15, 23, 0.5);
  white-space: nowrap;
}

.exp-route-timing > small b {
  color: var(--accent-2);
  font-weight: 700;
}

.rich-tooltip-note {
  margin: 9px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(173, 213, 255, 0.12);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.exp-route-card h3 {
  margin-bottom: 12px;
}

.exp-route-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
}

.exp-route-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-2);
  background: rgba(101, 214, 206, 0.1);
  font-size: 0.7rem;
}

.exp-alternatives {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
  gap: 10px;
}

.exp-alternative-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 168px;
  margin: 0;
  overflow: hidden;
}

.exp-alternative-card.has-location-art::before {
  background:
    linear-gradient(90deg, rgba(6, 20, 30, 0.94) 0%, rgba(6, 20, 30, 0.76) 58%, rgba(6, 20, 30, 0.89) 100%),
    linear-gradient(0deg, rgba(6, 20, 30, 0.45), rgba(6, 20, 30, 0.12)),
    var(--exp-location-bg) center 46% / cover no-repeat;
  opacity: 0.76;
}

.exp-alternative-card.has-location-art .exp-alternative-metrics > span {
  background: rgba(3, 15, 23, 0.68);
  backdrop-filter: blur(2px);
}

.exp-alternative-card > header {
  min-height: 48px;
}

.exp-alternative-card > header .exp-option-identity {
  align-items: flex-start;
}

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

.exp-alternative-metrics > span {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 10px;
  background: rgba(3, 15, 23, 0.42);
}

.exp-alternative-metrics small,
.exp-alternative-card > footer small {
  color: var(--muted);
  font-size: 0.64rem;
}

.exp-alternative-metrics strong {
  color: var(--accent-2);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.exp-alternative-card > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  min-height: 35px;
  padding-top: 9px;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
}

.exp-alternative-balance {
  display: inline-flex;
  align-items: center;
  min-width: min(210px, 68%);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.exp-alternative-balance .exp-economic-pair {
  gap: 6px;
  font-size: 0.78rem;
}

.exp-alternative-balance .exp-economic-rate {
  font-size: 0.88em;
}

.exp-alternative-card.is-profit {
  border-color: rgba(105, 219, 124, 0.24);
}

.exp-alternative-card.is-profit .exp-alternative-balance {
  color: var(--positive);
}

.exp-alternative-card.is-cost {
  border-color: rgba(255, 143, 143, 0.2);
}

.exp-alternative-card.is-cost .exp-alternative-balance {
  color: #ffc2a8;
}

.exp-warnings {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 191, 52, 0.22);
  border-radius: 13px;
  color: #d9c89a;
  background: rgba(255, 191, 52, 0.06);
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .exp-workspace,
  .exp-combat-layout {
    grid-template-columns: 1fr;
  }

  .exp-setup {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .exp-result-hero {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exp-result-metric.primary {
    grid-column: 1 / -1;
  }

  .exp-plan-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #expGatheringToolField {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .exp-panel-header {
    padding-bottom: 14px;
  }

  .exp-skill-stage {
    margin-top: 13px;
    padding: 10px;
  }

  .exp-skill-bar {
    display: none;
  }

  .exp-skill-mobile-select {
    display: block;
  }

  .exp-skill-stage > .exp-field-note {
    margin-top: 7px;
  }

  .exp-workspace {
    min-height: 0;
  }

  .exp-setup,
  .exp-main {
    padding: 14px;
  }

  .exp-character-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .exp-character-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .exp-character-card img,
  .exp-character-card .exp-character-fallback {
    width: 34px;
    height: 34px;
  }

  .exp-character-sync {
    grid-column: 2;
    grid-template-columns: auto auto;
    justify-content: start;
    justify-items: start;
    gap: 6px;
  }

  .exp-level-grid,
  .exp-result-hero,
  .exp-plan-controls {
    grid-template-columns: 1fr;
  }

  #expGatheringToolField {
    grid-column: auto;
  }

  .exp-calculation-effects {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .exp-effect-badges {
    width: 100%;
  }

  .exp-effect-badge {
    max-width: 100%;
    white-space: normal;
  }

  .exp-combat-layout {
    gap: 14px;
  }

  .exp-combat-controls {
    grid-template-columns: 1fr 0.7fr;
  }

  .exp-loadout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    min-height: 0;
    padding: 10px;
  }

  .exp-silhouette {
    display: none;
  }

  .exp-gear-slot,
  .slot-head,
  .slot-chest,
  .slot-hands,
  .slot-legs,
  .slot-feet,
  .slot-weapon,
  .slot-offhand,
  .slot-pet {
    position: relative;
    inset: auto;
    width: 100%;
    min-width: 0;
    min-height: 76px;
  }

  .exp-gear-slot > span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .exp-stat-grid,
  .exp-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-label-full {
    display: none;
  }

  .stat-label-compact {
    display: inline;
  }

  .exp-stat-field {
    grid-template-columns: 22px minmax(38px, 1fr) minmax(86px, 0.8fr);
    gap: 4px;
    padding: 6px;
  }

  .exp-stat-field > span:nth-child(2) {
    overflow: hidden;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .exp-stat-field .number-stepper {
    grid-template-columns: 24px minmax(32px, 1fr) 24px;
  }

  .exp-primary-grid article {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 5px;
    padding: 7px;
  }

  .exp-primary-grid em {
    font-size: 0.63rem;
    white-space: nowrap;
  }

  .exp-result-metric.primary {
    grid-column: auto;
  }

  .exp-combat-route-step {
    padding: 9px 0;
  }

  .exp-combat-route-summary {
    grid-template-columns: 28px 18px minmax(0, 1fr);
    gap: 8px;
  }

  .has-location-art::before,
  .exp-result-metric.primary.has-location-art::before {
    background-position: center 50%;
  }

  .exp-route-timing {
    grid-column: 3;
    grid-row: 2;
    min-width: 0;
    text-align: left;
  }

  .exp-route-expand {
    grid-column: 2;
    grid-row: 1;
  }

  .exp-route-timing > small {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .exp-combat-route-details {
    margin: 8px 0 0 54px;
  }

  .exp-encounter-mix.detailed .exp-encounter-chip {
    max-width: 100%;
  }

  .exp-combat-step-detail {
    grid-template-columns: 1fr auto;
  }

  .exp-step-detail-items {
    grid-column: 1 / -1;
  }

  .exp-alternative-card {
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .exp-loadout,
  .exp-stat-grid,
  .exp-primary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .exp-dungeon-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.character-console {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 9px 22px 12px;
  border-top: 1px solid rgba(173, 213, 255, 0.08);
  background: rgba(3, 13, 20, 0.2);
}

.character-console-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.character-state-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 5px rgba(158, 184, 207, 0.08);
}

.character-state-dot.is-ready { background: #69db9a; box-shadow: 0 0 0 5px rgba(105, 219, 154, 0.09); }
.character-state-dot.is-busy { background: var(--accent); box-shadow: 0 0 0 5px rgba(255, 179, 71, 0.09); }
.character-state-dot.is-error { background: var(--negative); box-shadow: 0 0 0 5px rgba(255, 143, 143, 0.09); }

.character-state-text {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.character-manager-shell {
  position: relative;
  flex: 0 0 auto;
}

.character-manager-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border-color: rgba(255, 179, 71, 0.34);
  color: #ffd27c;
  background: rgba(255, 179, 71, 0.08);
  font-size: 0.8rem;
  font-weight: 800;
}

.character-manager-button[aria-expanded="true"] {
  border-color: rgba(255, 179, 71, 0.62);
  background: rgba(255, 179, 71, 0.14);
}

.character-manager-popover {
  position: absolute;
  z-index: 58;
  top: calc(100% + 10px);
  right: 0;
  width: min(430px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid rgba(173, 213, 255, 0.22);
  border-radius: 18px;
  background: rgba(6, 18, 27, 0.99);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.46);
}

.character-manager-popover[hidden] { display: none; }

.character-manager-heading,
.character-manager-input-row,
.character-manager-item,
.character-manager-item-main {
  display: flex;
  align-items: center;
}

.character-manager-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.character-manager-heading strong,
.character-manager-heading span { display: block; }
.character-manager-heading span { margin-top: 3px; color: var(--muted); font-size: 0.75rem; }

.character-manager-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  font-size: 1.25rem;
}

.character-manager-field { margin: 0 0 13px; }
.character-manager-input-row { gap: 8px; }
.character-manager-input-row input { min-width: 0; }
.character-manager-input-row .primary { flex: 0 0 auto; }

.character-manager-list {
  display: grid;
  gap: 7px;
  max-height: 300px;
  overflow-y: auto;
}

.character-manager-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 13px;
  background: rgba(13, 31, 44, 0.7);
}

.character-manager-item.has-character-art::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 22, 32, 0.92) 0%, rgba(7, 22, 32, 0.7) 58%, rgba(7, 22, 32, 0.9) 100%),
    linear-gradient(0deg, rgba(7, 22, 32, 0.3), rgba(7, 22, 32, 0.06)),
    var(--character-manager-bg) center 36% / cover no-repeat;
  content: "";
  opacity: 0.72;
  transition: opacity 180ms ease, transform 240ms ease;
}

.character-manager-item.has-character-art:hover::before {
  opacity: 0.88;
  transform: scale(1.02);
}

.character-manager-item-expired {
  border-color: rgba(255, 143, 143, 0.22);
  background: rgba(77, 28, 35, 0.18);
}

.character-manager-item-main { gap: 9px; min-width: 0; }
.character-manager-item-copy { min-width: 0; }
.character-manager-item-copy strong,
.character-manager-item-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.character-manager-item-copy span { margin-top: 2px; color: var(--muted); font-size: 0.7rem; }
.character-resync-button { flex: 0 0 auto; padding: 7px 9px; border-radius: 10px; font-size: 0.7rem; }
.character-resync-button:disabled { cursor: default; opacity: 0.52; transform: none; }
.character-manager-item-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.character-manager-icon-button {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  padding: 0;
  border-radius: 10px;
  color: var(--accent-2);
  background: rgba(6, 18, 27, 0.72);
}

.character-manager-icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.character-manager-icon-button.is-remove {
  border-color: rgba(255, 143, 143, 0.28);
  color: var(--negative);
  font-size: 1.2rem;
}

.character-manager-icon-button.is-remove:hover {
  border-color: rgba(255, 143, 143, 0.58);
  background: rgba(255, 143, 143, 0.13);
}

.character-forget-button { padding: 7px 8px; border: 0; color: var(--muted); background: transparent; font-size: 0.68rem; }
.character-forget-button:hover { color: var(--negative); background: rgba(255, 143, 143, 0.08); }

.tracked-character-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.tracked-character-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.tracked-character-chip {
  padding: 0;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(173, 213, 255, 0.16);
  background: var(--control-bg);
}

.tracked-character-chip.is-active {
  border-color: rgba(101, 214, 206, 0.45);
  box-shadow: 0 0 0 2px rgba(101, 214, 206, 0.14);
}

.tracked-character-chip-queued,
.tracked-character-chip-syncing {
  border-color: rgba(255, 179, 71, 0.34);
  background: rgba(255, 179, 71, 0.08);
}

.tracked-character-chip-syncing {
  box-shadow: 0 0 0 2px rgba(255, 179, 71, 0.1);
}

.tracked-character-chip-error {
  border-color: rgba(255, 110, 110, 0.38);
  background: rgba(255, 110, 110, 0.08);
}

.tracked-character-chip-expired {
  border-color: rgba(255, 143, 143, 0.48);
  background: rgba(77, 28, 35, 0.34);
  filter: saturate(0.72);
}

.tracked-character-expired-mark {
  position: absolute;
  top: -5px;
  right: -4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border: 2px solid #081722;
  border-radius: 999px;
  color: #081722;
  background: var(--negative);
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1;
}

.tracked-character-avatar-shell {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
}

.tracked-character-avatar-clip {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
}

.tracked-character-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2) translateY(-1px);
  transform-origin: center top;
}

.tracked-character-avatar-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: rgba(22, 47, 66, 0.96);
  color: var(--text);
  font-weight: 800;
}

.membership-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  display: block;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.42));
}

.membership-badge-tracked,
.membership-badge-character,
.membership-badge-settings {
  width: 14px;
  height: 14px;
}

.membership-badge-tooltip,
.membership-badge-boss-location {
  width: 12px;
  height: 12px;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-tab.active {
  border-color: rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.12);
  color: #ffe2b5;
}

.nav-tab-icon,
.hero-button {
  display: grid;
  place-items: center;
}

.nav-tab-icon svg,
.hero-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero-button {
  width: 39px;
  height: 39px;
  padding: 0;
  border-radius: 13px;
  border-color: rgba(101, 214, 206, 0.35);
  background: rgba(101, 214, 206, 0.1);
  color: var(--accent-2);
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.layout > .section-panel {
  min-width: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--panel);
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header p {
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.field-inline {
  max-width: 320px;
}

.search-filter-field {
  min-width: 0;
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--control-bg);
  color: var(--text);
}

.number-stepper {
  display: grid;
  grid-template-columns: 34px minmax(42px, 1fr) 34px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--control-bg);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.number-stepper:focus-within {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(101, 214, 206, 0.09);
}

.number-stepper input[type="number"] {
  min-width: 0;
  padding: 10px 5px;
  border: 0;
  border-right: 1px solid rgba(173, 213, 255, 0.1);
  border-left: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.number-stepper input[type="number"]::-webkit-inner-spin-button,
.number-stepper input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.number-stepper-button {
  display: grid;
  min-width: 0;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: rgba(173, 213, 255, 0.025);
  font-size: 1.05rem;
  line-height: 1;
}

.number-stepper-button:hover,
.number-stepper-button:focus-visible {
  color: var(--text);
  background: rgba(101, 214, 206, 0.12);
  transform: none;
}

.exp-stat-field {
  grid-template-columns: 24px minmax(0, 1fr) minmax(104px, 0.75fr);
}

.exp-stat-field .number-stepper {
  grid-template-columns: 27px minmax(38px, 1fr) 27px;
  border-radius: 10px;
}

.exp-stat-field .number-stepper-button {
  min-height: 32px;
}

.exp-stat-field .number-stepper input[type="number"] {
  padding: 6px 3px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

button {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 28, 40, 0.9);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease,
    box-shadow 120ms ease,
    color 120ms ease;
}

button:hover,
.nav-tab:hover,
.hero-button:hover,
.multi-filter-toggle:hover,
.market-switch:hover {
  border-color: rgba(173, 213, 255, 0.28);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

button.primary:hover,
.nav-tab.active:hover {
  border-color: rgba(255, 179, 71, 0.56);
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.28), rgba(255, 179, 71, 0.14));
}

.hero-button:hover,
.market-switch:hover {
  border-color: rgba(101, 214, 206, 0.5);
  background: rgba(101, 214, 206, 0.14);
}

button:active,
.nav-tab:active,
.hero-button:active,
.multi-filter-toggle:active,
.market-switch:active {
  transform: translateY(0);
}

button.primary {
  border-color: rgba(255, 179, 71, 0.5);
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.22), rgba(255, 179, 71, 0.1));
  color: #ffe2b5;
}

.settings-block {
  margin-bottom: 18px;
}

.tracked-settings-list {
  display: grid;
  gap: 10px;
}

.tracked-settings-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 15, 23, 0.52);
}

.tracked-settings-summary {
  grid-column: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.tracked-settings-summary span {
  padding: 3px 7px;
  border: 1px solid rgba(101, 214, 206, 0.2);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(101, 214, 206, 0.06);
  font-size: 0.66rem;
}

.tracked-settings-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 7px;
}

.tracked-house-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.tracked-house-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1;
}

.tracked-house-toggle::after {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
}

.tracked-house-menu {
  max-height: 250px;
  padding: 6px;
}

.tracked-settings-remove {
  min-height: 42px;
}

.settings-crystal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 18px;
}

.settings-crystal-grid .field {
  min-width: 0;
  margin-bottom: 0;
}

.settings-transfer-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 15, 23, 0.44);
}

.settings-transfer-block h3,
.settings-transfer-block p {
  margin: 0;
}

.settings-transfer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-import-preview {
  display: grid;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(101, 214, 206, 0.28);
  border-radius: 12px;
  background: rgba(101, 214, 206, 0.07);
}

.settings-import-preview[hidden] {
  display: none;
}

.settings-transfer-privacy {
  color: var(--muted);
  font-size: 0.68rem;
}

.tracked-settings-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.tracked-settings-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 999px;
  object-fit: cover;
  transform: scale(1.18) translateY(-1px);
  transform-origin: center top;
  background: rgba(6, 15, 23, 0.92);
}

.tracked-settings-avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--text);
  font-weight: 800;
}

.tracked-settings-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tracked-settings-copy strong,
.tracked-settings-copy span,
.tracked-settings-copy code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tracked-settings-copy span,
.tracked-settings-copy code,
.tracked-settings-empty {
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.metric-card,
.boss-metric-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-card);
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 2rem;
}

.metric-label,
.metric-note {
  color: var(--muted);
}

.coverage-block {
  margin-top: 18px;
}

.control-bar > .field {
  margin: 0;
}

.filters {
  display: grid;
  grid-template-columns:
    minmax(240px, 1.4fr)
    minmax(160px, .9fr)
    minmax(150px, .85fr)
    minmax(180px, 1fr)
    max-content;
  gap: 12px;
  align-items: end;
}

.market-control-bar {
  margin-bottom: 14px;
}

.market-control-bar input[type="search"],
.market-control-bar .multi-filter-toggle,
.market-control-bar .market-switch {
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
}

.market-control-bar input[type="search"] {
  padding-block: 0;
}

.market-chain-field {
  min-width: 0;
}

.market-option-switches {
  display: flex;
  align-items: center;
  gap: 6px;
}

.market-option-switches .market-switch {
  padding-inline: 10px;
  gap: 7px;
}

.market-chain-label {
  opacity: 0;
  pointer-events: none;
}

.market-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: var(--radius-pill);
  background: rgba(9, 21, 30, 0.62);
  min-height: var(--control-height);
  align-self: stretch;
  white-space: nowrap;
}

.location-filter-field {
  min-width: 0;
}

.multi-filter-field {
  min-width: 0;
}

.multi-filter {
  position: relative;
}

.multi-filter-toggle {
  width: 100%;
  min-height: var(--control-height);
  justify-content: space-between;
  border-radius: var(--radius-control);
  border: 1px solid var(--line);
  background: var(--control-bg);
  color: var(--text);
  text-align: left;
}

.multi-filter-toggle::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.9rem;
}

.multi-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 15;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-menu);
  background: rgba(10, 24, 35, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color);
}

.multi-filter-menu::-webkit-scrollbar,
.modal-panel::-webkit-scrollbar {
  width: 10px;
}

.multi-filter-menu::-webkit-scrollbar-track,
.modal-panel::-webkit-scrollbar-track {
  border-radius: var(--radius-pill);
  background: var(--scrollbar-track);
}

.multi-filter-menu::-webkit-scrollbar-track { margin: 8px 2px; }
.modal-panel::-webkit-scrollbar-track { margin: 12px 2px; }

.multi-filter-menu::-webkit-scrollbar-thumb,
.modal-panel::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 17, 25, 0.86);
  border-radius: var(--radius-pill);
  background: var(--scrollbar-thumb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.multi-filter-menu::-webkit-scrollbar-thumb:hover,
.modal-panel::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.multi-filter-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
}

.multi-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
}

.multi-filter-option:hover {
  background: rgba(255, 255, 255, 0.04);
}

.multi-filter-option input {
  width: auto;
  margin: 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.opportunity-table {
  table-layout: fixed;
}

.opportunity-table col.col-item {
  width: clamp(350px, 26vw, 470px);
}

.opportunity-table col.col-skill {
  width: 52px;
}

.opportunity-table col.col-characters {
  width: 130px;
}

.opportunity-table col.col-sell,
.opportunity-table col.col-cost {
  width: 78px;
}

.opportunity-table col.col-profit-item {
  width: 84px;
}

.opportunity-table col.col-demand {
  width: 108px;
}

.opportunity-table col.col-profit-hour {
  width: 102px;
}

.opportunity-table col.col-crystal {
  width: clamp(291px, 20vw, 360px);
}

thead th {
  position: sticky;
  top: 0;
  background: var(--panel-strong);
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.opportunity-table th,
.opportunity-table td {
  min-width: 0;
}

.opportunity-table th {
  height: var(--table-header-height);
  font-size: .72rem;
  line-height: 1;
  vertical-align: middle;
}

.opportunity-table td:not(:first-child) {
  font-size: .78rem;
  line-height: 1.15;
}

.opportunity-table th:nth-child(2),
.opportunity-table td:nth-child(2) {
  padding-right: 8px;
}

.opportunity-table th:nth-child(3),
.opportunity-table td:nth-child(3) {
  padding-left: 8px;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tr.opportunity-row {
  cursor: pointer;
}

.opportunity-table tbody tr.opportunity-row > td {
  vertical-align: middle;
}

tr.opportunity-row.expanded {
  background: rgba(101, 214, 206, 0.04);
}

tr.opportunity-row.chain-row {
  background:
    linear-gradient(90deg, rgba(101, 214, 206, 0.08), rgba(101, 214, 206, 0.02) 18%, transparent 42%);
}

tr.opportunity-row.chain-row:hover {
  background:
    linear-gradient(90deg, rgba(101, 214, 206, 0.12), rgba(101, 214, 206, 0.03) 22%, rgba(255, 255, 255, 0.02));
}

tr.opportunity-row.chain-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(101, 214, 206, 0.42);
}

tr.history-row:hover {
  background: transparent;
}

tr.history-row td {
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.item-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

.item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.item-title-main {
  min-width: 0;
  flex: 1 1 auto;
}

.item-title-main-chain {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 26px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}

.item-title-main strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.item-title-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: 12px;
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 0;
}

.construction-warning {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid rgba(255, 179, 71, 0.42);
  border-radius: 9px;
  background: rgba(255, 179, 71, 0.1);
  color: #ffc76f;
}

.construction-warning svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.item-icon,
.item-icon-fallback,
.context-thumb {
  flex: 0 0 auto;
  object-fit: cover;
}

.item-icon,
.item-icon-fallback {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 15, 23, 0.78);
}

.item-icon-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-weight: 700;
  text-transform: uppercase;
}

.context-thumb {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.context-thumb-fallback {
  display: inline-grid;
  place-items: center;
  background: rgba(6, 15, 23, 0.78);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(101, 214, 206, 0.24);
  background: rgba(101, 214, 206, 0.05);
}

.skill-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  background: linear-gradient(180deg, rgba(18, 37, 52, 0.9), rgba(10, 22, 32, 0.96));
  color: #8fa3b9;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.skill-icon-svg {
  display: inline-flex;
  width: 18px;
  height: 18px;
}

.skill-icon-svg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.weather-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid rgba(101, 214, 206, 0.24);
  background: rgba(101, 214, 206, 0.08);
  color: var(--accent-2);
  overflow: hidden;
  isolation: isolate;
}

.weather-pill.has-location-thumb {
  width: 38px;
  min-width: 38px;
  padding: 3px 6px;
}

.weather-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--weather-progress, 100%);
  background: linear-gradient(90deg, rgba(101, 214, 206, 0.26), rgba(101, 214, 206, 0.12));
  z-index: 1;
  transition: width 0.35s linear;
}

.weather-pill-location-thumb {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  opacity: 0.32;
  filter: saturate(0.82) contrast(0.92);
}

.weather-pill-icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.weather-pill.has-location-thumb .weather-pill-icon {
  border-radius: 999px;
  background: rgba(4, 14, 22, 0.58);
  color: #8af4eb;
}

.weather-pill.weather-tone-clear .weather-pill-icon { color: #ddc57d; }
.weather-pill.weather-tone-overcast .weather-pill-icon { color: #adbac2; }
.weather-pill.weather-tone-rain .weather-pill-icon { color: #7fb6c8; }
.weather-pill.weather-tone-fog .weather-pill-icon { color: #a7b4b9; }
.weather-pill.weather-tone-storm .weather-pill-icon { color: #929bc5; }
.weather-pill.weather-tone-magic-storm .weather-pill-icon { color: #ae97c4; }
.weather-pill.weather-tone-windy .weather-pill-icon { color: #82b9aa; }
.weather-pill.weather-tone-snow .weather-pill-icon { color: #b6d0d7; }
.weather-pill.weather-tone-heatwave .weather-pill-icon { color: #cc9476; }

.weather-pill-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.combat-benchmark-row {
  background: linear-gradient(90deg, rgba(126, 110, 255, 0.14), rgba(85, 111, 205, 0.05) 44%, transparent);
}

.combat-benchmark-row td:first-child {
  box-shadow: inset 3px 0 0 rgba(139, 123, 255, 0.82);
}

.combat-benchmark-row:hover {
  background: linear-gradient(90deg, rgba(126, 110, 255, 0.19), rgba(85, 111, 205, 0.07) 48%, rgba(13, 29, 43, 0.35));
}

.benchmark-combat-icon {
  display: grid;
  place-items: center;
  color: #b7adff;
  border-color: rgba(139, 123, 255, 0.28);
  background: linear-gradient(180deg, rgba(78, 66, 150, 0.36), rgba(16, 24, 48, 0.9));
}

.benchmark-combat-icon svg {
  width: 22px;
  height: 22px;
}

.benchmark-item-cell .item-body {
  display: grid;
  grid-template-columns: minmax(126px, 1fr) minmax(130px, 170px);
  align-items: center;
  gap: 7px;
}

.benchmark-tag {
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid rgba(139, 123, 255, 0.36);
  border-radius: 999px;
  color: #c1b9ff;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.benchmark-loadout-button {
  min-height: 25px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 0.66rem;
}

.benchmark-inline-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  height: 30px;
  padding: 3px 8px;
  border-radius: 9px;
  font-size: 0.7rem;
  text-overflow: ellipsis;
}

.benchmark-inline-select::after {
  grid-column: 2;
  grid-row: 1;
  line-height: 1;
}

.benchmark-inline-select > span {
  grid-column: 1;
  grid-row: 1;
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.benchmark-select-popover {
  position: fixed;
  right: auto;
  z-index: 63;
  max-height: min(320px, calc(100dvh - 24px));
}

.benchmark-select-option {
  width: 100%;
  grid-template-columns: 25px minmax(0, 1fr) 22px;
}

.benchmark-select-option > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.benchmark-select-option .database-option-svg img {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  object-fit: cover;
}

.benchmark-location-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.benchmark-location-control:not(:has(.benchmark-weather-icon)) {
  grid-template-columns: minmax(0, 1fr);
}

.benchmark-weather-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(101, 214, 206, 0.25);
  border-radius: 8px;
  color: var(--accent-2);
  background: rgba(6, 15, 23, 0.72);
}

.benchmark-weather-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.benchmark-status {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.15;
}

.benchmark-buff {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(101, 214, 206, 0.25);
  border-radius: 9px;
  background: rgba(6, 15, 23, 0.72);
}

.benchmark-buff img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

#combatLoadoutModal .combat-loadout-modal-panel {
  width: min(1120px, calc(100vw - 32px));
  max-width: none;
  overflow-x: hidden;
}

.combat-loadout-editor-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.1fr) minmax(380px, .9fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.combat-editor-loadout {
  width: 100%;
  min-width: 0;
}

.combat-editor-controls {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.combat-editor-controls > *,
.combat-editor-controls .field,
.combat-editor-controls .multi-filter {
  min-width: 0;
  max-width: 100%;
}

.combat-potion-select .multi-filter-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.combat-potion-select .multi-filter-toggle::after {
  grid-column: 2;
  grid-row: 1;
}

#combatEditorPotionLabel,
#expCombatPotionLabel {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-potion-value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.combat-potion-value img,
.combat-potion-option .exp-select-option-icon img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.combat-potion-value span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.combat-potion-menu {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  max-height: min(360px, 50dvh);
}

.combat-potion-option {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
}

.combat-potion-option.is-unavailable {
  opacity: 0.52;
  cursor: not-allowed;
}

.combat-potion-option-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.combat-potion-option-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.combat-potion-option-copy strong,
.combat-potion-option-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-potion-bonus {
  color: #b7adff !important;
  font-size: 0.63rem !important;
  line-height: 1.15;
}

.combat-potion-option-note {
  color: var(--muted) !important;
  font-size: 0.63rem !important;
  line-height: 1.15;
}

.combat-potion-price {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-height: 16px;
  color: var(--muted) !important;
  font-size: 0.62rem !important;
}

.combat-potion-price .money-inline {
  display: inline-flex;
  flex: 0 0 auto;
}

.combat-potion-price > span {
  flex: 0 0 auto;
}

.combat-potion-option .exp-select-option-icon,
.combat-potion-option .exp-select-option-icon img {
  width: 21px;
  height: 21px;
}

@media (max-width: 900px) {
  .combat-loadout-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.combat-benchmark-detail-row > td {
  padding: 0;
  background: linear-gradient(180deg, rgba(37, 35, 78, 0.3), rgba(8, 19, 29, 0.82));
}

.benchmark-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(220px, .75fr) minmax(170px, .55fr);
  gap: 12px;
  padding: 14px;
  border-left: 3px solid rgba(139, 123, 255, 0.62);
}

.benchmark-detail-grid > section {
  min-width: 0;
  padding: 11px;
  border: 1px solid rgba(139, 123, 255, 0.16);
  border-radius: 12px;
  background: rgba(6, 15, 23, 0.46);
}

.benchmark-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.benchmark-detail-chip {
  display: inline-grid;
  grid-template-columns: 31px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 138px;
  max-width: 210px;
  padding: 6px 8px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 10px;
  background: rgba(8, 20, 30, 0.82);
}

.benchmark-detail-icon,
.benchmark-detail-icon img {
  width: 31px;
  height: 31px;
}

.benchmark-detail-icon {
  display: grid;
  place-items: center;
}

.benchmark-detail-icon img {
  object-fit: contain;
}

.benchmark-detail-chip > span:last-child {
  min-width: 0;
}

.benchmark-detail-chip strong,
.benchmark-detail-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.benchmark-detail-chip strong {
  font-size: 0.72rem;
}

.benchmark-detail-chip small,
.benchmark-detail-empty {
  color: var(--muted);
  font-size: 0.65rem;
}

.benchmark-detail-metrics .rich-tooltip-row {
  font-size: 0.68rem;
}

.benchmark-weather-summaries {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.benchmark-weather-summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 9px;
  background: rgba(8, 25, 32, 0.62);
}

.benchmark-weather-summary > span,
.benchmark-weather-summary svg {
  width: 20px;
  height: 20px;
}

.benchmark-weather-summary svg {
  fill: none;
  stroke: var(--accent-2);
  stroke-width: 1.7;
}

.benchmark-weather-summary strong,
.benchmark-weather-summary small {
  font-size: 0.66rem;
}

.combat-editor-controls > .exp-equipment-stat-icons {
  min-height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 15, 23, 0.45);
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, 0.28);
  background: rgba(255, 179, 71, 0.08);
  color: #ffd8a8;
  font-size: 0.76rem;
  font-weight: 700;
}

.meta-badge-chain {
  border-color: rgba(101, 214, 206, 0.32);
  background: rgba(101, 214, 206, 0.12);
  color: var(--accent-2);
}

.compact-value {
  display: inline-block;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
}

.money-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  vertical-align: middle;
}

.sale-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.sale-route-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

.demand-instant {
  color: var(--accent-2);
}

.demand-value {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
}

.trend-indicator {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.trend-indicator-positive {
  color: var(--positive);
}

.trend-indicator-negative {
  color: var(--negative);
}

.trend-indicator-neutral {
  color: var(--muted);
}

.money-sign,
.money-suffix {
  line-height: 1;
}

.money-suffix-compact {
  margin-left: 0;
}

.money-inline-compact {
  gap: 4px;
}

.money-value-compact {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.coin-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  object-fit: contain;
  vertical-align: middle;
}

.chain-crystal-cell {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chain-crystal-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.chain-crystal-part {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chain-crystal-trigger {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.16);
  background: rgba(6, 15, 23, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.chain-crystal-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chain-crystal-icon-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-size: 0.82rem;
  font-weight: 700;
}

.chain-crystal-step {
  position: absolute;
  right: 2px;
  bottom: 2px;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  border-radius: 999px;
  background: rgba(8, 18, 27, 0.9);
  color: var(--text);
  font-size: 0.56rem;
  line-height: 12px;
  text-align: center;
  font-weight: 700;
}

.chain-crystal-delta,
.chain-crystal-total {
  color: var(--positive);
  font-size: inherit;
  font-weight: 700;
  white-space: nowrap;
}

.chain-crystal-arrow {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1;
}

.rich-tooltip-trigger {
  cursor: help;
}

.item-tooltip-reference {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.item-tooltip-icon-trigger {
  cursor: help;
  outline: none;
}

.item-tooltip-icon-trigger:focus-visible {
  box-shadow: 0 0 0 2px rgba(101, 214, 206, 0.7);
}

.item-tooltip-reference-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border-radius: 8px;
}

.character-cell {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.character-stack {
  display: inline-flex;
  align-items: center;
  padding-left: 4px;
}

.character-avatar-frame {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
  border-radius: 999px;
  border: 2px solid rgba(6, 15, 23, 0.95);
  background: rgba(6, 15, 23, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.character-avatar-clip {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
}

.character-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.18) translateY(-1px);
  transform-origin: center top;
}

.character-avatar-frame + .character-avatar-frame {
  margin-left: -10px;
}

.character-avatar-fallback,
.character-avatar-more {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
}

.character-avatar-more {
  color: var(--accent-2);
  background: rgba(15, 30, 41, 0.98);
}

@media (min-width: 761px) {
  tr.opportunity-row {
    height: var(--table-row-height);
  }

  .opportunity-table th,
  .opportunity-table td {
    padding: 9px 11px;
  }

  .item-cell {
    gap: 9px;
  }

  .item-title-row,
  .item-title-meta {
    gap: 6px;
  }

  .chain-inline {
    gap: 4px;
  }

  .item-title-meta {
    margin-left: 8px;
  }

  .item-icon,
  .item-icon-fallback {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .character-cell {
    min-height: 34px;
  }

  .character-avatar-frame {
    width: 34px;
    height: 34px;
  }

  .skill-icon-badge {
    width: 32px;
    height: 32px;
  }

  .skill-icon-svg {
    width: 16px;
    height: 16px;
  }
}

@media (min-width: 761px) and (max-width: 1440px) {
  tr.opportunity-row.chain-row .item-title-meta {
    gap: 4px;
    margin-left: 4px;
  }

  tr.opportunity-row.chain-row .chain-inline-label {
    display: none;
  }

}

@media (min-width: 761px) and (max-width: 1340px) {
  .opportunity-table {
    min-width: 1300px;
  }

  tr.opportunity-row.chain-row .item-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  tr.opportunity-row.chain-row .item-title-main {
    width: 100%;
  }

  tr.opportunity-row.chain-row .item-title-meta {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }
}

.subline,
.empty-state {
  color: var(--muted);
}

.chain-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.chain-inline-label {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.chain-inline-icons {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.chain-inline-arrow {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
}

.chain-mini-skill,
.chain-mini-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(173, 213, 255, 0.14);
  background: linear-gradient(180deg, rgba(17, 35, 48, 0.9), rgba(10, 20, 28, 0.96));
  color: #9fb4c8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chain-mini-skill-svg {
  display: inline-flex;
  width: 13px;
  height: 13px;
}

.chain-mini-skill-svg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chain-mini-fallback {
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.capped-value {
  color: var(--muted);
}

.positive {
  color: var(--positive);
}

.positive-soft {
  color: #b7db69;
}

.positive-warn {
  color: #d8bd5d;
}

.positive-caution {
  color: #e2a15c;
}

.negative {
  color: var(--negative);
}

.load-more-sentinel {
  margin-top: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

.engine-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 0;
  max-width: 100vw;
  overflow: hidden;
}

.engine-footer.is-hidden {
  display: none;
}

.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: 22px;
  z-index: 43;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0;
  border-color: rgba(101, 214, 206, 0.34);
  background:
    linear-gradient(145deg, rgba(101, 214, 206, 0.17), rgba(255, 179, 71, 0.08)),
    rgba(7, 19, 28, 0.9);
  color: var(--accent-2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.9);
  transition: opacity 180ms ease, transform 180ms ease, border-color 140ms ease, background-color 140ms ease;
  backdrop-filter: blur(10px);
}

.back-to-top.is-visible {
  opacity: 0.88;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.back-to-top.is-visible:hover {
  border-color: rgba(101, 214, 206, 0.7);
  background:
    linear-gradient(145deg, rgba(101, 214, 206, 0.26), rgba(255, 179, 71, 0.12)),
    rgba(7, 19, 28, 0.96);
  opacity: 1;
  transform: translateY(-2px) scale(1.03);
}

.back-to-top svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 12px 0;
  padding: 14px 4px 4px;
  border-top: 1px solid rgba(173, 213, 255, 0.12);
  color: var(--muted);
  font-size: 0.76rem;
}

.site-footer nav { display: flex; gap: 16px; }
.site-footer a,
.legal-content a { color: var(--accent-2); text-decoration: none; }
.site-footer a:hover,
.legal-content a:hover { color: #a8fff8; text-decoration: underline; }

.legal-body { padding-bottom: 0; }

.legal-shell {
  width: min(980px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.legal-header,
.legal-brand,
.legal-index {
  display: flex;
  align-items: center;
}

.legal-header {
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(173, 213, 255, 0.16);
  border-radius: 20px;
  background: rgba(13, 31, 44, 0.92);
}

.legal-brand { gap: 12px; color: var(--text); text-decoration: none; font-weight: 900; font-size: 1.08rem; }
.legal-brand img { width: 38px; height: 38px; object-fit: contain; }
.legal-back { padding: 9px 13px; border: 1px solid rgba(101, 214, 206, 0.3); border-radius: 12px; color: var(--accent-2); text-decoration: none; }

.legal-content {
  margin-top: 18px;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid rgba(173, 213, 255, 0.16);
  border-radius: 24px;
  background: rgba(13, 31, 44, 0.94);
}

.legal-intro { padding-bottom: 24px; }
.legal-intro h1 { margin: 5px 0 10px; font-size: clamp(2rem, 5vw, 3.5rem); }
.legal-intro p { max-width: 700px; margin: 0 0 10px; color: #bfd0df; line-height: 1.65; }
.legal-intro > span { color: var(--muted); font-size: 0.78rem; }

.legal-index { flex-wrap: wrap; gap: 9px; padding: 14px 0 25px; border-top: 1px solid rgba(173, 213, 255, 0.1); }
.legal-index a { padding: 8px 12px; border: 1px solid rgba(101, 214, 206, 0.25); border-radius: 999px; background: rgba(101, 214, 206, 0.06); }

.legal-section { scroll-margin-top: 20px; padding: 22px 0; border-top: 1px solid rgba(173, 213, 255, 0.12); }
.legal-section h2 { margin: 0 0 24px; font-size: 1.65rem; }
.legal-section h3 { margin: 24px 0 7px; color: #dfeef8; font-size: 1rem; }
.legal-section p { margin: 0 0 10px; color: #adc2d3; line-height: 1.72; }

@media (max-width: 620px) {
  .site-footer { align-items: flex-start; flex-direction: column; gap: 8px; }
  .legal-shell { width: min(100% - 20px, 980px); margin-top: 10px; }
  .legal-header { padding: 12px; }
  .legal-brand { font-size: 0.95rem; }
  .legal-brand img { width: 32px; height: 32px; }
  .legal-content { padding: 22px 18px; border-radius: 20px; }
}

body.has-boss-footer .back-to-top {
  bottom: 88px;
}

.engine-footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid rgba(101, 214, 206, 0.22);
  background: rgba(8, 19, 29, 0.9);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.engine-title {
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.boss-footer-track {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.boss-footer-track::-webkit-scrollbar {
  height: 8px;
}

.boss-footer-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.boss-footer-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(160px, 220px);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px 8px 8px;
  border-radius: 16px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  background: rgba(12, 27, 39, 0.82);
  color: var(--text);
  text-align: left;
  flex: 0 0 auto;
}

.boss-footer-track.density-compact {
  gap: 8px;
}

.boss-footer-track.density-compact .boss-footer-item {
  grid-template-columns: 44px minmax(116px, 154px);
  gap: 8px;
  padding: 6px 8px 6px 6px;
  border-radius: 14px;
}

.boss-footer-track.density-compact .boss-footer-thumb {
  width: 44px;
  height: 44px;
  border-radius: 11px;
}

.boss-footer-track.density-compact .boss-footer-level {
  font-size: 0.54rem;
}

.boss-footer-track.density-compact .boss-footer-copy {
  gap: 4px;
}

.boss-footer-track.density-compact .boss-footer-head {
  gap: 8px;
}

.boss-footer-track.density-compact .boss-footer-name {
  font-size: 0.82rem;
}

.boss-footer-track.density-compact .boss-footer-countdown {
  font-size: 0.74rem;
}

.boss-footer-track.density-compact .boss-footer-meta {
  font-size: 0.72rem;
}

.boss-footer-track.density-icon {
  gap: 8px;
}

.boss-footer-track.density-icon .boss-footer-item {
  grid-template-columns: 48px;
  padding: 0;
  border-radius: 14px;
  min-width: 48px;
  width: 48px;
  height: 48px;
  overflow: hidden;
}

.boss-footer-track.density-icon .boss-footer-copy {
  display: none;
}

.boss-footer-track.density-icon .boss-footer-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 0;
}

.boss-footer-track.density-icon .boss-footer-time {
  display: block;
  inset: auto 0 0 0;
  padding: 0 3px 2px;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(5, 12, 18, 0.08), rgba(5, 12, 18, 0.7));
  text-align: center;
  font-size: 0.62rem;
}

.boss-footer-track.density-icon .boss-footer-level {
  display: none;
}

.boss-footer-item:hover {
  border-color: rgba(101, 214, 206, 0.44);
  background: rgba(12, 31, 44, 0.92);
}

.boss-footer-item.is-live {
  border-color: rgba(105, 219, 124, 0.62);
  background:
    radial-gradient(circle at top right, rgba(105, 219, 124, 0.2), transparent 42%),
    linear-gradient(180deg, rgba(14, 48, 39, 0.94), rgba(8, 28, 27, 0.94));
  box-shadow:
    inset 3px 0 0 rgba(105, 219, 124, 0.8),
    0 0 18px rgba(105, 219, 124, 0.12);
}

.boss-footer-item.is-live:hover {
  border-color: rgba(137, 244, 154, 0.82);
  background:
    radial-gradient(circle at top right, rgba(105, 219, 124, 0.26), transparent 44%),
    linear-gradient(180deg, rgba(16, 56, 45, 0.96), rgba(9, 34, 31, 0.96));
}

.boss-footer-item.is-live .boss-footer-thumb {
  border-color: rgba(105, 219, 124, 0.72);
  box-shadow: 0 0 0 2px rgba(105, 219, 124, 0.14);
}

.boss-footer-item.is-live .boss-footer-cooldown {
  background: linear-gradient(180deg, rgba(7, 38, 29, 0.26), rgba(5, 24, 22, 0.12));
}

.boss-footer-item.is-live .boss-footer-countdown,
.boss-footer-item.is-live .boss-footer-meta {
  color: #8ff2a2;
}

.boss-footer-item.is-live .boss-footer-progress-fill {
  background: linear-gradient(90deg, #5edb79, #b4ffbd);
  box-shadow: 0 0 10px rgba(105, 219, 124, 0.46);
}

.boss-footer-item.is-live .boss-footer-time {
  background: rgba(25, 116, 65, 0.94);
  color: #effff2;
  letter-spacing: 0.06em;
}

.boss-footer-thumb {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(173, 213, 255, 0.14);
  background: rgba(6, 15, 23, 0.92);
}

.boss-footer-thumb img,
.boss-footer-thumb-fallback {
  width: 100%;
  height: 100%;
}

.boss-footer-thumb img {
  object-fit: cover;
  display: block;
}

.boss-footer-thumb-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-weight: 800;
}

.boss-footer-cooldown {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 10, 16, 0.88), rgba(4, 10, 16, 0.64));
  transform-origin: top;
  transition: transform 0.35s linear;
  pointer-events: none;
}

.boss-footer-level {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 4px 2px;
  background: linear-gradient(180deg, rgba(28, 41, 58, 0.88), rgba(11, 20, 30, 0.96));
  border-top: 1px solid rgba(173, 213, 255, 0.12);
  color: #e9f3ff;
  font-size: 0.58rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.boss-footer-time {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: none;
  padding: 1px 4px;
  border-radius: 999px;
  background: rgba(5, 12, 18, 0.8);
  color: #f4fbff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
}

.boss-footer-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.boss-footer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.boss-footer-name {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-footer-countdown {
  flex: 0 0 auto;
  color: #dff7ff;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.boss-footer-meta {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.boss-footer-progress {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(173, 213, 255, 0.1);
}

.boss-footer-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 179, 71, 0.9), rgba(101, 214, 206, 0.92));
  transition: width 0.35s linear;
}

.engine-info-panel {
  display: grid;
  grid-template-columns: minmax(210px, 0.75fr) minmax(260px, 1.25fr);
  gap: 8px 20px;
  padding: 14px 16px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 18px;
  background: rgba(6, 15, 23, 0.58);
}

.engine-info-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.engine-info-header strong {
  color: var(--text);
}

.engine-info-detail {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0;
}

.engine-info-metrics {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.engine-info-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  background: rgba(13, 29, 43, 0.78);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.engine-live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(101, 214, 206, 0.09), 0 0 16px rgba(101, 214, 206, 0.42);
}

.api-observed-at {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.api-flow {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(170px, 1fr) auto minmax(150px, 1fr);
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

.api-flow-node {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 12px 14px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 15px;
  background: rgba(6, 15, 23, 0.58);
}

.api-flow-node.is-coordinator {
  border-color: rgba(101, 214, 206, 0.28);
  background: linear-gradient(135deg, rgba(20, 73, 78, 0.34), rgba(6, 15, 23, 0.72));
}

.api-flow-node.is-upstream {
  border-color: rgba(255, 179, 71, 0.22);
}

.api-flow-kicker {
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.api-flow-node strong {
  margin-top: 2px;
  color: var(--text);
}

.api-flow-node > span:last-child {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-flow-arrow {
  align-self: center;
  color: var(--accent-2);
  font-size: 1.25rem;
  font-weight: 800;
}

.api-flow-arrow.is-upstream {
  color: var(--warning);
}

.api-live-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(390px, 1.28fr);
  gap: 10px;
}

.api-budget-card,
.api-activity-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 17px;
  background: rgba(6, 15, 23, 0.58);
}

.api-budget-heading,
.api-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.api-budget-heading > div {
  display: grid;
}

.api-budget-heading span,
.api-card-heading > span {
  color: var(--muted);
  font-size: 0.72rem;
}

.api-budget-heading strong {
  margin-top: 2px;
  color: var(--text);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.api-budget-heading strong b {
  color: inherit;
}

.api-budget-percent {
  display: grid;
  min-width: 46px;
  min-height: 46px;
  place-items: center;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 50%;
  background: rgba(101, 214, 206, 0.08);
  color: var(--accent-2) !important;
  font-weight: 800;
}

.api-budget-track {
  height: 8px;
  margin: 13px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(173, 213, 255, 0.08);
}

.api-budget-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--positive), var(--warning));
  transition: width 240ms ease;
}

.api-budget-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.api-category-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

.api-kind-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
}

.api-kind-chip b {
  color: var(--text);
}

.api-card-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.api-activity-list {
  display: grid;
  max-height: 218px;
  margin-top: 9px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color);
}

.api-activity-row {
  display: grid;
  grid-template-columns: 8px minmax(130px, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 5px 3px;
  border-top: 1px solid rgba(173, 213, 255, 0.08);
}

.api-activity-row:first-child {
  border-top: 0;
}

.api-activity-marker,
.api-worker-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 9px rgba(101, 214, 206, 0.35);
}

.api-activity-row.is-failed .api-activity-marker {
  background: var(--negative);
  box-shadow: 0 0 9px rgba(255, 107, 129, 0.32);
}

.api-activity-row.is-in_flight .api-activity-marker {
  animation: api-live-pulse 1.2s ease-in-out infinite;
  background: var(--warning);
}

.api-activity-row > div {
  display: grid;
  min-width: 0;
}

.api-activity-row > div:last-child {
  text-align: right;
}

.api-activity-row strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-activity-row span {
  color: var(--muted);
  font-size: 0.68rem;
}

.api-empty-state {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.api-worker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.api-worker-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.11);
  border-radius: 15px;
  background: rgba(6, 15, 23, 0.52);
}

.api-worker-card.is-running {
  border-color: rgba(101, 214, 206, 0.34);
  background: linear-gradient(135deg, rgba(20, 73, 78, 0.3), rgba(6, 15, 23, 0.64));
}

.api-worker-heading {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.api-worker-heading > div {
  display: grid;
  min-width: 0;
}

.api-worker-heading strong,
.api-worker-heading span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-worker-heading strong {
  color: var(--text);
  font-size: 0.78rem;
}

.api-worker-heading > div span {
  color: var(--muted);
  font-size: 0.66rem;
}

.api-worker-state {
  padding: 3px 6px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  text-transform: uppercase;
}

.api-worker-card.is-running .api-worker-state {
  border-color: rgba(101, 214, 206, 0.25);
  color: var(--accent-2);
}

.api-worker-queue {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
}

.api-worker-queue strong {
  color: var(--text);
  font-size: 1.2rem;
}

.api-worker-queue span,
.api-worker-detail {
  color: var(--muted);
  font-size: 0.68rem;
}

.api-worker-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 5px;
}

.api-worker-detail b {
  color: var(--text);
}

.api-scheduler-metrics {
  margin-top: 10px;
}

@keyframes api-live-pulse {
  50% {
    opacity: 0.4;
    transform: scale(0.72);
  }
}

.market-health-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.market-health-heading h3,
.market-health-heading p {
  margin: 0;
}

.market-health-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.engine-overall {
  position: relative;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 7px;
  min-width: 170px;
  padding: 8px 12px 10px;
  overflow: hidden;
  border: 1px solid rgba(101, 214, 206, 0.18);
  border-radius: 14px;
  background: rgba(6, 15, 23, 0.58);
}

.engine-overall::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  width: var(--freshness, 0%);
  height: 3px;
  background: linear-gradient(90deg, #65d6ce, #69db7c);
  transition: width 260ms ease;
}

.engine-overall strong {
  color: var(--positive);
  font-size: 1.25rem;
}

.engine-overall span {
  color: var(--muted);
  font-size: 0.78rem;
}

.skill-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.skill-health-row {
  display: grid;
  grid-template-columns: minmax(135px, 0.9fr) minmax(100px, 1fr) 72px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 14px;
  background: linear-gradient(100deg, rgba(16, 38, 53, 0.7), rgba(7, 19, 28, 0.72));
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.skill-health-row:hover,
.skill-health-row:focus-visible {
  border-color: rgba(101, 214, 206, 0.3);
  background: linear-gradient(100deg, rgba(18, 48, 60, 0.82), rgba(8, 24, 34, 0.82));
  outline: none;
  transform: translateY(-1px);
}

.skill-health-row.is-active {
  border-color: rgba(255, 179, 71, 0.34);
  box-shadow: inset 3px 0 0 rgba(255, 179, 71, 0.72);
}

.skill-health-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.skill-health-identity > div {
  display: grid;
  min-width: 0;
}

.skill-health-identity strong,
.skill-health-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-health-identity span,
.skill-health-result span {
  color: var(--muted);
  font-size: 0.72rem;
}

.skill-health-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid rgba(101, 214, 206, 0.15);
  border-radius: 9px;
  background: rgba(5, 17, 25, 0.68);
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 800;
}

.skill-health-icon svg {
  width: 17px;
  height: 17px;
}

.skill-health-progress {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(173, 213, 255, 0.08);
}

.skill-health-fill {
  display: block;
  height: 100%;
  transition: width 260ms ease;
}

.skill-health-fill.is-fresh { background: linear-gradient(90deg, #45bcae, #69db7c); }
.skill-health-fill.is-stale { background: #ffb347; }
.skill-health-fill.is-missing { background: rgba(255, 143, 143, 0.42); }

.skill-health-result {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.skill-health-result strong {
  color: var(--positive);
}

.skill-health-row.is-active .skill-health-result strong {
  color: var(--accent);
}

.skill-health-empty {
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.modal-shell[hidden] {
  display: none;
}

.rich-tooltip[hidden] {
  display: none;
}

.rich-tooltip {
  position: fixed;
  z-index: 62;
  max-width: min(360px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid rgba(101, 214, 206, 0.24);
  border-radius: 16px;
  background: rgba(7, 17, 25, 0.97);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.rich-tooltip.is-item-tooltip {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.global-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.global-toast {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(255, 183, 76, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 183, 76, 0.16), rgba(101, 214, 206, 0.08)),
    rgba(7, 17, 25, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.global-toast-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.global-toast-thumb {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(173, 213, 255, 0.14);
  background: rgba(6, 15, 23, 0.84);
  object-fit: cover;
}

.global-toast-thumb-fallback {
  display: grid;
  place-items: center;
  color: #fff4d2;
  font-size: 1rem;
  font-weight: 800;
}

.global-toast-copy {
  min-width: 0;
}

.global-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.global-toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.global-toast-title {
  color: #fff4d2;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.global-toast-text {
  margin-top: 4px;
  color: #cae9f5;
  font-size: 0.88rem;
  line-height: 1.35;
}

.endgame-slot-menu {
  max-height: 320px;
  padding: 6px;
}

.endgame-slot-menu .endgame-slot-option {
  display: flex;
  align-items: center;
  gap: 9px;
}

.endgame-slot-option-icon {
  display: inline-grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 7px;
  background: rgba(5, 15, 23, 0.72);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.endgame-slot-option-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.endgame-view-tab {
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.endgame-view-tab:hover,
.endgame-view-tab.active {
  background: rgba(101, 214, 206, 0.12);
  color: var(--accent-2);
  box-shadow: none;
  transform: none;
}

.endgame-table {
  min-width: 1360px;
  table-layout: fixed;
}

.endgame-recipes-table {
  min-width: 1200px;
}

.endgame-equipment-table th:nth-child(1) { width: 250px; }
.endgame-equipment-table th:nth-child(2) { width: 66px; }
.endgame-equipment-table th:nth-child(3) { width: 116px; }
.endgame-equipment-table th:nth-child(n+4):nth-child(-n+9) { width: 72px; }
.endgame-equipment-table th:nth-child(10) { width: 118px; }
.endgame-equipment-table th:nth-child(11),
.endgame-equipment-table th:nth-child(12) { width: 86px; }
.endgame-equipment-table th:nth-child(13) { width: 92px; }

.endgame-recipes-table th:nth-child(1),
.endgame-recipes-table th:nth-child(2) { width: 240px; }
.endgame-recipes-table th:nth-child(3) { width: 90px; }
.endgame-recipes-table th:nth-child(4),
.endgame-recipes-table th:nth-child(5),
.endgame-recipes-table th:nth-child(6),
.endgame-recipes-table th:nth-child(9),
.endgame-recipes-table th:nth-child(10) { width: 86px; }
.endgame-recipes-table th:nth-child(7) { width: 110px; }
.endgame-recipes-table th:nth-child(8) { width: 130px; }

.endgame-row {
  cursor: pointer;
}

.endgame-table th,
.endgame-table td,
.pets-table th,
.pets-table td,
.database-table th,
.database-table td {
  padding: 7px 8px;
}

.endgame-table th,
.endgame-table td {
  vertical-align: middle;
  line-height: 1.15;
}

.endgame-table th:not(:first-child) {
  text-align: center;
}

.endgame-table th:not(:first-child) .table-sort-heading {
  justify-content: center;
}

.endgame-row.is-expanded {
  background: rgba(101, 214, 206, 0.045);
}

.endgame-row:focus-visible {
  outline: 2px solid rgba(101, 214, 206, 0.55);
  outline-offset: -2px;
}

.endgame-name-cell,
.pet-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.endgame-name-cell strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endgame-market-link {
  display: inline-grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(101, 214, 206, 0.2);
  border-radius: 8px;
  background: rgba(5, 15, 23, 0.64);
  color: var(--muted);
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
}

.endgame-market-link svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.endgame-market-link:hover,
.endgame-market-link:focus-visible {
  border-color: rgba(101, 214, 206, 0.5);
  background: rgba(101, 214, 206, 0.12);
  color: var(--accent-2);
}

.endgame-item-icon {
  position: relative;
  display: inline-grid;
  flex: 0 0 var(--icon-size-medium);
  width: var(--icon-size-medium);
  height: var(--icon-size-medium);
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 10px;
  background: rgba(5, 15, 23, 0.72);
  color: var(--muted);
  font-weight: 800;
}

.endgame-type-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 8px;
  background: rgba(5, 15, 23, 0.72);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.endgame-type-icon img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.endgame-type-icon > span {
  display: none;
}

.endgame-type-icon.is-fallback > span {
  display: inline;
}

.endgame-requirements {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.endgame-requirement {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.endgame-requirement svg,
.endgame-requirement img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.endgame-requirement svg {
  color: var(--accent-2);
  fill: var(--accent-2);
  opacity: 0.82;
}

.database-currency-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.database-currency-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.endgame-table .comparison-toggle {
  min-height: 28px;
  padding: 4px 8px;
  font-size: 0.76rem;
}

.endgame-material-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.endgame-material-count svg {
  width: 16px;
  height: 16px;
  fill: var(--accent-2);
  opacity: 0.82;
}

.endgame-craft-margin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.endgame-craft-margin small {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.endgame-craft-margin.is-pending {
  color: var(--muted);
  font-size: 0.76rem;
}

.endgame-item-icon > span {
  display: none;
}

.endgame-item-icon.is-fallback > span {
  display: inline;
}

.endgame-history-row:hover {
  background: transparent;
}

.endgame-history-row > td {
  padding: 0;
  text-align: left;
}

.endgame-history-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
}

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

.endgame-history-copy {
  min-width: 0;
}

.endgame-history-title-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.endgame-history-title-line .history-title {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endgame-acquisition {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
}

.endgame-source-badge {
  display: inline-flex;
  align-items: center;
  max-width: 240px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 999px;
  background: rgba(101, 214, 206, 0.08);
  color: var(--accent-2);
  font-size: 0.7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endgame-source-badge.is-crafted {
  border-color: rgba(255, 179, 71, 0.24);
  background: rgba(255, 179, 71, 0.08);
  color: #ffd18d;
}

.endgame-source-badge.is-muted {
  border-color: rgba(173, 213, 255, 0.12);
  background: rgba(173, 213, 255, 0.04);
  color: var(--muted);
}

.endgame-table td:not(:first-child) {
  text-align: center;
}

.pets-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pets-summary span {
  padding: 6px 10px;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 999px;
  background: rgba(101, 214, 206, 0.06);
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 700;
}

.pets-controls {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line-faint);
  border-radius: 16px;
  background: rgba(5, 16, 25, 0.38);
}

.pets-controls .field {
  margin: 0;
}

.pets-controls .database-clear-filters {
  width: var(--control-height);
  height: var(--control-height);
  min-width: var(--control-height);
  min-height: var(--control-height);
  flex-basis: var(--control-height);
}

.pets-search-field {
  min-width: 150px;
  flex: 1 1 220px;
  order: -10;
}

.pets-level-field {
  width: 105px;
  min-width: 90px;
  flex: 0 1 105px;
}

.pets-mastery-field {
  width: 155px;
  min-width: 135px;
  flex: 0 1 155px;
}

.pet-mastery-select .multi-filter-toggle {
  min-height: var(--control-height);
}

.pet-mastery-menu {
  max-height: 280px;
  padding: 6px;
}

.pet-mastery-option {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 0.86rem;
  text-align: left;
}

.pet-mastery-option:hover,
.pet-mastery-option.is-selected {
  background: rgba(101, 214, 206, 0.12);
  color: #dffdf8;
  transform: none;
  box-shadow: none;
}

.pets-pat-toggle,
.pets-owned-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  min-width: max-content;
  flex: 0 0 auto;
  white-space: nowrap;
  align-self: end;
  cursor: pointer;
}

#petQualityFilterMount {
  width: 150px;
  min-width: 135px;
  flex: 0 1 150px;
}

#petSourceFilterMount {
  width: 190px;
  min-width: 160px;
  flex: 0 1 190px;
}

#petQualityFilterMount .field,
#petSourceFilterMount .field {
  width: 100%;
}

#petQualityFilterMount .database-filter-toggle,
#petSourceFilterMount .database-filter-toggle {
  min-height: var(--control-height);
}

.comparison-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(101, 214, 206, 0.08), rgba(9, 21, 30, 0.5));
}

.comparison-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.comparison-header strong {
  display: block;
  margin-top: 2px;
}

.comparison-header button,
.comparison-toggle {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(173, 213, 255, 0.18);
  border-radius: 999px;
  background: rgba(6, 15, 23, 0.7);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

.comparison-header button:hover,
.comparison-toggle:hover,
.comparison-toggle.is-selected {
  border-color: rgba(101, 214, 206, 0.52);
  background: rgba(101, 214, 206, 0.12);
  color: #dffdf8;
}

.comparison-scroll {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(173, 213, 255, 0.1);
  text-align: right;
}

.comparison-table thead th {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.comparison-table th:first-child {
  width: 150px;
  text-align: left;
}

.comparison-table tbody th {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.comparison-table td {
  color: #dceffc;
  font-size: 0.88rem;
}

.comparison-table td.is-best {
  background: linear-gradient(90deg, rgba(105, 219, 188, 0.18), rgba(105, 219, 188, 0.04));
  color: #8af2c9;
}

.comparison-table td small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.comparison-entity-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  text-align: left;
}

.comparison-entity-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-entity-head button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(173, 213, 255, 0.08);
  color: var(--muted);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
}

.comparison-entity-head button:hover {
  background: rgba(255, 143, 143, 0.15);
  color: var(--negative);
}

.pets-table {
  min-width: 1510px;
  table-layout: fixed;
}

.pets-table th:nth-child(1) { width: 330px; }
.pets-table th:nth-child(2) { width: 84px; }
.pets-table th:nth-child(3) { width: 78px; }
.pets-table th:nth-child(4),
.pets-table th:nth-child(5),
.pets-table th:nth-child(6),
.pets-table th:nth-child(7) { width: 62px; }
.pets-table th:nth-child(8),
.pets-table th:nth-child(9),
.pets-table th:nth-child(10) { width: 72px; }
.pets-table th:nth-child(11),
.pets-table th:nth-child(12) { width: 76px; }
.pets-table th:nth-child(13) { width: 90px; }
.pets-table th:nth-child(14) { width: 72px; }
.pets-table th:nth-child(15) { width: 78px; }

.pets-table td {
  vertical-align: middle;
  text-align: center;
}

.pets-table th {
  vertical-align: middle;
  text-align: center;
}

.pets-table th:not(:first-child) .table-sort-heading {
  justify-content: center;
}

.pets-table th:first-child,
.pets-table th:first-child .table-sort-heading {
  text-align: left;
  justify-content: flex-start;
}

.pets-table tr.pet-row {
  cursor: pointer;
}

.pets-table tr.pet-row.is-expanded {
  background: rgba(101, 214, 206, 0.045);
}

.pets-table tr.pet-row:focus-visible {
  outline: 2px solid rgba(101, 214, 206, 0.55);
  outline-offset: -2px;
}

.pets-table tr.pet-history-row:hover {
  background: transparent;
}

.pets-table tr.pet-history-row > td {
  padding: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.pet-history-panel {
  border-top: 1px solid rgba(101, 214, 206, 0.12);
}

.pets-table td:first-child {
  text-align: left;
}

.table-sort-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.table-sort-heading::after {
  content: "↕";
  color: rgba(173, 213, 255, 0.36);
  font-size: 0.72rem;
}

.table-sort-heading.is-active {
  color: var(--accent-2);
}

.table-sort-heading:hover,
.table-sort-heading:focus-visible {
  color: var(--accent-2);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.table-sort-heading.is-active[data-direction="asc"]::after { content: "↑"; color: var(--accent-2); }
.table-sort-heading.is-active[data-direction="desc"]::after { content: "↓"; color: var(--accent-2); }

.pet-owner-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
}

.pet-owner-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border: 2px solid #0e2232;
  border-radius: 50%;
  background: #071521;
}

.pet-owner-avatar + .pet-owner-avatar {
  margin-left: -8px;
}

.pet-owner-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.pet-owner-fallback,
.pet-owner-more {
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 800;
}

.pet-name-cell strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-source-badge {
  flex: 0 1 auto;
  min-width: 0;
  margin-left: auto;
  padding: 3px 6px;
  overflow: hidden;
  border: 1px solid rgba(101, 214, 206, 0.22);
  border-radius: 999px;
  background: rgba(101, 214, 206, 0.07);
  color: var(--accent-2);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pets-table td:nth-child(13) small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.7rem;
}

.pet-icon-wrap {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
}

.pet-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 15, 23, 0.78);
  object-fit: cover;
}

.pet-icon-fallback {
  display: none;
  place-items: center;
  color: var(--accent-2);
  font-size: 1rem;
  font-weight: 800;
}

.pet-icon-wrap.is-fallback .pet-icon-fallback {
  display: grid;
}

.pet-compare-icon {
  width: 34px;
  height: 34px;
}

.pet-compare-icon .pet-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.pet-quality,
.database-quality {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid rgba(173, 213, 255, 0.15);
  border-radius: 999px;
  font-weight: 700;
  text-transform: capitalize;
}

.pet-quality { font-size: 0.76rem; }

.pet-quality-standard { border-color: var(--quality-standard-border); background: var(--quality-standard-background); color: var(--quality-standard); }
.pet-quality-refined { border-color: var(--quality-refined-border); background: var(--quality-refined-background); color: var(--quality-refined); }
.pet-quality-premium { border-color: var(--quality-premium-border); background: var(--quality-premium-background); color: var(--quality-premium); }
.pet-quality-epic { border-color: var(--quality-epic-border); background: var(--quality-epic-background); color: var(--quality-epic); }
.pet-quality-legendary { border-color: var(--quality-legendary-border); background: var(--quality-legendary-background); color: var(--quality-legendary); }
.pet-quality-mythic { border-color: var(--quality-mythic-border); background: var(--quality-mythic-background); color: var(--quality-mythic); }
.pet-quality-unique { border-color: var(--quality-unique-border); background: var(--quality-unique-background); color: var(--quality-unique); }

.quality-text-standard { color: var(--quality-standard); }
.quality-text-refined { color: var(--quality-refined); }
.quality-text-premium { color: var(--quality-premium); }
.quality-text-epic { color: var(--quality-epic); }
.quality-text-legendary { color: var(--quality-legendary); }
.quality-text-mythic,
.quality-text-unique {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.quality-text-mythic { background-image: var(--quality-mythic-text); }
.quality-text-unique { background-image: var(--quality-unique-text); }

.pet-owner-stack {
  min-height: 28px;
}

.pet-owner-avatar {
  width: 28px;
  height: 28px;
}

.rich-tooltip-section + .rich-tooltip-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
}

.rich-tooltip-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.rich-tooltip-line + .rich-tooltip-line {
  margin-top: 4px;
}

.rich-tooltip-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.rich-tooltip-value {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: right;
}

.rich-tooltip-effects-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rich-tooltip-effects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rich-tooltip-effect-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.rich-tooltip-effect-group {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.rich-tooltip-avatar {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 999px;
  border: 2px solid rgba(7, 17, 25, 0.98);
  transform: scale(1.16) translateY(-1px);
  transform-origin: center top;
  background: rgba(6, 15, 23, 0.92);
}

.rich-tooltip-avatar-frame {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: visible;
  border-radius: 999px;
  background: rgba(6, 15, 23, 0.92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.rich-tooltip-avatar-clip {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
}

.rich-tooltip-avatar-frame + .rich-tooltip-avatar-frame {
  margin-left: -8px;
}

.rich-tooltip-avatar-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
}

.rich-tooltip-effect-value {
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.rich-tooltip-cost-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rich-tooltip-cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rich-tooltip-cost-left {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.rich-tooltip-item-thumb {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  background: rgba(6, 15, 23, 0.92);
}

.rich-tooltip-item-thumb-fallback {
  display: inline-grid;
  place-items: center;
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 800;
}

.rich-tooltip-cost-name {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  min-width: 0;
}

.rich-tooltip-cost-value {
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.rich-tooltip-cost-source {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rich-tooltip-line-total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
}

.item-tooltip {
  width: min(360px, calc(100vw - 24px));
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(173, 213, 255, 0.16);
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(15, 33, 47, 0.98), rgba(5, 14, 22, 0.99));
  box-shadow: inset 3px 0 0 rgba(173, 213, 255, 0.2);
}

.item-tooltip-quality-standard { border-color: var(--quality-standard-border); box-shadow: inset 3px 0 0 var(--quality-standard); }
.item-tooltip-quality-refined { border-color: var(--quality-refined-border); box-shadow: inset 3px 0 0 var(--quality-refined); }
.item-tooltip-quality-premium { border-color: var(--quality-premium-border); box-shadow: inset 3px 0 0 var(--quality-premium); }
.item-tooltip-quality-epic { border-color: var(--quality-epic-border); box-shadow: inset 3px 0 0 var(--quality-epic); }
.item-tooltip-quality-legendary { border-color: var(--quality-legendary-border); box-shadow: inset 3px 0 0 var(--quality-legendary); }
.item-tooltip-quality-mythic { border-color: var(--quality-mythic-border); box-shadow: inset 3px 0 0 var(--quality-mythic); }
.item-tooltip-quality-unique { border-color: var(--quality-unique-border); box-shadow: inset 3px 0 0 var(--quality-unique); }

.item-tooltip-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.item-tooltip-icon {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.16);
  border-radius: 11px;
  background: rgba(4, 12, 19, 0.86);
  color: var(--muted);
  font-weight: 800;
}

.item-tooltip-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.item-tooltip-icon.is-fallback img {
  display: none;
}

.item-tooltip-name {
  display: block;
  font-size: 1.02rem;
  line-height: 1.2;
}

.item-tooltip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.item-tooltip-meta span,
.item-tooltip-sources span {
  padding: 3px 7px;
  border: 1px solid rgba(101, 214, 206, 0.16);
  border-radius: 999px;
  background: rgba(101, 214, 206, 0.07);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.item-tooltip-sources span.is-crafted {
  border-color: rgba(255, 191, 71, 0.34);
  background: rgba(255, 191, 71, 0.1);
  color: #ffd88a;
}

.item-tooltip-description {
  margin: 11px 0 0;
  color: #b8cad8;
  font-size: 0.82rem;
  line-height: 1.45;
}

.item-tooltip-section {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(173, 213, 255, 0.1);
}

.item-tooltip-section-title {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.item-tooltip-stat,
.item-tooltip-effect,
.item-tooltip-recipe-summary,
.item-tooltip-footer > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.item-tooltip-stat span,
.item-tooltip-effect span,
.item-tooltip-footer span {
  color: var(--muted);
  font-size: 0.78rem;
}

.item-tooltip-stat strong,
.item-tooltip-effect strong {
  color: var(--accent-2);
  font-size: 0.84rem;
  white-space: nowrap;
}

.item-tooltip-effect + .item-tooltip-effect {
  margin-top: 5px;
}

.item-tooltip-recipe-summary {
  color: var(--muted);
  font-size: 0.78rem;
}

.item-tooltip-recipe-summary strong {
  color: var(--text);
}

.item-tooltip-materials,
.item-tooltip-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.item-tooltip-source-groups {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.item-tooltip-source-group {
  min-width: 0;
}

.item-tooltip-source-kind {
  color: #7893aa;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.item-tooltip-source-group .item-tooltip-sources {
  margin-top: 4px;
}

.item-tooltip-materials span {
  color: #c8d8e4;
  font-size: 0.76rem;
}

.item-tooltip-footer {
  display: grid;
  gap: 5px;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(173, 213, 255, 0.12);
}

.item-tooltip-footer strong {
  color: var(--text);
  font-size: 0.82rem;
}

.item-tooltip-footer small {
  color: #e2aa65;
  font-size: 0.72rem;
}

.item-tooltip-loading {
  display: grid;
  gap: 5px;
  min-width: 220px;
  padding: 12px 14px;
  border: 1px solid rgba(101, 214, 206, 0.24);
  border-radius: 14px;
  background: rgba(7, 17, 25, 0.97);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.item-tooltip-loading span {
  color: var(--muted);
  font-size: 0.8rem;
}

.item-tooltip-loading.is-error span {
  color: var(--negative);
}

.history-panel {
  padding: 18px;
  background: linear-gradient(180deg, rgba(13, 29, 43, 0.96), rgba(8, 19, 29, 0.96));
}

.chain-panel {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(101, 214, 206, 0.14);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(12, 34, 43, 0.7), rgba(9, 21, 29, 0.78));
}

.chain-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.history-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.item-effects-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.item-effect-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(101, 214, 206, 0.22);
  background: rgba(101, 214, 206, 0.08);
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.item-effect-chip-exp {
  border-color: rgba(111, 196, 255, 0.3);
  background: rgba(66, 112, 168, 0.18);
  color: #9fd8ff;
}

.item-effect-chip-efficiency {
  border-color: rgba(105, 219, 124, 0.3);
  background: rgba(36, 99, 64, 0.2);
  color: #8ef0a3;
}

.item-effect-chip-heal {
  border-color: rgba(255, 179, 71, 0.28);
  background: rgba(119, 72, 24, 0.2);
  color: #ffcf85;
}

.item-effect-chip-stat {
  border-color: rgba(172, 184, 204, 0.26);
  background: rgba(59, 76, 100, 0.22);
  color: #d6e2f0;
}

.item-effect-chip-generic {
  border-color: rgba(101, 214, 206, 0.22);
  background: rgba(101, 214, 206, 0.08);
  color: var(--accent-2);
}

.chain-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(101, 214, 206, 0.24);
  background: rgba(101, 214, 206, 0.08);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.chain-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.chain-step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.chain-step-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 37, 52, 0.82), rgba(9, 22, 31, 0.86));
}

.chain-step-card-final {
  border-color: rgba(101, 214, 206, 0.18);
}

.chain-step-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.chain-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 179, 71, 0.26);
  background: rgba(255, 179, 71, 0.08);
  color: #ffd8a8;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chain-step-title {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.chain-step-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.history-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.history-title {
  display: block;
  font-size: 1rem;
}

.history-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.history-ranges {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-range-button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.history-range-button.active {
  border-color: rgba(101, 214, 206, 0.35);
  background: rgba(101, 214, 206, 0.12);
  color: var(--accent-2);
}

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

.history-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-faint);
  border-radius: var(--radius-panel);
  background: var(--surface-card);
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history-card-header strong {
  font-size: 0.96rem;
}

.history-card-header span {
  color: var(--muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.history-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.history-chart-wrap {
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(173, 213, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(255, 179, 71, 0.08), transparent 30%),
    rgba(7, 17, 25, 0.88);
}

.history-chart-svg {
  display: block;
  width: 100%;
  height: 220px;
}

.history-chart-grid line {
  stroke: rgba(173, 213, 255, 0.12);
  stroke-width: 1;
}

.history-axis-label {
  fill: var(--muted);
  font-size: 12px;
  text-anchor: end;
}

.history-chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-chart-bar {
  rx: 2;
  transition: fill-opacity 0.18s ease;
}

.history-chart-point {
  stroke: rgba(7, 17, 25, 0.92);
  stroke-width: 2;
}

.history-chart-hit {
  cursor: crosshair;
}

.history-card-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
}

.history-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.boss-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 1.15fr);
  gap: 16px;
  margin-bottom: 18px;
}

.boss-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.boss-metric-card strong {
  display: block;
  margin: 8px 0;
  font-size: 1.7rem;
}

.boss-controls {
  display: grid;
  grid-template-columns: auto auto auto minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface-card);
}

.boss-alert-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-self: end;
  margin: 0;
  white-space: nowrap;
}

.boss-alert-field > span {
  margin-bottom: 8px;
}

.boss-alert-field select {
  align-self: flex-start;
}

.boss-sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  align-self: end;
  min-height: var(--control-height);
  white-space: nowrap;
}

.boss-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.boss-switch-track {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 46px;
  border: 1px solid rgba(173, 213, 255, 0.16);
  border-radius: 999px;
  background: rgba(6, 15, 23, 0.88);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.boss-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d8e7f5;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.18s ease, background 0.18s ease;
}

.boss-switch input:checked + .boss-switch-track {
  border-color: rgba(101, 214, 206, 0.3);
  background: rgba(101, 214, 206, 0.18);
}

.boss-switch input:checked + .boss-switch-track .boss-switch-thumb {
  transform: translateX(20px);
  background: #c9fff8;
}

.boss-switch-label {
  color: var(--text);
}

.boss-controls select {
  min-width: 104px;
}

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

.boss-actions button {
  min-height: var(--control-height);
  white-space: nowrap;
}

.world-boss-panel > .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.boss-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  border-radius: 12px;
  background: rgba(6, 15, 23, 0.7);
}

.boss-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.boss-view-button:hover {
  border: 0;
  background: rgba(173, 213, 255, 0.06);
  color: var(--text);
}

.boss-view-button.active {
  background: rgba(101, 214, 206, 0.14);
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(101, 214, 206, 0.18);
}

.boss-view-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.boss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.boss-table-shell {
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-card);
  background: rgba(8, 19, 29, 0.72);
}

.boss-table-scroll {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color);
}

.boss-table {
  min-width: 1080px;
  table-layout: fixed;
}

.boss-table-col-boss { width: 18%; }
.boss-table-col-status { width: 12%; }
.boss-table-col-location { width: 16%; }
.boss-table-col-loot { width: 28%; }
.boss-table-col-schedule { width: 16%; }
.boss-table-col-watch { width: 10%; }

.boss-table th {
  height: var(--table-header-height);
  padding: 10px 12px;
  color: #bddcff;
  font-size: 0.72rem;
  line-height: 1;
  vertical-align: middle;
}

.boss-table td {
  padding: 7px 12px;
  font-size: 0.78rem;
  line-height: 1.2;
  vertical-align: middle;
}

.boss-table-row {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

.boss-table-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.boss-table-row-imminent {
  background: rgba(255, 179, 71, 0.045);
}

.boss-table-row-alert {
  box-shadow: inset 3px 0 0 rgba(255, 179, 71, 0.52);
}

.boss-table-row-live {
  background: rgba(105, 219, 124, 0.07);
  box-shadow: inset 3px 0 0 rgba(105, 219, 124, 0.72);
}

.boss-table-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.boss-table-portrait {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  border: 1px solid rgba(173, 213, 255, 0.14);
  border-radius: 12px;
  background: rgba(6, 15, 23, 0.9);
}

.boss-table-portrait img,
.boss-table-portrait .boss-portrait-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boss-table-name {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.boss-table-name strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boss-table-name span {
  color: var(--muted);
  font-size: 0.72rem;
}

.boss-table-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 7px;
}

.boss-table-status > strong {
  color: #dff7ff;
  font-size: 0.86rem;
  white-space: nowrap;
}

.boss-table-status > span:last-child {
  color: var(--muted);
  font-size: 0.72rem;
}

.boss-table-row-live .boss-table-status > strong,
.boss-table-row-live .boss-table-status > span:last-child {
  color: #91f2a4;
}

.boss-table-row-ended .boss-table-status > strong {
  display: none;
}

.boss-table-location {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.boss-table-location-chip {
  min-width: 0;
  max-width: 100%;
}

.boss-table .boss-table-loot-grid {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  min-width: 0;
}

.boss-table-loot-grid .boss-loot-item {
  width: 38px;
  min-width: 38px;
  padding: 4px 3px;
  gap: 3px;
  border-radius: 9px;
}

.boss-table-loot-grid .boss-loot-image,
.boss-table-loot-grid .boss-loot-item img {
  width: 24px;
  height: 24px;
}

.boss-table-loot-grid .boss-loot-chance {
  font-size: 0.66rem;
}

.boss-table .boss-table-schedule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-align: left;
  white-space: nowrap;
}

.boss-table-schedule-arrow {
  color: var(--muted);
}

.boss-table .boss-subscribe-btn {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 0.72rem;
}

.boss-table-location .boss-location-characters {
  flex-wrap: nowrap;
  gap: 0;
}

.boss-table-location .boss-location-character + .boss-location-character {
  margin-left: -5px;
}

.boss-table-empty {
  color: var(--muted);
}

@media (min-width: 761px) and (max-width: 1250px) {
  .boss-table .boss-table-schedule {
    display: grid;
    gap: 2px;
  }

  .boss-table-schedule-arrow {
    display: none;
  }
}

.boss-card,
.boss-empty-state {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  --boss-imminent-alpha: 0.12;
  --boss-imminent-glow: 0.16;
  --boss-imminent-border: 0.18;
  border: 1px solid var(--line-subtle);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, rgba(13, 29, 43, 0.96), rgba(8, 19, 29, 0.96));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.boss-empty-state {
  padding: 26px;
  color: var(--muted);
}

.boss-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(101, 214, 206, 0.09), transparent 28%);
  pointer-events: none;
}

.boss-card-imminent {
  border-color: rgba(255, 179, 71, var(--boss-imminent-border));
  box-shadow:
    0 0 0 1px rgba(255, 179, 71, calc(var(--boss-imminent-border) * 0.5)),
    0 18px 48px rgba(0, 0, 0, 0.24);
}

.boss-card-imminent::before {
  background:
    radial-gradient(circle at top right, rgba(255, 179, 71, var(--boss-imminent-alpha)), transparent 34%),
    linear-gradient(135deg, rgba(255, 179, 71, calc(var(--boss-imminent-alpha) * 0.55)), transparent 48%),
    linear-gradient(180deg, rgba(255, 179, 71, calc(var(--boss-imminent-alpha) * 0.22)), transparent 42%);
}

.boss-card-alert {
  border-color: rgba(255, 179, 71, 0.32);
  box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.12), 0 18px 48px rgba(0, 0, 0, 0.24);
}

.boss-card-live {
  border-color: rgba(105, 219, 124, 0.68);
  background: linear-gradient(180deg, rgba(13, 47, 38, 0.97), rgba(7, 27, 26, 0.97));
  box-shadow:
    0 0 0 1px rgba(105, 219, 124, 0.14),
    0 18px 48px rgba(0, 0, 0, 0.26),
    0 0 30px rgba(105, 219, 124, 0.1);
}

.boss-card-live::before {
  background:
    radial-gradient(circle at top right, rgba(105, 219, 124, 0.25), transparent 38%),
    linear-gradient(135deg, rgba(105, 219, 124, 0.09), transparent 52%);
}

.boss-card-live .boss-countdown-value,
.boss-card-live .boss-countdown-label {
  color: #91f2a4;
}

.boss-card-body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 18px;
  min-height: 100%;
}

.boss-card-top {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 104px;
  gap: 12px;
  align-items: start;
  min-height: 96px;
}

.boss-portrait-shell {
  position: relative;
  width: 86px;
  height: 86px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(173, 213, 255, 0.12);
  background: rgba(6, 15, 23, 0.84);
}

.boss-portrait {
  width: 86px;
  height: 86px;
  border-radius: 0;
  border: 0;
  background: transparent;
  object-fit: cover;
}

.boss-portrait-fallback {
  display: grid;
  place-items: center;
  color: var(--accent-2);
  font-weight: 800;
  font-size: 1.4rem;
}

.boss-level-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 5px 6px 6px;
  border-radius: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border: 0;
  border-top: 1px solid rgba(173, 213, 255, 0.12);
  background: linear-gradient(180deg, rgba(25, 37, 52, 0.9), rgba(13, 22, 32, 0.96));
  backdrop-filter: blur(4px);
}

.boss-meta {
  display: grid;
  grid-template-rows: minmax(56px, auto) minmax(28px, auto) 1fr;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.boss-name-row {
  display: flex;
  align-items: flex-start;
  min-height: 56px;
  margin-bottom: 0;
}

.boss-name {
  margin-bottom: 0;
  line-height: 1.1;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.boss-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.boss-level-badge,
.boss-status-badge,
.boss-location-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.boss-level-badge {
  border: 1px solid rgba(173, 213, 255, 0.14);
  background: rgba(173, 213, 255, 0.06);
  color: #d7eaff;
}

.boss-status-badge {
  border: 1px solid rgba(173, 213, 255, 0.14);
  background: rgba(173, 213, 255, 0.05);
  color: var(--muted);
}

.boss-status-badge[hidden] {
  display: none;
}

.boss-status-badge.upcoming {
  border-color: rgba(255, 179, 71, 0.25);
  color: #ffe2b5;
  background: rgba(255, 179, 71, 0.08);
}

.boss-status-badge.live {
  border-color: rgba(105, 219, 124, 0.24);
  color: var(--positive);
  background: rgba(105, 219, 124, 0.08);
}

.boss-status-badge.ended {
  color: var(--negative);
  border-color: rgba(255, 143, 143, 0.2);
  background: rgba(255, 143, 143, 0.08);
}

.boss-location-chip {
  max-width: 100%;
  border: 1px solid rgba(101, 214, 206, 0.2);
  background: rgba(101, 214, 206, 0.06);
  color: var(--accent-2);
}

.boss-location-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boss-location-chip img {
  width: 16px;
  height: 16px;
  border-radius: 5px;
}

.boss-countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 104px;
  min-height: 86px;
  text-align: right;
}

.boss-countdown-value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.boss-countdown-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.boss-card-actions {
  display: grid;
  grid-template-columns: minmax(128px, max-content) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.boss-subscribe-btn {
  min-width: 128px;
}

.boss-subscribe-btn.is-subscribed {
  border-color: rgba(255, 179, 71, 0.4);
  background: rgba(255, 179, 71, 0.12);
  color: #ffe2b5;
}

.boss-timer-meta {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: right;
  white-space: nowrap;
}

.boss-loot {
  margin-top: 18px;
  flex: 1 1 auto;
}

.boss-loot h4 {
  margin-bottom: 10px;
  font-size: 0.94rem;
}

.boss-loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 8px;
}

.boss-loot-item {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px 6px;
  border-radius: 13px;
  border: 1px solid rgba(173, 213, 255, 0.08);
  background: rgba(6, 15, 23, 0.68);
}

.boss-loot-item-epic {
  border-color: var(--quality-epic-border);
  background: var(--quality-epic-background);
  box-shadow: inset 0 0 0 1px var(--quality-epic-border);
}

.boss-loot-item-legendary {
  border-color: var(--quality-legendary-border);
  background: var(--quality-legendary-background);
  box-shadow: inset 0 0 0 1px var(--quality-legendary-border);
}

.boss-loot-item-premium {
  border-color: var(--quality-premium-border);
  background: var(--quality-premium-background);
  box-shadow: inset 0 0 0 1px var(--quality-premium-border);
}

.boss-loot-item-refined {
  border-color: var(--quality-refined-border);
  background: var(--quality-refined-background);
  box-shadow: inset 0 0 0 1px var(--quality-refined-border);
}

.boss-loot-item-mythic {
  border-color: var(--quality-mythic-border);
  background: var(--quality-mythic-background);
  box-shadow: inset 0 0 0 1px var(--quality-mythic-border);
}

.boss-loot-item-standard {
  border-color: var(--quality-standard-border);
  background: var(--quality-standard-background);
  box-shadow: inset 0 0 0 1px var(--quality-standard-border);
}

.boss-loot-item-unique {
  border-color: var(--quality-unique-border);
  background: var(--quality-unique-background);
  box-shadow: inset 0 0 0 1px var(--quality-unique-border);
}

.boss-loot-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.boss-loot-image {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
}

.boss-loot-chance {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.boss-location-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: auto -18px -18px;
  padding: 9px 18px 10px;
  border-top: 1px solid rgba(173, 213, 255, 0.08);
  background: linear-gradient(180deg, rgba(15, 30, 41, 0.88), rgba(10, 20, 29, 0.96));
}

.boss-location-chip-footer {
  display: flex;
  justify-content: center;
  margin: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #bfeee9;
  font-size: 0.9rem;
  text-align: center;
}

.boss-location-characters {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 0 0 auto;
}

.boss-location-character,
.boss-location-character img,
.boss-location-character-fallback {
  width: 24px;
  height: 24px;
  border-radius: 999px;
}

.boss-location-character {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  border: 1px solid rgba(173, 213, 255, 0.14);
  background: rgba(6, 15, 23, 0.78);
}

.boss-location-character-clip {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
}

.boss-location-character img {
  object-fit: cover;
}

.boss-location-character-fallback {
  display: grid;
  place-items: center;
  color: #d7eaff;
  font-size: 0.7rem;
  font-weight: 700;
}

.tracked-settings-avatar-shell {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  overflow: visible;
}

.tracked-settings-avatar-clip {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 59;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-shell.is-nested-picker {
  z-index: 61;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 16, 0.72);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(17, 40, 57, 0.96), rgba(10, 24, 35, 0.98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.modal-panel-wide {
  width: min(1040px, calc(100vw - 32px));
}

.settings-modal-panel {
  width: min(680px, calc(100vw - 32px));
}

.character-house-modal-panel {
  width: min(820px, calc(100vw - 32px));
  overflow-x: hidden;
  overflow-y: auto;
}

.character-session-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(320px, 1.28fr);
  gap: 12px;
  margin-bottom: 12px;
}

.character-session-section {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(6, 15, 23, 0.46);
}

.character-session-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.character-session-heading > div {
  display: grid;
  gap: 2px;
}

.character-session-kicker,
.character-session-note {
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.character-session-membership {
  padding: 4px 7px;
  border: 1px solid rgba(173, 213, 255, 0.15);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(7, 19, 29, 0.72);
  font-size: 0.69rem;
  white-space: nowrap;
}

.character-session-membership.is-active {
  border-color: rgba(101, 214, 206, 0.3);
  color: var(--accent);
}

.character-role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(4, 12, 19, 0.72);
}

.character-role-switch button {
  min-height: 34px;
  padding: 6px 12px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.character-role-switch button.is-active {
  border-color: rgba(101, 214, 206, 0.32);
  background: rgba(101, 214, 206, 0.14);
  color: var(--accent);
}

.character-session-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.character-session-summary strong {
  color: var(--text);
  font-size: 1rem;
}

.character-house-access-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.character-house-conduit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  white-space: nowrap;
}

.character-session-house .field-hint {
  margin: 8px 0 0;
}

.character-components-section {
  padding-bottom: 10px;
}

.character-components-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 10px;
}

.character-component-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 42px;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 5px 7px;
  border: 1px solid rgba(173, 213, 255, 0.1);
  border-radius: 12px;
  background: rgba(5, 14, 22, 0.48);
}

.character-component-skill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.character-component-skill > span:last-child {
  display: grid;
  min-width: 0;
}

.character-component-skill strong,
.character-component-skill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-component-skill strong {
  font-size: 0.78rem;
}

.character-component-skill small {
  color: var(--muted);
  font-size: 0.65rem;
}

.character-component-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  color: var(--accent);
}

.character-component-icon svg {
  width: 18px;
  height: 18px;
}

.character-component-select {
  min-width: 0;
}

.character-component-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 0.72rem;
  line-height: 1;
}

.character-component-toggle > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-component-toggle small,
.character-component-menu small {
  color: var(--muted);
  font-size: 0.63rem;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.character-component-menu {
  right: 0;
  left: auto;
  z-index: 8;
  width: 184px;
  max-height: 220px;
}

.character-component-menu .pet-mastery-option {
  display: grid;
  grid-template-columns: minmax(68px, 1fr) 58px;
  align-items: center;
  gap: 10px;
  line-height: 1;
}

.character-component-menu .pet-mastery-option > span {
  min-width: 0;
  white-space: nowrap;
}

#characterHouseLocationLabel {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#characterHouseLocationLabel > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-house-location-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.character-house-location-option > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-house-location-icon {
  display: grid;
  width: 28px;
  height: 28px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(101, 214, 206, 0.2);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(5, 17, 25, 0.76);
  font-size: 0.68rem;
}

#characterHouseLocationLabel .character-house-location-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

.character-house-location-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-house-location-icon.is-empty::before {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  border-radius: 50%;
  content: "";
}

.character-component-result {
  color: var(--accent);
  font-size: 0.74rem;
  text-align: right;
}

.character-settings-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.confirm-modal-panel {
  width: min(440px, calc(100vw - 32px));
}

.eyebrow.is-danger {
  color: var(--negative);
}

.confirm-modal-actions {
  justify-content: flex-end;
}

.danger-button {
  border-color: rgba(255, 143, 143, 0.5);
  color: #ffd1d1;
  background: linear-gradient(135deg, rgba(178, 49, 61, 0.34), rgba(107, 28, 39, 0.24));
}

.danger-button:hover {
  border-color: rgba(255, 143, 143, 0.75);
  background: linear-gradient(135deg, rgba(205, 59, 72, 0.45), rgba(119, 31, 43, 0.32));
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.modal-copy {
  color: var(--muted);
  margin-bottom: 0;
}

.modal-close {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 980px) {
  .benchmark-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid,
  .boss-toolbar,
  .boss-metrics {
    grid-template-columns: 1fr;
  }

  .search-filter-field {
    max-width: none;
  }

  .page-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px 10px 24px;
  }

  .hero {
    padding: 20px 18px;
  }

  .hero-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
  }

  .modal-header {
    width: 100%;
    flex-direction: column;
  }

  .hero-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
  }

  .tracked-character-strip {
    min-height: 40px;
  }

  .panel {
    padding: 16px;
    border-radius: 18px;
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .market-chain-field {
    width: 100%;
    grid-column: 1 / -1;
  }

  .market-chain-label {
    opacity: 1;
    pointer-events: auto;
    color: var(--muted);
  }

  .market-switch {
    width: 100%;
    justify-content: space-between;
  }

  .boss-controls {
    grid-template-columns: 1fr;
  }

  .boss-card-top {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .boss-portrait-shell {
    width: 72px;
    height: 72px;
  }

  .boss-portrait {
    width: 72px;
    height: 72px;
  }

  .boss-countdown {
    grid-column: 1 / -1;
    align-items: flex-start;
    width: auto;
    min-height: 0;
    text-align: left;
  }

  .boss-card-actions {
    grid-template-columns: 1fr;
  }

  .boss-timer-meta {
    text-align: left;
  }

  body {
    padding-bottom: 120px;
  }

  .engine-footer {
    bottom: 0;
    padding: 0;
  }

  .engine-footer-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
  }

  .boss-footer-item {
    grid-template-columns: 48px;
    padding: 0;
    border-radius: 14px;
    min-width: 48px;
    width: 48px;
    height: 48px;
    overflow: hidden;
  }

  .boss-footer-copy {
    display: none;
  }

  .boss-footer-thumb {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    border: 0;
  }

  .boss-footer-time {
    display: block;
    inset: auto 0 0 0;
    padding: 0 3px 2px;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(5, 12, 18, 0.08), rgba(5, 12, 18, 0.7));
    text-align: center;
    font-size: 0.62rem;
  }

  .boss-footer-level {
    display: none;
  }

  .global-toast-stack {
    right: 14px;
    bottom: 18px;
    left: 14px;
    align-items: stretch;
  }

  .global-toast {
    width: 100%;
  }

  .history-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-ranges {
    justify-content: flex-start;
  }

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

  .item-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .item-title-meta {
    margin-left: 0;
    justify-content: flex-start;
  }

  .tracked-settings-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .engine-info-panel {
    grid-template-columns: 1fr;
  }

  .api-live-layout {
    grid-template-columns: 1fr;
  }

  .api-worker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skill-health-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 2.2rem;
  }

  .api-flow {
    grid-template-columns: 1fr;
  }

  .api-flow-arrow {
    justify-self: center;
    line-height: 0.75;
    transform: rotate(90deg);
  }

  .api-flow-arrow.is-upstream {
    transform: rotate(90deg);
  }

  .api-worker-grid {
    grid-template-columns: 1fr;
  }

  .api-activity-row {
    grid-template-columns: 8px minmax(105px, 1fr) auto;
  }

  .world-boss-panel > .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .boss-view-switch {
    width: 100%;
  }

  .boss-view-button {
    flex: 1 1 0;
  }

  .world-boss-panel > .panel-header {
    gap: 9px;
    margin-bottom: 12px;
  }

  .world-boss-panel > .panel-header h2 {
    margin: 0;
    font-size: 1.35rem;
  }

  .boss-toolbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .boss-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .boss-metric-card {
    min-width: 0;
    padding: 9px 8px;
    border-radius: 13px;
  }

  .boss-metric-card .metric-label,
  .boss-metric-card .metric-note {
    display: block;
    overflow: hidden;
    font-size: 0.64rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .boss-metric-card strong {
    margin: 4px 0;
    font-size: 1.28rem;
    line-height: 1.1;
  }

  .boss-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 9px 8px;
    padding: 11px;
    border-radius: 14px;
  }

  .boss-alert-field {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    gap: 12px;
  }

  .boss-alert-field > span {
    margin: 0;
    font-size: 0.74rem;
  }

  .boss-alert-field select {
    width: 130px;
    min-width: 130px;
    min-height: 36px;
    padding-top: 5px;
    padding-bottom: 5px;
  }

  .boss-controls .boss-sound-toggle {
    justify-content: flex-start;
    min-width: 0;
    min-height: 34px;
    gap: 7px;
    font-size: 0.72rem;
  }

  .boss-controls .boss-switch-track {
    width: 40px;
    height: 22px;
    flex-basis: 40px;
  }

  .boss-controls .boss-switch-thumb {
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
  }

  .boss-controls .boss-switch input:checked + .boss-switch-track .boss-switch-thumb {
    transform: translateX(18px);
  }

  .boss-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .boss-actions button {
    width: 100%;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.7rem;
  }

  .boss-table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .boss-table-scroll {
    overflow: visible;
  }

  .boss-table,
  .boss-table thead,
  .boss-table tbody,
  .boss-table tr,
  .boss-table td {
    display: block;
    width: 100%;
  }

  .boss-table {
    min-width: 0;
  }

  .boss-table thead {
    display: none;
  }

  .boss-table tbody {
    display: grid;
    gap: 12px;
  }

  .boss-table-row {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line-subtle);
    border-radius: 16px;
    background: rgba(13, 29, 43, 0.92);
  }

  .boss-table-row-live {
    border-color: rgba(105, 219, 124, 0.58);
    background: rgba(14, 48, 39, 0.9);
  }

  .boss-table-row-imminent {
    border-color: rgba(255, 179, 71, 0.34);
  }

  .boss-table td {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border-bottom: 1px solid rgba(173, 213, 255, 0.08);
  }

  .boss-table td:last-child {
    border-bottom: 0;
  }

  .boss-table td::before {
    content: attr(data-label);
    color: #8ebce8;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .boss-table-loot-grid {
    flex-wrap: wrap;
  }

  .boss-table .boss-subscribe-btn {
    width: max-content;
    min-width: 118px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-control-bar input[type="search"],
  .market-control-bar .multi-filter-toggle,
  .market-control-bar .market-switch {
    height: var(--control-height);
    min-height: var(--control-height);
  }

  .modal-shell {
    padding: 8px;
  }

  .modal-panel {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    padding: 18px 14px;
    border-radius: 18px;
  }

  .character-session-layout,
  .character-components-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .character-session-section {
    padding: 11px;
  }

  .character-house-access-grid {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .character-component-row {
    grid-template-columns: minmax(0, 1fr) 108px 40px;
  }

  .character-session-heading {
    gap: 8px;
  }

  .character-session-membership {
    white-space: normal;
    text-align: right;
  }

  .tracked-settings-item {
    grid-template-columns: minmax(0, 1fr);
    padding: 11px;
  }

  .tracked-settings-summary,
  .tracked-settings-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .tracked-settings-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-transfer-actions button {
    flex: 1 1 auto;
  }

  .page-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 8px 20px;
  }

  .market-health-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .engine-overall {
    width: 100%;
    min-width: 0;
    justify-content: start;
  }

  .skill-health-row {
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 8px 12px;
  }

  .skill-health-progress {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .skill-health-result {
    grid-column: 2;
    grid-row: 1;
  }

  .layout {
    margin-top: 12px;
  }

  .hero-nav {
    width: 100%;
  }

  .hero-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .hero-actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .hero-button {
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .nav-tab {
    flex: 1 1 0;
    text-align: center;
  }

  .engine-title {
    display: none;
  }

  .opportunities-panel > .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .opportunity-table,
  .opportunity-table thead,
  .opportunity-table tbody,
  .opportunity-table tr,
  .opportunity-table td {
    display: block;
    width: 100%;
  }

  .opportunity-table thead {
    display: none;
  }

  .opportunity-table tbody {
    display: grid;
    gap: 12px;
  }

  tr.opportunity-row,
  tr.history-row {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(13, 29, 43, 0.92);
    overflow: hidden;
  }

  tr.opportunity-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  tr.opportunity-row.chain-row {
    background:
      linear-gradient(90deg, rgba(101, 214, 206, 0.1), rgba(101, 214, 206, 0.03) 24%, rgba(13, 29, 43, 0.92) 55%);
  }

  tr.opportunity-row td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(173, 213, 255, 0.08);
  }

  tr.opportunity-row td:nth-child(1),
  tr.opportunity-row td:nth-child(9) {
    grid-column: 1 / -1;
  }

  tr.opportunity-row td:nth-child(2),
  tr.opportunity-row td:nth-child(3),
  tr.opportunity-row td:nth-child(7),
  tr.opportunity-row td:nth-child(8) {
    grid-column: span 3;
  }

  tr.opportunity-row td:nth-child(4),
  tr.opportunity-row td:nth-child(5),
  tr.opportunity-row td:nth-child(6) {
    grid-column: span 2;
  }

  tr.opportunity-row td:last-child {
    border-bottom: 0;
  }

  tr.opportunity-row td:first-child {
    padding-top: 12px;
  }

  tr.opportunity-row td:not(:first-child) {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  tr.opportunity-row td:nth-child(2) > :last-child,
  tr.opportunity-row td:nth-child(3) > :last-child,
  tr.opportunity-row td:nth-child(7) > :last-child,
  tr.opportunity-row td:nth-child(8) > :last-child {
    min-width: 0;
    justify-self: end;
  }

  tr.opportunity-row td:nth-child(4),
  tr.opportunity-row td:nth-child(5),
  tr.opportunity-row td:nth-child(6) {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    grid-template-columns: 1fr;
  }

  tr.opportunity-row td:not(:first-child)::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
  }

  tr.opportunity-row td:nth-child(4)::before,
  tr.opportunity-row td:nth-child(5)::before,
  tr.opportunity-row td:nth-child(6)::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
  }

  tr.history-row td {
    padding: 0;
    border-bottom: 0;
  }

  .item-cell {
    align-items: flex-start;
  }

  .item-title-row {
    gap: 6px;
  }

  .item-title-main-chain {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .item-title-meta {
    margin-left: 0;
    justify-content: flex-start;
  }

  .character-cell {
    min-width: 0;
    justify-content: flex-end;
  }

  .character-stack {
    padding-left: 0;
  }

  .character-avatar-frame {
    width: 30px;
    height: 30px;
  }

  .character-avatar-frame + .character-avatar-frame {
    margin-left: -12px;
  }

  .engine-footer-inner {
    padding: 10px 14px;
  }

  .boss-footer-track {
    gap: 8px;
  }

  .pets-summary {
    justify-content: flex-start;
  }

  .pets-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    padding: 10px;
  }

  .pets-controls > *,
  #petQualityFilterMount,
  #petSourceFilterMount {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .pets-controls .database-clear-filters {
    min-height: var(--control-height);
  }

  .pets-controls .database-clear-filter-label {
    display: inline;
  }

  .pets-pat-toggle,
  .pets-owned-toggle {
    min-width: 0;
  }

  .pets-table-wrap,
  .endgame-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  .pets-table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .pets-table thead { display: none; }
  .pets-table tbody {
    display: grid;
    gap: 10px;
  }

  .pets-table tr.pet-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(13, 29, 43, 0.92);
  }

  .pets-table tr.pet-row td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(173, 213, 255, 0.08);
    text-align: right;
  }

  .pets-table tr.pet-row td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: left;
  }

  .pets-table tr.pet-row td:first-child,
  .pets-table tr.pet-row td:nth-child(13),
  .pets-table tr.pet-row td:last-child {
    grid-column: 1 / -1;
  }

  .pets-table tr.pet-row td:first-child::before,
  .pets-table tr.pet-row td:last-child::before {
    display: none;
  }

  .pets-table tr.pet-row td:last-child {
    border-bottom: 0;
  }

  .pets-table tr.pet-history-row {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .pets-table tr.pet-history-row > td {
    display: block;
    width: 100%;
    padding: 0;
  }

  .pet-history-panel {
    padding: 14px;
  }

  .comparison-toggle {
    width: 100%;
  }

  .endgame-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .endgame-table thead {
    display: none;
  }

  .endgame-table tbody {
    display: grid;
    gap: 10px;
  }

  .endgame-table tr.endgame-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(13, 29, 43, 0.92);
  }

  .endgame-recipes-table tr.endgame-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .endgame-recipes-table tr.endgame-row td {
    grid-column: span 2;
  }

  .endgame-recipes-table tr.endgame-row td:nth-child(2) {
    grid-column: span 3;
    justify-content: flex-start;
  }

  .endgame-recipes-table tr.endgame-row td:nth-child(3) {
    grid-column: span 1;
  }

  .endgame-table tr.endgame-row td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(173, 213, 255, 0.08);
    text-align: right;
  }

  .endgame-table tr.endgame-row td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-align: left;
  }

  .endgame-table tr.endgame-row td:first-child,
  .endgame-table tr.endgame-row td:last-child {
    grid-column: 1 / -1;
  }

  .endgame-recipes-table tr.endgame-row td:nth-child(2) .item-tooltip-reference {
    overflow: hidden;
  }

  .endgame-recipes-table tr.endgame-row td:nth-child(2) .item-tooltip-reference > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .endgame-table tr.endgame-row td:first-child::before,
  .endgame-table tr.endgame-row td:last-child::before {
    display: none;
  }

  .endgame-table tr.endgame-history-row {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
  }

  .endgame-table tr.endgame-history-row > td {
    display: block;
    width: 100%;
    padding: 0;
  }
}

/* Command header and compact mobile navigation. */
@media (max-width: 980px) {
  .hero { padding: 0; }

  .hero-topbar {
    display: grid;
    grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
  }

  .hero-nav { width: auto; }
  .nav-tab { padding: 0 9px; }
  .nav-tab-icon { display: none; }
}

@media (max-width: 760px) {
  body { padding-bottom: 82px; }
  body.has-boss-footer { padding-bottom: 142px; }
  .hero { padding: 0; border-radius: 19px; }

  .hero-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 14px 12px;
  }

  .hero-brand { gap: 9px; }

  .hero-brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .hero h1 { font-size: clamp(1rem, 5vw, 1.25rem); }
  .hero-actions { grid-column: 2; grid-row: 1; }
  .hero-button {
    width: 36px;
    height: 36px;
    padding: 0;
    line-height: 0;
  }
  .hero-button svg {
    display: block;
    width: 18px;
    height: 18px;
  }

  .market-option-switches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-option-switches .market-switch {
    min-width: 0;
    padding-inline: 9px;
  }

  .benchmark-item-cell .item-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .combat-benchmark-row td[data-label="Profit/Item"],
  .combat-benchmark-row td[data-label="Buffs"]:has(.compact-value) {
    display: none;
  }

  .combat-loadout-editor-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .combat-editor-loadout {
    min-height: 360px;
  }

  .benchmark-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
  }

  .benchmark-detail-chip {
    max-width: none;
    flex: 1 1 145px;
  }

  .hero-nav {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    min-height: 68px;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid rgba(173, 213, 255, 0.16);
    background: rgba(7, 19, 28, 0.96);
    box-shadow: 0 -14px 35px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
  }

  .nav-tab {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 54px;
    padding: 5px 2px;
    border-radius: 13px;
    font-size: 0.65rem;
    line-height: 1;
  }

  .nav-tab-icon { display: grid; }
  .nav-tab-icon svg { width: 18px; height: 18px; }

  .character-console {
    align-items: center;
    min-height: 58px;
    padding: 9px 14px 11px;
  }

  .character-console-summary { gap: 8px; }
  .character-state-text { display: none; }

  .tracked-character-strip {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .tracked-character-chip { width: 36px; height: 36px; }

  .tracked-character-avatar-shell,
  .tracked-character-avatar-clip {
    width: 30px;
    height: 30px;
  }

  .character-manager-button {
    min-width: 80px;
    justify-content: center;
    padding: 0 11px;
  }

  .character-manager-popover {
    right: 0;
    width: min(390px, calc(100vw - 28px));
  }

  .engine-footer { bottom: 68px; z-index: 44; }

  .back-to-top {
    right: max(13px, env(safe-area-inset-right));
    bottom: 82px;
    width: 40px;
    height: 40px;
  }

  body.has-boss-footer .back-to-top {
    bottom: 146px;
  }

  .engine-footer-inner {
    min-height: 60px;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(173, 213, 255, 0.1);
  }

  .global-toast-stack { bottom: 82px; }
  body.has-boss-footer .global-toast-stack { bottom: 146px; }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition-duration: 0.01ms;
  }
}

@media (max-width: 430px) {
  .character-house-access-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .character-component-row {
    grid-template-columns: minmax(0, 1fr) 104px 38px;
    gap: 6px;
  }

  .character-component-skill small {
    display: none;
  }

  .pets-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-brand-logo {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
  }

  .character-manager-input-row {
    align-items: stretch;
    flex-direction: column;
  }

  .character-manager-input-row .primary { width: 100%; }

  .character-manager-item {
    align-items: flex-start;
  }

  .character-manager-item-actions {
    gap: 4px;
  }

  .character-resync-button {
    padding-inline: 7px;
  }
}
