@font-face {
  font-family: "Bender";
  src:
    url("../assets/fonts/Bender-Bold.woff2") format("woff2"),
    local("Bender Bold"),
    local("Bender-Bold");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0e0f11;
  --bg-elevated: #16181d;
  --bg-card: #1a1d24;
  --border: #2a3038;
  --text: #e8eaed;
  --text-muted: #9aa3ad;
  --accent: #c9a227;
  --accent-dim: #8a7120;
  --success: #3d9a6a;
  --warn: #d4844a;
  --danger: #c94f4f;
  --choice: #6b8fd4;
  --optional: #7a8490;
  --line: #3a424d;
  --radius: 10px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --brand: "Bender", "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --scrollbar-size: 9px;
  --scrollbar-track: rgba(255, 255, 255, 0.04);
  --scrollbar-thumb: rgba(154, 163, 173, 0.28);
  --scrollbar-thumb-hover: rgba(201, 162, 39, 0.55);
  --scrollbar-thumb-active: rgba(201, 162, 39, 0.72);
  --topbar-main-height: 3.75rem;
  --topbar-height: var(--topbar-main-height);
  --scroll-offset-gap: 0.75rem;
  --hq-complete-watermark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='4' y='4' width='56' height='56' rx='10' fill='none' stroke='%233d9a6a' stroke-width='3.5'/%3E%3Cpath fill='none' stroke='%233d9a6a' stroke-width='4.5' stroke-linecap='round' stroke-linejoin='round' d='M18 34l10 10 18-22'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

/* Custom scrollbars — thin, dark, gold on hover */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

*::-webkit-scrollbar-thumb:active {
  background-color: var(--scrollbar-thumb-active);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(201, 162, 39, 0.08), transparent),
    linear-gradient(180deg, #0e0f11 0%, #12141a 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 28px;
}

a { color: var(--accent); }
a:hover { color: #e0bc4a; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.hidden { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex;
  flex-direction: column;
  background: rgba(14, 15, 17, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  width: 100%;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  min-height: var(--topbar-main-height);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem 1rem;
}

.topbar-brand {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
  min-width: 0;
}

.topbar-brand-mark {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.topbar-brand-title {
  font-family: var(--brand);
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}

.topbar-brand:hover .topbar-brand-title { color: #e0bc4a; }

.topbar-logo {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.topbar-logo:hover { color: #e0bc4a; }

.brand-tag {
  display: inline-block;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-dim);
  padding: 0.15rem 0.45rem; border-radius: 4px; margin-bottom: 0.35rem;
}

.brand h1 { margin: 0; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.brand h1 em { color: var(--accent); font-style: normal; }
.subtitle { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.9rem; }

.topbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
  align-items: center;
  min-height: 2.2rem;
  min-width: 0;
}

.topbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.topbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.topbar-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.topbar-control.hidden { display: none; }

.topbar-control-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.topbar-select-wrap { cursor: pointer; }

.topbar-select {
  font: inherit;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.5rem 2rem 0.5rem 0.65rem;
  font-size: 0.84rem;
  min-width: 9.5rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa3ad' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
}

.topbar-select:focus {
  outline: 2px solid var(--accent-dim);
  border-color: var(--accent-dim);
}

.topbar-select-chapter {
  min-width: 11rem;
  font-weight: 500;
}

.search-wrap input {
  width: min(320px, 42vw);
  background: var(--bg-elevated); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 0.55rem 0.75rem;
  font: inherit;
}
.search-wrap input:focus { outline: 2px solid var(--accent-dim); border-color: var(--accent-dim); }

.btn {
  font: inherit; cursor: pointer; border-radius: 8px;
  padding: 0.55rem 0.85rem; border: 1px solid transparent;
}
.btn-secondary { background: var(--bg-card); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
}

.btn-icon .icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
}

.progress-fill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.35s ease;
}

.briefcase-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.briefcase-opt {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
  white-space: nowrap;
}
.briefcase-opt:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.briefcase-opt.active {
  background: rgba(201, 162, 39, 0.15);
  color: var(--accent);
  font-weight: 600;
}
.briefcase-opt[data-briefcase="prapor"].active {
  background: rgba(212, 132, 74, 0.12);
  color: #e8a878;
}

.req-briefcase {
  margin-bottom: 0.85rem;
}

.req-briefcase-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.req-briefcase .briefcase-toggle {
  display: flex;
  margin-top: 0.65rem;
  width: 100%;
}

.req-briefcase .briefcase-opt {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.5rem;
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: normal;
}

.layout {
  max-width: min(1200px, 100%);
  margin: 0;
  display: grid; grid-template-columns: 320px 1fr; gap: 1.25rem;
  padding: 1.25rem;
  width: 100%;
}

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

.skip-banner {
  background: rgba(61, 154, 106, 0.08);
  border: 1px dashed rgba(61, 154, 106, 0.45);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.skip-banner h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--success);
}
.skip-banner p { margin: 0 0 0.65rem; color: var(--text-muted); font-size: 0.88rem; }
.skip-banner details { font-size: 0.85rem; color: var(--text-muted); }
.skip-banner summary { cursor: pointer; color: var(--text); margin-bottom: 0.35rem; }
.skip-banner ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.skip-banner li { margin: 0.2rem 0; }

.skip-nav-link {
  border-left: 3px solid var(--success) !important;
  opacity: 0.9;
  font-size: 0.82rem;
}

.route-tab-badge {
  font-size: 0.65rem;
  opacity: 0.75;
  margin-left: 0.25rem;
}

body.dock-open .app-body,
body.dock-open .sq-app-body,
body.dock-open .kappa-app-body {
  margin-right: var(--dock-width, 300px);
}

body.dock-collapsed .app-body,
body.dock-collapsed .sq-app-body,
body.dock-collapsed .kappa-app-body {
  margin-right: var(--dock-collapsed-width, 44px);
}

@media (max-width: 1100px) {
  .topbar-inner { padding: 0.65rem 1rem; }
  .topbar-subnav { padding-left: 1rem; padding-right: 1rem; }
  .topbar-brand-title { font-size: 0.92rem; }
  .search-wrap input { width: min(220px, 38vw); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; position: static; max-height: none; }
  body.dock-open .app-body,
  body.dock-collapsed .app-body,
  body.dock-open .sq-app-body,
  body.dock-collapsed .sq-app-body,
  body.dock-open .kappa-app-body,
  body.dock-collapsed .kappa-app-body { margin-right: 0; }
  .chart-dock {
    top: auto !important;
    bottom: 0 !important;
    height: 55vh !important;
    width: 100% !important;
    border-left: none !important;
    border-top: 1px solid var(--border);
  }
  .chart-dock.collapsed {
    height: 44px !important;
    overflow: hidden;
  }
  .dock-expand-tab { display: none !important; }
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-height) + 0.5rem);
  align-self: start;
  max-height: calc(100vh - var(--topbar-height) - 1rem);
  overflow-y: auto;
}

.sidebar-section {
  padding: 0;
  overflow: hidden;
}

/* Story / Kappa — sidebar panel watermark icon */
.sidebar-section--chapter-nav.has-chapter-icon,
.sidebar-section--kappa-nav.has-chapter-icon {
  position: relative;
  isolation: isolate;
}

.sidebar-section--chapter-nav.has-chapter-icon::before,
.sidebar-section--kappa-nav.has-chapter-icon::before {
  content: '';
  position: absolute;
  right: -6%;
  bottom: -10%;
  width: min(78%, 12rem);
  aspect-ratio: 1;
  background-image: var(--story-chapter-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}

.sidebar-section--chapter-nav.has-chapter-icon::after,
.sidebar-section--kappa-nav.has-chapter-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 70% at 88% 92%,
    color-mix(in srgb, var(--story-chapter-accent, var(--accent)) 14%, transparent),
    transparent 68%
  );
  pointer-events: none;
  z-index: 0;
}

.sidebar-section--chapter-nav.has-chapter-icon .sidebar-section-static-head,
.sidebar-section--chapter-nav.has-chapter-icon .sidebar-section-body,
.sidebar-section--kappa-nav.has-chapter-icon .sidebar-section-static-head,
.sidebar-section--kappa-nav.has-chapter-icon .sidebar-section-body {
  position: relative;
  z-index: 1;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: left;
}

.sidebar-section-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.sidebar-section-toggle:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.45);
  outline-offset: -2px;
}

.sidebar-section-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-section-chevron {
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.sidebar-section.is-collapsed .sidebar-section-chevron {
  transform: rotate(-90deg);
}

.sidebar-section-body {
  padding: 0 1rem 1rem;
}

.sidebar-section.is-collapsed .sidebar-section-body {
  display: none;
}

.sidebar-section--static .sidebar-section-body {
  display: block;
}

.sidebar-section-static-head {
  padding: 0.75rem 1rem;
}

.sidebar-section-static-head .sidebar-section-title {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-section-head {
  display: flex;
  align-items: stretch;
}

.sidebar-section-head .sidebar-section-toggle {
  flex: 1;
  min-width: 0;
}

.sidebar-section-action {
  align-self: center;
  margin-right: 0.45rem;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.sidebar-nav .brand-tag { margin-bottom: 0.4rem; }

.sidebar-nav h1 {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
  transition: color 0.2s ease;
}

.sidebar-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.55rem;
}

.sidebar-select-wrap.hidden,
.sidebar-ending-path-wrap.hidden { display: none; }

.sidebar-ending-path-wrap {
  margin-top: 0.15rem;
}

.sidebar-select-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-select {
  font: inherit;
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.55rem 2rem 0.55rem 0.65rem;
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aa3ad' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
}

.sidebar-select:focus {
  outline: 2px solid var(--accent-dim);
  border-color: var(--accent-dim);
}

.panel-profile {
  border-color: rgba(201, 162, 39, 0.25);
}

.panel-profile h2 {
  margin-bottom: 0.65rem;
}

.profile-progress { margin-bottom: 0.75rem; }

.profile-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.profile-progress .progress-track {
  height: 5px;
  background: var(--bg-elevated);
  border-radius: 99px;
  overflow: hidden;
}

.profile-auth { margin-bottom: 0.65rem; }

.profile-auth-guest.hidden,
.profile-auth-user.hidden { display: none; }

.profile-email {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  word-break: break-all;
}

.profile-display-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.profile-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.35rem;
}

.profile-email-inline {
  font-size: 0.78rem;
  color: var(--text-muted);
  word-break: break-all;
}

.profile-level-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.35);
  color: var(--accent);
}

.profile-level-badge.hidden { display: none; }

.profile-sync-note { margin: 0 0 0.5rem; }

.profile-reset {
  width: 100%;
  margin-top: 0.25rem;
}

.progress-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
}

.progress-updated {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.85;
  text-align: right;
}

#panel-guide[hidden],
.sidebar-section[data-sidebar-section="guide"] {
  display: none !important;
}

.sidebar-story-branches {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-story-branches .req-choice {
  margin: 0;
}

.sidebar-briefcase-status {
  margin-top: 0.15rem;
}

.sidebar-briefcase-status-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
}

.sidebar-briefcase-status-tag.is-kept {
  color: #e8c547;
  background: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.32);
}

.sidebar-briefcase-status-tag.is-prapor {
  color: #e8a878;
  background: rgba(212, 132, 74, 0.14);
  border: 1px solid rgba(212, 132, 74, 0.32);
}

.sidebar-briefcase-status-tag.is-pending {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.panel-savior, .panel-guide {
  border-color: rgba(201, 162, 39, 0.35);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.06) 0%, var(--bg-elevated) 40%);
}

.req-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.req-block + .req-block { margin-top: 1rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }

.req-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
}

.req-list li {
  margin-bottom: 0.55rem;
  line-height: 1.45;
}

.req-list li strong { display: block; color: var(--text); font-size: 0.84rem; }
.req-list li span { color: var(--text-muted); }

.req-compact li strong { display: inline; }
.req-compact li strong::after { content: ' — '; color: var(--text-muted); font-weight: 400; }

.req-critical { border-left: 3px solid var(--danger); padding-left: 0.55rem; }
.req-important { border-left: 3px solid var(--warn); padding-left: 0.55rem; }

.req-choices { display: flex; flex-direction: column; gap: 0.65rem; }

.req-choice {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font-size: 0.8rem;
}

.req-choice.req-critical { border-color: rgba(201, 79, 79, 0.4); }
.req-choice.req-important { border-color: rgba(212, 132, 74, 0.35); }

.req-choice header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.84rem;
}

.req-choice-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed rgba(201, 162, 39, 0.4);
}
.req-choice-link:hover { color: var(--accent); }

.req-choice-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: rgba(201, 79, 79, 0.15);
  color: #efb0b0;
}

.req-choice.req-important .req-choice-badge {
  background: rgba(212, 132, 74, 0.15);
  color: #e8c4a8;
}

.req-do, .req-avoid, .req-result {
  margin: 0.25rem 0 0;
  line-height: 1.4;
  color: var(--text-muted);
}

.req-do span, .req-avoid span {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  min-width: 2.5rem;
}

.req-do span { color: var(--success); }
.req-avoid span { color: var(--danger); }

.req-result {
  font-size: 0.75rem;
  font-style: italic;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.req-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}

.req-item-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.4;
}

.req-item-list .fir {
  font-size: 0.65rem;
  color: var(--warn);
  font-style: normal;
  margin-left: 0.25rem;
}

.req-item-note {
  display: block;
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-top: 0.15rem;
}

.req-check li {
  padding-left: 1.1rem;
  position: relative;
}

.req-check li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent-dim);
}

.req-sources {
  margin: 0.85rem 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.req-sources a { color: var(--text-muted); }
.req-sources a:hover { color: var(--accent); }

.panel {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem;
}
.panel h2 {
  margin: 0 0 0.65rem; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
}
.panel-note { margin: 0 0 0.65rem; font-size: 0.8rem; color: var(--text-muted); }
.panel-warn { border-color: rgba(212, 132, 74, 0.35); }

.step-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding: 0 0.25rem 0.5rem;
}

.step-nav a {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: normal;
  word-break: break-word;
  text-align: left;
}

.step-nav a:hover,
.step-nav a.active {
  background: var(--bg-card);
  border-color: var(--border);
}

.step-nav a.done { opacity: 0.65; }
.step-nav a.done .jump-label { text-decoration: line-through; color: var(--text-muted); }
.step-nav a.is-savior-nav {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.06);
}
.step-nav a.is-savior-nav .jump-num {
  color: var(--accent);
}
.step-nav a.is-savior-nav .jump-label::after {
  content: ' ★';
  color: var(--accent);
  font-size: 0.72rem;
}

.jump-num {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.22);
  min-width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  margin-top: 0.05rem;
}

.jump-label {
  flex: 1;
  min-width: 0;
}

.item-checklist {
  list-style: none; margin: 0; padding: 0;
  max-height: 360px; overflow: auto; font-size: 0.82rem;
}
.item-checklist li {
  display: flex; gap: 0.45rem; align-items: flex-start;
  padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.item-checklist input { margin-top: 0.2rem; accent-color: var(--accent); }
.item-checklist .qty { color: var(--accent); font-family: var(--mono); min-width: 2rem; }
.item-checklist .fir { color: var(--warn); font-size: 0.72rem; }

.lock-list { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; color: var(--text-muted); }
.lock-list li { margin-bottom: 0.45rem; }

.flow { position: relative; }

.step-card {
  position: relative;
  scroll-margin-top: calc(var(--topbar-height) + var(--scroll-offset-gap));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem 0.7rem;
  transition: border-color 0.2s, opacity 0.2s;
  isolation: isolate;
}

.story-chapter-chart {
  margin-bottom: 0.85rem;
  padding: 0.9rem 1rem 1rem;
  border: 1px solid rgba(107, 143, 212, 0.35);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(107, 143, 212, 0.08) 0%, var(--bg-card) 100%);
}

.story-chapter-chart-head {
  margin-bottom: 0.7rem;
}

.story-chapter-chart-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.story-chapter-chart-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  color: #e8edf2;
}

.story-chapter-chart-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.story-chapter-chart-figure {
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.story-chapter-chart-img {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  border-radius: 6px;
  cursor: zoom-in;
}

.step-card.has-trader-watermark {
  overflow: hidden;
}

.step-card.has-trader-watermark::after {
  content: '';
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 7.25rem;
  height: 7.25rem;
  background-image: var(--step-trader-icon);
  background-repeat: no-repeat;
  background-position: top right;
  background-size: contain;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  filter: saturate(0.88);
  -webkit-mask-image:
    linear-gradient(to top, transparent 0%, #000 46%),
    linear-gradient(to right, transparent 0%, #000 46%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to top, transparent 0%, #000 46%),
    linear-gradient(to right, transparent 0%, #000 46%);
  mask-composite: intersect;
}

.step-card.has-trader-watermark:not([style*='--step-trader-icon'])::after {
  display: none;
}

.step-card.done.has-trader-watermark::after {
  opacity: 0.11;
}

.step-card.has-trader-watermark .step-detail-head,
.step-card.has-trader-watermark .step-detail-body {
  position: relative;
  z-index: 1;
}

.step-card.done {
  border-color: rgba(61, 154, 106, 0.42);
  background: linear-gradient(145deg, rgba(61, 154, 106, 0.16) 0%, rgba(61, 154, 106, 0.06) 55%, var(--bg-card) 100%);
  box-shadow: inset 0 1px 0 rgba(143, 212, 143, 0.1);
}

.step-card.done::before {
  content: '';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: min(38%, 6.5rem);
  height: min(38%, 6.5rem);
  opacity: 0.13;
  background: var(--hq-complete-watermark) center / contain no-repeat;
  pointer-events: none;
  z-index: 0;
}

.step-card.done .step-header,
.step-card.done .step-body,
.step-card.done .step-detail-head,
.step-card.done .step-detail-body {
  position: relative;
  z-index: 1;
}

.step-card.done .step-title-wrap h3,
.step-card.done .step-head-main h3,
.step-card.done .step-detail-heading h3,
.step-card.done .step-title {
  color: #b8e8c8;
}
.step-card.optional { border-style: dashed; border-color: var(--optional); }
.step-card.is-choice { border-color: rgba(107, 143, 212, 0.45); }
.step-card.is-critical { border-color: rgba(201, 79, 79, 0.55); box-shadow: 0 0 0 1px rgba(201, 79, 79, 0.15); }
.step-card.is-critical .step-num { background: var(--danger); color: #fff; }
.step-card.is-highlight-danger {
  background: linear-gradient(145deg, rgba(201, 79, 79, 0.34) 0%, rgba(140, 45, 45, 0.24) 55%, rgba(110, 32, 32, 0.18) 100%);
  border-color: rgba(201, 79, 79, 0.72);
  box-shadow: 0 0 0 1px rgba(201, 79, 79, 0.28);
}
.step-card.is-highlight-danger .step-num {
  background: var(--danger);
  color: #fff;
}
.step-card.is-highlight-danger.done {
  background: linear-gradient(145deg, rgba(61, 154, 106, 0.2) 0%, rgba(201, 79, 79, 0.22) 55%, rgba(110, 32, 32, 0.16) 100%);
}
.step-card.is-savior-needed {
  border-color: rgba(201, 162, 39, 0.45);
  box-shadow: inset 3px 0 0 rgba(201, 162, 39, 0.75);
}
.step-card.is-savior-needed .step-num {
  background: rgba(201, 162, 39, 0.22);
  color: var(--accent);
}
.critical-banner {
  display: flex; align-items: flex-start; gap: 0.5rem;
  background: rgba(201, 79, 79, 0.12); border: 1px solid rgba(201, 79, 79, 0.35);
  border-radius: 8px; padding: 0.65rem 0.75rem; margin-bottom: 0.75rem;
  font-size: 0.88rem;
}
.critical-banner strong { color: #f0a0a0; }
.critical-banner--path {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}
.critical-banner--grid {
  display: block;
  padding: 0.7rem 0.8rem;
}
.critical-banner-head {
  margin-bottom: 0.55rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(201, 79, 79, 0.25);
}
.critical-banner-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #f0a0a0;
  letter-spacing: 0.02em;
}
.critical-banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.critical-banner-cell {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.critical-banner-cell-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e8b4b4;
  line-height: 1.2;
}
.critical-banner-cell-body {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}
.critical-banner-cell--avoid .critical-banner-cell-label { color: #d4a0a0; }
.critical-banner-cell--avoid .critical-banner-cell-body { color: var(--text-muted); }
.critical-banner-cell--result .critical-banner-cell-body { color: #e8c4c4; font-size: 0.82rem; }
.critical-banner-grid:has(.critical-banner-cell:only-child) {
  grid-template-columns: 1fr;
}
@media (max-width: 860px) {
  .critical-banner-grid {
    grid-template-columns: 1fr;
  }
}

.story-nick-note {
  margin: 0.85rem 0 0;
  border-radius: 8px;
  border: 1px solid rgba(139, 108, 198, 0.42);
  background: rgba(124, 92, 188, 0.11);
  padding: 0.7rem 0.8rem;
  font-size: 0.88rem;
}
.story-nick-note--danger {
  margin: 0 0 0.9rem;
  border: 2px solid rgba(201, 79, 79, 0.82);
  background: rgba(201, 79, 79, 0.22);
  padding: 0.9rem 1rem;
  box-shadow: 0 0 0 1px rgba(201, 79, 79, 0.25);
}
.story-nick-note-head {
  margin-bottom: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(139, 108, 198, 0.28);
}
.story-nick-note--danger .story-nick-note-head {
  margin-bottom: 0.6rem;
  padding-bottom: 0.55rem;
  border-bottom-color: rgba(255, 180, 180, 0.35);
}
.story-nick-note-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #c9b8e8;
  letter-spacing: 0.02em;
}
.story-nick-note--danger .story-nick-note-title {
  font-size: 1rem;
  font-weight: 800;
  color: #ffd0d0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.story-nick-note-body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
}
.story-nick-note-list {
  margin: 0;
  padding-left: 1.1rem;
}
.story-nick-note-list li {
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}
.story-nick-note-list li:last-child {
  margin-bottom: 0;
}
.story-nick-note--danger .story-nick-note-list li::marker {
  color: #ffb4b4;
}
.step-card .story-nick-note {
  margin-top: 0.55rem;
}
.step-card .story-nick-note--danger {
  margin-top: 0;
}
.critical-banner-lead { margin: 0; color: var(--text); }
.critical-banner-do { margin: 0; }
.critical-banner-avoid { margin: 0; color: var(--text-muted); }
.critical-banner-result { margin: 0; font-size: 0.84rem; color: #e8b4b4; }

.story-exclusive-fork {
  margin: 0 0 0.85rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.08);
}
.story-exclusive-fork-label {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.story-exclusive-fork .story-fork-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.story-exclusive-fork .story-fork-options:has(.story-fork-option:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .story-exclusive-fork .story-fork-options {
    grid-template-columns: 1fr;
  }
}
.story-fork-rewards {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
}
.story-fork-reward {
  display: grid;
  grid-template-columns: minmax(4.75rem, auto) minmax(0, 1fr);
  gap: 0.35rem 0.5rem;
  width: 100%;
  align-items: baseline;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.story-fork-reward-body {
  min-width: 0;
}
.story-fork-reward-tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
}
.story-fork-reward--achievement .story-fork-reward-tag {
  background: rgba(201, 162, 39, 0.2);
  color: #e8d080;
}
.story-fork-reward--achievement .story-fork-reward-body {
  color: #e8d4a8;
  font-weight: 600;
}
.story-fork-reward--roubles .story-fork-reward-body {
  color: #9fd4a8;
  font-weight: 600;
}
.story-fork-reward--evidence .story-fork-reward-tag {
  background: rgba(201, 162, 39, 0.15);
}
.story-fork-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  height: 100%;
}
.story-fork-option:hover { border-color: rgba(201, 162, 39, 0.45); }
.story-fork-option input { margin-top: 0.2rem; flex-shrink: 0; accent-color: var(--accent); }
.story-fork-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
  width: 100%;
}
.story-fork-hint { font-size: 0.82rem; color: var(--text-muted); font-weight: normal; }
.story-exclusive-fork--picked .story-exclusive-fork-picked { margin: 0; }
.story-exclusive-fork-hint { margin: 0.35rem 0 0.5rem; font-size: 0.84rem; color: var(--text-muted); }
.story-fork-change { margin-top: 0.25rem; }

.step-card.is-exclusive-fork.is-fork-pending .hq-complete-toggle { display: none; }
.step-card.is-wait { border-color: rgba(201, 162, 39, 0.35); }
.step-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(201,162,39,0.2); }

.step-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.step-header--quest {
  align-items: center;
}

.step-quest-img {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.step-head,
.step-header {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.step-head-main,
.step-title-wrap {
  flex: 1;
  min-width: 0;
}

.step-head-main h3,
.step-title-wrap h3,
.step-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}

.step-head .step-tags,
.step-title-wrap .tags {
  margin-top: 0.45rem;
}
.step-num {
  flex-shrink: 0;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 600;
  color: var(--accent); background: rgba(201,162,39,0.12);
  border: 1px solid rgba(201,162,39,0.25);
  width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 8px;
}
.step-title-wrap { flex: 1; min-width: 0; }
.step-title-wrap h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; }

.hq-complete-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  cursor: pointer;
  user-select: none;
  text-align: center;
  flex-shrink: 0;
  width: 4.75rem;
}

.hq-complete-toggle__hint {
  position: relative;
  width: 100%;
  min-height: calc(2 * 1.25em);
  font-size: 0.66rem;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hq-complete-toggle__hint-off,
.hq-complete-toggle__hint-on {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.hq-complete-toggle__hint-on {
  color: #8fd48f;
  font-weight: 600;
  opacity: 0;
  visibility: hidden;
}

.hq-complete-toggle:has(input:checked) .hq-complete-toggle__hint-off {
  opacity: 0;
  visibility: hidden;
}

.hq-complete-toggle:has(input:checked) .hq-complete-toggle__hint-on {
  opacity: 1;
  visibility: visible;
}

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

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

.hq-complete-toggle__input:checked,
.step-check.hq-complete-toggle__input: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-complete-toggle__input:checked:disabled,
.step-check.hq-complete-toggle__input:checked:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  filter: saturate(0.75);
}

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

.step-check {
  margin-top: 0;
  accent-color: var(--success);
  width: 1.35rem;
  height: 1.35rem;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
}

.step-header--quest .step-check {
  margin-top: 0;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.tag {
  font-size: 0.68rem; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.04em; padding: 0.15rem 0.45rem; border-radius: 99px;
  background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.tag.map { color: #8ecae6; background: rgba(142,202,230,0.1); }
.tag.wait { color: var(--accent); background: rgba(201,162,39,0.12); }
.tag.choice { color: var(--choice); background: rgba(107,143,212,0.12); }
.tag.optional { color: var(--optional); }
.tag-savior {
  color: #e8c547;
  background: rgba(201, 162, 39, 0.16);
  border: 1px solid rgba(201, 162, 39, 0.35);
  font-weight: 600;
}

.step-body { margin-top: 0.85rem; }

.step-detail-head {
  margin-bottom: 0;
}

.step-card:has(.sq-detail-subhead) .step-detail-head {
  margin-bottom: 0.6rem;
}

.step-detail-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.step-detail-top:has(.sq-detail-subhead) {
  align-items: flex-start;
}

.step-detail-top > .step-num {
  width: 1.55rem;
  height: 1.55rem;
  margin-top: 0;
  border-radius: 7px;
  font-size: 0.76rem;
  align-self: center;
}

.step-detail-top:has(.sq-detail-subhead) > .step-num {
  align-self: flex-start;
  margin-top: calc((1.1rem * 1.25 - 1.55rem) / 2);
}

.step-detail-heading {
  flex: 1;
  min-width: 0;
}

.step-detail-heading h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.step-detail-heading .sq-detail-subhead {
  margin-top: 0.28rem;
  gap: 0.35rem 0.5rem;
}

.step-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  margin-top: 0.02rem;
}

.step-detail-actions .hq-find-map-btn {
  margin: 0;
  padding: 0.34rem 0.58rem;
  font-size: 0.72rem;
}

.step-detail-complete.hq-complete-toggle {
  flex-direction: row;
  align-items: center;
  width: auto;
  gap: 0.4rem;
}

.step-detail-complete .hq-complete-toggle__input {
  align-self: center;
}

.step-detail-complete .hq-complete-toggle__hint {
  display: inline-grid;
  align-items: center;
  width: auto;
  min-height: 0;
  font-size: 0.62rem;
  line-height: 1.2;
  white-space: nowrap;
}

.step-detail-complete .hq-complete-toggle__hint-off,
.step-detail-complete .hq-complete-toggle__hint-on {
  grid-area: 1 / 1;
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.step-detail-body.sq-detail-body {
  margin-top: 0;
  padding: 0;
}

.step-card .sq-detail-subhead .sq-obj-optional {
  flex-shrink: 0;
}

.step-card .step-detail-body > .sq-block {
  margin-top: 0.55rem;
  padding-top: 0.5rem;
}

.step-card .sq-objectives .sq-obj-row {
  padding: 0.55rem 0.72rem;
  gap: 0.55rem;
}

.step-card .sq-block h3 {
  margin-bottom: 0.45rem;
}

.step-card .critical-banner,
.step-card .story-exclusive-fork {
  margin-bottom: 0.85rem;
}

.step-card .sq-obj-row--warn {
  border-color: rgba(201, 79, 79, 0.28);
  background: rgba(201, 79, 79, 0.08);
}

.step-card .sq-obj-num--warn {
  color: #f0a0a0;
  background: rgba(201, 79, 79, 0.15);
  border-color: rgba(201, 79, 79, 0.35);
}

.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 {
  min-height: auto;
  width: 100%;
  padding: 0.65rem 0.75rem;
  align-items: stretch;
  justify-content: center;
}

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

.step-card .sq-block--items .items-table-wrap,
.step-card .sq-block--items .story-item-or-group {
  margin-bottom: 0;
}

.story-item-or-list {
  margin: 0 0 0.65rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.story-item-or-list-item {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
}

.story-item-or-meta {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.story-item-or-meta strong {
  color: #d2d7dc;
  font-weight: 600;
}

.story-raid-group {
  margin: 1rem 0 0.55rem;
  padding: 0.8rem 0.95rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}
.story-raid-group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.story-raid-group-label {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d2d7dc;
}
.story-raid-group-hint {
  margin: 0.45rem 0 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
}
.story-raid-group--prep {
  border-color: rgba(107, 143, 212, 0.45);
  background: rgba(107, 143, 212, 0.08);
}
.story-raid-group--prep .story-raid-group-label {
  color: #b8cce8;
}
.story-raid-group--raid-1 {
  border: 2px solid rgba(90, 168, 196, 0.55);
  background: rgba(90, 168, 196, 0.12);
}
.story-raid-group--raid-1 .story-raid-group-label {
  color: #b8e8f4;
}
.story-raid-group--raid-2 {
  border: 2px solid rgba(201, 79, 79, 0.72);
  background: rgba(201, 79, 79, 0.16);
}
.story-raid-group--raid-2 .story-raid-group-label {
  color: #ffd0d0;
}
.story-raid-group--after {
  border-color: rgba(139, 108, 198, 0.45);
  background: rgba(124, 92, 188, 0.1);
}
.story-raid-group--after .story-raid-group-label {
  color: #c9b8e8;
}
.step-card.is-raid-prep {
  border-left: 3px solid rgba(107, 143, 212, 0.55);
}
.step-card.is-raid-raid-1 {
  background: linear-gradient(145deg, rgba(90, 168, 196, 0.24) 0%, rgba(58, 120, 150, 0.16) 55%, rgba(42, 96, 124, 0.12) 100%);
  border-color: rgba(90, 168, 196, 0.58);
  border-left: 3px solid rgba(90, 168, 196, 0.85);
  box-shadow: 0 0 0 1px rgba(90, 168, 196, 0.18);
}
.step-card.is-raid-raid-1 .step-num {
  background: rgba(90, 168, 196, 0.88);
  color: #fff;
}
.step-card.is-raid-raid-1.done {
  background: linear-gradient(145deg, rgba(61, 154, 106, 0.18) 0%, rgba(90, 168, 196, 0.18) 55%, rgba(42, 96, 124, 0.1) 100%);
}
.step-card.is-raid-raid-2 {
  border-left: 3px solid rgba(201, 79, 79, 0.75);
}
.step-card.is-raid-after {
  border-left: 3px solid rgba(139, 108, 198, 0.55);
}
.step-card.is-raid-raid-1 + .step-card.is-raid-raid-1,
.story-guide-step.is-raid-raid-1 + .step-card.is-raid-raid-1,
.step-card.is-raid-raid-1 + .story-guide-step.is-raid-raid-1 {
  margin-top: 0.35rem;
}
.story-raid-group + .step-card.is-raid-prep,
.story-raid-group + .step-card.is-raid-raid-1,
.story-raid-group + .step-card.is-raid-raid-2,
.story-raid-group + .step-card.is-raid-after,
.story-raid-group + .story-guide-step {
  margin-top: 0.45rem;
}

.story-guide-step {
  margin: 0.55rem 0;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 2px solid rgba(201, 79, 79, 0.78);
  background: linear-gradient(145deg, rgba(201, 79, 79, 0.3) 0%, rgba(140, 45, 45, 0.2) 100%);
  box-shadow: 0 0 0 1px rgba(201, 79, 79, 0.28);
}
.story-guide-step.is-raid-raid-1,
.story-guide-step--raid-1 {
  border-color: rgba(90, 168, 196, 0.78);
  background: linear-gradient(145deg, rgba(90, 168, 196, 0.34) 0%, rgba(58, 120, 150, 0.22) 100%);
  box-shadow: 0 0 0 1px rgba(90, 168, 196, 0.28);
}
.story-guide-step.is-raid-raid-1 .story-guide-step-kicker,
.story-guide-step--raid-1 .story-guide-step-kicker {
  color: #b8e8f4;
}
.story-guide-step.is-raid-raid-1 .story-guide-step-body,
.story-guide-step--raid-1 .story-guide-step-body {
  color: #e8f8ff;
}
.story-guide-step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
.story-guide-step-kicker {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffb4b4;
}
.story-guide-step-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
}
.story-guide-step-body {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  color: #ffe3e3;
}
.story-guide-step-complete {
  flex-shrink: 0;
}

.story-location-options-lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.story-location-options {
  display: grid;
  gap: 0.45rem;
}

.story-location-option {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.story-location-option-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: #d2d7dc;
}

.story-location-option-summary::-webkit-details-marker {
  display: none;
}

.story-location-option-summary::before {
  content: '▸';
  color: var(--accent);
  font-size: 0.82rem;
  transition: transform 0.15s ease;
}

.story-location-option[open] .story-location-option-summary::before {
  transform: rotate(90deg);
}

.story-location-option-body {
  padding: 0 0.7rem 0.7rem;
  border-top: 1px solid var(--border);
}

.story-location-option-key {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.88rem;
}

.story-location-option-desc {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.story-location-option .gallery {
  margin-top: 0.35rem;
}

.step-card .sq-block--gallery .gallery {
  margin-top: 0;
}

.desc { margin: 0 0 0.85rem; color: #d2d7dc; white-space: pre-wrap; }
.step-desc {
  margin: 0 0 0.85rem;
  color: #d2d7dc;
  font-size: 1.05rem;
  line-height: 1.45;
}

.warnings {
  margin: 0 0 0.85rem; padding: 0.65rem 0.75rem;
  background: rgba(201, 79, 79, 0.08); border: 1px solid rgba(201, 79, 79, 0.25);
  border-radius: 8px; font-size: 0.88rem;
}
.warnings li { margin-left: 1rem; color: #efb0b0; }

.items-table-wrap { overflow-x: auto; margin-bottom: 0.85rem; }
.items-table-wrap--collapsible .items-table { margin-bottom: 0; }
.items-table-toggle {
  margin-top: 0.35rem;
  font-size: 0.78rem;
}
.items-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.items-table th, .items-table td {
  text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--border);
}
.items-table th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.items-table td.num {
  font-family: var(--mono);
  font-size: 0.82rem;
  width: 3rem;
}
.items-table .fir-yes { color: var(--warn); font-weight: 600; }
.items-table-or td {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-bottom: 1px solid var(--border);
}
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table-extra[hidden] { display: none; }

.substeps, .evidence-block {
  margin: 0 0 0.85rem; padding: 0.75rem;
  background: var(--bg-elevated); border-radius: 8px; border: 1px solid var(--border);
}
.substeps h4, .evidence-block h4 { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--accent); }
.substeps ul, .evidence-block ul { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; color: var(--text-muted); }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem; margin-top: 0.5rem;
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: #1a1d24;
  padding: 0.35rem;
}
.gallery img.is-screenshot {
  object-fit: cover;
  padding: 0;
  background: #000;
}
.gallery img.is-icon {
  object-fit: contain;
  aspect-ratio: 1;
  max-height: 120px;
  margin-inline: auto;
}
.gallery figcaption { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; }

.rewards {
  margin-top: 0.65rem; font-size: 0.82rem; color: var(--success);
}
.rewards ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }

.footer {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.view-footer {
  margin-top: auto;
  flex-shrink: 0;
}

body.route-story .view-footer,
body.sq-view-kappa .view-footer {
  padding-bottom: 0.35rem;
}
.footer code {
  font-family: var(--mono); background: var(--bg-elevated);
  padding: 0.1rem 0.35rem; border-radius: 4px;
}

.lightbox {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,0.9);
  display: flex; flex-direction: column;
  padding: 3.25rem 1rem 4.5rem;
}
.lightbox.hidden { display: none; }
.lightbox-viewport {
  flex: 1; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
.lightbox img {
  max-width: min(1400px, 96vw); max-height: 88vh;
  object-fit: contain;
  border-radius: 8px; border: 1px solid var(--border);
  transform-origin: center center;
  transition: transform 0.12s ease-out;
  cursor: zoom-in;
  user-select: none;
}
.lightbox.is-zoomed img { cursor: grab; }
.lightbox.is-panning img { cursor: grabbing; transition: none; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  background: transparent; border: none; color: #fff; font-size: 2rem; cursor: pointer;
  z-index: 2;
}
.lightbox-toolbar {
  position: absolute; top: 1rem; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.35rem;
  background: rgba(12, 14, 18, 0.82);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.35rem;
  z-index: 2;
}
.lightbox-zoom-btn,
.lightbox-zoom-reset {
  border: none; background: transparent; color: var(--text);
  cursor: pointer; font: inherit; line-height: 1;
}
.lightbox-zoom-btn {
  width: 2rem; height: 2rem; border-radius: 999px;
  font-size: 1.25rem;
}
.lightbox-zoom-btn:hover,
.lightbox-zoom-reset:hover { background: rgba(201, 162, 39, 0.12); }
.lightbox-zoom-reset {
  min-width: 3.25rem; padding: 0.35rem 0.65rem;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
}
#lightbox-caption {
  position: absolute; bottom: 2.35rem; left: 50%; transform: translateX(-50%);
  color: var(--text-muted); text-align: center; max-width: 80vw; margin: 0;
}
.lightbox-hint {
  position: absolute; bottom: 0.85rem; left: 50%; transform: translateX(-50%);
  margin: 0; font-size: 0.72rem; color: rgba(255, 255, 255, 0.45); text-align: center;
}

.hidden-step { display: none !important; }

/* ── Right dock (flowchart) ── */
.chart-dock {
  --dock-width: 300px;
  --dock-collapsed-width: 44px;
  --chart-dock-gap: 0px;
  position: fixed;
  top: calc(var(--topbar-height) + var(--chart-dock-gap));
  right: 0;
  width: var(--dock-width);
  height: calc(100vh - var(--topbar-height) - var(--chart-dock-gap));
  z-index: 15;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  transition: width 0.25s ease, transform 0.25s ease;
}

.chart-dock.collapsed {
  width: var(--dock-collapsed-width);
}

.chart-dock.collapsed .dock-header-actions,
.chart-dock.collapsed .dock-tabs,
.chart-dock.collapsed .dock-panel,
.chart-dock.collapsed .dock-hint,
.chart-dock.collapsed .chart-legend {
  display: none;
}

.chart-dock.collapsed .dock-header {
  justify-content: center;
  padding: 0.5rem 0;
}

.chart-dock.collapsed .dock-title {
  display: none;
}

.chart-dock.collapsed .dock-expand-tab {
  display: flex;
}

.dock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
}

.dock-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.dock-header-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.btn-icon {
  min-width: 1.75rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.9rem;
  line-height: 1;
}

.dock-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dock-tab {
  flex: 1;
  font: inherit;
  font-size: 0.75rem;
  padding: 0.5rem 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.dock-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.dock-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(201, 162, 39, 0.06);
}

.dock-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.dock-panel.active { display: flex; }

.dock-hint {
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .chart-dock:not(.mobile-open) {
    transform: translateY(100%);
    pointer-events: none;
  }
  .chart-dock.mobile-open {
    transform: translateY(0);
    pointer-events: auto;
  }
}

.dock-expand-tab {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
}

.dock-expand-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.dock-expand-tab:hover { background: rgba(201, 162, 39, 0.08); }

.flowchart-viewport {
  overflow: auto;
  flex: 1;
  min-height: 0;
  background: rgba(0, 0, 0, 0.15);
  scroll-padding-top: 0.75rem;
  scroll-padding-bottom: 0.75rem;
}

.flowchart {
  padding: 0.65rem;
  transform-origin: top center;
  transition: transform 0.15s ease;
}

.chart-track {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: 100%;
  margin: 0;
}

.chart-phase {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  border-top: 3px solid var(--phase-accent, var(--accent));
  overflow: hidden;
  margin-bottom: 0.65rem;
}

.chart-phase-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
}

.chart-phase-num {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--phase-accent, var(--accent));
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 6px;
  flex-shrink: 0;
}

.chart-phase-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.8rem;
}

.chart-phase-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.chart-phase-flow {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.55rem 0.65rem 0.65rem;
}

.chart-arrow {
  display: flex;
  justify-content: center;
  height: 1.25rem;
  position: relative;
}

.chart-arrow span {
  display: block;
  width: 2px;
  height: 100%;
  background: var(--line);
  position: relative;
}

.chart-arrow span::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--line);
}

.chart-node {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.6rem;
  scroll-margin-top: 0.75rem;
  scroll-margin-bottom: 0.75rem;
  background: #243040;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chart-node:hover {
  background: #2a3848;
  border-color: #4a5560;
  transform: translateY(-1px);
}

.chart-node:active { transform: translateY(0); }

.chart-node.active {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.chart-node.is-focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.25);
  background: #383020;
}

.chart-node.is-wait { background: #3a3220; border-color: #5a4a30; }
.chart-node.is-choice { background: #2a3550; border-color: #4a5a80; }
.chart-node.is-critical { background: #3a2020; border-color: #a04040; }
.chart-node.is-critical .cn-num { background: var(--danger); }
.chart-node.is-savior-needed {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.12);
}
.chart-node.is-savior-needed .cn-num {
  background: rgba(201, 162, 39, 0.35);
  color: #fff;
}

.chart-node.done {
  opacity: 0.55;
  background: #1e3a2a;
  border-color: rgba(61, 154, 106, 0.35);
}

.chart-node.is-locked {
  opacity: 0.72;
  background: #252830;
  border-color: rgba(120, 130, 150, 0.35);
}

.chart-node.is-locked .cn-num {
  background: rgba(120, 130, 150, 0.35);
  color: #eef1f5;
}

.cn-lock-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.3rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b8beca;
  border: 1px solid rgba(150, 160, 180, 0.35);
  vertical-align: middle;
}

.step-nav a.is-locked-nav {
  opacity: 0.72;
  border-color: rgba(120, 130, 150, 0.25);
}

.step-nav a.is-locked-nav .jump-label {
  color: #aeb6c4;
}

.cn-num {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.22);
  min-width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.cn-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cn-label {
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 500;
}

.cn-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.cn-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.cn-badge-wait { color: var(--accent); background: rgba(201, 162, 39, 0.12); }
.cn-badge-choice { color: var(--choice); background: rgba(107, 143, 212, 0.12); }
.cn-badge-critical { color: #f0a0a0; background: rgba(201, 79, 79, 0.15); }
.cn-badge-savior { color: #e8c547; background: rgba(201, 162, 39, 0.15); }
.cn-badge-map { color: #8ecae6; background: rgba(142, 202, 230, 0.1); }
.cn-badge-items { color: #b8c4ce; }

.chart-phase-bridge {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 2rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  opacity: 0.6;
}

.chart-phase-bridge--horizontal {
  flex-direction: column;
  width: 2.5rem;
  height: auto;
  align-self: stretch;
  min-height: 120px;
}

.chart-phase-bridge--horizontal span {
  transform: rotate(-90deg);
  font-size: 1.25rem;
}

/* ── Full-screen route map overlay ── */
.chart-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.chart-overlay.hidden { display: none; }

.chart-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 9, 0.82);
  backdrop-filter: blur(6px);
}

.chart-overlay-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 1600px);
  margin: 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.chart-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.08), transparent);
  flex-shrink: 0;
}

.chart-overlay-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.chart-overlay-header h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  line-height: 1.2;
}

.chart-overlay-meta {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chart-overlay-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.chart-overlay-body {
  display: grid;
  grid-template-columns: 1fr 220px;
  flex: 1;
  min-height: 0;
}

.chart-overlay-canvas-wrap {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.flowchart-viewport--overlay {
  flex: 1;
  min-height: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(201, 162, 39, 0.06), transparent 45%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 23px,
      rgba(255, 255, 255, 0.02) 23px,
      rgba(255, 255, 255, 0.02) 24px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 23px,
      rgba(255, 255, 255, 0.02) 23px,
      rgba(255, 255, 255, 0.02) 24px
    ),
    rgba(0, 0, 0, 0.2);
}

.flowchart--overlay {
  padding: 1.5rem 1.75rem 2rem;
  transform-origin: top left;
}

.flowchart--overlay .chart-track {
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  width: max-content;
  min-width: 100%;
}

.flowchart--overlay .chart-phase {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.flowchart--overlay .chart-phase-head {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
}

.flowchart--overlay .chart-phase-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.flowchart--overlay .chart-phase-flow {
  padding: 0.65rem 0.75rem 0.85rem;
}

.flowchart--overlay .chart-node {
  padding: 0.65rem 0.75rem;
}

.flowchart--overlay .cn-label {
  font-size: 0.84rem;
}

.flowchart--overlay .cn-anno {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-weight: 400;
}

.chart-overlay-sidebar {
  border-left: 1px solid var(--border);
  padding: 1rem 1rem 1.25rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.15);
}

.chart-overlay-sidebar h3 {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.chart-overlay-legend {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.chart-overlay-legend .legend-item {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chart-overlay-hint {
  margin: 1rem 0 0;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-muted);
}

body.chart-overlay-open { overflow: hidden; }

@media (max-width: 900px) {
  .chart-overlay-panel { margin: 0; border-radius: 0; width: 100%; }
  .chart-overlay-body { grid-template-columns: 1fr; }
  .chart-overlay-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 28vh;
  }
  .flowchart--overlay .chart-phase { min-width: 240px; max-width: 260px; }
}

@media (max-width: 520px) {
  .topbar-brand-title { display: none; }
  .search-wrap input { width: min(160px, 36vw); font-size: 0.88rem; }
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-top: 1px solid var(--border);
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.details-heading {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.flow.collapsed .details-heading,
.flow.collapsed #flow { display: none; }

.auth-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.auth-signed-out,
.auth-signed-in {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.auth-signed-in.hidden,
.auth-signed-out.hidden { display: none; }

.auth-user-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.btn-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #5865f2;
  border-color: #4752c4;
  color: #fff;
  font-weight: 600;
}

.btn-discord:hover {
  background: #4752c4;
  color: #fff;
  border-color: #3c45a5;
}

.btn-discord-icon {
  width: 18px;
  height: 18px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.14 96.36'%3E%3Cpath fill='%23fff' d='M107.7 8.07A105.15 105.15 0 0 0 81.1 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.2 0A72.37 72.37 0 0 0 45.19 0 105.89 105.89 0 0 0 18.6 8.07 110.76 110.76 0 0 0 1.55 65.05a106 106 0 0 0 32.32 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 106 106 0 0 0 32.31-16.14 110.25 110.25 0 0 0-17.05-56.98zM42.45 53.2a18.72 18.72 0 0 1-17-10.1 18.72 18.72 0 0 1 17-10.1 18.72 18.72 0 0 1 17 10.1 18.72 18.72 0 0 1-17 10.1zm42.24 0a18.72 18.72 0 0 1-17-10.1 18.72 18.72 0 0 1 17-10.1 18.72 18.72 0 0 1 17 10.1 18.72 18.72 0 0 1-17 10.1z'/%3E%3C/svg%3E");
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-modal.hidden { display: none; }

.auth-modal-panel {
  position: relative;
  width: min(400px, 100%);
  background: #16181d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.auth-modal-panel h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.auth-modal-panel h3 { margin: 0 0 0.85rem; font-size: 0.95rem; color: var(--text-muted); }

.auth-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.auth-form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

.auth-form .btn { width: 100%; margin-top: 0.25rem; }

.auth-forgot-wrap {
  margin: -0.35rem 0 0.65rem;
  text-align: right;
}

.auth-form-hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-switch {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.btn-link {
  font: inherit;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.story-quest-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
}

.story-quest-link:hover {
  color: #e8c547;
}

.auth-message {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  background: rgba(61, 154, 106, 0.12);
  border: 1px solid rgba(61, 154, 106, 0.35);
  color: #a8e0c4;
}

.auth-message.auth-message-error {
  background: rgba(201, 79, 79, 0.12);
  border-color: rgba(201, 79, 79, 0.35);
  color: #f0a0a0;
}

/* ── Profile modal ── */
.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.profile-modal.hidden { display: none; }

.profile-modal-panel {
  position: relative;
  width: min(560px, 100%);
  height: min(680px, 92vh);
  min-height: min(680px, 92vh);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.profile-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.profile-modal-header { margin-bottom: 0.85rem; padding-right: 1.5rem; }

.profile-modal-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.profile-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.profile-modal-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.profile-message {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  background: rgba(61, 154, 106, 0.12);
  border: 1px solid rgba(61, 154, 106, 0.35);
  color: #a8e0c4;
}

.profile-message.profile-message-error {
  background: rgba(201, 79, 79, 0.12);
  border-color: rgba(201, 79, 79, 0.35);
  color: #f0a0a0;
}

.profile-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--border);
}

.profile-tab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.55rem 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

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

.profile-tab.is-active {
  color: var(--accent);
  background: rgba(201, 162, 39, 0.12);
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.28);
}

.profile-tab-pane {
  display: none;
}

.profile-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.profile-tab-pane.is-active {
  display: block;
}

.profile-section-scroll {
  padding-bottom: 0.25rem;
}

.profile-pane-intro {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.profile-session-signout {
  width: 100%;
  margin-top: 0.5rem;
}

.profile-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-field {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.profile-field input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

.profile-field input:read-only {
  opacity: 0.75;
  cursor: default;
}

.profile-field select,
.profile-select {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
}

.profile-field-hint {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.profile-quest-flags {
  margin: 0.85rem 0 0;
  padding: 0;
  border: none;
}

.profile-quest-flags .profile-section-title {
  margin-bottom: 0.5rem;
}

.profile-flag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.88rem;
  cursor: pointer;
}

.profile-flag input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.profile-trader-standing {
  border: none;
  margin: 0.85rem 0 0;
  padding: 0;
}

.profile-trader-standing .profile-section-title {
  margin-bottom: 0.35rem;
}

.profile-trader-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.65rem;
}

.profile-trader-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
}

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

.profile-trader-input {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.profile-trader-input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.45);
}

@media (max-width: 520px) {
  .profile-trader-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-modal-panel {
    height: min(680px, 94vh);
    min-height: min(620px, 94vh);
  }
}

.profile-section .btn { width: 100%; margin-top: 0.15rem; }

.profile-tt-import {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem 0.95rem;
  margin: 0.85rem 0 0.35rem;
}

.profile-tt-import .profile-section-title {
  margin-bottom: 0.35rem;
}

.profile-tt-import .profile-field-hint {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.profile-modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  padding-top: 0.25rem;
}

.profile-modal-footer .btn { flex: 1 1 auto; }

body.profile-modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

/* ── Raider groups ── */
.panel-group { margin-top: 0; }

.group-panel-head {
  display: none;
}

.group-state.hidden { display: none; }

.group-summary {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.group-name-line {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: var(--accent);
}

.group-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.group-member-count { font-family: var(--mono); }

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

.group-invite-code {
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.25);
  color: var(--accent);
}

.group-invite-code-lg {
  font-size: 1rem;
  padding: 0.35rem 0.55rem;
}

.group-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.group-members {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.group-member-row {
  position: relative;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
}

.group-member-row.is-self {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.05);
}

.group-member-row-btn {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.group-member-row-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}

.group-member-row-btn:focus-visible {
  outline: 2px solid rgba(201, 162, 39, 0.55);
  outline-offset: -2px;
}

.group-member-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.group-member-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.group-you-badge,
.group-role-badge,
.group-level-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  line-height: 1.2;
}

.group-you-badge {
  background: rgba(45, 110, 72, 0.95);
  border: 1px solid rgba(61, 154, 106, 0.5);
  color: #fff;
  font-weight: 600;
}

.group-role-badge,
.group-level-badge {
  background: transparent;
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: var(--accent);
  font-weight: 500;
}

.group-member-drawer {
  display: none;
  padding: 0.55rem 0.65rem 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
}

.group-member-row.is-expanded .group-member-drawer {
  display: block;
}

.group-member-drawer.is-hover-floating {
  display: block;
  position: fixed;
  z-index: 200;
  min-width: 260px;
  max-width: min(300px, calc(100vw - 1rem));
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  background: var(--bg-card);
  pointer-events: auto;
}

/* Legacy card styles — kept for older cached markup */
.group-member-card {
  padding: 0.75rem 0.8rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border);
}

.group-member-card.is-self {
  border-color: rgba(201, 162, 39, 0.35);
  background: rgba(201, 162, 39, 0.06);
}

.group-member-head { margin-bottom: 0.55rem; }

.group-member-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
  font-size: 0.88rem;
}

.group-member-title .profile-level-badge {
  font-size: 0.62rem;
  padding: 0.12rem 0.38rem;
}

.group-you-badge,
.group-role-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
}

.group-member-card .group-you-badge {
  background: rgba(61, 154, 106, 0.14);
  border: 1px solid rgba(61, 154, 106, 0.35);
  color: #a8e0c4;
}

.group-member-card .group-role-badge {
  background: rgba(201, 162, 39, 0.12);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--accent);
}

.group-quest-line {
  margin-bottom: 0.45rem;
}

.group-quest-line:last-child { margin-bottom: 0; }

.group-quest-line-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.group-quest-line-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-quest-line-count {
  font-family: var(--mono);
  flex-shrink: 0;
}

.group-quest-track {
  height: 6px;
}

.group-no-progress {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.group-tab-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: var(--accent);
}

.profile-field-readonly input:read-only {
  opacity: 0.85;
}

/* ── Bottom chapter progress bar ── */
.chapter-progress-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: 28px;
  background: rgba(12, 14, 18, 0.96);
  border-top: 1px solid rgba(201, 162, 39, 0.22);
  backdrop-filter: blur(8px);
  transition: right 0.25s ease;
}

body.dock-open .chapter-progress-bar,
body.dock-open #kappa-progress-bar {
  right: var(--dock-width, 300px);
}

.chapter-progress-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 100%;
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 1rem;
}

.chapter-progress-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}

.chapter-progress-track-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.chapter-progress-track {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.chapter-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  transition: width 0.35s ease;
}

.chapter-progress-label {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ── Story choice pickers ── */
.req-choices-intro {
  margin: 0 0 0.75rem;
}

.req-subheading {
  margin: 0.85rem 0 0.65rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.req-choice-marked {
  border-color: rgba(61, 154, 106, 0.35);
}

.story-path-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.story-path-opt {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 0.5rem 0.45rem;
  font-size: 0.74rem;
  line-height: 1.25;
  text-align: center;
}

.story-path-opt:hover {
  color: var(--text);
  border-color: rgba(201, 162, 39, 0.35);
}

.story-path-opt.active {
  background: rgba(201, 162, 39, 0.12);
  border-color: rgba(201, 162, 39, 0.45);
  color: var(--accent);
  font-weight: 600;
}

.decision-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.decision-opt {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
}

.decision-opt:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.decision-opt.active {
  background: rgba(61, 154, 106, 0.14);
  border-color: rgba(61, 154, 106, 0.4);
  color: #a8e0c4;
  font-weight: 600;
}

.req-story-path {
  margin-bottom: 0.85rem;
}

@media (max-width: 640px) {
  .chapter-progress-title { max-width: 34vw; font-size: 0.66rem; }
  .story-path-toggle { grid-template-columns: 1fr; }
}

/* ── Toasts & confirm dialogs ── */
.story-toast-host {
  position: fixed;
  top: 4.5rem;
  right: 1rem;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.story-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #1a222c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  animation: story-toast-in 0.22s ease-out;
}

.story-toast.is-leaving {
  opacity: 0;
  transform: translateX(0.5rem);
  transition: opacity 0.2s, transform 0.2s;
}

@keyframes story-toast-in {
  from { opacity: 0; transform: translateY(-0.35rem); }
  to { opacity: 1; transform: translateY(0); }
}

.story-toast-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.story-toast-success .story-toast-icon {
  background: rgba(61, 154, 106, 0.2);
  color: #6fd49a;
}

.story-toast-error .story-toast-icon {
  background: rgba(201, 79, 79, 0.2);
  color: #f0a0a0;
}

.story-toast-info .story-toast-icon {
  background: rgba(107, 143, 212, 0.2);
  color: #9bb8f0;
}

.story-toast-body { flex: 1; min-width: 0; }

.story-toast-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.story-toast-message {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text);
}

.story-toast-close {
  flex-shrink: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.story-confirm {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.story-confirm.hidden { display: none; }

.story-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.story-confirm-panel {
  position: relative;
  width: min(24rem, 100%);
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius);
  background: #16181d;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.story-confirm-panel h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text);
}

.story-confirm-panel p {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.story-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-danger {
  background: rgba(201, 79, 79, 0.22);
  border-color: rgba(201, 79, 79, 0.55);
  color: #f0c0c0;
}

.btn-danger:hover {
  background: rgba(201, 79, 79, 0.35);
  border-color: rgba(201, 79, 79, 0.7);
}

body.story-confirm-open { overflow: hidden; }

/* ── Profile: Tarkov character ID + PMC tab (EFT-style) ── */

.profile-tab.is-disabled,
.profile-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-character-id {
  margin: 0.85rem 0;
  padding: 0.75rem 0 0;
  border: none;
  border-top: 1px solid var(--border);
}

.profile-character-id-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.eft-profile-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.eft-profile-locked {
  padding: 1.25rem 1rem;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.eft-locked-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c9a227;
}

.eft-profile {
  --eft-bg: #121310;
  --eft-panel: #1a1916;
  --eft-border: #3d3828;
  --eft-gold: #c9a227;
  --eft-text: #d8d4c8;
  --eft-muted: #8a8578;
  font-size: 0.84rem;
  color: var(--eft-text);
  background: linear-gradient(180deg, #161512 0%, var(--eft-bg) 100%);
  border: 1px solid var(--eft-border);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(201, 162, 39, 0.08), 0 8px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.eft-profile-hero {
  padding: 1rem 1.1rem 0.85rem;
  background:
    linear-gradient(90deg, rgba(201, 162, 39, 0.14) 0%, transparent 55%),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 2px,
      transparent 2px,
      transparent 6px
    );
  border-bottom: 1px solid var(--eft-border);
}

.eft-profile-hero-text {
  min-width: 0;
  flex: 1;
}

.eft-profile-hero-shell {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

.eft-profile-hero-level-art {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.eft-level-icon-hero {
  width: 82px;
  height: 82px;
  object-fit: contain;
  flex-shrink: 0;
  opacity: 0.9;
}

.eft-level-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--eft-gold);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  padding: 0 0.35rem;
}

.eft-hero-progress {
  margin-top: 0.6rem;
}

.eft-hero-progress-bar {
  height: 7px;
  border: 1px solid rgba(61, 56, 40, 0.85);
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.eft-hero-progress-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(158, 133, 46, 0.8) 0%, rgba(201, 162, 39, 1) 100%);
}

.eft-hero-progress-meta {
  margin-top: 0.28rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: start;
}

.eft-hero-progress-center {
  justify-self: center;
  display: flex;
  gap: 0.6rem;
}

.eft-hero-progress-center span,
.eft-hero-progress-right {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.64rem;
  color: var(--eft-muted);
  line-height: 1.3;
}

.eft-hero-progress-right {
  justify-self: end;
}

.eft-profile-kicker {
  margin: 0 0 0.25rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--eft-muted);
}

.eft-profile-name {
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #f0ead8;
}

.eft-profile-name-text {
  line-height: 1.1;
}

.eft-name-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.eft-profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.45rem 0 0;
}

.eft-side-badge,
.eft-level-badge,
.eft-name-tag {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: normal;
  vertical-align: baseline;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--eft-border);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
}

.eft-name-tag {
  color: var(--eft-gold);
  border-color: rgba(201, 162, 39, 0.45);
}

.eft-side--usec .eft-side-badge {
  color: #8ec5ff;
  border-color: rgba(110, 168, 255, 0.45);
}

.eft-side--bear .eft-side-badge {
  color: #f08a7a;
  border-color: rgba(220, 100, 80, 0.45);
}

.eft-level-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.5rem 0.2rem 0.25rem;
  border: 1px solid rgba(201, 162, 39, 0.45);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
}

.eft-level-badge-img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.eft-level-badge-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.eft-level-badge-label {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--eft-gold);
}

.eft-level-progress {
  font-size: 0.65rem;
  color: var(--eft-muted);
  line-height: 1.3;
}

.eft-profile-sub {
  margin: 0.35rem 0 0;
  font-size: 0.74rem;
  color: var(--eft-muted);
  line-height: 1.45;
}

@media (max-width: 720px) {
  .eft-level-icon-hero {
    width: 60px;
    height: 60px;
  }

  .eft-hero-progress-meta {
    grid-template-columns: 1fr;
  }

  .eft-hero-progress-center {
    justify-self: start;
    flex-wrap: wrap;
    gap: 0.35rem 0.6rem;
  }

  .eft-hero-progress-right {
    justify-self: start;
  }
}

.eft-warn {
  color: #e88;
}

.eft-profile-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0.75rem;
}

@media (max-width: 720px) {
  .eft-profile-body {
    grid-template-columns: 1fr;
  }
}

.eft-panel {
  padding: 0.65rem 0.7rem;
  background: var(--eft-panel);
  border: 1px solid var(--eft-border);
  border-radius: 2px;
}

.eft-panel--compact {
  margin-top: 0;
}

.eft-panel-title {
  margin: 0 0 0.55rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--eft-gold);
}

.eft-panel--stats {
  padding-top: 0.6rem;
}

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

.eft-stats-head .eft-panel-title {
  margin: 0;
}

.eft-stats-toggle {
  display: inline-flex;
  gap: 0.25rem;
}

.eft-stats-toggle-btn {
  border: 1px solid rgba(61, 56, 40, 0.75);
  background: rgba(0, 0, 0, 0.28);
  color: var(--eft-muted);
  border-radius: 2px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  padding: 0.18rem 0.45rem;
  cursor: pointer;
}

.eft-stats-toggle-btn.is-active {
  color: #f0ead8;
  border-color: rgba(201, 162, 39, 0.55);
  background: rgba(201, 162, 39, 0.14);
}

.eft-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 0.35rem 0.42rem;
}

.eft-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.38rem 0.32rem;
  border: 1px solid rgba(61, 56, 40, 0.45);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.2);
}

.eft-stat-card.is-danger {
  border-color: rgba(188, 72, 72, 0.58);
  box-shadow: inset 0 0 0 1px rgba(188, 72, 72, 0.22), 0 0 10px rgba(188, 72, 72, 0.14);
}

.eft-stat-card-icon {
  font-size: 0.62rem;
  line-height: 1;
  color: var(--eft-gold);
  margin-bottom: 0.16rem;
}

.eft-stat-card-icon.is-danger {
  color: #e58b8b;
  text-shadow: 0 0 6px rgba(229, 139, 139, 0.45);
}

.eft-stat-card-value {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 1.18rem;
  line-height: 1.1;
  color: #f0ead8;
}

.eft-stat-card-label {
  margin-top: 0.08rem;
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--eft-muted);
}

.eft-stat-card-label.is-danger {
  color: #dba2a2;
}

.eft-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  margin: 0;
}

.eft-stat-grid dt {
  margin: 0;
  font-size: 0.68rem;
  color: var(--eft-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.eft-stat-grid dd {
  margin: 0;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.9rem;
  color: #f0ead8;
}

.eft-skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 19rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.eft-skill-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.eft-skill-name {
  font-size: 0.76rem;
  color: var(--eft-text);
}

.eft-skill-lv {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.68rem;
  color: var(--eft-gold);
}

.eft-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(61, 56, 40, 0.8);
  border-radius: 1px;
  overflow: hidden;
}

.eft-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #6a5a28 0%, var(--eft-gold) 100%);
}

.eft-mastery-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.eft-mastery-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0;
  border-bottom: 1px solid rgba(61, 56, 40, 0.5);
  font-size: 0.78rem;
}

.eft-mastery-list li:last-child {
  border-bottom: none;
}

.eft-mastery-lv {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  color: var(--eft-gold);
}

.eft-empty {
  margin: 0;
  font-size: 0.78rem;
  color: var(--eft-muted);
}

.eft-profile-error {
  padding: 1rem;
  text-align: center;
}

.eft-attribution {
  margin: 0;
  padding: 0.5rem 0.75rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.68rem;
  color: var(--eft-muted);
  border-top: 1px solid var(--eft-border);
  background: rgba(0, 0, 0, 0.25);
}

.eft-attribution-left {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.eft-attribution-fetched {
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: var(--eft-muted);
  white-space: nowrap;
}

.eft-attribution-credit {
  text-align: right;
  flex-shrink: 0;
}

.eft-attribution-refresh {
  padding: 0.15rem;
  border-radius: 4px;
  color: var(--eft-muted);
  line-height: 0;
}

.eft-attribution-refresh:hover {
  color: var(--eft-gold);
}

.eft-attribution-refresh .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.eft-attribution a {
  color: var(--eft-gold);
}

.eft-achievement-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}

.eft-achievement-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(61, 56, 40, 0.45);
}

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

.eft-achievement-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
}

.eft-achievement-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.eft-achievement-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f0ead8;
}

.eft-achievement-desc {
  font-size: 0.68rem;
  color: var(--eft-muted, #8a8578);
  line-height: 1.35;
}

.eft-achievement-date {
  font-size: 0.65rem;
  color: var(--eft-gold, #c9a227);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
}

/* ── Loadout / equipment preview (PMC tab) ── */

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

.eft-weapon-slot-card {
  position: relative;
  border: 1px solid rgba(61, 56, 40, 0.55);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.55rem 0.65rem;
}

.eft-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.62rem;
}

.eft-slot-card {
  border: 1px solid rgba(61, 56, 40, 0.55);
  border-radius: 2px;
  padding: 0.58rem 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  min-height: 88px;
}

.eft-slot-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.eft-slot-label {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--eft-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eft-slot-card-body {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 0.7rem;
}

.eft-slot-name {
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  color: #f0ead8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eft-loadout-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
}

.eft-loadout-icon-fallback {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--eft-gold);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.9rem;
  font-weight: 700;
}

.eft-loadout-weapon {
  position: relative;
}

.eft-weapon-hover-panel {
  position: absolute;
  top: -0.2rem;
  left: calc(100% + 0.4rem);
  width: 320px;
  max-width: min(320px, 72vw);
  z-index: 8;
  padding: 0.5rem 0.55rem;
  border: 1px solid rgba(61, 56, 40, 0.78);
  border-radius: 2px;
  background: rgba(12, 12, 11, 0.96);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  display: none;
}

.eft-weapon-slot-card:hover .eft-weapon-hover-panel {
  display: block;
}

.eft-weapon-hover-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--eft-gold);
}

.eft-weapon-hover-list {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.eft-weapon-hover-item {
  display: grid;
  grid-template-columns: 28px 110px 1fr;
  align-items: center;
  gap: 0.4rem;
}

.eft-weapon-hover-item .eft-loadout-icon,
.eft-weapon-hover-item .eft-loadout-icon-fallback {
  width: 28px;
  height: 28px;
}

.eft-weapon-hover-slot {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.59rem;
  color: var(--eft-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eft-weapon-hover-name {
  min-width: 0;
  font-size: 0.74rem;
  color: #f0ead8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 980px) {
  .eft-weapon-hover-panel {
    top: calc(100% + 0.35rem);
    left: 0;
    width: auto;
    max-width: 92vw;
  }
}

.eft-durability {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.eft-durability-bar {
  width: 70px;
  height: 5px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(61, 56, 40, 0.8);
  border-radius: 1px;
  overflow: hidden;
}

.eft-durability-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(128, 110, 40, 0.8) 0%, var(--eft-gold) 100%);
}

.eft-durability-text {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  color: var(--eft-muted);
  font-size: 0.62rem;
  min-width: 2.3ch;
  text-align: right;
}

.eft-loadout-count {
  color: var(--eft-muted);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eft-mod-tree {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.eft-mod-node-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.eft-mod-node-slot {
  min-width: 110px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 0.62rem;
  color: var(--eft-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.eft-mod-node-name {
  min-width: 0;
  font-size: 0.78rem;
  color: #f0ead8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eft-mod-node-children {
  padding-left: 0.15rem;
}

.hq-pmc-page {
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  padding-bottom: 2rem;
}

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

.hq-page-header-actions {
  flex-shrink: 0;
}

.hq-pmc-page .hq-page-title {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.hq-pmc-page .hq-page-lead {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.pmc-local-preview-note {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--accent);
}

.pmc-setup {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
}

.pmc-profile-mount {
  min-height: 10rem;
}

body.route-pmc .topbar-story-only {
  display: none;
}

