:root {
  color-scheme: dark;

  /* Warm Obsidian Tavern & Burnished Gold Palette */
  --bg-canvas: #0b0d14;
  --bg-sidebar: #101420;
  --bg-surface: #141928;
  --bg-surface-2: #1a2135;
  --bg-row-hover: #212b45;
  --border: #252f49;
  --border-gold: rgba(217, 165, 62, 0.38);
  --border-strong: #374569;

  --text-primary: #f2efe9;
  --text-secondary: #a5b0c9;
  --text-muted: #6f7c99;

  --gold: #e8b84b;
  --gold-bright: #ffd36b;
  --gold-soft: rgba(232, 184, 75, 0.14);

  /* WoW Coin Colors */
  --coin-gold: #ffd100;
  --coin-silver: #d4dce8;
  --coin-copper: #e08d55;

  /* WoW Skill Difficulty Colors */
  --skill-orange: #ff8040;
  --skill-yellow: #ffd83d;
  --skill-green: #40c855;
  --skill-gray: #7c89a6;
  --skill-red: #f87171;

  /* Semantic Colors */
  --profit-pos: #34d399;
  --profit-neg: #f87171;
  --badge-high-bg: rgba(52, 211, 153, 0.16);
  --badge-high-fg: #34d399;
  --badge-med-bg: rgba(251, 191, 36, 0.16);
  --badge-med-fg: #fbbf24;
  --badge-low-bg: rgba(248, 113, 113, 0.16);
  --badge-low-fg: #f87171;

  --src-known-bg: rgba(52, 211, 153, 0.16);
  --src-known-fg: #34d399;
  --src-trainer-bg: rgba(56, 189, 248, 0.16);
  --src-trainer-fg: #38bdf8;
  --src-vendor-bg: rgba(34, 211, 238, 0.16);
  --src-vendor-fg: #22d3ee;
  --src-ah-bg: rgba(232, 184, 75, 0.18);
  --src-ah-fg: #ffd36b;

  --font-display: "Cinzel", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.38);

  accent-color: var(--gold);
  scrollbar-color: #364566 #0d111d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  line-height: 1.48;
  background:
    radial-gradient(900px 500px at 8% 0%, rgba(232, 184, 75, 0.09), transparent 55%),
    radial-gradient(800px 500px at 92% 4%, rgba(56, 189, 248, 0.07), transparent 55%),
    var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

/* ================================================================
   2-Column App Shell (Left Character Dock + Right Workbench)
   ================================================================ */
.app-shell {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  min-height: 100vh;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Left Sidebar */
.sidebar {
  background: linear-gradient(180deg, #111626 0%, #0d111d 100%);
  border-inline-end: 1px solid var(--border);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  position: sticky;
  inset-block-start: 0;
  max-height: 100vh;
  min-width: 0;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  .sidebar {
    position: relative;
    z-index: 50;
    max-height: none;
    overflow: visible;
    border-inline-end: none;
    border-block-end: 1px solid var(--border);
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

@keyframes brand-gold-shimmer {
  0% {
    background-position: 115% 0;
  }
  42%, 100% {
    background-position: -45% 0;
  }
}

@keyframes crest-emblem-glow {
  0%, 100% {
    filter: drop-shadow(0 0 3px rgba(232, 184, 75, 0.35));
  }
  50% {
    filter: drop-shadow(0 0 7px rgba(255, 224, 138, 0.65));
  }
}

.brand-crest {
  width: 42px;
  height: 42px;
  flex: none;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.crest-emblem {
  animation: crest-emblem-glow 4.5s ease-in-out infinite;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  background: linear-gradient(
    105deg,
    #f2c85b 0%,
    #f9df8e 38%,
    #fffdf2 49%,
    #ffffff 50%,
    #fffdf2 51%,
    #f9df8e 62%,
    #f2c85b 100%
  );
  background-size: 280% 100%;
  background-position: 115% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(232, 184, 75, 0.22));
  animation: brand-gold-shimmer 4.5s ease-in-out infinite;
}

.brand-sub {
  margin: 0.16rem 0 0;
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--text-primary);
}

.brand-sub-game {
  color: #e6cc8a;
}

.brand-sub-dot {
  color: rgba(232, 184, 75, 0.55);
}

@media (max-width: 1024px) {
  .sidebar-brand {
    gap: 0.85rem;
  }

  .brand-crest {
    width: 48px;
    height: 48px;
  }

  .brand-title {
    font-size: clamp(1.18rem, 5.1vw, 1.4rem);
  }

  .brand-sub {
    font-size: clamp(0.64rem, 2.7vw, 0.74rem);
    letter-spacing: 0.08em;
    gap: 0.34rem;
  }
}

/* Dock Cards */
.dock-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dock-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dock-heading-row .dock-heading {
  min-width: 0;
  line-height: 1.25;
}

.dock-heading {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.dock-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.dock-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modern Borderless Character Switcher Dock */
.char-dock {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.char-search-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.char-command-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.28rem 0.25rem 0.7rem;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(17, 22, 38, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.char-command-bar:focus-within {
  border-color: var(--gold);
  background: rgba(21, 27, 46, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.char-command-icon {
  flex: none;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.char-command-bar:focus-within .char-command-icon {
  color: var(--gold);
}

.char-command-bar input[type="text"],
.char-command-bar input[type="text"]:focus,
.char-command-bar input[type="text"]:focus-visible {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: 0.2rem 0.15rem;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.86rem;
  outline: none;
  box-shadow: none;
}

.char-command-bar input[type="text"]::placeholder {
  color: var(--text-muted);
}

.char-load-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 0.72rem;
  border-radius: 8px;
  border: 1px solid rgba(232, 184, 75, 0.45);
  background: linear-gradient(180deg, rgba(232, 184, 75, 0.22), rgba(232, 184, 75, 0.12));
  color: var(--gold-bright);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.char-load-pill:hover:not(:disabled) {
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(232, 184, 75, 0.34), rgba(232, 184, 75, 0.2));
  color: #fff6d6;
}

.char-load-pill:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.char-load-pill.is-loading {
  cursor: wait;
}

/* Recent Character Chips (2-column LRU grid, max 10) */
.recent-chars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.recent-chars[hidden] {
  display: none;
}

.recent-chip {
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 0.74rem;
  overflow: hidden;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.recent-chip:hover {
  border-color: var(--border-gold);
}

.recent-chip.is-active {
  border-color: var(--border-gold);
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.recent-chip-select {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 0.35rem;
  padding: 0.24rem 0.35rem 0.24rem 0.28rem;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.recent-chip-select span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-chip-select:hover {
  color: var(--text-primary);
}

.recent-chip-select img {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.recent-chip-remove {
  display: inline-grid;
  place-items: center;
  width: 22px;
  align-self: stretch;
  padding: 0 0.22rem 0 0.1rem;
  background: transparent;
  border: none;
  border-inline-start: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.recent-chip-remove:hover {
  background: rgba(248, 113, 113, 0.16);
  color: var(--profit-neg);
}

.char-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  flex: none;
}

@keyframes char-hero-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes char-hero-swap {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Character Armory Hero Card */
.char-hero {
  --char-class-color: var(--gold);
  --char-faction-rgb: 232, 184, 75;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--char-faction-rgb), 0.32);
  background:
    radial-gradient(circle at 16% 24%, rgba(var(--char-faction-rgb), 0.2) 0%, transparent 62%),
    linear-gradient(135deg, #171e34 0%, #101526 100%);
  padding: 0.8rem 0.85rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 8px 24px rgba(0, 0, 0, 0.26);
  transition: border-color 240ms ease;
}

.char-hero.is-entering {
  animation: char-hero-enter 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.char-hero-top.is-swapping {
  animation: char-hero-swap 210ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .char-hero.is-entering,
  .char-hero-top.is-swapping {
    animation: none;
  }
}

.char-hero[hidden] {
  display: none;
}

.char-hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.char-avatar-wrap {
  position: relative;
  flex: none;
}

.char-avatar-ring {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, var(--char-class-color), #6e4f19);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.char-avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.char-level-badge {
  position: absolute;
  inset-block-end: -3px;
  inset-inline-end: -3px;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1.5px solid #121728;
  background: linear-gradient(180deg, #273152, #151b2f);
  color: var(--gold-bright);
  font-size: 0.64rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.char-level-badge[hidden] {
  display: none;
}

.char-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold);
}

.char-identity {
  min-width: 0;
  flex: 1;
}

.char-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.char-display-name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-class-line {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 0.1rem;
}

.char-realm-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.mini-pill {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.mini-pill.alliance {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.mini-pill.horde {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
}

/* Tactile WoW Skill Slider HUD */
.skill-hud {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

@keyframes wow-slider-swirl {
  0% {
    background-position: 0 0, 0 0, 0 0, 0 0, 0% 0;
  }
  100% {
    background-position: 0 0, 0 0, 72px 0, -108px 0, 200% 0;
  }
}

.wow-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 11px;
  border-radius: 999px;
  background-color: #0a0e18;
  background-image:
    linear-gradient(
      90deg,
      transparent 0%,
      transparent var(--fill-pct, 0%),
      #0a0e18 var(--fill-pct, 0%),
      #0a0e18 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.26) 0%,
      rgba(255, 255, 255, 0.04) 48%,
      rgba(0, 0, 0, 0.28) 100%
    ),
    radial-gradient(
      ellipse 62% 135% at 32% 30%,
      rgba(255, 247, 214, 0.52) 0%,
      rgba(255, 247, 214, 0) 64%
    ),
    radial-gradient(
      ellipse 58% 140% at 70% 72%,
      rgba(255, 198, 72, 0.44) 0%,
      rgba(255, 198, 72, 0) 62%
    ),
    linear-gradient(
      90deg,
      #9a6514 0%,
      #d99b26 26%,
      #f8d878 50%,
      #cf8b1d 76%,
      #9a6514 100%
    );
  background-size: 100% 100%, 100% 100%, 72px 100%, 54px 100%, 200% 100%;
  background-repeat: no-repeat, no-repeat, repeat-x, repeat-x, repeat-x;
  animation: wow-slider-swirl 5.5s linear infinite;
  border: 1px solid rgba(232, 184, 75, 0.34);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 0 10px rgba(232, 184, 75, 0.14);
  cursor: pointer;
  margin: 0.25rem 0;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wow-slider:hover,
.wow-slider:active {
  border-color: rgba(247, 211, 114, 0.62);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 0 14px rgba(247, 211, 114, 0.28);
}

/* Profession Skill Bar Themes (default: Alchemy Teal) */
:root,
[data-prof="alchemy"] {
  --prof-bar-deep: #0f766e;
  --prof-bar-mid: #14b8a6;
  --prof-bar-accent: #5eead4;
  --prof-eddy-light: rgba(204, 251, 241, 0.56);
  --prof-eddy-warm: rgba(94, 234, 212, 0.44);
  --prof-border: rgba(45, 212, 191, 0.4);
  --prof-border-hover: rgba(153, 246, 228, 0.72);
  --prof-glow: rgba(20, 184, 166, 0.24);
  --prof-glow-hover: rgba(45, 212, 191, 0.4);
  --prof-thumb-light: #f0fdfa;
  --prof-thumb-mid: #2dd4bf;
  --prof-thumb-deep: #115e59;
  --prof-thumb-ring: rgba(45, 212, 191, 0.52);
  --prof-thumb-glow: rgba(45, 212, 191, 0.62);
}

[data-prof="cooking"] {
  --prof-bar-deep: #9a3412;
  --prof-bar-mid: #ea580c;
  --prof-bar-accent: #fbbf24;
  --prof-eddy-light: rgba(254, 243, 199, 0.56);
  --prof-eddy-warm: rgba(251, 146, 60, 0.48);
  --prof-border: rgba(251, 146, 60, 0.44);
  --prof-border-hover: rgba(253, 186, 116, 0.75);
  --prof-glow: rgba(234, 88, 12, 0.26);
  --prof-glow-hover: rgba(251, 146, 60, 0.42);
  --prof-thumb-light: #fff7ed;
  --prof-thumb-mid: #fb923c;
  --prof-thumb-deep: #9a3412;
  --prof-thumb-ring: rgba(251, 146, 60, 0.54);
  --prof-thumb-glow: rgba(249, 115, 22, 0.62);
}

[data-prof="first-aid"] {
  --prof-bar-deep: #9f1239;
  --prof-bar-mid: #e11d48;
  --prof-bar-accent: #fda4af;
  --prof-eddy-light: rgba(255, 228, 230, 0.56);
  --prof-eddy-warm: rgba(251, 113, 133, 0.46);
  --prof-border: rgba(251, 113, 133, 0.42);
  --prof-border-hover: rgba(253, 164, 175, 0.75);
  --prof-glow: rgba(225, 29, 72, 0.24);
  --prof-glow-hover: rgba(251, 113, 133, 0.42);
  --prof-thumb-light: #fff1f2;
  --prof-thumb-mid: #fb7185;
  --prof-thumb-deep: #881337;
  --prof-thumb-ring: rgba(251, 113, 133, 0.52);
  --prof-thumb-glow: rgba(225, 29, 72, 0.6);
}

[data-prof="blacksmithing"] {
  --prof-bar-deep: #334155;
  --prof-bar-mid: #94a3b8;
  --prof-bar-accent: #fb923c;
  --prof-eddy-light: rgba(241, 245, 249, 0.54);
  --prof-eddy-warm: rgba(251, 146, 60, 0.46);
  --prof-border: rgba(148, 163, 184, 0.42);
  --prof-border-hover: rgba(251, 146, 60, 0.72);
  --prof-glow: rgba(148, 163, 184, 0.22);
  --prof-glow-hover: rgba(251, 146, 60, 0.36);
  --prof-thumb-light: #f8fafc;
  --prof-thumb-mid: #cbd5e1;
  --prof-thumb-deep: #475569;
  --prof-thumb-ring: rgba(203, 213, 225, 0.52);
  --prof-thumb-glow: rgba(251, 146, 60, 0.55);
}

[data-prof="tailoring"] {
  --prof-bar-deep: #3730a3;
  --prof-bar-mid: #6366f1;
  --prof-bar-accent: #a5b4fc;
  --prof-eddy-light: rgba(224, 231, 255, 0.56);
  --prof-eddy-warm: rgba(129, 140, 248, 0.46);
  --prof-border: rgba(129, 140, 248, 0.42);
  --prof-border-hover: rgba(199, 210, 254, 0.75);
  --prof-glow: rgba(99, 102, 241, 0.26);
  --prof-glow-hover: rgba(129, 140, 248, 0.44);
  --prof-thumb-light: #eef2ff;
  --prof-thumb-mid: #818cf8;
  --prof-thumb-deep: #312e81;
  --prof-thumb-ring: rgba(129, 140, 248, 0.54);
  --prof-thumb-glow: rgba(99, 102, 241, 0.62);
}

[data-prof="engineering"] {
  --prof-bar-deep: #92400e;
  --prof-bar-mid: #f59e0b;
  --prof-bar-accent: #38bdf8;
  --prof-eddy-light: rgba(224, 242, 254, 0.56);
  --prof-eddy-warm: rgba(251, 191, 36, 0.48);
  --prof-border: rgba(56, 189, 248, 0.42);
  --prof-border-hover: rgba(125, 211, 252, 0.75);
  --prof-glow: rgba(245, 158, 11, 0.24);
  --prof-glow-hover: rgba(56, 189, 248, 0.4);
  --prof-thumb-light: #fffbeb;
  --prof-thumb-mid: #fbbf24;
  --prof-thumb-deep: #92400e;
  --prof-thumb-ring: rgba(56, 189, 248, 0.54);
  --prof-thumb-glow: rgba(56, 189, 248, 0.6);
}

[data-prof="leatherworking"] {
  --prof-bar-deep: #78350f;
  --prof-bar-mid: #b45309;
  --prof-bar-accent: #f59e0b;
  --prof-eddy-light: rgba(254, 243, 199, 0.52);
  --prof-eddy-warm: rgba(217, 119, 6, 0.48);
  --prof-border: rgba(217, 119, 6, 0.44);
  --prof-border-hover: rgba(251, 191, 36, 0.72);
  --prof-glow: rgba(180, 83, 9, 0.26);
  --prof-glow-hover: rgba(217, 119, 6, 0.42);
  --prof-thumb-light: #fef3c7;
  --prof-thumb-mid: #d97706;
  --prof-thumb-deep: #78350f;
  --prof-thumb-ring: rgba(217, 119, 6, 0.54);
  --prof-thumb-glow: rgba(217, 119, 6, 0.6);
}

[data-prof="enchanting"] {
  --prof-bar-deep: #6b21a8;
  --prof-bar-mid: #a855f7;
  --prof-bar-accent: #f0abfc;
  --prof-eddy-light: rgba(250, 232, 255, 0.58);
  --prof-eddy-warm: rgba(192, 132, 252, 0.48);
  --prof-border: rgba(192, 132, 252, 0.44);
  --prof-border-hover: rgba(240, 171, 252, 0.78);
  --prof-glow: rgba(168, 85, 247, 0.28);
  --prof-glow-hover: rgba(192, 132, 252, 0.46);
  --prof-thumb-light: #fdf4ff;
  --prof-thumb-mid: #c084fc;
  --prof-thumb-deep: #581c87;
  --prof-thumb-ring: rgba(192, 132, 252, 0.56);
  --prof-thumb-glow: rgba(168, 85, 247, 0.66);
}

[data-prof="herbalism"] {
  --prof-bar-deep: #14532d;
  --prof-bar-mid: #16a34a;
  --prof-bar-accent: #86efac;
  --prof-eddy-light: rgba(220, 252, 231, 0.56);
  --prof-eddy-warm: rgba(74, 222, 128, 0.46);
  --prof-border: rgba(74, 222, 128, 0.44);
  --prof-border-hover: rgba(134, 239, 172, 0.76);
  --prof-glow: rgba(22, 163, 74, 0.26);
  --prof-glow-hover: rgba(74, 222, 128, 0.42);
  --prof-thumb-light: #f0fdf4;
  --prof-thumb-mid: #4ade80;
  --prof-thumb-deep: #166534;
  --prof-thumb-ring: rgba(74, 222, 128, 0.54);
  --prof-thumb-glow: rgba(22, 163, 74, 0.62);
}

[data-prof="mining"] {
  --prof-bar-deep: #7c2d12;
  --prof-bar-mid: #c2410c;
  --prof-bar-accent: #fbbf24;
  --prof-eddy-light: rgba(254, 243, 199, 0.54);
  --prof-eddy-warm: rgba(245, 158, 11, 0.46);
  --prof-border: rgba(245, 158, 11, 0.44);
  --prof-border-hover: rgba(251, 191, 36, 0.76);
  --prof-glow: rgba(194, 65, 12, 0.26);
  --prof-glow-hover: rgba(245, 158, 11, 0.42);
  --prof-thumb-light: #fffbeb;
  --prof-thumb-mid: #f59e0b;
  --prof-thumb-deep: #7c2d12;
  --prof-thumb-ring: rgba(245, 158, 11, 0.54);
  --prof-thumb-glow: rgba(217, 119, 6, 0.6);
}

[data-prof="skinning"] {
  --prof-bar-deep: #713f12;
  --prof-bar-mid: #a16207;
  --prof-bar-accent: #fde047;
  --prof-eddy-light: rgba(254, 249, 195, 0.52);
  --prof-eddy-warm: rgba(234, 179, 8, 0.44);
  --prof-border: rgba(202, 138, 4, 0.44);
  --prof-border-hover: rgba(250, 204, 21, 0.74);
  --prof-glow: rgba(161, 98, 7, 0.24);
  --prof-glow-hover: rgba(202, 138, 4, 0.4);
  --prof-thumb-light: #fefce8;
  --prof-thumb-mid: #eab308;
  --prof-thumb-deep: #713f12;
  --prof-thumb-ring: rgba(202, 138, 4, 0.52);
  --prof-thumb-glow: rgba(161, 98, 7, 0.58);
}

[data-prof="fishing"] {
  --prof-bar-deep: #0c4a6e;
  --prof-bar-mid: #0284c7;
  --prof-bar-accent: #7dd3fc;
  --prof-eddy-light: rgba(224, 242, 254, 0.58);
  --prof-eddy-warm: rgba(56, 189, 248, 0.46);
  --prof-border: rgba(56, 189, 248, 0.44);
  --prof-border-hover: rgba(125, 211, 252, 0.78);
  --prof-glow: rgba(2, 132, 199, 0.26);
  --prof-glow-hover: rgba(56, 189, 248, 0.44);
  --prof-thumb-light: #f0f9ff;
  --prof-thumb-mid: #38bdf8;
  --prof-thumb-deep: #075985;
  --prof-thumb-ring: rgba(56, 189, 248, 0.54);
  --prof-thumb-glow: rgba(2, 132, 199, 0.62);
}

.wow-slider.skill-slider {
  height: 12px;
  background-image:
    linear-gradient(
      90deg,
      transparent 0%,
      transparent var(--fill-pct, 0%),
      #0a0e18 var(--fill-pct, 0%),
      #0a0e18 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.04) 48%,
      rgba(0, 0, 0, 0.28) 100%
    ),
    radial-gradient(
      ellipse 62% 135% at 32% 30%,
      var(--prof-eddy-light) 0%,
      transparent 64%
    ),
    radial-gradient(
      ellipse 58% 140% at 70% 72%,
      var(--prof-eddy-warm) 0%,
      transparent 62%
    ),
    linear-gradient(
      90deg,
      var(--prof-bar-deep) 0%,
      var(--prof-bar-mid) 28%,
      var(--prof-bar-accent) 52%,
      var(--prof-bar-mid) 76%,
      var(--prof-bar-deep) 100%
    );
  border-color: var(--prof-border);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 0 12px var(--prof-glow);
}

.wow-slider.skill-slider:hover,
.wow-slider.skill-slider:active {
  border-color: var(--prof-border-hover);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    0 0 16px var(--prof-glow-hover);
}

.slider-card.disabled .wow-slider {
  animation: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}

.wow-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fffbe6 0%, #f7d372 38%, #c98a1e 78%, #7a4e0b 100%);
  border: 2px solid #161106;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.75),
    0 0 0 2px rgba(232, 184, 75, 0.42),
    0 0 10px rgba(247, 211, 114, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.65);
  cursor: grab;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.wow-slider::-webkit-slider-thumb:hover {
  transform: scale(1.14);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.85),
    0 0 0 2px rgba(247, 211, 114, 0.68),
    0 0 16px rgba(247, 211, 114, 0.72),
    0 2px 8px rgba(0, 0, 0, 0.7);
}

.wow-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.2);
  box-shadow:
    inset 0 1px 3px rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(247, 211, 114, 0.8),
    0 0 20px rgba(247, 211, 114, 0.85),
    0 2px 8px rgba(0, 0, 0, 0.75);
}

.wow-slider.skill-slider::-webkit-slider-thumb {
  background:
    radial-gradient(circle at 35% 28%, var(--prof-thumb-light) 0%, var(--prof-thumb-mid) 52%, var(--prof-thumb-deep) 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 0 2px var(--prof-thumb-ring),
    0 0 12px var(--prof-thumb-glow),
    0 2px 6px rgba(0, 0, 0, 0.65);
}

.wow-slider.skill-slider::-webkit-slider-thumb:hover {
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.9),
    0 0 0 2px var(--prof-border-hover),
    0 0 18px var(--prof-thumb-glow),
    0 2px 8px rgba(0, 0, 0, 0.7);
}

.wow-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fffbe6 0%, #f7d372 38%, #c98a1e 78%, #7a4e0b 100%);
  border: 2px solid #161106;
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.75),
    0 0 0 2px rgba(232, 184, 75, 0.42),
    0 0 10px rgba(247, 211, 114, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.65);
  cursor: grab;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.wow-slider.skill-slider::-moz-range-thumb {
  background:
    radial-gradient(circle at 35% 28%, var(--prof-thumb-light) 0%, var(--prof-thumb-mid) 52%, var(--prof-thumb-deep) 100%);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 0 2px var(--prof-thumb-ring),
    0 0 12px var(--prof-thumb-glow),
    0 2px 6px rgba(0, 0, 0, 0.65);
}

.wow-slider:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.skill-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-step {
  width: 34px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-step:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.skill-inline-ctrl {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.28rem;
}

.skill-num-input {
  width: 48px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 26px !important;
  padding: 0.1rem 0.25rem !important;
}

.skill-max {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.known-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.88rem;
  border-top: 1px solid var(--border);
}

.known-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  padding-top: 1px;
  color: var(--text-primary);
}

/* Refresh Live AH dock in sidebar */
.refresh-dock {
  display: flex;
  align-items: center;
  gap: 0.48rem;
}

.refresh-ah-btn {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.refresh-freshness-tip {
  flex: none;
}

.refresh-freshness-tip[hidden] {
  display: none;
}

.info-tip.refresh-freshness-tip::after {
  width: max-content;
  max-width: min(260px, 76vw);
  white-space: pre-line;
}

/* ================================================================
   Right Main Workbench
   ================================================================ */
.workbench {
  position: relative;
  padding: 1.1rem 1.4rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

@media (max-width: 640px) {
  .workbench {
    padding: 0.85rem 0.75rem 2.5rem;
  }

  .field-md {
    min-width: 0;
    width: 100%;
  }
}

/* Indeterminate top progress bar during network fetches */
.workbench-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 40;
  overflow: hidden;
  background: rgba(232, 184, 75, 0.14);
  pointer-events: none;
}

.workbench-progress[hidden] {
  display: none;
}

.workbench-progress::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: 38%;
  background: linear-gradient(90deg, transparent, var(--gold-bright), var(--gold), transparent);
  animation: progressSlide 1.15s ease-in-out infinite;
}

@keyframes progressSlide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

/* Loading Skeleton */
.loading-skeleton {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.loading-skeleton[hidden] {
  display: none;
}

.skel-card {
  gap: 0.55rem;
  min-height: 86px;
}

.skel-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.skel-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.skel-rows {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.skel-bar,
.skel-row {
  display: block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 20%,
    rgba(232, 184, 75, 0.09) 50%,
    rgba(255, 255, 255, 0.04) 80%
  );
  background-size: 240% 100%;
  animation: skelShimmer 1.4s ease-in-out infinite;
}

.skel-bar {
  height: 11px;
}

.skel-bar.skel-lg {
  height: 16px;
}

.skel-row {
  height: 36px;
}

.skel-w30 { width: 30%; }
.skel-w40 { width: 40%; }
.skel-w50 { width: 50%; }
.skel-w55 { width: 55%; }
.skel-w65 { width: 65%; }
.skel-w75 { width: 75%; }

@keyframes skelShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Single-Row Profession Tabs (per modern-web-guidance tabs guide) */
.prof-tabs-shell {
  border-bottom: 1px solid var(--border);
}

.prof-tabs-shell-bar {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.prof-cat-switch {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: stretch;
  gap: 0.15rem;
  padding-inline-end: 0.65rem;
  margin-inline-end: 0.15rem;
}

.prof-cat-switch::after {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  inset-block: 22%;
  width: 1px;
  background: rgba(148, 163, 184, 0.22);
  pointer-events: none;
}

.prof-cat-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 0.6rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.prof-cat-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.prof-cat-btn[aria-pressed="true"] {
  color: var(--text-primary);
}

.prof-cat-btn[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 0.5rem;
  inset-block-end: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: rgba(226, 232, 240, 0.62);
}

.prof-tablist {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: inline proximity;
  gap: 0.2rem;
  scrollbar-width: none;
}

.prof-tablist::-webkit-scrollbar {
  display: none;
}

.prof-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.2rem;
}

.prof-group[hidden],
.mining-subtabs[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .prof-tabs-shell-bar {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
}

.mining-subtabs {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  margin: -0.3rem -0.25rem 0.85rem;
  padding: 0 0.25rem;
  border-bottom: 1px solid var(--border);
}

.mining-subtab {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 6px 6px 0 0;
  padding: 0.55rem 0.8rem 0.65rem;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.mining-subtab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.mining-subtab[aria-selected="true"] {
  color: var(--gold-bright);
}

.mining-subtab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 0.35rem;
  inset-block-end: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 8px rgba(232, 184, 75, 0.35);
}

.prof-tab {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.95rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.prof-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.prof-tab[aria-selected="true"] {
  color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(232, 184, 75, 0.12), rgba(232, 184, 75, 0.02));
}

.prof-tab-indicator {
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 10px rgba(232, 184, 75, 0.45);
  pointer-events: none;
  opacity: 0;
  will-change: transform, width;
}

.prof-tab-indicator.visible {
  opacity: 1;
}

.prof-tab-indicator.ready {
  opacity: 1;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    width 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* Directional Tab & Mode Glide Transitions */
@keyframes tabSlideFromRight {
  from {
    opacity: 0.15;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tabSlideFromLeft {
  from {
    opacity: 0.15;
    transform: translateX(-22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tab-slide-right {
  animation: tabSlideFromRight 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.tab-slide-left {
  animation: tabSlideFromLeft 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.prof-icon-frame {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(165, 176, 201, 0.28);
  background: #0c101b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prof-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  /* Crop Blizzard's baked-in dark JPEG bevel so our CSS frame hugs the art cleanly */
  transform: scale(1.12);
  filter: saturate(0.9) brightness(0.92);
  transition: filter 0.15s ease;
}

.prof-tab:hover .prof-icon-frame {
  border-color: var(--border-gold);
}

.prof-tab:hover .prof-icon-img {
  filter: saturate(1.02) brightness(1);
}

.prof-tab[aria-selected="true"] .prof-icon-frame {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(232, 184, 75, 0.35), 0 2px 8px rgba(232, 184, 75, 0.28);
}

.prof-tab[aria-selected="true"] .prof-icon-img {
  filter: none;
}

/* Framed WoW Item Icons (Tables, Spotlights, Shopping List, & Inspector Modal) */
.item-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  vertical-align: middle;
}

.item-cell-text {
  min-width: 0;
}

.item-icon-frame {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(165, 176, 201, 0.3);
  background: #0c101b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.item-icon-frame.item-icon-md {
  width: 30px;
  height: 30px;
  border-radius: 6px;
}

.item-icon-frame.item-icon-lg {
  width: 36px;
  height: 36px;
  border-radius: 7px;
}

.item-icon-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.12);
}

.item-icon-frame.q-poor {
  border-color: rgba(157, 157, 157, 0.55);
}

.item-icon-frame.q-common {
  border-color: rgba(203, 213, 225, 0.36);
}

.item-icon-frame.q-uncommon {
  border-color: rgba(34, 197, 94, 0.82);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2), 0 1px 6px rgba(34, 197, 94, 0.22);
}

.item-icon-frame.q-rare {
  border-color: rgba(56, 168, 255, 0.88);
  box-shadow: 0 0 0 1px rgba(56, 168, 255, 0.24), 0 1px 7px rgba(56, 168, 255, 0.28);
}

.item-icon-frame.q-epic {
  border-color: rgba(192, 102, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(192, 102, 255, 0.26), 0 1px 8px rgba(192, 102, 255, 0.32);
}

.item-icon-frame.q-legendary {
  border-color: rgba(255, 128, 0, 0.92);
  box-shadow: 0 0 0 1px rgba(255, 128, 0, 0.28), 0 1px 8px rgba(255, 128, 0, 0.35);
}

.spotlight-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.dialog-title-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.prof-skill-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
}

.prof-tab[aria-selected="true"] .prof-skill-pill {
  background: rgba(232, 184, 75, 0.24);
  color: var(--gold-bright);
}

/* Full-Width 50/50 Workspace Mode Subtabs (governs the entire page below) */
.mode-subtabs-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: -1rem;
  position: relative;
  z-index: 2;
}

.mode-subtabs-bar[hidden] {
  display: none;
}

.mode-subtab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  padding: 0.72rem 1.05rem;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  border-bottom-color: var(--border);
  background: rgba(10, 14, 24, 0.55);
  color: var(--text-secondary);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mode-subtab:hover {
  background: rgba(20, 25, 40, 0.85);
  color: var(--text-primary);
}

.mode-subtab[aria-selected="true"] {
  background: linear-gradient(180deg, rgba(232, 184, 75, 0.08) 0%, var(--bg-surface) 48%);
  border-color: var(--border-strong);
  border-bottom-color: var(--bg-surface);
  margin-bottom: -1px;
  padding-bottom: calc(0.72rem + 1px);
  color: var(--gold-bright);
  box-shadow: inset 0 2px 0 rgba(232, 184, 75, 0.52);
}

.mode-subtab-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mode-subtab-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.mode-subtab[aria-selected="true"] .mode-subtab-desc {
  color: var(--text-secondary);
}

/* Info Tooltip (used for Leveling EV explanation) */
.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.08);
  cursor: help;
}

.info-tip:hover,
.info-tip:focus-visible {
  color: var(--gold-bright);
  background: var(--gold-soft);
}

.info-tip::after {
  content: attr(data-tooltip);
  display: none;
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(260px, 76vw);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: #0d1220;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 450;
  line-height: 1.4;
  letter-spacing: normal;
  white-space: normal;
  text-align: start;
  box-shadow: var(--shadow);
  pointer-events: none;
  z-index: 20;
}

.info-tip:hover::after,
.info-tip:focus-visible::after {
  display: block;
}

/* Connected Filter & Slider Panel directly beneath Mode Subtabs */
.toolbar-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.95rem 1rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-deck {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.filter-deck[hidden] {
  display: none;
}

.filter-ribbon {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
}

.filter-ribbon[hidden] {
  display: none;
}

.field.mobile-only-field {
  display: none;
}

@media (max-width: 680px) {
  .field.mobile-only-field {
    display: flex;
  }
}

.field-colors {
  flex: 0 0 auto;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.color-chip-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 32px;
  padding: 0 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 20, 34, 0.55);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.52;
  transition: opacity 0.14s ease, border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.color-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.color-chip {
  transition: opacity 0.14s ease, border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.color-chip[aria-pressed="true"] {
  opacity: 1;
}

.color-chip-gray[aria-pressed="true"],
.color-chip-gray:hover {
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.55);
  background: rgba(148, 163, 184, 0.16);
}

.color-chip-green[aria-pressed="true"],
.color-chip-green:hover {
  color: var(--skill-green);
  border-color: rgba(64, 200, 85, 0.55);
  background: rgba(64, 200, 85, 0.16);
}

.color-chip-yellow[aria-pressed="true"],
.color-chip-yellow:hover {
  color: var(--skill-yellow);
  border-color: rgba(255, 216, 61, 0.55);
  background: rgba(255, 216, 61, 0.16);
}

.color-chip-orange[aria-pressed="true"],
.color-chip-orange:hover {
  color: var(--skill-orange);
  border-color: rgba(255, 128, 64, 0.58);
  background: rgba(255, 128, 64, 0.18);
}

.color-chip[aria-pressed="false"]:hover {
  opacity: 0.88;
}

.color-chip[aria-pressed="true"]:hover {
  filter: brightness(1.16);
}

.color-chip-gray[aria-pressed="true"]:hover {
  border-color: rgba(203, 213, 225, 0.82);
  background: rgba(148, 163, 184, 0.24);
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.22);
}

.color-chip-green[aria-pressed="true"]:hover {
  border-color: rgba(64, 200, 85, 0.85);
  background: rgba(64, 200, 85, 0.24);
  box-shadow: 0 0 10px rgba(64, 200, 85, 0.25);
}

.color-chip-yellow[aria-pressed="true"]:hover {
  border-color: rgba(255, 216, 61, 0.85);
  background: rgba(255, 216, 61, 0.24);
  box-shadow: 0 0 10px rgba(255, 216, 61, 0.24);
}

.color-chip-orange[aria-pressed="true"]:hover {
  border-color: rgba(255, 128, 64, 0.88);
  background: rgba(255, 128, 64, 0.26);
  box-shadow: 0 0 10px rgba(255, 128, 64, 0.26);
}

.leveling-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.leveling-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
  min-width: 0;
}

.optimize-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.optimize-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.segmented-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(10, 14, 24, 0.72);
  isolation: isolate;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.segmented-toggle:hover {
  border-color: rgba(232, 184, 75, 0.48);
  box-shadow: 0 0 10px rgba(232, 184, 75, 0.12);
}

.segmented-toggle::before {
  content: "";
  position: absolute;
  inset: 2px auto 2px 2px;
  width: calc(50% - 2px);
  border-radius: 999px;
  background: var(--gold-soft);
  box-shadow:
    inset 0 0 0 1px rgba(232, 184, 75, 0.45),
    0 0 10px rgba(232, 184, 75, 0.16);
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 160ms ease;
  pointer-events: none;
  z-index: 0;
}

.segmented-toggle:hover::before {
  box-shadow:
    inset 0 0 0 1px rgba(247, 211, 114, 0.68),
    0 0 12px rgba(232, 184, 75, 0.24);
}

.segmented-toggle[data-active="raw"]::before,
.segmented-toggle[data-active="high"]::before {
  transform: translateX(100%);
}

.field-liquidity {
  flex: 0 0 auto;
}

.segmented-btn {
  position: relative;
  z-index: 1;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem;
  min-height: 28px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: color 160ms ease, background-color 160ms ease;
}

.segmented-btn[aria-pressed="false"]:hover {
  color: var(--gold-bright);
  background: rgba(232, 184, 75, 0.12);
}

.segmented-btn[aria-pressed="true"] {
  color: var(--gold-bright);
}

.target-cur-skill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.target-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.target-cur-marker {
  position: absolute;
  left: calc(10px + (100% - 20px) * var(--cur-ratio, 0));
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: #f8fafc;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.75), 0 0 2px #000;
  pointer-events: none;
  z-index: 2;
}

.target-cur-marker[hidden] {
  display: none;
}

.wow-slider.target-skill-slider {
  background-image:
    linear-gradient(
      90deg,
      rgba(10, 14, 24, 0.68) 0%,
      rgba(10, 14, 24, 0.68) var(--cur-pct, 0%),
      transparent var(--cur-pct, 0%),
      transparent var(--fill-pct, 0%),
      #0a0e18 var(--fill-pct, 0%),
      #0a0e18 100%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.04) 48%,
      rgba(0, 0, 0, 0.28) 100%
    ),
    radial-gradient(
      ellipse 62% 135% at 32% 30%,
      var(--prof-eddy-light) 0%,
      transparent 64%
    ),
    radial-gradient(
      ellipse 58% 140% at 70% 72%,
      var(--prof-eddy-warm) 0%,
      transparent 62%
    ),
    linear-gradient(
      90deg,
      var(--prof-bar-deep) 0%,
      var(--prof-bar-mid) 28%,
      var(--prof-bar-accent) 52%,
      var(--prof-bar-mid) 76%,
      var(--prof-bar-deep) 100%
    );
}

/* Interactive Cost & Target Skill Sliders */
.sliders-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .leveling-grid,
  .sliders-row {
    grid-template-columns: 1fr;
  }
}

.slider-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 20, 0.45);
  border: 1px solid var(--border);
  min-width: 0;
  transition: opacity 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.slider-card:not(.disabled):hover,
.slider-card:not(.disabled):focus-within {
  border-color: rgba(232, 184, 75, 0.32);
  box-shadow: 0 0 18px rgba(232, 184, 75, 0.08);
}

.slider-card-target:hover,
.slider-card-target:focus-within {
  border-color: var(--prof-border);
  box-shadow: 0 0 18px var(--prof-glow);
}

.slider-card.disabled label,
.slider-card.disabled .slider-val,
.slider-card.disabled .wow-slider,
.slider-card.disabled .slider-ticks {
  opacity: 0.42;
}

.slider-label-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.slider-label-wrap .info-tip[hidden] {
  display: none;
}

.info-tip-rich::after {
  display: none !important;
}

.info-tip-popup {
  display: none;
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-start: 0;
  width: min(260px, 76vw);
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: #0d1220;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 450;
  line-height: 1.4;
  letter-spacing: normal;
  white-space: normal;
  text-align: start;
  box-shadow: var(--shadow);
  pointer-events: none;
  z-index: 20;
}

.info-tip-popup strong {
  font-weight: 700;
  color: var(--gold-bright);
}

.info-tip-rich:hover .info-tip-popup,
.info-tip-rich:focus-visible .info-tip-popup {
  display: block;
}

.slider-card-target {
  min-width: 0;
}

.slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.slider-header label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.slider-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.67rem;
  color: var(--text-muted);
  user-select: none;
}

.slider-ticks-exact {
  position: relative;
  display: block;
  height: 1.15rem;
}

.slider-ticks-exact.skill-ticks {
  height: 1.35rem;
}

.slider-ticks-exact span {
  position: absolute;
  top: 0;
  left: calc(10px + (100% - 20px) * var(--pos, 0));
  transform: translateX(-50%);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.slider-ticks-exact span:first-child {
  left: 0;
  transform: none;
}

.slider-ticks-exact span:last-child {
  left: auto;
  right: 0;
  transform: none;
}

.skill-ticks:not(.slider-ticks-exact) span {
  position: relative;
}

.skill-ticks span {
  padding-top: 0.28rem;
  font-variant-numeric: tabular-nums;
}

.skill-ticks span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 4px;
  background: var(--border-strong);
}

.skill-ticks span:first-child::before {
  left: 2px;
  transform: none;
}

.skill-ticks span:last-child::before {
  left: auto;
  right: 2px;
  transform: none;
}

.target-num-input {
  width: 64px;
  text-align: center;
  font-weight: 700;
  min-height: 28px !important;
  padding: 0.15rem 0.35rem !important;
  font-size: 0.84rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  min-width: 0;
}

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.field-xs {
  min-width: 118px;
}

.field-sm {
  min-width: 148px;
}

.field-md {
  min-width: 220px;
}

.field-search {
  flex: 1;
  min-width: 155px;
}

/* Custom-chevron Select (fixes macOS/Chrome right-edge hugging!) */
input[type="text"],
input[type="search"],
select {
  font: inherit;
  font-size: 0.88rem;
  min-height: 38px;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background-color: var(--bg-surface-2);
  color: var(--text-primary);
}

select {
  appearance: none;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-inline-end: 2.3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.25L6 7.75L9.5 4.25' stroke='%23a5b0c9' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 12px 12px;
  cursor: pointer;
}

select:hover {
  border-color: var(--border-gold);
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
.table-wrapper:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Toggle Chips */
.chip-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface-2);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.chip-toggle[hidden] {
  display: none;
}

.chip-toggle:has(input:checked) {
  border-color: var(--border-gold);
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.chip-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 650;
  font-size: 0.86rem;
  min-height: 38px;
  padding: 0.42rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: #161106;
  box-shadow: 0 2px 10px rgba(232, 184, 75, 0.22);
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-outline {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.btn-sm {
  min-height: 36px;
  padding: 0.32rem 0.75rem;
  font-size: 0.82rem;
}

.btn-xs {
  min-height: 29px;
  padding: 0.22rem 0.62rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.btn-xs.copied {
  border-color: var(--profit-pos);
  color: var(--profit-pos);
}

.btn-tiny-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
}

.btn-tiny-icon:hover {
  color: var(--gold-bright);
  border-color: var(--border-gold);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

/* Spotlight Highlight Ribbon */
.spotlight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.spotlight-strip[hidden] {
  display: none;
}

@media (max-width: 820px) {
  .spotlight-strip {
    grid-template-columns: 1fr;
  }
}

.spotlight-card {
  text-align: start;
  font: inherit;
  color: inherit;
  background: linear-gradient(145deg, var(--bg-surface) 0%, #121725 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

button.spotlight-card {
  cursor: pointer;
}

button.spotlight-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.spotlight-card.gold {
  border-color: rgba(232, 184, 75, 0.32);
}

.spotlight-card.emerald {
  border-color: rgba(52, 211, 153, 0.3);
}

.spotlight-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.spotlight-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spotlight-stat {
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Panels & Tables */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow);
}

.status-banner {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 0.88rem;
}

.status-banner.error {
  border-color: rgba(248, 113, 113, 0.55);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.warning-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
  font-size: 0.85rem;
  margin-block-end: 0.9rem;
}

.results-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.results-stack[hidden],
[hidden] {
  display: none !important;
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-block-end: 0.75rem;
}

.results-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.results-panel {
  transition: opacity 0.15s ease;
}

.results-panel.is-loading {
  opacity: 0.58;
}

.results-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--gold-bright);
}

.results-header-end {
  justify-content: flex-end;
  margin-bottom: 0.45rem;
}

.table-search-input {
  flex: 1 1 240px;
  min-width: 160px;
  height: 32px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.table-search-input::placeholder {
  color: var(--text-muted);
}

.table-search-input:focus,
.table-search-input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 184, 75, 0.22);
}

@media (max-width: 680px) {
  .results-header {
    gap: 0.5rem;
  }

  .table-search-input {
    flex: 1 1 140px;
    min-width: 120px;
  }

  .results-header:has(#reset-filters-btn:not([hidden])) .table-search-input,
  .gathering-header .table-search-input {
    flex: 1 1 100%;
    width: 100%;
  }

  .results-header:has(#reset-filters-btn:not([hidden])) .results-actions {
    width: 100%;
  }

  .results-header:has(#reset-filters-btn:not([hidden])) .results-actions .btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .gathering-header .results-actions {
    width: 100%;
    justify-content: space-between;
  }

  .gathering-header #gathering-share-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

.results-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.results-tip {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.table-wrapper {
  overflow: auto;
  scrollbar-gutter: stable;
  max-inline-size: 100%;
  max-block-size: min(650px, 70vh);
  container-type: inline-size;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

#gathering-results-section .table-wrapper {
  max-block-size: calc(100vh - 185px);
  max-block-size: calc(100dvh - 185px);
}

@media (max-width: 680px) {
  .table-wrapper,
  #gathering-results-section .table-wrapper {
    max-block-size: none;
    overflow-x: clip;
    overflow-y: visible;
    scrollbar-gutter: auto;
    border: none;
    border-radius: 0;
  }
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.86rem;
}

.data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

.data-table thead th {
  background: #0f1422;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: start;
  padding: 0.7rem 0.65rem;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.data-table thead th.sortable:hover {
  color: var(--gold-bright);
}

.data-table thead th.sort-active {
  color: var(--gold-bright);
}

.data-table thead th.sort-active::after,
.data-table thead th.sort-active.sort-desc::after {
  content: " ↓";
}

.data-table thead th.sort-active.sort-asc::after {
  content: " ↑";
}

.data-table th.num,
.data-table td.num {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table th.center,
.data-table td.center {
  text-align: center;
  white-space: nowrap;
}

.data-table th.col-tight,
.data-table td.col-tight,
#leveling-results-section .data-table tbody th:first-child {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}

.data-table thead th.col-math-hdr {
  font-size: 0.86rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.data-table tbody tr.clickable {
  cursor: pointer;
}

.data-table tbody tr.clickable:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

.data-table tbody tr:hover td,
.data-table tbody tr:hover th {
  background: var(--bg-row-hover);
}

/* Shopping List Controls & Check-off State */
.shopping-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.buffer-segmented {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  overflow: hidden;
}

.buffer-btn {
  background: transparent;
  border: none;
  border-inline-end: 1px solid var(--border);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.24rem 0.56rem;
  min-height: 29px;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.buffer-btn:last-child {
  border-inline-end: none;
}

.buffer-btn:hover {
  color: var(--text-primary);
}

.buffer-btn[aria-pressed="true"] {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.shopping-table .col-check {
  width: 38px;
  min-width: 38px;
  text-align: center;
  padding-inline: 0.5rem;
}

.shopping-table tbody td.col-check {
  position: static;
}

.shopping-table tbody th {
  position: static;
  min-width: 150px;
}

.shopping-check {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}

.shopping-row-checked td,
.shopping-row-checked th {
  opacity: 0.48;
}

.shopping-row-checked th,
.shopping-row-checked td[data-label="Need"] {
  text-decoration: line-through;
}

/* Inspect Modal Batch Multiplier Bar */
.inspect-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gold);
  background: linear-gradient(135deg, rgba(232, 184, 75, 0.09), rgba(20, 25, 40, 0.85));
}

.batch-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.batch-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}

.batch-presets {
  display: inline-flex;
  gap: 0.3rem;
}

.batch-btn {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.2rem 0.55rem;
  min-height: 28px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.batch-btn:hover {
  border-color: var(--border-gold);
  color: var(--text-primary);
}

.batch-btn[aria-pressed="true"] {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.batch-input {
  width: 64px;
  min-height: 28px !important;
  padding: 0.15rem 0.35rem !important;
  text-align: center;
  font-size: 0.82rem !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.batch-summary-meta {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.batch-warning {
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  background: rgba(251, 191, 36, 0.09);
  color: #fde68a;
  font-size: 0.78rem;
}

.empty-state-cell {
  text-align: center;
  padding: 2rem 1rem !important;
}

.empty-state-actions {
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .workbench-progress::after,
  .skel-bar,
  .skel-row,
  .tab-slide-right,
  .tab-slide-left,
  .wow-slider,
  .brand-title,
  .crest-liquid {
    animation: none;
  }

  .prof-tab-indicator.ready,
  .segmented-toggle::before,
  dialog,
  dialog::backdrop {
    transition: none;
  }
}

.data-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  background: var(--bg-surface);
  text-align: start;
  font-weight: 600;
  padding: 0.62rem 0.7rem;
  border-bottom: 1px solid var(--border);
  min-width: 185px;
}

.data-table tbody td {
  padding: 0.62rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.hide-recipe-meta .col-recipe-meta {
  display: none;
}

.recipe-sub {
  display: block;
  font-weight: 400;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.tag-cd {
  display: inline-block;
  margin-inline-start: 0.35rem;
  padding: 0.05rem 0.36rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

/* Coins, Skill Colors, Badges */
.coin {
  display: inline-flex;
  gap: 0.28rem;
  align-items: baseline;
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.coin-g { color: var(--coin-gold); font-weight: 650; }
.coin-s { color: var(--coin-silver); font-weight: 500; }
.coin-c { color: var(--coin-copper); }

.coin-dir {
  display: inline-block;
  font-size: 0.66em;
  line-height: 1;
  align-self: center;
  margin-inline-end: 0.15rem;
}

.coin-dir.dir-pos { color: var(--profit-pos); }
.coin-dir.dir-neg { color: var(--profit-neg); }
.coin-dir.dir-flat { color: var(--text-muted); }

/* Columnar alignment inside data tables so 5c aligns with 76c and 7s 0c aligns with 81s 16c */
.data-table td .coin {
  gap: 0.35ch;
}

.data-table td .coin-sign {
  display: inline-block;
  margin-inline-end: -0.2ch;
}

.data-table td .coin-dir {
  margin-inline-end: 0.1ch;
}

.data-table td .coin-s,
.data-table td .coin-c {
  display: inline-block;
  min-width: 3.1ch;
  text-align: end;
}

.data-table td .coin-g {
  display: inline-block;
  text-align: end;
}

.data-table td .breakeven-tag {
  display: inline-block;
  min-width: 5ch;
  margin-inline-start: 0.35rem;
  text-align: end;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.profit-pos { color: var(--profit-pos); font-weight: 700; }
.profit-neg { color: var(--profit-neg); font-weight: 600; }
.muted { color: var(--text-muted); }

.skill-orange { color: var(--skill-orange); font-weight: 700; }
.skill-yellow { color: var(--skill-yellow); font-weight: 700; }
.skill-green { color: var(--skill-green); font-weight: 600; }
.skill-gray { color: var(--skill-gray); }
.skill-too_low { color: var(--skill-red); font-weight: 700; }
.skill-unknown { color: var(--text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.52rem;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 650;
}

.badge-high { background: var(--badge-high-bg); color: var(--badge-high-fg); }
.badge-medium { background: var(--badge-med-bg); color: var(--badge-med-fg); }
.badge-low { background: var(--badge-low-bg); color: var(--badge-low-fg); }
.vol-pct-high { color: var(--badge-high-fg); }
.vol-pct-medium { color: var(--badge-med-fg); }
.vol-pct-low { color: var(--badge-low-fg); }

.badge-known { background: var(--src-known-bg); color: var(--src-known-fg); }
.badge-trainer { background: var(--src-trainer-bg); color: var(--src-trainer-fg); }
.badge-vendor { background: var(--src-vendor-bg); color: var(--src-vendor-fg); }
.badge-ah { background: var(--src-ah-bg); color: var(--src-ah-fg); }
.badge-unknown { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }
.badge-orange { background: rgba(255, 128, 64, 0.2); color: var(--skill-orange); }
.badge-yellow { background: rgba(255, 216, 61, 0.18); color: var(--skill-yellow); }
.badge-green { background: rgba(64, 200, 85, 0.18); color: var(--skill-green); }

/* Summary Cards */
.leveling-summary-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-block-end: 0.9rem;
}

.leveling-summary-row .summary-cards {
  flex: 1 1 auto;
  margin-block-end: 0;
}

.leveling-share-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .leveling-summary-row {
    flex-direction: column;
    align-items: stretch;
  }

  .leveling-share-btn {
    align-self: flex-end;
  }
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-block-end: 0.9rem;
}

.summary-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
}

.summary-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.summary-card-value {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Mobile Collapsible Row Toggle & Mobile-Only Reagent Sparkline (hidden on desktop) */
.mobile-row-toggle,
.reagent-breakdown-table td.reagent-spark {
  display: none;
}

/* Responsive Stacked Table Cards via Container Queries */
@container (width < 680px) {
  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    margin-block-end: 0.6rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface);
  }

  .data-table tbody th {
    background: var(--bg-surface-2);
    min-width: 0;
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    text-align: end;
    padding: 0.42rem 0.75rem;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .data-table tbody td.empty-state-cell {
    display: block;
    text-align: center;
  }

  .data-table tbody td.empty-state-cell::before {
    content: none;
  }

  /* Compact Collapsible Summary Cards on Mobile */
  .data-table.mobile-collapsible tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #results-table.mobile-collapsible tbody tr,
  #gathering-table.mobile-collapsible tbody tr {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) auto;
  }

  .data-table.shopping-table.mobile-collapsible tbody tr {
    grid-template-columns: auto repeat(2, minmax(0, 1fr));
  }

  .data-table.mobile-collapsible tbody th,
  #leveling-results-section .data-table.mobile-collapsible tbody th:first-child {
    grid-column: 1 / -1;
    order: -4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.52rem 0.65rem;
    width: auto;
    white-space: normal;
  }

  .data-table.mobile-collapsible tbody th .item-cell {
    min-width: 0;
    flex: 1;
  }

  .data-table.mobile-collapsible .mobile-row-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  }

  .data-table.mobile-collapsible .mobile-row-toggle svg {
    transition: transform 0.18s ease;
  }

  .data-table.mobile-collapsible tr.mobile-expanded .mobile-row-toggle {
    border-color: var(--border-gold);
    background: var(--gold-soft);
    color: var(--gold-bright);
  }

  .data-table.mobile-collapsible tr.mobile-expanded .mobile-row-toggle svg {
    transform: rotate(180deg);
  }

  .data-table.mobile-collapsible tbody td.mobile-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.14rem;
    padding: 0.42rem 0.7rem;
    text-align: start;
    border-top: 1px solid var(--border);
    min-width: 0;
    order: -2;
  }

  .data-table.mobile-collapsible tbody td.mobile-summary.mobile-summary-wide {
    grid-column: 1 / -1;
    order: -3;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: end;
  }

  .data-table.mobile-collapsible tbody td.mobile-summary.col-check {
    align-items: center;
    padding-inline: 0.65rem;
  }

  .data-table.mobile-collapsible tbody td.mobile-summary-spark {
    order: -1;
    align-items: flex-end;
    text-align: end;
    padding-inline-start: 0.45rem;
  }

  .data-table.mobile-collapsible tbody td:not(.mobile-summary):not(.empty-state-cell) {
    display: none;
    grid-column: 1 / -1;
    order: 1;
    border-top: 1px solid var(--border);
  }

  .data-table.mobile-collapsible tbody tr.mobile-expanded td:not(.mobile-summary):not(.empty-state-cell) {
    display: flex;
  }

  .data-table.mobile-collapsible tbody td.empty-state-cell {
    grid-column: 1 / -1;
  }

  .data-table.hide-recipe-meta tbody tr.mobile-expanded .col-recipe-meta,
  .data-table.hide-recipe-meta .col-recipe-meta {
    display: none;
  }

  /* Compact 2-line Reagent Breakdown Ledger on Mobile */
  .data-table.reagent-breakdown-table tbody {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface);
  }

  .data-table.reagent-breakdown-table tbody tr {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.28rem 0.38rem;
    margin: 0;
    padding: 0.52rem 0.65rem;
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
  }

  .data-table.reagent-breakdown-table tbody tr:last-child {
    border-bottom: none;
  }

  .data-table.reagent-breakdown-table tbody th,
  .data-table.reagent-breakdown-table tbody td {
    padding: 0;
    border: none;
    background: transparent !important;
    min-width: 0;
  }

  .data-table.reagent-breakdown-table tbody td::before {
    content: none;
  }

  .data-table.reagent-breakdown-table tbody td .coin-s,
  .data-table.reagent-breakdown-table tbody td .coin-c {
    min-width: 0;
  }

  .data-table.reagent-breakdown-table tbody th {
    grid-column: 1 / 5;
    grid-row: 1;
    font-size: 0.86rem;
    font-weight: 600;
  }

  .data-table.reagent-breakdown-table tbody td.reagent-subtotal {
    grid-column: 5;
    grid-row: 1;
    display: block;
    text-align: end;
    font-size: 0.86rem;
    font-weight: 700;
  }

  .data-table.reagent-breakdown-table tbody td.reagent-source {
    grid-column: 1;
    grid-row: 2;
    display: block;
    text-align: start;
  }

  .data-table.reagent-breakdown-table tbody td.reagent-qty {
    grid-column: 2;
    grid-row: 2;
    display: block;
    text-align: start;
    font-size: 0.75rem;
    color: var(--text-secondary);
  }

  .data-table.reagent-breakdown-table tbody td.reagent-unit {
    grid-column: 3;
    grid-row: 2;
    display: block;
    text-align: start;
    font-size: 0.74rem;
    color: var(--text-muted);
  }

  .data-table.reagent-breakdown-table tbody td.reagent-unit::before {
    content: "@ ";
    font-size: 0.72rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
  }

  .data-table.reagent-breakdown-table tbody td.reagent-stock {
    grid-column: 4;
    grid-row: 2;
    display: block;
    text-align: start;
    font-size: 0.73rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .data-table.reagent-breakdown-table tbody td.reagent-stock::before {
    content: "· ";
    font-size: 0.73rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
  }

  .data-table.reagent-breakdown-table tbody td.reagent-spark {
    grid-column: 5;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .data-table.reagent-breakdown-table tbody td.reagent-spark .spark-pct {
    font-size: 0.72rem;
  }
}

/* Lock background page scroll while any native modal dialog is open */
html:has(dialog[open]),
body:has(dialog[open]) {
  overflow: hidden;
}

/* Native Modal Dialogs */
dialog {
  flex-direction: column;
  width: min(760px, 94vw);
  max-width: 95vw;
  max-height: 88vh;
  max-height: 88dvh;
  margin: auto;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: scale(0.97) translateY(6px);
  transition:
    opacity 165ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 165ms cubic-bezier(0.22, 1, 0.36, 1),
    overlay 165ms allow-discrete,
    display 165ms allow-discrete;
}

dialog[open] {
  display: flex;
  opacity: 1;
  transform: scale(1) translateY(0);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
}

#inspect-dialog {
  width: min(880px, 95vw);
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(5, 7, 13, 0.76);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
  opacity: 0;
  transition:
    opacity 165ms ease,
    overlay 165ms allow-discrete,
    display 165ms allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open]::backdrop {
    opacity: 0;
  }
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.dialog-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  color: var(--gold-bright);
}

.dialog-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.05rem 1.25rem;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
}

.dialog-footer-actions {
  display: flex;
  gap: 0.5rem;
}

/* Inspect Modal Content */
.inspect-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.inspect-back-bar {
  display: flex;
  align-items: center;
  margin-bottom: -0.15rem;
}

.inspect-back-btn {
  font-size: 0.78rem;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
}

.reagent-row-clickable:hover td,
.reagent-row-clickable:hover th {
  background: rgba(232, 184, 75, 0.06);
}

.history-stat-pill.vol-low strong { color: var(--profit-pos); }
.history-stat-pill.vol-mod strong { color: var(--badge-med-fg); }
.history-stat-pill.vol-high strong { color: var(--profit-neg); }

.inspect-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 0.45rem;
}

.inspect-kpis .summary-card {
  padding: 0.48rem 0.6rem;
}

.inspect-kpis .summary-card-label {
  font-size: 0.65rem;
}

.inspect-kpis .summary-card-value {
  font-size: 0.9rem;
  margin-top: 0.1rem;
  line-height: 1.25;
}

.inspect-kpis .inspect-kpi-trend .spark-svg {
  width: 66px;
  max-width: 100%;
  height: 20px;
}

.inspect-kpi-roi {
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .dialog-header {
    padding: 0.72rem 0.9rem;
    gap: 0.6rem;
  }

  .dialog-title {
    font-size: 1.08rem;
    line-height: 1.22;
  }

  .dialog-title-with-icon .item-icon-lg {
    width: 28px;
    height: 28px;
  }

  .dialog-body {
    padding: 0.8rem 0.9rem;
    gap: 0.85rem;
  }

  .inspect-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .inspect-kpis .summary-card {
    padding: 0.42rem 0.58rem;
  }

  .inspect-kpis .summary-card-value {
    font-size: 0.88rem;
  }

  .inspect-kpis .inspect-kpi-profit {
    border-color: var(--border-gold);
  }

  .inspect-kpis .inspect-kpi-roi-card {
    border-color: var(--border-gold);
  }

  .inspect-kpis:not(:has(.inspect-kpi-recipe)) .inspect-kpi-p25,
  .inspect-kpis .inspect-kpi-trend {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .inspect-kpis:not(:has(.inspect-kpi-recipe)) .inspect-kpi-p25 .summary-card-value,
  .inspect-kpis .inspect-kpi-trend .summary-card-value {
    margin-top: 0;
  }

  .inspect-kpis .inspect-kpi-trend {
    gap: 0.85rem;
  }

  .inspect-kpis .inspect-kpi-trend .summary-card-label {
    flex: none;
  }

  .inspect-kpis .inspect-kpi-trend .summary-card-value {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 0;
  }

  .inspect-kpis .inspect-kpi-trend .spark-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
  }

  .inspect-kpis .inspect-kpi-trend .spark-svg {
    flex: 1;
    width: 100%;
    max-width: none;
    height: 22px;
  }

  .inspect-kpis .inspect-kpi-recipe {
    display: block;
  }
}

/* Liquidity & Order-Book Trading Panel */
.dialog-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.38rem;
  margin-top: 0.4rem;
}

.liq-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(26, 33, 53, 0.92), rgba(15, 20, 34, 0.92));
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.liq-hero-score {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.liq-gauge {
  position: relative;
  width: 54px;
  height: 54px;
  flex: none;
  display: grid;
  place-items: center;
}

.liq-gauge svg {
  width: 54px;
  height: 54px;
  transform: rotate(-90deg);
}

.liq-gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 5;
}

.liq-gauge-fill {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
}

.liq-gauge.grade-high .liq-gauge-fill { stroke: var(--profit-pos); filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.45)); }
.liq-gauge.grade-medium .liq-gauge-fill { stroke: var(--badge-med-fg); filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.45)); }
.liq-gauge.grade-low .liq-gauge-fill { stroke: var(--profit-neg); filter: drop-shadow(0 0 4px rgba(248, 113, 113, 0.45)); }

.liq-gauge-val {
  position: absolute;
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.liq-hero-meta {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.liq-hero-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.liq-consensus-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.liq-bench-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  padding: 0.3rem 0.62rem;
  border-radius: 7px;
  background: rgba(11, 13, 20, 0.62);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.liq-bench-btn:hover {
  border-color: var(--gold);
  background: rgba(232, 184, 75, 0.08);
}

.liq-bench-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.liq-bench-val {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Unified Liquidity Breakdown Card */
.liq-card {
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 20, 0.52);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.liq-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.44rem 0.72rem;
  background: rgba(15, 20, 34, 0.9);
  border-bottom: 1px solid var(--border);
  font-size: 0.73rem;
}

.liq-card-score {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.liq-card-score .liq-gauge {
  width: 34px;
  height: 34px;
}

.liq-card-score .liq-gauge svg {
  width: 34px;
  height: 34px;
}

.liq-card-score .liq-gauge-val {
  font-size: 0.62rem;
  letter-spacing: -0.03em;
}

.liq-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-evenly;
}

.liq-row {
  display: grid;
  grid-template-columns: minmax(94px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.52rem 0.72rem;
  border-bottom: 1px solid var(--border);
}

.liq-row:last-child {
  border-bottom: none;
}

.liq-row-metric {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.liq-row-meter {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  flex-shrink: 0;
}

.liq-mini-bar {
  width: 54px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.liq-row-meter .liq-age-mini {
  width: 54px;
  height: 6px;
  margin-top: 0;
}

.liq-kpi-label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.liq-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.liq-status-dot.pass { background: var(--profit-pos); box-shadow: 0 0 6px rgba(52, 211, 153, 0.5); }
.liq-status-dot.warn { background: var(--badge-med-fg); box-shadow: 0 0 6px rgba(251, 191, 36, 0.45); }
.liq-status-dot.fail { background: var(--profit-neg); box-shadow: 0 0 6px rgba(248, 113, 113, 0.5); }

.liq-kpi-score {
  min-width: 34px;
  text-align: end;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.liq-cap-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.06rem 0.38rem;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.16);
  color: var(--profit-neg);
  white-space: nowrap;
}

.liq-kpi-primary {
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}

.liq-kpi-unit {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.liq-kpi-secondary {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Integrated Price Benchmark Strip inside Ladder Card */
.ladder-bench-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 34, 0.55);
}

.ladder-bench-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  background: transparent;
  border: none;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.ladder-bench-cell:last-child {
  border-inline-end: none;
}

.ladder-bench-cell:hover {
  background: rgba(232, 184, 75, 0.08);
}

/* 4-Cell Order-Book Reset Stat Strip */
.ladder-reset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  background: rgba(15, 20, 34, 0.92);
}

@media (max-width: 560px) {
  .ladder-reset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ladder-reset-cell {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  padding: 0.52rem 0.6rem;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
}

.ladder-reset-cell:last-child {
  border-inline-end: none;
}

.ladder-reset-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.ladder-reset-val {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  white-space: nowrap;
}

.liq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: stretch;
}

@media (max-width: 740px) {
  .liq-grid {
    grid-template-columns: 1fr;
  }
}

.liq-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.rule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
}

.rule-item {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding: 0.42rem 0.62rem;
  border-radius: 7px;
  background: var(--bg-surface-2);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.79rem;
}

.rule-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.rule-reason {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.32;
}

.rule-score {
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex: none;
}

.rule-bar-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 0.1rem;
}

.rule-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.rule-bar-fill.pass { background: var(--profit-pos); }
.rule-bar-fill.warn { background: var(--badge-med-fg); }
.rule-bar-fill.fail { background: var(--profit-neg); }

.rule-pass { color: var(--profit-pos); }
.rule-warn { color: var(--badge-med-fg); }
.rule-fail { color: var(--profit-neg); }

/* Listing Age Stacked Bar */
.age-card {
  padding: 0.58rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.age-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.74rem;
}

.age-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.age-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  gap: 1px;
}

.age-seg {
  height: 100%;
  min-width: 3px;
}

.age-seg.very-long { background: #34d399; }
.age-seg.long { background: #38bdf8; }
.age-seg.medium { background: #fbbf24; }
.age-seg.short { background: #f87171; }

.age-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.71rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.age-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.age-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.age-dot.very-long { background: #34d399; }
.age-dot.long { background: #38bdf8; }
.age-dot.medium { background: #fbbf24; }
.age-dot.short { background: #f87171; }

/* Order-Book Depth Ladder */
.ladder-card {
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 20, 0.52);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ladder-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  background: rgba(15, 20, 34, 0.9);
  border-bottom: 1px solid var(--border);
  font-size: 0.73rem;
}

.ladder-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.ladder-breakeven-pill {
  font-size: 0.71rem;
  color: var(--text-secondary);
}

.ladder-cols {
  display: grid;
  grid-template-columns: minmax(92px, 1.15fr) 54px 58px minmax(78px, 0.9fr);
  gap: 0.4rem;
  padding: 0.34rem 0.65rem;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ladder-cols span:not(:first-child) {
  text-align: end;
}

.ladder-rows {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Subtle Wowhead Forever external item link */
.wh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  color: var(--text-muted);
  opacity: 0.4;
  flex: none;
  text-decoration: none;
  vertical-align: middle;
  transition: opacity 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

tr:hover .wh-link,
.summary-card:hover .wh-link {
  opacity: 0.72;
}

.wh-link:hover,
.wh-link:focus-visible {
  opacity: 1;
  color: var(--gold-bright);
  background: rgba(232, 184, 75, 0.14);
  outline: none;
}

.wh-link.wh-link-md {
  width: 22px;
  height: 22px;
  opacity: 0.65;
}

.ladder-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, 1.15fr) 54px 58px minmax(78px, 0.9fr);
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.36rem 0.65rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  text-align: start;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.12s ease;
}

.ladder-row:last-child {
  border-bottom: none;
}

.ladder-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ladder-row[aria-pressed="true"] {
  background: rgba(56, 189, 248, 0.1);
  box-shadow: inset 2px 0 0 #38bdf8;
}

.ladder-bar-qty {
  position: absolute;
  inset-block: 1px;
  inset-inline-end: 0;
  pointer-events: none;
  border-radius: 3px 0 0 3px;
}

.ladder-bar-qty.is-pos {
  background: rgba(52, 211, 153, 0.15);
}

.ladder-bar-qty.is-neg {
  background: rgba(248, 113, 113, 0.18);
}

.ladder-cell {
  position: relative;
  z-index: 1;
  white-space: nowrap;
}

.ladder-cell.num {
  text-align: end;
}

.ladder-wall-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--badge-med-fg);
  margin-inline-end: 0.28rem;
  vertical-align: middle;
}

.ladder-breakeven-divider {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.68rem;
  color: var(--gold-bright);
  background: rgba(232, 184, 75, 0.06);
  border-bottom: 1px dashed rgba(232, 184, 75, 0.45);
}

.ladder-callout {
  padding: 0.52rem 0.7rem;
  border-top: 1px solid var(--border);
  background: rgba(20, 25, 40, 0.85);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ladder-callout strong {
  color: var(--text-primary);
}

.ladder-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  padding-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ladder-swatch {
  display: inline-block;
  width: 10px;
  height: 7px;
  border-radius: 2px;
  margin-inline-end: 0.28rem;
  vertical-align: middle;
}

.ladder-swatch.is-pos {
  background: rgba(52, 211, 153, 0.38);
  border: 1px solid rgba(52, 211, 153, 0.75);
}

/* Inline 7d Trend Pill (Main Table) */
.trend-pill {
  display: inline-block;
  margin-inline-start: 0.32rem;
  padding: 0.04rem 0.34rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}

.trend-pill.trend-up {
  background: rgba(52, 211, 153, 0.14);
  color: var(--profit-pos);
}

.trend-pill.trend-down {
  background: rgba(248, 113, 113, 0.14);
  color: var(--profit-neg);
}

.trend-pill.trend-flat {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}

/* Price & Supply History Chart (Inspect Modal) */
.history-card {
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 20, 0.52);
  border: 1px solid var(--border);
  overflow: hidden;
}

.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.8rem;
  padding: 0.55rem 0.75rem;
  background: rgba(15, 20, 34, 0.9);
  border-bottom: 1px solid var(--border);
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.history-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(11, 13, 20, 0.55);
  border: 1px solid var(--border);
}

.history-range-group {
  display: inline-flex;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface-2);
  overflow: hidden;
}

.history-range-btn {
  background: transparent;
  border: none;
  border-inline-end: 1px solid var(--border);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

.history-range-btn:last-child {
  border-inline-end: none;
}

.history-range-btn[aria-pressed="true"] {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

.history-chart-wrap {
  position: relative;
  padding: 0.65rem 0.75rem 0.45rem;
}

.history-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  cursor: crosshair;
}

.history-grid-line {
  stroke: rgba(148, 163, 184, 0.12);
  stroke-width: 1;
}

.history-axis-label {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-sans);
}

.history-supply-bar {
  fill: rgba(148, 163, 184, 0.18);
}

.history-p25-line {
  fill: none;
  stroke: rgba(56, 189, 248, 0.68);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

.history-min-line {
  fill: none;
  stroke: var(--gold-bright);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.history-breakeven-line {
  stroke: rgba(52, 211, 153, 0.55);
  stroke-width: 1.25;
  stroke-dasharray: 5 4;
}

.history-breakeven-text {
  fill: var(--profit-pos);
  font-size: 9.5px;
  font-weight: 600;
  font-family: var(--font-sans);
}

.history-crosshair {
  stroke: rgba(232, 184, 75, 0.55);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.history-dot {
  fill: var(--gold-bright);
  stroke: #0b0d14;
  stroke-width: 2;
}

.history-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
  padding: 0.48rem 0.75rem;
  border-top: 1px solid var(--border);
  background: rgba(20, 25, 40, 0.85);
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.history-legend {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.69rem;
  color: var(--text-muted);
}

.history-leg-line {
  display: inline-block;
  width: 12px;
  height: 2px;
  vertical-align: middle;
  margin-inline-end: 0.25rem;
}

.history-leg-line.min { background: var(--gold-bright); }
.history-leg-line.p25 { border-top: 2px dashed rgba(56, 189, 248, 0.78); height: 0; }
.history-leg-line.be { border-top: 2px dashed rgba(52, 211, 153, 0.7); height: 0; }

.history-empty-card {
  padding: 0.85rem 0.95rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* Known Recipes Checklist Modal */
.known-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
}

.known-toolbar input {
  flex: 1;
  min-width: 180px;
}

.known-quick-btns {
  display: flex;
  gap: 0.4rem;
}

.known-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  max-height: 52vh;
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(11, 13, 20, 0.5);
}

.known-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.86rem;
  padding: 0.34rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
}

.known-item:hover {
  background: var(--bg-surface-2);
}

.known-item input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
}

.known-skill-col {
  width: 34px;
  flex: none;
  text-align: end;
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.known-skill-col.unknown {
  color: var(--text-muted);
  font-weight: 400;
}

.spark-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  vertical-align: middle;
}

.spark-svg {
  display: block;
  overflow: visible;
  flex: none;
}

.spark-line {
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark-area {
  stroke: none;
}

.spark-pct {
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.spark-wrap.is-up .spark-line { stroke: var(--profit-pos); }
.spark-wrap.is-up .spark-dot { fill: var(--profit-pos); }
.spark-wrap.is-up .spark-area { fill: rgba(52, 211, 153, 0.14); }
.spark-wrap.is-up .spark-pct { color: var(--profit-pos); }

.spark-wrap.is-down .spark-line { stroke: var(--profit-neg); }
.spark-wrap.is-down .spark-dot { fill: var(--profit-neg); }
.spark-wrap.is-down .spark-area { fill: rgba(248, 113, 113, 0.14); }
.spark-wrap.is-down .spark-pct { color: var(--profit-neg); }

.spark-wrap.is-flat .spark-line { stroke: #94a3b8; }
.spark-wrap.is-flat .spark-dot { fill: #94a3b8; }
.spark-wrap.is-flat .spark-area { fill: rgba(148, 163, 184, 0.1); }
.spark-wrap.is-flat .spark-pct { color: var(--text-muted); }

/* Native WoW Forever Hover Tooltip */
.wow-tooltip {
  --tt-accent: rgba(226, 232, 240, 0.35);
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0.72rem 0.85rem;
  min-width: 240px;
  max-width: 345px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(180deg, rgba(16, 21, 35, 0.94), rgba(10, 14, 24, 0.97));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  line-height: 1.45;
  box-shadow:
    inset 0 2px 0 var(--tt-accent),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 42px rgba(0, 0, 0, 0.72),
    0 0 0 1px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 110ms ease-out, transform 110ms ease-out;
}

@starting-style {
  .wow-tooltip:not([hidden]) {
    opacity: 0;
    transform: translateY(3px) scale(0.985);
  }
}

.wow-tooltip[data-quality="poor"] { --tt-accent: rgba(157, 157, 157, 0.65); border-color: rgba(157, 157, 157, 0.32); }
.wow-tooltip[data-quality="common"] { --tt-accent: rgba(232, 184, 75, 0.55); border-color: rgba(232, 184, 75, 0.28); }
.wow-tooltip[data-quality="uncommon"] { --tt-accent: rgba(74, 222, 128, 0.72); border-color: rgba(74, 222, 128, 0.35); }
.wow-tooltip[data-quality="rare"] { --tt-accent: rgba(56, 189, 248, 0.78); border-color: rgba(56, 189, 248, 0.4); }
.wow-tooltip[data-quality="epic"] { --tt-accent: rgba(192, 132, 252, 0.82); border-color: rgba(192, 132, 252, 0.44); }
.wow-tooltip[data-quality="legendary"] { --tt-accent: rgba(251, 146, 60, 0.88); border-color: rgba(251, 146, 60, 0.48); }

.wow-tt-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.wow-tt-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.wow-tt-title {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.22;
}

.wow-tt-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.wow-tt-sub-ilvl {
  color: var(--gold);
  font-weight: 600;
}

.wow-tt-q-poor { color: #9d9d9d; }
.wow-tt-q-common { color: #f8fafc; }
.wow-tt-q-uncommon { color: #4ade80; }
.wow-tt-q-rare { color: #38bdf8; }
.wow-tt-q-epic { color: #c084fc; }
.wow-tt-q-legendary { color: #fb923c; }

.wow-tt-body {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.wow-tt-bind,
.wow-tt-white {
  color: #e2e8f0;
}

.wow-tt-split {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  color: #e2e8f0;
}

.wow-tt-muted {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.wow-tt-green {
  color: #4ade80;
}

.wow-tt-flavor {
  color: var(--gold-bright);
  font-style: italic;
  margin-top: 0.22rem;
}

.wow-tt-req {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.wow-tt-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.42rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.wow-tt-loading {
  color: var(--text-muted);
  font-size: 0.76rem;
}

[data-tooltip-item-id] {
  cursor: pointer;
}

/* Prevent iOS Safari auto-zoom on form field focus (triggers when font-size < 16px) */
@media (pointer: coarse), (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="number"],
  select,
  textarea,
  .char-command-bar input[type="text"],
  .table-search-input,
  .skill-num-input,
  .target-num-input {
    font-size: 16px;
  }

  .skill-num-input {
    width: 56px;
  }
}
