/* ===== Quest Hub + Quest Detail (La2Hub) ===== */
:root {
 --qh-accent: var(--gold, #c9a84c);
 --qh-accent-soft: rgba(201, 168, 76, 0.12);
 --qh-ok: #34d399;
 --qh-warn: #f59e0b;
 --qh-danger: #ef4444;
 --qh-info: #60a5fa;
 --qh-radius: 14px;
}

.qh-page {
 max-width: 1200px;
 margin: 0 auto;
 padding: 72px 20px 64px;
 position: relative;
 z-index: 2;
}

.qh-crumbs {
 font-size: 0.8rem;
 color: var(--text-muted);
 margin-bottom: 10px;
}
.qh-crumbs a { color: var(--qh-accent); text-decoration: none; }
.qh-crumbs a:hover { text-decoration: underline; }

.qh-hero {
 margin-bottom: 22px;
}
.qh-hero h1 {
 font-family: 'Cinzel', serif;
 font-size: clamp(1.55rem, 3vw, 2.1rem);
 margin: 0 0 8px;
 letter-spacing: 0.02em;
}
.qh-hero p {
 margin: 0;
 color: var(--text-secondary);
 max-width: 54ch;
 line-height: 1.55;
 font-size: 0.95rem;
}

/* ----- Hub filters ----- */
.qh-filters {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--qh-radius);
 padding: 14px;
 margin-bottom: 18px;
 display: flex;
 flex-direction: column;
 gap: 12px;
}

.qh-search-row {
 display: flex;
 gap: 10px;
 align-items: center;
 flex-wrap: wrap;
}
.qh-search {
 flex: 1;
 min-width: 220px;
 position: relative;
}
.qh-search input {
 width: 100%;
 box-sizing: border-box;
 background: var(--bg-secondary, #0f0f16);
 border: 1px solid var(--border);
 color: var(--text-primary);
 border-radius: 10px;
 padding: 11px 14px 11px 40px;
 font-size: 0.92rem;
}
.qh-search::before {
 content: '⌕';
 position: absolute;
 left: 14px;
 top: 50%;
 transform: translateY(-50%);
 color: var(--text-muted);
 font-size: 1rem;
 pointer-events: none;
}
.qh-count {
 color: var(--text-muted);
 font-size: 0.8rem;
 white-space: nowrap;
}

.qh-chips,
.qh-levels {
 display: flex;
 flex-wrap: wrap;
 gap: 8px 10px;
}
.qh-chips-wrap {
 display: flex;
 flex-wrap: wrap;
 align-items: flex-start;
 gap: 10px;
}
.qh-chips {
 flex: 1 1 100%;
 flex-wrap: wrap;
 gap: 8px 10px;
 overflow: visible;
 scroll-snap-type: none;
 padding: 0;
 margin: 0;
}
.qh-chip-grid {
 display: grid !important;
 flex-wrap: unset !important;
 gap: 8px 10px;
}
.qh-chip-grid .qh-chip,
.qh-chip-grid .qh-lvl {
 width: 100%;
 justify-content: center;
 text-align: center;
 white-space: normal;
 line-height: 1.25;
 min-height: 42px;
}
.qh-chip,
.qh-lvl {
 appearance: none;
 flex: 0 0 auto;
 display: inline-flex;
 align-items: center;
 justify-content: center;
 gap: 8px;
 border: 1px solid rgba(255, 255, 255, 0.1);
 background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.22));
 color: var(--text-secondary);
 border-radius: 12px;
 padding: 11px 16px;
 font-size: 0.88rem;
 font-weight: 700;
 line-height: 1.2;
 cursor: pointer;
 white-space: nowrap;
 text-align: center;
 box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
 transition: border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.qh-chip-ico {
 font-size: 1.1rem;
 line-height: 1;
}
.qh-chip:hover,
.qh-lvl:hover {
 border-color: rgba(201, 168, 76, 0.5);
 color: var(--text-primary);
 transform: translateY(-1px);
 box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(201, 168, 76, 0.12);
}
.qh-chip.is-on,
.qh-lvl.is-on {
 border-color: rgba(201, 168, 76, 0.7);
 background: linear-gradient(180deg, rgba(201, 168, 76, 0.22), rgba(201, 168, 76, 0.08));
 color: var(--qh-accent);
 box-shadow:
 0 0 0 1px rgba(201, 168, 76, 0.35),
 0 0 22px rgba(201, 168, 76, 0.28),
 0 8px 18px rgba(0, 0, 0, 0.35);
}
.qh-reset {
 flex-shrink: 0;
 margin-left: 0;
 margin-top: 0;
 border: 0;
 background: transparent;
 color: var(--text-muted);
 font-size: 0.78rem;
 cursor: pointer;
 text-decoration: underline;
 text-underline-offset: 2px;
 white-space: nowrap;
 align-self: center;
}

.qh-job-sub {
 display: flex;
 flex-direction: column;
 gap: 10px;
 padding-top: 2px;
}
.qh-job-row {
 display: flex;
 flex-direction: column;
 gap: 8px;
}
.qh-job-label {
 font-size: 0.72rem;
 font-weight: 700;
 letter-spacing: 0.06em;
 text-transform: uppercase;
 color: var(--qh-accent);
}
.qh-job-races {
 flex: 1 1 auto;
}

/* Race filter colors */
.qh-chip--race-human {
 border-color: rgba(244, 180, 196, 0.45);
 background: linear-gradient(180deg, rgba(244, 180, 196, 0.22), rgba(244, 180, 196, 0.06));
 color: #f6c9d4;
}
.qh-chip--race-human:hover,
.qh-chip--race-human.is-on {
 border-color: rgba(244, 180, 196, 0.85);
 background: linear-gradient(180deg, rgba(244, 180, 196, 0.34), rgba(244, 180, 196, 0.12));
 color: #ffe4ec;
 box-shadow:
 0 0 0 1px rgba(244, 180, 196, 0.4),
 0 0 18px rgba(244, 180, 196, 0.28),
 0 6px 16px rgba(0, 0, 0, 0.3);
}

.qh-chip--race-elf {
 border-color: rgba(110, 190, 120, 0.45);
 background: linear-gradient(180deg, rgba(110, 190, 120, 0.22), rgba(110, 190, 120, 0.06));
 color: #9dd8a3;
}
.qh-chip--race-elf:hover,
.qh-chip--race-elf.is-on {
 border-color: rgba(110, 190, 120, 0.85);
 background: linear-gradient(180deg, rgba(110, 190, 120, 0.34), rgba(110, 190, 120, 0.12));
 color: #c8f0cc;
 box-shadow:
 0 0 0 1px rgba(110, 190, 120, 0.4),
 0 0 18px rgba(110, 190, 120, 0.28),
 0 6px 16px rgba(0, 0, 0, 0.3);
}

.qh-chip--race-darkelf {
 border-color: rgba(140, 190, 240, 0.45);
 background: linear-gradient(180deg, rgba(140, 190, 240, 0.22), rgba(140, 190, 240, 0.06));
 color: #a8cffa;
}
.qh-chip--race-darkelf:hover,
.qh-chip--race-darkelf.is-on {
 border-color: rgba(140, 190, 240, 0.85);
 background: linear-gradient(180deg, rgba(140, 190, 240, 0.34), rgba(140, 190, 240, 0.12));
 color: #d6ebff;
 box-shadow:
 0 0 0 1px rgba(140, 190, 240, 0.4),
 0 0 18px rgba(140, 190, 240, 0.28),
 0 6px 16px rgba(0, 0, 0, 0.3);
}

.qh-chip--race-orc {
 border-color: rgba(220, 90, 90, 0.45);
 background: linear-gradient(180deg, rgba(220, 90, 90, 0.22), rgba(220, 90, 90, 0.06));
 color: #f0a0a0;
}
.qh-chip--race-orc:hover,
.qh-chip--race-orc.is-on {
 border-color: rgba(220, 90, 90, 0.85);
 background: linear-gradient(180deg, rgba(220, 90, 90, 0.34), rgba(220, 90, 90, 0.12));
 color: #ffcfcf;
 box-shadow:
 0 0 0 1px rgba(220, 90, 90, 0.4),
 0 0 18px rgba(220, 90, 90, 0.28),
 0 6px 16px rgba(0, 0, 0, 0.3);
}

.qh-chip--race-dwarf {
 border-color: rgba(230, 200, 70, 0.45);
 background: linear-gradient(180deg, rgba(230, 200, 70, 0.22), rgba(230, 200, 70, 0.06));
 color: #f0d878;
}
.qh-chip--race-dwarf:hover,
.qh-chip--race-dwarf.is-on {
 border-color: rgba(230, 200, 70, 0.85);
 background: linear-gradient(180deg, rgba(230, 200, 70, 0.34), rgba(230, 200, 70, 0.12));
 color: #ffe9a0;
 box-shadow:
 0 0 0 1px rgba(230, 200, 70, 0.4),
 0 0 18px rgba(230, 200, 70, 0.28),
 0 6px 16px rgba(0, 0, 0, 0.3);
}
.qh-pill {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 text-align: center;
 font-size: 0.68rem;
 padding: 3px 8px;
 border-radius: 999px;
 border: 1px solid var(--border);
 color: var(--text-muted);
 background: rgba(0, 0, 0, 0.18);
 line-height: 1.2;
}
.qh-pill--tier-1 {
 color: #86efac;
 border-color: rgba(134, 239, 172, 0.45);
 background: rgba(52, 211, 153, 0.14);
}
.qh-pill--tier-2 {
 color: #93c5fd;
 border-color: rgba(147, 197, 253, 0.45);
 background: rgba(96, 165, 250, 0.14);
}
.qh-pill--tier-3 {
 color: #f0abfc;
 border-color: rgba(240, 171, 252, 0.45);
 background: rgba(217, 70, 239, 0.14);
}
.qh-hub-results {
 display: flex;
 flex-direction: column;
 gap: 22px;
}
.qh-job-group {
 display: flex;
 flex-direction: column;
 gap: 12px;
}
.qh-job-group-title {
 margin: 0;
 font-family: 'Cinzel', serif;
 font-size: 1.05rem;
 letter-spacing: 0.03em;
}
.qh-job-group-title--1 { color: #86efac; }
.qh-job-group-title--2 { color: #93c5fd; }
.qh-job-group-title--3 { color: #f0abfc; }
@media (max-width: 768px) {
 .qh-chip-grid {
 grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
 }
 #qhJobTiers.qh-chip-grid,
 .qh-job-tiers-row {
 grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
 }
}
.qh-job-tiers-row {
 display: grid !important;
 grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
 gap: 8px 10px;
}
.qh-job-classes-grid {
 align-items: stretch;
}
.qh-job-classes-grid .qh-chip {
 white-space: nowrap;
 min-height: 42px;
 height: 100%;
 padding: 10px 12px;
 line-height: 1.15;
 overflow: hidden;
 text-overflow: ellipsis;
}
.qh-job-classes-grid .qh-chip--compact {
 font-size: 0.76rem;
 padding-left: 8px;
 padding-right: 8px;
 letter-spacing: -0.01em;
}
@media (max-width: 768px) {
 .qh-job-classes-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
 }
}

/* ----- Card grid ----- */
.qh-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
 gap: 14px;
}
.qh-card {
 display: flex;
 flex-direction: column;
 gap: 0;
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--qh-radius);
 padding: 0;
 overflow: hidden;
 cursor: pointer;
 text-align: left;
 color: inherit;
 transition: border-color 0.18s, transform 0.18s, background 0.18s;
 min-height: 100%;
 box-sizing: border-box;
}
.qh-card:hover {
 border-color: rgba(201, 168, 76, 0.45);
 background: var(--bg-card-hover);
 transform: translateY(-2px);
}
.qh-card-media {
 position: relative;
 height: 132px;
 background:
 radial-gradient(ellipse at 30% 20%, rgba(201, 168, 76, 0.18), transparent 55%),
 linear-gradient(160deg, #16161f 0%, #0c0c12 100%);
 overflow: hidden;
}
.qh-card-img {
 width: 100%;
 height: 100%;
 object-fit: contain;
 object-position: center;
 padding: 18px;
 box-sizing: border-box;
 filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
 transform: scale(1.05);
 transition: transform 0.25s ease;
}
.qh-class-icon {
 pointer-events: none;
 user-select: none;
 -webkit-user-drag: none;
 -webkit-touch-callout: none;
}
.qh-card-img.is-fallback {
 object-fit: cover;
 padding: 0;
 filter: none;
 transform: none;
 opacity: 0.55;
}
.qh-card:hover .qh-card-img:not(.is-fallback) {
 transform: scale(1.12);
}
.qh-card-media-fade {
 position: absolute;
 inset: 0;
 background: linear-gradient(180deg, rgba(8, 8, 12, 0.05) 20%, rgba(8, 8, 12, 0.72) 100%);
 pointer-events: none;
}
.qh-badge--media {
 position: absolute;
 top: 10px;
 right: 10px;
 z-index: 1;
}
.qh-card-body {
 display: flex;
 flex-direction: column;
 gap: 12px;
 padding: 14px 16px 16px;
 flex: 1;
 min-width: 0;
}
.qh-card-top {
 display: flex;
 justify-content: center;
 gap: 10px;
 align-items: flex-start;
}
.qh-card-title {
 font-family: 'Cinzel', serif;
 font-size: 1.02rem;
 margin: 0;
 line-height: 1.3;
 color: var(--text-primary);
 text-align: center;
 width: 100%;
}
.qh-badge {
 flex-shrink: 0;
 font-size: 0.68rem;
 font-weight: 800;
 letter-spacing: 0.04em;
 text-transform: uppercase;
 padding: 4px 8px;
 border-radius: 6px;
 border: 1px solid rgba(201, 168, 76, 0.3);
 background: var(--qh-accent-soft);
 color: var(--qh-accent);
 white-space: nowrap;
}
.qh-meta {
 display: flex;
 flex-wrap: wrap;
 gap: 6px;
 align-items: center;
 justify-content: center;
}
.qh-pill--chron { color: var(--qh-accent); border-color: rgba(201, 168, 76, 0.25); }
.qh-pill--tag-fire { color: #fb7185; border-color: rgba(251, 113, 133, 0.35); }
.qh-pill--tag-job { color: #a78bfa; border-color: rgba(167, 139, 250, 0.35); }
.qh-pill--tag-gold { color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
.qh-pill--tag-raid { color: #f87171; border-color: rgba(248, 113, 113, 0.35); }
.qh-pill--tag-starter { color: #86efac; border-color: rgba(134, 239, 172, 0.35); }
.qh-pill--tag-clan { color: #93c5fd; border-color: rgba(147, 197, 253, 0.35); }
.qh-pill--tag-sa { color: #c4b5fd; border-color: rgba(196, 181, 253, 0.35); }
.qh-pill--tag-recipe { color: #67e8f9; border-color: rgba(103, 232, 249, 0.35); }
.qh-pill--tag-enchant { color: #fcd34d; border-color: rgba(252, 211, 77, 0.35); }
.qh-pill--tag-acc { color: #f9a8d4; border-color: rgba(249, 168, 212, 0.35); }
.qh-pill--tag-pets { color: #fdba74; border-color: rgba(253, 186, 116, 0.35); }

.qh-npc {
 font-size: 0.82rem;
 color: var(--text-secondary);
 line-height: 1.4;
}
.qh-npc b { color: var(--text-primary); font-weight: 600; }
.qh-npc span { color: var(--text-muted); }

.qh-rewards {
 display: flex;
 gap: 6px;
 flex-wrap: wrap;
 min-height: 28px;
 justify-content: center;
}
.qh-reward-ico {
 width: 28px;
 height: 28px;
 border-radius: 7px;
 border: 1px solid rgba(201, 168, 76, 0.22);
 background: rgba(0, 0, 0, 0.28);
 display: inline-flex;
 align-items: center;
 justify-content: center;
 font-size: 0.72rem;
 color: var(--qh-accent);
 position: relative;
}
.qh-reward-ico[data-tip]:hover::after {
 content: attr(data-tip);
 position: absolute;
 left: 50%;
 bottom: calc(100% + 8px);
 transform: translateX(-50%);
 white-space: nowrap;
 background: #0b0b10;
 border: 1px solid rgba(201, 168, 76, 0.35);
 color: var(--text-primary);
 font-size: 0.7rem;
 padding: 5px 8px;
 border-radius: 6px;
 z-index: 5;
 pointer-events: none;
}

.qh-card-foot {
 margin-top: auto;
 display: flex;
 justify-content: flex-end;
 gap: 8px;
 font-size: 0.75rem;
 color: var(--text-muted);
 border-top: 1px solid rgba(255, 255, 255, 0.04);
 padding-top: 10px;
}

.qh-empty {
 grid-column: 1 / -1;
 text-align: center;
 padding: 48px 16px;
 color: var(--text-muted);
 border: 1px dashed var(--border);
 border-radius: var(--qh-radius);
 background: rgba(0, 0, 0, 0.15);
}

/* ===== Detail page ===== */
.qd-hidden { display: none !important; }

/* Деталь квеста — страница, не модалка: скролл документа свободен */
html:has(body.qh-detail-open),
body.qh-detail-open {
 overflow: auto !important;
 overflow-x: hidden !important;
 overscroll-behavior: auto;
 position: static !important;
 top: auto !important;
 left: auto !important;
 right: auto !important;
 width: auto !important;
 height: auto !important;
 max-height: none !important;
}
body.qh-detail-open.modal-open {
 overflow: auto !important;
 position: static !important;
 top: auto !important;
 width: auto !important;
}

/* Фокус на гайде: без табов хроник и левого рекламного баннера (меню сайдбара остаётся) */
body.qh-detail-open #chronicle-tabs-hub-placeholder,
body.qh-detail-open .catalog-chronicle-tabs-slot,
body.qh-detail-open .chronicle-tabs,
body.qh-detail-open .chronicle-tabs-wrapper,
body.qh-detail-open .chronicle-btn,
body.qh-detail-open .chronicle-tab-btn {
 display: none !important;
}
body.qh-detail-open .sidebar-advertising-slot {
 display: none !important;
}
/* Описание (таймлайн) тянется влево под меню: слева = край меню, справа = край блока «Шаги» */
body.qh-detail-open .db-page-layout,
body.qh-detail-open .db-main,
body.qh-detail-open #qdView,
body.qh-detail-open .qd-layout {
 overflow: visible;
}
body.qh-detail-open .qd-timeline-wrap {
 width: calc(100% + 260px + 24px);
 max-width: none;
 margin-left: calc(-260px - 24px);
 box-sizing: border-box;
}
@media (max-width: 1024px) {
 body.qh-detail-open .qd-timeline-wrap {
 width: calc(100% + 220px + 24px);
 margin-left: calc(-220px - 24px);
 }
}
@media (max-width: 768px) {
 body.qh-detail-open .qd-timeline-wrap {
 width: 100%;
 margin-left: 0;
 }
}
#qdView {
 display: block;
 overflow: visible;
 max-height: none;
}
#qdView:not(.qd-hidden) {
 overflow-y: visible;
 max-height: none;
}
.qd-layout {
 display: grid;
 grid-template-columns: minmax(0, 1fr) 320px;
 gap: 20px;
 align-items: stretch;
 overflow: visible;
}
.qd-main {
 min-width: 0;
 display: flex;
 flex-direction: column;
 height: 100%;
}
.qd-main .qd-summary {
 flex: 1 1 auto;
 margin-bottom: 14px;
 height: 100%;
}
.qd-timeline-wrap {
 grid-column: 1 / -1;
 width: 100%;
 min-width: 0;
}
@media (max-width: 980px) {
 .qd-layout { grid-template-columns: 1fr; align-items: start; }
 .qd-side { order: -1; position: static !important; height: auto; }
 .qd-timeline-wrap { grid-column: 1; }
}
@media (max-width: 768px) {
 .qd-layout {
 grid-template-columns: 1fr;
 gap: 14px;
 }
 .qd-main,
 .qd-side,
 .qd-timeline-wrap {
 grid-column: 1;
 width: 100%;
 max-width: 100%;
 }
}

.qd-summary {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--qh-radius);
 padding: 18px;
 margin-bottom: 18px;
}
.qd-title-row {
 display: flex;
 flex-wrap: wrap;
 gap: 10px;
 align-items: flex-start;
 justify-content: space-between;
 margin-bottom: 14px;
}
.qd-title-row h1 {
 font-family: 'Cinzel', serif;
 font-size: clamp(1.35rem, 2.6vw, 1.85rem);
 margin: 0;
 line-height: 1.25;
}
.qd-keys {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
 gap: 10px;
 margin-bottom: 14px;
}
.qd-key {
 background: rgba(0, 0, 0, 0.22);
 border: 1px solid var(--border);
 border-radius: 10px;
 padding: 10px 12px;
}
.qd-key span {
 display: block;
 font-size: 0.68rem;
 text-transform: uppercase;
 letter-spacing: 0.05em;
 color: var(--text-muted);
 margin-bottom: 4px;
}
.qd-key b {
 color: var(--text-primary);
 font-size: 0.92rem;
 font-weight: 700;
}
.qd-key a { color: var(--qh-accent); }

.qd-npc-box {
 display: flex;
 flex-wrap: wrap;
 gap: 12px;
 align-items: center;
 justify-content: space-between;
 padding: 12px;
 border-radius: 10px;
 border: 1px solid rgba(96, 165, 250, 0.25);
 background: rgba(96, 165, 250, 0.06);
 margin-bottom: 14px;
}
.qd-npc-box strong { color: #93c5fd; }
.qd-npc-meta { font-size: 0.82rem; color: var(--text-secondary); margin-top: 2px; }
.qd-target {
 appearance: none;
 border: 1px solid rgba(96, 165, 250, 0.4);
 background: rgba(96, 165, 250, 0.12);
 color: #bfdbfe;
 border-radius: 8px;
 padding: 8px 12px;
 font-size: 0.8rem;
 font-weight: 700;
 cursor: pointer;
 font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.qd-target:hover { background: rgba(96, 165, 250, 0.2); }
.qd-target.is-copied {
 border-color: rgba(52, 211, 153, 0.45);
 background: rgba(52, 211, 153, 0.14);
 color: #6ee7b7;
}

.qd-rewards-title {
 font-size: 0.78rem;
 text-transform: uppercase;
 letter-spacing: 0.06em;
 color: var(--qh-accent);
 margin: 0 0 8px;
}
.qd-rewards {
 display: flex;
 flex-direction: row;
 flex-wrap: wrap;
 gap: 10px;
 align-items: center;
}
.qd-reward {
 display: inline-flex;
 gap: 10px;
 align-items: center;
 padding: 8px 10px;
 border-radius: 10px;
 border: 1px solid var(--border);
 background: rgba(0, 0, 0, 0.18);
 max-width: 100%;
}
.qd-reward-ico {
 width: 36px;
 height: 36px;
 border-radius: 8px;
 border: 1px solid rgba(201, 168, 76, 0.25);
 display: flex;
 align-items: center;
 justify-content: center;
 background: rgba(201, 168, 76, 0.08);
 flex-shrink: 0;
 font-size: 0.9rem;
 overflow: hidden;
}
.qd-reward-ico img,
.qd-reward-ico-img {
 width: 28px;
 height: 28px;
 object-fit: contain;
 display: block;
}
.qd-reward-name { font-size: 0.82rem; color: var(--text-primary); font-weight: 600; }
.qd-reward-qty { font-size: 0.72rem; color: var(--text-muted); }

/* Stepper */
.qd-progress {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 10px;
 margin-bottom: 14px;
}
.qd-progress-bar {
 flex: 1;
 height: 6px;
 border-radius: 999px;
 background: rgba(255, 255, 255, 0.06);
 overflow: hidden;
}
.qd-progress-bar > i {
 display: block;
 height: 100%;
 width: 0;
 background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
 transition: width 0.25s ease;
}
.qd-progress-label { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

.qd-timeline {
 display: flex;
 flex-direction: column;
 gap: 0;
 position: relative;
 padding-left: 8px;
}
.qd-step {
 display: grid;
 grid-template-columns: 36px minmax(0, 1fr);
 gap: 12px;
 position: relative;
 padding-bottom: 16px;
 scroll-margin-top: calc(var(--header-height, 72px) + 20px);
}
.qd-step:not(:last-child) .qd-step-rail::after {
 content: '';
 position: absolute;
 left: 17px;
 top: 36px;
 bottom: -16px;
 width: 2px;
 background: rgba(201, 168, 76, 0.2);
}
.qd-step-rail {
 position: relative;
}
.qd-step-num {
 width: 36px;
 height: 36px;
 border-radius: 50%;
 border: 2px solid rgba(201, 168, 76, 0.45);
 background: #101018;
 color: var(--qh-accent);
 font-weight: 800;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 0.85rem;
 z-index: 1;
 position: relative;
}
.qd-step.is-done .qd-step-num {
 background: rgba(52, 211, 153, 0.15);
 border-color: rgba(52, 211, 153, 0.55);
 color: var(--qh-ok);
}
.qd-step.is-done .qd-step-num::after {
 content: '✓';
 position: absolute;
 inset: 0;
 display: flex;
 align-items: center;
 justify-content: center;
 font-size: 0.85rem;
 background: rgba(16, 16, 24, 0.92);
 border-radius: 50%;
 color: var(--qh-ok);
}
.qd-step.is-done .qd-step-body {
 opacity: 0.55;
}
.qd-step.is-done .qd-step-head h3 {
 text-decoration: line-through;
 text-decoration-color: rgba(52, 211, 153, 0.55);
 color: var(--text-muted);
}
.qd-step-body {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--qh-radius);
 padding: 14px;
 transition: opacity 0.2s;
}
.qd-step-head {
 display: flex;
 gap: 10px;
 align-items: flex-start;
 justify-content: space-between;
 margin-bottom: 8px;
}
.qd-step-head h3 {
 margin: 0;
 font-size: 1rem;
 font-family: 'Cinzel', serif;
 flex: 1 1 auto;
 min-width: 0;
 white-space: normal;
 overflow: visible;
 word-wrap: break-word;
 line-height: 1.35;
}
.qd-check {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 font-size: 0.75rem;
 color: var(--text-muted);
 cursor: pointer;
 user-select: none;
 white-space: nowrap;
 flex-shrink: 0;
}
.qd-check input { accent-color: var(--qh-ok); }

.qd-step-text {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}
.qd-step-text p { margin: 0 0 0.7em; }
.qd-step-text p:last-child { margin-bottom: 0; }
.qd-step-text h2,
.qd-step-text h3,
.qd-step-text h4 {
  margin: 0.7em 0 0.35em;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.qd-step-text a {
  color: var(--qh-accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
}
.qd-step-text a:hover {
  color: var(--gold-light, #e8c96a);
  border-bottom-color: currentColor;
  text-decoration: none;
}
.qd-step-text ul,
.qd-step-text ol {
 margin: 0.4em 0 0.6em 1.2em;
 padding: 0;
}
.qd-step-text li { margin: 0.2em 0; }
.qd-step-text img,
.qd-step-text figure {
 display: block;
 max-width: 100%;
 height: auto;
 margin: 10px 0;
 border-radius: 8px;
}
.qd-step-text figure img { margin: 0; }
.qd-step-text figcaption {
 font-size: 0.75rem;
 color: var(--text-muted);
 margin-top: 4px;
}
.qd-step-text b,
.qd-step-text strong { color: var(--text-primary); font-weight: 700; }
.qd-step-text i,
.qd-step-text em { font-style: italic; }

.qd-goals {
 display: flex;
 flex-direction: column;
 gap: 6px;
 margin-bottom: 10px;
}
.qd-goal {
 display: flex;
 flex-wrap: wrap;
 gap: 8px;
 align-items: center;
 font-size: 0.8rem;
 padding: 8px 10px;
 border-radius: 8px;
 background: rgba(0, 0, 0, 0.2);
 border: 1px solid rgba(255, 255, 255, 0.04);
}
.qd-goal-type {
 font-size: 0.65rem;
 font-weight: 800;
 text-transform: uppercase;
 letter-spacing: 0.04em;
 color: var(--qh-accent);
}
.qd-goal-drop { color: #fbbf24; font-weight: 700; }

.qd-callout {
 border-radius: 10px;
 padding: 10px 12px;
 font-size: 0.82rem;
 line-height: 1.45;
 margin-top: 8px;
 border: 1px solid transparent;
}
.qd-callout--warn {
 background: rgba(245, 158, 11, 0.08);
 border-color: rgba(245, 158, 11, 0.3);
 color: #fcd34d;
}
.qd-callout--tip {
 background: rgba(96, 165, 250, 0.08);
 border-color: rgba(96, 165, 250, 0.3);
 color: #bfdbfe;
}
.qd-callout--hot {
 background: rgba(239, 68, 68, 0.08);
 border-color: rgba(239, 68, 68, 0.3);
 color: #fca5a5;
}

/* Sidebar */
.qd-side {
 position: sticky;
 top: 88px;
 display: flex;
 flex-direction: column;
 gap: 12px;
 height: 100%;
 min-height: 100%;
 align-self: stretch;
}
.qd-side-card {
 background: var(--bg-card);
 border: 1px solid var(--border);
 border-radius: var(--qh-radius);
 padding: 14px;
 flex: 1 1 auto;
 display: flex;
 flex-direction: column;
 min-height: 100%;
 height: 100%;
 box-sizing: border-box;
}
.qd-side-card h4 {
 margin: 0 0 10px;
 font-size: 0.78rem;
 text-transform: uppercase;
 letter-spacing: 0.06em;
 color: var(--qh-accent);
 font-family: 'Cinzel', serif;
}
.qd-toc {
 display: flex;
 flex-direction: column;
 gap: 4px;
 flex: 1 1 auto;
 max-height: 490px;
 overflow-x: hidden;
 overflow-y: auto;
 padding-right: 4px;
 scrollbar-width: thin;
 scrollbar-color: rgba(201, 168, 76, 0.45) rgba(255, 255, 255, 0.04);
}
.qd-toc::-webkit-scrollbar {
 width: 5px;
}
.qd-toc::-webkit-scrollbar-track {
 background: rgba(255, 255, 255, 0.04);
 border-radius: 999px;
}
.qd-toc::-webkit-scrollbar-thumb {
 background: rgba(201, 168, 76, 0.4);
 border-radius: 999px;
}
.qd-toc::-webkit-scrollbar-thumb:hover {
 background: rgba(201, 168, 76, 0.65);
}
.qd-toc-item {
 display: flex;
 align-items: center;
 gap: 10px;
 padding: 6px 6px 6px 8px;
 border-radius: 8px;
 transition: background 0.15s ease, opacity 0.15s ease;
}
.qd-toc-item:hover {
 background: var(--qh-accent-soft);
}
.qd-toc-item.is-active {
 background: var(--qh-accent-soft);
}
.qd-toc-item.is-done {
 opacity: 0.62;
}
.qd-toc-item.is-done .qd-toc-title {
 text-decoration: line-through;
 text-decoration-color: rgba(52, 211, 153, 0.5);
 color: var(--text-muted);
}
.qd-toc-item.is-done .qd-toc-num {
 border-color: rgba(52, 211, 153, 0.55);
 color: var(--qh-ok);
 background: rgba(52, 211, 153, 0.12);
}
.qd-toc-check {
 display: inline-flex;
 align-items: center;
 justify-content: center;
 flex-shrink: 0;
 width: 16px;
 height: 16px;
 margin: 0;
 padding: 0;
 cursor: pointer;
 line-height: 1;
}
.qd-toc-check input {
 width: 14px;
 height: 14px;
 margin: 0;
 padding: 0;
 flex-shrink: 0;
 accent-color: var(--qh-ok);
 cursor: pointer;
 vertical-align: middle;
}
.qd-toc-link {
 display: flex;
 align-items: center;
 gap: 10px;
 flex: 1 1 auto;
 min-width: 0;
 color: var(--text-secondary);
 text-decoration: none;
 font-size: 0.8rem;
 line-height: 1.35;
 padding: 0;
}
.qd-toc-link:hover,
.qd-toc-item.is-active .qd-toc-link {
 color: var(--qh-accent);
}
.qd-toc-num {
 flex-shrink: 0;
 width: 20px;
 height: 20px;
 border-radius: 50%;
 border: 1px solid rgba(201, 168, 76, 0.35);
 display: inline-flex;
 align-items: center;
 justify-content: center;
 font-size: 0.68rem;
 font-weight: 700;
 color: var(--qh-accent);
 line-height: 1;
 margin: 0;
}
.qd-toc-title {
 min-width: 0;
 flex: 1 1 auto;
 white-space: normal;
 word-wrap: break-word;
 line-height: 1.35;
}
.qd-toc a {
 color: var(--text-secondary);
 text-decoration: none;
 font-size: 0.8rem;
 padding: 6px 8px;
 border-radius: 7px;
 white-space: normal;
 overflow: visible;
 line-height: 1.35;
 word-wrap: break-word;
}
.qd-toc a:hover,
.qd-toc a.is-active {
 background: var(--qh-accent-soft);
 color: var(--qh-accent);
}
.qd-back {
 display: inline-flex;
 align-items: center;
 gap: 6px;
 color: var(--qh-accent);
 text-decoration: none;
 font-size: 0.85rem;
 margin-bottom: 12px;
}
.qd-back:hover { text-decoration: underline; }

.qh-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 40px));
  background: var(--bg-card);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 40000;
  font-weight: 600;
  font-size: 0.85rem;
  transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
}
.qh-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

@media (max-width: 768px) {
 .qh-page { padding: 64px 14px 48px; }
 .qh-filters { padding: 12px; }
 .qh-chips-wrap {
 flex-direction: column;
 gap: 8px;
 }
 .qh-chips,
 .qh-levels {
 gap: 8px;
 }
 .qh-chip,
 .qh-lvl {
 font-size: 0.8rem;
 padding: 10px 12px;
 }
 .qh-chip-ico { font-size: 1.05rem; }
 .qh-reset { align-self: flex-end; }
 .qh-grid { grid-template-columns: 1fr; }
 .qh-card-media { height: 120px; }
 .qd-step { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
 .qd-step-num { width: 28px; height: 28px; font-size: 0.75rem; }
 .qd-step:not(:last-child) .qd-step-rail::after { left: 13px; top: 30px; }
 .qd-npc-box { flex-direction: column; align-items: stretch; }
 .qd-target { width: 100%; text-align: center; }
}

/* Locations hub (/db-maps): floor the card grid at Dion’s list so the catalog sidebar
   and page bottom do not jump when switching city chips (Dion 7 cards ↔ Oren 6). */
.loc-grid {
  --loc-card-h: 52px;
  --loc-gap: 10px;
  align-content: start;
  min-height: calc(4 * var(--loc-card-h) + 3 * var(--loc-gap));
}
.loc-card { min-height: var(--loc-card-h); box-sizing: border-box; }
@media (min-width: 1100px) {
  .loc-grid { min-height: calc(3 * var(--loc-card-h) + 2 * var(--loc-gap)); }
}
@media (max-width: 520px) {
  .loc-grid { min-height: calc(7 * var(--loc-card-h) + 6 * var(--loc-gap)); }
}
