.level-budget [id] { scroll-margin-top: 5rem; }
.level-budget :is(a, summary):focus-visible { outline: 2px solid #f0ca8b; outline-offset: 3px; }
.level-budget :is(p, li, dd) { text-wrap: pretty; }
.level-budget a { text-underline-offset: .18em; }
.level-budget .dg-section a { color: #efd5a7; text-decoration: underline; }
.level-budget .dg-section a:hover { color: #fff1d6; }
.level-budget .level-budget-nav { margin: 14px 0 16px; }
.level-budget-nav a { justify-content: center; min-width: 46px; min-height: 44px; }
.level-budget-nav a[aria-current="page"] { border-color: #e1c28e; color: #fff0d1; background: #32291b; }

.level-route-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.level-route-list > li { min-width: 0; padding: 10px 12px; border: 1px solid #6b583b; background: #172018; }
.level-budget .level-route-list a {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    text-decoration: none;
}
.level-route-list a:hover strong { text-decoration: underline; }
.level-route-list a .icon, .level-route-action .icon { width: 16px; height: 16px; }
.level-route-list img { object-fit: contain; border: 1px solid #796443; background: #0e1511; }
.level-route-list strong { display: block; color: #f6e3c1; font: 600 1.35rem/1.15 var(--serif, Georgia, serif); }
.level-route-list small { display: block; margin-top: 3px; color: #e1cba5; }
.level-route-list p { margin: 7px 0 0; color: #e6ddca; line-height: 1.45; }
.level-route-hub-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.level-route-hub-notes > section { margin: 0; }
.level-route-action { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.level-budget-note { margin: 12px 0 8px; padding: 10px 12px; border: 1px solid #6b583b; background: #171e16; }
.level-budget-note p { max-width: 86ch; margin: 0; }
.level-budget-note a { color: #efd5a7; text-decoration: underline; }
.level-step-references { display: flex; flex-wrap: wrap; gap: 2px 15px; margin-top: 3px; }
.level-step-references a { display: inline-flex; align-items: center; min-height: 35px; }

.level-budget-stage { padding-bottom: 22px; }
.level-budget-stage + .level-budget-stage { padding-top: 24px; border-top: 1px solid #63543d; }
.level-budget-stage:last-child { padding-bottom: 0; }
.level-budget-stage h2 { max-width: 39ch; margin-top: 2px; text-wrap: balance; }
.level-budget-stage > header p { margin: 0 0 3px; color: #e1c28e; font-weight: 700; }
.level-budget-stage-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 21px clamp(24px, 4vw, 54px); align-items: start; }
.level-budget-steps > ol { max-width: 72ch; margin: 0; padding-inline-start: 1.45em; }
.level-budget-steps > ol > li { padding-inline-start: .25em; }
.level-budget-steps > ol > li + li { margin-top: .7em; }
.level-budget-steps > ol > li::marker { color: #e1c28e; font-weight: 700; font-variant-numeric: tabular-nums; }

.level-budget-equipment { min-width: 0; }
.level-gear-group + .level-gear-group { margin-top: 14px; }
.level-budget .level-gear-group h3 {
    margin: 0 0 7px;
    color: #f1dcba;
    font: 600 1.2rem/1.25 var(--serif, Georgia, serif);
}
.level-gear-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.level-gear-tile {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 8px 9px 2px;
    background: #172018;
    border: 1px solid #6b583b;
    overflow-wrap: anywhere;
}
.level-gear-tile:target { border-color: #e1c28e; }
.level-budget .dg-section .level-gear-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    line-height: 1.3;
    text-decoration: none;
}
.level-budget .level-gear-item:hover strong { text-decoration: underline; }
.level-gear-item img { flex: none; width: 42px; height: 42px; object-fit: contain; border: 1px solid #6b583b; background: #0e1511; }
.level-gear-item .help-preview-cue { margin-inline-start: auto; }
.level-gear-item small { display: block; margin-top: 2px; color: #d9c4a1; }
.level-gear-tile > p { margin: 5px 0 2px; color: #dfd3be; font-size: .94em; line-height: 1.35; }
.level-gear-actions { display: flex; flex-wrap: wrap; column-gap: 12px; margin-top: auto; }
.level-budget .level-gear-source {
    display: inline-flex;
    align-self: start;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    line-height: 1.25;
}
.level-gear-source .icon { width: 13px; height: 13px; flex: none; }
.level-gear-tile:has(> .help-inline-preview) { grid-column: 1 / -1; }

.level-budget-classes dl, .level-grace-group dl { margin: 0; }
.level-budget-classes dl > div, .level-grace-group dl > div {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 64ch);
    gap: 5px 18px;
    padding: 9px 0;
    border-bottom: 1px solid #63543d;
}
.level-budget-classes dt, .level-grace-group dt { font-weight: 700; color: #efd5a7; }
.level-budget-classes dd, .level-grace-group dd { margin: 0; }
.level-grace-group dl > div { grid-template-columns: minmax(0, 19rem) minmax(0, 74ch); }
.level-grace-group dl > div:last-child { border-bottom: 0; }

@media (max-width: 940px) {
    .level-budget-stage-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 840px) {
    .level-route-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
    .level-budget-classes dl > div, .level-grace-group dl > div, .level-route-hub-notes { grid-template-columns: minmax(0, 1fr); }
    .level-budget-stage h2 { text-wrap: wrap; }
}
