.sgl.sr-bis {
    --sgl-columns: minmax(67px, .62fr) minmax(0, 1.48fr) minmax(0, 1.38fr) minmax(0, 1.5fr);
    --sgl-rule: #635238;
    --sgl-brass: #e4c690;
    container-type: inline-size;
    padding: 14px;
    border: 1px solid #7b623d;
    background: linear-gradient(155deg, #24251e, #171e1a 53%, #1a201b);
    box-shadow: inset 0 0 0 2px #100f0c, 0 3px 10px #0006;
    color: #e4decb;
    scroll-margin-top: 104px;
}

.sgl :is(h4, h5, h6, p, ul) {
    margin: 0;
}

.sgl ul {
    padding: 0;
    list-style: none;
}

.sgl .sgl-top {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 16px;
}

.sgl .sgl-top h4 {
    color: #f2d8a4;
    font-size: clamp(20px, 2.2vw, 26px);
    line-height: 1.22;
    margin: 0 0 4px;
}

.sgl .sgl-top p,
.sgl .sgl-jump {
    color: #cbbd9f;
    font: 14px/1.5 system-ui, sans-serif;
}

.sgl .sgl-top p a {
    color: #ead099;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sgl .sgl-jump:not([hidden]) {
    display: grid;
    gap: 4px;
}

.sgl .sgl-jump select {
    width: 100%;
    min-width: 145px;
    min-height: 38px;
    padding: 5px 10px;
    border: 1px solid #8a7146;
    border-radius: 2px;
    background: #161c18;
    color: #f0d8a8;
    font: inherit;
}

.sgl .sgl-column-labels,
.sgl .sgl-slot {
    display: grid;
    grid-template-columns: var(--sgl-columns);
    align-items: start;
    gap: 8px 14px;
    padding: 12px;
}

.sgl .sgl-column-labels {
    background: #171a16;
    border: 1px solid var(--sgl-rule);
    border-bottom: 0;
    color: #cbb587;
    font: 600 12px/1.35 system-ui, sans-serif;
}

.sgl .sgl-group {
    min-width: 0;
    border: 1px solid var(--sgl-rule);
}

.sgl .sgl-group + .sgl-group {
    margin-top: 12px;
}

.sgl .sgl-group h5 {
    padding: 8px 12px;
    background: linear-gradient(100deg, #44321e, #2d271e 76%);
    border-bottom: 1px solid var(--sgl-rule);
    color: #f0d19a;
    font-size: 16px;
    line-height: 1.25;
}

.sgl .sgl-slot {
    min-width: 0;
    background: #151e19;
    scroll-margin-top: 104px;
}

.sgl .sgl-slot:nth-child(even) {
    background: #20251d;
}

.sgl .sgl-slot + .sgl-slot {
    border-top: 1px solid #4b4635;
}

.sgl .sgl-slot h6 {
    color: var(--sgl-brass);
    font: 600 13px/1.45 system-ui, sans-serif;
    margin: 3px 0 0;
}

.sgl .sgl-slot > .sgl-item {
    display: contents;
}

.sgl .sgl-identity {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.sgl .sgl-icon {
    display: block;
    width: 36px;
    aspect-ratio: 1;
    border: 1px solid #826a40;
    background: #111810;
}

.sgl .sgl-icon:empty {
    display: none;
}

.sgl .sgl-identity:has(.sgl-icon:empty) {
    grid-template-columns: minmax(0, 1fr);
}

.sgl .sgl-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sgl.sr-bis .sgl-name:is(:link, :visited) {
    color: #f4dfb4;
    font: 700 16px/1.32 Georgia, serif;
    padding: 0 !important;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.sgl.sr-bis a.sgl-name.rare:is(:link, :visited) { color: #a4cefc !important; }
.sgl.sr-bis a.sgl-name.epic:is(:link, :visited) { color: #dfb1ff !important; }
.sgl.sr-bis .sgl-name:is(:hover, :focus-visible) { text-decoration: underline; }

.sgl .sgl-stats,
.sgl .sgl-source,
.sgl .sgl-tradeoff {
    min-width: 0;
    color: #e1ddc9;
    font: 14px/1.45 system-ui, sans-serif;
    overflow-wrap: anywhere;
}

.sgl .sgl-stats {
    display: flex;
    flex-wrap: wrap;
    column-gap: 8px;
}

.sgl .sgl-stats li + li::before {
    content: '·';
    color: #ae996d;
    margin-right: 6px;
}

.sgl.sr-bis a.sgl-acquisition:is(:link, :visited) {
    padding: 0 !important;
    color: #efd18a;
    text-decoration: underline;
    text-decoration-color: #aa8c57;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    box-decoration-break: clone;
}

.sgl.sr-bis a.sgl-acquisition:is(:hover, :focus-visible) {
    color: #ffe7b5;
    text-decoration-color: currentColor;
}

.sgl .sgl-source small {
    display: block;
    color: #edc47f;
    font-size: 13px;
    line-height: 1.4;
    margin-top: 3px;
}

.sgl .sgl-source .sgl-source-note {
    color: #c4b89a;
}

.sgl .sgl-alternatives {
    grid-column: 2 / -1;
}

.sgl :is(.sgl-alternatives, .sgl-fitting) > summary {
    display: list-item;
    width: fit-content;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #7e6943;
    border-radius: 2px;
    background: linear-gradient(#332b20, #211c17);
    color: #f0d59b;
    font: 600 13px/1.5 system-ui, sans-serif;
    cursor: pointer;
}

.sgl :is(summary, a, select):focus-visible,
.sgl .sgl-slot:focus {
    outline: 2px solid #f6d988;
    outline-offset: 2px;
}

.sgl .sgl-alternatives .sgl-item {
    display: grid;
    grid-template-columns: minmax(0, 1.48fr) minmax(0, 1.38fr) minmax(0, 1.5fr);
    gap: 6px 14px;
    margin-top: 8px;
    padding: 9px 10px;
    border-left: 2px solid #8f7447;
    background: #0e1712;
}

.sgl .sgl-tradeoff {
    grid-column: 1 / -1;
    color: #c4b89a;
    font-size: 13px;
}

.sgl .sgl-set-note {
    margin-top: 12px;
    color: #dcccae;
    font: 14px/1.45 system-ui, sans-serif;
}

.sgl .sgl-fitting {
    margin-top: 16px;
}

.sgl .sgl-fitting-stage {
    max-width: 650px;
    margin: 12px auto 0;
}

.sgl .sgl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

@container (max-width: 610px) {
    .sgl .sgl-column-labels {
        display: none;
    }

    .sgl .sgl-slot {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
        padding: 11px 10px;
    }

    .sgl .sgl-slot h6 {
        margin: 0 0 1px;
    }

    .sgl .sgl-alternatives {
        grid-column: 1;
        margin-top: 3px;
    }

    .sgl .sgl-alternatives > summary {
        min-height: 44px;
        padding-block: 8px;
    }

    .sgl .sgl-alternatives .sgl-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }
}

@media (max-width: 760px) {
    .sgl-in-view > .sr-guide-contents-return:not(:focus) {
        visibility: hidden;
    }

    .sgl.sr-bis {
        padding: 10px;
        scroll-margin-top: 52px;
    }

    .sgl .sgl-slot {
        scroll-margin-top: 52px;
    }
}
.sr-bis .sr-bis-character-window:has(.sr-bis-model) {
    align-items: start;
}

.sr-bis .sr-bis-character.sr-bis-model {
    display: flex;
    flex-direction: column;
    align-self: start;
    align-items: stretch;
    justify-content: start;
    min-height: 0;
    max-height: none;
    border: 1px solid #725a36;
    border-radius: 2px;
    background: #151613;
    box-shadow: 0 5px 12px #0807049c, 0 0 0 2px #151410;
    scroll-margin-top: 110px;
}

.sr-bis .sr-bis-model::before,
.sr-bis .sr-bis-model::after {
    content: none;
}

.sr-bis .sr-bis-model-frame {
    display: block;
    width: 100%;
    height: 414px;
    border: 0;
}

.sr-bis .sr-bis-character.sr-bis-model figcaption {
    position: static;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    align-items: baseline;
    padding: 8px 10px;
    border-top: 1px solid #5c4b32;
    background: linear-gradient(#2a251b, #1a1813);
    color: #c3b18a;
    text-align: left;
    font-size: 12px;
}

.sr-bis .sr-bis-model figcaption a {
    color: #efd59d;
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 760px) {
    .sr-bis .sr-bis-body:has(.sr-bis-model) {
        padding-inline: 4px;
    }

    .sr-bis .sr-bis-character-window:has(.sr-bis-model) {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px;
        padding: 12px 6px;
    }

    .sr-bis .sr-bis-character.sr-bis-model {
        grid-area: 1 / 1 / 2 / -1;
        scroll-margin-top: 48px;
    }

    .sr-bis .sr-bis-model-frame {
        height: clamp(268px, 86vw, 370px);
    }

    .sr-bis .sr-bis-character-window:has(.sr-bis-model) .sr-bis-slots {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
    }

    .sr-bis .sr-bis-character-window:has(.sr-bis-model) .sr-bis-slots .sr-bis-slot-link {
        display: flex;
        justify-content: center;
        min-height: 44px;
        padding: 1px;
        border: 0;
        background: none;
        box-shadow: none;
    }

    .sr-bis .sr-bis-character-window:has(.sr-bis-model) .sr-bis-slots .sr-bis-slot-link > span:last-child {
        display: none;
    }
}

@media (max-width: 480px) {
    .sr-bis .sr-bis-character-window:has(.sr-bis-model) .sr-bis-slots {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 761px) {
    .sr-bis .sr-bis-character-window:has(.sr-bis-model) {
        grid-template-columns: 56px minmax(0, 1fr) 56px;
    }

    .sr-bis .sr-bis-character-window:has(.sr-bis-model) .sr-bis-slots .sr-bis-slot-link {
        display: flex;
        justify-content: center;
        min-height: 48px;
        padding: 1px;
    }

    .sr-bis .sr-bis-character-window:has(.sr-bis-model) .sr-bis-slots .sr-bis-slot-link > span:last-child {
        display: none;
    }
}

.sgl-catalogue {
    min-width: 0;
    scroll-margin-top: 104px;
}

.sgl-catalogue .sgl-build-picker:not([hidden]) {
    display: grid;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    margin: 0 0 10px;
    color: #ddc59c;
    font: 600 14px/1.5 system-ui, sans-serif;
}

.sgl-catalogue .sgl-build-picker select {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid #8a7146;
    border-radius: 2px;
    background: #161c18;
    color: #f0d8a8;
    font: inherit;
}

.sgl-catalogue.sgl-enhanced .sgl-profile:not([open]),
.sgl-catalogue.sgl-enhanced .sgl-profile > summary {
    display: none;
}

.sgl-catalogue .sgl-profile > summary {
    padding: 8px 12px;
    margin-bottom: 6px;
    border: 1px solid #7b623d;
    background: #24211a;
    color: #f2d8a4;
    cursor: pointer;
}

.sgl-catalogue .sgl-build-picker select:focus-visible,
.sgl-catalogue .sgl-profile > summary:focus-visible {
    outline: 2px solid #f6d988;
    outline-offset: 2px;
}

.sgl .sgl-profile-note {
    margin: -4px 0 12px;
    color: #dcccae;
    font: 14px/1.45 system-ui, sans-serif;
}

.sgl .sgl-slot > .sgl-item > .sgl-tradeoff {
    grid-column: 2 / -1;
}

@container (max-width: 610px) {
    .sgl .sgl-slot > .sgl-item > .sgl-tradeoff {
        grid-column: 1;
    }
}

@media (max-width: 760px) {
    .sgl-catalogue {
        scroll-margin-top: 52px;
    }
}
