.center-map-layout {
    display: block;
    width: 100%;
    min-width: 0;
}

.center-map-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
}

.center-route-map-container {
    width: 100% !important;
    max-width: 100%;
    height: 420px;
    min-height: 420px;
}

.center-map-canvas-shell {
    position: relative;
    width: 100%;
    min-width: 0;
}

.center-map-basemap-loading {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(15 23 42 / 0.82);
    color: rgb(226 232 240);
    pointer-events: none;
}

.center-map-basemap-loading__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.center-map-basemap-loading__spinner {
    width: 1.75rem;
    height: 1.75rem;
    animation: center-map-spin 0.8s linear infinite;
}

@keyframes center-map-spin {
    to {
        transform: rotate(360deg);
    }
}

.center-map-wrapper:fullscreen,
.center-map-wrapper:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: var(--fi-body-bg, #fff);
}

.center-map-wrapper:fullscreen .center-map-canvas-shell,
.center-map-wrapper:-webkit-full-screen .center-map-canvas-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.center-map-wrapper:fullscreen .center-route-map-container,
.center-map-wrapper:-webkit-full-screen .center-route-map-container {
    flex: 1 1 auto;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
}

.center-map-wrapper:fullscreen .leaflet-container,
.center-map-wrapper:-webkit-full-screen .leaflet-container {
    width: 100% !important;
    height: 100% !important;
}

.center-map-overlay-toolbar {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    pointer-events: none;
}

.center-map-overlay-controls--time {
    flex: 1;
    min-width: 0;
    max-width: min(420px, calc(100% - 18rem));
    pointer-events: auto;
}

.center-map-overlay-controls--actions {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-shrink: 0;
    margin-left: auto;
    pointer-events: auto;
}

.center-map-time-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    width: 100%;
    margin-left: 40px;
}

.center-map-datetime-input {
    width: 100%;
    max-width: 16rem;
    border-radius: 0.375rem;
    border: 1px solid rgb(209 213 219);
    background-color: rgb(255 255 255);
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(17 24 39);
}

.center-map-time-control__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 0;
}

.center-map-animation-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.center-map-animation-btn {
    flex-shrink: 0;
}

.center-map-preload-status {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 12rem;
}

.center-map-preload-progress {
    height: 0.375rem;
    width: 100%;
    overflow: hidden;
    border-radius: 9999px;
    background-color: rgb(229 231 235);
}

.dark .center-map-preload-progress {
    background-color: rgb(55 65 81);
}

.center-map-preload-progress__bar {
    height: 100%;
    border-radius: 9999px;
    background-color: rgb(37 99 235);
    transition: width 150ms ease-out;
}

.dark .center-map-preload-progress__bar {
    background-color: rgb(96 165 250);
}

.center-map-zoom-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.center-map-time-stepper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    width: 100%;
}

.center-map-time-stepper input[type="range"] {
    flex: 1;
    min-width: 0;
    width: auto;
}

.center-map-time-step-btn {
    flex-shrink: 0;
}

.center-map-overlay-controls {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    pointer-events: auto;
}

.center-map-layer-control, .center-map-region-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.center-map-layer-label, .center-map-region-label {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background: rgb(255 255 255 / 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: rgb(55 65 81);
}

.dark .center-map-layer-label, .dark .center-map-region-label {
    background: rgb(31 41 55 / 0.9);
    color: rgb(229 231 235);
}

.center-map-layer-label .weather-layer-label-text {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.center-map-overlay-status {
    position: absolute;
    top: 3.75rem;
    right: 0.5rem;
    left: auto;
    max-width: calc(100% - 1rem);
    z-index: 1000;
    pointer-events: none;
}

.center-map-overlay-status p {
    margin: 0;
    padding: 0.25rem 0.375rem;
    border-radius: 0.25rem;
    background: rgb(255 255 255 / 0.9);
}

.dark .center-map-overlay-status p {
    background: rgb(31 41 55 / 0.9);
}

.center-map-voyage-card {
    margin: 0;
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    background: rgb(255 255 255 / 0.92);
    max-width: min(320px, calc(100% - 1rem));
    overflow-wrap: anywhere;
    word-break: break-word;
    pointer-events: auto;
}

.dark .center-map-voyage-card {
    background: rgb(31 41 55 / 0.92);
}

.center-map-voyage-card__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.center-map-voyage-card__title {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25;
    width: 3rem;
}

.center-map-voyage-card__body {
    margin-top: 0.375rem;
}

.center-map-voyage-card__line {
    margin: 0 0 0.25rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: rgb(55 65 81);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dark .center-map-voyage-card__line {
    color: rgb(229 231 235);
}

.center-map-voyage-card__line:last-child {
    margin-bottom: 0;
}

.center-map-bottom-left {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: min(320px, calc(100% - 1rem));
    pointer-events: none;
}

.center-map-fullscreen-btn {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .center-map-layer-control .weather-layer-select, .center-map-region-control .weather-layer-select {
        max-width: calc(100vw - 4rem);
    }
}

.center-route-marker {
    background: transparent;
    border: 0;
}

.center-route-marker__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.center-route-marker--departure .center-route-marker__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #16a34a;
    box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
}

.center-route-marker--departure svg {
    width: 14px;
    height: 14px;
    color: #16a34a;
}

.center-route-marker--last .center-route-marker__arrow-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 1px 4px rgb(0 0 0 / 25%);
}

.center-route-marker--last .center-route-marker__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.center-route-marker--last svg {
    width: 16px;
    height: 16px;
    color: #fff;
}

.center-map-legend {
    position: relative;
    max-width: 100%;
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    background: rgb(255 255 255 / 0.92);
    pointer-events: none;
    font-size: 0.75rem;
}

.dark .center-map-legend {
    background: rgb(31 41 55 / 0.92);
}

.center-map-legend__title {
    margin: 0 0 0.375rem;
    font-weight: 600;
    line-height: 1.25;
}

.center-map-legend__row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.125rem;
}

.center-map-legend__row:last-child {
    margin-bottom: 0;
}

.center-map-legend__swatch {
    width: 1rem;
    height: 0.75rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.center-map-legend__image {
    max-width: 100%;
    height: auto;
    display: block;
}

.center-map-point-result {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 1000;
    max-width: min(280px, calc(100% - 1rem));
    padding: 0.5rem 0.625rem;
    border-radius: 0.375rem;
    background: rgb(255 255 255 / 0.92);
    pointer-events: none;
    font-size: 0.75rem;
}

.dark .center-map-point-result {
    background: rgb(31 41 55 / 0.92);
}

.center-map-point-result__layer {
    margin: 0 0 0.25rem;
    font-weight: 600;
    line-height: 1.25;
}

.center-map-point-result__value {
    margin: 0 0 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

.center-map-point-result__coords,
.center-map-point-result__meta {
    margin: 0;
    color: rgb(107 114 128);
    line-height: 1.35;
}

.dark .center-map-point-result__coords,
.dark .center-map-point-result__meta {
    color: rgb(156 163 175);
}

@media (prefers-reduced-motion: no-preference) {
    .center-route-marker--last .center-route-marker__arrow-wrap {
        animation: center-route-pulse 2s ease-out infinite;
    }
}

@keyframes center-route-pulse {
    0% {
        box-shadow: 0 0 0 0 rgb(37 99 235 / 0.45);
    }
    70% {
        box-shadow: 0 0 0 10px rgb(37 99 235 / 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgb(37 99 235 / 0);
    }
}

.center-route-tools {
    width: 100%;
}

.center-route-tools__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .center-route-tools__grid {
        grid-template-columns: 1fr;
    }
}

.center-route-tool-card__hint {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: rgb(107 114 128);
}

.dark .center-route-tool-card__hint {
    color: rgb(156 163 175);
}

.center-route-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.center-route-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(15 23 42 / 0.45);
}

.center-route-modal__panel {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(80vh, 720px);
    overflow: auto;
    border-radius: 0.75rem;
    background: rgb(255 255 255);
    padding: 1.25rem;
    box-shadow: 0 20px 40px rgb(0 0 0 / 0.18);
}

.dark .center-route-modal__panel {
    background: rgb(17 24 39);
}

.center-route-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.center-route-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}

.center-route-modal__empty {
    margin: 0;
    font-size: 0.875rem;
    color: rgb(107 114 128);
}

.dark .center-route-modal__empty {
    color: rgb(156 163 175);
}

.center-route-calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.center-route-calendar__month {
    font-size: 0.875rem;
    font-weight: 650;
}

.center-route-calendar__weekdays,
.center-route-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.25rem;
}

.center-route-calendar__weekday {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    color: rgb(107 114 128);
}

.center-route-calendar__day {
    min-height: 2.25rem;
    border-radius: 0.375rem;
    border: 1px solid rgb(229 231 235);
    font-size: 0.75rem;
    line-height: 2.25rem;
    text-align: center;
}

.dark .center-route-calendar__day {
    border-color: rgb(55 65 81);
}

.center-route-calendar__day--empty {
    border-color: transparent;
}

.center-route-calendar__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.875rem;
}

.center-route-calendar__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
}

.center-route-calendar__swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.center-route-calendar__swatch--underway {
    background: #2563eb;
}

.center-route-calendar__swatch--anchored {
    background: #d97706;
}

.center-route-calendar__swatch--in-port {
    background: #16a34a;
}
