.portofino-routes-overview {
    min-width: 0;
    margin: 24px 0;
    overflow: hidden;
    border: 1px solid #e2ddd3;
    border-radius: 18px;
    background: #fff;
    color: #0b192c;
}

.portofino-routes-overview-preview {
    position: relative;
    display: block;
    background: #faf7f2;
    color: #0b192c;
    text-decoration: none;
}

.portofino-routes-overview-preview > picture { display: block; }

.portofino-routes-overview-preview > picture > img {
    display: block;
    width: 100%;
    height: auto;
}

.portofino-routes-overview-action {
    position: absolute;
    right: 18px;
    top: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 17px;
    border: 1px solid #d4c6b0;
    border-radius: 999px;
    background: #fffdf9;
    box-shadow: 0 3px 12px #0b192c14;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.portofino-routes-overview-preview:hover .portofino-routes-overview-action {
    background: #f5efe4;
    border-color: #9f835e;
}

.portofino-routes-overview-caption {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 20px;
    padding: 17px 22px;
    border-bottom: 1px solid #e9e3d8;
    font-size: 13px;
    line-height: 1.6;
}

.portofino-routes-overview-caption strong { font-weight: 600; }
.portofino-routes-overview-label { display: grid; gap: 2px; }
.portofino-routes-overview-label > span { color: #647080; }
.portofino-routes-interactive-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 16px;
    border: 1px solid #b5a183;
    border-radius: 10px;
    color: #0b192c;
    background: #faf7f2;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}
.portofino-routes-interactive-link:hover { background: #f1e9dc; border-color: #9f835e; }
.portofino-routes-interactive-link:focus-visible,
.portofino-route-details > summary:focus-visible { outline: 3px solid #9f835e; outline-offset: 3px; }
#boatRoutes, #summerExplorer { scroll-margin-top: 110px; }
.portofino-route-details {
    border: 1px solid #e2ddd3;
    border-radius: 12px;
    background: #fff;
}
.portofino-route-details > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 20px;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    margin: 0;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}
.portofino-route-details > summary::-webkit-details-marker { display: none; }
.portofino-route-details .route-duration { white-space: nowrap; }
.portofino-route-details .route-path { font-size: 14px; line-height: 1.5; }
.portofino-route-toggle { color: #806a49; }
.portofino-route-details[open] .portofino-route-toggle { transform: rotate(45deg); }
.portofino-route-body { padding: 0 16px 18px; border-top: 1px solid #eee9df; }
.portofino-route-body > p:first-child { margin-top: 16px; }

.portofino-routes-overview-dialog {
    position: fixed;
    inset: 0;
    width: min(1440px, calc(100vw - 48px));
    height: min(1080px, calc(100vh - 48px));
    height: min(1080px, calc(100dvh - 48px));
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: hidden;
    border: 1px solid #ded7ca;
    border-radius: 18px;
    background: #faf7f2;
    color: #0b192c;
    box-shadow: 0 20px 100px #0005;
}

.portofino-routes-overview-dialog[open] { display: flex; flex-direction: column; }
.portofino-routes-overview-dialog::backdrop { background: #07101ed9; }

.portofino-routes-overview-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    padding: 14px 18px;
    border-bottom: 1px solid #e2ddd3;
    background: #fffdf9;
}

.portofino-routes-overview-title {
    margin: 0;
    font-family: var(--font-serif, Georgia, serif);
    font-size: 27px;
    font-weight: 600;
    line-height: 1.15;
}

.portofino-routes-overview-controls { display: flex; align-items: center; gap: 6px; }

.portofino-routes-overview-toolbar button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid #d9d0c2;
    border-radius: 9px;
    background: #fff;
    color: #0b192c;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
}

.portofino-routes-overview-toolbar button:hover { border-color: #9f835e; background: #f5efe4; }
.portofino-routes-overview-toolbar button:disabled { opacity: .4; cursor: default; }
.portofino-routes-overview-toolbar .portofino-routes-overview-fit { width: auto; padding: 0 13px; font-size: 13px; font-weight: 500; }
.portofino-routes-overview-toolbar .portofino-routes-overview-close { border-radius: 50%; }
.portofino-routes-overview-controls output { min-width: 48px; color: #596879; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }

.portofino-routes-overview-viewport {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    background: #eeeae1;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
}

.portofino-routes-overview-stage { display: grid; place-items: center; min-width: 100%; min-height: 100%; }
.portofino-routes-overview-stage > img { display: block; max-width: none; height: auto; user-select: none; -webkit-user-drag: none; }
.portofino-routes-overview-viewport.is-zoomed { cursor: grab; }
.portofino-routes-overview-viewport.is-dragging { cursor: grabbing; }

.portofino-routes-overview-preview:focus-visible { outline: 3px solid #9f835e; outline-offset: -4px; }
.portofino-routes-overview-toolbar button:focus-visible { outline: 3px solid #9f835e; outline-offset: 3px; }
.portofino-routes-overview-viewport:focus-visible { outline: 3px solid #9f835e; outline-offset: -3px; }

@media (max-width: 600px) {
    .portofino-routes-overview { margin: 20px 0; border-radius: 13px; }
    .portofino-routes-overview-preview > picture > img { aspect-ratio: 900 / 1420; }
    .portofino-routes-overview-action { right: 10px; top: 10px; padding: 9px 13px; font-size: 12px; }
    .portofino-routes-overview-caption { padding: 13px 15px; font-size: 12px; }
    .portofino-routes-interactive-link { width: 100%; margin-top: 9px; }
    .portofino-route-details > summary { grid-template-columns: minmax(0, 1fr) 20px; padding: 14px; gap: 9px 12px; }
    .portofino-route-details .route-duration { justify-self: start; }
    .portofino-route-details .route-path { grid-row: 2; font-size: 13px; }
    .portofino-route-toggle { grid-column: 2; grid-row: 1 / 3; }
    .portofino-route-body { padding-right: 14px; padding-left: 14px; }
    .portofino-routes-overview-dialog { width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
    .portofino-routes-overview-toolbar {
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 10px;
        padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
    }
    .portofino-routes-overview-title { font-size: 25px; }
    .portofino-routes-overview-controls { grid-row: 2; grid-column: 1 / -1; justify-content: center; }
    .portofino-routes-overview-close { grid-row: 1; grid-column: 2; }
}
