/* ==========================================================================
   AION 2 Companion — Railway Aesthetic Design System
   ========================================================================== */

:root {
  /* Obsidian Base & Surface Elevation */
  --bg-canvas: #090b10;
  --bg-surface: #0f131c;
  --bg-card: #141824;
  --bg-elevated: #141824;
  --bg-lifted: #1a2030;
  --bg-hover: #262e42;
  --bg-inset: #06080d;

  /* Crisp Typography */
  --text-ink: #f1f5f9;
  --text-primary: #f1f5f9;
  --text-ink-muted: #8892b0;
  --text-muted: #8892b0;
  --text-dim: #64748b;

  /* Sleek Borders */
  --border-line: #1e2436;
  --border-edge: #262e42;
  --border-hover: #333d56;

  /* Accent Colorway */
  --color-accent: #d4a359;
  --color-accent-strong: #e8ca91;
  --color-accent-dim: #7e5f25;
  --color-gold: #d4a359;
  --color-emerald: #10b981;
  --color-cyan: #06b6d4;
  --color-violet: #8b5cf6;
  --color-gray: #6b7280;

  /* Status Colors */
  --color-success: #10b981;
  --color-danger: #ef4444;
  --color-rose: #f43f5e;
  --color-error: #ef4444;
  --color-amber: #f59e0b;
  --color-ap: #06b6d4;

  /* Item Rarity Grades */
  --rarity-currency: #d4a359;
  --rarity-soul: #c084fc;
  --rarity-common: #6b7280;
  --rarity-uncommon: #10b981;
  --rarity-rare: #06b6d4;
  --rarity-epic: #3b82f6;
  --rarity-legendary: #f0c75e;
  --rarity-mythic: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-canvas);
  color: var(--text-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  user-select: none;
  min-width: 700px;
  min-height: 500px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

input,
select,
textarea {
  background: var(--bg-inset);
  color: var(--text-primary);
  border: 1px solid var(--border-line);
  font-family: inherit;
}


code, kbd, samp, pre {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.mono {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-weight: 600;
}

.gold {
  color: var(--color-accent);
}

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

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

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

.text-muted {
  color: var(--text-muted);
}

.text-dim {
  color: var(--text-dim);
}

.font-bold {
  font-weight: 700;
}

/* ==========================================================================
   Minimal Custom Scrollbars
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-line);
  border-radius: 3px;
  transition: background 0.15s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover);
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: var(--bg-canvas);
}

/* ==========================================================================
   Custom Railway Frameless Titlebar
   ========================================================================== */
.railway-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-line);
  padding: 0 0 0 12px;
  user-select: none;
  -webkit-app-region: drag;
  z-index: 1000;
  flex-shrink: 0;
}

.titlebar-drag-region {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  height: 100%;
}

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

.brand-text {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-ink);
}

.brand-pill {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(212, 163, 89, 0.12);
  color: var(--color-accent);
  border: 1px solid rgba(212, 163, 89, 0.28);
}

.titlebar-char-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  font-size: 11px;
}

.char-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-emerald);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.char-status-dot.disconnected {
  background: var(--color-gray);
  box-shadow: none;
}

.char-name {
  font-weight: 600;
  color: var(--text-ink);
}

.char-divider {
  color: var(--text-dim);
}

.server-name {
  color: var(--text-muted);
}

.titlebar-controls {
  display: flex;
  align-items: center;
  height: 100%;
  -webkit-app-region: no-drag;
}

.win-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.win-btn:hover {
  background: var(--bg-hover);
  color: var(--text-ink);
}

.win-btn.win-close:hover {
  background: #dc2626;
  color: #ffffff;
}

/* ==========================================================================
   Top Navigation Tabs
   ========================================================================== */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-line);
  height: 42px;
  flex-shrink: 0;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-ink);
  background: var(--bg-surface);
}

.tab-btn.active {
  color: var(--text-ink);
  background: var(--bg-card);
  border: 1px solid var(--border-line);
}

.tab-icon {
  flex-shrink: 0;
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   Banners
   ========================================================================== */
.error-banner,
.update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 12px;
  border-bottom: 1px solid var(--border-line);
}

.error-banner {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.3);
}

.update-banner {
  background: rgba(6, 182, 212, 0.12);
  color: var(--color-cyan);
  border-color: rgba(6, 182, 212, 0.3);
  min-height: 44px;
  box-sizing: border-box;
}

.update-banner.clickable {
  cursor: pointer;
  user-select: none;
}

.update-banner.clickable:hover {
  background: var(--bg-hover);
}

.update-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.update-banner-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

/* ==========================================================================
   Update Modal
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.update-modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-edge);
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  width: calc(100% - 32px);
  max-width: 440px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.update-modal-card .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-line);
  background: var(--bg-surface);
  min-height: 44px;
  box-sizing: border-box;
}

.update-modal-card .modal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-ink);
  letter-spacing: 0.02em;
}

.modal-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: -6px -8px -6px 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-ink);
}

.update-modal-card .modal-body {
  padding: 20px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-ink-muted);
  background: var(--bg-elevated);
}

.update-modal-card .modal-body p {
  margin: 0;
}

.update-modal-card .modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-line);
  background: var(--bg-surface);
  min-height: 44px;
  box-sizing: border-box;
}

#btn-update-restart {
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  font-weight: 600;
  background: var(--color-accent);
  color: var(--bg-inset);
  border: 1px solid var(--color-accent-strong);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#btn-update-restart:hover {
  background: var(--color-accent-strong);
}

#btn-update-remind {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  font-weight: 500;
  background: var(--bg-surface);
  color: var(--text-ink);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#btn-update-remind:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .update-modal-card,
  .update-banner,
  .modal-close-btn,
  #btn-update-restart,
  #btn-update-remind {
    transition: none !important;
    animation: none !important;
  }
}

.layout-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.layout-indicator {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-amber);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  background: var(--bg-inset);
  color: var(--text-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.btn:hover:not(:disabled) {
  border-color: rgba(214, 168, 81, 0.45);
  background: rgba(214, 168, 81, 0.10);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #14120c;
}

.btn-primary:hover:not(:disabled) {
  background: #e6bd6a;
  border-color: #e6bd6a;
}

.btn-secondary {
  background: var(--bg-inset);
  border-color: var(--border-line);
  color: var(--text-ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: rgba(214, 168, 81, 0.45);
  background: rgba(214, 168, 81, 0.10);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.08);
}

.btn-danger:hover:not(:disabled) {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: #86efac;
  border-color: rgba(16, 185, 129, 0.4);
}

.btn-success:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
}

.btn-highlight {
  box-shadow: 0 0 12px rgba(214, 168, 81, 0.35);
}

/* ==========================================================================
   Loot & Session Tab — Sleek Railway Header Bar
   ========================================================================== */
.railway-session-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  padding: 14px 20px;
  min-height: 76px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.railway-hero-block {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  border-left: 2px solid var(--color-accent);
}

.railway-hero-time-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.railway-hero-time,
.railway-metric.railway-metric-hero .railway-metric-val {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text-ink);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.session-state-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-line);
  color: var(--text-ink-muted);
  background: var(--bg-inset);
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

.session-state-pill[data-state="active"] {
  color: var(--color-emerald);
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
}

.session-state-pill[data-state="paused"] {
  color: var(--color-amber);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.session-state-pill[data-state="idle"] {
  color: var(--text-ink-muted);
  background: var(--bg-inset);
  border-color: var(--border-line);
}

.railway-stat-grid {
  flex: 1 1 560px;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}

.railway-header-metrics,
.railway-metric-group {
  display: flex;
  align-items: center;
  gap: 20px;
  row-gap: 12px;
  column-gap: 20px;
  flex-wrap: wrap;
  min-width: 0;
}

.railway-metric {
  background: var(--bg-inset);
  border: 1px solid var(--border-line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.railway-metric.railway-metric-hero {
  border-left: 2px solid var(--color-accent);
  padding-left: 12px;
}

.railway-metric-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink-muted);
  line-height: 1;
}

.railway-metric-val,
.session-stat-val {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--text-ink);
  letter-spacing: 0;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
}

#gathering-header-metrics .railway-metric-val {
  font-size: 17px;
  font-size: clamp(14px, 1.15vw, 19px);
  white-space: nowrap;
  letter-spacing: 0;
}

.railway-metric-sub {
  font-size: 11px;
  color: var(--text-ink-muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.railway-metric-sub .railway-metric-val,
.railway-metric-sub strong {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ink-muted);
}

.railway-hero-paused-time {
  font-size: 11px;
  color: var(--text-ink-muted);
  line-height: 1.2;
  margin-top: 2px;
}

.railway-metric-rate {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-ink-muted);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: 0.01em;
}

.railway-metric-row {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.currency-coin-icon-sm {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: inline-block;
}

.railway-header-actions {
  flex: 0 0 auto;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  align-self: center;
}

.session-mode-selector-wrap,
#session-mode-selector-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.railway-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 44px;
  min-width: 44px;
  box-sizing: border-box;
  user-select: none;
}

.railway-toggle-btn.start {
  background: var(--color-emerald);
  color: var(--bg-inset);
  border-color: var(--color-emerald);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.railway-toggle-btn.start:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.railway-toggle-btn.stop {
  background: var(--color-danger);
  color: var(--text-ink);
  border-color: var(--color-danger);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.railway-toggle-btn.stop:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.railway-toggle-btn:disabled {
  opacity: 0.45;
  background: var(--bg-card);
  color: var(--text-dim);
  border-color: var(--border-line);
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.btn-icon {
  font-size: 12px;
  line-height: 1;
}

.btn-text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 1200px) {
  .railway-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex: 1 1 100%;
  }

  .railway-header-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .railway-session-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
  }

  .railway-hero-block {
    width: 100%;
  }

  .railway-stat-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .railway-metric-val,
  .session-stat-val,
  #gathering-header-metrics .railway-metric-val {
    font-size: 16px;
  }
}

@media (max-width: 720px) {
  .railway-session-header {
    padding: 12px 14px;
    gap: 12px;
  }

  .railway-stat-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
/* ==========================================================================
   Live Loot Showcase
   ========================================================================== */
.loot-showcase-container {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  flex: 1;
  min-height: 0;
}

.loot-showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-line);
}

.loot-showcase-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink);
}

.showcase-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  color: var(--text-muted);
}

.loot-showcase-est {
  display: flex;
  align-items: center;
  gap: 8px;
}

.loot-est-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink-muted, #8892b0);
}

.loot-est-val {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.loot-unpriced-tag {
  font-size: 11px;
  color: var(--text-dim);
}

.loot-table-wrapper {
  overflow-y: auto;
  flex: 1;
}

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

.loot-table th {
  padding: 8px 16px;
  background: var(--bg-canvas);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink-muted, #8892b0);
  border-bottom: 1px solid var(--border-line);
  text-align: left;
}

.loot-table th.th-price {
  text-align: right;
  width: 160px;
}

.loot-table th.th-qty {
  text-align: right;
  width: 90px;
}

.loot-table th.th-action {
  text-align: right;
  width: 90px;
}

.loot-row {
  border-bottom: 1px solid var(--border-line);
  transition: background 0.12s ease;
}

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

.loot-row:hover {
  background: var(--bg-hover);
}

.loot-row td {
  padding: 8px 16px;
  vertical-align: middle;
}

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

.loot-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.loot-icon-box {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 2px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.loot-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Rarity Grade Borders for Icons */
.loot-icon-box.rarity-common { border-color: var(--rarity-common); }
.loot-icon-box.rarity-uncommon { border-color: var(--rarity-uncommon); }
.loot-icon-box.rarity-rare { border-color: var(--rarity-rare); }
.loot-icon-box.rarity-epic { border-color: var(--rarity-epic); }
.loot-icon-box.rarity-legendary { border-color: var(--rarity-legendary); }
.loot-icon-box.rarity-mythic { border-color: var(--rarity-mythic); }
.loot-icon-box.rarity-currency { border-color: var(--rarity-currency); }
.loot-icon-box.rarity-soul { border-color: var(--rarity-soul); }

.loot-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.loot-item-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.loot-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rarity Colors for Item Names */
.loot-item-name.rarity-common { color: var(--rarity-common); }
.loot-item-name.rarity-uncommon { color: var(--rarity-uncommon); }
.loot-item-name.rarity-rare { color: var(--rarity-rare); }
.loot-item-name.rarity-epic { color: var(--rarity-epic); }
.loot-item-name.rarity-legendary { color: var(--rarity-legendary); }
.loot-item-name.rarity-mythic { color: var(--rarity-mythic); }
.loot-item-name.rarity-currency { color: var(--rarity-currency); }
.loot-item-name.rarity-soul { color: var(--rarity-soul); }

.badge-kill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(212, 163, 89, 0.12);
  color: #d4a359;
  border: 1px solid rgba(212, 163, 89, 0.28);
  white-space: nowrap;
  flex-shrink: 0;
}

.loot-item-sub {
  font-size: 11px;
  color: var(--text-dim);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-variant-numeric: tabular-nums;
}

.loot-cell-price {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.loot-cell-qty {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.loot-cell-action {
  text-align: right;
  padding: 8px 16px;
  width: 90px;
  white-space: nowrap;
}

.loot-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  text-align: center;
  color: var(--text-muted);
}

.loot-empty-icon {
  font-size: 28px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.loot-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-ink);
  margin-bottom: 4px;
}

.loot-empty-desc {
  font-size: 12px;
  color: var(--text-dim);
}

/* ==========================================================================
   Settings Sections & Grid
   ========================================================================== */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink);
  margin: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-line);
}

.settings-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  align-items: start;
  gap: 14px;
}

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

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease;
  align-self: start;
}

.settings-card:hover {
  border-color: var(--border-hover);
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.status-pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 9999px;
  letter-spacing: 0.04em;
}

.status-pill.green {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-pill.red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-pill.gray {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.35);
}

#card-capture-health .capture-loss-panel {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.capture-loss-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.capture-loss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.capture-loss-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-ink);
}

.capture-loss-status-line {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.capture-loss-status-line .sep {
  opacity: 0.4;
}

#txt-capture-gap-breakdown,
#txt-capture-filter-health {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-word;
}

.shortcut-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut-pill {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  color: var(--color-cyan);
}

.text-accent {
  color: var(--color-accent);
}

.upload-status {
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

/* ==========================================================================
   Market Evidence Card & Markers
   ========================================================================== */
.evidence-markers-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-marker {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md, 6px);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.btn-marker.btn-marked {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  color: #86efac !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  transform: scale(0.98);
}

.evidence-status-line {
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--text-muted);
  margin-top: 10px;
  padding: 6px 10px;
  background: var(--bg-inset);
  border: 1px solid var(--border-line);
  border-radius: 4px;
  word-break: break-all;
}

/* ==========================================================================
   Telemetry Accessible Switch
   ========================================================================== */
.switch-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  outline: none;
}

.switch-track {
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  background: var(--bg-hover);
  border: 1px solid var(--border-line);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  display: inline-block;
}

.switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease;
}

.switch-toggle.active .switch-track,
.switch-toggle[aria-checked="true"]:not(.pending) .switch-track {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
}

.switch-toggle.active .switch-thumb,
.switch-toggle[aria-checked="true"]:not(.pending) .switch-thumb {
  transform: translateX(20px);
  background: #10b981;
}

.switch-toggle.pending .switch-track {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
}

.switch-toggle.pending .switch-thumb {
  transform: translateX(20px);
  background: #f59e0b;
}

/* ==========================================================================
   Footer Bar
   ========================================================================== */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 16px;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-line);
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.footer-hotkey {
  color: var(--text-muted);
}

.hotkey-keycap {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-line);
  background: var(--bg-inset);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-accent);
}

/* ==========================================================================
   Overlay HUD Window & In-Game Loot HUD Card
   ========================================================================== */
body.overlay-body {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
}

body.overlay-body::-webkit-scrollbar {
  display: none;
}

body.overlay-body.locked {
  user-select: none;
}

body.overlay-body.editing {
  user-select: none;
  pointer-events: none;
  background-color: transparent;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 24px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 24px);
}

/* Solid dark plate:
   background: rgba(10, 13, 20, 0.94);
   border: 1px solid rgba(255, 255, 255, 0.09);
   box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6); */
.hud-card,
#hud-card {
  position: absolute;
  width: 288px;
  min-width: 220px;
  min-height: 180px;
  max-height: calc(100vh - 16px);
  container-type: inline-size;
  box-sizing: border-box;
  background: rgba(10, 13, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 200ms ease, transform 200ms ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  user-select: none;
  pointer-events: auto;
  cursor: grab;
  overflow: hidden;
}

.hud-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: hidden;
  flex: 1 1 auto;
}

.hud-region-loot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  pointer-events: auto;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background-image:
    linear-gradient(135deg, transparent 0, transparent 40%, rgba(212, 163, 89, 0.45) 40%, rgba(212, 163, 89, 0.45) 55%, transparent 55%, transparent 70%, rgba(96, 165, 250, 0.6) 70%, rgba(96, 165, 250, 0.6) 85%, transparent 85%);
  opacity: 0.7;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.hud-resize-handle::before {
  content: '';
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 44px;
  height: 44px;
  pointer-events: auto;
}

.hud-resize-handle:hover,
.hud-resize-handle:active {
  opacity: 1;
  filter: drop-shadow(0 0 2px rgba(212, 163, 89, 0.8));
}

body.hud-minimized .hud-resize-handle,
.hud-minimized .hud-resize-handle {
  display: none !important;
}

.hud-card.dragging {
  cursor: grabbing;
}

.hud-card button,
.hud-card input,
.hud-card select,
.hud-card textarea,
.hud-card a {
  cursor: pointer;
}

.hud-card.alt-free,
#hud-card.alt-free {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 12px rgba(96, 165, 250, 0.45), 0 0 0 1px rgba(96, 165, 250, 0.3);
}

body.overlay-body.editing .hud-card {
  border-color: rgba(212, 163, 89, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(212, 163, 89, 0.4);
}

.hud-region {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-region[hidden],
.hud-region[style*="display: none"] {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
}

.hud-region-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  gap: 8px;
}

.hud-timer-row {
  min-height: 44px;
}

@container (max-width: 340px) {
  .hud-timer-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .hud-timer-row .hud-label-group {
    justify-content: space-between;
  }

  .hud-timer-row .hud-session-actions {
    justify-content: flex-end;
  }
}

.hud-label-group,
.hud-val-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hud-val-group {
  justify-content: flex-end;
}

/* Clean Header: brand badge, character indicator with green dot */
.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  cursor: grab;
  user-select: none;
}

.hud-header.dragging {
  cursor: grabbing;
}

.hud-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.hud-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-brand-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(212, 163, 89, 0.14);
  border: 1px solid rgba(212, 163, 89, 0.3);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.hud-char-status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hud-char-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  flex-shrink: 0;
  display: inline-block;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.hud-char-dot.disconnected {
  background: var(--text-dim);
  box-shadow: none;
}

.hud-char-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hud-char-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.hud-capture-info {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  text-align: right;
}

.hud-header-timer {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--text-ink);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.hud-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

body.overlay-body.editing .hud-badge {
  background: rgba(212, 163, 89, 0.15);
  border-color: rgba(212, 163, 89, 0.4);
  color: var(--color-accent);
}

/* Typography & Labels */
.hud-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  white-space: nowrap;
}

.hud-stat-val {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--text-ink);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: right;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.hud-timer-val,
.hud-stat-val.prominent {
  font-size: 16px;
  font-weight: 700;
}
/* Trend span for hourly rate comparison against historical best */
.hud-trend {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 0.85em;
  font-weight: 700;
  margin-left: 4px;
}

.hud-trend.up {
  color: var(--color-emerald, var(--color-success, #10b981));
}

.hud-trend.down {
  color: var(--color-rose, var(--color-error, var(--color-danger, #ef4444)));
}

.hud-trend.flat {
  color: var(--text-ink-muted, var(--text-muted, #8892b0));
}


/* Session Buttons & Actions (ghost/outline, min 44px hit area) */
.hud-session-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

.hud-session-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hud-session-btn,
.hud-session-btn-ghost {
  position: relative;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  color: var(--text-ink-muted);
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  user-select: none;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Neutral Ghost hover for start / pause / resume */
.hud-session-btn:hover:not(:disabled),
.hud-session-btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-ink);
}

.hud-session-btn:active:not(:disabled),
.hud-session-btn-ghost:active:not(:disabled) {
  background: var(--bg-inset);
  border-color: var(--border-edge);
}

/* Stop button: red TINT outline / border & text via var(--color-danger), never solid red fill */
.hud-session-btn.btn-session-stop,
.hud-session-btn-ghost.btn-session-stop {
  background: var(--bg-surface);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.hud-session-btn.btn-session-stop:hover:not(:disabled),
.hud-session-btn-ghost.btn-session-stop:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--color-rose);
  color: var(--color-rose);
}

.hud-session-btn.btn-session-stop:active:not(:disabled),
.hud-session-btn-ghost.btn-session-stop:active:not(:disabled) {
  background: var(--bg-inset);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.hud-session-btn:disabled,
.hud-session-btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Paused Badge: muted amber outline token, no hardcoded hex */
.hud-paused-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-amber);
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 3px;
  padding: 2px 6px;
  box-sizing: border-box;
  align-self: flex-end;
  white-space: nowrap;
}


.hud-coin-wrapper {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hud-coin-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.hud-sub-unpriced {
  font-size: 11px;
  color: var(--text-dim);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.ap-blue {
  color: var(--color-ap);
}
/* Drop list items: 32px icon with crisp rarity grade border, item name in bold rarity color, mob origin pill (~Kerubar), bold quantity */
.hud-items-list,
.hud-item-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 7px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  min-height: 44px;
  cursor: pointer;
}

.hud-item-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.hud-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.item-icon-wrapper,
.hud-icon-box {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-edge);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.item-icon-img,
.hud-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Crisp Rarity Grade Borders for 32px Icons */
.item-icon-wrapper.item-grade-common,
.hud-icon-box.item-grade-common,
.item-icon-wrapper.rarity-common,
.hud-icon-box.rarity-common {
  border-color: #6b7280;
}
.item-icon-wrapper.item-grade-uncommon,
.hud-icon-box.item-grade-uncommon,
.item-icon-wrapper.rarity-uncommon,
.hud-icon-box.rarity-uncommon {
  border-color: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}
.item-icon-wrapper.item-grade-rare,
.hud-icon-box.item-grade-rare,
.item-icon-wrapper.rarity-rare,
.hud-icon-box.rarity-rare {
  border-color: #06b6d4;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.3);
}
.item-icon-wrapper.item-grade-epic,
.hud-icon-box.item-grade-epic,
.item-icon-wrapper.rarity-epic,
.hud-icon-box.rarity-epic {
  border-color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
}
.item-icon-wrapper.item-grade-legendary,
.hud-icon-box.item-grade-legendary,
.item-icon-wrapper.rarity-legendary,
.hud-icon-box.rarity-legendary {
  border-color: var(--rarity-legendary);
  box-shadow: 0 0 8px rgba(240, 199, 94, 0.35);
}
.item-icon-wrapper.item-grade-mythic,
.hud-icon-box.item-grade-mythic,
.item-icon-wrapper.rarity-mythic,
.hud-icon-box.rarity-mythic {
  border-color: var(--rarity-mythic);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
.item-icon-wrapper.item-grade-currency,
.hud-icon-box.item-grade-currency,
.item-icon-wrapper.rarity-currency,
.hud-icon-box.rarity-currency {
  border-color: #d4a359;
  box-shadow: 0 0 8px rgba(212, 163, 89, 0.35);
}
.item-icon-wrapper.item-grade-soul,
.hud-icon-box.item-grade-soul,
.item-icon-wrapper.rarity-soul,
.hud-icon-box.rarity-soul {
  border-color: #c084fc;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.35);
}

.hud-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

/* Item Name in Bold Rarity Color: font-size 14px, font-weight 600 */
.hud-item-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-ink);
}

.hud-item-name.item-grade-common,
.hud-item-name.rarity-common {
  color: #94a3b8;
}
.hud-item-name.item-grade-uncommon,
.hud-item-name.rarity-uncommon {
  color: #10b981;
}
.hud-item-name.item-grade-rare,
.hud-item-name.rarity-rare {
  color: #06b6d4;
}
.hud-item-name.item-grade-epic,
.hud-item-name.rarity-epic {
  color: #60a5fa;
}
.hud-item-name.item-grade-legendary,
.hud-item-name.rarity-legendary {
  color: var(--rarity-legendary);
}
.hud-item-name.item-grade-mythic,
.hud-item-name.rarity-mythic {
  color: #f87171;
}
.hud-item-name.item-grade-currency,
.hud-item-name.rarity-currency {
  color: #e8ca91;
}
.hud-item-name.item-grade-soul,
.hud-item-name.rarity-soul {
  color: #c084fc;
}

/* Mob Origin Pill (~Kerubar) - hidden from HUD loot rows */
.hud-mob-pill,
.badge-probable-kill {
  display: none !important;
  align-items: center;
  font-size: 11px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(212, 163, 89, 0.12);
  color: #d4a359;
  border: 1px solid rgba(212, 163, 89, 0.28);
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  gap: 1px;
}

/* Bold Quantity: font-size 14px - 15px, font-weight: 700, #f1f5f9 */
.hud-item-qty {
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hud-item-val {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Compact Exclude Action on HUD Item Rows (44px target) */
.hud-item-exclude {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  padding: 0;
  position: relative;
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
  margin-left: 6px;
}

.hud-item-exclude::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
}

.hud-item-exclude:hover,
.hud-item-exclude:focus-visible {
  opacity: 1;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.hud-item-exclude:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.hud-empty-state {
  text-align: center;
  padding: 14px 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.hud-unattributed-note {
  font-size: 11px;
  color: var(--text-dim);
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.hud-footer-bar {
  display: none;
}

body.overlay-body.editing .hud-footer-bar,
.editing .hud-footer-bar {
  display: flex;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 13, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  gap: 16px;
  align-items: center;
  z-index: 10000;
  pointer-events: auto;
}

.hud-footer-hint {
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.hud-layout-actions {
  display: none;
  gap: 6px;
}

body.overlay-body.editing .hud-layout-actions,
.editing .hud-layout-actions {
  display: flex;
}

.hud-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.hud-btn:hover {
  opacity: 0.9;
}

.hud-btn-done {
  background: #14532d;
  color: #86efac;
  border-color: #22c55e;
}

.hud-btn-cancel {
  background: #4a1d24;
  color: #fca5a5;
  border-color: #ef4444;
}

body.toolbar-body {
  background: transparent;
}

/* ==========================================================================
   Draggable HUD Elements, Launcher Chip & Edit Mode
   ========================================================================== */

.hud-container {
  position: static;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* Helper canvas and alignment grid classes */
.hud-canvas {
  position: relative;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
  pointer-events: none;
}

.hud-alignment-grid {
  background-color: transparent;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 24px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 24px);
}

.hud-element,
.hud-element-floating {
  position: absolute;
  width: 288px;
  box-sizing: border-box;
  background: rgba(10, 13, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.09);
  /* House rule: never set border-radius on panel classes here */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  touch-action: none;
  user-select: none;
  pointer-events: none;
}

body.overlay-body.editing .hud-element,
body.overlay-body.editing .hud-element-floating,
.editing .hud-element,
.editing .hud-element-floating {
  pointer-events: auto;
}

.hud-element[hidden],
.hud-element-floating[hidden] {
  display: none !important;
}

/* Thin outlined box with corner ticks (1px outline + corner brackets via ::before/::after) */
.hud-element.editing,
.hud-element-floating.editing,
body.editing .hud-element,
body.editing .hud-element-floating,
.editing .hud-element,
.editing .hud-element-floating {
  outline: 1px solid rgba(239, 68, 68, 0.85);
  outline-offset: 1px;
}

.hud-element.editing::before,
.hud-element-floating.editing::before,
body.editing .hud-element::before,
body.editing .hud-element-floating::before,
.editing .hud-element::before,
.editing .hud-element-floating::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #ef4444;
  border-left: 2px solid #ef4444;
  pointer-events: none;
}

.hud-element.editing::after,
.hud-element-floating.editing::after,
body.editing .hud-element::after,
body.editing .hud-element-floating::after,
.editing .hud-element::after,
.editing .hud-element-floating::after {
  content: '';
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid #ef4444;
  border-right: 2px solid #ef4444;
  pointer-events: none;
}

/* Drag Handle: secondary affordance, cursor grab, >=44x44 hit area */
.hud-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.15s ease, color 0.15s ease;
  min-width: 24px;
  min-height: 24px;
  padding: 2px 4px;
  border-radius: 4px;
}

.hud-drag-handle:hover {
  opacity: 1;
  color: var(--text-ink);
  background: rgba(255, 255, 255, 0.05);
}

.hud-element.editing .hud-drag-handle,
.hud-element-floating.editing .hud-drag-handle,
body.editing .hud-drag-handle,
.editing .hud-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  right: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  font-size: 16px;
  line-height: 1;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  cursor: grab;
  z-index: 10;
  box-sizing: border-box;
  pointer-events: auto;
}

body.editing .hud-header .hud-drag-handle,
.editing .hud-header .hud-drag-handle {
  position: static;
  border-radius: 4px;
  flex-shrink: 0;
}

.hud-header.dragging .hud-drag-handle,
.hud-element.editing .hud-drag-handle:active,
.hud-element-floating.editing .hud-drag-handle:active,
body.editing .hud-drag-handle:active,
.editing .hud-drag-handle:active {
  cursor: grabbing;
}
/* Launcher Button: modern mini glass button for Alt+A (~34px visual, 44px hit area) */
.hud-launcher,
.hud-chip {
  position: absolute;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  font-family: inherit;
  pointer-events: auto;
  z-index: 1000;
  outline: none;
}

.hud-launcher-caption {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  margin-bottom: 3px;
  pointer-events: none;
  transition: color 0.15s ease;
}

.hud-launcher-visual {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-edge);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  pointer-events: none;
}

.hud-launcher:hover .hud-launcher-caption,
.hud-launcher:focus-visible .hud-launcher-caption {
  color: var(--text-ink);
}

.hud-launcher:hover .hud-launcher-visual,
.hud-chip:hover .hud-launcher-visual {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--color-accent-strong);
  transform: translateY(-1px);
}

.hud-launcher:active .hud-launcher-visual,
.hud-chip:active .hud-launcher-visual {
  background: var(--bg-inset);
  border-color: var(--color-accent);
  transform: translateY(0);
}

.hud-launcher:focus-visible .hud-launcher-visual,
.hud-chip:focus-visible .hud-launcher-visual {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px var(--bg-canvas), 0 0 0 4px var(--color-accent);
}

.hud-launcher.alt-free .hud-launcher-caption {
  color: var(--color-cyan);
}

.hud-launcher.alt-free .hud-launcher-visual,
#hud-launcher.alt-free .hud-launcher-visual {
  border-color: var(--color-cyan);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 8px var(--color-cyan);
  color: var(--color-cyan);
}

.hud-launcher.dragging,
#hud-launcher.dragging {
  cursor: grabbing;
  opacity: 0.9;
}

.hud-launcher.dragging .hud-launcher-visual,
#hud-launcher.dragging .hud-launcher-visual {
  cursor: grabbing;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.hud-launcher .hud-launcher-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .hud-launcher,
  .hud-chip,
  .hud-launcher-caption,
  .hud-launcher-visual,
  .hud-session-btn,
  .hud-session-btn-ghost {
    transition: none !important;
    transform: none !important;
  }
}
/* Chip Mode: hide every .hud-element except the launcher */
.chip-mode .hud-card,
body.chip-mode .hud-card,
.chip-mode .hud-element,
.chip-mode .hud-element-floating,
body.chip-mode .hud-element,
body.chip-mode .hud-element-floating {
  display: none !important;
}

.chip-mode .hud-footer-bar,
body.chip-mode .hud-footer-bar {
  display: none !important;
}

body.chip-mode,
.chip-mode {
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

/* ==========================================================================
   Reference Market Prices & Capture Warning System
   ========================================================================== */

/* Loot Table Price Badges */
.loot-price-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.loot-price-cell-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.price-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.2;
}

.badge-source-custom {
  background: rgba(212, 163, 89, 0.15);
  color: var(--color-gold);
  border: 1px solid rgba(212, 163, 89, 0.4);
}

.badge-source-reference {
  background: rgba(6, 182, 212, 0.15);
  color: var(--color-cyan);
  border: 1px solid rgba(6, 182, 212, 0.4);
}

.badge-source-market {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.badge-source-class {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}

.price-source-badge .badge-age {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
  text-transform: none;
}

/* Settings: Reference Market Prices Card */
.settings-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.settings-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.settings-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  color: var(--text-ink);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
  cursor: pointer;
}

.settings-select:focus {
  border-color: var(--color-accent);
}

.settings-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.server-combobox-container {
  position: relative;
  width: 100%;
}

.server-combobox-input {
  cursor: text;
}

.server-combobox-input:focus,
.server-combobox-input:focus-visible {
  border-color: var(--color-accent);
  outline: 2px solid var(--color-accent-dim);
  outline-offset: -1px;
}

.server-combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-edge);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  z-index: 100;
  margin: 0;
  padding: 4px;
  list-style: none;
}

.server-combobox-option {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--text-ink);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, outline-color 0.12s ease;
  gap: 8px;
}

.server-combobox-option:hover,
.server-combobox-option.focused,
.server-combobox-option:focus-visible {
  background: var(--bg-hover);
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.server-combobox-option[aria-selected="true"],
.server-combobox-option.selected {
  background: rgba(212, 163, 89, 0.12);
  color: var(--color-accent-strong);
}

.server-combobox-option[aria-selected="true"]:hover,
.server-combobox-option[aria-selected="true"].focused {
  background: rgba(212, 163, 89, 0.22);
}

.server-option-name {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-option-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.server-combobox-empty {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
}

.settings-field-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.loot-rules-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted, #94a3b8);
  border-left: 2px solid var(--accent, #6366f1);
  padding-left: 8px;
}

.settings-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-line);
}

.settings-status-line {
  margin: 0;
  font-size: 11px;
}

.market-reference-credit {
  font-size: 11px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.market-reference-credit:hover {
  text-decoration: underline;
  opacity: 0.85;
}

/* Price Popover Reference Line */
.price-popover-ref-row {
  border-top: 1px solid var(--border-line);
  padding-top: 8px;
  margin-top: 2px;
}

.price-popover-attribution-row {
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

.market-reference-popover-credit {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}

.market-reference-popover-credit:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Overlay In-Game Capture Warning Toast */
.hud-capture-warning {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 320px;
  max-width: calc(100vw - 48px);
  background: var(--bg-card);
  border: 1px solid var(--color-amber);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 16px rgba(245, 158, 11, 0.2);
  pointer-events: auto;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

.hud-capture-warning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hud-capture-warning-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-amber);
}

.hud-capture-warning-icon {
  flex-shrink: 0;
}

.hud-capture-warning-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-ink);
  line-height: 1.3;
}

.hud-capture-warning-dismiss {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.hud-capture-warning-dismiss:hover {
  color: var(--text-ink);
  background: var(--bg-hover);
}

.hud-capture-warning-body {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   Price State & Manual Fetch UX
   ========================================================================== */

.btn-price-fetch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  color: var(--color-accent);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.btn-price-fetch:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

.btn-price-fetch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-dim);
  border-color: var(--border-line);
  background: transparent;
}

.btn-price-fetch.is-fetching {
  cursor: wait;
}

.loot-price-val.price-unavailable-label {
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.loot-price-val.price-fetching-label {
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.price-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
  transform-origin: center;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .price-spinner,
  .spin {
    animation: none;
  }
}

.item-detail-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.item-detail-price-row .loot-price-wrap {
  justify-content: flex-start;
}

/* Loot Row Exclusion & Action Styling */
.loot-row.is-excluded {
  opacity: 0.55;
  background: rgba(15, 23, 42, 0.4);
}

.loot-row.is-excluded .loot-item-name {
  color: var(--text-dim, #64748b) !important;
}

.badge-excluded {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  margin-left: 6px;
  white-space: nowrap;
}

.badge-exclusion-reason {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin-left: 4px;
  white-space: nowrap;
}

.btn-loot-action {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border-color, #334155);
  background: var(--bg-surface-elevated, #1e293b);
  color: var(--text-color, #f1f5f9);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-loot-action:hover:not(:disabled) {
  background: var(--bg-hover, #334155);
  border-color: var(--border-hover, #475569);
}

.btn-loot-action:focus-visible {
  outline: 2px solid var(--color-accent, #38bdf8);
  outline-offset: 2px;
}

.btn-loot-action.btn-loot-exclude {
  color: var(--text-muted, #94a3b8);
}

.btn-loot-action.btn-loot-exclude:hover:not(:disabled) {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-loot-action.btn-loot-include {
  color: var(--color-accent, #38bdf8);
  border-color: rgba(56, 189, 248, 0.4);
}

/* Settings: Equipment Loot & Exclusion Rules Card */
.equipment-loot-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #1e293b);
}
/* Equipment Grade Exclusion Switches */
#section-grade-exclusions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.equipment-grade-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm, 6px);
  gap: 16px;
  min-height: 52px;
  box-sizing: border-box;
}

.equipment-grade-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.equipment-grade-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-normal, #f1f5f9);
  line-height: 1.4;
}

.equipment-grade-desc {
  font-size: 12px;
  color: var(--text-dim, #64748b);
  line-height: 1.3;
  margin: 0;
}


.equipment-loot-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 12px;
}

/* ========================================================================= */
/* Loot Rules Pass & Exclusion Composer                                      */
/* ========================================================================= */
.rule-composer-block {
  border: 1px solid var(--border-line);
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 12px 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-composer-legend {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  padding: 0 6px;
  margin-left: -2px;
}

.rule-composer-helper {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

.rule-composer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.settings-input,
.settings-select,
.rule-composer-row .rule-input,
.rule-composer-row .rule-select,
#card-equipment-loot input[type="text"],
#card-equipment-loot select {
  background: var(--bg-inset);
  color: var(--text-primary);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  min-height: 44px;
  padding: 8px 12px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.settings-input::placeholder,
.rule-composer-row .rule-input::placeholder,
#card-equipment-loot input::placeholder {
  color: var(--text-muted);
}

.settings-input:focus,
.settings-input:focus-visible,
.settings-select:focus,
.settings-select:focus-visible,
.rule-composer-row .rule-input:focus,
.rule-composer-row .rule-input:focus-visible,
.rule-composer-row .rule-select:focus,
.rule-composer-row .rule-select:focus-visible,
#card-equipment-loot input[type="text"]:focus,
#card-equipment-loot input[type="text"]:focus-visible,
#card-equipment-loot select:focus,
#card-equipment-loot select:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(212, 163, 89, 0.25);
}

.settings-select,
.rule-composer-row .rule-select,
#card-equipment-loot select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892b0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.settings-select option,
.rule-composer-row .rule-select option,
#card-equipment-loot select option {
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
}

.rule-composer-row .rule-input {
  flex: 1 1 200px;
  min-height: 44px;
}

.rule-composer-row .rule-select {
  flex: 0 0 180px;
  min-height: 44px;
}

.rule-composer-row .btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 18px;
  font-weight: 600;
}

.rule-error-msg {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-danger, #ef4444);
}

.loot-exclusion-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.loot-exclusion-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  min-height: 44px;
  gap: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.loot-exclusion-rule-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-lifted);
}

.rule-info-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.loot-exclusion-rule-pattern {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}

.rule-mode-badge {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.28);
  flex-shrink: 0;
}

.rule-mode-badge.badge-regex {
  background: rgba(192, 132, 252, 0.12);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.28);
}

.btn-rule-remove {
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  padding: 0;
  transition: all 0.15s ease;
}

.btn-rule-remove:hover:not(:disabled) {
  color: var(--color-danger, #ef4444);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-rule-remove:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
/* Loot list auto-sized & scroll containment */
#list-items,
.hud-region-loot .hud-items-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(214, 168, 81, 0.55) transparent;
  padding-right: 2px;
  scroll-behavior: smooth;
}
#list-items::-webkit-scrollbar,
.hud-region-loot .hud-items-list::-webkit-scrollbar {
  width: 6px;
}
#list-items::-webkit-scrollbar-track,
.hud-region-loot .hud-items-list::-webkit-scrollbar-track {
  background: transparent;
  margin: 2px 0;
}
#list-items::-webkit-scrollbar-thumb,
.hud-region-loot .hud-items-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(214, 168, 81, 0.65), rgba(214, 168, 81, 0.35));
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.35);
}
#list-items::-webkit-scrollbar-thumb:hover,
.hud-region-loot .hud-items-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(240, 199, 94, 0.9), rgba(214, 168, 81, 0.6));
}
#list-items:focus-visible,
.hud-region-loot .hud-items-list:focus-visible {
  outline: 1px solid rgba(214, 168, 81, 0.6);
  outline-offset: -1px;
  border-radius: 4px;
}

/* Value region stacked rows spacing */
[data-region="value"] {
  gap: 6px;
}

[data-region="value"] .hud-net-rate-row {
  margin-top: 4px;
}

#row-hud-net-per-hour .hud-val-group,
.hud-net-rate-row .hud-val-group,
.hud-net-rate-val-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  text-align: right;
}

#row-hud-net-per-hour #txt-hud-net-rate,
.hud-net-rate-row .hud-stat-val {
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

#row-hud-net-per-hour #txt-hud-net-breakdown,
.hud-net-rate-row .hud-stat-breakdown,
[data-region="value"] .hud-stat-breakdown {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text-dim, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: right;
}

/* Minimized HUD mode */
body.hud-minimized #hud-card,
body.hud-minimized .hud-footer-bar,
body.hud-minimized #hud-launcher {
  display: none !important;
}

body.hud-minimized #hud-mini {
  display: flex !important;
}

body:not(.hud-minimized) #hud-mini {
  display: none !important;
}

.hud-header-btn.hud-btn-minimize,
.hud-mini-btn-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-dim, #94a3b8);
  border-radius: 6px;
  padding: 0;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.hud-header-btn.hud-btn-minimize:hover,
.hud-mini-btn-expand:hover {
  color: var(--text-bright, #f8fafc);
  background: rgba(255, 255, 255, 0.08);
}

.hud-mini {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  max-width: 320px;
  padding: 6px 10px;
  background: var(--glass-bg, rgba(16, 20, 28, 0.94));
  border: 1px solid var(--border-edge, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-main, #e2e8f0);
  pointer-events: auto;
  user-select: none;
  z-index: 100;
  cursor: grab;
}

.hud-mini.dragging {
  cursor: grabbing;
}

.hud-mini-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  flex: 1;
  min-width: 0;
}

.hud-mini-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.hud-mini-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim, #94a3b8);
}

.hud-mini-val {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-bright, #f8fafc);
}

.hud-mini-val.gold {
  color: var(--color-accent, #fbbf24);
}

.hud-mini-val.ap-blue {
  color: var(--color-ap, #38bdf8);
}

/* Auto-hide Fade In/Out */
#hud-card,
#hud-mini,
.hud-footer-bar,
#hud-capture-warning {
  transition: opacity 200ms ease, transform 200ms ease;
}

body.hud-auto-hidden #hud-card,
body.hud-auto-hidden #hud-mini,
body.hud-auto-hidden .hud-footer-bar,
body.hud-auto-hidden #hud-capture-warning {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-4px) scale(0.99);
}

@media (prefers-reduced-motion: reduce) {
  #hud-card,
  #hud-mini,
  .hud-footer-bar,
  #hud-capture-warning {
    transition: none !important;
  }
  body.hud-auto-hidden #hud-card,
  body.hud-auto-hidden #hud-mini,
  body.hud-auto-hidden .hud-footer-bar,
  body.hud-auto-hidden #hud-capture-warning {
    transform: none !important;
  }
}

/* Gathering Mode HUD Elements */
.hud-hybrid-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  line-height: 1.2;
}

.hud-item-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hud-item-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.hud-item-badge-hybrid {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.hud-item-badge-bound {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #cbd5e1;
}

.hud-item-badge-unpriced {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ==========================================================================
   Sessions Splitter & Split View
   ========================================================================== */
.sessions-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 8px minmax(420px, 1.2fr);
  gap: 0;
  align-items: stretch;
}

.sessions-splitter {
  width: 8px;
  cursor: col-resize;
  background: transparent;
  position: relative;
}

.sessions-splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: var(--border-line);
  transition: background 150ms ease;
}

.sessions-splitter:hover::after,
.sessions-splitter:focus::after,
.sessions-splitter:focus-visible::after {
  background: var(--color-accent);
}

.sessions-splitter:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

body.resizing-sessions {
  cursor: col-resize;
  user-select: none;
}

/* ==========================================================================
   Drop Rates — Spotlight Search & Class Chips
   ========================================================================== */
.drop-rates-spotlight {
  display: flex;
  justify-content: center;
  padding: 4px 0 10px;
}

.drop-rates-spotlight-field {
  position: relative;
  width: min(680px, 100%);
}

.drop-rates-spotlight-input {
  width: 100%;
  height: 46px;
  padding: 0 46px 0 44px;
  border-radius: 12px;
  border: 1px solid var(--border-line);
  background: var(--bg-card);
  color: var(--text-ink);
  font-size: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.drop-rates-spotlight-input:focus,
.drop-rates-spotlight-input:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(214, 168, 81, 0.18);
}

.drop-rates-spotlight-input::placeholder {
  color: var(--text-muted);
}

.drop-rates-spotlight-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-rates-spotlight-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-line);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  pointer-events: none;
  line-height: 1.2;
}

.drop-rates-spotlight-field .search-dropdown,
.drop-rates-spotlight-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bg-surface);
  border: 1px solid var(--border-line);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  max-height: 320px;
  overflow-y: auto;
}

.drop-rates-class-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.drop-rates-class-chip {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border-line);
  background: var(--bg-inset);
  color: var(--text-ink);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}

.drop-rates-class-chip:hover {
  border-color: rgba(214, 168, 81, 0.45);
  background: rgba(214, 168, 81, 0.05);
}

.drop-rates-class-chip:focus-visible {
  /* Neutral ring: gold is reserved for the Unique class. */
  outline: 2px solid rgba(230, 221, 204, 0.8);
  outline-offset: 2px;
}

.drop-rates-class-chip[data-selected="true"],
.drop-rates-class-chip.active,
.drop-rates-class-chip[aria-pressed="true"] {
  /* Neutral selection: gold is reserved for the Unique class so the selected
     state never reads as a grade colour. */
  border-color: rgba(230, 221, 204, 0.55);
  box-shadow: inset 0 0 0 2px rgba(230, 221, 204, 0.55);
  background: rgba(230, 221, 204, 0.06);
}

.drop-rates-class-chip-check {
  display: none;
  width: 14px;
  height: 14px;
  color: var(--text-ink);
  flex-shrink: 0;
}

.drop-rates-class-chip[data-selected="true"] .drop-rates-class-chip-check,
.drop-rates-class-chip.active .drop-rates-class-chip-check,
.drop-rates-class-chip[aria-pressed="true"] .drop-rates-class-chip-check {
  display: inline-flex;
}


/* ========================================================================= */
/* Drop Rates Scope Toggle & Table Enhancements                              */
/* ========================================================================= */
.drop-rates-scope-toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.drop-rates-scope-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--bg-inset, rgba(0, 0, 0, 0.4));
  border: 1px solid var(--border-line, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  user-select: none;
}

.drop-rates-scope-btn {
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-ink-muted, #94a3b8);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  transition: all 150ms ease;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drop-rates-scope-btn:hover:not(:disabled) {
  color: var(--text-ink, #f8fafc);
  background: rgba(255, 255, 255, 0.06);
}

.drop-rates-scope-btn.active,
.drop-rates-scope-btn[aria-pressed="true"] {
  background: var(--color-accent, #d4a359);
  color: #0b0f19;
  font-weight: 700;
}

.drop-rates-scope-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.drop-rates-kills-summary {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin-top: 6px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.drop-rates-items-table th.th-mob,
.drop-rates-items-table td.drop-rates-cell-mob {
  text-align: left;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drop-rates-items-table th.th-rate,
.drop-rates-items-table th.th-solo-rate,
.drop-rates-items-table th.th-shared-rate,
.drop-rates-items-table th.th-drops,
.drop-rates-items-table th.th-kills {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.drop-rates-items-table td.drop-rates-cell-rate,
.drop-rates-items-table td.drop-rates-cell-solo-rate,
.drop-rates-items-table td.drop-rates-cell-shared-rate,
.drop-rates-items-table td.drop-rates-cell-drops,
.drop-rates-items-table td.drop-rates-cell-kills {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* ========================================================================= */
/* Runs Section (Run History / Instances)                                    */
/* ========================================================================= */
.runs-section {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.runs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
}

.runs-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.runs-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-ink);
  margin: 0;
}

.runs-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.runs-filter-chip {
  min-height: 44px;
  min-width: 44px;
  border-radius: 8px;
  border: 1px solid var(--border-line);
  background: var(--bg-inset);
  color: var(--text-ink);
  padding: 8px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 150ms ease;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
}

.runs-filter-chip:hover {
  border-color: rgba(214, 168, 81, 0.45);
  background: rgba(214, 168, 81, 0.06);
}

.runs-filter-chip.active,
.runs-filter-chip[aria-pressed="true"] {
  border-color: var(--color-accent, #d4a359);
  background: rgba(214, 168, 81, 0.12);
  color: var(--color-accent, #d4a359);
  box-shadow: inset 0 0 0 1px var(--color-accent, #d4a359);
}

.runs-empty-state {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
}

.runs-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.25fr) minmax(280px, 1fr);
  gap: 14px;
}

@media (max-width: 900px) {
  .runs-layout {
    grid-template-columns: 1fr;
  }
}

.runs-list-panel,
.runs-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.runs-list-scroll {
  max-height: calc(100vh - 220px);
  min-height: 380px;
  overflow-y: auto;
}

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

.runs-table th {
  padding: 8px 12px;
  background: var(--bg-canvas);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-line);
  text-align: left;
}

.runs-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-line);
  font-size: 12px;
  color: var(--text-ink);
}

.run-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.run-row:hover {
  background: var(--bg-hover);
}

.run-row.selected {
  background: var(--bg-lifted);
  border-left: 3px solid var(--color-accent, #d4a359);
}

.run-badge-kind {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.run-badge-dungeon {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.run-badge-shugo {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.run-badge-dimensional {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.run-badge-outcome {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.outcome-completed {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.outcome-abandoned {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.outcome-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.badge-confidence {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-confidence-high {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.badge-confidence-medium {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
}

.badge-confidence-low {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.runs-detail-scroll {
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 220px);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.runs-detail-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.run-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.run-detail-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.run-detail-metric-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.run-detail-metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.run-detail-metric-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-ink);
}

.run-detail-evidence-line {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 10px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-classify-box {
  margin-top: 4px;
  padding: 12px;
  background: var(--bg-canvas);
  border: 1px dashed var(--color-accent, #d4a359);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.run-classify-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent, #d4a359);
}

.run-classify-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.run-classify-select,
.run-classify-input {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid var(--border-line);
  background: var(--bg-inset);
  color: var(--text-ink);
}

.run-classify-input {
  flex: 1;
  min-width: 140px;
}

.run-classify-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.run-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-line);
}
