main {
    max-width: 60rem;
    margin: 0 auto;
    padding: 1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 8rem;
    gap: 1rem;
}

.grid > .wide  { grid-column: span 2; }
.grid > .tall  { grid-row: span 2; }
.grid > .large { grid-column: span 2; grid-row: span 2; }

.bucket {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid #000000;
}

.bucket:hover { background: #f0f0f0; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #000000;
    padding: 0.5rem;
}

.table-block {
    margin: 2rem 0;
}

.table-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.button {
    background: #ffffff;
    color: #000000;
    text-decoration: none;
    border: 1px solid #000000;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.button:hover { background: #f0f0f0; }

.toggle {
    width: 1px;
    white-space: nowrap;
}

.toggle button {
    cursor: pointer;
    width: 2rem;
    background: #ffffff;
    border: 1px solid #000000;
    border-radius: 4px;
}

.drawer > td {
    padding: 0;
    background: #f7f7f7;
}

/* the nested table brings its own spacing; drop the outer block margin */
.drawer .table-block {
    margin: 0;
    padding: 1rem;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

@media (max-width: 60rem) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 30rem) {
    .grid {
        grid-template-columns: 1fr;
    }
}
.detail-block {
    margin: 2rem 0;
}

.detail-block dl {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1rem;
}

.detail-block dt {
    font-weight: 600;
}

.detail-block dd {
    margin: 0;
}

.field {
    display: grid;
    grid-template-columns: 12rem 1fr;
    gap: 1rem;
    align-items: center;
    margin: 0.5rem 0;
}

.field label {
    font-weight: 600;
}

.repeat-block {
    margin: 2rem 0;
}

.repeat-row {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.repeat-row input {
    flex: 1;
}

@media (max-width: 40rem) {
    .field {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .repeat-row {
        flex-wrap: wrap;
    }
}
