/* Depth profile (shared/depth-profile.js). Light by default, for the public map; the
   portal's dark buoy modal overrides the variables at the end. The JS reads the axis,
   grid and depth-colour variables when it draws. */
.bcdp {
    --bcdp-ink: #0f172a;
    --bcdp-muted: #475569;
    --bcdp-line: #d6dde6;
    --bcdp-pill-border: #5b6b80;
    --bcdp-accent: #002b49;
    --bcdp-accent-ink: #ffffff;
    --bcdp-axis: #475569;
    --bcdp-grid: rgba(15, 23, 42, 0.08);
    --bcdp-shallow: #0891b2;
    --bcdp-deep: #1e3a8a;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--bcdp-ink);
}
.bcdp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.bcdp-chips, .bcdp-windows { display: flex; flex-wrap: wrap; gap: 6px; }
.bcdp-pill {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--bcdp-pill-border);
    background: transparent;
    color: var(--bcdp-accent);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.bcdp-pill:hover { border-color: var(--bcdp-accent); color: var(--bcdp-accent); }
.bcdp-pill[aria-pressed="true"], .bcdp-pill[aria-pressed="true"]:hover {
    background: var(--bcdp-accent);
    border-color: var(--bcdp-accent);
    color: var(--bcdp-accent-ink);
}
.bcdp-pill:focus-visible { outline: 2px solid var(--bcdp-shallow); outline-offset: 2px; }
.bcdp-status { margin: 0; font-size: 13px; color: var(--bcdp-muted); }
.bcdp-section[hidden] { display: none; }
.bcdp-title {
    margin: 4px 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--bcdp-muted);
}
.bcdp-canvas { position: relative; height: 220px; }
.bcdp-canvas--heat { height: 168px; }
.bcdp-loading .bcdp-canvas { opacity: .55; transition: opacity .2s ease; }
.bcdp-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--bcdp-muted);
    font-variant-numeric: tabular-nums;
}
.bcdp-ramp { flex: 0 1 160px; height: 8px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
    .bcdp-pill, .bcdp-loading .bcdp-canvas { transition: none; }
}

/* The portal's buoy modal is dark glass: lighter lines and text, the same layout. */
.buoy-group-panel .bcdp {
    --bcdp-ink: #e2e8f0;
    --bcdp-muted: #94a3b8;
    --bcdp-line: rgba(255, 255, 255, 0.18);
    --bcdp-pill-border: rgba(255, 255, 255, 0.18);
    --bcdp-accent: #7dd3fc;
    --bcdp-accent-ink: #0b1220;
    --bcdp-axis: #94a3b8;
    --bcdp-grid: rgba(255, 255, 255, 0.08);
    --bcdp-shallow: #a5f3fc;
    --bcdp-deep: #3b82f6;
    /* The Ocean Stations panel's ink and blue (ocean_stations.css, waves.js), for the profile line and the stepper. */
    --bcdp-accent: #3987e5;
    --bcdp-ink: #f1f5f9;
    /* The water column (depth-profile.js): its line, the ring round its nodes (the card's
       colour), and a scale for dark glass, deep indigo for low to bright for high. */
    --bcdp-rail: rgba(148, 163, 184, 0.45);
    --bcdp-ring: #171b22;
    --bcdp-heat: #1d2b5c, #1f5c8f, #1c97a8, #5fcca6, #e4f49b;
    padding: 12px 4px;
}

/* ── the portal's Profile tab (opts.menus, opts.toggle) ──
   Sized to sit inside the buoy modal's panel without growing it: one row of
   controls, then one chart card. Its look is the Ocean Stations panel's
   (ocean_stations.css): Manrope, the slate select boxes (.os-sel) and their list,
   the outlined pill switch with its sky-blue pick (.os-seg), the sea-state card
   (.os-wv-now). The buttons and menu borrow the chart workspace's classes
   (telemetry/chart/chart.css), restyled here under .bcdp--menus. */
.bcdp--menus {
    --bcdp-font: 'Manrope', system-ui, sans-serif;
    container-type: inline-size;   /* the controls fold to the modal's width, not the window's */
    font-family: var(--bcdp-font);
    font-size: 12px;
    gap: 10px;
}
/* Every control one height, its words in its middle (text-box below). */
.bcdp--menus .bcdp-controls { flex-wrap: wrap; gap: 8px; }
.bcdp--menus .bcdp-chips { min-width: 0; }
.bcdp-dd { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
/* The select boxes: the Ocean Stations selects (.os-sel, .os-pick-btn), slate with a hairline. */
.bcdp--menus .bcdp-dd-btn {
    min-width: 0;
    max-width: 100%;
    height: 28px;
    padding: 0 9px 0 11px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #1e293b;
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    transition: border-color .15s ease;
}
.bcdp--menus .bcdp-dd-btn:hover { border-color: rgba(255, 255, 255, 0.3); color: #f8fafc; }
.bcdp--menus .bcdp-dd-btn[aria-expanded="true"] { border-color: rgba(56, 189, 248, 0.6); }
.bcdp-dd-btn > .text { min-width: 0; gap: 10px; }
.bcdp-dd-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bcdp-dd-chev { font-size: 10px; color: #94a3b8; transition: transform .2s ease; }
.bcdp-dd-btn[aria-expanded="true"] .bcdp-dd-chev { transform: rotate(180deg); color: #38bdf8; }
/* Its list: the Ocean Stations select's (.os-pick-menu, .os-opt), under the box. */
.bcdp-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    max-height: min(320px, 60vh);
    overflow-y: auto;
}
.bcdp--menus .bcdp-menu {
    min-width: 100%;
    padding: 3px 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: #1e293b;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.bcdp-menu[hidden] { display: none; }
.bcdp--menus .tcw-mi { padding: 7px 11px; font-size: 12px; font-weight: 500; line-height: 1; color: #cbd5e1; white-space: nowrap; }
.bcdp--menus .tcw-mi:hover { background: rgba(255, 255, 255, 0.06); color: #f8fafc; }
.bcdp--menus .tcw-mi.on { background: rgba(56, 189, 248, 0.12); color: #f8fafc; font-weight: 600; box-shadow: inset 2px 0 0 #38bdf8; }   /* the one shown */
.bcdp--menus .tcw-mi:focus-visible { outline-offset: -2px; }       /* inside the menu, which clips */
/* The switch: the Ocean Stations segments (.os-seg), outlined, its pick filled sky blue; cornered like the select boxes. */
.bcdp-views { margin-left: auto; box-sizing: border-box; }
.bcdp--menus .bcdp-views { height: 28px; padding: 0; gap: 0; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px; background: none; overflow: hidden; }
.bcdp--menus .bcdp-views button { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; border-radius: 0; font-size: 11px; font-weight: 700;
                                  line-height: 1; color: #94a3b8; box-shadow: none; }
.bcdp--menus .bcdp-views button:hover { color: #e2e8f0; }
.bcdp--menus .bcdp-views button.on { background: rgba(56, 189, 248, 0.2); color: #f8fafc; box-shadow: none; }
.bcdp-views button > .text { display: inline-flex; align-items: center; gap: 6px; }
.bcdp-views button i { font-size: 10px; opacity: .85; }
.bcdp--menus .bcdp-views button:disabled { opacity: .4; cursor: default; color: #94a3b8; }
@supports (text-box: trim-both cap alphabetic) {   /* the words cut to their capitals, so they sit in the middle */
    .bcdp-dd-label, .bcdp-view-label, .bcdp--menus .tcw-mi-label { text-box: trim-both cap alphabetic; }
    .bcdp-dd-label { padding: 4px 0; margin: -4px 0; }   /* its clip (the ellipsis) spares the descenders */
}
/* A narrow modal (a phone): the menus share the first row, the switch the second. */
@container (max-width: 440px) {
    .bcdp--menus .bcdp-chips { flex: 1 1 0; }
    .bcdp--menus .bcdp-windows { flex: 0 0 auto; }
    .bcdp--menus .bcdp-chips .bcdp-dd, .bcdp--menus .bcdp-chips .bcdp-dd-btn { width: 100%; }
    .bcdp--menus .bcdp-dd-btn > .text { flex: 1; justify-content: space-between; }
    .bcdp-views { flex: 1 0 100%; margin-left: 0; }
    .bcdp-views button { flex: 1; justify-content: center; }
}
/* One chart at a time, on a card like the readings tiles. */
.bcdp--toggle .bcdp-section:not(.bcdp-picked) { display: none; }
.bcdp--toggle .bcdp-title { display: none; }
/* The Ocean Stations card (.os-wv-now). */
.bcdp--toggle .bcdp-body {
    padding: 14px 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}
.bcdp--toggle .bcdp-canvas { height: 226px; }
.bcdp--toggle .bcdp-canvas--heat { height: 196px; }
/* The scale's key: the width of the plot over it (its margins come from the chart). */
.bcdp--toggle .bcdp-legend { gap: 10px; margin-top: 8px; font-size: 11px; font-weight: 600; }
.bcdp--toggle .bcdp-ramp { flex: 1 1 auto; height: 6px; border-radius: 3px; }
.bcdp--menus .bcdp-status:empty { display: none; }
/* Its message (loading, none in the period, a failure) stands in for the chart: set in the chart's place, centred,
   as the one-depth note is (.bcdp-note below). */
.bcdp--menus .bcdp-status { padding: 36px 12px; font-size: 12px; text-align: center; line-height: 1.5; }
/* The switch layout brings its own spacing: none extra around it in the modal. */
.buoy-group-panel .bcdp--toggle { padding: 2px 2px 0; }

/* The profile at one moment (the switch's first view, depth-profile.js columnConfig): its height comes from
   its depths (set inline). Under it the stepper: the moment shown with, while an earlier one shows, a way back
   to the latest that also keys its faint line; then a slider through the period's readings, a step either side. */
.bcdp--toggle .bcdp-canvas--column { height: 160px; }
.bcdp-steps { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bcdp-when { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.bcdp-when-text { font-size: 11.5px; font-weight: 600; color: var(--bcdp-muted); font-variant-numeric: tabular-nums; }
.bcdp--menus .bcdp-to-latest { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.18); background: #1e293b;
                                color: #e2e8f0; font-size: 11px; font-weight: 600; line-height: 1; }
.bcdp--menus .bcdp-to-latest:hover { border-color: rgba(56, 189, 248, 0.6); color: #f8fafc; }
.bcdp-to-latest[hidden] { display: none; }
.bcdp-to-latest > .text { gap: 7px; }
.bcdp-ghost-key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--bcdp-faint, rgba(100, 116, 139, 0.55)); }
.bcdp-to-latest i { font-size: 9px; opacity: .7; }
.bcdp-step-row { display: flex; align-items: center; gap: 8px; }
.bcdp--menus .bcdp-step { flex: none; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 8px;
                          border: 1px solid rgba(255, 255, 255, 0.18); background: #1e293b; color: #e2e8f0; }
.bcdp--menus .bcdp-step:hover:not(:disabled) { border-color: rgba(56, 189, 248, 0.6); color: #f8fafc; }
.bcdp-step i { font-size: 10px; }
.bcdp-step:disabled { opacity: .35; cursor: default; }
.bcdp-slider { flex: 1; min-width: 0; margin: 0; accent-color: #38bdf8; cursor: pointer; }   /* the panel's interactive sky blue */
.bcdp-slider:disabled { opacity: .4; cursor: default; }
.bcdp-note { margin: 2px 0 0; font-size: 11px; color: var(--bcdp-muted); }
.bcdp-canvas[hidden], .bcdp-steps[hidden], .bcdp-legend[hidden] { display: none; }
/* One depth: the profile and heatmap views are only their message, set in the card's middle. */
.bcdp--toggle .bcdp-canvas[hidden] ~ .bcdp-note { margin: 0; padding: 36px 12px; font-size: 12px; text-align: center; line-height: 1.5; }
.bcdp-note:empty { display: none; }
/* The latest profile's faint line, on the modal's dark glass. */
.buoy-group-panel .bcdp { --bcdp-faint: rgba(148, 163, 184, 0.5); }

