.bus-staff-grid-scroll { max-width: 100%; overflow-x: auto; }
.bus-staff-route-cell { position: relative; display: block; width: 100%; min-height: 90px; padding: 12px; border: 0; background: transparent; color: inherit; }
.bus-route-complete { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); color: white; font-size: 4rem; pointer-events: none; }
.bus-staff-stop { width: 100%; padding: 12px; margin: 12px 0; border: 1px solid #aaa; border-radius: 4px; }
.bus-staff-current-stop { border: 2px solid #397baf; }
.bus-staff-map { width: min(360px, 100%); margin: 12px 0; }
.bus-staff-students { flex-wrap: wrap; gap: 12px; }
.bus-staff-student { max-width: 200px; padding: 6px; border: 2px solid transparent; }
.bus-staff-student-done, .bus-staff-student-done .media-card-student { background: #d7f0dd !important; border-color: #23743b; }
.bus-staff-student-absent { background: #fff0cc; border-color: #957023; }
.bus-staff-student p { font-size: .9rem; overflow-wrap: anywhere; }
.bus-staff-student button { margin: 4px 0; }
.bus-staff-confirm { padding: 12px; background: #edf3f8; border: 1px solid #397baf; }
.bus-staff-confirm label, .bus-staff-comment { display: block; margin: 8px 0; }
.bus-staff-confirm textarea, .bus-staff-comment textarea { display: block; width: 100%; min-height: 70px; }
.bus-staff-success { color: #23743b; font-weight: bold; }

.bus-map-demo {
    width: 100%;
    min-width: 0;
}

.bus-map-demo h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.bus-map-demo-canvas {
    width: 100%;
    height: 65vh;
    height: 65dvh;
    min-height: 300px;
}

.bus-map-demo-caption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.bus-stop-row {
    display: block;
    height: auto;
    min-height: 50px;
    cursor: default;
    padding: 8px;
}

.hagwon-stop-row {
    background-color: #f1f5fa;
}

.bus-stop-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.bus-stop-fields select {
    max-width: 360px;
}

.bus-stop-location-select {
    display: flex;
    flex-direction: column;
    min-width: 240px;
    max-width: 360px;
}

.bus-stop-location-select select {
    width: 100%;
}

.bus-stop-location-notes {
    padding: 2px 4px 0 4px;
    font-size: 0.78rem;
    font-style: italic;
    line-height: 1.15;
    white-space: normal;
}

.bus-stop-students {
    clear: both;
    margin-top: 10px;
}

.location-image-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 15px 18px 15px;
}

.location-media-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 15px 18px;
}

.location-photo-panel,
.location-map-column {
    min-width: 0;
}

.location-media-map-only {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.location-photo-panel > .location-image-square,
.location-photo-panel > .location-image-placeholder {
    width: 100%;
}

.location-map-panel {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f4f4f4;
}

.location-map-toolbar { margin-top: 6px; }
.location-address-search { display: flex; gap: 6px; margin-top: 8px; }
.location-address-search input { min-width: 0; flex: 1; }
.location-address-results { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.location-address-results button { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.location-map-canvas[hidden] { display: none !important; }
.location-panorama-status:not(:empty) {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: #fff;
    z-index: 1;
}

.location-map-canvas {
    width: 100%;
    aspect-ratio: 1;
}

.location-map-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

@media (max-width: 575.98px) {
    .location-media-section {
        grid-template-columns: minmax(0, 1fr);
        padding-left: 0;
        padding-right: 0;
    }
}

.location-image-placeholder {
    width: min(256px, 100%);
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bbb;
    background: #f4f4f4;
    font-size: 3rem;
    color: #888;
}

.location-image-message {
    font-size: 0.82rem;
    font-style: italic;
}

.location-detail-list,
.bus-detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 5px 12px 0;
}

.location-detail-row,
.bus-detail-row {
    width: 100%;
    min-height: 36px;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    column-gap: 12px;
    align-items: center;
}

.location-detail-row > label,
.bus-detail-row > label {
    margin: 0;
    font-weight: 600;
}

.location-detail-row > input:not([type="checkbox"]),
.location-detail-row > select,
.location-detail-row > textarea,
.bus-detail-row > input:not([type="checkbox"]),
.bus-detail-row > select,
.bus-detail-row > textarea {
    width: 100%;
    max-width: 500px;
    min-width: 0;
}

.location-detail-row > input:not([type="checkbox"]),
.bus-detail-row > input:not([type="checkbox"]) {
    height: 36px;
}

.location-detail-row > input[type="checkbox"],
.bus-detail-row > input[type="checkbox"] {
    width: 22px;
    height: 22px;
}

.location-comments-row,
.bus-notes-row {
    align-items: flex-start;
}

.location-comments-row > label,
.bus-notes-row > label {
    padding-top: 6px;
}

.location-comments-row textarea {
    min-height: 100px;
}

.bus-notes-row textarea {
    min-height: 110px;
}

.location-selector-notes {
    margin-left: auto;
    padding-left: 12px;
    font-size: 0.82rem;
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-image-editor {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 12px;
}

.location-image-editor-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 12px;
    width: 100%;
    margin-bottom: 12px;
}

.location-image-square {
    width: min(256px, 100%);
    aspect-ratio: 1;
}

.location-image-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #bbb;
    background: #f4f4f4;
    color: #888;
    font-size: 3rem;
}

.sched-table tr.bus-schedule-arrival > td {
    background-color: #edf8ef;
}

.sched-table tr.bus-schedule-departure > td {
    background-color: #fbeeee;
}

.sched-table.bus-schedule-table {
    display: table;
    width: auto;
    align-self: flex-start;
    border-collapse: collapse;
    border: none;
}

.bus-schedule-body > .sched-title {
    box-sizing: border-box;
    padding-left: 60px;
    min-height: 56px;
    font-size: 1.5rem;
    line-height: 1.2;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
}

.bus-schedule-body > .sched-info {
    gap: 0.25rem 1rem;
}

.bus-schedule-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bus-schedule-body > .sched-title > .sched-lock {
    flex-shrink: 0;
    top: 0;
}

@media (min-width: 576px) {
    .bus-schedule-body > .sched-title {
        font-size: 1.75rem;
    }
}

@media (min-width: 768px) {
    .bus-schedule-body > .sched-title {
        font-size: 2rem;
    }
}

.sched-table.bus-schedule-table th:first-child {
    border: none;
    background: transparent;
}

.bus-schedule-table .bus-schedule-bus-column {
    border-top: 3px solid #465563;
}

.bus-schedule-table .bus-schedule-bus-column:nth-child(2),
.bus-schedule-table td:first-child {
    border-left: 3px solid #465563;
}

.bus-schedule-table .bus-schedule-bus-column:last-child,
.bus-schedule-table td:last-child {
    border-right: 3px solid #465563;
}

.bus-schedule-table .bus-schedule-bus-column {
    padding: 10px;
    text-align: center;
    width: auto;
    min-width: 0;
    max-width: none;
}

.bus-schedule-table tr.bus-schedule-block-end > td {
    border-bottom: 3px solid #465563;
}

.bus-schedule-table tr.bus-schedule-block-start > td {
    border-top: 3px solid #465563;
}

@media (max-width: 700px) {
    .bus-stop-location-select {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 600px) {
    .location-detail-row,
    .bus-detail-row {
        grid-template-columns: 1fr;
        row-gap: 4px;
    }

    .bus-detail-row > label {
        padding: 0;
    }

    .location-detail-row > input:not([type="checkbox"]),
    .location-detail-row > select,
    .location-detail-row > textarea,
    .bus-detail-row > input:not([type="checkbox"]),
    .bus-detail-row > select,
    .bus-detail-row > textarea {
        max-width: none;
    }
}
