* { box-sizing: border-box; }
body { margin: 0; font-family: 'Hiragino Sans', 'Meiryo', sans-serif; }
.container {
    display: flex;
    flex-direction: row;
    height: 100vh;
}
.sidebar {
    width: 320px;
    min-width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
}
.sidebar-header {
    padding: 12px 16px;
    background: #2c5aa0;
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
}
.route-wrap {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}
.route-wrap label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 4px;
}
.route-wrap select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    cursor: pointer;
}
.route-wrap select:focus {
    outline: none;
    border-color: #2c5aa0;
}
.direction-wrap select:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}
.search-wrap {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}
.search-wrap input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
}
.search-wrap input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44,90,160,0.2);
}
.stop-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}
.stop-item {
    padding: 10px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}
.stop-item:hover {
    background: #e9ecef;
}
.stop-item.highlight {
    background: #cce5ff;
}
.stop-item .name {
    font-weight: 500;
    color: #212529;
}
.stop-item .ids {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}
#map {
    flex: 1;
    min-width: 0;
}
.loading {
    padding: 24px;
    text-align: center;
    color: #6c757d;
}
.error {
    padding: 24px;
    color: #c62828;
}
.popup-timetable {
    margin-top: 8px;
    font-size: 0.9rem;
    border-top: 1px solid #dee2e6;
    padding-top: 6px;
}
.popup-timetable-title {
    font-weight: bold;
    margin-bottom: 4px;
    color: #333;
}
.popup-timetable-times {
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.5;
}
.popup-timetable-row {
    white-space: nowrap;
}
@media (max-width: 768px) {
    .container { flex-direction: column; height: auto; min-height: 100vh; }
    .sidebar { width: 100%; max-height: none; height: auto; border-right: none; border-bottom: 1px solid #dee2e6; }
    #map { min-height: 55vh; }
    .search-wrap { display: none; }
    .stop-list { display: none; }
}
