
html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    overflow: auto;
}

html {
    box-sizing: border-box;
    font-size: 100%;
    font-family: sans-serif;
    line-height: 1.15;
}

*,
::after,
::before {
    -webkit-box-sizing: inherit;
    box-sizing: inherit;
}

body > h1 {
    text-align: center;
}

.container {
    width: 100%;
    padding-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container > p {
	margin: 0 0 1rem 0;
    line-height: 1.5;
    text-align: center;
}

.container > h2,
.container > h3 {
	margin: 0 0 1.25rem 0;
    text-align: center;
}

.table-group > div {
    width: 100%;
}

.table-group > div > div {
    overflow-x: auto;
}

.table-group h3 {
    margin-top: 2.5rem;
    margin-bottom: 0.1rem;
}

.table-group h5 {
    margin-top: 0;
}

.table-group table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.table-group th, .table-group td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #ddd;
    padding: 0.5rem;
}

.table-group thead td {
    text-align: center;
    font-weight: bold;
}

.table-group tbody > tr:nth-child(even) {
    background-color: #f2f2f2;
}

.table-group tbody td:nth-child(1),
.table-group tbody td:nth-child(4) {
    text-align: center;
}

.table-group tbody td:nth-child(3) {
    text-align: right;
}

.table-group td:nth-child(2) {
    width: 45%;
}

.table-group td:nth-child(4) {
    width: 22%;
}

.entries-panel {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

.table-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
}

.table-pager[hidden] {
    display: none !important;
}

.table-pager-info {
    font-size: 0.9rem;
    color: #333;
}

.table-pager button {
    padding: 0.4rem 0.85rem;
    font: inherit;
    cursor: pointer;
    border: 1px solid #888;
    border-radius: 3px;
    background: #fff;
}

.table-pager button:hover:not(:disabled) {
    background: #eee;
}

.table-pager button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.entries-scroll-area {
    width: 100%;
    max-height: calc(100vh - 14rem);
    min-height: 6rem;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    background: #fff;
}

#entries-panel .table-pager:not([hidden]) + .entries-scroll-area {
    border-top: none;
    border-radius: 0 0 4px 4px;
}

#entries-panel .table-pager[hidden] + .entries-scroll-area {
    border-radius: 4px;
}

/* Match table width to pager / panel (avoid narrow 75% table with empty space on the right) */
#entries-panel .table-group {
    width: 100%;
    max-width: none;
}

.entries-scroll-area .table-group > div:first-child h3 {
    margin-top: 1rem;
}

#select-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    padding: 0.5rem 1rem;
    width: 100%;
    background-color: #fff;
    border-bottom: 1px solid #aaa;
    z-index: 100;
}

#select-container > .input-line {
    margin-right: 0;
    min-width: 0;
}

#select-container > .input-line--club {
    flex: 1 1 9rem;
}

#select-container > .input-line--swimmer {
    flex: 1 1 11rem;
}

#select-container > .input-line--filter {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    flex: 1 1 12rem;
}

#select-container .swimmer-filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

#select-container > .input-line--filter #swimmer-filter {
    flex: 1 1 6rem;
    min-width: 5rem;
    max-width: 100%;
    padding: 0.45rem 0.5rem;
    font: inherit;
    border: 1px solid #aaa;
    border-radius: 2px;
}

#select-container > .input-line select {
    padding: 0.5rem;
    width: 100%;
}

/* Screens <= 768px */
@media only screen and (max-width: 48em) {

    html {
        font-size: 75%;
    }

    .container > * {
        max-width: 100%;
    }

    .container > p {
        max-width: 80%;
    }

    .table-group {
        width: 95%;
    }

    .table-group table {
        table-layout: auto;
    }

    #select-container > .input-line {
        flex: 1 1 12rem;
        min-width: 0;
        max-width: 100%;
    }

}

/* Screens >= 768 and <= 992 */
@media only screen and (min-width: 48em) and (max-width: 62em) {

    html {
        font-size: 100%;
    }

    .container > * {
        max-width: 90%;
    }

    .container > p {
        max-width: 70%;
    }

    .table-group {
        width: 85%;
    }

    .table-group table {
        font-size: 0.75rem;
        table-layout: fixed;
    }

    #select-container > .input-line {
        flex: 1 1 8rem;
        min-width: 0;
        max-width: none;
    }

}

/* Screens >= 992 */
@media only screen and (min-width: 62em) {

    .container > * {
        max-width: 80%;
    }

    .container > p {
        max-width: 60%;
    }

    .table-group {
        width: 75%;
    }

    .table-group table {
        font-size: 1rem;
        table-layout: fixed;
    }

    #select-container > .input-line {
        flex: 1 1 9rem;
        min-width: 0;
        max-width: none;
    }

}

