/* Bar detail page (/bar/<slug>)
   Moved out of templates/bar_detail.html (issue #56). Loaded after barwatch.css from
   {% block extra_css %}; the sections keep their original order. */
.jump-menu-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure all cards and containers respect viewport width */
.chart-card, .status-card, .fishing-resources-card {
    max-width: 100%;
    box-sizing: border-box;
}

/* Header title - logo + bar name (matches other pages) */
.header-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-title .header-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

.header-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Logo - match main page size (48x48) */
.header-title .logo-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-title .logo-icon img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.header-title .logo-icon svg {
    width: 28px;
    height: 28px;
    color: var(--ocean-glow);
}

/* Large logo mode - match index page */
.header-title .logo-icon.large-mode {
    width: auto;
    height: auto;
    min-width: unset;
}

/* Allow custom logos to use their configured height */
.header-title .logo-icon.custom-logo {
    width: auto;
    height: auto;
    min-width: unset;
}

/* Subscribe button styling */
.subscribe-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem;
    background: rgba(59, 158, 206, 0.15);
    color: var(--ocean-glow);
    border: 1px solid rgba(59, 158, 206, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.subscribe-btn:hover {
    background: rgba(59, 158, 206, 0.25);
    border-color: var(--ocean-glow);
}

.subscribe-btn.subscribed {
    background: var(--ocean-glow);
    color: var(--ocean-deep);
}

/* Status card SVG sizing - inline fallback for CSS caching issues */
.status-card-compact .header-action-btn svg,
.status-card-compact .contact-info svg,
.status-card-compact .weather-summary svg,
.email-subscribe-card svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.email-subscribe-card .email-icon {
    width: 48px;
    height: 48px;
}

.bar-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.bar-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--ocean-glow);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 158, 206, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(59, 158, 206, 0.2);
    transition: background-color 0.2s, border-color 0.2s;
}

.bar-phone:hover {
    background: rgba(59, 158, 206, 0.2);
    border-color: var(--ocean-glow);
}

.phone-label {
    color: var(--text-secondary);
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 500;
    padding-right: 0.25rem;
    border-right: 1px solid rgba(59, 158, 206, 0.3);
    margin-right: 0.25rem;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.last-report {
    text-align: right;
    color: var(--text-secondary);
}

.last-report-date {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.last-report-time {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ocean-glow);
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .header-title {
        gap: 0.75rem;
        flex: 1;
        min-width: 0;
    }
    .header-title .logo-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    .header-title .logo-icon svg {
        width: 24px;
        height: 24px;
    }
    .header-title .logo-icon.custom-logo,
    .header-title .logo-icon.large-mode {
        width: auto;
        height: auto;
        min-width: unset;
    }
    .header-title h1 {
        font-size: 1.125rem;
    }
    .header-title .header-subtitle {
        display: none;
    }
    .status-header {
        gap: 0.75rem;
        align-items: center;
    }
    .last-report {
        text-align: right;
    }
    .last-report-date {
        font-size: 0.875rem;
    }
    .last-report-time {
        font-size: 1rem;
    }
    /* Compact VHF button on mobile - icon only */
    .vhf-toggle .vhf-text,
    .vhf-toggle .vhf-expand-icon {
        display: none;
    }
    .vhf-toggle {
        padding: 0.5rem !important;
    }
    .nav {
        display: none;
    }
}

/* VHF Expandable Section */
.vhf-info {
    position: relative;
}

.vhf-toggle {
    cursor: pointer;
}

.vhf-details {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: var(--ocean-dark);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 1rem;
    min-width: 280px;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.vhf-details.show {
    display: block;
}

.vhf-channel {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(59, 158, 206, 0.1);
}

.vhf-channel:last-of-type {
    border-bottom: none;
}

.vhf-channel strong {
    color: var(--ocean-glow);
    font-size: 0.9rem;
}

.vhf-purpose {
    color: var(--text-primary);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.vhf-freq {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

.vhf-note {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(59, 158, 206, 0.1);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.vhf-expand-icon.rotated {
    transform: rotate(180deg);
}

/* Inline Disclaimer */
.inline-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    opacity: 0.8;
}
.inline-disclaimer strong {
    color: var(--status-restricted);
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-primary);
    background: rgba(59, 158, 206, 0.1);
    border: 1px solid rgba(59, 158, 206, 0.2);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: rgba(59, 158, 206, 0.2);
    border-color: var(--ocean-glow);
    color: var(--ocean-glow);
}

.pagination-btn.active {
    background: var(--ocean-glow);
    border-color: var(--ocean-glow);
    color: var(--background-dark);
    font-weight: 600;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 0.25rem;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .pagination-controls {
        flex-direction: column;
        text-align: center;
    }
}

/* Status Legend for Conditions Chart */
.chart-legend-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.legend-color.open {
    background: rgba(72, 187, 120, 0.35);
}

.legend-color.restricted {
    background: rgba(237, 137, 54, 0.35);
}

.legend-color.closed {
    background: rgba(245, 101, 101, 0.35);
}

/* Fullscreen chart mode */
.chart-fullscreen-btn {
    display: none;
}

.chart-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--z-modal) + 10);
    background: var(--ocean-deep);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.chart-wrapper.fullscreen .chart-container {
    flex: 1;
    height: auto !important;
    margin-bottom: 0;
}

.chart-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.5rem 0 1rem;
    line-height: 1.5;
}

.fullscreen-header {
    display: none;
}

.chart-wrapper.fullscreen .fullscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.fullscreen-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.fullscreen-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .chart-fullscreen-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .chart-hint {
        display: none;
    }
}

/* Fishing Resources Card */
.fishing-resources-card {
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.fishing-header {
    margin-bottom: 1rem;
}

.fishing-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.fishing-agency {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.fishing-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.fishing-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(59, 158, 206, 0.08);
    border: 1px solid rgba(59, 158, 206, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.2s, border-color 0.2s, opacity 0.2s, translate 0.2s;
    translate: 0px;  /* keeps the stacking context the same on hover (#168) */
}

.fishing-link:hover {
    background: rgba(59, 158, 206, 0.15);
    border-color: rgba(59, 158, 206, 0.4);
}
@media (prefers-reduced-motion: no-preference) { .fishing-link:hover { translate: 0 -1px; } }

.fishing-link-icon {
    font-size: 1.1rem;
}

.fishing-link-label {
    flex: 1;
}

.fishing-link .external-icon {
    opacity: 0.5;
    flex-shrink: 0;
}

.fishing-link:hover .external-icon {
    opacity: 0.8;
}

.fishing-email-signup {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: border-color 0.2s, color 0.2s;
}

.fishing-email-signup:hover {
    border-color: var(--ocean-glow);
    color: var(--ocean-glow);
}

.fishing-email-signup svg {
    opacity: 0.7;
}

@media (max-width: 480px) {
    .fishing-links {
        grid-template-columns: 1fr;
    }
}

/* Page Layout — NewTheme: full-width edge-to-edge canvas, no sidebar rail */
.page-layout {
    display: block;
    width: 100%;          /* body is flex-column; without a definite width the
                             auto margins below disable align-items:stretch, so
                             the div sizes to max-content and overflows on mobile */
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* The bar page is an edge-to-edge canvas the width of the shared page
   container. Each section is inset by --page-pad (a margin, so its divider
   lines end where the header and plan cards do), and all content shares the
   header's left edge (#97). */
main.main-content.page-main {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    padding-inline: 0;
    overflow-x: hidden;
}

.page-sidebar { display: none; }

.detail-inline-ad { padding: 18px 0; margin: 0 var(--page-pad); }
.detail-inline-ad:empty { display: none; }

/* ===== Sticky section nav ===== */
/* Fragment links and focus land below the sticky section nav, not under it
   (#157; WCAG 2.4.11). 56px = the nav's height plus a small gap. */
html { scroll-padding-top: 56px; }
.section-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 18px;
    /* Full-width bar, padded so its content starts at the page container's
       left edge on every screen width. */
    padding: 0 max(var(--page-pad), calc(50% - var(--page-max) / 2 + var(--page-pad)));
    background: var(--ocean-dark);
    border-bottom: 1px solid var(--card-border);
    overflow-x: auto;
}
.section-nav-home {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.78125rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}
.section-nav-home:hover { color: var(--text-primary); }
.section-nav-tabs { display: flex; gap: 4px; }
.section-tab {
    display: inline-block;
    flex-shrink: 0;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 14px 14px 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.84375rem;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    white-space: nowrap;
}
.section-tab:hover { color: var(--text-primary); }
.section-tab[aria-current="true"] { color: var(--text-primary); border-bottom-color: var(--ocean-glow); }
/* A section focused by its link: no ring around the whole section */
section[tabindex="-1"]:focus { outline: none; }

.su-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status-open); flex-shrink: 0; }
.su-dot.aging { background: var(--status-restricted); }
.su-dot.stale, .su-dot.unknown { background: var(--status-closed); }
/* Shape as well as colour (#163): fresh = circle, aging = triangle, stale = square */
.su-dot.aging { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 8px; height: 8px; }
.su-dot.stale, .su-dot.unknown { border-radius: 1px; }

/* Call action, pinned beside the status */
.signboard-call {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 36px var(--page-pad) 32px 28px;
    border-left: 1px solid var(--card-border);
}
.strip-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.strip-station-name { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-secondary); margin-top: 6px; }
.strip-phone {
    display: inline-block;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.625rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-decoration: none;
    margin-top: 7px;
}
.strip-phone:hover { color: var(--ocean-glow); }
.strip-call {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--on-accent);
    background: var(--ocean-glow);
    padding: 12px 18px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
}
.strip-call:hover { background: var(--ocean-foam); color: var(--on-accent); }
.strip-call svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.strip-call-short { display: none; }

/* ===== Metric strip ===== */
.detail-strip { display: flex; flex-wrap: wrap; margin: 0 var(--page-pad); border-bottom: 1px solid var(--card-border); }
.strip-cell { flex: 1; min-width: 96px; padding: 18px 22px; border-right: 1px solid var(--card-border); }
.strip-cell:first-child { padding-left: 0; }
.strip-cell:last-child { border-right: none; }
.strip-value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-top: 9px;
}
.strip-unit { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 400; color: var(--text-muted); margin-left: 4px; }
.strip-sub { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; }

/* ===== Live report: webcam + NOAA ===== */
.detail-report { display: grid; grid-template-columns: 1fr 1fr; margin: 0 var(--page-pad); border-bottom: 1px solid var(--card-border); }
/* min-width: 0 lets the grid column shrink to the phone width instead of growing to fit the camera buttons */
.report-cam { border-right: 1px solid var(--card-border); padding: 28px 0; min-width: 0; }
.report-noaa { padding: 28px 0; }
.report-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.report-title { font-family: var(--font-display); font-weight: 800; font-size: 1.1875rem; text-transform: uppercase; letter-spacing: -0.01em; color: var(--text-primary); }
.report-live { display: flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; color: var(--status-closed); }
.report-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--status-closed); box-shadow: 0 0 8px var(--status-closed); }
.report-issued { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.report-zone { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); margin-bottom: 10px; }
.report-narrative { font-size: 0.9375rem; line-height: 1.55; color: var(--text-secondary); }
.report-restriction { margin-top: 12px; font-size: 0.875rem; color: var(--text-secondary); padding: 10px 12px; border-left: 3px solid var(--status-restricted); background: var(--status-restricted-bg); border-radius: 4px; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 18px; }
.report-actions .header-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.report-cam-empty { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-muted); padding: 2rem 0; }
/* Keep the webcam image responsive — the <img> carries width="640" which otherwise overflows narrow screens */
.report-cam .webcam-frame img { display: block; width: 100%; max-width: 100%; height: auto; }
.report-cam .webcam-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; background: var(--ocean-deep); }
/* Every panel shares one grid cell (the section is always as tall as the
   tallest panel) and every frame is 16:9, so switching cameras never shifts the page below. */
.cam-panels.multi { display: grid; }
.cam-panels.multi > .cam-panel { grid-area: 1 / 1; min-width: 0; }
.cam-panels.multi > .cam-panel[hidden] { display: block; visibility: hidden; }
.report-cam .webcam-frame {
    max-width: 100%;
    aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
    overflow: hidden; border-radius: 8px; background: var(--ocean-deep);
}
.report-cam .webcam-frame img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.report-cam .webcam-frame iframe { height: 100%; }
/* Camera card: the chosen camera large, its name and source under it, and a
   rail of thumbnails (beside the picture when the card is wide, under it otherwise) */
.report-cam { container-type: inline-size; }
.cam-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@container (min-width: 640px) {
    .cam-layout.has-rail { grid-template-columns: minmax(0, 1fr) 132px; align-items: start; }
    .cam-layout.has-rail .cam-rail { grid-auto-flow: row; grid-auto-columns: auto; }
}
.cam-view { position: relative; }
/* Badge on the picture: top-left on video (player controls are along the bottom),
   bottom-left on stills (most stills print their own clock in the top-left corner) */
.cam-badge {
    position: absolute; left: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 7px;
    max-width: calc(100% - 64px); padding: 4px 10px; border-radius: var(--radius-full);
    background: var(--scrim-strong); color: var(--text-primary);
    font-size: var(--text-xs); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none;
}
.cam-badge.is-live { top: 10px; }
.cam-badge.is-still { bottom: 10px; }
.cam-badge-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--status-open); }
.cam-badge.is-live .cam-badge-dot { background: var(--status-closed); box-shadow: 0 0 8px var(--status-closed); }
.cam-badge.is-stale .cam-badge-dot { background: var(--freshness-stale); }
.cam-expand {
    position: absolute; top: 10px; right: 10px; z-index: 1; width: 36px; height: 36px;
    display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
    background: var(--scrim-strong); color: var(--text-primary); cursor: zoom-in; transition: var(--transition-ui);
}
.cam-expand:hover { background: var(--ocean-glow); color: var(--on-accent); }
.cam-expand svg { width: 16px; height: 16px; }
.cam-caption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; margin-top: 10px; }
.cam-name { font-family: var(--font-display); font-weight: 800; font-size: var(--text-md); text-transform: uppercase; letter-spacing: -0.01em; color: var(--text-primary); min-width: 0; }
.cam-source { font-size: var(--text-xs); color: var(--text-muted); min-width: 0; }
.cam-name a, .cam-source a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.cam-name a:hover, .cam-source a:hover { color: var(--ocean-glow); }
/* Thumbnail rail */
.cam-rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.cam-thumb {
    position: relative; display: block; padding: 0; border: 0; border-radius: var(--radius-md); overflow: hidden;
    aspect-ratio: 16 / 9; background: var(--ocean-mid); color: var(--text-secondary); cursor: pointer;
    opacity: 0.65; outline: 2px solid transparent; outline-offset: 0; transition: var(--transition-ui), opacity var(--dur-base) var(--ease-out);
}
.cam-thumb:hover { opacity: 0.9; }
/* Selected camera: full opacity and an outline, so it does not rely on colour alone (#156) */
.cam-thumb[aria-selected="true"] { opacity: 1; outline-color: var(--ocean-glow); }
.cam-thumb:focus-visible { outline: 2px solid var(--ocean-foam); outline-offset: 2px; }
.cam-thumb-media, .cam-thumb-img, .cam-thumb-play { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam-thumb-img { object-fit: cover; }
/* Play tile: shown for video cameras whose provider publishes no picture (and under the picture while it loads) */
.cam-thumb-play {
    display: grid; place-items: center; padding-bottom: 1.25rem;
    background: radial-gradient(circle at 50% 40%, var(--ocean-light), var(--ocean-deep) 75%); color: var(--text-primary);
}
.cam-thumb-play svg {
    width: 30px; height: 30px; padding: 7px 6px 7px 8px; border-radius: 50%;
    background: var(--ocean-glow); color: var(--on-accent);
}
.cam-thumb-label {
    position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 1px 6px; border-radius: var(--radius-sm);
    background: var(--scrim-strong); color: var(--text-primary); font-size: var(--text-xs); font-weight: 600; text-align: left;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cam-thumb-live { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--status-closed); }
.img-fallback--thumb { position: absolute; inset: 0; display: grid; place-items: center; padding: 0 0 1.5rem; }

.detail-stale-note {
    padding: 16px 0;
    margin: 0 var(--page-pad);
    border-bottom: 1px solid var(--card-border);
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.detail-stale-note .inline-alert { margin-bottom: 12px; }
.section-alert { margin-bottom: 1rem; }
.tide-load-error { grid-column: 1 / -1; }
.mf-none { color: var(--text-muted); font-weight: 400; font-size: var(--text-xs); }

/* ===== Shared section header ===== */
.detail-section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.detail-section-title { font-family: var(--font-display); font-weight: 800; font-size: 1.1875rem; text-transform: uppercase; letter-spacing: -0.01em; color: var(--text-primary); }

/* ===== Nearby Bars ===== */
.detail-nearby { padding: 26px 0; margin: 0 var(--page-pad); border-top: 1px solid var(--card-border); }
.detail-nearby-all { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ocean-glow); text-decoration: none; }
.nearby-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.nearby-card { display: flex; align-items: center; gap: 14px; text-decoration: none;padding: 13px 16px; transition: border-color 0.14s ease; }
.nearby-card:hover { border-color: var(--card-border-hover); }
.nearby-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--status-unknown); }
.nearby-dot.open { background: var(--status-open); }
.nearby-dot.restricted { background: var(--status-restricted); }
.nearby-dot.closed { background: var(--status-closed); }
/* Shape as well as colour (#163) */
.nearby-dot.restricted { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.nearby-dot.closed { border-radius: 1px; }
.nearby-dot.unknown { background: transparent; box-shadow: inset 0 0 0 2px var(--status-unknown); }
.nearby-name { flex: 1; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text-primary); }
.nearby-level { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xs); letter-spacing: 0.05em; text-transform: uppercase; }
.nearby-level.open { color: var(--status-open); }
.nearby-level.restricted { color: var(--status-restricted); }
.nearby-level.closed { color: var(--status-closed); }
.nearby-level.unknown { color: var(--status-unknown); }
.nearby-swell { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); min-width: 52px; text-align: right; }

@media (max-width: 860px) {

    .nearby-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .detail-report { grid-template-columns: 1fr; }
    .report-cam { border-right: none; border-bottom: 1px solid var(--card-border); }

    .strip-cell { padding: 14px 12px; }
    .strip-value { font-size: 1.625rem; }
    /* Call action: one bar fixed to the bottom of the screen, always in reach */
    .signboard-call {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 95;
        width: auto;
        padding: 10px var(--page-pad) calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--ocean-dark);
        border-left: none;
        border-top: 1px solid var(--card-border);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    }
    .signboard-call-info { display: none; }
    .strip-call-long { display: none; }
    .strip-call-short { display: inline; }
    /* Keep the end of the page and the scroll-to-top button clear of the bar */
    .page-layout.has-call-bar ~ .site-footer { padding-bottom: 76px; }
    .page-layout.has-call-bar ~ .scroll-top-btn { bottom: 6rem; }
}

/* Hero Crossing Badge - page-specific adjustments */
.crossing-badge-hero {
    margin-bottom: 0;
}

.crossing-badge-hero-detail {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* Plain language summary for new users - now unused but kept for reference */
.plain-language-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--ocean-deep);
    border-radius: 6px;
    border-left: 3px solid var(--ocean-glow);
    line-height: 1.5;
}

/* Gauge status indicators */
.gauge-status {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

.gauge-card.gauge-good {
    border-color: rgba(72, 187, 120, 0.3);
}
.gauge-card.gauge-good .gauge-status {
    color: var(--status-open);
}

.gauge-card.gauge-moderate {
    border-color: rgba(236, 201, 75, 0.3);
}
.gauge-card.gauge-moderate .gauge-status {
    color: var(--status-restricted);
}

.gauge-card.gauge-bad {
    border-color: rgba(245, 101, 101, 0.3);
}
.gauge-card.gauge-bad .gauge-status {
    color: var(--status-closed);
}

.condition-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--card-border);
}

.condition-item {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.condition-item svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--ocean-glow);
}

.condition-tip {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(59, 158, 206, 0.08);
    border-radius: 4px;
}

.condition-tip::before {
    content: "💡 ";
}

/* Status Timeline */
.status-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.status-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--card-border);
}
.timeline-entry {
    position: relative;
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1.25rem;
}
.timeline-entry:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    position: absolute;
    left: -1.5rem;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--card-bg);
    box-shadow: 0 0 0 2px var(--card-border);
    flex-shrink: 0;
}
.timeline-dot-open { background: var(--status-open); box-shadow: 0 0 0 2px var(--status-open); }
.timeline-dot-restricted { background: var(--status-restricted); box-shadow: 0 0 0 2px var(--status-restricted); }
.timeline-dot-closed { background: var(--status-closed); box-shadow: 0 0 0 2px var(--status-closed); }
.timeline-dot-unknown { background: var(--text-muted); box-shadow: 0 0 0 2px var(--text-muted); }

.timeline-content {
    min-width: 0;
}
.timeline-status {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
}
.timeline-time {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}
.timeline-conditions {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}
.timeline-restrictions {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.25rem;
}

/* Section title with copy link button */
.section-title-with-link {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.section-title-with-link .copy-link-btn {
    margin-left: auto;
}

/* Forecast scroll wrappers for mobile. overflow-x: auto also clips vertically,
   so the 4px padding leaves room for a card's 2px hover lift (its top border
   was cut off); the matching negative margin keeps the layout unchanged. */
.forecast-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: -4px 0;
    padding: 4px 0;
}

/* Extended 7-Day Forecast */
.extended-forecast-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(110px, 1fr));
    gap: 0.75rem;
}

.forecast-day-card {
    padding: 0.875rem;
    text-align: center;
    transition: translate 0.2s, border-color 0.2s;
    translate: 0px;  /* keeps the stacking context the same on hover (#168) */
}

.forecast-day-card:hover {
    border-color: var(--ocean-glow);
}
@media (prefers-reduced-motion: no-preference) { .forecast-day-card:hover { translate: 0 -2px; } }

.forecast-day-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--ocean-glow);
    margin-bottom: 0.5rem;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    margin: 0.25rem auto 0.5rem;
    display: block;
    border-radius: 8px;
}

.forecast-temp {
    margin-bottom: 0.375rem;
}

.forecast-temp .temp-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.forecast-conditions {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    min-height: 2.6em;
}

.forecast-wind {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.forecast-wind svg {
    color: var(--ocean-glow);
    opacity: 0.7;
}

@media (max-width: 600px) {
    /* Wrap the 7 day-cards across rows instead of forcing a 630px+ single row that overflows narrow phones */
    .extended-forecast-grid {
        grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
        gap: 0.5rem;
    }

    .forecast-day-card {
        padding: 0.625rem;
    }

    .forecast-temp .temp-value {
        font-size: 1.25rem;
    }

    .forecast-icon {
        width: 40px;
        height: 40px;
        margin: 0.125rem auto 0.375rem;
    }

    .forecast-conditions {
        font-size: var(--text-xs);
    }
}

/* Tidal Currents Section */
.current-state-container {
    margin-bottom: 1.25rem;
}

.current-now {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--ocean-deep);
    border-radius: 10px;
    border: 1px solid var(--card-border);
}

.current-type-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
}

.current-type-badge.ebb {
    background: rgba(245, 101, 101, 0.15);
    color: var(--status-closed);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.current-type-badge.flood {
    background: rgba(59, 158, 206, 0.15);
    color: var(--ocean-glow);
    border: 1px solid rgba(59, 158, 206, 0.3);
}

.current-type-badge.slack {
    background: rgba(72, 187, 120, 0.15);
    color: var(--status-open);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.current-type-badge.unknown {
    background: rgba(160, 174, 192, 0.15);
    color: var(--text-muted);
    border: 1px solid rgba(160, 174, 192, 0.3);
}

.next-slack-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.next-slack-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.next-slack-time {
    font-weight: 600;
    color: var(--status-open);
    font-size: 0.9375rem;
}

.estimate-badge {
    font-size: var(--text-xs);
    padding: 0.125rem 0.375rem;
    background: rgba(237, 137, 54, 0.2);
    color: var(--status-restricted);
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.currents-safety-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.75rem;
    background: rgba(59, 158, 206, 0.05);
    border-radius: 6px;
    line-height: 1.5;
}

.currents-safety-note strong {
    color: var(--ocean-glow);
}

@media (max-width: 600px) {
    .current-now {
        flex-direction: column;
        align-items: stretch;
    }

    .next-slack-info {
        margin-left: 0;
        justify-content: center;
    }
}

/* ============================================================================
   Bar Detail Dashboard — top-of-page hero + summary card grid
   ============================================================================ */
.bar-dashboard {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.dashboard-hero > * {
    margin: 0; /* override default chart-card/status-card margin-bottom inside grid */
    min-width: 0;
}

/* Webcam panel in hero (left column on desktop) */
.dashboard-webcam {
    background: linear-gradient(135deg, var(--ocean-dark) 0%, var(--ocean-deep) 100%);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-webcam .webcam-frame {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    min-height: 280px;
    max-height: 460px;
    background: rgba(0, 0, 0, 0.3);
}

.dashboard-webcam .webcam-frame img,
.dashboard-webcam .webcam-frame iframe {
    width: 100%;
    height: 100%;
    max-height: 460px;
    object-fit: contain;
    border-radius: 12px;
    cursor: zoom-in;
    display: block;
    background: #000;
}

.dashboard-webcam .webcam-frame iframe {
    cursor: default;
}

.dashboard-webcam .webcam-meta {
    margin-top: 0.625rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* When no webcam, hero is single-column (status card fills full width) */
.dashboard-hero.no-webcam {
    grid-template-columns: 1fr;
}

/* Status card in hero needs vertical metric layout, not 4-column */
.dashboard-hero .status-card-compact .metrics-row {
    grid-template-columns: 1fr 1fr;
}

.dashboard-hero .status-card-compact .metric-item {
    padding: 0.75rem 0.5rem;
}

/* Summary card row (Buoy / Tide / Forecast) */
.dashboard-summary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-summary-row > * {
    margin: 0;
    min-width: 0;
}

/* NewTheme: edge-to-edge sections (was floating rounded card) */
.summary-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--card-border);
    border-radius: 0;
    padding: 26px 0;
    margin: 0 var(--page-pad) !important;  /* override inline margin-top on the <details> */
    overflow: hidden;
}

.summary-card > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    outline: none;
}

.summary-card > summary::-webkit-details-marker {
    display: none;
}

.summary-card > summary:focus-visible {
    outline: 2px solid var(--ocean-glow);
    outline-offset: 2px;
    border-radius: 8px;
}

.summary-card-title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 0;
}

.summary-card-rows {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.875rem;
}

.summary-card-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.summary-card-row .label {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.summary-card-row .value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.summary-card-row .value.muted {
    color: var(--text-muted);
    font-weight: 500;
}

.summary-card-toggle {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ocean-glow);
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.summary-card-toggle::after {
    content: "▼";
    transition: transform 0.2s ease;
    font-size: var(--text-xs);
    display: inline-block;
}

.summary-card[open] .summary-card-toggle::after {
    transform: rotate(180deg);
}

.summary-card-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

/* Neutralize nested chart-card styling so we don't get a card-in-card */
.summary-card-body .chart-card {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}

.summary-card-body .chart-card + .chart-card {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

/* NewTheme: convert remaining bottom sections to edge-to-edge (detail page only) */
.page-main > .chart-card,
.page-main > .detail-section,
.page-main > .fishing-resources-card,
.page-main > #email-subscribe-section {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--card-border);
    border-radius: 0;
    box-shadow: none;
    padding: 26px 0;
    margin: 0 var(--page-pad) !important;
}
.page-main > .chart-card h2,
.page-main > .detail-section h2,
.page-main > .detail-section h3,
.page-main > .fishing-resources-card .fishing-header {
    font-family: var(--font-display);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

/* Tablet: summary row collapses to 2 columns */
@media (max-width: 1024px) {
    .dashboard-summary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile: everything stacks single-column */
@media (max-width: 768px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-row {
        grid-template-columns: 1fr;
    }

    .dashboard-webcam .webcam-frame {
        min-height: 220px;
        max-height: 340px;
    }

    .dashboard-hero .status-card-compact .metrics-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---- formerly an inline block inside the page body ---- */
.mf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; }
.mf-card {padding: 16px 18px; min-width: 0; }
.mf-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mf-day { font-family: var(--font-display); font-weight: 800; font-size: 1rem; text-transform: uppercase; letter-spacing: -0.01em; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; background: var(--status-unknown); }
.mf-dot.open { background: var(--status-open); }
.mf-dot.restricted { background: var(--status-restricted); }
.mf-dot.closed { background: var(--status-closed); }
/* Shape as well as colour (#163): low = circle, moderate = triangle,
   high = square, no forecast = ring */
.mf-dot.restricted { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.mf-dot.closed { border-radius: 1px; }
.mf-dot.unknown { background: transparent; box-shadow: inset 0 0 0 2px var(--status-unknown); }
.mf-swell { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -0.01em; color: var(--text-primary); margin-top: 12px; }
.mf-wind { font-family: var(--font-mono); font-size: 0.78125rem; color: var(--text-muted); margin-top: 4px; }
.mf-note { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--card-border); line-height: 1.45; }

/* ---- formerly an inline block inside the page body ---- */
.tide-buoy-grid { display: grid; grid-template-columns: 1.3fr 1fr; align-items: stretch; }
.tide-buoy-grid > #tides { grid-column: 1; grid-row: 1; border-right: 1px solid var(--card-border); }
.tide-buoy-grid > #buoy { grid-column: 2; grid-row: 1; }
.tide-buoy-grid > #currents { grid-column: 1 / -1; grid-row: 2; }
@media (max-width: 900px) {
    .tide-buoy-grid { display: block; }
    .tide-buoy-grid > #tides { border-right: none; }
}

/* ---- formerly an inline block inside the page body ---- */
#tide-times-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(85px, 1fr)); gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--card-border); }
.tide-pred-type { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ocean-glow); }
.tide-pred-type.low { color: var(--status-restricted); }
.tide-pred-time { font-family: var(--font-display); font-weight: 800; font-size: 1.0625rem; color: var(--text-primary); margin-top: 4px; }
.tide-pred-h { font-family: var(--font-mono); font-size: var(--text-xs); margin-top: 2px; }

/* ---- formerly an inline block inside the page body ---- */
.buoy-obs { font-family: var(--font-mono); font-size: 0.78125rem; color: var(--text-muted); margin: 0 0 12px; }
.buoy-obs-age { color: var(--text-primary); }
.buoy-obs-age.aging { color: var(--text-secondary); }
.buoy-obs-age.stale { color: var(--status-restricted); }
.buoy-obs-age.old { color: var(--status-closed); }

/* ---- formerly an inline block inside the page body ---- */
/* Buoy gauges — clean uniform hairline grid (design template) */
.buoy-gauges {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    background: var(--card-border);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}
.buoy-gauges .gauge-card {
    flex: 1 1 150px;
    background: var(--card-bg);
    border: none !important;
    border-radius: 0;
    padding: 14px 16px;
    text-align: left;
    cursor: default;
}
.buoy-gauges .gauge-label {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 5px;
}
.buoy-gauges .gauge-reading { display: flex; align-items: baseline; gap: 6px; margin: 0; flex-wrap: wrap; }
.buoy-gauges .gauge-u { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.buoy-gauges .gauge-v { font-family: var(--font-display); font-weight: 800; font-size: 1.3125rem; color: var(--text-primary); letter-spacing: -0.01em; }
.buoy-gauges .gauge-none { font-size: var(--text-sm); line-height: 1.35; color: var(--text-muted); }
.buoy-gauges .gauge-sub { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); width: 100%; margin-top: 2px; }

.catch-lightbox-btn.facebook:hover { background: #1877f2; }
.catch-lightbox-btn.twitter:hover { background: #1da1f2; }
.catch-share-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    border: 1px solid var(--ocean-glow);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    z-index: calc(var(--z-modal) + 12);
    opacity: 0;
    transition: opacity 0.3s;
}
.catch-share-toast.visible { opacity: 1; }

/* Clickable species tags in lightbox */
#catch-lightbox-species .species-tag {
    cursor: pointer;
    transition: color 0.2s, text-decoration 0.2s;
    text-decoration: none;
    color: var(--ocean-glow);
}
#catch-lightbox-species .species-tag:hover {
    text-decoration: underline;
    color: var(--ocean-foam);
}
#catch-lightbox-species .species-info-link {
    color: var(--ocean-glow);
    text-decoration: none;
    margin-left: 6px;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
    transition: opacity 0.2s;
}
#catch-nav-prev:hover, #catch-nav-next:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: var(--ocean-glow) !important;
}
#catch-lightbox-species .species-info-link:hover {
    color: var(--ocean-foam);
    opacity: 1;
}

/* ===== Header: the bar's photo with the verdict (v2.86.0) ===== */
.detail-hero {
    position: relative;
    margin: 20px var(--page-pad) 0;
    padding: 30px 34px;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--card-bg);
}
.detail-hero.has-photo {
    background-image:
        linear-gradient(90deg, var(--ocean-abyss) 0%, color-mix(in oklab, var(--ocean-abyss) 88%, transparent) 42%, color-mix(in oklab, var(--ocean-abyss) 25%, transparent) 75%, color-mix(in oklab, var(--ocean-abyss) 45%, transparent) 100%),
        var(--hero-photo);
    background-size: 100% 100%, cover;
    background-position: 0 0, right center;
    background-repeat: no-repeat;
    /* Keep the photo inside the border: the shade only covers the padding box,
       so the bare photo showed through the translucent border at top and bottom */
    background-clip: padding-box;
}
.detail-hero::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--status-unknown); }
.detail-hero.open::before { background: var(--status-open); }
.detail-hero.restricted::before { background: var(--status-restricted); }
.detail-hero.closed::before { background: var(--status-closed); }
.hero-main { position: relative; max-width: 640px; min-width: 0; }
.hero-eyebrow { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.hero-region { color: var(--text-secondary); text-decoration: none; }
.hero-region:hover { color: var(--ocean-glow); }
.hero-name {
    font-family: var(--font-display);
    font-weight: 850;
    font-stretch: 88%;
    font-size: clamp(2.5rem, 1.6rem + 3vw, 4rem);
    line-height: 1;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin: 10px 0 16px;
    text-wrap: balance;
}
.hero-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border: 2px solid currentColor;
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--status-unknown);
    background: color-mix(in oklab, var(--ocean-abyss) 70%, transparent);
}
.hero-pill.open { color: var(--status-open); }
.hero-pill.restricted { color: var(--status-restricted); }
.hero-pill.closed { color: var(--status-closed); }
.hero-pill-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.hero-restriction { font-size: 1rem; color: var(--text-secondary); }
.hero-restriction strong { color: var(--text-primary); }
.hero-verdict { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); line-height: 1.15; margin: 18px 0 12px; color: var(--text-primary); }
.hero-verdict.no { color: var(--status-closed); }
.hero-verdict.warn { color: var(--status-restricted); }
.hero-verdict.ok { color: var(--status-open); }
.hero-reasons { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 7px; }
.hero-reasons li { position: relative; padding-left: 18px; font-size: 0.9375rem; line-height: 1.4; color: var(--text-secondary); }
.hero-reasons li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.hero-reasons li.no::before { background: var(--status-closed); }
.hero-reasons li.warn::before { background: var(--status-restricted); }
.hero-reasons li.ok::before { background: var(--status-open); }
.hero-src { display: block; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.hero-checked { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-muted); }
.hero-credit { position: absolute; right: 12px; bottom: 8px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary); opacity: 0.75; }
.detail-hero .staleness-badge { margin: 0 0 14px; }
@media (min-width: 861px) {
    /* The call box sits under the reasons; on phones it is the fixed bar below */
    .detail-hero .signboard-call { width: auto; flex-direction: row; justify-content: flex-start; align-items: center; gap: 18px; padding: 0; border-left: 0; }
    .detail-hero .signboard-call-info { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
    .detail-hero .strip-station-name, .detail-hero .strip-label { display: none; }
    .detail-hero .strip-phone { margin-top: 0; font-size: 1.375rem; }
}

/* ===== Today's plan beside the tide & crossing chart ===== */
.detail-plan {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 16px;
    align-items: start;
    margin: 16px var(--page-pad) 0;
}
.plan-list, .plan-cam-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-card); padding: 20px 22px; min-width: 0; }
.detail-plan.no-plan { grid-template-columns: minmax(0, 1fr); }
/* Same columns as the plan row above, so the chart/report divider sits in the gap between the plan and camera cards */
.detail-report:not(.no-chart) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 16px; }
/* The cameras sit beside the plan; the camera block keeps its own markup and script */
.plan-cam-card .report-cam { border-right: 0; padding: 0; }
/* The chart sits beside the NOAA report */
.report-chart { padding: 28px 0; min-width: 0; }
.detail-report.no-chart { grid-template-columns: minmax(0, 1fr); }
.plan-sub { font-size: var(--text-xs); color: var(--text-muted); margin: 4px 0 6px; }
.plan-sub-inline { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-muted); margin-left: 6px; }
.plan-events { list-style: none; padding: 0; margin: 0; }
.plan-ev { display: grid; grid-template-columns: 82px 18px minmax(0, 1fr); gap: 12px; padding: 13px 0; border-top: 1px solid var(--card-border); align-items: start; }
.plan-ev:first-child { border-top: 0; }
.plan-time { font-family: var(--font-display); font-weight: 800; font-size: 0.9375rem; text-align: right; white-space: nowrap; color: var(--text-primary); }
.plan-time small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: var(--text-xs); color: var(--text-muted); white-space: normal; }
.plan-dot { width: 14px; height: 14px; margin: 3px auto 0; border-radius: 50%; border: 3px solid var(--text-muted); background: var(--bg-raised); }
.plan-ev.slack .plan-dot { border-color: var(--status-open); }
.plan-ev.danger .plan-dot { border-color: var(--status-closed); background: color-mix(in oklab, var(--status-closed) 35%, transparent); }
.plan-ev.sun .plan-dot { border-color: var(--status-restricted); }
.plan-title { font-family: var(--font-display); font-weight: 800; font-size: 0.9375rem; color: var(--text-primary); }
.plan-ev.slack .plan-title { color: var(--status-open); }
.plan-ev.danger .plan-title { color: var(--status-closed); }
.plan-text { display: block; font-size: var(--text-sm); color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }
.plan-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 21px; height: 21px; margin-right: 8px; vertical-align: 1px;
    border: 2px solid var(--status-open); border-radius: 50%;
    font-size: var(--text-xs); color: var(--text-primary);
}
.plan-ev.danger .plan-num { border-color: var(--status-closed); }
.plan-tag { display: inline-block; margin-left: 6px; padding: 2px 7px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.06em; text-transform: uppercase; vertical-align: 1px; }
.plan-tag.no { background: color-mix(in oklab, var(--status-closed) 22%, transparent); color: var(--status-closed); }
.plan-tag.dark { background: var(--ocean-abyss); color: var(--text-secondary); }
.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: var(--text-xs); color: var(--text-secondary); }
.plan-legend .lg { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.plan-legend .lg.slack { background: color-mix(in oklab, var(--status-open) 45%, transparent); }
.plan-legend .lg.ebb { background: color-mix(in oklab, var(--status-closed) 45%, transparent); }
.plan-legend .lg.night { background: var(--ocean-abyss); }
.plan-legend .lg.now { width: 2px; background: var(--text-primary); }
.plan-fine { font-size: var(--text-xs); color: var(--text-muted); margin-top: 10px; }

/* The chart (inline SVG from services/crossing_plan.py). The column is about
   phone width, so the taller compact chart is used there. */
.plan-chart { display: block; width: 100%; height: auto; margin-top: 10px; }
.plan-chart--compact { display: none; }
.pc-night { fill: var(--ocean-abyss); opacity: 0.6; }
.pc-slack { fill: var(--status-open); opacity: 0.22; }
.pc-ebb { fill: var(--status-closed); opacity: 0.2; }
.pc-grid { stroke: var(--card-border); }
.pc-axis { fill: var(--text-muted); font-size: 12px; }
.pc-day { font-weight: 700; fill: var(--text-secondary); }
.pc-area { fill: var(--ocean-glow); opacity: 0.12; }
.pc-curve { fill: none; stroke: var(--ocean-glow); stroke-width: 2.5; }
.pc-dot { fill: var(--text-primary); }
.pc-turn { fill: var(--text-primary); font-size: 12px; font-weight: 700; }
.pc-band-label { fill: var(--status-closed); font-size: 12px; font-weight: 700; }
.pc-now { stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 4 3; }
.pc-now-label { fill: var(--text-primary); font-size: 12px; font-weight: 700; }
.pc-mark circle { fill: var(--ocean-abyss); stroke-width: 2.5; stroke: var(--status-open); }
.pc-mark--danger circle { stroke: var(--status-closed); }
.pc-mark text { fill: var(--text-primary); font-size: 12px; font-weight: 800; }

@media (max-width: 860px) {
    .detail-hero { padding: 0; min-height: 0; flex-direction: column; align-items: stretch; margin-top: 12px; }
    .detail-hero.has-photo {
        padding-top: 170px;
        background-image:
            linear-gradient(180deg, color-mix(in oklab, var(--card-bg) 10%, transparent) 0, color-mix(in oklab, var(--card-bg) 75%, transparent) 150px, var(--card-bg) 260px),
            var(--hero-photo);
        background-size: 100% 100%, auto 300px;
        background-position: 0 0, 70% top;
        background-color: var(--card-bg);
    }
    .hero-main { padding: 20px 18px 18px; max-width: none; }
    .detail-hero.has-photo .hero-main { padding-top: 0; }
    .hero-credit { top: 8px; bottom: auto; }
    .detail-plan { grid-template-columns: minmax(0, 1fr); }
    .plan-chart--medium { display: none; }
    .plan-chart--compact { display: block; }
    .plan-list, .plan-cam-card { padding: 16px; }
    .detail-report:not(.no-chart) { grid-template-columns: minmax(0, 1fr); }
    .report-chart { border-bottom: 1px solid var(--card-border); }
    .plan-ev { grid-template-columns: 68px 16px minmax(0, 1fr); gap: 10px; }
    .plan-time { font-size: var(--text-sm); }
}
