/* ============================================================
   boat-card.css — Dense Dashboard Boat Card
   Master's Mate
   ============================================================ */

:root {
    --bc-accent: #0ea5e9;
    --bc-accent-10: #0ea5e91a;
    --bc-accent-20: #0ea5e933;
    --bc-bg: #f0f7ff;
    --bc-bg2: #ffffff;
    --bc-bg3: #f8fbff;
    --bc-surface: #f1f6fc;
    --bc-surface-hover: #e6f0fa;
    --bc-border: #d4e3f5;
    --bc-border-light: #e8f0fa;
    --bc-text: #1a2744;
    --bc-text2: #4a6180;
    --bc-text3: #8097b3;
    --bc-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    --bc-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --bc-radius: 12px;
    --bc-radius-sm: 8px;
    --bc-radius-lg: 16px;
    --bc-shadow: 0 2px 12px rgba(14,100,180,0.08);
    --bc-shadow-lg: 0 8px 32px rgba(14,100,180,0.12);
    --bc-gap: 16px;
    --bc-pad: 20px;
    --bc-transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body.boat-card-page {
    font-family: var(--bc-sans);
    background: var(--bc-bg);
    color: var(--bc-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    min-height: 100vh;
    background-image: linear-gradient(180deg, #f0f7ff 0%, #e8f4ff 40%, #f5f9ff 100%);
}

body.boat-card-page a { color: var(--bc-accent); text-decoration: none; }
body.boat-card-page a:hover { color: #38bdf8; }
body.boat-card-page img { max-width: 100%; display: block; }

.section-hidden { display: none !important; }

/* ============================================================
   LOADER
   ============================================================ */
.bc-loader {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--bc-bg);
}
.bc-loader-inner { text-align: center; color: var(--bc-accent); }
.bc-loader-inner svg { width: 48px; height: 48px; margin-bottom: 16px; }
.bc-loader-inner p { color: var(--bc-text3); font-size: 14px; font-weight: 500; }

/* ============================================================
   HEADER BAR
   ============================================================ */
.bc-header {
    background: rgba(255,255,255,0.88);
    border-bottom: 1px solid var(--bc-border);
    padding: 16px var(--bc-pad);
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    box-shadow: 0 1px 8px rgba(14,100,180,0.06);
}
.bc-header-inner {
    max-width: 1400px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: stretch; gap: 16px;
}

/* Master's Mate brand block — appears only at mobile breakpoint */
.bc-mobile-brand { display: none; }
/* Mobile-only wrapper for the right-column items. On desktop it's
   transparent (display:contents) so .bc-header-left and .bc-header-cta
   remain direct grid children of .bc-header-inner. */
.bc-mobile-right-stack { display: contents; }
.bc-header-left {
    display: flex; align-items: stretch; gap: 14px; min-width: 0; flex-wrap: wrap;
}
.bc-logo {
    width: 67px; height: 67px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--bc-border); flex-shrink: 0;
    background: #fff; box-shadow: 0 1px 4px rgba(14,100,180,0.1);
    align-self: center;
}
.bc-header-left h1 {
    font-size: 32px; font-weight: 800; letter-spacing: -0.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    color: var(--bc-text); line-height: 1.1; margin: 0;
}
.bc-header-left h1 img { max-height: 78px; width: auto; vertical-align: middle; display: block; }
.bc-name-stack {
    display: inline-flex; flex-direction: column; align-items: flex-start;
    justify-content: flex-start;
    min-height: 67px; min-width: 0; gap: 0;
}
.bc-header-cta {
    display: inline-flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px;
    justify-self: center; align-self: center; text-align: center;
}
.bc-status-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 1px 7px; border-radius: 100px;
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    font-size: 9px; font-weight: 500; color: var(--bc-text2);
    align-self: flex-start; margin-top: -6px;
}
.bc-status-badge .badge-icon { display: flex; }
.bc-status-badge .badge-icon svg { width: 9px; height: 9px; color: var(--bc-accent); }
.bc-status-badge .badge-text { white-space: nowrap; }

/* Header specs inline */
.bc-header-right { display: flex; align-items: stretch; gap: 12px; justify-self: end; }
.bc-specs-inline {
    display: flex; gap: 0;
}
.spec-card {
    padding: 6px 16px; text-align: center;
    border-left: 1px solid var(--bc-border);
}
.spec-card:first-child { border-left: none; }
.spec-label {
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3); line-height: 1;
}
.spec-value {
    font-size: 14px; font-weight: 700; color: var(--bc-text);
    font-family: var(--bc-mono); margin-top: 2px; line-height: 1.2;
}

/* ============================================================
   DASHBOARD GRID (Map + Instruments)
   ============================================================ */
.bc-dashboard {
    max-width: 1400px; margin: var(--bc-gap) auto;
    padding: 0 var(--bc-pad);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 360px;
    gap: var(--bc-gap);
}

.bc-panel {
    background: #ffffff;
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg);
    overflow: hidden;
    box-shadow: var(--bc-shadow);
    position: relative;
    z-index: 1;
}

.bc-panel-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3);
    padding: 14px 16px 8px; margin: 0;
}

.bc-panel-title.is-offline {
    background: rgba(239, 68, 68, 0.85);
    color: #fff;
    padding: 10px 16px;
    text-align: center;
    letter-spacing: 0.12em;
}

/* Panel label (floats over content) */
.bc-panel-label {
    position: absolute; top: 8px; left: 12px; z-index: 5;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3);
    background: rgba(255,255,255,0.75); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px; border-radius: 4px;
    pointer-events: none;
}

/* Map */
.bc-panel-map { position: relative; min-height: 360px; }
.bc-map { width: 100%; height: 100%; }
.cog-vector-label {
    background: rgba(59,130,246,0.85); color: #fff;
    font-size: 9px; font-weight: 700; font-family: monospace;
    padding: 1px 4px; border-radius: 3px; white-space: nowrap;
    text-align: center; line-height: 14px;
}

/* Gallery panel in dashboard */
.bc-panel-gallery { overflow: hidden; min-height: 300px; }

/* Instruments — Dashboard HUD */
.bc-panel-instruments { display: flex; flex-direction: column; overflow: hidden; }
.bc-instruments-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1px; background: var(--bc-border-light); flex: 1;
}
.inst-panel {
    background: #ffffff; padding: 14px 14px 10px;
    position: relative; overflow: hidden;
    display: flex; flex-direction: column;
}
.inst-panel-label {
    font-size: 9px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3); margin-bottom: 6px;
}
/* Compass */
.inst-compass {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; flex: 1;
    position: relative;
}
.inst-compass-wrap {
    position: relative; width: 100%; max-width: 130px; aspect-ratio: 1;
}
.inst-compass-wrap svg {
    width: 100%; height: 100%;
    transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
.compass-readout {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--bc-mono); font-size: 22px; font-weight: 800;
    color: var(--bc-accent); text-align: center; line-height: 1;
    pointer-events: none;
}
.compass-readout small {
    display: block; font-size: 9px; font-weight: 600;
    color: var(--bc-text3); margin-top: 2px; letter-spacing: 0.05em;
}
/* Wind panel */
.inst-wind-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.inst-wind-arrow {
    width: 52px; height: 52px; flex-shrink: 0;
}
.inst-wind-arrow svg {
    transition: transform 0.8s cubic-bezier(0.4,0,0.2,1);
}
.inst-wind-vals { flex: 1; }
/* Shared value styles */
.inst-big-value {
    font-family: var(--bc-mono); font-size: 26px; font-weight: 800;
    color: var(--bc-accent); line-height: 1;
}
.inst-sub-value {
    font-family: var(--bc-mono); font-size: 12px; font-weight: 600;
    color: var(--bc-text2); margin-top: 2px;
}
.inst-unit {
    font-size: 11px; color: var(--bc-text3); font-weight: 600;
}
.inst-minmax {
    display: flex; gap: 8px;
    font-size: 9px; font-weight: 600; color: var(--bc-text3);
    letter-spacing: 0.03em; margin: 4px 0 2px;
}
/* Sparkline */
.inst-sparkline-wrap {
    position: relative; flex: 1; min-height: 28px; max-height: 50px;
}
.inst-sparkline-wrap canvas {
    width: 100%; height: 100%; display: block;
}
/* Live pulse */
.inst-pulse-line {
    position: absolute; top: 0; left: 0; right: 0;
    height: 2px; opacity: 0;
}
@keyframes inst-pulse-fade {
    0% { opacity: 1; } 100% { opacity: 0; }
}
.inst-pulse-line.active {
    animation: inst-pulse-fade 1.2s ease-out forwards;
}
/* No-data overlay */
.bc-no-data-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    background: rgba(255,255,255,0.85);
    color: var(--bc-text3); font-size: 12px; font-weight: 600;
    z-index: 5; pointer-events: none;
}
/* Responsive */
@media (max-width: 600px) {
    .inst-big-value { font-size: 20px; }
    .inst-compass-wrap { max-width: 130px; }
    .compass-readout { font-size: 18px; }
    .inst-wind-arrow { width: 40px; height: 40px; }
}

/* ============================================================
   GALLERY
   ============================================================ */
.bc-section {
    max-width: 1400px; margin: 0 auto;
    padding: var(--bc-gap) var(--bc-pad);
}
.bc-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3);
    margin-bottom: 12px;
}

/* ── Gallery Mosaic ── */
.gallery-mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 140px;
    gap: 6px;
}
.mosaic-item {
    position: relative; overflow: hidden;
    border-radius: var(--bc-radius-sm); cursor: pointer;
    transition: transform var(--bc-transition), box-shadow var(--bc-transition);
}
.mosaic-item:hover { transform: scale(1.02); box-shadow: var(--bc-shadow-lg); z-index: 2; }
.mosaic-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--bc-transition); }
.mosaic-item:hover img { transform: scale(1.06); }

/* Size variants */
.mosaic-lg { grid-column: span 2; grid-row: span 2; }
.mosaic-md { grid-column: span 2; grid-row: span 1; }
.mosaic-sm { grid-column: span 1; grid-row: span 1; }

.gallery-play-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.25); transition: background var(--bc-transition);
}
.mosaic-item:hover .gallery-play-overlay { background: rgba(0,0,0,0.4); }
.gallery-play-overlay svg { width: 48px; height: 48px; color: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4)); }

.gallery-caption {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 24px 12px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
    color: #fff; font-size: 12px; font-weight: 500;
}

/* Pagination */
.gallery-pagination {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-top: 12px;
}
.gallery-page-btn {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--bc-border); background: #ffffff;
    color: var(--bc-text); font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all var(--bc-transition);
}
.gallery-page-btn:hover:not(:disabled) { background: var(--bc-accent); color: #fff; border-color: var(--bc-accent); }
.gallery-page-btn:disabled { opacity: 0.3; cursor: default; }
.gallery-page-info { font-size: 12px; color: var(--bc-text3); font-weight: 600; }

/* Panel gallery — images tile to fill entire box */
.bc-panel-gallery {
    position: relative;
}
.bc-panel-gallery .gallery-mosaic {
    position: absolute; inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 2px;
}
.bc-panel-gallery .mosaic-lg { grid-column: span 2; grid-row: span 2; }
.bc-panel-gallery .mosaic-md { grid-column: span 1; }
.bc-panel-gallery .mosaic-sm { grid-column: span 1; }
.bc-panel-gallery .mosaic-item { border-radius: 0; }
.bc-panel-gallery .mosaic-item:first-child { border-top-left-radius: var(--bc-radius-lg); }
.bc-panel-gallery .mosaic-item:last-child { border-bottom-right-radius: var(--bc-radius-lg); }

/* Pagination fixed at bottom center of gallery panel */
.bc-panel-gallery .gallery-pagination {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    z-index: 10;
    display: flex; align-items: center; gap: 8px;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    padding: 4px 12px; border-radius: 20px;
}
.bc-panel-gallery .gallery-page-btn {
    width: 24px; height: 24px; font-size: 14px;
    background: transparent; border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.bc-panel-gallery .gallery-page-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.bc-panel-gallery .gallery-page-btn:disabled { opacity: 0.3; }
.bc-panel-gallery .gallery-page-info { font-size: 11px; color: #fff; font-weight: 600; }

/* ============================================================
   ABOUT
   ============================================================ */
.bc-about {
    max-width: 800px; margin: 0 auto;
    font-size: 15px; line-height: 1.8;
    color: var(--bc-text2); text-align: center;
    padding: 8px var(--bc-pad) 24px;
}

/* ============================================================
   BOTTOM GRID
   ============================================================ */
.bc-bottom-grid {
    max-width: 1400px; margin: 0 auto;
    padding: 0 var(--bc-pad) var(--bc-gap);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--bc-gap);
}

.bc-card {
    background: #ffffff;
    border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg);
    padding: 8px 14px;
    box-shadow: var(--bc-shadow);
}
.bc-card-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3);
    margin-bottom: 6px;
}

/* Voyages */
.bc-voyages { display: flex; flex-direction: column; gap: 8px; }
.voyage-card {
    padding: 6px 12px; border-radius: var(--bc-radius-sm);
    background: var(--bc-bg3); border-left: 3px solid var(--bc-accent);
}
.voyage-name { font-size: 13px; font-weight: 600; color: var(--bc-text); }
.voyage-meta { display: flex; gap: 12px; margin-top: 2px; }
.voyage-meta span { font-size: 11px; color: var(--bc-text3); }

/* Crew */
.bc-crew { display: flex; flex-wrap: wrap; gap: 12px; }
.crew-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crew-photo {
    width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    border: 2px solid var(--bc-border); display: flex; align-items: center; justify-content: center;
}
.crew-photo img { width: 100%; height: 100%; object-fit: cover; }
.crew-initials {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: var(--bc-accent); color: #fff; font-size: 14px; font-weight: 700;
}
.crew-name { font-size: 13px; font-weight: 600; color: var(--bc-text); line-height: 1.2; }
.crew-role { font-size: 11px; color: var(--bc-text3); }

/* Contact */
.bc-contact { display: flex; flex-direction: column; gap: 8px; }
.contact-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--bc-radius-sm);
    background: var(--bc-bg3); color: var(--bc-text2);
    font-size: 13px; font-weight: 500;
    transition: background var(--bc-transition), color var(--bc-transition);
}
.contact-link:hover { background: var(--bc-surface-hover); color: var(--bc-text); }
.contact-link svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--bc-accent); }
.contact-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.social-row { display: flex; gap: 8px; margin-top: 8px; }
.social-btn {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bc-bg3); border: 1px solid var(--bc-border);
    color: var(--bc-text2); transition: all var(--bc-transition);
}
.social-btn:hover { background: var(--bc-accent); color: #fff; border-color: var(--bc-accent); }
.social-btn svg { width: 16px; height: 16px; }

/* QR — referral card */
.bc-qr-card { padding: 0; overflow: hidden; }
.bc-qr-frame {
    display: flex; flex-direction: column; align-items: center;
    padding: 22px 18px 18px;
    background: linear-gradient(165deg, #f0f9ff 0%, #ffffff 60%);
    text-align: center;
}
.bc-qr-eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--bc-text3);
    margin-bottom: 2px;
}
.bc-qr-brand {
    font-size: 18px; font-weight: 800; color: var(--bc-accent);
    margin-bottom: 14px; letter-spacing: -0.01em;
}
.bc-qr-imgwrap {
    background: #fff; padding: 8px; border-radius: 12px;
    border: 1px solid var(--bc-border);
    box-shadow: 0 4px 12px rgba(14, 100, 180, 0.08);
    margin-bottom: 14px;
}
#qrcode-img {
    display: block;
    width: 200px; height: 200px;
    border-radius: 4px;
    background: #fff;
}
.bc-qr-cta {
    font-size: 15px; font-weight: 700; color: var(--bc-text1);
    margin-bottom: 2px;
}
.bc-qr-tagline {
    font-size: 13px; color: var(--bc-text2); font-style: italic;
    margin-bottom: 14px;
}
.bc-qr-footer {
    padding-top: 12px; border-top: 1px dashed var(--bc-border);
    width: 100%;
}
.bc-qr-perk {
    font-size: 12px; color: var(--bc-text3);
    font-weight: 500; line-height: 1.4;
}

/* Captain badge tiers (recognition for referrals) */
.bc-ref-badge {
    display: inline-block;
    padding: 2px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
    margin-right: 6px;
    background: #e0f2fe; color: #0369a1;
    border: 1px solid #bae6fd;
}
.bc-ref-badge.tier-firstmate    { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
.bc-ref-badge.tier-watchkeeper  { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.bc-ref-badge.tier-bosun        { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.bc-ref-badge.tier-quartermaster{ background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.bc-ref-badge.tier-commodore    {
    background: linear-gradient(135deg, #fcd34d, #f59e0b);
    color: #78350f; border-color: #f59e0b;
}
.bc-ref-count { font-size: 12px; color: var(--bc-text3); }

/* Weather + Tides row */
.bc-wx-row {
    max-width: 1400px; margin: 0 auto;
    padding: 0 var(--bc-pad);
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--bc-gap); margin-bottom: var(--bc-gap);
}
.bc-wx-card {
    background: #ffffff; border: 1px solid var(--bc-border);
    border-radius: var(--bc-radius-lg); padding: 16px 20px;
    box-shadow: var(--bc-shadow);
}
.bc-wx-card h3 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3); margin-bottom: 12px;
}
.bc-wx-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (max-width: 540px) { .bc-wx-grid { grid-template-columns: repeat(2, 1fr); } }
.bc-wx-item {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; gap: 4px;
    padding: 12px 8px;
    background: linear-gradient(160deg, rgba(2,132,199,0.06) 0%, rgba(56,189,248,0.02) 100%);
    border: 1px solid rgba(2,132,199,0.10);
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--bc-transition), box-shadow var(--bc-transition), border-color var(--bc-transition);
}
.bc-wx-item::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--bc-accent), #38bdf8);
    opacity: 0.55;
}
.bc-wx-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2,132,199,0.10);
    border-color: rgba(2,132,199,0.22);
}
.bc-wx-icon {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    color: var(--bc-accent); opacity: 0.85;
}
.bc-wx-icon svg { width: 20px; height: 20px; }
.bc-wx-value {
    font-family: var(--bc-mono); font-size: 22px; font-weight: 800;
    color: var(--bc-accent); line-height: 1.1;
    letter-spacing: -0.02em;
}
.bc-wx-unit { font-size: 10px; font-weight: 500; color: var(--bc-text3); margin-left: 2px; }
.bc-wx-label { font-size: 10px; font-weight: 700; color: var(--bc-text3); text-transform: uppercase; letter-spacing: 0.06em; }
.bc-wx-sub { font-size: 11px; color: var(--bc-text2); font-weight: 600; }

.bc-tide-list { }
.bc-tide-canvas-wrap {
    position: relative;
    background: linear-gradient(180deg, rgba(14,165,233,0.04) 0%, rgba(14,165,233,0.00) 100%);
    border-radius: var(--bc-radius);
}
.bc-tide-tooltip {
    position: absolute; top: 6px; right: 8px;
    background: #ffffff;
    border: 1px solid rgba(2,132,199,0.18);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(15,23,42,0.10);
    min-width: 96px;
}
.bc-tide-tt-time { font-weight: 600; color: var(--bc-text); margin-bottom: 1px; }
.bc-tide-tt-height { font-family: var(--bc-mono); font-size: 14px; font-weight: 800; color: var(--bc-accent); line-height: 1.1; }
.bc-tide-tt-state { font-size: 10px; font-weight: 700; margin-top: 2px; }
.bc-tide-extremes {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 8px 0 0; justify-content: center;
}
.bc-tide-ext {
    display: flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: var(--bc-radius-sm);
    font-size: 11px; white-space: nowrap;
    background: var(--bc-bg3);
}
.bc-tide-arrow { font-size: 16px; flex-shrink: 0; }
.bc-tide-arrow.high { color: #0ea5e9; }
.bc-tide-arrow.low { color: #f59e0b; }
.bc-tide-info { flex: 1; }
.bc-tide-type { font-size: 12px; font-weight: 700; color: var(--bc-text); }
.bc-tide-time { font-size: 11px; color: var(--bc-text3); }
.bc-tide-height { font-family: var(--bc-mono); font-size: 14px; font-weight: 700; color: var(--bc-text); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
/* ── Borderless Lightbox ── */
.bc-lightbox {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.25s ease;
}
.bc-lightbox.bc-lightbox-open { opacity: 1; }
.bc-lightbox-backdrop {
    position: fixed; inset: 0;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(24px) saturate(0.8);
    -webkit-backdrop-filter: blur(24px) saturate(0.8);
}
.bc-lightbox-body {
    position: relative; z-index: 1;
    max-width: 96vw; max-height: 96vh;
    display: flex; align-items: center; justify-content: center;
}
.bc-lightbox-body img,
.bc-lightbox-content img {
    max-width: 96vw; max-height: 80vh; object-fit: contain;
    border-radius: 4px; border: none;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15);
}
.bc-lightbox-body iframe,
.bc-lightbox-content iframe {
    width: 92vw; max-width: 1100px; aspect-ratio: 16/9; border: none;
}
.bc-lightbox-close {
    position: fixed; top: 20px; right: 20px; z-index: 10001;
    width: 44px; height: 44px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.08); color: #334155;
    font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bc-lightbox-close:hover { background: rgba(0,0,0,0.15); }

/* Prev/Next navigation arrows */
.bc-lb-nav {
    position: fixed; top: 50%; transform: translateY(-50%); z-index: 10001;
    width: 50px; height: 50px; border: none; border-radius: 50%;
    background: rgba(0,0,0,0.06); color: #334155;
    font-size: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    line-height: 1;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bc-lb-nav:hover { background: rgba(0,0,0,0.12); }
.bc-lb-prev { left: 16px; }
.bc-lb-next { right: 16px; }

/* Lightbox body — vertical stack for image + info */
.bc-lightbox-body {
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Info panel below lightbox image */
.bc-lb-info-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 700px;
    display: flex;
    justify-content: center;
}
.bc-lb-info {
    margin-top: 12px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    text-align: center;
    max-width: 100%;
    animation: bc-lb-info-in 0.3s ease;
}
@keyframes bc-lb-info-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bc-lb-desc {
    font-size: 15px;
    font-weight: 500;
    color: #1a2744;
    line-height: 1.5;
    margin-bottom: 6px;
}
.bc-lb-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #4a6180;
    line-height: 1.4;
}
.bc-lb-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.bc-lb-meta-item svg {
    opacity: 0.6;
    flex-shrink: 0;
}
.bc-lb-meta-sep {
    color: #8097b3;
    font-size: 8px;
}
.bc-lb-info > .bc-lb-meta:first-child { margin-top: 0; }
.bc-lb-info > .bc-lb-desc:last-child { margin-bottom: 0; }
.bc-lb-info > .bc-lb-meta:only-child { margin: 0; }

@media (max-width: 640px) {
    .bc-lb-info { margin-top: 8px; padding: 10px 14px; border-radius: 10px; }
    .bc-lb-desc { font-size: 13px; }
    .bc-lb-meta { font-size: 11px; gap: 4px; }
}

/* ============================================================
   FOOTER
   ============================================================ */
.bc-footer {
    text-align: center; padding: 24px;
    font-size: 12px; color: var(--bc-text3);
    border-top: 1px solid var(--bc-border);
    margin-top: var(--bc-gap);
}
.bc-footer a { color: var(--bc-text3); font-weight: 500; }
.bc-footer a:hover { color: var(--bc-accent); }

/* ── Mid grid (voyages + crew) ── */
.bc-mid-grid {
    max-width: 1400px; margin: 0 auto;
    padding: 0 var(--bc-pad);
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--bc-gap);
    margin-bottom: 6px;
}

/* ── Action Row (3-col: Contact | QR | Actions) ── */
.bc-action-row {
    max-width: 1400px; margin: 0 auto;
    padding: 0 var(--bc-pad) var(--bc-gap);
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--bc-gap);
}

/* Actions card */
.bc-actions-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }

.bc-actions-hero { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.bc-follow-hero-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 28px; border-radius: 100px;
    background: var(--bc-accent); color: #fff; border: none;
    font-size: 14px; font-weight: 700; font-family: var(--bc-sans);
    cursor: pointer; transition: all var(--bc-transition);
    box-shadow: 0 2px 12px rgba(14,165,233,0.25);
}
.bc-follow-hero-btn:hover { background: #0284c7; box-shadow: 0 4px 20px rgba(14,165,233,0.35); transform: translateY(-1px); }
.bc-follow-hero-btn svg { flex-shrink: 0; }

.bc-share-btn {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    color: var(--bc-text2); cursor: pointer; transition: all var(--bc-transition);
}
.bc-share-btn:hover { background: var(--bc-surface-hover); color: var(--bc-text); border-color: var(--bc-accent); }
.bc-share-btn svg { flex-shrink: 0; }

.bc-follow-count-text { font-size: 12px; color: var(--bc-text3); margin-bottom: 12px; }

.bc-actions-links {
    display: flex; align-items: center; gap: 6px;
    padding-top: 12px; border-top: 1px solid var(--bc-border-light);
}
.bc-action-link {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 500; color: var(--bc-text3);
    text-decoration: none; transition: color var(--bc-transition);
}
.bc-action-link:hover { color: var(--bc-accent); }
.bc-action-link svg { flex-shrink: 0; }
.bc-action-dot { color: var(--bc-border); font-size: 14px; }

/* Follow modal */
.bc-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.bc-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); }
.bc-modal-card {
    position: relative; z-index: 1; background: #fff; border-radius: var(--bc-radius-lg);
    padding: 28px; max-width: 400px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.bc-modal-close {
    position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
    border: none; border-radius: 50%; background: var(--bc-surface); color: var(--bc-text3);
    font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.bc-modal-close:hover { background: var(--bc-border); }
.bc-input {
    display: block; width: 100%; padding: 10px 12px; margin-bottom: 8px;
    border: 1px solid var(--bc-border); border-radius: var(--bc-radius-sm);
    font-size: 14px; font-family: var(--bc-sans); color: var(--bc-text);
    background: var(--bc-surface); outline: none;
}
.bc-input:focus { border-color: var(--bc-accent); box-shadow: 0 0 0 3px rgba(14,165,233,0.1); }

/* Google sign-in button */
.bc-google-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 11px 16px; border-radius: var(--bc-radius-sm);
    background: #fff; border: 1px solid var(--bc-border); color: var(--bc-text);
    font-size: 14px; font-weight: 500; font-family: var(--bc-sans);
    cursor: pointer; transition: all var(--bc-transition);
}
.bc-google-btn:hover { border-color: #4285F4; box-shadow: 0 2px 8px rgba(66,133,244,0.15); }

/* Divider */
.bc-divider {
    display: flex; align-items: center; gap: 12px; margin: 16px 0;
    color: var(--bc-text3); font-size: 12px;
}
.bc-divider::before, .bc-divider::after { content: ''; flex: 1; height: 1px; background: var(--bc-border); }

/* Follow submit button */
.bc-follow-submit-btn {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 11px 16px; border-radius: var(--bc-radius-sm);
    background: var(--bc-accent); color: #fff; border: none;
    font-size: 14px; font-weight: 600; font-family: var(--bc-sans);
    cursor: pointer; transition: all var(--bc-transition); margin-top: 4px;
}
.bc-follow-submit-btn:hover { background: #0284c7; }
.bc-follow-submit-btn:disabled { opacity: 0.6; cursor: wait; }

/* ── Tabbed auth modal (sign in / create account) ── */
.bc-auth-tabs {
    display: flex; gap: 0; padding: 4px;
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    border-radius: 100px; margin: 4px 0 18px;
}
.bc-auth-tab {
    flex: 1; padding: 8px 12px;
    background: transparent; border: none; cursor: pointer;
    font-family: var(--bc-sans); font-size: 13px; font-weight: 600;
    color: var(--bc-text2); border-radius: 100px;
    transition: all var(--bc-transition);
}
.bc-auth-tab:hover { color: var(--bc-text); }
.bc-auth-tab.active {
    background: #fff; color: var(--bc-accent);
    box-shadow: 0 1px 3px rgba(14,100,180,0.12);
}
.bc-auth-header { text-align: center; margin: 4px 0 16px; }
.bc-auth-header h2 {
    font-size: 17px; font-weight: 700; color: var(--bc-text);
    margin: 0 0 4px; line-height: 1.3;
}
.bc-auth-header p {
    font-size: 12px; color: var(--bc-text3); line-height: 1.5;
    margin: 0;
}
.bc-auth-form { display: flex; flex-direction: column; gap: 8px; }
.bc-auth-error {
    font-size: 12px; color: #ef4444; padding: 8px 12px;
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 6px; margin-top: 4px;
    line-height: 1.4;
}
.bc-auth-footnote {
    font-size: 11px; color: var(--bc-text3);
    text-align: center; line-height: 1.6; margin-top: 18px;
}
.bc-auth-footnote a { color: var(--bc-accent); font-weight: 600; text-decoration: none; }
.bc-auth-footnote a:hover { text-decoration: underline; }

/* Activity Feed */
.bc-activity-feed {
    max-width: 800px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 0;
    position: relative; padding-left: 24px;
}
.bc-activity-feed::before {
    content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px;
    width: 2px; background: var(--bc-border); border-radius: 1px;
}
.bc-activity-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 8px 0; position: relative;
}
.bc-activity-dot {
    width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    position: absolute; left: -24px; top: 10px;
    background: #fff; border: 2px solid var(--bc-border);
}
.bc-activity-dot svg { width: 8px; height: 8px; }
.bc-activity-dot.dot-anchor { border-color: #00E676; color: #00E676; }
.bc-activity-dot.dot-depart { border-color: var(--bc-accent); color: var(--bc-accent); }
.bc-activity-dot.dot-arrive { border-color: #8b5cf6; color: #8b5cf6; }
.bc-activity-dot.dot-photo { border-color: #f59e0b; color: #f59e0b; }
.bc-activity-dot.dot-weigh { border-color: #64748b; color: #64748b; }
.bc-activity-body { flex: 1; min-width: 0; }
.bc-activity-text { font-size: 13px; font-weight: 500; color: var(--bc-text); }
.bc-activity-time { font-size: 11px; color: var(--bc-text3); margin-top: 1px; }

/* No-data overlay for instruments */
.bc-no-data-overlay {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    border-radius: var(--bc-radius-lg);
    color: var(--bc-text3); font-size: 12px; font-weight: 600;
    text-align: center; padding: 16px;
}
.bc-no-data-overlay svg { opacity: 0.35; }

/* Leaflet icon overrides */
.boat-card-boat-icon, .boat-card-ais-icon { background: transparent !important; border: none !important; }

/* Anchor HUD overlay on map */
.bc-anchor-hud {
    position: absolute; bottom: 8px; left: 8px; right: 8px; z-index: 1000;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px; padding: 8px 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1); pointer-events: none;
}
.bc-ahud-row {
    display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
}
.bc-ahud-label { color: var(--bc-text3); text-transform: uppercase; letter-spacing: 0.05em; font-size: 9px; }
.bc-ahud-value { color: var(--bc-text); font-family: var(--bc-mono); font-size: 13px; font-weight: 800; }
.bc-ahud-sep { color: var(--bc-text3); }
.bc-ahud-bar {
    margin-top: 4px; height: 4px; background: var(--bc-border); border-radius: 2px; overflow: hidden;
}
.bc-ahud-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

/* ============================================================
   RESPONSIVE — Tablet
   ============================================================ */
@media (max-width: 900px) {
    .bc-dashboard { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
    .bc-panel-gallery { grid-column: span 2; }
    .bc-panel-gallery .gallery-mosaic { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; }
    .bc-panel-gallery .mosaic-lg { grid-column: span 2; grid-row: span 2; }
    .bc-panel-map { min-height: 280px; }
    .bc-map { min-height: 280px; }
    .bc-instruments-grid { grid-template-columns: repeat(4, 1fr); }
    .bc-header-right { gap: 8px; }
    .bc-header-right .bc-specs-inline { display: none; }
    .bc-wx-row { grid-template-columns: 1fr; }
    .bc-mid-grid { grid-template-columns: 1fr; }
    .bc-action-row { grid-template-columns: 1fr 1fr 1fr; }
    .gallery-mosaic { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 120px; }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 600px) {
    :root { --bc-pad: 12px; --bc-gap: 10px; }
    /* Mobile: two-column header.
       LEFT: Master's Mate captain brand (aspirational hero).
       RIGHT: Airspeed cursive logo, status pill, Follow & Chat, count.
       LOGIN pill absolute-pinned to top-left corner. */
    .bc-header { padding: 14px var(--bc-pad); position: relative; }
    /* Auto-width columns + justify-content:center on the grid so the
       brand + right-column items move together as one group, with the
       whole group horizontally centered in the header. */
    .bc-header-inner {
        grid-template-columns: auto auto;
        grid-template-areas: "brand right";
        column-gap: 16px;
        align-items: center;
        justify-content: center;
    }
    .bc-mobile-brand {
        display: block;
        grid-area: brand;
        width: 120px; height: 120px;
        background-image: var(--bc-hero-photo-url, url(/assets/logo-captain.png));
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        border-radius: 50%;
        border: 2px solid var(--bc-border);
        box-shadow: 0 1px 4px rgba(14,100,180,0.1);
        flex-shrink: 0;
    }
    /* Wrapper is a flex column centered both horizontally and
       vertically inside the white space to the right of the brand. */
    .bc-mobile-right-stack {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        grid-area: right;
        gap: 6px;
        text-align: center;
    }
    .bc-header-left  {
        align-items: center; justify-content: center;
        flex-wrap: nowrap; gap: 0; min-width: 0;
        width: 100%;
    }
    /* LOGIN pinned to top-RIGHT corner so the brand can stretch left
       without fighting the pill for top-left space. */
    .bc-header-right {
        display: block;
        position: absolute;
        top: 8px; right: 10px;
        left: auto;
        z-index: 5;
        width: auto;
    }
    /* Flatten the specs-stack wrapper on mobile so it doesn't dictate
       width/alignment of the lone LOGIN pill. */
    .bc-header-right .bc-specs-stack {
        display: block;
        min-height: 0;
        align-items: initial;
    }
    .bc-header-cta   {
        justify-self: center; align-self: center;
        align-items: center;
        gap: 2px;
    }

    /* Hide the photo on mobile.
       body.boat-card-page img sets display:block at higher specificity
       than .bc-logo, so we mirror that selector to win the cascade. */
    body.boat-card-page img.bc-logo { display: none; }

    /* Cursive boat-name logo with the status pill snugged beneath it.
       Cursive PNGs ship with empty pixels under the glyph baseline,
       so use a negative margin-top to pull the pill up flush with
       the visible bottom of the cursive. */
    .bc-name-stack {
        align-items: center; justify-content: center;
        min-height: 0; gap: 0;
    }
    .bc-header-left h1 { font-size: 48px; line-height: 1; text-align: center; }
    .bc-header-left h1 img { max-height: 98px; width: auto; max-width: 100%; }
    .bc-status-badge { align-self: center; margin-top: -20px; }

    /* CTA touch target — left-aligned to match the right column */
    .bc-follow-pill { padding: 10px 22px; font-size: 14px; }
    .bc-follower-count-inline { font-size: 12px; }

    /* Smaller LOGIN pill for the corner */
    body.boat-card-page a.bc-login-pill { padding: 4px 10px; font-size: 10px !important; align-self: auto; }
    .bc-dashboard { grid-template-columns: 1fr; grid-template-rows: auto; }
    .bc-panel-gallery { grid-column: span 1; }
    .bc-panel-gallery .gallery-mosaic { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
    .bc-instruments-grid { grid-template-columns: 1fr 1fr; }
    .instrument-value { font-size: 22px; }
    .bc-panel-map { min-height: 0; aspect-ratio: 1; }
    .bc-map { min-height: 0; height: 100%; }
    .bc-mid-grid { grid-template-columns: 1fr; }
    .bc-action-row { grid-template-columns: 1fr; }
    .bc-wx-row { grid-template-columns: 1fr; }
    .bc-bottom-grid { grid-template-columns: 1fr; }
    .bc-qr-frame { padding: 20px 16px 16px; }
    #qrcode-img { width: 180px; height: 180px; }
    .bc-qr-brand { font-size: 16px; }
    .gallery-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 100px; }
    .mosaic-lg { grid-column: span 2; }
    .mosaic-md { grid-column: span 2; }
    .bc-lb-prev { left: 8px; }
    .bc-lb-next { right: 8px; }
    .bc-lb-nav { width: 40px; height: 40px; font-size: 24px; }
}

/* ── Follow pill button in header ── */
.bc-follow-pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 16px; border-radius: 100px;
    background: var(--bc-accent); color: #fff; border: none;
    font-size: 12px; font-weight: 700; font-family: var(--bc-sans);
    cursor: pointer; transition: all var(--bc-transition);
    white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(14,165,233,0.2);
}
.bc-follow-pill:hover { background: #0284c7; }
.bc-follow-pill.following {
    background: #10b981; color: #fff; cursor: default;
    box-shadow: 0 2px 8px rgba(16,185,129,0.30);
}
.bc-follow-pill.following:hover { background: #10b981; }
.bc-follower-count-inline {
    font-size: 11px; color: var(--bc-text3); font-weight: 600; white-space: nowrap;
}

/* ── Beta waitlist sub-banner (full-width strip below header) ── */
.bc-beta-banner {
    display: flex; align-items: center; justify-content: center;
    width: 100%; padding: 9px 16px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 55%, #ea580c 100%);
    color: #fff !important; text-decoration: none !important;
    font-family: var(--bc-sans); font-size: 13px; font-weight: 700;
    line-height: 1; cursor: pointer; position: relative; overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 2px 10px rgba(245, 158, 11, 0.25);
    transition: filter var(--bc-transition);
}
.bc-beta-banner:hover { filter: brightness(1.07); color: #fff !important; }
.bc-beta-banner:visited, .bc-beta-banner:active { color: #fff !important; }
.bc-beta-banner-inner {
    display: inline-flex; align-items: center; gap: 9px;
}
.bc-beta-tag {
    display: inline-block; padding: 3px 7px; border-radius: 100px;
    background: rgba(255,255,255,0.22);
    font-size: 9px; font-weight: 800; letter-spacing: 0.12em;
    line-height: 1; text-transform: uppercase;
}
.bc-beta-icon { opacity: 0.95; flex-shrink: 0; }
.bc-beta-text { white-space: nowrap; }
.bc-beta-count {
    margin-left: 4px; padding-left: 9px;
    border-left: 1px solid rgba(255,255,255,0.35);
    font-size: 11px; font-weight: 600; opacity: 0.95;
    white-space: nowrap;
}
.bc-beta-count:empty { display: none; }
.bc-beta-banner::after {
    content: ''; position: absolute; top: 0; left: -120%;
    width: 30%; height: 100%; pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.30) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: bc-beta-shimmer 4.2s ease-in-out infinite;
}
@keyframes bc-beta-shimmer {
    0%, 25%   { left: -120%; }
    65%, 100% { left: 220%; }
}
@media (max-width: 720px) {
    .bc-beta-banner { padding: 8px 12px; font-size: 12px; }
    .bc-beta-banner-inner { gap: 7px; }
    .bc-beta-tag { padding: 3px 6px; font-size: 8px; }
    .bc-beta-count { font-size: 10px; padding-left: 7px; margin-left: 3px; }
}

/* ── Logged-in user pill (identity + logout) ── */
.bc-specs-stack {
    display: inline-flex; flex-direction: column; align-items: flex-end;
    justify-content: space-between;
    min-height: 67px; gap: 4px;
}
.bc-user-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 3px 3px 9px; border-radius: 100px;
    background: var(--bc-surface); border: 1px solid var(--bc-border);
    font-size: 9px; font-weight: 600; color: var(--bc-text2);
    font-family: var(--bc-sans); white-space: nowrap; flex-shrink: 0;
    line-height: 1; align-self: flex-end;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
/* Login pill (logged-out viewer) — !important guards against the global
   body.boat-card-page a { color: var(--bc-accent) } rule which keeps trying
   to color the text the same as the pill background (i.e. invisible). */
body.boat-card-page a.bc-login-pill {
    display: inline-flex !important;
    align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 100px;
    background: var(--bc-accent) !important;
    color: #fff !important;
    border: 1px solid var(--bc-accent);
    font-size: 12px !important; font-weight: 700; font-family: var(--bc-sans);
    text-transform: uppercase; letter-spacing: 0.06em;
    text-decoration: none !important;
    white-space: nowrap; flex-shrink: 0;
    line-height: 1; align-self: flex-end;
    box-shadow: 0 2px 8px rgba(14,165,233,0.20);
    transition: all var(--bc-transition);
    visibility: visible !important;
}
body.boat-card-page a.bc-login-pill:hover { background: #0284c7 !important; border-color: #0284c7; color: #fff !important; }
body.boat-card-page a.bc-login-pill .bc-user-icon { width: 12px; height: 12px; color: #fff; flex-shrink: 0; }
body.boat-card-page a.bc-login-pill > span {
    color: #fff !important;
    font-size: 12px !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.bc-user-pill .bc-user-icon {
    color: var(--bc-accent); flex-shrink: 0;
    background: rgba(14, 165, 233, 0.10);
    width: 22px; height: 22px; padding: 5px; border-radius: 50%;
    box-sizing: border-box;
}
.bc-user-pill .bc-user-id {
    display: inline-flex; flex-direction: column; gap: 2px;
    min-width: 0; line-height: 1.15;
}
.bc-user-pill .bc-user-email {
    max-width: 160px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; color: var(--bc-text3); font-weight: 500;
    font-size: 8.5px; letter-spacing: 0.01em;
}
.bc-user-pill .bc-user-gear {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 100px;
    color: var(--bc-text3);
    transition: all var(--bc-transition);
    flex-shrink: 0;
}
.bc-user-pill .bc-user-gear:hover {
    color: var(--bc-text);
    background: rgba(0,0,0,0.05);
    transform: rotate(30deg);
}
.bc-user-pill .bc-user-name {
    max-width: 160px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; color: var(--bc-text);
    font-weight: 700; font-size: 10.5px;
}
.bc-user-pill .bc-user-logout {
    display: inline-flex; align-items: center;
    padding: 2px 7px; border-radius: 100px;
    background: #fff; border: 1px solid var(--bc-border);
    font-size: 8px; font-weight: 700; color: var(--bc-text2);
    text-decoration: none; letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: all var(--bc-transition);
}
.bc-user-pill .bc-user-logout:hover {
    background: var(--bc-text); color: #fff; border-color: var(--bc-text);
}
@media (max-width: 720px) {
    .bc-user-pill { font-size: 9px; padding: 2px 3px 2px 8px; gap: 5px; }
    .bc-user-pill .bc-user-icon { width: 19px; height: 19px; padding: 4px; }
    .bc-user-pill .bc-user-name { max-width: 100px; font-size: 10px; }
    .bc-user-pill .bc-user-email { max-width: 100px; font-size: 8px; }
    .bc-user-pill .bc-user-logout { font-size: 8px; padding: 2px 6px; }
}

/* ============================================================
   COLLAPSE EMPTY GRID SLOTS — sparse-data tenants leave huge
   blank columns when one sibling section is hidden. These rules
   make the visible sibling span the full row, and hide the row
   container entirely when nothing inside is visible.
   ============================================================ */
.bc-wx-row:has(> #section-weather.section-hidden),
.bc-wx-row:has(> #section-tides.section-hidden) { grid-template-columns: 1fr; }
.bc-wx-row:not(:has(> section:not(.section-hidden))) { display: none; }

.bc-mid-grid:has(> #section-voyages.section-hidden),
.bc-mid-grid:has(> #section-crew.section-hidden) { grid-template-columns: 1fr; }
.bc-mid-grid:not(:has(> section:not(.section-hidden))) { display: none; }

.bc-bottom-grid:has(> #section-contact.section-hidden),
.bc-bottom-grid:has(> #section-qrcode.section-hidden) { grid-template-columns: 1fr; }
.bc-bottom-grid:not(:has(> section:not(.section-hidden))) { display: none; }

/* ── Widget Row (Pinterest-style masonry via CSS columns: Activity | Stats | Passport | Chat) ── */
/* Each widget keeps its natural height; columns pack tightly with no forced empty space. */
.bc-widget-row {
    max-width: 1400px; margin: 0 auto;
    padding: 0 var(--bc-pad);
    column-count: 4;
    column-gap: var(--bc-gap);
}
@media (max-width: 1100px) { .bc-widget-row { column-count: 3; } }
@media (max-width: 820px)  { .bc-widget-row { column-count: 2; } }
@media (max-width: 540px)  { .bc-widget-row { column-count: 1; } }
.bc-widget-card {
    background: var(--bc-bg2); border-radius: var(--bc-radius);
    box-shadow: var(--bc-shadow); padding: 16px;
    display: flex; flex-direction: column;
    margin-bottom: var(--bc-gap);
    break-inside: avoid;                    /* don't split a widget across columns */
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    width: 100%;
}
/* Scrollable widgets (Activity + Passport): fixed visible height, internal scroll lazy-loads more */
.bc-widget-card--scroll {
    height: 380px;
    overflow: hidden;
}
.bc-widget-card--scroll .bc-widget-title { flex-shrink: 0; }
/* When the passport widget needs to scroll, make its content wrapper a flex column too
   so the grid can claim flex:1 of the remaining card height. */
.bc-widget-card--scroll #passport-content {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
}
.bc-widget-card--scroll .bc-scroll {
    flex: 1; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-width: thin;
}
.bc-widget-card--scroll .bc-scroll::-webkit-scrollbar { width: 4px; }
.bc-widget-card--scroll .bc-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.bc-widget-card--scroll .bc-scroll::-webkit-scrollbar-track { background: transparent; }
.bc-scroll-sentinel { height: 1px; }
.bc-widget-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--bc-text3); margin-bottom: 12px;
    flex-shrink: 0;
}
/* Compact activity — let content flow at natural height (cap to 5 items in JS) */
.bc-activity-compact { padding-right: 0; }
.bc-activity-compact .bc-activity-item { padding: 6px 0 6px 20px; }
.bc-activity-compact .bc-activity-text { font-size: 12px; }

/* ── Voyage Stats — icon tiles, matched to Activity card height ── */
.bc-widget-card--stats {
    height: 380px;
    overflow: hidden;
}
.bc-widget-card--stats .bc-widget-title { flex-shrink: 0; }
.bc-voyage-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    flex: 1; min-height: 0;
    padding: 4px 2px;
    align-content: stretch;
}
/* Odd-count layouts: let the last tile span both columns so nothing looks orphaned */
.bc-stats-count-3 .bc-stat-tile:last-child,
.bc-stats-count-5 .bc-stat-tile:last-child { grid-column: 1 / -1; }

.bc-stat-tile {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; gap: 6px;
    padding: 12px 8px;
    background: linear-gradient(160deg, rgba(2,132,199,0.06) 0%, rgba(56,189,248,0.02) 100%);
    border: 1px solid rgba(2,132,199,0.10);
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--bc-transition), box-shadow var(--bc-transition), border-color var(--bc-transition);
}
.bc-stat-tile::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--bc-accent), #38bdf8);
    opacity: 0.55;
}
.bc-stat-tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(2,132,199,0.10);
    border-color: rgba(2,132,199,0.22);
}
.bc-stat-icon {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    color: var(--bc-accent); opacity: 0.85;
}
.bc-stat-icon svg { width: 22px; height: 22px; }
.bc-stat-value {
    font-family: var(--bc-mono); font-size: 28px; font-weight: 800;
    color: var(--bc-accent); line-height: 1;
    letter-spacing: -0.02em;
}
.bc-stat-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    color: var(--bc-text3); letter-spacing: 0.06em;
}
.bc-stat-divider { display: none; }

/* ── Courtesy Flag Passport ── */
.bc-passport-summary {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 8px; margin-bottom: 10px;
    border-bottom: 1px solid var(--bc-border-light);
    flex-shrink: 0;
}
.bc-passport-counts { display: flex; gap: 14px; }
.bc-passport-count {
    font-size: 11px; color: var(--bc-text3); letter-spacing: 0.02em;
}
.bc-passport-count strong {
    font-family: var(--bc-mono); font-size: 20px; font-weight: 800;
    color: var(--bc-accent); margin-right: 4px;
}
.bc-passport-hint {
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--bc-text3); text-align: right;
    max-width: 110px; line-height: 1.3;
}
.bc-passport-grid {
    display: flex; flex-direction: column; gap: 6px;
}
.bc-passport-card {
    border: 1px solid var(--bc-border-light); border-radius: 8px;
    padding: 8px 10px; background: var(--bc-bg);
    transition: border-color 0.15s, transform 0.15s;
}
.bc-passport-card:hover {
    border-color: var(--bc-accent); transform: translateY(-1px);
}
.bc-passport-card-head {
    display: flex; align-items: center; gap: 10px;
}
.bc-passport-flag {
    width: 32px; height: auto; border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
    flex-shrink: 0;
}
.bc-passport-card-meta { flex: 1; min-width: 0; }
.bc-passport-country {
    font-size: 13px; font-weight: 700; color: var(--bc-text);
    line-height: 1.2;
}
.bc-passport-date {
    font-size: 10px; color: var(--bc-text3); margin-top: 1px;
}
.bc-passport-territories {
    display: flex; flex-wrap: wrap; gap: 3px;
    margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed var(--bc-border-light);
}
.bc-passport-territory {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 5px 1px 3px; border-radius: 5px;
    background: rgba(0,0,0,0.04); font-size: 10px; font-weight: 600;
    color: var(--bc-text2);
}
.bc-passport-territory img {
    width: 12px; height: auto; border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}

/* Hide internal scrollbars in widget cards (still scrollable via wheel/touch) */
.bc-widget-card *::-webkit-scrollbar { width: 4px; }
.bc-widget-card *::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }
.bc-widget-card *::-webkit-scrollbar-track { background: transparent; }

/* ── Chat Widget — same 380px height as scrollable widgets ── */
.bc-chat-widget {
    display: flex; flex-direction: column; position: relative;
    flex: 1; min-height: 0;
}
.bc-chat-messages {
    flex: 1; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column;
    gap: 6px; padding: 4px 0;
    scrollbar-width: thin;
}
.bc-chat-messages::-webkit-scrollbar { width: 4px; }
.bc-chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.bc-chat-messages::-webkit-scrollbar-track { background: transparent; }

/* ── Demo conversation (shown when not signed in) ── */
.bc-chat-demo-banner {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px; margin-bottom: 6px;
    background: rgba(245, 158, 11, 0.12); color: #92400e;
    border-radius: 8px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.bc-chat-demo-banner::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: #f59e0b;
}
.bc-chat-demo-cta {
    flex-shrink: 0; padding: 10px 8px 6px;
    text-align: center;
    border-top: 1px solid var(--bc-border-light);
    margin-top: 8px;
}
.bc-chat-demo-cta-text {
    font-size: 12px; color: var(--bc-text2); margin-bottom: 8px;
    font-weight: 500;
}
.bc-chat-demo-cta-btn {
    padding: 8px 20px; border-radius: 100px;
    background: var(--bc-accent); color: #fff; border: none;
    font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--bc-sans);
    transition: background 0.2s;
}
.bc-chat-demo-cta-btn:hover { background: #0284c7; }
.bc-chat-input-disabled {
    opacity: 0.55; pointer-events: none;
}
.bc-chat-msg {
    max-width: 85%; padding: 8px 12px; border-radius: 12px;
    font-size: 13px; line-height: 1.4; word-wrap: break-word;
}
.bc-chat-msg-sailor {
    align-self: flex-end; background: var(--bc-accent); color: #fff;
    border-bottom-right-radius: 4px;
}
.bc-chat-msg-tenant {
    align-self: flex-start; background: var(--bc-surface); color: var(--bc-text);
    border-bottom-left-radius: 4px;
}
.bc-chat-msg-time {
    font-size: 9px; opacity: 0.6; margin-top: 2px;
}
.bc-chat-input-row {
    display: flex; gap: 6px; margin-top: 8px; align-items: flex-end;
}
.bc-chat-input {
    flex: 1; min-width: 0;
    padding: 8px 14px; border: 1px solid var(--bc-border);
    border-radius: 18px; font-size: 13px; font-family: var(--bc-sans);
    outline: none; transition: border-color 0.2s;
    background: var(--bc-bg2); color: var(--bc-text);
    /* Textarea defaults: word-wrap, no horizontal scroll, grow up to ~3
       lines (≈ line-height 1.4 × 3 + 16px padding) then scroll internally. */
    line-height: 1.4;
    min-height: 36px;
    max-height: calc(13px * 1.4 * 3 + 16px);
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.bc-chat-input:focus { border-color: var(--bc-accent); }
.bc-chat-send {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bc-accent); color: #fff; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s; flex-shrink: 0;
}
.bc-chat-send:hover { background: #0284c7; }
.bc-chat-gate {
    position: absolute; inset: 0; background: rgba(255,255,255,0.92);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; text-align: center; border-radius: var(--bc-radius);
    z-index: 5;
}
.bc-chat-gate p { font-size: 13px; color: var(--bc-text2); font-weight: 500; margin: 0; }
.bc-chat-gate-btn {
    padding: 8px 20px; border-radius: 100px;
    background: var(--bc-accent); color: #fff; border: none;
    font-size: 13px; font-weight: 700; cursor: pointer; font-family: var(--bc-sans);
}
.bc-chat-gate svg { color: var(--bc-accent); }
.bc-chat-empty {
    flex: 1; display: flex; align-items: center; justify-content: center;
    color: var(--bc-text3); font-size: 12px; font-style: italic;
}

@media (max-width: 900px) {
    .bc-widget-row { grid-template-columns: 1fr; }
    .bc-widget-card { max-height: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* High-visibility map cursor — same SVG as the chartplotter (/css/app.css:323)
   so the embedded boat-card Leaflet map matches every other map surface.
   Dark fill + white halo + amber when dragging. Added 2026-05-29 after
   captains reported losing the cursor against busy chart tiles. */
.leaflet-grab,
.leaflet-container.leaflet-grab {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M3 2 L3 21 L9 17 L12 24 L15 22.5 L12 16 L19 16 Z' fill='%231e293b' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, grab !important;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging.leaflet-grab,
.leaflet-container.leaflet-dragging .leaflet-grab {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M3 2 L3 21 L9 17 L12 24 L15 22.5 L12 16 L19 16 Z' fill='%23f59e0b' stroke='%23ffffff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, grabbing !important;
}
