/**
 * Größentabelle (Artikelseite und Designer). Farben und Ecken aus dem
 * Aussehen des Shops (--rs-*) bzw. des Designers (--st-*).
 */
.rs-sizechart-open {
    --rs-sc-accent: var(--rs-accent, var(--st-accent, #2554d9));
    display: inline-flex;
    align-items: center;
    gap: .5em;
    margin: .85rem 0 0;
    padding: .5rem 1rem .5rem .8rem;
    border: 1.5px solid var(--rs-sc-accent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--rs-sc-accent) 9%, #fff);
    color: var(--rs-sc-accent);
    font: inherit;
    font-size: .95em;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.rs-sizechart-open:hover,
.rs-sizechart-open:focus-visible {
    background: var(--rs-sc-accent);
    color: var(--rs-on-accent, var(--st-on-accent, #fff));
}

.rs-sizechart-open:focus-visible {
    outline: 2px solid var(--rs-sc-accent);
    outline-offset: 2px;
}

.rs-sizechart-open svg,
.rs-sizechart-close svg {
    width: 1.3em;
    height: 1.3em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

dialog.rs-sizechart {
    width: min(34rem, calc(100vw - 2rem));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 0;
    border-radius: var(--rs-radius-lg, var(--st-radius-lg, 14px));
    background: #fff;
    color: #111827;
    font-family: var(--rs-font, var(--st-font, inherit));
    font-size: 1rem;
    line-height: 1.45;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .28);
    overflow: hidden;
}

dialog.rs-sizechart[open] {
    display: flex;
    flex-direction: column;
}

dialog.rs-sizechart::backdrop {
    background: rgba(15, 23, 42, .55);
}

.rs-sizechart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem .85rem;
    border-bottom: 1px solid #e5e7eb;
}

.rs-sizechart-head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.rs-sizechart-head h2 small {
    display: block;
    margin-top: .15rem;
    color: #6b7280;
    font-size: .85rem;
    font-weight: 400;
}

.rs-sizechart-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    margin: -.35rem -.5rem 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #374151;
    cursor: pointer;
}

.rs-sizechart-close:hover {
    background: #f3f4f6;
}

.rs-sizechart-body {
    padding: 1rem 1.25rem 1.25rem;
    overflow: auto;
    overscroll-behavior: contain;
}

.rs-sizechart-unit,
.rs-sizechart-tip,
.rs-sizechart-note,
.rs-sizechart-legend {
    color: #4b5563;
    font-size: .88rem;
}

.rs-sizechart-unit {
    margin: 0 0 .75rem;
}

.rs-sizechart-scroll {
    overflow-x: auto;
    margin: 0 -.25rem;
}

.rs-sizechart table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.rs-sizechart th,
.rs-sizechart td {
    padding: .6rem .65rem;
    border-bottom: 1px solid #eef0f3;
    text-align: center;
    white-space: nowrap;
}

.rs-sizechart thead th {
    border-bottom-color: #d1d5db;
    color: #6b7280;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.rs-sizechart tbody th {
    text-align: left;
    font-weight: 700;
}

.rs-sizechart thead th:first-child {
    text-align: left;
}

.rs-sizechart tbody tr.is-current {
    background: color-mix(in srgb, var(--rs-accent, var(--st-accent, #2554d9)) 11%, #fff);
}

.rs-sizechart tbody tr.is-current th {
    box-shadow: inset 3px 0 0 var(--rs-accent, var(--st-accent, #2554d9));
}

.rs-sizechart-legend {
    margin: .9rem 0 0;
    padding: 0;
    list-style: none;
}

.rs-sizechart-legend li + li {
    margin-top: .2rem;
}

.rs-sizechart-legend strong {
    color: #111827;
}

.rs-sizechart-tip {
    margin: .9rem 0 0;
    padding: .65rem .8rem;
    border-radius: var(--rs-radius, var(--st-radius-sm, 8px));
    background: #f5f6f8;
}

.rs-sizechart-note {
    margin: .6rem 0 0;
    font-size: .8rem;
    color: #6b7280;
}

/* Handy: als Blatt von unten, volle Breite */
@media (max-width: 560px) {
    dialog.rs-sizechart {
        width: 100vw;
        max-width: 100vw;
        max-height: 88dvh;
        margin: auto 0 0;
        border-radius: 18px 18px 0 0;
    }

    .rs-sizechart-head,
    .rs-sizechart-body {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .rs-sizechart-body {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
    }

    .rs-sizechart th,
    .rs-sizechart td {
        padding: .55rem .45rem;
    }
}
