.jem-cancellation-dialog {
    width: min(42rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    overflow: auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color, #aaa);
    border-radius: .5rem;
    background: var(--body-bg, #fff);
    color: var(--body-color, #222);
}
.jem-cancellation-dialog::backdrop {
    background: rgb(0 0 0 / 45%);
}

#jem .jem-cancellation-areas {
    width: fit-content;
    max-width: min(36rem, 100%);
    min-width: 0;
    margin: 1rem auto;
    text-align: left;
}

#jem .jem-cancellation-areas legend {
    float: none;
    width: 100%;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: inherit;
}

#jem .jem-cancellation-areas .jem-cancellation-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0 0 0.75rem;
}

#jem .jem-cancellation-area > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

#jem .jem-cancellation-area > input[type="number"] {
    flex: 0 0 4.5rem;
    width: 4.5rem;
    min-width: 0;
    margin: 0;
}

#jem #jem_send_attend {
    margin-top: 1rem !important;
}

#jem #cancelplaces[readonly] {
    appearance: textfield;
    -moz-appearance: textfield;
}

#jem #cancelplaces[readonly]::-webkit-inner-spin-button,
#jem #cancelplaces[readonly]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Keep the owner's cancellation quantities readable beside each saved tariff. */
#jem .jem-priced-cancellation table { width: 100%; table-layout: fixed; }
#jem .jem-priced-cancellation th:last-child,
#jem .jem-priced-cancellation td:last-child { width: 5.5rem; }
#jem .jem-priced-cancellation [data-cancel-item] { width: 4.5rem !important; min-width: 0; max-width: 100%; }
#jem .jem-priced-cancellation legend { font-size: inherit; font-weight: 600; }
#jem .jem-priced-cancellation th,
#jem .jem-priced-cancellation td { white-space: normal !important; overflow-wrap: anywhere; }

/* Each location owns its ticket list; stack both blocks on narrow screens. */
#jem .jem-cancellation-areas[data-cancel-seats] { width: 100%; max-width: 60rem; }
#jem .jem-priced-cancellation > .table-responsive { max-width: 36rem; margin-inline: auto; }
#jem .jem-cancellation-seats { container: jem-cancellation-seats / inline-size; width: 100%; }
#jem .jem-cancellation-seat-group { display: grid; gap: .5rem 1.5rem; padding-block: .75rem; border-bottom: 1px solid #d5dbe3; }
#jem .jem-cancellation-location { min-width: 0; overflow-wrap: anywhere; }
#jem .jem-cancellation-location > * { display: block; }
#jem .jem-cancellation-seat-list { display: grid; gap: .25rem 1rem; list-style: none; padding: 0; margin: 0; min-width: 0; }
#jem .jem-cancellation-seat-list li { list-style: none; padding: 0; margin: 0; min-width: 0; }
#jem .jem-cancellation-seat-list label { display: flex; align-items: center; gap: .6rem; min-height: 44px; margin: 0; padding: .25rem; cursor: pointer; }
#jem .jem-cancellation-seat-list label span { min-width: 0; overflow-wrap: anywhere; }
#jem .jem-cancellation-seat-list input { flex: 0 0 auto; margin: 0; }
@container jem-cancellation-seats (min-width: 42rem) {
    #jem .jem-cancellation-seat-group { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
    #jem .jem-cancellation-seat-list-multiple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
