.bus-page {
    max-width: 1000px;
    margin: 40px auto;
    padding: 24px;
    color: #243348;
    background: #fff;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.7;
}

.bus-page h1 {
    font-size: 28px;
    margin-bottom: 16px;
    font-weight: 700;
}

/* 固定ヘッダーに座席表の見出しが隠れないようにする。 */
.bus-admin #seat-results {
    scroll-margin-top: 80px;
}

.bus-page h2,
.bus-admin h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 12px 0;
}

.bus-rounds {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.bus-card {
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    background: #f8fafc;
}

.bus-button {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 10px 18px;
    background: #235a87;
    color: #fff !important;
    cursor: pointer;
    font-size: 16px;
    text-decoration: none !important;
    margin: 4px 0 4px 10px;
}

.bus-button.secondary {
    background: #536575;
}

.bus-button.active {
    outline: 3px solid #f1b44a;
    outline-offset: 2px;
}

.bus-admin .bus-rounds {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 16px 0;
}

.bus-admin .bus-card {
    padding: 12px;
    border-radius: 8px;
}

.bus-admin .bus-card h2 {
    font-size: 18px;
    margin: 0 0 6px;
}

.bus-admin .bus-card p {
    font-size: 12px;
    line-height: 1.5;
    margin: 0 0 10px;
    color: #536575;
}

.bus-round-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bus-round-actions form {
    margin: 0;
}

.bus-round-actions .bus-button {
    font-size: 13px;
    line-height: 1.5;
    padding: 7px 10px;
    margin: 0;
    border-radius: 6px;
    white-space: nowrap;
}

.bus-button:disabled {
    opacity: .55;
    cursor: wait;
}

.bus-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.bus-seat-wrap {
    max-width: 900px;
    margin: 24px auto;
}

.bus-front {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background: #e9eef3;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
}

.bus-seats {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 6px;
    background: #f8fafc;
}

.bus-seats td {
    vertical-align: middle;
    text-align: center;
    padding: 10px 4px;
    border-radius: 8px;
    overflow-wrap: anywhere;
}

.bus-seat {
    border: 1px solid #cbd5e1;
    background: #fff;
}

.bus-seat.male {
    background: #e8f3ff;
    border-color: #89b5dc;
}

.bus-seat.female {
    background: #fff0e7;
    border-color: #dbab86;
}

.bus-seat-number,
.bus-seat small {
    display: block;
    font-size: 12px;
    color: #4b596b;
}

.bus-seat strong {
    display: block;
    font-size: 15px;
}

.bus-empty,
.bus-aisle {
    color: #697787;
    font-size: 13px;
}

.bus-note {
    font-size: 13px;
    margin: 12px 0;
}

.bus-roster {
    margin: 28px 0;
}

.bus-roster summary {
    cursor: pointer;
    padding: 12px;
    background: #eef2f6;
}

@media (max-width: 600px) {
    .bus-page {
        margin: 16px 8px;
        padding: 16px 8px;
    }

    .bus-rounds {
        grid-template-columns: 1fr;
    }

    .bus-seats {
        border-spacing: 3px;
    }

    .bus-seat strong {
        font-size: 12px;
    }

    .bus-seats td {
        padding: 8px 2px;
    }

    .bus-aisle {
        font-size: 11px;
    }
}

@media print {
    .bus-rounds,
    .bus-tabs,
    .bus-roster,
    header,
    footer,
    .bus-draw {
        display: none;
    }

    .bus-page {
        margin: 0;
        padding: 0;
    }

    .bus-seat-wrap {
        break-inside: avoid;
    }
}

.bus-person {
    padding: 12px;
    border: 1px solid #ccd5df;
    border-radius: 8px;
    margin: 10px 0;
}

.bus-person summary {
    cursor: pointer;
}

/* 名簿フォーム */
.bus-roster > form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.bus-roster label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px;
}

.bus-roster input,
.bus-roster select {
    border: 1px solid #aab7c5;
    border-radius: 5px;
    padding: 8px;
    max-width: 100%;
    background: white;
}

.bus-reset {
    margin: 32px 0;
    padding: 20px;
    border: 1px solid #d5a7a7;
    border-radius: 12px;
}

.bus-button.danger {
    background: #a83434;
}

.bus-roster h3 {
    margin-top: 24px;
    font-size: 20px;
}


/* スマートフォン向けの操作サイズと座席表 */

.bus-page,
.bus-admin,
.bus-page *,
.bus-admin * {
    box-sizing: border-box;
}

.bus-card,
.bus-person,
.bus-roster form {
    min-width: 0;
}

.bus-person summary {
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.bus-roster input,
.bus-roster select {
    font-size: 16px;
    min-height: 44px;
    min-width: 0;
}

.bus-button:focus-visible,
.bus-person summary:focus-visible {
    outline: 3px solid #7ab5e1;
    outline-offset: 3px;
}

.bus-seats col.bus-seat-column {
    width: 22%;
}

.bus-seats col.bus-aisle-column {
    width: 12%;
}

@media (max-width: 600px) {
    .bus-page {
        margin: 12px 8px;
        padding: 16px 8px;
    }

    .bus-page h1 {
        font-size: 23px;
        line-height: 1.4;
    }

    .bus-admin > p {
        font-size: 14px;
        line-height: 1.7;
    }

    .bus-admin h2 {
        font-size: 20px;
    }

    .bus-admin .bus-rounds {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .bus-admin .bus-card {
        padding: 12px;
    }

    .bus-round-actions {
        flex-wrap: nowrap;
    }

    .bus-round-actions > .bus-button,
    .bus-round-actions > form {
        flex: 1;
        min-width: 0;
    }

    .bus-round-actions form .bus-button {
        width: 100%;
    }

    .bus-button,
    .bus-round-actions .bus-button {
        min-height: 44px;
        font-size: 14px;
        display: inline-flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        line-height: 1.5;
    }

    .bus-round-actions .bus-button {
        padding: 9px 10px;
    }

    .bus-roster label {
        display: flex;
        width: 100%;
        margin: 12px 0 8px;
    }

    .bus-roster input,
    .bus-roster select {
        width: 100%;
    }

    .bus-roster .bus-button,
    .bus-reset .bus-button {
        width: 100%;
        white-space: normal;
    }

    .bus-person {
        padding: 10px;
    }

    .bus-person summary {
        padding: 10px;
        min-height: 44px;
    }

    .bus-reset {
        padding: 16px 12px;
    }

    .bus-reset p {
        font-size: 14px;
        line-height: 1.7;
    }

    .bus-seat-wrap {
        margin: 20px 0;
    }

    .bus-front {
        font-size: 13px;
        padding: 10px 8px;
    }

    .bus-seats {
        border-spacing: 3px;
    }

    .bus-seats td {
        height: 56px;
        padding: 6px 2px;
        border-radius: 6px;
    }

    .bus-seat strong {
        font-size: 13px;
        line-height: 1.5;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .bus-aisle {
        font-size: 10px;
        line-height: 1.5;
    }

    .bus-tabs {
        gap: 8px;
    }
}

.bus-personal-form {
    max-width: 460px;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bus-personal-form label {
    font-weight: 600;
}

.bus-personal-form select {
    width: 100%;
    min-height: 48px;
    padding: 10px;
    border: 1px solid #aab7c5;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.bus-personal-form .bus-button {
    min-height: 48px;
}

.bus-personal-result {
    text-align: center;
}

.bus-result-number {
    font-size: 80px;
    line-height: 1.4;
    font-weight: bold;
    color: #bc7300;
    font-variant-numeric: tabular-nums;
    min-height: 112px;
    margin: 16px 0;
}