/*
  EvE EMU market tools — Bootswatch Slate (matches eve-emu.com / auth.eve-emu.com).
  Shared tokens with core-web globals.css for a universal look across all market pages.
*/
:root {
  --bg: #272b30;
  --bg-elevated: #32383e;
  --bg-panel: #3a3f44;
  --bg-input: #1c1e22;
  --border: rgba(0, 0, 0, 0.6);
  --border-light: rgba(255, 255, 255, 0.1);
  --text: #aaa;
  --text-emphasis: #fff;
  --text-dim: #7a8288;
  --fg: #aaa;
  --fg-emphasis: #fff;
  --muted: #7a8288;
  --accent: #5bc0de;
  --accent-dim: #46b8da;
  --accent-hover: #46b8da;
  --sell: #ee5f5b;
  --buy: #62c462;
  --warn: #f89406;
  --chart-avg: #5bc0de;
  --chart-vol: #7a8288;
  --sz-body: 13px;
  --sz-label: 11px;
  --sz-title: 15px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 0.375rem;
  --topbar-h: 48px;
  --sidebar-w: 280px;
  --shadow-text: 1px 1px 1px rgba(0, 0, 0, 0.3);
}

html {
  color-scheme: dark;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--sz-body);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  color: var(--text-emphasis);
  text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
  font-weight: 600;
}

/* ——— Site nav (fluid sticky chrome — mirrors core-web SiteNav) ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  min-height: var(--topbar-h);
  padding: 0;
  gap: 0;
  background: linear-gradient(
    180deg,
    rgba(67, 72, 78, 0.97) 0%,
    rgba(58, 63, 68, 0.95) 45%,
    rgba(46, 51, 56, 0.96) 100%
  );
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  transition: box-shadow 280ms ease, border-color 280ms ease;
}
.topbar.site-nav.is-scrolled {
  border-bottom-color: rgba(0, 0, 0, 0.7);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat;
  transition: background-color 180ms ease, color 180ms ease;
}
.brand-link:hover {
  text-decoration: none;
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat,
    rgba(0, 0, 0, 0.22);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin-left: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: visible;
}

.nav-menu {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
}

.nav-menu > button {
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat,
    transparent;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  padding: 12px 12px;
  font-size: 13px;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  border-radius: 0;
  white-space: nowrap;
  text-shadow: var(--shadow-text);
  transition: background-color 180ms ease, color 180ms ease;
}
.nav-menu > button:hover,
.nav-menu.open > button {
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat,
    rgba(0, 0, 0, 0.22);
  color: #fff;
}
.nav-menu > button .nav-chev {
  display: inline-block;
  opacity: 0.65;
  font-size: 0.7em;
  margin-left: 2px;
  transition: transform 200ms ease, opacity 180ms ease;
}
.nav-menu.open > button .nav-chev {
  transform: rotate(180deg);
  opacity: 1;
}

.nav-dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  z-index: 200;
  min-width: 12rem;
  padding: 6px 0;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: var(--radius);
  background: rgba(50, 56, 62, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top left;
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 160ms;
}
.nav-menu.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.nav-dropdown a {
  display: block;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease, padding-left 140ms ease;
}
.nav-dropdown a:hover {
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  text-decoration: none;
  padding-left: 16px;
}
.nav-dropdown a.active { color: var(--accent); }

/* Top-nav links only (Home / Auth) — do not reuse for page actions */
.top-nav > .nav-btn {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat,
    transparent;
  border: none;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.88);
  padding: 12px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: var(--shadow-text);
  transition: background-color 180ms ease, color 180ms ease;
}
.top-nav > .nav-btn:hover {
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat,
    rgba(0, 0, 0, 0.22);
  color: #fff;
  text-decoration: none;
}
.top-nav > .nav-btn.active {
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.18)) right / 1px 55% no-repeat,
    rgba(0, 0, 0, 0.3);
}

.topbar-main {
  margin-left: auto;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
  padding: 0 12px;
}

@media (prefers-reduced-motion: reduce) {
  .topbar,
  .brand-link,
  .nav-menu > button,
  .nav-menu > button .nav-chev,
  .nav-dropdown,
  .nav-dropdown a,
  .top-nav > .nav-btn,
  .auth-slot .login-btn {
    transition: none !important;
  }
}

.auth-slot {
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
}
.auth-slot .pilot-name { color: #fff; }
.auth-slot .login-btn {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  background: linear-gradient(#6bc6e2, #5bc0de 40%, #46b8da);
  text-shadow: var(--shadow-text);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}
.auth-slot .login-btn:hover {
  background: linear-gradient(#46b8da, #5bc0de 40%, #6bc6e2);
  text-decoration: none;
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(70, 184, 218, 0.35);
}

/* Page action buttons (Slate) — use instead of .nav-btn in tool panels */
.emu-btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.25;
  color: var(--text-emphasis);
  text-shadow: var(--shadow-text);
  background: linear-gradient(#43484e, #3a3f44 40%, #2e3338);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.emu-btn:hover {
  background: linear-gradient(#2e3338, #32383e 40%, #3a3f44);
  color: var(--text-emphasis);
  text-decoration: none;
}
.emu-btn-accent,
.emu-btn.primary {
  background: linear-gradient(#6bc6e2, #5bc0de 40%, #46b8da);
  border-color: rgba(0, 0, 0, 0.6);
}
.emu-btn-accent:hover,
.emu-btn.primary:hover {
  background: linear-gradient(#46b8da, #5bc0de 40%, #6bc6e2);
}

/* Back-compat: page buttons still using .nav-btn outside the topbar */
.filter-bar .nav-btn,
.main-panel .nav-btn,
.welcome-msg .nav-btn,
.hist-tabs .nav-btn,
.hist-tabs .emu-btn {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-emphasis);
  text-shadow: var(--shadow-text);
  background: linear-gradient(#43484e, #3a3f44 40%, #2e3338);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.filter-bar .nav-btn:hover,
.main-panel .nav-btn:hover,
.welcome-msg .nav-btn:hover,
.hist-tabs .nav-btn:hover,
.hist-tabs .emu-btn:hover {
  background: linear-gradient(#2e3338, #32383e 40%, #3a3f44);
  color: var(--text-emphasis);
  text-decoration: none;
}
.filter-bar .nav-btn.primary,
.main-panel .nav-btn.primary {
  background: linear-gradient(#6bc6e2, #5bc0de 40%, #46b8da);
}
.filter-bar .nav-btn.primary:hover,
.main-panel .nav-btn.primary:hover {
  background: linear-gradient(#46b8da, #5bc0de 40%, #6bc6e2);
}
.hist-tabs .nav-btn.active,
.hist-tabs .emu-btn.active {
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
}

.status-dot.ok { background: var(--buy); }
.status-dot.err { background: var(--sell); }

.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h) - 36px);
}

.layout-no-hub-aside {
  display: block;
}

.layout-no-hub-aside .hub-chrome-aside,
.hub-chrome-aside[hidden] {
  display: none !important;
}

.layout-no-hub-aside .main-panel {
  width: 100%;
  max-width: none;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-toolbar {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-total-label {
  font-size: var(--sz-label);
  color: var(--text-dim);
  margin-bottom: 6px;
  display: block;
}

.sidebar .search-wrap {
  padding: 0 10px 8px;
}

.sidebar .loading-msg {
  padding: 8px 10px;
}

.main-panel {
  flex: 1;
  padding: 16px 20px;
  overflow: auto;
  min-width: 0;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

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

.filter-bar input, .filter-bar select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-emphasis);
  padding: 6px 8px;
  border-radius: var(--radius);
  font-size: var(--sz-body);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sz-body);
}

table.data {
  table-layout: fixed;
}

table.data th {
  text-align: left;
  padding: 8px 10px;
  font-size: var(--sz-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  vertical-align: bottom;
}

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

table.data th.th-sortable:hover,
table.data th.th-sortable:focus-visible {
  color: var(--text);
  outline: none;
  box-shadow: inset 0 -2px 0 var(--accent);
}

table.data th.th-sortable .sort-indicator {
  font-size: 10px;
  opacity: 0.9;
  margin-left: 2px;
}

table.data th.num,
table.data td.num {
  text-align: right;
}

table.data th.col-icon,
table.data td.col-icon {
  width: 44px;
  text-align: center;
  padding: 4px 6px;
}

table.data th.col-item,
table.data td.col-item {
  width: auto;
  min-width: 180px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}

table.data td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
}

table.data tr:hover td { background: rgba(91, 192, 222, 0.08); }

.num { font-variant-numeric: tabular-nums; text-align: right; }
.sell { color: var(--sell); }
.buy { color: var(--buy); }

.pi-dir {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 1.2;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  vertical-align: middle;
}
.pi-dir-import {
  color: var(--buy);
  background: rgba(98, 196, 98, 0.14);
  box-shadow: inset 0 0 0 1px rgba(98, 196, 98, 0.35);
}
.pi-dir-export {
  color: var(--sell);
  background: rgba(238, 95, 91, 0.14);
  box-shadow: inset 0 0 0 1px rgba(238, 95, 91, 0.35);
}
.pi-dir-loc {
  font-weight: 500;
  letter-spacing: 0;
  opacity: 0.85;
}
.pi-haul-escort {
  color: var(--warning, #f89406);
  font-weight: 650;
}
.pi-haul-jf {
  color: var(--accent, #5bc0de);
  font-weight: 600;
}
.pi-haul-local {
  color: var(--muted, #7a8288);
  font-weight: 600;
}
.pi-advice {
  display: inline-block;
  max-width: 22rem;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-dim, #9aa0a6);
  white-space: normal;
}
.pi-advice-escort {
  color: var(--warning, #f89406);
}
.col-advice {
  min-width: 14rem;
  max-width: 24rem;
}

.welcome-msg {
  color: var(--text-dim);
  max-width: 720px;
}

.welcome-msg h1 {
  font-size: 20px;
  color: var(--text-emphasis);
  margin: 0 0 8px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.tool-card {
  display: block;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tool-card:hover {
  border-color: var(--accent-dim);
  text-decoration: none;
}

.tool-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-emphasis);
}

td.num.price-best-sell {
  background: rgba(232, 93, 93, 0.12);
  color: var(--sell);
  font-weight: 600;
}
td.num.price-best-buy {
  background: rgba(77, 187, 106, 0.12);
  color: var(--buy);
  font-weight: 600;
}

.mt-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.mt-layout .mb-sidebar {
  flex: 0 0 240px;
  max-height: calc(100vh - 140px);
  overflow: auto;
}
.mt-layout .mt-main {
  flex: 1;
  min-width: 0;
}

.buyback-cta {
  margin-top: 20px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(61,139,253,0.12), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

footer.site-footer {
  text-align: center;
  padding: 8px 24px;
  font-size: var(--sz-label);
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.hidden { display: none !important; }
.loading-msg { color: var(--text-dim); padding: 24px; }

.mb-layout {
  display: flex;
  gap: 16px;
  min-height: 420px;
}

.mb-sidebar {
  flex: 0 0 280px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
}

.mb-sidebar-toolbar {
  flex-shrink: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.mb-total-label {
  display: block;
  font-size: var(--sz-label);
  color: var(--text-dim);
  margin-bottom: 6px;
}

.mb-filter-listed {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--sz-label);
  color: var(--text-dim);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.mb-filter-listed input {
  accent-color: var(--accent);
}

.mb-sidebar .search-wrap {
  max-width: none;
}

.type-link.unlisted {
  opacity: 0.55;
}

.type-link.unlisted:hover {
  opacity: 0.85;
}

.mb-sidebar-tree {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.mb-sidebar-tree .loading-msg {
  padding: 8px 10px;
}

.mb-grp-count {
  font-size: var(--sz-label);
  color: var(--text-dim);
  font-weight: normal;
}

.mb-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.mb-sidebar li button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mb-sidebar li button:hover,
.mb-sidebar li button.active {
  background: rgba(61, 139, 253, 0.1);
}

.mb-sidebar .mb-price {
  margin-left: auto;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.mb-main { flex: 1; min-width: 0; }

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-wrap input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
}

.search-suggestions {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 2px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.search-suggestions button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.search-suggestions button:hover,
.search-suggestions button.focused {
  background: rgba(61, 139, 253, 0.12);
}

.search-suggestions .hint {
  padding: 8px 12px;
  color: var(--text-dim);
  font-size: var(--sz-label);
}

.mb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mb-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--panel, #3a3f44);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius, 0.375rem);
}

.mb-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.mb-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text);
}

.mb-filter-input,
.mb-filter-select {
  width: 7rem;
  margin-left: 4px;
  padding: 4px 6px;
  background: var(--bg-input, #1c1e22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text);
}

.mb-filter-select {
  width: auto;
  min-width: 9rem;
}

.mb-region-ms {
  position: relative;
  min-width: 14rem;
}

.mb-region-ms-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 14rem;
  padding: 4px 8px;
  background: var(--bg-input, #1c1e22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  font-size: var(--sz-label);
  text-align: left;
}

.mb-region-ms-toggle:hover {
  border-color: rgba(91, 192, 222, 0.45);
}

.mb-region-ms-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: min(22rem, 90vw);
  max-height: 18rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--bg-elevated, #32383e);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.mb-region-ms-panel.hidden {
  display: none;
}

.mb-region-ms-panel input[type="search"] {
  width: 100%;
  padding: 5px 8px;
  background: var(--bg-input, #1c1e22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text);
}

.mb-region-ms-actions {
  display: flex;
  gap: 8px;
}

.mb-region-ms-actions button {
  padding: 2px 8px;
  font-size: var(--sz-label);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
}

.mb-region-ms-actions button:hover {
  color: var(--text);
  border-color: rgba(91, 192, 222, 0.4);
}

.mb-region-ms-list {
  overflow: auto;
  max-height: 12rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mb-region-ms-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  font-size: var(--sz-label);
}

.mb-region-ms-list label:hover {
  background: rgba(91, 192, 222, 0.08);
}

.mb-region-ms-list label.pending {
  color: var(--text-dim);
}

.mb-region-ms-list .mb-region-meta {
  display: block;
  color: var(--text-dim);
  font-size: 11px;
}

.mb-sync-ages {
  color: var(--text-dim);
  font-size: 11px;
  margin: 0;
  line-height: 1.35;
}

.mb-sync-ages strong {
  color: var(--text);
  font-weight: 600;
}

.mb-appraisal {
  color: var(--accent, #5bc0de);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  margin: -4px 0 14px;
}

.mb-search-hits {
  margin: 0 0 8px;
  list-style: none;
}

.mb-search-hits-label {
  font-size: var(--sz-label);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
}

.mb-item-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 18px;
}

img.type-icon {
  flex-shrink: 0;
  object-fit: contain;
  background: var(--bg);
  border-radius: 2px;
}

.mb-subtitle {
  color: var(--text-dim);
  font-size: var(--sz-label);
  margin: 0 0 14px;
}

.mb-orders-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.mb-orders-panel {
  min-width: 0;
}

.mb-orders-panel h4 {
  margin: 0 0 8px;
  font-size: var(--sz-label);
  text-transform: uppercase;
}

.mb-orders-panel .table-wrap {
  max-height: 480px;
}

table.data th.col-price,
table.data td.col-price {
  width: 7.5rem;
}

table.data th.col-vol,
table.data td.col-vol {
  width: 4.5rem;
}

table.data th.col-location,
table.data td.col-location {
  width: auto;
  min-width: 16rem;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

table.data th.col-system,
table.data td.col-system {
  width: 7rem;
}

table.data th.col-sec,
table.data td.col-sec,
table.data th.col-jumps,
table.data td.col-jumps {
  width: 3.5rem;
}

.mb-loc-structure {
  color: var(--accent, #5bc0de);
}

.mb-history {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.mb-history h4 {
  margin: 0 0 8px;
  font-size: var(--sz-title);
}

.mb-history-note {
  color: var(--text-dim);
  font-size: var(--sz-label);
  margin: 0 0 10px;
}

.hist-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.hist-tab.active {
  border-color: var(--accent);
  color: var(--text);
}

.chart-section-title {
  font-size: var(--sz-label);
  margin: 12px 0 6px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chart-legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  font-size: var(--sz-label);
  color: var(--text-dim);
  margin: 0 0 6px;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  border-radius: 1px;
}

.chart-legend-item.vol .chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.chart-legend-hint {
  color: var(--text-dim);
  font-size: 10px;
  opacity: 0.85;
}

.chart-host {
  position: relative;
  margin-bottom: 8px;
}

.hub-charts-wrap {
  margin-bottom: 16px;
}

.chart-section-title {
  margin: 0 0 6px;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

canvas.hub-chart-canvas {
  width: 100%;
  height: 200px;
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

canvas.mb-chart {
  width: 100%;
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: crosshair;
}

.mb-history {
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 30;
  min-width: 160px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  font-size: var(--sz-label);
  pointer-events: none;
}

.chart-tip-date {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.chart-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 3px 0;
}

.chart-tip-row span {
  color: var(--text-dim);
}

.chart-tip-row strong {
  font-variant-numeric: tabular-nums;
}

.chart-tip-row.dim span,
.chart-tip-row.dim strong {
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .mb-region-ms,
  .mb-region-ms-toggle {
    min-width: 100%;
  }
}

.mb-cat-tree {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px;
}

.mb-cat-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 12px;
}

.mb-cat-tree details.mb-cat > summary {
  cursor: pointer;
  padding: 5px 10px;
  color: var(--text);
  font-size: var(--sz-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mb-cat-tree details.mb-cat > summary:hover {
  background: rgba(61, 139, 253, 0.08);
}

.mb-cat-tree button.type-link {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.mb-cat-tree button.type-link:hover,
.mb-cat-tree button.type-link.active {
  background: rgba(91, 192, 222, 0.12);
}

.coming-soon-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  color: var(--text-dim);
}


.appraisal-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-panel);
  margin-bottom: 16px;
}

.appraisal-route {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: var(--sz-label);
}

.appraisal-route select {
  background: var(--bg-input);
  color: var(--text-emphasis);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
}

.appraisal-arrow {
  color: var(--accent);
  font-weight: 600;
}

.appraisal-dest {
  color: var(--buy);
  font-weight: 600;
}

.appraisal-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.appraisal-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 160px;
  padding: 10px;
  background: var(--bg-input);
  color: var(--text-emphasis);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  resize: vertical;
}

.appraisal-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.appraisal-results {
  margin-top: 16px;
}

.appraisal-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.appraisal-stat {
  padding: 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.appraisal-stat .label {
  display: block;
  font-size: var(--sz-label);
  color: var(--text-dim);
  margin-bottom: 4px;
}

.appraisal-stat strong {
  font-size: 15px;
  color: var(--text);
}

.appraisal-meta-line {
  font-size: var(--sz-label);
  color: var(--text-dim);
  margin: 0 0 10px;
}

.sell-order-export {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sell-order-export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.sell-order-copy-hint {
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.sell-order-copy-hint.copied {
  color: var(--buy);
}

.so-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--sz-body);
  color: var(--text);
  cursor: pointer;
}

.so-check-row input {
  margin-top: 3px;
}

.so-markup-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.so-markup-track-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  padding-top: 30px;
}

.so-markup-bubble {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: var(--radius);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: var(--sz-label);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--buy);
  white-space: nowrap;
  pointer-events: none;
  transition: left 40ms linear;
}

.so-markup-bubble.negative {
  color: var(--warn);
}

.so-markup-slider {
  width: 100%;
  height: 6px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  display: block;
}

.so-markup-num {
  width: 4.5rem;
  flex: 0 0 4.5rem;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--sz-body);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.so-markup-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.so-markup-hint {
  margin: 6px 0 0;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.appraisal-results.so-updating {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 80ms ease;
}

.sell-order-clipboard {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 12px;
  margin: 0;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  cursor: pointer;
  user-select: all;
  min-height: 120px;
  max-height: 320px;
  overflow: auto;
}

.sell-order-clipboard:hover,
.sell-order-clipboard:focus {
  border-color: var(--accent);
  outline: none;
}

.sell-order-clipboard.copied {
  border-color: var(--buy);
}

.hidden {
  display: none !important;
}

.rank-meta {
  margin: 0 0 10px;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.rank-table-wrap .rank-alliance-row {
  cursor: pointer;
}

.rank-table-wrap .rank-alliance-row:hover td {
  background: rgba(61, 139, 253, 0.06);
}

.rank-table-wrap .rank-alliance-row.expanded td {
  background: rgba(61, 139, 253, 0.1);
  border-bottom-color: transparent;
}

.rank-expand {
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
}

.rank-expand.open {
  color: var(--accent);
}

.rank-entity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.entity-logo {
  border-radius: 2px;
  flex-shrink: 0;
}

.rank-names .rank-ticker {
  color: var(--text-dim);
  font-weight: normal;
}

.rank-detail-wrap {
  padding: 8px 8px 12px 36px;
  background: var(--bg-panel);
  border-left: 2px solid var(--accent-dim);
}

.rank-corp-table {
  font-size: 12px;
}

.rank-corp-row td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.delta.up {
  color: var(--buy);
}

.delta.down {
  color: var(--sell);
}

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

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

.delta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.delta-rank {
  font-size: 10px;
  opacity: 0.92;
}

.delta-arrow {
  display: inline-block;
  margin-right: 2px;
  font-size: 10px;
  line-height: 1;
}

.rank-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text);
}

.col-rank {
  width: 40px;
  text-align: right;
}

.col-expand {
  width: 28px;
  text-align: center;
}

.womp-seeding-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: end;
  padding: 12px 14px;
  margin-bottom: 4px;
}

.womp-seeding-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--sz-label);
  color: var(--text-dim);
}

.womp-seeding-controls select,
.womp-seeding-controls input {
  min-width: 12rem;
}

.womp-seeding-summary {
  margin-top: 12px;
}

#ws-copy-fit:not(.hidden) {
  align-self: end;
  margin-bottom: 2px;
}

.delta.warn {
  color: var(--accent-warn, #e6b422);
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .layout-no-hub-aside { display: block; }
  .sidebar { width: 100%; max-height: 200px; }
  .hub-chrome-aside { display: none !important; }

  /* Market Trends: stack category sidebar so the table gets full width */
  .mt-layout {
    flex-direction: column;
  }
  .mt-layout .mb-sidebar {
    flex: none;
    width: 100%;
    max-height: 200px;
  }
  .mt-layout .mt-main {
    width: 100%;
    min-width: 0;
  }

  /* Readable multi-column tables: size to content, scroll sideways */
  table.data {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
  }
  table.data th {
    white-space: nowrap;
  }
  table.data th.col-icon,
  table.data td.col-icon {
    display: none;
  }
  table.data th.col-item,
  table.data td.col-item {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 14rem;
    max-width: 18rem;
    overflow: visible;
    text-overflow: clip;
    background: var(--bg-panel);
    box-shadow: 2px 0 0 var(--border);
  }
  table.data th.col-item {
    z-index: 3;
    background: var(--bg-elevated);
  }
}

/* Blueprint prices — multipack deals strip (collapsed by default) */
.bp-deals-collapse {
  margin: 0 0 4px;
}

.bp-deals-summary {
  cursor: pointer;
  list-style: none;
  margin: 0 0 8px;
  font-size: var(--sz-title, 1.1rem);
  font-weight: 600;
  color: var(--text);
  user-select: none;
}

.bp-deals-summary::-webkit-details-marker {
  display: none;
}

.bp-deals-summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  margin-right: 4px;
  color: var(--text-dim);
  transition: transform 0.12s ease;
}

.bp-deals-collapse[open] > .bp-deals-summary::before {
  transform: rotate(90deg);
}

.bp-deals-body {
  margin-top: 4px;
}
