.page-quests .rk-main {
    background: #e8f1df;
}

.quests-page-head {
    min-height: 198px;
    padding: 32px 28px;
    color: #fffbe4;
    background-color: var(--rk-deep);
    background-image: url("../images/grass-tile.webp");
    background-repeat: repeat;
    background-size: 96px 96px;
    border-bottom: 8px solid var(--rk-sand);
}

.quests-page-head-inner {
    display: flex;
    width: min(100%, 1280px);
    min-height: 126px;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 0 auto;
}

.quests-page-title-block {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 18px;
    text-shadow: 2px 2px 0 var(--rk-deep-dark);
}

.quests-page-sprite {
    display: block;
    width: 96px;
    height: 96px;
    flex: 0 0 auto;
    background: url("../images/ui-sprites.webp") -96px 0 / 768px 768px no-repeat;
    image-rendering: pixelated;
    filter: drop-shadow(3px 3px 0 rgba(4, 48, 47, 0.72));
}

.quests-page-title-block p,
.quests-section-head p,
.quests-model-panel header p,
.quests-route-panel header p,
.quests-next-panel header p {
    margin: 0 0 2px;
    color: #fff1a2;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.quests-page-title-block h1 {
    margin: 0;
    font-size: 40px;
    line-height: 1.08;
}

.quests-page-title-block > div > span {
    display: block;
    max-width: 680px;
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
}

.quests-scope-badge {
    display: grid;
    min-width: 248px;
    padding: 15px 17px;
    color: var(--rk-ink);
    background: var(--rk-paper);
    border: var(--rk-line);
    border-radius: 6px;
    box-shadow: 5px 5px 0 rgba(4, 48, 47, 0.45);
    text-align: center;
}

.quests-scope-badge strong {
    color: var(--rk-deep);
    font-size: 17px;
    text-transform: uppercase;
}

.quests-scope-badge span {
    margin-top: 5px;
    color: #8b5a17;
    font-size: 13px;
    font-weight: 900;
}

.quests-scope-badge small {
    margin-top: 9px;
    color: #60766a;
    font-size: 10px;
    font-weight: 800;
}

.quests-workspace {
    width: min(calc(100% - 40px), 1280px);
    margin: 0 auto;
    padding: 28px 0 72px;
}

.quests-route-tabs {
    display: grid;
    align-items: stretch;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(240px, 0.8fr);
    overflow: hidden;
    background: #dce9d2;
    border: var(--rk-line);
    border-radius: 6px;
    box-shadow: 4px 4px 0 #7b9b72;
}

.quests-route-tabs > button {
    display: flex;
    min-width: 0;
    min-height: 65px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--rk-ink);
    background: #f7f1d6;
    border: 0;
    border-right: 2px solid rgba(24, 58, 54, 0.42);
    cursor: pointer;
    text-align: left;
}

.quests-route-tabs > button:hover { background: #f3dda0; }

.quests-route-tabs > button.is-active {
    color: #fff;
    background: var(--rk-deep);
}

.quests-route-tabs > button > span:last-child {
    display: grid;
    gap: 3px;
}

.quests-route-tabs strong {
    font-size: 13px;
    text-transform: uppercase;
}

.quests-route-tabs small {
    color: #638073;
    font-size: 10px;
    font-weight: 800;
}

.quests-route-tabs .is-active small { color: #d7ecd4; }

.quests-route-icon {
    display: block;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    background-image: url("../images/ui-sprites.webp");
    background-repeat: no-repeat;
    background-size: 256px 256px;
    image-rendering: pixelated;
}

.quests-route-icon.is-all { background-position: -64px 0; }
.quests-route-icon.is-kid { background-position: -96px 0; }
.quests-route-icon.is-teen { background-position: -96px -192px; }

.quests-route-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    color: var(--rk-deep);
    background: #fffdf0;
}

.quests-route-actions > span {
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.quests-reset-button {
    min-height: 30px;
    padding: 4px 8px;
    color: var(--rk-ink);
    background: #f7e3a5;
    border: 1px solid var(--rk-ink);
    border-radius: 3px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.quests-reset-button:hover,
.quests-reset-button:focus-visible { background: #f0c96d; }

.quests-overview {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 26px;
    margin-top: 16px;
    padding: 20px 22px;
    background: var(--rk-paper-strong);
    border: var(--rk-line);
    border-radius: 6px;
    box-shadow: 4px 4px 0 #91a976;
}

.quests-kicker {
    margin: 0 0 5px;
    color: #a16a19;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.quests-overview-copy h2 {
    margin: 0;
    color: var(--rk-deep);
    font-size: 25px;
    line-height: 1.15;
}

.quests-overview-copy > p:last-child {
    max-width: 680px;
    margin: 8px 0 0;
    color: #587067;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 700;
}

.quests-progress-block {
    padding: 14px 15px;
    background: #eef5e3;
    border: 1px solid #9bb18c;
    border-radius: 4px;
}

.quests-progress-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: #60766a;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.quests-progress-label strong {
    color: var(--rk-deep);
    font-size: 28px;
    line-height: 1;
}

.quests-progress-track {
    height: 13px;
    margin-top: 10px;
    overflow: hidden;
    background: #cbd9c1;
    border: 2px solid var(--rk-ink);
    border-radius: 3px;
}

.quests-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: var(--rk-green);
    transition: width 160ms ease;
}

.quests-count-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0 0;
}

.quests-count-grid div { min-width: 0; }
.quests-count-grid dt { color: #718278; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.quests-count-grid dd { margin: 2px 0 0; color: var(--rk-deep); font-size: 18px; font-weight: 900; }

.quests-filter-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 10px 12px;
    background: #dce9d2;
    border: var(--rk-line);
    border-radius: 5px;
}

.quests-filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.quests-filter-label,
.quests-category-filter {
    color: #587067;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.quests-filter-label { margin-right: 3px; }

.quests-filter-group button {
    min-height: 28px;
    padding: 3px 9px;
    color: var(--rk-ink);
    background: #f7f1d6;
    border: 1px solid #829e79;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.quests-filter-group button:hover,
.quests-filter-group button.is-active { color: #fff; background: var(--rk-deep); border-color: var(--rk-ink); }

.quests-category-filter {
    display: flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.quests-category-filter select {
    min-height: 30px;
    padding: 3px 25px 3px 7px;
    color: var(--rk-ink);
    background: #fffdf0;
    border: 1px solid #829e79;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 800;
}

.quests-results-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 19px 2px 11px;
    color: #62756b;
    font-size: 11px;
    font-weight: 800;
}

.quests-results-status p { margin: 0; }
.quests-results-status strong { color: var(--rk-deep); }

.quests-layout {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1.6fr) minmax(285px, 0.72fr);
    gap: 18px;
}

.quests-list-panel {
    min-width: 0;
    padding: 18px;
    background: #f4f6e8;
    border: var(--rk-line);
    border-radius: 6px;
    box-shadow: 4px 4px 0 #77966f;
}

.quests-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 2px solid #9bb18c;
}

.quests-section-head h2 {
    margin: 0;
    color: var(--rk-deep);
    font-size: 23px;
    line-height: 1.1;
}

.quests-open-badge {
    padding: 5px 8px;
    color: #6b541d;
    background: #f5dc83;
    border: 1px solid #9a731d;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.quests-list {
    display: grid;
    gap: 13px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.quest-card {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    min-width: 0;
    background: #fffdf0;
    border: 2px solid #7f9e7b;
    border-radius: 4px;
    box-shadow: 3px 3px 0 #c0cfb0;
}

.quest-card.is-complete { background: #eff5e6; border-color: #56875d; }
.quest-card.is-locked { background: #f5f0d9; border-color: #a7ae92; }

.quest-card-rail {
    display: flex;
    align-items: start;
    justify-content: center;
    padding-top: 17px;
    color: #fff;
    background: var(--rk-deep);
    border-radius: 2px 0 0 2px;
}

.quest-card-rail span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 2px solid #d7ecd4;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 900;
}

.quest-card.is-complete .quest-card-rail { background: var(--rk-green-dark); }
.quest-card.is-locked .quest-card-rail { background: #8d9781; }

.quest-card-body { min-width: 0; padding: 14px 15px 12px; }

.quest-card-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.quest-card-title-wrap { min-width: 0; }

.quest-card-title-wrap p {
    margin: 0 0 3px;
    color: #a16a19;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.quest-card-title-wrap h3 {
    margin: 0;
    color: var(--rk-deep);
    font-size: 18px;
    line-height: 1.2;
}

.quest-route-pill {
    flex: 0 0 auto;
    padding: 4px 7px;
    color: #286172;
    background: #d7eef0;
    border: 1px solid #7faeb4;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.quest-complete-toggle {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    padding: 3px 7px;
    color: var(--rk-ink);
    background: #f5e6a8;
    border: 1px solid #9b7c22;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.quest-complete-toggle input { accent-color: var(--rk-green-dark); }
.quest-complete-toggle:has(input:disabled) { color: #56645a; background: #ece9d7; border-color: #939d8b; cursor: not-allowed; }

.quest-objective {
    margin: 10px 0 0;
    color: #455f57;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 800;
}

.quest-instruction-list {
    display: grid;
    gap: 4px;
    margin: 9px 0 0;
    padding-left: 18px;
    color: #5c7065;
    font-size: 11px;
    line-height: 1.4;
    font-weight: 700;
}

.quest-step-notes {
    margin-top: 9px;
    padding: 7px 9px;
    color: #6d7154;
    background: #f7f2d8;
    border-left: 3px solid #c1a44c;
    font-size: 10px;
    line-height: 1.4;
    font-weight: 700;
}

.quest-step-notes p { margin: 0; }

.quest-references {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 11px;
}

.quest-ref-chip {
    display: inline-flex;
    min-height: 35px;
    flex-direction: column;
    justify-content: center;
    padding: 4px 7px;
    color: var(--rk-ink);
    background: #e9f0d9;
    border: 1px solid #8ea379;
    border-radius: 3px;
    text-decoration: none;
}

.quest-ref-chip:hover,
.quest-ref-chip:focus-visible { background: #fff1b6; }

.quest-ref-chip.is-fish { background: #dff0ed; border-color: #75a6a3; }
.quest-ref-chip.is-gear { background: #f7e7bf; border-color: #b8975b; }
.quest-ref-chip.is-story-reward { background: #f4e3a1; border-color: #a78227; }
.quest-ref-chip strong { font-size: 10px; line-height: 1.1; }
.quest-ref-chip small { margin-top: 2px; color: #65766d; font-size: 8px; font-weight: 900; }

.quest-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 9px;
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px solid #c3d1b6;
}

.quest-map-chip,
.quest-checkpoint-chip {
    padding: 4px 7px;
    color: #385c4a;
    background: #dfead1;
    border: 1px solid #8aa57d;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.quest-checkpoint-chip { color: #6b541d; background: #f5dc83; border-color: #9a731d; }

.quest-link {
    color: #0a6f91;
    font-size: 10px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

.quest-link:hover { text-decoration: underline; }

.quest-requirement {
    margin: 8px 0 0;
    color: #718278;
    font-size: 9px;
    font-weight: 800;
}

.quest-requirement.is-locked { color: #9b5c36; }

.quest-flag-details {
    margin-top: 8px;
    color: #607269;
    font-size: 10px;
}

.quest-flag-details summary { cursor: pointer; font-weight: 900; }
.quest-flag-details dl { display: grid; gap: 4px; margin: 7px 0 0; padding: 7px; background: #f7f2d8; border: 1px solid #bdc49e; }
.quest-flag-details dl div { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 7px; }
.quest-flag-details dt { color: #9b6b1f; font-weight: 900; text-transform: uppercase; }
.quest-flag-details dd { margin: 0; overflow-wrap: anywhere; }

.quests-side-panel { display: grid; gap: 17px; }
.quests-side-panel > section { box-shadow: 4px 4px 0 #77966f; }

.quests-model-panel,
.quests-route-panel,
.quests-next-panel {
    overflow: hidden;
    background: #fffdf0;
    border: var(--rk-line);
    border-radius: 5px;
}

.quests-model-panel > header,
.quests-route-panel > header,
.quests-next-panel > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    color: #fff;
    background: var(--rk-deep);
}

.quests-model-panel header h2,
.quests-route-panel header h2,
.quests-next-panel header h2 { margin: 0; font-size: 17px; line-height: 1.1; }

.quests-side-icon {
    display: block;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    background-image: url("../images/ui-sprites.webp");
    background-repeat: no-repeat;
    background-size: 320px 320px;
    image-rendering: pixelated;
}

.quests-side-icon.is-flag { background-position: 0 -160px; }
.quests-side-icon.is-route { background-position: -80px 0; }
.quests-side-icon.is-next { background-position: -40px -160px; }

.quests-model-panel > p,
.quests-route-panel > p,
.quests-next-panel > p { margin: 0; padding: 13px 14px 7px; color: #526960; font-size: 11px; line-height: 1.45; font-weight: 800; }

.quests-model-meta { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 7px 14px 13px; }
.quests-model-meta div { min-width: 0; }
.quests-model-meta dt { color: #a16a19; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.quests-model-meta dd { margin: 3px 0 0; color: var(--rk-deep); font-size: 10px; font-weight: 900; }

.quests-route-totals { display: grid; gap: 6px; margin: 0; padding: 7px 14px 14px; list-style: none; }
.quests-route-totals li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px; color: #557067; background: #eef4e4; border: 1px solid #c1d0b6; font-size: 10px; font-weight: 800; }
.quests-route-totals strong { color: var(--rk-deep); }

.quests-data-state { padding: 22px; color: #52645a; background: #fffdf0; border: 1px dashed #829576; text-align: center; font-size: 12px; }
.quests-data-state.is-error { color: #8f3d32; background: #f9e5d9; border-color: #bf6c5b; }
.quests-noscript { margin-top: 15px; padding: 15px; color: #fff; background: var(--rk-red); border: var(--rk-line); font-weight: 900; }

@media (max-width: 1120px) {
    .quests-route-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .quests-route-actions { grid-column: 1 / -1; border-top: 2px solid rgba(24, 58, 54, 0.42); }
}

@media (max-width: 940px) {
    .quests-page-head-inner { align-items: stretch; flex-direction: column; }
    .quests-scope-badge { width: 100%; }
    .quests-overview { grid-template-columns: 1fr; }
    .quests-layout { grid-template-columns: 1fr; }
    .quests-side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .quests-next-panel { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .quests-page-head { padding: 27px 18px; }
    .quests-page-title-block h1 { font-size: 31px; }
    .quests-page-sprite { width: 76px; height: 76px; background-position: -76px 0; background-size: 608px 608px; }
    .quests-workspace { width: min(calc(100% - 24px), 1280px); padding-top: 20px; }
    .quests-route-tabs { grid-template-columns: 1fr; }
    .quests-route-tabs > button { border-right: 0; border-bottom: 2px solid rgba(24, 58, 54, 0.42); }
    .quests-route-actions { grid-column: auto; border-top: 0; }
    .quests-filter-panel { align-items: flex-start; flex-direction: column; }
    .quests-results-status { align-items: flex-start; flex-direction: column; gap: 4px; }
    .quest-card-head { flex-direction: column; gap: 8px; }
    .quest-card-body { padding-right: 10px; }
    .quests-side-panel { display: block; }
    .quests-side-panel > section { margin-top: 17px; }
    .quests-side-panel > section:first-child { margin-top: 0; }
}
