/* ── SPA views & top nav ── */
.app-view.hidden { display: none !important; }

.topbar-nav {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.15rem;
  min-width: 0;
}

.topbar-nav-link {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.topbar-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.topbar-nav-link.is-active {
  color: var(--accent);
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
}

body.route-hideout,
body.route-dashboard,
body.route-ammo,
body.route-sidequests,
body.route-story {
  --topbar-subnav-height: 2.65rem;
  --topbar-height: calc(var(--topbar-main-height) + var(--topbar-subnav-height));
  --chart-dock-gap: 0.35rem;
}

.hq-tools-page {
  max-width: 1200px;
  margin: 0 auto;
}

.hq-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
}

.hq-tools-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: 100%;
}

.hq-tools-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--tools-bg) center / cover no-repeat;
  opacity: 0.18;
  filter: saturate(0.85) brightness(0.7);
  pointer-events: none;
  z-index: 0;
}

.hq-tools-card > * {
  position: relative;
  z-index: 1;
}

.hq-tools-card h2 {
  color: #fff;
}

@media (max-width: 1100px) {
  .hq-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.topbar-subnav {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.35rem 1.5rem 0.45rem;
}

.topbar-subnav-group {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.topbar-subnav-group[hidden] {
  display: none !important;
}

.topbar-subnav[hidden] {
  display: none !important;
}

.topbar-subnav .hq-tab {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.topbar-story-only {
  display: none !important;
}

body.route-story .topbar-story-only,
body.route-sidequests .topbar-story-only {
  display: flex !important;
}

/* ── Home (Dashboard tab) ── */
.hq-home {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 1rem;
}

body.route-hideout #hideout-root.hideout-tab-home .hq-page-foot-attribution {
  display: none;
}

body.route-hideout .hq-tab-panel[data-hideout-panel="home"] .hq-home {
  padding-bottom: 0.5rem;
}

.hq-home .hq-tarkov-time,
.hq-home .hq-goons-tracker {
  margin-top: 1rem;
}

button.hq-home-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1rem;
}

.hq-home-hero {
  text-align: center;
}

.hq-home-hero h1 {
  margin: 0 0 0.85rem;
  font-family: var(--brand);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0bc4a;
  line-height: 1.2;
}

.hq-home-tour-cta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  margin: 0 auto;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
  border: 1px solid rgba(201, 162, 39, 0.65);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.22) 0%, rgba(201, 162, 39, 0.08) 100%);
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.12) inset, 0 8px 24px rgba(201, 162, 39, 0.12);
  color: #f0d98a;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.hq-home-tour-cta:hover {
  border-color: rgba(224, 188, 74, 0.9);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.32) 0%, rgba(201, 162, 39, 0.14) 100%);
  box-shadow: 0 0 0 1px rgba(224, 188, 74, 0.2) inset, 0 10px 28px rgba(201, 162, 39, 0.2);
  transform: translateY(-1px);
  color: #fff2c4;
}

.hq-home-tour-cta:focus-visible {
  outline: 2px solid rgba(224, 188, 74, 0.85);
  outline-offset: 3px;
}

.hq-home-tour-cta-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(224, 188, 74, 0.45);
  background: rgba(12, 14, 18, 0.55);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0bc4a;
}

.hq-home-tour-cta-label {
  letter-spacing: 0.01em;
}

.hq-home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

@media (max-width: 1100px) {
  .hq-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.hq-home-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.hq-home-card:hover {
  border-color: rgba(201, 162, 39, 0.45);
  transform: translateY(-2px);
}

.hq-home-card-tag {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hq-home-card h2 {
  margin: 0.45rem 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}

.hq-home-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.hq-tarkov-time {
  position: relative;
  margin-top: 1rem;
  padding: 0.7rem 0.75rem 0.8rem;
}

.hq-tarkov-time-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.hq-tarkov-time-head h2 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.hq-tarkov-time-body {
  text-align: center;
  padding: 0;
}

.hq-tarkov-time-value {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: var(--text);
}

.hq-tarkov-time-graph {
  --day-pos: 0%;
  --night-pos: 50%;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.55rem 1.35rem;
  border: 1px solid rgba(201, 162, 39, 0.18);
  border-radius: 3px;
  background: rgba(7, 11, 18, 0.45);
}

.hq-tarkov-time-track {
  position: relative;
  width: 100%;
  height: 0.76rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(90deg, rgba(24, 32, 44, 0.95), rgba(20, 26, 38, 0.95));
  overflow: visible;
}

.hq-tarkov-time-segment {
  position: absolute;
  top: 0;
  height: 100%;
  pointer-events: none;
}

.hq-tarkov-time-segment--night {
  background: linear-gradient(180deg, rgba(6, 8, 12, 0.96), rgba(12, 16, 24, 0.96));
}

.hq-tarkov-time-segment--dawn {
  background: linear-gradient(90deg, rgba(8, 10, 14, 0.96) 0%, rgba(201, 162, 39, 0.72) 100%);
}

.hq-tarkov-time-segment--dusk {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.72) 0%, rgba(8, 10, 14, 0.96) 100%);
}

.hq-tarkov-time-segment--daylight {
  background: linear-gradient(180deg, rgba(222, 187, 84, 0.8), rgba(201, 162, 39, 0.76));
}

.hq-tarkov-time-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.22rem;
  height: 1.22rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: rgba(3, 5, 8, 0.95);
  font-size: 0.68rem;
  line-height: 1;
  transition: left 0.9s linear;
  z-index: 3;
}

.hq-tarkov-time-marker--sun {
  left: var(--day-pos);
  color: #c9a227;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.26);
}

.hq-tarkov-time-marker--moon {
  left: var(--night-pos);
  color: #8ec5ff;
  box-shadow: 0 0 8px rgba(142, 197, 255, 0.26);
}

.hq-tarkov-time-bubble {
  position: absolute;
  top: calc(100% + 0.16rem);
  left: 0;
  transform: translate(-50%, 0);
  padding: 0.3rem 0.58rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(3, 5, 8, 0.98);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.05;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  transition: left 0.9s linear;
  z-index: 2;
  pointer-events: none;
}

.hq-tarkov-time-ruler {
  order: -1;
  margin: 0 0 0.55rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  color: rgba(210, 218, 232, 0.55);
}

.hq-tarkov-time-ruler span:nth-child(1) {
  text-align: left;
}

.hq-tarkov-time-ruler span:nth-child(2),
.hq-tarkov-time-ruler span:nth-child(3),
.hq-tarkov-time-ruler span:nth-child(4) {
  text-align: center;
}

.hq-tarkov-time-ruler span:nth-child(5) {
  text-align: right;
}

.hq-tarkov-time-bubble--sun {
  color: #c9a227;
  left: var(--day-pos);
}

.hq-tarkov-time-bubble--moon {
  color: #8ec5ff;
  left: var(--night-pos);
}

.hq-tarkov-time-status {
  margin: 0.9rem 0 0;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: 0.4rem;
  text-align: center;
}

.hq-tarkov-time-flag {
  display: block;
  padding: 0.18rem 0.45rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: normal;
}

.hq-tarkov-time-flag--terminal {
  color: #c9a227 !important;
}

.hq-tarkov-time-flag--cultist {
  color: #8ec5ff !important;
}

.hq-tarkov-time-flag--insomnia {
  color: #b48cff !important;
}

.hq-tarkov-time-status-sep {
  display: none;
}

.hq-goons-tracker {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  margin-top: 1rem;
  padding-bottom: 2.1rem;
  background: rgba(12, 14, 12, 0.72);
  border-color: rgba(201, 162, 39, 0.28);
}

.hq-goons-tracker::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/assets/goons-bg.webp') center / cover no-repeat;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.hq-goons-tracker > * {
  position: relative;
  z-index: 1;
}

.hq-goons-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-bottom: 0.65rem;
}

.hq-goons-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.hq-goons-subhead {
  margin: 0.85rem 0 0.45rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.hq-goons-now-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 640px) {
  .hq-goons-now-grid {
    grid-template-columns: 1fr;
  }
}

.hq-goons-now {
  padding: 0.75rem 0.85rem;
}

.hq-goons-map {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.2rem;
  color: var(--accent);
}

.hq-goons-meta,
.hq-goons-reporter {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.hq-goons-reporter {
  font-family: var(--mono);
  font-size: 0.78rem;
}

.hq-goons-mode {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-goons-mode--pvp {
  background: rgba(201, 79, 79, 0.18);
  color: #f0a8a8;
}

.hq-goons-mode--pve {
  background: rgba(120, 170, 220, 0.18);
  color: #a8c8f0;
}

.hq-goons-table td strong {
  color: var(--accent);
}

.hq-goons-table tr.is-latest td {
  background: rgba(201, 162, 39, 0.06);
}

/* ── Shared page layout ── */
.hq-page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 1rem 1.5rem;
  min-width: 0;
}

.hq-page-header {
  position: relative;
  margin-bottom: 0.35rem;
  padding-bottom: 0.1rem;
  min-height: 1.2rem;
}

.hq-page-header:has(.hq-status:not([hidden])) {
  padding-bottom: 0.35rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.hq-page-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}

.hq-page-header h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.hq-attribution,
.hq-page-meta {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: right;
}

.hq-attribution a,
.hq-page-meta a {
  color: var(--choice);
  text-decoration: none;
}

.hq-attribution a:hover,
.hq-page-meta a:hover {
  text-decoration: underline;
}

.hq-page-header > .hq-attribution,
.hq-page-header > .hq-page-meta {
  position: absolute;
  right: 0;
  top: 0;
  max-width: 100%;
}

.hq-page-foot-attribution {
  position: fixed;
  right: 1rem;
  bottom: 0.5rem;
  z-index: 4;
  max-width: min(100vw - 2rem, 420px);
  pointer-events: auto;
}

body.dock-open #view-sidequests:not(.hidden) .hq-page-foot-attribution {
  right: calc(1rem + var(--dock-width, 300px));
}

body.dock-collapsed #view-sidequests:not(.hidden) .hq-page-foot-attribution {
  right: calc(1rem + var(--dock-collapsed-width, 44px));
}

@media (max-width: 1100px) {
  body.dock-open #view-sidequests:not(.hidden) .hq-page-foot-attribution,
  body.dock-collapsed #view-sidequests:not(.hidden) .hq-page-foot-attribution {
    right: 1rem;
  }
}

.hq-tarkov-time > .hq-attribution {
  position: static;
  margin-top: 0.3rem;
  text-align: right;
  max-width: 100%;
  font-size: 0.68rem;
  z-index: 1;
}

.hq-goons-tracker > .hq-attribution {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  max-width: calc(100% - 2rem);
  z-index: 1;
}

.hq-site-changelog {
  margin-top: 1rem;
  padding: 0.85rem 1rem 0.95rem;
  border-color: rgba(107, 143, 212, 0.28);
  background: linear-gradient(180deg, rgba(107, 143, 212, 0.07) 0%, rgba(12, 14, 18, 0.92) 100%);
}

.hq-changelog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.7rem;
}

.hq-changelog-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.hq-changelog-current {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 143, 212, 0.45);
  background: rgba(107, 143, 212, 0.14);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #b8cce8;
}

.hq-changelog-entry + .hq-changelog-entry {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.hq-changelog-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.45rem;
}

.hq-changelog-version {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #d8e2ec;
}

.hq-changelog-date {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.hq-changelog-list {
  margin: 0;
  padding-left: 1.1rem;
}

.hq-changelog-list li {
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}

.hq-changelog-list li:last-child {
  margin-bottom: 0;
}

.hq-changelog-link {
  color: #9eb8e0;
  text-decoration: underline;
  text-decoration-color: rgba(158, 184, 224, 0.45);
  text-underline-offset: 0.15em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.hq-changelog-link:hover {
  color: #c8d8f0;
  text-decoration-color: rgba(200, 216, 240, 0.75);
}

.hq-changelog-empty {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

body.site-tour-open {
  overflow: hidden;
}

.site-tour {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.site-tour:not(.hidden) {
  pointer-events: auto;
}

.site-tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.18);
}

.site-tour-spotlight {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 0 0 9999px rgba(4, 6, 10, 0.38);
  pointer-events: none;
  transition: top 0.22s ease, left 0.22s ease, width 0.22s ease, height 0.22s ease;
  z-index: 1;
}

.site-tour-card {
  position: fixed;
  width: min(22rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.9rem 1rem 1rem;
  z-index: 2;
  border: 1px solid rgba(201, 162, 39, 0.5);
  background: linear-gradient(
    180deg,
    rgba(18, 20, 26, 0.78) 0%,
    rgba(10, 12, 16, 0.82) 100%
  );
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 18px 48px rgba(0, 0, 0, 0.45);
}

.site-tour-card--center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.site-tour-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.site-tour-step {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-tour-close {
  flex-shrink: 0;
}

.site-tour-title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #e8edf2;
}

.site-tour-body {
  margin: 0 0 0.9rem;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
}

.site-tour-body p {
  margin: 0 0 0.55rem;
}

.site-tour-body p:last-child {
  margin-bottom: 0;
}

.site-tour-demo-wrap {
  margin-bottom: 0.75rem;
}

.site-tour-demo-card {
  max-width: 18rem;
  z-index: 2;
}

.site-tour-demo-card .sq-qi-popover {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.site-tour-demo-group {
  margin: 0.5rem 0 0.75rem;
  border: 1px solid rgba(111, 212, 168, 0.35);
  border-radius: var(--radius);
  background: rgba(111, 212, 168, 0.06);
}

.site-tour-demo-group .hq-maps-group-filter-summary {
  padding: 0.45rem 0.55rem;
}

.site-tour-demo-member::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pin-color, #6fd4a8);
  flex-shrink: 0;
}

.site-tour-demo-note {
  margin: 0;
  padding: 0 0.55rem 0.55rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.site-tour-pmc-fallback {
  margin-top: 0.5rem;
}

.site-tour-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.site-tour-actions .btn.hidden {
  display: none;
}

.monitor-remote {
  position: fixed;
  left: 0.85rem;
  bottom: 0.85rem;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  max-width: min(20rem, calc(100vw - 1.7rem));
}

.monitor-remote-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 143, 212, 0.45);
  background: rgba(12, 14, 18, 0.92);
  color: #c8d8f0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.monitor-remote.is-connected .monitor-remote-toggle {
  border-color: rgba(111, 212, 168, 0.55);
}

.monitor-remote-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.monitor-remote-status-dot.is-live {
  background: #6fd4a8;
  box-shadow: 0 0 8px rgba(111, 212, 168, 0.75);
}

.monitor-remote-panel {
  width: min(20rem, calc(100vw - 1.7rem));
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(107, 143, 212, 0.35);
  background: rgba(12, 14, 18, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.monitor-remote-kicker {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.monitor-remote-id-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.monitor-remote-id {
  flex: 1;
  padding: 0.35rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(201, 162, 39, 0.1);
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #f0d98a;
}

.monitor-remote-hint {
  margin: 0 0 0.5rem;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.monitor-remote-status {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  color: #b8cce8;
}

.monitor-remote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.monitor-remote-link {
  font-size: 0.76rem;
  color: #9eb8e0;
}

.profile-monitor {
  margin-top: 0.75rem;
}

.profile-monitor-id-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
}

.profile-monitor-id {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(201, 162, 39, 0.4);
  background: rgba(201, 162, 39, 0.08);
  font-family: var(--mono);
  letter-spacing: 0.14em;
}

.profile-monitor-status {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.hq-map-player-pin {
  width: 28px;
  height: 28px;
  transform: rotate(var(--player-rot, 0deg));
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}

.hq-map-player-pin-arrow {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 22px solid #5eead4;
}

.hq-headsets-panel > .hq-attribution {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  max-width: calc(100% - 1.5rem);
}

.hq-status {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hq-status.is-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
}

.hq-status.is-loading:not([hidden]) {
  display: flex;
}

.hq-load-banner {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  margin: 0 0 0.75rem;
  background: rgba(201, 162, 39, 0.08);
  border: 1px solid rgba(201, 162, 39, 0.28);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--accent);
}

.hq-load-banner:not([hidden]) {
  display: flex;
}

.hq-data-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.15rem 1rem;
  color: var(--text-muted);
}

.hq-data-loading p {
  margin: 0;
  font-size: 0.88rem;
}

.hq-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(201, 162, 39, 0.22);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: hq-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.hq-spinner-lg {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

@keyframes hq-spin {
  to { transform: rotate(360deg); }
}

/* ── Item hover tooltips ── */
.item-tip-trigger {
  font: inherit;
  font-size: inherit;
  color: var(--accent);
  background: none;
  border: none;
  border-bottom: 1px dashed rgba(201, 162, 39, 0.45);
  padding: 0;
  margin: 0;
  cursor: help;
  text-decoration: none;
  line-height: inherit;
}

.item-tip-trigger:hover,
.item-tip-trigger:focus-visible {
  color: #e0bc4a;
  border-bottom-color: rgba(201, 162, 39, 0.75);
  outline: none;
}

.obj-item-line {
  display: block;
  margin: 0;
}

.hq-item-tooltip {
  position: fixed;
  z-index: 60;
  width: min(280px, calc(100vw - 16px));
  pointer-events: none;
}

.hq-item-tooltip.hidden {
  display: none;
}

.hq-item-tooltip-inner {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: #16181d;
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.hq-item-tooltip-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

.hq-item-tooltip-icon--empty {
  display: block;
}

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

.hq-item-tooltip-body strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.25;
  margin-bottom: 0.15rem;
}

.hq-item-tooltip-short {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.hq-item-tooltip-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.65rem;
  margin: 0;
  font-size: 0.72rem;
}

.hq-item-tooltip-prices div {
  display: contents;
}

.hq-item-tooltip-prices dt {
  color: var(--text-muted);
  margin: 0;
}

.hq-item-tooltip-prices dd {
  margin: 0;
  font-family: var(--mono);
  text-align: right;
}

.hq-item-tooltip-hint {
  margin: 0.35rem 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.hq-item-tooltip-wiki {
  display: none;
}

.hq-item-tooltip-loading,
.hq-item-tooltip-error {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

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

.btn.is-busy {
  opacity: 0.65;
  pointer-events: none;
}

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

.hq-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.5rem 0 0.65rem;
  flex-wrap: wrap;
}

.hq-tab {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

.hq-tab.active {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.4);
  color: var(--accent);
}

.hq-search-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}

.hq-search-field input,
.hq-toolbar input,
.hq-toolbar select {
  font: inherit;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.88rem;
}

.hq-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.hq-toolbar input { flex: 1; min-width: 140px; }
.hq-toolbar select { width: auto; min-width: 130px; }

.hq-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 0.85rem;
  align-items: start;
}

.hq-scroll-panel {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}

.hq-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.hq-item-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.hq-item-row:hover { background: rgba(255, 255, 255, 0.03); }
.hq-item-row.is-active { background: rgba(201, 162, 39, 0.1); }

.hq-item-row img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.hq-item-row-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  flex: 1;
}

.hq-item-row-text strong { font-size: 0.88rem; }
.hq-item-row-text span {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hq-item-row-price {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  flex-shrink: 0;
}

.hq-item-list-row {
  display: flex;
  align-items: stretch;
}

.hq-item-list-row .hq-item-row {
  flex: 1;
  min-width: 0;
}

.hq-item-fav-btn {
  flex-shrink: 0;
  width: 2.1rem;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  background: transparent;
  color: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.hq-item-fav-btn:hover {
  color: #e8c040;
  background: rgba(201, 162, 39, 0.08);
}

.hq-item-fav-btn.is-fav {
  color: #e8c040;
}

.hq-item-detail-head .hq-item-fav-btn {
  margin-left: auto;
  align-self: flex-start;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm, 6px);
}

.hideout-favorites {
  flex-shrink: 0;
  margin: 0;
  padding: 0.85rem 0.85rem 0.75rem;
  border-top: none;
  border-radius: 0 0 var(--radius, 10px) var(--radius, 10px);
  background: rgba(0, 0, 0, 0.22);
  position: relative;
  z-index: 1;
}

/* Hideout item search — main area + favourites docked at bottom under tabs */
body.route-hideout #hideout-root.hq-page {
  max-width: min(1440px, 100%);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-height, 3.75rem));
  padding-bottom: 2rem;
}

body.route-hideout.hideout-view-loottiers #view-hideout {
  width: 100%;
  max-width: none;
}

body.route-hideout #hideout-root.hq-page.hideout-tab-loottiers {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
}

body.route-hideout #hideout-root.hideout-tab-loottiers .hq-tab-panel[data-hideout-panel='loottiers'] {
  width: 100%;
  max-width: none;
}

body.route-hideout .hq-tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.route-hideout .hq-tab-panel[data-hideout-panel="search"] {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.hideout-search-layout {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius, 10px);
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
  --hideout-search-pane-max: min(48vh, 440px);
  --hideout-search-input-block: 4.35rem;
}

.hideout-search-layout .hideout-search-main {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: calc(var(--hideout-search-pane-max) + var(--hideout-search-input-block));
  min-height: calc(var(--hideout-search-pane-max) + var(--hideout-search-input-block));
  max-height: calc(var(--hideout-search-pane-max) + var(--hideout-search-input-block));
  margin: 0;
  padding: 0.85rem 0.85rem 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  column-gap: 0.85rem;
  row-gap: 0.3rem;
  align-items: stretch;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hideout-search-layout .hideout-search-label {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
}

.hideout-search-layout .hideout-search-input {
  grid-column: 1;
  grid-row: 2;
  margin: 0;
  font: inherit;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.88rem;
}

.hideout-search-layout .hideout-search-results {
  grid-column: 1;
  grid-row: 3;
  min-height: 0;
  max-height: 100%;
  margin-top: 0.35rem;
  overflow-x: hidden;
  overflow-y: auto;
}

.hideout-search-layout .hideout-search-detail {
  grid-column: 2;
  grid-row: 2 / 4;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  align-self: stretch;
}

.hideout-search-layout .hideout-search-results.hq-scroll-panel,
.hideout-search-layout .hideout-search-detail.hq-scroll-panel {
  max-height: 100%;
}

.hideout-favorites-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.hideout-favorites-head .sidebar-select-label {
  margin: 0;
}

.hideout-favorites-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hideout-favorites-head .btn {
  margin-left: auto;
}

.hideout-favorites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, 7.5rem);
  gap: 0.35rem;
}

.hideout-fav-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  height: 100%;
  min-height: 7.5rem;
  box-sizing: border-box;
  padding: 0.55rem 1.65rem 0.55rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 6px);
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hideout-fav-slot:hover {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.05);
}

.hideout-fav-slot.is-active {
  border-color: rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.1);
}

.hideout-fav-slot.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.1);
  background: transparent;
  cursor: default;
  padding: 0.55rem;
}

.hideout-fav-slot.is-loading,
.hideout-fav-slot.is-error {
  cursor: default;
  justify-content: center;
}

.hideout-fav-slot img,
.hideout-fav-slot-icon-fallback {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.hideout-fav-slot-icon-fallback {
  display: block;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.hideout-fav-slot-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;
}

.hideout-fav-slot-name {
  width: 100%;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.hideout-fav-slot-prices {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  width: 100%;
  min-width: 0;
}

.hideout-fav-slot-price {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.hideout-fav-slot-trader {
  color: #9fd4a8;
}

.hideout-fav-slot-price-label {
  font-family: var(--sans, inherit);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.hideout-fav-slot-updated {
  width: 100%;
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.hideout-fav-slot-empty-label {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.22);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hideout-fav-slot-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  transform: none;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.hideout-fav-slot:hover .hideout-fav-slot-remove,
.hideout-fav-slot:focus-within .hideout-fav-slot-remove {
  opacity: 1;
}

.hideout-fav-slot-remove:hover {
  color: #fff;
}

@media (max-width: 760px) {
  .hideout-favorites-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(4, 7.5rem);
  }
}

.hq-item-detail-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.hq-item-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.hq-item-detail h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.hq-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.hq-price-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.hq-price-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.hq-price-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hq-price-tables h3 {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.hq-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.hq-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hq-table td.num {
  text-align: right;
  font-family: var(--mono);
  color: var(--accent);
}

.hq-wiki-link {
  font-size: 0.82rem;
  color: var(--choice);
}

.hq-crafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

.hq-craft-card {
  position: relative;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.hq-craft-card--profit {
  border-color: rgba(90, 170, 120, 0.38);
  background: linear-gradient(165deg, rgba(48, 88, 62, 0.42) 0%, rgba(12, 18, 14, 0.55) 55%);
  box-shadow: inset 0 1px 0 rgba(130, 210, 155, 0.1);
}

.hq-craft-card--loss {
  border-color: rgba(190, 95, 95, 0.38);
  background: linear-gradient(165deg, rgba(72, 36, 36, 0.45) 0%, rgba(18, 12, 12, 0.55) 55%);
  box-shadow: inset 0 1px 0 rgba(220, 120, 120, 0.08);
}

.hq-craft-card--top {
  border-color: rgba(201, 162, 39, 0.58);
  background: linear-gradient(165deg, rgba(88, 72, 28, 0.5) 0%, rgba(22, 18, 10, 0.6) 50%);
  box-shadow:
    inset 0 1px 0 rgba(232, 210, 140, 0.14),
    0 0 0 1px rgba(201, 162, 39, 0.12);
}

.hq-craft-top-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 1;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  color: #f3e6b8;
  background: rgba(18, 14, 6, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.55);
}

.hq-craft-head {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
}

.hq-craft-head-top {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  min-width: 0;
}

.hq-craft-head-top .hq-item-icon {
  flex-shrink: 0;
}

.hq-craft-head-top > div {
  min-width: 0;
}

.hq-craft-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  line-height: 1.25;
}

.hq-craft-costs {
  margin-left: 0;
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
  font-size: 0.76rem;
}

.hq-craft-costs div {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.hq-craft-costs span { color: var(--text-muted); }
.hq-craft-costs strong { font-family: var(--mono); }
.hq-craft-costs .pos { color: #a8e0c4; }
.hq-craft-costs .neg { color: #f0a8a8; }

.hq-craft-ingredients {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
}

@media (max-width: 520px) {
  .hq-crafts-grid {
    grid-template-columns: 1fr;
  }

  .hq-craft-costs {
    grid-template-columns: 1fr;
  }

  .hq-craft-costs div {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
  }
}

.hq-cultist-note {
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.hq-trader-reset-intro {
  text-align: center;
  max-width: 34rem;
  margin: 0 auto 1rem;
  padding: 1rem 1.15rem;
  line-height: 1.5;
}

.hq-trader-reset-intro-lead {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.hq-trader-reset-intro-sub {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hq-trader-reset-summary {
  text-align: center;
  margin-bottom: 0.85rem;
}

.hq-trader-reset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.65rem;
}

.hq-trader-reset-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.65rem 0.75rem;
  border: 2px solid color-mix(in srgb, var(--hq-trader-color, #7a8494) 35%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--hq-trader-color, #7a8494) 10%, rgba(10, 12, 16, 0.92)) 0%, rgba(10, 12, 16, 0.96) 100%);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.hq-trader-reset-card:hover {
  border-color: color-mix(in srgb, var(--hq-trader-color, #7a8494) 58%, transparent);
  transform: translateY(-1px);
}

.hq-trader-reset-card.is-subscribed {
  border-color: color-mix(in srgb, var(--hq-trader-color, var(--accent)) 72%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hq-trader-color, var(--accent)) 28%, transparent);
}

.hq-trader-reset-card.is-restocking {
  animation: hq-trader-pulse 1.2s ease-in-out infinite;
}

@keyframes hq-trader-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hq-trader-color, var(--accent)) 35%, transparent); }
  50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--hq-trader-color, var(--accent)) 18%, transparent); }
}

.hq-trader-reset-icon {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--hq-trader-color, #7a8494) 45%, transparent);
  background: rgba(0, 0, 0, 0.35);
}

.hq-trader-reset-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--hq-trader-color, var(--text));
}

.hq-trader-reset-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.hq-trader-reset-time.is-now {
  color: var(--accent);
}

.hq-trader-reset-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--hq-trader-color, var(--accent)) 22%, rgba(10, 12, 16, 0.9));
  border: 1px solid color-mix(in srgb, var(--hq-trader-color, var(--accent)) 55%, transparent);
  color: var(--hq-trader-color, var(--accent));
}

.hq-trader-reset-badge svg {
  width: 0.75rem;
  height: 0.75rem;
}

.hq-sacrifice-section {
  margin-top: 0.85rem;
}

.hq-sacrifice-section-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.hq-sacrifice-section .panel-note {
  margin-bottom: 0.55rem;
}

.hq-cultist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.hq-cultist-card {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.3rem;
  padding: 0.55rem 0.5rem 0.5rem;
  min-width: 0;
  text-align: center;
}

.hq-cultist-card-icon-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  min-height: 0;
}

.hq-cultist-card-icon {
  position: relative;
  width: 3.4rem;
  height: 3.4rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.22);
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.1) 0%, rgba(0, 0, 0, 0.35) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hq-cultist-card-img {
  width: 2.45rem;
  height: 2.45rem;
  object-fit: contain;
}

.hq-cultist-card-img-fallback {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.hq-cultist-card-count,
.hq-cultist-card-more {
  position: absolute;
  top: -0.3rem;
  right: -0.3rem;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.3;
  color: #f3e6b8;
  background: rgba(18, 16, 10, 0.92);
  border: 1px solid rgba(201, 162, 39, 0.45);
}

.hq-cultist-card-more {
  top: auto;
  bottom: -0.28rem;
  left: -0.28rem;
  right: auto;
}

.hq-cultist-card-duration {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  white-space: nowrap;
}

.hq-cultist-card-sacrifice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem 0.25rem;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text);
  max-height: 2.5em;
  overflow: hidden;
}

.hq-cultist-card-plus {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.hq-cultist-card-divider {
  font-size: 0.72rem;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0.75;
}

.hq-cultist-card-outcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  min-height: 0;
  flex: 1;
}

.hq-cultist-card-outcome-text {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.hq-cultist-card-outcome-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  line-height: 1.2;
  color: var(--text-muted);
  max-width: 100%;
}

.hq-cultist-card-outcome-icon {
  width: 1.1rem;
  height: 1.1rem;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .hq-cultist-grid {
    grid-template-columns: repeat(auto-fill, minmax(8.25rem, 1fr));
    gap: 0.5rem;
  }
}

.hq-item-icon-sm {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.hq-craft-ingredients li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
}

.hq-craft-ingredients img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.hq-craft-ingredients .num {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--text-muted);
}

/* ── Kappa mode (matches Sidequests detailed layout) ── */
.kappa-app-body {
  transition: margin-right 0.25s ease;
}

.kappa-shell {
  width: 100%;
  max-width: none;
  padding: 0.5rem 1rem 0;
  box-sizing: border-box;
}

.kappa-shell > .kappa-trader-bar {
  margin: calc(1.2rem + 0.1rem + 0.35rem) 0 0.85rem;
}

.kappa-trader-bar .kappa-list-filters {
  padding: 0;
}

body.sq-view-kappa .kappa-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.hq-kappa-layout {
  flex: 1 1 auto;
  min-height: calc(100vh - var(--topbar-height) - 12rem);
}

.kappa-sidebar {
  gap: 0.65rem;
}

.kappa-sidebar-intro {
  position: relative;
  padding: 0.15rem 0 0.35rem;
  padding-left: 3.25rem;
  min-height: 3rem;
}

.kappa-sidebar-intro.has-chapter-icon::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 2.65rem;
  height: 2.65rem;
  background: var(--story-chapter-icon) center / contain no-repeat;
  opacity: 0.92;
}

.kappa-sidebar-title {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
  line-height: 1.2;
}

.kappa-handins {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.kappa-handins-summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.kappa-handins .item-checklist {
  margin-top: 0.35rem;
  max-height: 16rem;
  overflow-y: auto;
}

.sq-collector-banner {
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 0.45rem;
  background: color-mix(in srgb, #c9a227 14%, transparent);
  border: 1px solid color-mix(in srgb, #c9a227 35%, transparent);
}

.sq-detail.is-collector-detail.is-done::before {
  background: color-mix(in srgb, #c9a227 8%, transparent);
}

.sq-quest-row.is-collector-row .sq-quest-row-name {
  color: #e8c96a;
}

@media (max-width: 1100px) {
  body.sq-view-kappa .hq-kappa-layout {
    grid-template-columns: 1fr;
  }

  body.sq-view-kappa .kappa-sidebar {
    max-height: min(57.2vh, 624px);
  }
}

/* ── Sidequests ── */
.sq-trader-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.hq-list-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.15rem 0.15rem 0;
}

.sq-trader-bar .hq-list-filters {
  justify-content: center;
  width: 100%;
}

.hq-list-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.hq-list-filter input {
  margin: 0;
  accent-color: var(--accent, #c9a227);
}

.flow-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.flow-head .details-heading {
  margin: 0;
}

.kappa-list-filters {
  padding: 0;
}

.sq-unavailable-banner {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(212, 160, 90, 0.35);
  background: rgba(212, 160, 90, 0.1);
  color: #e8c898;
}

.sq-app-body {
  display: flex;
  justify-content: center;
  transition: margin-right 0.25s ease;
  width: 100%;
}

.sq-app-body > .hq-page {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

#sidequests-root.hq-page {
  max-width: 1440px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-height, 3.75rem) - 1.25rem);
}

.sq-tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sq-tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sq-tab-panel.hidden {
  display: none !important;
}

body.sq-view-checklist #sq-chart-dock,
body.sq-view-quest-items #sq-chart-dock {
  display: none !important;
}

body.sq-view-quest-items .sq-trader-bar,
body.sq-view-quest-items .topbar-story-only {
  display: none !important;
}

body.sq-view-checklist #sidequests-root.hq-page,
body.sq-view-quest-items #sidequests-root.hq-page {
  max-width: 100%;
}

body.sq-view-kappa #view-sidequests {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topbar-height, 3.75rem));
}

body.sq-view-kappa #kappa-root {
  flex: 1 1 auto;
  width: 100%;
}

body.sq-view-kappa .sq-app-body {
  display: none !important;
}

/* ── Story checklist tabs ── */
.story-app-body {
  display: flex;
  justify-content: center;
  transition: margin-right 0.25s ease;
  width: 100%;
  min-height: calc(100vh - var(--topbar-height, 3.75rem));
}

.story-tab-panels {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.story-tab-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.story-tab-panel.hidden {
  display: none !important;
}

body.story-view-checklist #chart-dock,
body.story-view-decisions #chart-dock {
  display: none !important;
}

body.story-view-checklist .story-app-body,
body.story-view-decisions .story-app-body {
  margin-right: 0 !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-height, 3.75rem));
  max-height: calc(100vh - var(--topbar-height, 3.75rem));
  min-height: 0;
  overflow: hidden;
}

body.story-view-checklist .story-checklist-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  padding: 0 1.25rem 1rem;
  overflow: auto;
}

body.story-view-decisions .story-tab-panel[data-story-panel="decisions"] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.story-view-decisions .story-decisions-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  padding: 0 1.25rem 0.75rem;
  box-sizing: border-box;
  overflow: hidden;
}

/* ── Story — Decisions Flowchart tab ── */
.story-decisions-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sdf-image-page {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(1400px, calc(100vw - 2.5rem));
  margin: 0 auto;
}

.sdf-header {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  background:
    linear-gradient(135deg, rgba(201, 162, 39, 0.1), transparent 60%),
    var(--bg-card);
}

.sdf-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.sdf-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.sdf-subtitle {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.sdf-zoom {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.sdf-zoom-btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  min-width: 1.75rem;
  transition: background 0.15s, border-color 0.15s;
}

.sdf-zoom-btn:hover {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.35);
}

.sdf-zoom-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  min-width: 2.5rem;
  text-align: center;
}

.sdf-credit {
  margin: 0.5rem 0 0;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-style: italic;
}

.sdf-pan-viewport {
  flex: 1 1 0;
  min-height: 0;
  max-height: calc(100vh - var(--topbar-height, 3.75rem) - 10rem);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0e1218;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.sdf-pan-viewport.is-dragging {
  cursor: grabbing;
}

.sdf-pan-viewport:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.45);
  outline-offset: 2px;
}

.sdf-pan-layer {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  line-height: 0;
}

.sdf-flowchart-img {
  display: block;
  max-width: none;
  width: auto;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

/* Story detailed — flow centered on 50vw; sidebar docked to its left (out of grid) */
body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .layout {
  --story-flow-max: 820px;
  --story-flow-half: calc(var(--story-flow-max) / 2);
  --story-sidebar-w: 320px;
  --story-flow-sidebar-gap: 1.25rem;
  --story-layout-pad: 1.25rem;
  display: block;
  position: relative;
  max-width: none;
  width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}

body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .sidebar {
  position: absolute;
  /* Fallback: layout pad + flow-head + margin-bottom (1rem) before #flow */
  top: calc(var(--story-layout-pad) * 2 + 3.5rem);
  left: max(
    1.25rem,
    calc(50vw - var(--story-flow-half) - var(--story-sidebar-w) - var(--story-flow-sidebar-gap))
  );
  width: var(--story-sidebar-w);
  max-height: calc(100vh - var(--topbar-height) - 6.25rem);
  overflow-y: auto;
  margin: 0;
  z-index: 2;
}

@supports (top: anchor(top)) {
  body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .sidebar {
    top: anchor(--story-flow-steps top);
  }
}

body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  width: min(
    var(--story-flow-max),
    calc(100vw - var(--story-sidebar-w) - var(--dock-width, 300px) - 4rem)
  );
  max-width: var(--story-flow-max);
  margin-left: max(0px, calc(50vw - var(--story-flow-half) - 1.25rem));
  margin-right: auto;
}

body.route-story:not(.story-view-checklist):not(.story-view-decisions).dock-collapsed .story-tab-panel[data-story-panel="detailed"] .flow {
  width: min(
    var(--story-flow-max),
    calc(100vw - var(--story-sidebar-w) - var(--dock-collapsed-width, 44px) - 4rem)
  );
}

body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .flow-head {
  align-items: flex-start;
  justify-content: space-between;
}

body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .flow-head .details-heading {
  text-align: left;
}

body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] #flow {
  anchor-name: --story-flow-steps;
  width: 100%;
  max-width: none;
}

@media (max-width: 1100px) {
  body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .sidebar {
    position: sticky;
    top: calc(var(--topbar-height) + 0.5rem);
    left: auto;
    width: auto;
    margin: 0;
  }

  body.route-story:not(.story-view-checklist):not(.story-view-decisions) .story-tab-panel[data-story-panel="detailed"] .flow {
    width: min(var(--story-flow-max), 100%);
    margin-left: auto;
    margin-right: auto;
  }
}

.story-checklist-wrap .sq-checklist-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

@media (max-width: 1600px) {
  .story-checklist-wrap .sq-checklist-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .story-checklist-wrap .sq-checklist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .story-checklist-wrap .sq-checklist-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.story-check-col-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--story-chapter-color, var(--accent));
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.sq-check-col-route {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.story-check-step-num {
  color: var(--text-muted);
  font-size: 0.72rem;
  margin-right: 0.15rem;
}

.sq-checklist-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-bottom: 0.5rem;
}

.sq-checklist-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.4rem;
  align-items: stretch;
  min-width: 0;
}

.sq-check-col {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sq-check-col-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.2rem 0.45rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.15rem;
}

.sq-check-col-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.sq-check-col-icon-fallback {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--sq-trader-color, var(--text-muted));
  flex-shrink: 0;
}

.sq-check-col-title {
  min-width: 0;
  flex: 1 1 auto;
}

.sq-check-col-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.sq-check-col-progress {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.sq-check-list {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1 1 auto;
  min-height: 0;
}

.sq-check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  min-height: 1.55rem;
}

.sq-check-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sq-check-row.is-done {
  opacity: 0.72;
}

.sq-check-row.is-done .sq-check-name {
  text-decoration: line-through;
  color: #7a9a88;
}

.sq-check-row input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: #3d9a6a;
  cursor: pointer;
  flex-shrink: 0;
}

.sq-check-row input[type="checkbox"]:disabled {
  cursor: default;
  opacity: 0.85;
}

.sq-check-name {
  font-size: 0.72rem;
  line-height: 1.2;
  color: #7ec8e3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sq-check-lv {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: #6fcf6f;
  white-space: nowrap;
  flex-shrink: 0;
}

.sq-checklist-wrap:has(.sq-checklist-grid.is-filtered) {
  overflow-x: auto;
}

.sq-checklist-grid.is-filtered {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.55rem;
  width: max-content;
  min-width: 100%;
}

.sq-checklist-grid.is-filtered .sq-check-col {
  flex: 1 1 140px;
  min-width: 140px;
  max-width: 210px;
  height: auto;
}

@media (max-width: 1280px) {
  .sq-checklist-grid:not(.is-filtered) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sq-checklist-grid:not(.is-filtered) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .sq-checklist-grid:not(.is-filtered) {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hq-sidequests-layout {
  display: grid;
  grid-template-columns: minmax(292px, 339px) minmax(0, 1fr);
  gap: 0.85rem;
  align-items: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.sq-trader-bar {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  min-width: 0;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.sq-trader-bar:has(.sq-traders--icons) {
  padding-top: 2rem;
  overflow: visible;
}

.sq-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  max-height: calc(100vh - var(--topbar-height, 3.75rem) - 9rem);
}

.sq-sidebar .hq-search-field,
.sq-sidebar .sq-refresh-btn,
.sq-sidebar .btn {
  flex-shrink: 0;
}

.sq-refresh-btn {
  align-self: stretch;
  justify-content: center;
  margin-top: 0.15rem;
}

.sq-detail-wrap {
  min-width: 0;
  width: 100%;
}

.sq-detail {
  position: relative;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sq-detail-hero {
  position: relative;
  isolation: isolate;
  margin: -1rem -1rem 0.85rem;
  padding: 1rem 1rem 0.85rem;
  overflow: hidden;
}

.sq-detail-hero--has-bg {
  min-height: 12.5rem;
  background-color: var(--bg-elevated);
}

.sq-detail-hero--has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--sq-hero-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

.sq-detail-hero--has-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-elevated) 0%,
    rgba(14, 15, 17, 0.72) 22%,
    rgba(14, 15, 17, 0.2) 48%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
}

.sq-detail-hero .sq-detail-main h2 {
  font-size: calc(1.28rem * 1.3);
  line-height: 1.25;
}

.sq-detail-hero--has-bg .sq-detail-main h2 {
  color: #fff;
}

.sq-detail-hero > * {
  position: relative;
  z-index: 1;
}

.sq-detail-body {
  position: relative;
  z-index: 1;
  padding: 0 0.1rem 0.25rem;
}

.sq-detail-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sq-detail-wiki-btn,
.sq-detail-youtube-btn,
.hq-find-map-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.42rem 0.72rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.sq-detail-wiki-btn {
  border: 1px solid rgba(107, 143, 212, 0.5);
  background: rgba(107, 143, 212, 0.16);
  color: #b8d4f5;
}

.sq-detail-wiki-btn:hover {
  color: #dcecff;
  border-color: rgba(158, 200, 239, 0.72);
  background: rgba(107, 143, 212, 0.28);
  transform: translateY(-1px);
}

.sq-detail-youtube-btn {
  border: 1px solid rgba(255, 72, 72, 0.48);
  background: rgba(255, 48, 48, 0.14);
  color: #ffb4b4;
}

.sq-detail-youtube-btn:hover {
  color: #ffd8d8;
  border-color: rgba(255, 110, 110, 0.72);
  background: rgba(255, 48, 48, 0.24);
  transform: translateY(-1px);
}

.hq-find-map-btn {
  border: 1px solid rgba(111, 196, 168, 0.45);
  background: rgba(111, 196, 168, 0.14);
  color: #b8ead8;
}

.hq-find-map-btn:hover {
  color: #e2fff4;
  border-color: rgba(143, 224, 196, 0.72);
  background: rgba(111, 196, 168, 0.24);
  transform: translateY(-1px);
}

.sq-detail-actions .hq-find-map-btn {
  margin-right: auto;
}

.step-header .hq-find-map-btn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.15rem;
}

.sq-detail-wiki-icon,
.sq-detail-youtube-icon {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}

.sq-traders {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.sq-traders::-webkit-scrollbar {
  height: 6px;
}

.sq-traders::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

.sq-trader-btn {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.sq-trader-btn.active {
  background: color-mix(in srgb, var(--sq-trader-color, var(--accent)) 16%, transparent);
  border-color: color-mix(in srgb, var(--sq-trader-color, var(--accent)) 52%, transparent);
  color: var(--sq-trader-color, var(--accent));
}

.sq-traders--icons {
  gap: 0.62rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  overflow-x: visible;
  width: 100%;
}

.sq-traders-group--pick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.62rem;
  min-width: 0;
}

.sq-traders--icons .sq-trader-btn--none {
  flex-shrink: 0;
}

.sq-traders--icons .sq-trader-btn--none:hover,
.sq-traders--icons .sq-trader-btn--none:focus-visible {
  z-index: 2;
  border-color: rgba(201, 79, 79, 0.55);
  color: #e07070;
}

.sq-traders--icons .sq-trader-btn--none.active {
  background: rgba(201, 79, 79, 0.16);
  border-color: rgba(201, 79, 79, 0.58);
  color: #e07070;
}

.sq-traders--icons .sq-trader-btn--none.active .sq-trader-btn-tip {
  border-color: rgba(201, 79, 79, 0.45);
  color: #e07070;
}

.sq-checklist-empty {
  margin: 0.5rem 0 0;
  text-align: center;
}

.sq-traders--icons .sq-trader-btn--all {
  position: relative;
  z-index: 1;
  min-width: 3.67rem;
  height: 3.67rem;
  padding: 0 0.7rem;
  border-radius: 12px;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sq-traders--icons .sq-trader-btn--all:hover,
.sq-traders--icons .sq-trader-btn--all:focus-visible {
  z-index: 2;
}

.sq-traders--icons .sq-trader-btn--all.active {
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.48);
  color: var(--accent);
}

.sq-traders--icons .sq-trader-btn--icon {
  position: relative;
  width: 3.67rem;
  height: 3.67rem;
  padding: 0;
  border-width: 3px;
  border-radius: 50%;
  border-color: color-mix(in srgb, var(--sq-trader-color, #7a8494) 38%, transparent);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sq-trader-color, #7a8494) 10%, rgba(10, 12, 16, 0.92)) 0%, rgba(10, 12, 16, 0.96) 100%);
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.sq-traders--icons .sq-trader-btn--icon:hover,
.sq-traders--icons .sq-trader-btn--icon:focus-visible {
  border-color: color-mix(in srgb, var(--sq-trader-color, #7a8494) 58%, transparent);
  transform: translateY(-1px);
  z-index: 2;
}

.sq-traders--icons .sq-trader-btn--icon.active {
  border-color: color-mix(in srgb, var(--sq-trader-color, var(--accent)) 72%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sq-trader-color, var(--accent)) 28%, transparent);
  background: color-mix(in srgb, var(--sq-trader-color, var(--accent)) 14%, rgba(10, 12, 16, 0.92));
}

.sq-trader-btn-icon {
  width: 2.89rem;
  height: 2.89rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sq-trader-btn-fallback {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--sq-trader-color, var(--text-muted));
  line-height: 1;
}

.sq-trader-btn-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.4rem);
  transform: translateX(-50%) translateY(4px);
  padding: 0.22rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.96);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.sq-trader-btn-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(10, 12, 16, 0.96);
}

.sq-traders--icons .sq-trader-btn--icon:hover .sq-trader-btn-tip,
.sq-traders--icons .sq-trader-btn--icon:focus-visible .sq-trader-btn-tip,
.sq-traders--icons .sq-trader-btn--all:hover .sq-trader-btn-tip,
.sq-traders--icons .sq-trader-btn--all:focus-visible .sq-trader-btn-tip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.sq-traders--icons .sq-trader-btn--icon.active .sq-trader-btn-tip {
  border-color: color-mix(in srgb, var(--sq-trader-color, var(--accent)) 45%, transparent);
  color: var(--sq-trader-color, var(--text));
}

.sq-quest-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 10rem;
  max-height: min(75.4vh, 806px);
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 0.65rem;
  padding: 0.45rem 0.4rem 0.45rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.sq-quest-list::-webkit-scrollbar {
  width: 8px;
}

.sq-quest-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

.sq-quest-row {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 4.35rem;
  padding: 0.68rem 0.8rem;
  border: 2px solid color-mix(in srgb, var(--sq-trader-color, #7a8494) 42%, transparent);
  border-radius: 10px;
  background: linear-gradient(
    105deg,
    rgba(10, 12, 16, 0.94) 0%,
    rgba(10, 12, 16, 0.84) 54%,
    color-mix(in srgb, var(--sq-trader-color, #7a8494) 24%, rgba(10, 12, 16, 0.78)) 100%
  );
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  overflow: hidden;
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.sq-quest-row-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.5;
}

.sq-quest-row-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(
    105deg,
    rgba(10, 12, 16, 0.82) 0%,
    rgba(10, 12, 16, 0.55) 52%,
    color-mix(in srgb, var(--sq-trader-color, #7a8494) 22%, rgba(10, 12, 16, 0.45)) 100%
  );
}

.sq-quest-row.has-quest-bg {
  background: rgba(10, 12, 16, 0.35);
}

.sq-quest-row.has-quest-bg .sq-quest-row-body {
  z-index: 2;
}

.sq-quest-row-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
  flex: 1;
  padding-right: 1.75rem;
}

.sq-quest-row-name {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.32;
  color: var(--text);
}

.sq-quest-row-trader {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--sq-trader-color, var(--text-muted));
}

.sq-quest-row-map {
  color: var(--text-muted);
  font-weight: 500;
}

.sq-quest-row-lock {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 7px;
  background: rgba(8, 10, 14, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

.sq-quest-lock-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.sq-quest-row:hover {
  border-color: color-mix(in srgb, var(--sq-trader-color, #7a8494) 62%, transparent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.sq-quest-row.is-active {
  border-color: var(--sq-trader-color, var(--accent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--sq-trader-color, var(--accent)) 35%, transparent);
}

.sq-quest-row.is-done {
  border-color: rgba(61, 154, 106, 0.48);
  background: linear-gradient(
    105deg,
    rgba(10, 12, 16, 0.92) 0%,
    rgba(61, 154, 106, 0.14) 100%
  );
}

.sq-quest-row.is-done .sq-quest-row-name {
  text-decoration: line-through;
  opacity: 0.88;
  color: #a8ddb8;
}

.sq-quest-row.is-done.is-active {
  border-color: rgba(61, 154, 106, 0.62);
  box-shadow: 0 0 0 1px rgba(61, 154, 106, 0.28);
}

.sq-quest-row.is-locked .sq-quest-row-name {
  color: #c8ced8;
}

.sq-quest-row.is-locked.has-quest-bg .sq-quest-row-bg {
  opacity: 0.35;
  filter: grayscale(0.4);
}

.sq-quest-row.is-locked:not(.is-active):hover {
  border-color: rgba(150, 160, 180, 0.35);
}

.sq-quest-row.is-available-override:not(.is-locked) {
  border-color: color-mix(in srgb, var(--sq-trader-color, #7a8494) 42%, #64a0dc 58%);
}

.sq-detail-img.is-dimmed {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.sq-chain-panel { margin-bottom: 0.65rem; }

.sq-flowchart-viewport {
  max-height: min(44vh, 440px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.14);
}

.sq-flowchart-track {
  padding: 0.65rem 0.7rem 0.75rem;
}

.sq-flowchart-track .sq-chart-node {
  width: 100%;
}

.sq-flowchart-track .sq-chart-node .cn-label {
  display: block;
  line-height: 1.35;
  word-break: break-word;
}

.sq-chain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sq-chain-head .sq-chain-title {
  margin: 0;
  flex: 1;
  text-align: center;
}

.sq-chain-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sq-chain-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sq-chain {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.sq-chain li button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-muted);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  font-size: 0.74rem;
}

.sq-chain li.is-current button {
  border-color: rgba(201, 162, 39, 0.45);
  color: var(--accent);
  font-weight: 600;
}

.sq-chain li:not(:last-child)::after {
  content: '→';
  margin-left: 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.sq-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'main toggles';
  align-items: start;
  gap: 0.65rem 0.75rem;
  min-width: 0;
}

.sq-detail-head--no-img {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'main toggles';
}

.sq-detail-img {
  grid-area: img;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.sq-detail-main {
  grid-area: main;
  min-width: 0;
}

.sq-detail-main h2 {
  margin: 0 0 0.25rem;
  font-size: 1.28rem;
  line-height: 1.28;
}

.sq-detail-main .tags {
  margin-top: 0;
}

.sq-detail-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-top: 0.35rem;
}

.sq-xp-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.32rem;
  padding: 0.38rem 0.72rem;
  border-radius: 9px;
  border: 1px solid rgba(201, 162, 39, 0.5);
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.26) 0%, rgba(201, 162, 39, 0.1) 100%);
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.12),
    0 4px 14px rgba(201, 162, 39, 0.14);
  flex-shrink: 0;
}

.sq-xp-badge.is-done {
  border-color: rgba(61, 154, 106, 0.45);
  background: linear-gradient(145deg, rgba(61, 154, 106, 0.22) 0%, rgba(61, 154, 106, 0.08) 100%);
  box-shadow:
    0 0 0 1px rgba(61, 154, 106, 0.1),
    0 4px 14px rgba(61, 154, 106, 0.1);
}

.sq-xp-value {
  font-size: 1.12rem;
  font-weight: 800;
  font-family: var(--mono, ui-monospace, monospace);
  line-height: 1;
  color: #f2dc82;
  letter-spacing: 0.02em;
}

.sq-xp-badge.is-done .sq-xp-value {
  color: #a8ddb8;
}

.sq-xp-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c9a227;
  line-height: 1;
}

.sq-xp-badge.is-done .sq-xp-label {
  color: #6fbf8f;
}

.sq-detail-wiki {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
}

.sq-detail-main .panel-note {
  margin: 0.35rem 0 0;
}

.sq-detail-toggles {
  grid-area: toggles;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
  flex-shrink: 0;
}

.sq-done-toggle.hq-complete-toggle {
  align-items: center;
}

.sq-available-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #9ec8ef;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.sq-detail.is-done::before {
  content: '';
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: min(36%, 7.5rem);
  height: min(36%, 7.5rem);
  opacity: 0.14;
  background: var(--hq-complete-watermark) center / contain no-repeat;
  pointer-events: none;
  z-index: 0;
}

.sq-detail.is-done > .sq-detail-hero,
.sq-detail.is-done > .sq-detail-body {
  position: relative;
  z-index: 1;
}

.sq-detail.is-done {
  border-color: rgba(61, 154, 106, 0.42);
  background: linear-gradient(145deg, rgba(61, 154, 106, 0.14) 0%, rgba(61, 154, 106, 0.05) 55%, rgba(12, 14, 18, 0.2) 100%);
  box-shadow: inset 0 1px 0 rgba(143, 212, 143, 0.1);
}

.sq-detail.is-done .sq-detail-main h2 {
  color: #b8e8c8;
}

.sq-detail.is-done .sq-detail-hero--has-bg .sq-detail-main h2 {
  color: #fff;
}

.sq-detail.is-done .sq-detail-hero--has-bg::after {
  background: linear-gradient(
    to top,
    rgba(22, 42, 32, 0.96) 0%,
    rgba(22, 42, 32, 0.62) 24%,
    rgba(22, 42, 32, 0.18) 50%,
    transparent 72%
  );
}

.hq-maps-quest-check {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background-color: rgba(8, 10, 12, 0.55);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.hq-maps-quest-check:hover:not(:disabled) {
  border-color: rgba(61, 154, 106, 0.55);
  box-shadow: 0 0 0 2px rgba(61, 154, 106, 0.14);
}

.hq-maps-quest-check:checked {
  border-color: #4caf7a;
  background-color: #3d9a6a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 5l3.5 3.5L11 1'/%3E%3C/svg%3E");
  box-shadow: 0 0 0 2px rgba(61, 154, 106, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hq-maps-quest-check:checked:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: saturate(0.75);
}

.hq-maps-quest-check:focus-visible {
  outline: 2px solid rgba(61, 154, 106, 0.65);
  outline-offset: 2px;
}

.sq-locked-banner {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(150, 160, 180, 0.22);
  background: rgba(255, 255, 255, 0.03);
  color: #b8beca;
}

.sq-detail.is-locked-detail {
  border-color: rgba(150, 160, 180, 0.22);
}

.tag-locked {
  color: #b8beca;
  border-color: rgba(150, 160, 180, 0.35);
}

.tag-available {
  color: #9ec8ef;
  border-color: rgba(100, 160, 220, 0.35);
}

.sq-ref-list li.is-blocking {
  color: #c8ced8;
}

.sq-ref-list li.is-blocking .sq-ref-meta {
  color: #d4a0a0;
}

.sq-ref-list li.is-blocking .btn-link {
  color: #d8dee8;
}

.sq-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sq-ref-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
  line-height: 1.4;
}

.sq-ref-meta {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--text-muted);
  text-transform: lowercase;
}

.sq-ref-meta::before {
  content: '·';
  margin-right: 0.35rem;
  opacity: 0.6;
}

.sq-ref-list--rewards li {
  align-items: baseline;
}

.sq-reward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.5rem;
}

.step-card .sq-block--rewards .sq-reward-grid {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  width: 100%;
}

.step-card .sq-reward-card--story {
  width: 100%;
  min-height: auto;
  align-items: stretch;
  justify-content: center;
}

.step-card .sq-reward-card--story .sq-reward-card-name {
  white-space: normal;
  text-align: center;
  width: 100%;
}

.sq-reward-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  min-height: 6.75rem;
  padding: 0.55rem 0.45rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%),
    rgba(0, 0, 0, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sq-reward-card--rep {
  --sq-trader-color: #7a8494;
  border-color: color-mix(in srgb, var(--sq-trader-color) 34%, rgba(255, 255, 255, 0.08));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--sq-trader-color) 14%, transparent) 0%, transparent 58%),
    rgba(0, 0, 0, 0.2);
}

.sq-reward-card-icon {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.sq-reward-card-icon--trader {
  padding: 0.35rem;
}

.sq-reward-card-img {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
  image-rendering: auto;
}

.sq-reward-card-img--empty {
  display: block;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.sq-reward-card-icon--trader .sq-trader-btn-icon,
.sq-reward-card-icon--trader .sq-trader-btn-fallback {
  width: 2.2rem;
  height: 2.2rem;
}

.sq-reward-card-qty {
  position: absolute;
  right: -0.35rem;
  bottom: -0.3rem;
  min-width: 1.35rem;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 39, 0.45);
  background: rgba(14, 15, 17, 0.92);
  color: #e0bc4a;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--mono);
  line-height: 1.2;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.sq-reward-card-body {
  width: 100%;
  min-width: 0;
  text-align: center;
}

.sq-reward-card-name,
.sq-reward-card .item-tip-trigger {
  display: block;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: #e8dcc0;
  border-bottom: none;
  cursor: help;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sq-reward-card .item-tip-trigger:hover,
.sq-reward-card .item-tip-trigger:focus-visible {
  color: #f0e4c8;
}

.sq-reward-card-meta {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  font-family: var(--mono);
  color: color-mix(in srgb, var(--sq-trader-color) 72%, #d8dee8);
}

.sq-reward-card--plain {
  justify-content: center;
}

.sq-unlock-grid {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sq-unlock-card {
  --sq-trader-color: #7a8494;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.55rem 0.5rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--sq-trader-color);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--sq-trader-color) 12%, transparent) 0%, transparent 42%),
    rgba(255, 255, 255, 0.025);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.sq-unlock-card:hover {
  border-color: color-mix(in srgb, var(--sq-trader-color) 42%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--sq-trader-color) 18%, transparent) 0%, transparent 48%),
    rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.sq-unlock-card:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sq-trader-color) 65%, #fff);
  outline-offset: 2px;
}

.sq-unlock-card-thumb {
  flex-shrink: 0;
  width: 4.5rem;
  height: 2.55rem;
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  background-color: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sq-unlock-card-thumb--empty {
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.22);
}

.sq-unlock-card-thumb--empty svg {
  width: 1.25rem;
  height: 1.25rem;
}

.sq-unlock-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.sq-unlock-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #eceff4;
  line-height: 1.25;
}

.sq-unlock-card-trader {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sq-unlock-card-trader .sq-trader-btn-icon,
.sq-unlock-card-trader .sq-trader-btn-fallback {
  width: 1rem;
  height: 1rem;
}

.sq-unlock-card-chevron {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  color: color-mix(in srgb, var(--sq-trader-color) 70%, #9aa3b2);
  opacity: 0.85;
}

.sq-block {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sq-block h3 {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sq-objectives {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.sq-objectives .sq-obj-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.78rem 0.88rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sq-objectives .sq-obj-row:has(.sq-obj-desc),
.sq-objectives .sq-obj-row:has(.sq-obj-detail) {
  align-items: flex-start;
}

.sq-objectives .sq-obj-row.optional {
  opacity: 0.9;
  border-style: dashed;
}

.sq-obj-num {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin-top: 0;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.22);
}

.sq-objectives .sq-obj-row:has(.sq-obj-desc) .sq-obj-num,
.sq-objectives .sq-obj-row:has(.sq-obj-detail) .sq-obj-num {
  margin-top: calc((0.94rem * 1.55 - 1.55rem) / 2);
}

.sq-obj-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sq-obj-desc,
.sq-obj-single {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
  color: var(--text);
}

.sq-obj-detail {
  margin: 0;
  padding: 0.52rem 0 0.52rem 0.9rem;
  border-left: 2px solid rgba(201, 162, 39, 0.32);
  font-size: 0.88rem;
  line-height: 1.5;
  color: #c4cad6;
}

.sq-objectives .fir {
  color: var(--warn);
  font-size: 0.82em;
  font-weight: 600;
}

.sq-obj-optional {
  align-self: flex-start;
  margin-top: 0.1rem;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #9aa3b2;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .hq-split,
  .hq-sidequests-layout,
  .hq-price-tables {
    grid-template-columns: 1fr;
  }

  .hideout-search-layout .hideout-search-main {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(var(--hideout-search-pane-max, min(48vh, 440px)) + var(--hideout-search-input-block, 4.35rem));
    max-height: none;
    grid-template-rows: auto auto minmax(0, var(--hideout-search-pane-max, min(48vh, 440px))) auto;
  }

  .hideout-search-layout .hideout-search-detail {
    grid-column: 1;
    grid-row: 4;
  }

  #sidequests-root.hq-page {
    min-height: 0;
  }

  .sq-sidebar {
    max-height: none;
  }

  .sq-quest-list {
    max-height: min(57.2vh, 624px);
    min-height: 8rem;
  }

  .sq-quest-row-body {
    padding-right: 1.5rem;
  }

  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.65rem 1rem;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .topbar-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: flex-start;
  }

  .topbar-subnav {
    grid-template-columns: 1fr;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .topbar-subnav-group {
    grid-column: 1;
    justify-self: stretch;
    justify-content: flex-start;
  }
}

/* ── Armoury (ammo + headsets) ── */
.hq-ammo-page,
.hq-armoury-page {
  max-width: 1400px;
}

.hq-ammo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.hq-ammo-caliber-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.hq-ammo-caliber-chip:hover {
  border-color: rgba(201, 162, 39, 0.35);
}

.hq-ammo-caliber-chip.is-hidden {
  opacity: 0.45;
  text-decoration: line-through;
}

.hq-ammo-caliber-mark {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--cal-color);
  flex-shrink: 0;
}

.hq-ammo-caliber-mark[data-shape="triangle"] {
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  border-radius: 0;
}

.hq-ammo-caliber-mark[data-shape="square"] {
  border-radius: 1px;
}

.hq-ammo-caliber-mark[data-shape="diamond"] {
  transform: rotate(45deg);
  border-radius: 1px;
}

.hq-ammo-legend-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.hq-ammo-plot-frame {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.hq-ammo-edge-arrow {
  opacity: 0.95;
  pointer-events: none;
}

.hq-ammo-point.is-clamped .hq-ammo-point-mark {
  stroke-dasharray: 2 1.5;
}

.hq-ammo-tip-offchart {
  margin-bottom: 0.5rem;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #9ec8ef;
  background: rgba(80, 140, 210, 0.1);
  border: 1px solid rgba(100, 160, 220, 0.22);
}

.hq-ammo-chart-panel {
  padding: 0.5rem 0.75rem 0.75rem;
  overflow-x: auto;
}

.hq-ammo-chart-wrap {
  position: relative;
  min-width: min(100%, 980px);
}

.hq-ammo-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.hq-ammo-grid {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.hq-ammo-grid.is-class {
  stroke: rgba(120, 200, 120, 0.42);
  stroke-width: 1.25;
}

.hq-ammo-grid.is-vertical {
  stroke: rgba(255, 255, 255, 0.04);
}

.hq-ammo-axis-label {
  fill: var(--text-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.hq-ammo-class-pill {
  fill: rgba(22, 32, 28, 0.94);
  stroke: rgba(120, 200, 120, 0.5);
  stroke-width: 1;
}

.hq-ammo-class-num {
  fill: rgba(140, 220, 150, 0.98);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.hq-ammo-class-pen {
  fill: rgba(180, 200, 185, 0.88);
  font-family: var(--mono);
  font-size: 8px;
}

.hq-ammo-axis-title {
  fill: var(--text-muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hq-ammo-point-hit {
  fill: transparent;
  cursor: pointer;
}

.hq-ammo-point-mark {
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 0.75;
  pointer-events: none;
}

.hq-ammo-point.is-active .hq-ammo-point-mark {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.25;
}

.hq-ammo-point-label {
  fill: #f0e6d2;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.72);
  stroke-width: 0.45px;
}

.hq-ammo-point-label.is-active {
  fill: var(--accent);
  font-size: 10px;
}

.hq-ammo-labels {
  pointer-events: none;
}

.hq-ammo-class-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.hq-ammo-class-btn.is-active,
.hq-ammo-reset.is-active {
  border-color: rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.12);
}

.hq-ammo-chart-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.hq-ammo-toolbar {
  justify-content: center;
  margin-top: 0.75rem;
}

.hq-ammo-count {
  margin: 0;
  text-align: center;
}

.hq-ammo-tooltip {
  position: fixed;
  z-index: 1200;
  width: min(320px, calc(100vw - 16px));
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 10px;
  background: rgba(12, 14, 18, 0.96);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.hq-ammo-tip-head {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.hq-ammo-tip-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.hq-ammo-tip-head-text {
  min-width: 0;
}

.hq-ammo-tip-kicker {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

.hq-ammo-tip-name {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  line-height: 1.35;
}

.hq-ammo-tip-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.hq-ammo-tip-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.hq-ammo-tip-section {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hq-ammo-tip-subhead {
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.hq-ammo-tip-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.74rem;
  padding: 0.08rem 0;
}

.hq-ammo-tip-row .is-yes {
  color: rgba(120, 200, 120, 0.95);
}

.hq-ammo-tip-row .is-low {
  color: #d4b86a;
}

.hq-ammo-tip-row .is-no {
  color: var(--text-muted);
}

.hq-ammo-tip-traders {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.76rem;
}

.hq-ammo-tip-traders .is-muted {
  list-style: none;
  margin-left: -1rem;
  color: var(--text-muted);
}

.hq-ammo-tip-no-traders {
  list-style: none;
  margin-left: -1rem;
  color: #e07070;
  font-weight: 700;
}

.hq-ammo-tip-flea {
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.hq-headsets-panel {
  position: relative;
  padding: 0.75rem;
  padding-bottom: 2.4rem;
}

.hq-headsets-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.hq-headsets-note {
  margin: 0;
  max-width: 42rem;
}

.hq-headsets-table-wrap {
  max-height: min(72vh, 760px);
  overflow: auto;
}

.hq-headsets-sheet {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

.hq-headsets-sheet th,
.hq-headsets-sheet td {
  padding: 0.55rem 0.65rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.hq-headsets-sheet th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-bg, rgba(18, 18, 20, 0.96));
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.hq-headsets-sheet th.num,
.hq-headsets-sheet td.num {
  text-align: center;
}

.hq-headsets-rank {
  width: 2rem;
  color: var(--accent);
  font-weight: 700;
}

.hq-headsets-icon-cell {
  width: 2.6rem;
}

.hq-headsets-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  display: block;
}

.hq-headsets-icon--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.hq-headsets-name-cell strong {
  font-size: 0.88rem;
}

.hq-headsets-traders {
  font-size: 0.78rem;
  min-width: 8rem;
  max-width: 14rem;
  white-space: normal;
}

.hq-headsets-traders.is-yes {
  color: #9fd49f;
}

.hq-headsets-traders.is-no {
  color: var(--text-muted);
}

.hq-headsets-stat {
  font-weight: 700;
  color: var(--accent);
}

.hq-headsets-foot {
  margin-top: 0.75rem;
  text-align: right;
}

.hq-headsets-count,
.hq-headsets-credit {
  margin: 0.35rem 0 0;
}

.hq-headsets-video {
  margin: 0.65rem 0 0;
}

.hq-headsets-video-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.hq-headsets-video-link:hover {
  text-decoration: underline;
}

.hq-headsets-table {
  width: 100%;
  min-width: 720px;
}

.hq-headsets-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-bg, rgba(18, 18, 20, 0.96));
}

.hq-headsets-sort {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hq-headsets-sort.is-active {
  color: var(--accent);
}

.hq-headsets-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 12rem;
}

.hq-headsets-fullname {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.hq-headsets-table td.num.is-best {
  color: #7fd67f;
  font-weight: 700;
}

.hq-headsets-count {
  margin: 0.55rem 0 0;
}

/* ── Maps ── */
body.route-maps .view-footer {
  display: none;
}

.hq-maps-page {
  max-width: none;
  width: 100%;
  height: calc(100vh - var(--topbar-height, 3.75rem) - 1rem);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0.5rem 1rem 0.75rem;
  box-sizing: border-box;
}

.hq-maps-header {
  flex-shrink: 0;
}

.hq-maps-layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  gap: 0.85rem;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-items: stretch;
}

.hq-maps-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 1rem 1rem 0.85rem;
}

.hq-maps-sidebar-head {
  margin-bottom: 0.65rem;
}

.hq-maps-map-picker {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.55rem;
}

.hq-maps-select {
  width: 100%;
  color-scheme: dark;
}

.hq-maps-select option {
  background: var(--bg-elevated);
  color: var(--text);
}

.hq-maps-count {
  margin: 0.4rem 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.45;
}

.hq-maps-filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.45rem 0 0.25rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.hq-maps-filter-toggle input {
  margin: 0;
  width: 1rem;
  height: 1rem;
}

.hq-maps-group-filter {
  margin: 0.35rem 0 0.5rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(14, 16, 20, 0.85);
}

.hq-maps-group-filter > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  list-style: none;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hq-maps-group-filter > summary::-webkit-details-marker {
  display: none;
}

.hq-maps-group-filter-count {
  color: rgba(122, 184, 255, 0.95);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.hq-maps-group-filter-list {
  display: grid;
  gap: 0.25rem;
  padding: 0 0.45rem 0.45rem;
}

.hq-maps-group-filter-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.88);
}

.hq-maps-group-filter-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--pin-color, var(--accent, #7ab8ff));
}

.hq-maps-needed-wrap {
  position: relative;
  margin: 0.25rem 0 0.55rem;
}

.hq-maps-needed-btn {
  width: 100%;
  justify-content: center;
}

.hq-maps-needed-popover {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  padding: 0.55rem;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(13, 15, 20, 0.96);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.hq-maps-needed-wrap:hover .hq-maps-needed-popover,
.hq-maps-needed-wrap:focus-within .hq-maps-needed-popover {
  display: block !important;
}

.hq-maps-needed-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.hq-maps-needed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.hq-maps-needed-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.hq-maps-needed-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.hq-maps-needed-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.74rem;
}

.hq-maps-needed-qty {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.7rem;
  color: var(--accent, #7ab8ff);
}

.hq-maps-filter-note {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  line-height: 1.45;
}

.hq-maps-quest-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.55rem 0.5rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.hq-maps-quest-list::-webkit-scrollbar {
  width: var(--scrollbar-size);
}

.hq-maps-quest-list::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

.hq-maps-quest-list::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.hq-maps-quest-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

.hq-maps-quest-list::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-active);
}

.hq-maps-quest-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.62rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  line-height: 1.4;
}

.hq-maps-quest-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.hq-maps-quest-row.is-active {
  border-color: rgba(255, 122, 122, 0.4);
  background: rgba(255, 122, 122, 0.08);
}

.hq-maps-quest-row.is-done {
  opacity: 1;
  border-color: rgba(61, 154, 106, 0.32);
  background: rgba(61, 154, 106, 0.09);
}

.hq-maps-quest-row.is-done .hq-maps-quest-name {
  text-decoration: line-through;
  color: #a8ddb8;
  opacity: 0.9;
}

.hq-maps-quest-row.is-done.is-active {
  border-color: rgba(61, 154, 106, 0.48);
  background: rgba(61, 154, 106, 0.14);
}

.hq-maps-quest-row.is-locked {
  opacity: 0.48;
}

.hq-maps-quest-check {
  margin-top: 0.15rem;
  accent-color: var(--accent);
}

.hq-maps-quest-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--quest-color, transparent);
  margin-top: 0.42rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hq-maps-quest-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.hq-maps-quest-name {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.hq-maps-quest-meta {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.hq-maps-toolbar {
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hq-maps-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.hq-maps-canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hq-maps-canvas {
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
}

.hq-maps-canvas .maplibregl-canvas {
  width: 100% !important;
  height: 100% !important;
}

.hq-maps-section-title {
  margin: 0.75rem 0 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.hq-maps-story-section[hidden] {
  display: none !important;
}

.hq-maps-story-list {
  flex: 0 1 auto;
  max-height: min(42vh, 24rem);
  margin-bottom: 0.55rem;
}

.hq-maps-story-row.is-active {
  border-left: 3px solid var(--quest-color, var(--accent));
  padding-left: calc(0.65rem - 3px);
}

.hq-maps-story-row.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hq-maps-story-icon-wrap {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}

.hq-maps-story-icon,
.hq-map-pin-story-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.hq-maps-story-icon--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--quest-color, var(--accent));
}

.hq-maps-story-row.is-disabled .hq-maps-story-icon-wrap {
  filter: grayscale(0.35);
  opacity: 0.85;
}

.hq-map-pin--story .hq-map-pin-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  overflow: hidden;
  background: var(--pin-color, var(--accent));
  border: 2px solid rgba(255, 255, 255, 0.92);
}

.hq-map-pin--story .hq-map-pin-story-img {
  border-radius: 50%;
  object-fit: cover;
}

.hq-maps-tip-badge.is-story {
  background: rgba(201, 162, 39, 0.2);
  color: #e8c96a;
}

.hq-maps-tip-foot {
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
}

.hq-maps-tip-kbd-hint {
  color: var(--text-muted);
}

.hq-maps-tip-kbd-hint kbd {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0.08rem 0.35rem;
  margin: 0 0.12rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: center;
}

.hq-maps-tip-foot a {
  color: var(--accent, #7ab8ff);
  text-decoration: none;
}

.hq-maps-tip-foot a:hover {
  text-decoration: underline;
}

.hq-map-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
  max-width: 200px;
}

.hq-map-pin-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 200px;
  padding: 0.22rem 0.5rem;
  border-radius: 5px;
  background: rgba(12, 14, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  pointer-events: none;
}

.hq-map-pin-icon {
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  background: var(--pin-color, var(--accent));
  border: 2px solid rgba(255, 255, 255, 0.92);
  transform: rotate(-45deg);
  flex-shrink: 0;
}

.hq-map-pin--member .hq-map-pin-label {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--pin-color, #7ab8ff) 60%, #ffffff);
}

.hq-map-pin--extract .hq-map-pin-label {
  border-color: color-mix(in srgb, var(--extract-color, #d0d5db) 70%, #ffffff);
  background: color-mix(in srgb, var(--extract-color, #d0d5db) 12%, rgba(10, 12, 16, 0.94));
}

.hq-map-pin--transit .hq-map-pin-label {
  border-color: rgba(255, 179, 71, 0.78);
  background: rgba(30, 18, 6, 0.94);
}

.hq-map-pin--name-hover .hq-map-pin-label {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.hq-map-pin--name-hover:hover .hq-map-pin-label,
.hq-map-pin--name-hover:focus-visible .hq-map-pin-label {
  opacity: 1;
  transform: translateY(0);
}

.hq-map-pin-icon--extract {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  transform: none;
  border: 2px solid color-mix(in srgb, var(--extract-color, #d0d5db) 80%, #ffffff);
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--extract-color, #d0d5db) 62%, transparent),
      color-mix(in srgb, var(--extract-color, #d0d5db) 62%, transparent)
    ),
    var(--extract-icon-url);
  background-size: 100% 100%, cover;
  background-position: center;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
  background-color: rgba(10, 12, 16, 0.35);
}

.hq-maps-extract-mode {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 50;
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 12, 16, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.hq-maps-extract-mode-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: rgba(230, 235, 242, 0.88);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.hq-maps-extract-mode-btn.is-active {
  background: rgba(122, 184, 255, 0.22);
  border-color: rgba(122, 184, 255, 0.65);
  color: #fff;
}

.hq-maps-pin-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: min(320px, calc(100vw - 24px));
  pointer-events: none;
}

.hq-maps-pin-tooltip.hidden {
  display: none !important;
}

.hq-maps-tip {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: var(--panel, #1a1d24);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  font-size: 0.78rem;
  line-height: 1.35;
}

.hq-maps-tip-head {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  margin-bottom: 0.35rem;
}

.hq-maps-tip-head--no-img {
  grid-template-columns: minmax(0, 1fr);
}

.hq-maps-tip-quest-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hq-maps-tip-head-text {
  min-width: 0;
}

.hq-maps-tip-quest {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  line-height: 1.25;
}

.hq-maps-tip-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.hq-maps-tip-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.45rem;
}

.hq-maps-tip-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hq-maps-tip-badge.is-done { color: #8fd48f; border-color: rgba(143, 212, 143, 0.35); }
.hq-maps-tip-badge.is-locked { color: #d4b86a; border-color: rgba(212, 184, 106, 0.35); }
.hq-maps-tip-badge.is-opt { color: var(--text-muted); }
.hq-maps-tip-badge.is-kappa { color: #c89bff; border-color: rgba(200, 155, 255, 0.35); }

.hq-maps-tip-section {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hq-maps-tip-subhead {
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hq-maps-tip-grid {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.hq-maps-tip-grid dt {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin: 0;
}

.hq-maps-tip-grid dd {
  margin: 0.05rem 0 0;
}

.hq-maps-tip-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.74rem;
}

.hq-maps-tip-list .is-muted {
  list-style: none;
  margin-left: -1rem;
  color: var(--text-muted);
}

.hq-maps-tip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  vertical-align: middle;
}

.hq-maps-tip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.hq-maps-tip-fir {
  color: #8fd48f;
  font-weight: 600;
}

.hq-maps-tip-or {
  color: var(--text-muted);
}

.hq-maps-tip-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  white-space: pre-wrap;
}

.hq-maps-tip-note--strong {
  font-weight: 600;
  color: var(--text);
}

.hq-maps-tip-meta-lines {
  margin: 0.35rem 0 0;
  padding-left: 0.65rem;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.hq-maps-tip-meta-line {
  margin: 0.2rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text);
}

.hq-maps-tip-meta-line:first-child {
  margin-top: 0;
}

.hq-maps-tip-meta-line strong {
  font-weight: 600;
}

.hq-maps-tip-screenshot {
  width: 100%;
  max-height: 160px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
}

@media (max-width: 900px) {
  .hq-maps-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(200px, 35vh) minmax(280px, 1fr);
  }

  .hq-maps-page {
    height: auto;
    min-height: calc(100vh - var(--topbar-height, 3.75rem) - 1rem);
  }

  .hq-maps-canvas-wrap {
    min-height: 320px;
  }
}

/* ── Quest Items tab ── */
.sq-quest-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.sq-qi-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 0.95rem;
}

.sq-qi-toolbar-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 0.85rem;
}

.sq-qi-toolbar .sq-qi-search {
  margin: 0;
  flex: 1 1 14rem;
  min-width: 0;
}

.sq-qi-level-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sq-qi-level-wrap input {
  width: 4.25rem;
  text-align: center;
  font: inherit;
  font-size: 0.82rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.38rem 0.45rem;
}

.sq-qi-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}

.sq-qi-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sq-qi-select-wrap select {
  font: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.38rem 0.55rem;
  font-size: 0.82rem;
}

.sq-qi-stats {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.sq-qi-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sq-qi-section-title {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.sq-qi-section--collector .sq-qi-section-title {
  color: var(--accent);
}

.sq-qi-section-desc {
  margin: -0.35rem 0 0.55rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.sq-qi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.62rem;
  align-items: stretch;
}

.sq-qi-grid > .sq-qi-card {
  align-self: stretch;
}

.sq-qi-card {
  position: relative;
  display: grid;
  grid-template-columns: 2.85rem minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.35rem 0.55rem;
  align-items: start;
  min-height: 7.35rem;
  height: 100%;
  padding: 0.68rem 0.72rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  min-width: 0;
  box-sizing: border-box;
}

.sq-qi-card.is-complete {
  border-color: rgba(61, 154, 106, 0.28);
  background: rgba(61, 154, 106, 0.06);
}

.sq-qi-card.is-complete .sq-qi-name,
.sq-qi-card.is-complete .sq-qi-choice-label {
  color: #a8c4b0;
}

.sq-qi-card:hover,
.sq-qi-card:focus-within {
  z-index: 30;
}

.sq-qi-card:hover .sq-qi-popover,
.sq-qi-card:focus-within .sq-qi-popover {
  display: block;
}

.sq-qi-icon {
  grid-column: 1;
  grid-row: 1;
  width: 2.85rem;
  height: 2.85rem;
  object-fit: contain;
}

.sq-qi-icon--empty {
  display: block;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sq-qi-body {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  align-self: stretch;
}

.sq-qi-badges {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.28rem;
  min-height: 1.35rem;
}

.sq-qi-card-footer {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  margin-top: auto;
  padding-top: 0.45rem;
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sq-qi-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.sq-qi-badge--fir {
  color: #f0c878;
  background: rgba(201, 162, 39, 0.14);
  border-color: rgba(201, 162, 39, 0.28);
}

.sq-qi-badge--kappa {
  color: #9ec8ef;
  background: rgba(74, 143, 212, 0.14);
  border-color: rgba(74, 143, 212, 0.28);
}

.sq-qi-badge--done {
  color: #a8ddb8;
  background: rgba(61, 154, 106, 0.14);
  border-color: rgba(61, 154, 106, 0.28);
}

.sq-qi-badge--choice {
  color: #d8c4f0;
  background: rgba(142, 108, 198, 0.16);
  border-color: rgba(142, 108, 198, 0.3);
}

.sq-qi-card.is-choice .sq-qi-name {
  line-height: 1.3;
}

.sq-qi-choice-label {
  color: var(--accent);
}

.sq-qi-name {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  font-weight: 600;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  height: calc(2 * 1.35 * 0.84rem);
  min-height: calc(2 * 1.35 * 0.84rem);
}

.sq-qi-qty {
  display: grid;
  grid-template-columns: 1.45rem 2.35rem 0.65rem 2.15rem 1.45rem;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  width: max-content;
  flex-shrink: 0;
}

.sq-qi-qty-btn {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.sq-qi-qty-btn:hover:not(:disabled) {
  border-color: rgba(201, 162, 39, 0.35);
  color: var(--accent);
}

.sq-qi-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sq-qi-qty-input {
  width: 100%;
  min-width: 0;
  text-align: center;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1.45rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0;
  box-sizing: border-box;
  appearance: textfield;
  -moz-appearance: textfield;
}

.sq-qi-qty-input::-webkit-outer-spin-button,
.sq-qi-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sq-qi-qty-sep,
.sq-qi-qty-need {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.sq-qi-qty-need {
  color: var(--accent);
  font-weight: 700;
}

.sq-qi-quest-done {
  margin: 0;
  font-size: 0.68rem;
  color: #a8ddb8;
  text-align: center;
}

.sq-qi-popover {
  display: none;
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  top: calc(100% + 0.35rem);
  z-index: 1;
  padding: 0.55rem 0.62rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 16, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.sq-qi-pop-foot {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sq-qi-pop-title {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.sq-qi-pop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  max-height: 10rem;
  overflow: auto;
}

.sq-qi-pop-row {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.sq-qi-pop-row.is-done {
  opacity: 0.7;
}

.sq-qi-pop-row.is-out-of-level {
  opacity: 0.45;
}

.sq-qi-pop-level {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-muted);
}

.sq-qi-pop-choice {
  color: #d8c4f0;
  font-weight: 700;
}

.sq-qi-pop-obj {
  display: block;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.sq-qi-pop-alt-list {
  list-style: none;
  margin: 0 0 0.45rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem 0.45rem;
  max-height: 6.5rem;
  overflow: auto;
}

.sq-qi-pop-alt {
  font-size: 0.72rem;
}

.sq-qi-pop-alt--more {
  color: var(--text-muted);
  font-size: 0.68rem;
}

.sq-qi-pop-quest {
  font: inherit;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}

.sq-qi-pop-quest:hover {
  color: var(--accent);
}

.sq-qi-pop-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.sq-qi-pop-kappa {
  color: #9ec8ef;
  font-weight: 600;
}

.sq-qi-empty {
  margin: 0.5rem 0 0;
}

/* ── Loot Tiers (Dashboard) ── */

.lt-intro {
  margin-bottom: 0.65rem;
}

.lt-root {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.lt-tier-section {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.lt-tier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lt-tier-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.lt-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0 0.35rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.lt-tier-range {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.lt-tier-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.lt-tier--s .lt-tier-badge {
  color: #ffe8a8;
  background: rgba(201, 162, 39, 0.22);
  border: 1px solid rgba(201, 162, 39, 0.45);
}

.lt-tier--a .lt-tier-badge {
  color: #c8e4ff;
  background: rgba(74, 143, 212, 0.2);
  border: 1px solid rgba(74, 143, 212, 0.38);
}

.lt-tier--b .lt-tier-badge {
  color: #c8f0d0;
  background: rgba(61, 154, 106, 0.18);
  border: 1px solid rgba(61, 154, 106, 0.35);
}

.lt-tier--c .lt-tier-badge {
  color: #e0d4f8;
  background: rgba(142, 108, 198, 0.18);
  border: 1px solid rgba(142, 108, 198, 0.32);
}

.lt-tier--d .lt-tier-badge {
  color: #d0d4dc;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.lt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.45rem;
}

body.route-hideout #hideout-root.hideout-tab-loottiers .lt-grid {
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
  gap: 0.4rem;
}

.lt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  padding: 0.5rem 0.35rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  text-align: center;
  min-width: 0;
  cursor: default;
  outline: none;
}

.lt-card:hover,
.lt-card:focus-within {
  z-index: 20;
  border-color: rgba(201, 162, 39, 0.32);
  background: rgba(255, 255, 255, 0.05);
}

.lt-card:hover .lt-popover,
.lt-card:focus-within .lt-popover {
  display: block;
}

.lt-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 5rem;
}

.lt-icon {
  width: 4.75rem;
  height: 4.75rem;
  object-fit: contain;
}

.lt-icon--empty {
  display: block;
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.lt-name {
  margin: 0;
  width: 100%;
  font-size: 0.72rem;
  line-height: 1.25;
  font-weight: 600;
  color: var(--accent);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.lt-popover {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 0.35rem);
  transform: translateX(-50%);
  z-index: 1;
  width: max-content;
  min-width: 11.5rem;
  max-width: min(16rem, 72vw);
  padding: 0.55rem 0.62rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 12, 16, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  text-align: left;
  pointer-events: none;
}

.lt-pop-name {
  margin: 0 0 0.4rem;
  font-size: 0.76rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--text);
}

.lt-pop-grid {
  display: grid;
  gap: 0.28rem;
  margin: 0;
}

.lt-pop-grid > div {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.35rem;
  align-items: baseline;
}

.lt-pop-grid dt {
  margin: 0;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.lt-pop-grid dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text);
}

.lt-pop-highlight {
  color: #a8ddb8;
  font-weight: 700;
}

.lt-pop-source--trader {
  color: #9ec8ef;
}

.lt-pop-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-weight: 800;
}

.lt-pop-tier--s { color: #ffe8a8; background: rgba(201, 162, 39, 0.2); }
.lt-pop-tier--a { color: #c8e4ff; background: rgba(74, 143, 212, 0.2); }
.lt-pop-tier--b { color: #c8f0d0; background: rgba(61, 154, 106, 0.18); }
.lt-pop-tier--c { color: #e0d4f8; background: rgba(142, 108, 198, 0.18); }
.lt-pop-tier--d { color: #d0d4dc; background: rgba(255, 255, 255, 0.1); }

.lt-pop-wiki {
  margin: 0.4rem 0 0;
  font-size: 0.68rem;
}

.lt-pop-wiki a {
  color: var(--accent);
  text-decoration: none;
}

.lt-pop-wiki a:hover {
  text-decoration: underline;
}
