.map-admin-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

.map-container {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

.control-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1;
    width: 300px;
    overflow: hidden;
}

.card {
    border-bottom: 1px solid #eee;
}

.card:last-child {
    border-bottom: none;
}

.map-style-controls {
    position: absolute;
    left: 20px;
    bottom: 110px;
    width: 450px;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
    z-index: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.map-style-trigger {
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    align-self: flex-end;
    position: relative;
    width: 64px;
    height: 40px;
}

.map-style-trigger img {
    width: 64px;
    height: 40px;
}

.map-style-3d img {
    width: 50px;
}

.map-style-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}


.map-style-loading {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: #f26b1d;
    border-radius: 50%;
    animation: menuSpin 0.8s linear infinite;
}

.map-style-panel {
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid #f26b1d;
    border-radius: 14px;
    padding: 18px 20px 20px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.map-style-header {
    font-size: 20px;
    font-weight: 700;
    color: #2b2f33;
    margin-bottom: 18px;
}

.map-style-subheader {
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
    margin-top: 6px;
}

.map-style-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0 0 18px;
}

.map-style-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.map-style-item {
    border: 1.5px solid #d9dee5;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.map-style-item:hover {
    border-color: #bfc6cf;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.map-style-item.active {
    border-color: #f26b1d;
    box-shadow: 0 6px 12px rgba(242, 107, 29, 0.22);
}

.map-style-preview {
    width: 80px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
}

.map-style-name {
    font-size: 14px;
    font-weight: 600;
    color: #2b2f33;
}

.header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.upload-container {
    position: relative;
}

.upload-button {
    background: #4CAF50;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upload-button:hover {
    background: #45a049;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.collections-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.collection-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collection-item:last-child {
    border-bottom: none;
}

.collection-info {
    flex: 1;
}

.collection-name {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 0.95em;
}

.collection-count {
    font-size: 0.85em;
    color: #666;
}

.collection-controls {
    display: flex;
    gap: 8px;
}

.control-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-button:hover {
    background: #f5f5f5;
}

.control-button.delete {
    color: #dc3545;
}

.control-button.view {
    color: #007bff;
}

.mapboxgl-popup {
    max-width: 300px;
}

.mapboxgl-popup-content {
    padding: 15px;
}

.lines-list {
    position: absolute;
    top: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    padding: 15px;
    max-width: 300px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 1;
}

.lines-list h2 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
}

.lines-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.line-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 4px;
    background: #f8f9fa;
    transition: background-color 0.2s;
}

.line-item:hover {
    background: #e9ecef;
}

.line-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.line-info {
    flex: 1;
    min-width: 0;
}

.line-info h3 {
    margin: 0;
    font-size: 0.95em;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-details {
    margin: 5px 0 0 0;
    font-size: 0.8em;
    color: #666;
    display: flex;
    gap: 10px;
}

.line-details .system,
.line-details .status {
    padding: 2px 6px;
    border-radius: 3px;
    background: #e9ecef;
}

.lines-list.loading,
.lines-list.error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.station-detail-panel {
    position: absolute;
    left: 20px;
    top: 20px;
    width: min(360px, calc(100% - 40px));
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(16, 24, 40, 0.18);
    padding: 18px 18px 22px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.station-detail-close {
    position: absolute;
    right: 16px;
    top: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.station-detail-icon {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    background: #f8f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}

.station-detail-icon img {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}

.station-detail-name {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

.station-detail-system {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.4px;
    color: #6b7280;
    text-transform: uppercase;
}

.station-detail-status {
    margin-top: 8px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 8px 14px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}

.station-detail-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.station-detail-status.disrupted .status-dot {
    background: #f59e0b;
}

.station-detail-status[data-status="noService"] .status-dot,
.station-detail-status[data-status="noSchedule"] .status-dot {
    background: #9ca3af;
}

.station-detail-status[data-status="opensSoon"] .status-dot,
.station-detail-status[data-status="lastService"] .status-dot {
    background: #f59e0b;
}

.station-detail-status[data-status="inService"] .status-dot {
    background: #22c55e;
}

.station-status-chevron {
    margin-left: auto;
    width: 18px;
    height: 18px;
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.station-status-chevron svg {
    width: 16px;
    height: 16px;
}

.station-detail-line {
    margin-top: 12px;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    appearance: none;
}

.station-detail-line-icon {
    font-size: 22px;
}

.station-detail-line-title {
    font-weight: 700;
    color: #111827;
}

.station-detail-line-route {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

.station-detail-actions {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.station-detail-action {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 16px;
    padding: 10px 12px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}

.station-icon-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 6px 2px 12px;
}

.station-icon-list::-webkit-scrollbar {
    height: 6px;
}

.station-icon-list::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 999px;
}

.station-icon-item {
    width: 96px;
    min-height: 118px;
    border-radius: 20px;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    flex: 0 0 auto;
    text-align: center;
    cursor: pointer;
}

.station-icon-item:focus {
    outline: 2px solid rgba(59, 130, 246, 0.3);
    outline-offset: 2px;
}

.station-icon-item img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}

.station-icon-label {
    font-size: 12px;
    color: #111827;
    font-weight: 600;
    line-height: 1.2;
}

.station-selected-marker {
    width: auto;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.station-selected-marker img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    box-shadow: none;
    background: transparent;
}

.bottomsheet-root {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

.bottomsheet-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.bottomsheet-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.bottomsheet-overlay.no-block {
    opacity: 0;
    pointer-events: none;
}

.bottomsheet {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%) translateY(120%);
    width: min(560px, calc(100% - 32px));
    background: #ffffff;
    border-radius: 5px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    z-index: 3;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
    transition: transform 0.25s ease;
    pointer-events: auto;
}

.bottomsheet.line-details-panel {
    border: 2px solid #f26b1d;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    border-radius: 10px;
}

.bottomsheet.line-details-panel .bottomsheet-title-row {
    border-bottom: 1px solid #e5e7eb;
}

.bottomsheet.line-details-panel .bottomsheet-title {
    font-size: 20px;
    font-weight: 700;
}

.bottomsheet.line-details-panel .bottomsheet-subtitle {
    font-size: 15px;
    color: #6b7280;
}

.bottomsheet.line-details-panel .bottomsheet-close {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.bottomsheet.station-details-panel {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    overflow: visible;
}

.bottomsheet.station-details-panel .bottomsheet-content {
    padding: 0;
    gap: 14px;
}

.line-status-pill {
    margin-top: 8px;
    border-radius: 999px;
    border: none;
    background: #ffffff;
    padding: 8px 14px;
    display: inline-flex;
    gap: 12px;
    align-items: center;
    font-weight: 600;
    color: #111827;
    align-self: center;
    justify-content: center;
    width: 100%;
}

.line-close-floating {
    position: absolute;
    left: 20px;
    bottom: 20px;
    width: min(442px, calc(100% - 40px));
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding: 16px 20px;
    border-radius: 10px;
    border: 2px solid #f26b1d;
    background: #ffffff;
    color: #f26b1d;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    z-index: 4;
}

.line-close-floating:hover {
    background: #fff7f0;
}

.bottomsheet.line-details-panel.has-external-close.left-bottom {
    bottom: 92px;
}

.bottomsheet.nearby-panel {
    border: 2px solid #f26b1d;
    border-radius: 10px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.bottomsheet.nearby-panel .bottomsheet-title-row {
    display: none;
}

.bottomsheet.nearby-panel .bottomsheet-content {
    padding-top: 16px;
}

.nearby-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nearby-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nearby-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
}

.nearby-radius {
    font-size: 15px;
    color: #6b7280;
    margin-top: 0;
    font-weight: 500;
}

.nearby-badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(242, 107, 29, 0.12);
    color: #f26b1d;
    font-weight: 700;
    font-size: 13px;
}

.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nearby-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
}

.nearby-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nearby-close-floating {
    position: absolute;
    left: 20px;
    bottom: 20px;
    width: min(442px, calc(100% - 40px));
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-start;
    padding: 16px 20px;
    border-radius: 10px;
    border: 2px solid #f26b1d;
    background: #ffffff;
    color: #f26b1d;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    z-index: 4;
}

.nearby-close-floating:hover {
    background: #fff7f0;
}

.bottomsheet.nearby-panel.has-external-close.left-bottom {
    bottom: 92px;
}

.line-status-pill .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.line-status-info {
    margin-left: 10px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: #eef4ff;
    color: #3b82f6;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.line-status-info svg {
    width: 16px;
    height: 16px;
}

.line-details-divider {
    height: 1px;
    background: #eceff4;
    margin: 20px 0;
}

.bottomsheet.line-details-panel .section-title {
    font-size: 14px;
    letter-spacing: 2px;
    color: #9aa1ad;
    font-weight: 700;
    text-transform: uppercase;
}

.bottomsheet.line-details-panel .schedule-list {
    margin-top: 8px;
}

.bottomsheet.line-details-panel .schedule-row {
    padding: 16px 0;
    border-bottom: 1px solid #edf0f4;
    font-size: 18px;
    color: #111827;
}

.bottomsheet.line-details-panel .schedule-row:last-child {
    border-bottom: none;
}

.bottomsheet.line-details-panel .schedule-row span:last-child {
    color: #4b5563;
    font-weight: 500;
}

.bottomsheet.line-details-panel .schedule-notes {
    margin-top: 12px;
    color: #9aa1ad;
    font-size: 14px;
    line-height: 1.4;
}

/* duplicate definition removed */

.bottomsheet.line-details-panel .bottomsheet-title-row {
    border-bottom: 1px solid #e5e7eb;
}


.bottomsheet.open {
    transform: translateX(-50%) translateY(0);
}

.bottomsheet.left-bottom {
    left: 20px;
    bottom: 20px;
    transform: translateY(120%);
    width: min(442px, calc(100% - 40px));
}

.bottomsheet.left-bottom.open {
    transform: translateY(0);
}

.bottomsheet-header {
    padding: 16px 20px 0;
    position: relative;
}

.bottomsheet-handle {
    width: 48px;
    height: 4px;
    border-radius: 999px;
    background: #d1d5db;
    margin: 0 auto 12px;
}

.bottomsheet-title-row {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.bottomsheet-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
    background: #f3f4f6;
    padding: 6px;
}

.bottomsheet-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

.bottomsheet-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-top: 2px;
}

.bottomsheet-close {
    position: absolute;
    top: 12px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #111827;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.bottomsheet-content {
    padding: 12px 20px 20px;
    overflow-y: auto;
}

.section {
    margin-top: 16px;
}

.section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6b7280;
    font-weight: 700;
    margin-bottom: 8px;
}

.disruption-card {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    padding: 12px;
    border-radius: 14px;
}

.disruption-title {
    font-size: 14px;
    font-weight: 700;
    color: #9a3412;
}

.disruption-subtitle {
    font-size: 13px;
    color: #9a3412;
    margin-top: 4px;
}

.disruption-note {
    font-size: 13px;
    color: #9a3412;
    margin-top: 8px;
    white-space: pre-line;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.schedule-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
    padding-bottom: 6px;
}

.schedule-row:last-child {
    border-bottom: none;
}

.schedule-notes {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    white-space: pre-line;
}

.station-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.station-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #111827;
}

.station-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--line-color, #111827);
    flex-shrink: 0;
}

.station-identifier {
    font-size: 12px;
    color: #6b7280;
}

.line-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.line-chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 12px;
    font-weight: 600;
    color: #111827;
}
