/* Refine chain panels and material grids. */

.refine-chain-panel {
    overflow: visible;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 22px;
}

.refine-chain-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 15px 4px 15px 4px;
    cursor: pointer;
    list-style: none;
}

.refine-chain-panel[open] summary {
    border-radius: 15px 4px 0 0;
}

.refine-chain-panel summary::-webkit-details-marker {
    display: none;
}

.refine-chain-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.refine-chain-title img {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8df;
}

.refine-chain-title strong,
.refine-chain-title small {
    display: block;
    min-width: 0;
}

.refine-chain-title strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.refine-chain-title small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.refine-chain-toggle {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    border-right: 2px solid var(--accent-strong);
    border-bottom: 2px solid var(--accent-strong);
    transform: rotate(45deg);
    transition: transform 140ms ease;
}

.refine-chain-panel[open] .refine-chain-toggle {
    transform: rotate(225deg);
}

.refine-material {
    margin: 0 auto;
    color: var(--ink);
}

.refine-material:hover {
    text-decoration: none;
}

.refine-material.crafting-item-tile {
    width: 68px;
    min-height: 62px;
    gap: 3px;
    padding: 2px;
}

.refine-material.crafting-item-tile--proto-size-2 {
    width: 74px;
    min-height: 68px;
}

.refine-material.crafting-item-tile--proto-size-3 {
    width: 80px;
    min-height: 74px;
}

.refine-material .crafting-item-icon {
    width: 34px;
    height: 34px;
}

.refine-material.crafting-item-tile--proto-size-2 .crafting-item-icon {
    width: 40px;
    height: 66px;
}

.refine-material.crafting-item-tile--proto-size-3 .crafting-item-icon {
    width: 46px;
    height: 98px;
}

.refine-material .crafting-item-icon span {
    right: -6px;
    bottom: -5px;
    min-width: 20px;
    padding: 0 4px;
    font-size: 0.54rem;
    line-height: 1.45;
}

.refine-material .crafting-item-name strong {
    font-size: 0.58rem;
    line-height: 1.08;
}

.refine-wearable-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
}

.refine-wearable-list span {
    padding: 4px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1.2;
}

.refine-chain-evolution {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    color: #88283a;
    font-weight: 900;
}

.refine-chain-evolution strong {
    color: #88283a;
}

.refine-chain-panel summary {
    border-color: #6f241b;
    background:
        linear-gradient(180deg, rgba(255, 244, 196, 0.54), rgba(226, 201, 132, 0.62)),
        #e7d59e;
}

.refine-chain-toggle {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    color: #fff4cf;
}

.refine-wearable-list span {
    border-color: #7d321d;
    background: #fff9df;
    color: var(--accent-strong);
}
