/* ═══════════════════════════════════════════════════════════════════════════
   cartes-stripe — Account Portal CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────────────────────────────────── */
:root {
    --cs-radius: 0.75rem;
    --cs-border: rgba(0, 0, 0, 0.1);
    --cs-muted: #717182;
    --cs-muted-bg: #f3f3f5;
    --cs-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --cs-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.cs-account {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #030213;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.cs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--cs-radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--cs-border);
    background: #fff;
    color: #030213;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}
.cs-btn:hover {
    background: var(--cs-muted-bg);
}
.cs-btn-outline {
    border: 1px solid var(--cs-border);
    background: #fff;
}
.cs-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}
.cs-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.cs-btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* ── Empty State ─────────────────────────────────────────────────────────── */
.cs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    border: 2px dashed var(--cs-border);
    border-radius: var(--cs-radius);
    background: #fafbfc;
}
.cs-empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1;
}
.cs-empty-state-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #030213;
}
.cs-empty-state-text {
    font-size: 0.95rem;
    color: var(--cs-muted);
    max-width: 400px;
    margin: 0 0 1.5rem;
    line-height: 1.6;
}

/* ── Active Card ──────────────────────────────────────────────────────────── */
.cs-active-card {
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--cs-shadow);
}
.cs-active-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: #f9fafb;
    border-bottom: 1px solid var(--cs-border);
}
.cs-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--cs-muted);
    margin: 0;
}
.cs-title {
    font-size: 18px;
    font-weight: 700;
    margin: 2px 0 0;
    line-height: 1.3;
}
.cs-subtitle {
    font-size: 12px;
    color: var(--cs-muted);
    margin: 2px 0 0;
}

/* ── Switching overlay (blur + loader) ────────────────────────────────────── */
.cs-active-card,
.cs-calendar-card {
    position: relative;
}
.cs-active-card.is-switching > *:not(.cs-switch-overlay),
.cs-calendar-card.is-switching > *:not(.cs-switch-overlay) {
    filter: blur(6px);
    pointer-events: none;
    transition: filter 0.3s ease;
}
.cs-switch-overlay {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 50;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    border-radius: var(--cs-radius);
}
.cs-active-card.is-switching .cs-switch-overlay,
.cs-calendar-card.is-switching .cs-switch-overlay {
    display: flex;
}
.cs-switch-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.cs-switch-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: csSpin 0.7s linear infinite;
}
.cs-switch-message {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    text-align: center;
    min-height: 18px;
    animation: csFadeSwap 0.4s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@keyframes csFadeSwap {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Map Viewer (kept + adjusted) ─────────────────────────────────────────── */
.cartes-stripe-map-viewer {
    position: relative;
    background: #fafafa;
}
.cartes-stripe-map-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
}
.cartes-stripe-toggle-heatmap.active {
    background: #14532d;
    border-color: #14532d;
    color: #fff;
}
.cartes-stripe-toggle-heatmap.active:hover {
    background: #166534;
    border-color: #166534;
}

.cs-admin-label {
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cs-muted);
}
/* ── Map body (canvas + side panels) ─────────────────────────────────────── */
.cs-map-body {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.cs-map-canvas-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.cartes-stripe-map-canvas {
    height: 450px;
    width: 100%;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 40%, #ecfdf5 100%);
}

/* ── Panel toggle buttons (overlaid on map) ──────────────────────────────── */
.cs-panel-toggle {
    position: absolute;
    top: 12px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.cs-panel-toggle:hover {
    background: #fff;
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124,58,237,0.18);
}
.cs-panel-toggle.is-active {
    background: #7c3aed;
    color: #fff;
    box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.cs-panel-toggle--left  { left: 12px; }
.cs-panel-toggle--right { right: 12px; }

/* ── Map controls (bottom-right) ─────────────────────────────────────────── */
.cs-map-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cs-map-ctrl {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.cs-map-ctrl:hover {
    background: #fff;
    color: #7c3aed;
    box-shadow: 0 2px 8px rgba(124,58,237,0.18);
}
.cs-map-ctrl.is-active {
    background: #7c3aed;
    color: #fff;
}
.cs-map-ctrl[data-action="geolocate"].is-locating {
    animation: csSpin 1.2s linear infinite;
}

/* ── Shared side panel base ────────────────────────────────────────────────── */
.cs-zones-panel,
.cs-map-side-panel {
    display: none;
    flex-direction: column;
    width: 220px;
    min-width: 180px;
    max-width: 240px;
    background: #fff;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 450px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.cs-zones-panel::-webkit-scrollbar,
.cs-map-side-panel::-webkit-scrollbar { width: 4px; }
.cs-zones-panel::-webkit-scrollbar-thumb,
.cs-map-side-panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

/* Left panel (zones) */
.cs-zones-panel {
    border-right: 1px solid var(--cs-border);
    order: -1;
    padding: 12px;
}
.cs-zones-panel.is-visible { display: flex; }

/* Right panel (hour-picker + conditions) */
.cs-map-side-panel {
    border-left: 1px solid var(--cs-border);
}
.cs-map-side-panel.is-visible { display: flex; }

/* ── Zones du jour ──────────────────────────────────────────────────────────── */
.cs-zones-header {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.cs-zones-count { font-weight: 400; color: #94a3b8; }
.cs-zone-row {
    padding: 6px 4px;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
    border-radius: 4px;
}
.cs-zone-row:last-child { border-bottom: none; }
.cs-zone-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.cs-zone-clickable:hover {
    background: #f1f5f9;
}
.cs-zone-row.is-selected {
    background: #ede9fe;
    border-color: #c4b5fd;
}
.cs-zone-name { font-size: 11px; }
.cs-zone-score { color: #6b7280; font-size: 10px; margin-left: 4px; }
.cs-zone-meta { font-size: 10px; color: #64748b; margin-top: 1px; }
.cartes-stripe-map-meta { display: none !important; }

.cartes-stripe-loading {
    display: none;
    width: 16px;
    height: 16px;
    margin: 0 12px 8px;
    border: 2px solid #d0d0d0;
    border-top-color: #8a8a8a;
    border-radius: 50%;
    animation: csSpin .8s linear infinite;
}
.cartes-stripe-map-viewer.is-loading .cartes-stripe-loading {
    display: inline-block;
}
.cartes-stripe-capture-shield {
    display: none;
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0.96;
    z-index: 100000;
    pointer-events: none;
}
.cartes-stripe-map-viewer.is-capture-shield .cartes-stripe-capture-shield {
    display: block;
}

/* Side panel — hour picker & conditions in context */
.cs-map-side-panel .cs-hour-picker {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px 8px;
    gap: 6px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.cs-map-side-panel .cs-hour-slots {
    flex-wrap: wrap;
    overflow-x: visible;
}
.cs-map-side-panel .cs-conditions-summary {
    padding: 4px 12px 8px;
}
.cs-map-side-panel .cs-cond-title {
    padding: 8px 0;
    display: block;
}

/* Fullscreen */
.cartes-stripe-map-viewer.is-expanded {
    position: fixed;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 99999;
    margin: 0;
    background: #fff;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.2);
    border-radius: var(--cs-radius);
}
.cartes-stripe-map-viewer.is-expanded .cartes-stripe-map-canvas {
    height: calc(100vh - 120px);
    min-height: 420px;
}
.cartes-stripe-map-viewer.is-expanded .cs-zones-panel,
.cartes-stripe-map-viewer.is-expanded .cs-map-side-panel {
    max-height: calc(100vh - 120px);
}

@keyframes csSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── Indicateur chargement tiles (haut-gauche canvas) ─────────────────────── */
.cs-tiles-loader {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #3b82f6;
    border-radius: 50%;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.cs-tiles-loader.is-active {
    animation: csSpin 0.7s linear infinite;
    opacity: 1;
}

/* ── Map bottom bar (legend + toolbar) ────────────────────────────────────── */
.cs-map-bottom-bar {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 54px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}
.cs-map-bottom-bar > * { pointer-events: auto; }

.cs-highlight-legend {
    background: rgba(255,255,255,0.92);
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 11px;
    line-height: 1.5;
    white-space: nowrap;
}
/* Supprime le focus outline sur les liens dans les popups map */
.maplibregl-popup a:focus,
.maplibregl-popup a:focus-visible {
    outline: none;
    box-shadow: none;
}

.cs-highlight-legend-bar {
    display: inline-block;
    width: 36px; height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, #e9d5ff, #4c1d95);
    vertical-align: middle;
    margin-right: 5px;
}

/* ── Conditions Summary ───────────────────────────────────────────────────── */
.cs-conditions-summary {
    padding: 4px 0 4px;
    font-size: 13px;
    line-height: 1.4;
}
.cs-cond-header {
    margin-bottom: 0;
    font-size: 14px;
}
.cs-cond-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    padding: 8px 0;
}
.cs-cond-body { padding-top: 4px; }
.cs-cond-total {
    background: #0f172a;
    color: #fff;
    padding: 2px 9px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.cs-cond-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    border-bottom: 1px solid #f1f5f9;
}
.cs-cond-row:last-child { border-bottom: none; }
.cs-cond-icon { font-size: 16px; flex-shrink: 0; width: 24px; text-align: center; }
.cs-cond-text { flex: 1; }
.cs-cond-detail { color: #64748b; font-size: 11px; margin-left: 4px; }
.cs-cond-badge { font-weight: 700; font-size: 13px; min-width: 26px; text-align: right; flex-shrink: 0; }

/* ── Day Picker (inside map viewer — pill style) ──────────────────────────── */
.cs-day-picker {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 10px 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.cs-day-picker::-webkit-scrollbar { height: 4px; }
.cs-day-picker::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.cs-day-picker-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.cs-day-picker-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}
.cs-day-picker-btn--active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
    font-weight: 600;
}
.cs-day-picker-btn--active:hover {
    background: #1e293b;
    border-color: #1e293b;
}

/* ── Hour Picker ─────────────────────────────────────────────────────────── */
.cs-hour-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 4px;
    flex-wrap: nowrap;
}
.cs-hour-live {
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.cs-hour-live.active,
.cs-hour-live:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}
.cs-hour-slots {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.cs-hour-slots::-webkit-scrollbar { height: 3px; }
.cs-hour-slots::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.cs-hour-slot {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: background 0.12s, border-color 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cs-hour-slot:hover        { background: #f1f5f9; border-color: #94a3b8; }
/* Périodes solunar — reprend les couleurs condRow positif (#16a34a) */
.cs-hour-slot.cs-hour-major {
    background: #dcfce7;
    border-color: #16a34a;
    color: #15803d;
    font-weight: 700;
}
.cs-hour-slot.cs-hour-minor {
    background: #f0fdf4;
    border-color: #4ade80;
    color: #16a34a;
}
.cs-hour-slot.cs-hour-now {
    border-color: #0f172a;
    color: #0f172a;
    font-weight: 700;
    font-size: 12px;
}
.cs-hour-slot.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
    font-weight: 700;
}
.cs-hour-slot.cs-hour-major.active { background: #15803d; border-color: #15803d; }
.cs-hour-slot.cs-hour-minor.active { background: #16a34a; border-color: #16a34a; }

/* ── Indicateur live / heure (sibling absolu à gauche du bouton horloge) ─── */
.cs-clock-status {
    position: absolute;
    top: 12px;
    right: 54px;   /* bouton (36px) + right (12px) + gap (6px) */
    z-index: 5;
    font-size: 10px;
    font-weight: 700;
    line-height: 36px;   /* même hauteur que le bouton toggle */
    text-align: center;
    pointer-events: none;
}
.cs-clock-live {
    color: #ef4444;
    animation: cs-live-pulse 1.4s ease-in-out infinite;
}
.cs-clock-hour {
    color: #0f172a;
    background: rgba(255,255,255,0.88);
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 4px;
    line-height: 1;
    top: 20px;   /* centré vertically avec le bouton */
    font-size: 9px;
}
@keyframes cs-live-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

/* ── Station Panel ────────────────────────────────────────────────────────── */
.cs-station-panel {
    display: none;
    margin-top: 10px;
    padding: 14px 14px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    overflow-y: auto;
    max-height: 540px;
}
.cs-station-panel.is-open {
    display: block;
}
.cartes-stripe-map-viewer.is-expanded .cs-station-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    max-height: none;
    width: 300px;
    max-width: 45%;
    margin-top: 0;
    border-radius: 0 6px 6px 0;
    border: none;
    border-left: 1px solid #e2e8f0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 30;
}
.cs-station-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.cs-station-panel-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.cs-station-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #64748b;
    cursor: pointer;
    padding: 0 2px;
}
.cs-station-panel-close:hover {
    color: #1e293b;
}
.cs-station-panel-loading {
    display: none;
    width: 20px;
    height: 20px;
    margin: 16px auto;
    border: 2px solid #e2e8f0;
    border-top-color: #6d28d9;
    border-radius: 50%;
    animation: csSpin .7s linear infinite;
}
.cs-panel-section {
    margin-top: 14px;
}

/* Anchor shortcut buttons */
.cs-panel-anchors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 0 4px;
}
.cs-anchor-btn {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--cs-muted-bg);
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--cs-border);
    transition: background 0.15s, border-color 0.15s;
}
.cs-anchor-btn:hover {
    background: #e9e9ef;
    border-color: #c0c0cc;
}

/* Switch Grille/Courbe dans le panneau station — centré sous la courbe */
.cs-panel-tides-card .cs-panel-view-switch {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Wrapper canvas — hauteur fixe comme sur la page marée */
.cs-day-sheet-content .marees-chart-wrapper {
    height: 160px;
}
.cs-day-sheet-content .marees-chart-axis-y {
    height: 160px;
}

/* Weather card full width in day sheet */
.cs-day-sheet-content .marees-weather-card {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Leurre section */
.cs-leurre-phrase {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
    margin: 6px 0 10px;
}
.cs-leurre-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════════════════════ */

.cs-calendar-card {
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    background: #fff;
    box-shadow: var(--cs-shadow);
    padding: 14px;
    margin-top: 12px;
}
.cs-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.cs-calendar-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #030213;
}
.cs-calendar-title svg {
    flex-shrink: 0;
}
.cs-calendar-title-mobile { display: none; }
.cs-calendar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cs-calendar-city-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--cs-muted);
}
.cs-btn-city-mobile { display: none; }

/* Calendar Nav (carousel wrapper) — hauteur fixe pour éviter le saut au chargement */
.cs-calendar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 150px;
}

/* Arrow buttons */
.cs-cal-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--cs-border);
    border-radius: 50%;
    background: #fff;
    color: #475569;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}
.cs-cal-arrow:hover:not(:disabled) {
    background: var(--cs-muted-bg);
    border-color: #94a3b8;
    color: #1e293b;
}
.cs-cal-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Calendar Grid — horizontal scroll carousel */
.cs-calendar-grid {
    display: flex;
    gap: 8px;
    overflow: hidden;
    flex: 1;
    scroll-behavior: smooth;
    align-items: stretch;
    height: 100%;
}

/* Day Button */
.cs-day-btn {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 140px;
    padding: 6px 8px 5px;
    border: 2px solid #e5e7eb;
    border-radius: var(--cs-radius);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    text-align: left;
    font-family: inherit;
    color: inherit;
}
.cs-day-btn:hover {
    box-shadow: var(--cs-shadow);
    border-color: #d1d5db;
}
.cs-day-btn.is-selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Today marker */
.cs-day-btn .cs-today-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 9px;
    height: 9px;
    background: #3b82f6;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Day name */
.cs-day-name {
    font-size: 10px;
    font-weight: 500;
    color: var(--cs-muted);
    text-transform: capitalize;
    line-height: 1.2;
    text-align: center;
    margin-bottom: 2px;
}

/* Date — centered */
.cs-day-date {
    text-align: center;
    flex: 1;
}
.cs-day-number {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.1;
}
.cs-day-month {
    font-size: 9px;
    color: var(--cs-muted);
    line-height: 1.2;
}

/* Main row: weather (left) | date (center) | coef (right) */
.cs-day-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 3px;
}

/* Weather */
.cs-day-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}
.cs-day-weather-icon { font-size: 16px; line-height: 1; }
.cs-day-weather-temp {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
}

/* Coef + tide times */
.cs-day-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.cs-coef-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
}
.cs-coef-badge.cs-coef-high {
    background: #030213;
    color: #fff;
}
.cs-coef-badge.cs-coef-normal {
    background: #e5e7eb;
    color: #030213;
}
.cs-coef-icon {
    font-size: 8px;
}
.cs-tide-time {
    font-size: 9px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
}
.cs-tide-high {
    color: #2563eb;
}
.cs-tide-low {
    color: #ea580c;
}

/* Activity label */
.cs-day-activity-label {
    font-size: 9px;
    color: var(--cs-muted);
    font-weight: 500;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* Activity badge */
.cs-day-badge-row {
    text-align: center;
    padding-bottom: 4px;
    border-bottom: 1px solid #f3f4f6;
}
.cs-activity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}

/* Activity badge colors */
.cs-activity-exceptional {
    background: #7c3aed;
    color: #fff;
}
.cs-activity-very-good {
    background: #1d4ed8;
    color: #fff;
}
.cs-activity-good {
    background: #3b82f6;
    color: #fff;
}
.cs-activity-medium {
    background: #93c5fd;
    color: #fff;
}
.cs-activity-low {
    background: #d1d5db;
    color: #6b7280;
}

/* Infos Marées button */
.cs-day-marees-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: 5px 8px;
    margin-top: auto;
    background: #fff;
    color: #3b82f6;
    border: 1.5px solid #3b82f6;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.cs-day-marees-btn:hover {
    background: #eff6ff;
}

/* Day card loading state */
.cs-day-btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}
.cs-day-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: csSpin .7s linear infinite;
}

/* Calendar hint */
.cs-calendar-hint {
    text-align: center;
    font-size: 12px;
    color: var(--cs-muted);
    margin: 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.cs-hint-mobile { display: none; }

/* Calendar loading */
.cs-calendar-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    color: var(--cs-muted);
    font-size: 13px;
    gap: 8px;
}
.cs-calendar-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: csSpin .7s linear infinite;
}
.cs-calendar-empty {
    text-align: center;
    padding: 30px;
    color: var(--cs-muted);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHEETS (Day Detail + Cards List)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shared sheet styles */
.cs-day-sheet,
.cs-cards-sheet {
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.cs-day-sheet[aria-hidden="false"],
.cs-cards-sheet[aria-hidden="false"] {
    pointer-events: auto;
    opacity: 1;
}

/* Backdrop */
.cs-day-sheet-backdrop,
.cs-cards-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

/* Panel */
.cs-day-sheet-panel,
.cs-cards-sheet-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 520px;
    background: #fff;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cs-day-sheet[aria-hidden="false"] .cs-day-sheet-panel,
.cs-cards-sheet[aria-hidden="false"] .cs-cards-sheet-panel {
    transform: translateX(0);
}

/* Sheet header */
.cs-day-sheet-header,
.cs-cards-sheet-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 16px 20px 0;
    border-bottom: 1px solid var(--cs-border);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}
.cs-cards-sheet-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 20px 14px;
}

/* Day sheet header — top row */
.cs-day-sheet-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
}
.cs-day-sheet-header-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}
.cs-day-sheet-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Day nav arrows (prev / next) */
.cs-day-nav-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--cs-border);
    border-radius: 50%;
    background: #fff;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    padding: 0;
}
.cs-day-nav-btn:hover:not(:disabled) {
    background: var(--cs-muted-bg);
    border-color: #94a3b8;
    color: #1e293b;
}
.cs-day-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Anchor pills row in day sheet header */
.cs-day-sheet-anchors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 12px;
    border-top: 1px solid var(--cs-border);
    min-height: 0;
}
.cs-day-sheet-anchors:empty {
    display: none;
}
.cs-day-sheet-title,
.cs-cards-sheet-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.cs-day-sheet-title {
    font-size: 16px;
}
.cs-day-sheet-subtitle,
.cs-cards-sheet-subtitle {
    font-size: 13px;
    color: var(--cs-muted);
    margin: 2px 0 0;
}
.cs-day-sheet-close,
.cs-cards-sheet-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    flex-shrink: 0;
    border-radius: 6px;
    transition: background 0.15s;
}
.cs-day-sheet-close:hover,
.cs-cards-sheet-close:hover {
    background: var(--cs-muted-bg);
    color: #030213;
}

/* Sheet content */
.cs-day-sheet-content {
    padding: 20px;
}
.cs-cards-sheet-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Day sheet loading */
.cs-day-sheet-loading {
    display: none;
    padding: 40px;
    text-align: center;
}
.cs-day-sheet-loading::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: csSpin .7s linear infinite;
}

/* Groupes par département dans la sheet */
.cs-cards-dept-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cs-muted);
    padding: 8px 4px 4px;
    margin-top: 6px;
    border-bottom: 1px solid var(--cs-border);
}
.cs-cards-dept-header:first-child {
    margin-top: 0;
}
.cs-cards-dept-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 0 4px;
}

/* Sous-en-tête type de pêche dans la sheet */
.cs-cards-type-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cs-muted);
    padding: 8px 4px 2px;
    margin-top: 2px;
}
.cs-cards-type-icon {
    font-size: 14px;
    line-height: 1;
}

/* Card items in cards sheet */
.cs-card-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    color: inherit;
}
.cs-card-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}
.cs-card-item strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}
.cs-card-item span {
    display: block;
    font-size: 12px;
    color: var(--cs-muted);
    margin-top: 2px;
}
.cs-card-fishing-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--cs-muted);
}
.cs-card-fishing-type svg {
    flex-shrink: 0;
    opacity: .7;
}
.cs-active-card-subtitle .cs-card-fishing-type {
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CITY SEARCH MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.cs-city-modal {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.cs-city-modal[aria-hidden="false"] {
    pointer-events: auto;
    opacity: 1;
}
.cs-city-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}
.cs-city-modal-panel {
    position: relative;
    width: 90%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--cs-radius);
    box-shadow: var(--cs-shadow-lg);
    overflow: hidden;
    transform: translateY(-10px);
    transition: transform 0.2s;
}
.cs-city-modal[aria-hidden="false"] .cs-city-modal-panel {
    transform: translateY(0);
}
.cs-city-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cs-border);
}
.cs-city-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.cs-city-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    padding: 2px;
}
.cs-city-modal-search {
    padding: 12px 18px;
    border-bottom: 1px solid var(--cs-border);
}
.cs-city-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}
.cs-city-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.cs-city-results {
    max-height: 260px;
    overflow-y: auto;
}
.cs-city-result {
    display: block;
    width: 100%;
    padding: 10px 18px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    color: #030213;
    transition: background 0.1s;
}
.cs-city-result:hover {
    background: #f3f4f6;
}
.cs-city-result-code {
    font-size: 11px;
    color: var(--cs-muted);
    margin-left: 6px;
}
.cs-city-no-results {
    padding: 16px 18px;
    text-align: center;
    color: var(--cs-muted);
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CITY MARKER TOOLTIP
   ═══════════════════════════════════════════════════════════════════════════ */

.cs-marker-tooltip {
    position: absolute;
    z-index: 20;
    pointer-events: none;
    transform: translate(-50%, 14px);
    background: #0f172a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: csTooltipAppear 0.2s ease-out;
}
/* Flèche pointant vers le haut */
.cs-marker-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #0f172a;
}

@keyframes csTooltipAppear {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 14px);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .cs-active-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .cs-title {
        font-size: 16px;
    }
    .cartes-stripe-map-canvas {
        height: min(240px, 35vh);
    }

    /* Calendar */
    .cs-calendar-title-desktop { display: none; }
    .cs-calendar-title-mobile { display: inline; }
    .cs-calendar-title { font-size: 14px; }
    .cs-btn-city-desktop { display: none; }
    .cs-btn-city-mobile { display: inline; }

    /* Scroll tactile sur le calendrier */
    .cs-calendar-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    .cs-calendar-grid .cs-day-btn {
        scroll-snap-align: start;
    }
    .cs-cal-arrow { display: none; }

    .cs-day-btn {
        width: 125px;
    }

    .cs-hint-desktop { display: none; }
    .cs-hint-mobile { display: inline; }

    /* Side panels — stack below canvas on mobile */
    .cs-map-body {
        flex-direction: column;
    }
    .cs-zones-panel,
    .cs-map-side-panel {
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: 260px;
        border-left: none;
        border-right: none;
        order: 0;
    }
    .cs-zones-panel { border-bottom: 1px solid var(--cs-border); }
    .cs-map-side-panel { border-top: 1px solid var(--cs-border); }
    .cs-map-side-panel .cs-hour-picker {
        flex-direction: row;
        flex-wrap: nowrap;
        padding: 6px 12px;
    }
    .cs-map-side-panel .cs-hour-slots {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    /* Sheets */
    .cs-day-sheet-panel,
    .cs-cards-sheet-panel {
        max-width: 100%;
    }

    /* Courbe marée — pleine largeur et centrée sur mobile */
    .cs-day-sheet-content .cs-panel-tides-card {
        width: auto !important;
        max-width: none !important;
        flex: none;
        margin-left: -20px;
        margin-right: -20px;
    }
    .cs-day-sheet-content .marees-chart-view {
        padding: 12px 0;
    }
    .cs-day-sheet-content .marees-chart-container {
        gap: 0;
    }
    .cs-day-sheet-content .marees-chart-axis-y {
        display: none;
    }
    .cs-day-sheet-content .marees-chart-main {
        width: 100%;
    }
    .cs-day-sheet-content .marees-chart-wrapper {
        width: 100%;
        height: 160px;
    }
    .cs-day-sheet-content .marees-chart-wrapper canvas {
        width: 100% !important;
        height: 160px !important;
    }
}

@media (max-width: 480px) {
    .cs-calendar-card {
        padding: 10px;
    }
    .cs-day-btn {
        padding: 5px 6px 4px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GUEST (non-logged-in) — Landing page
   ═══════════════════════════════════════════════════════════════════════════ */

.cs-guest {
    max-width: 620px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
}

/* Hero */
.cs-guest__hero {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #0891b2 100%);
    color: #fff;
    text-align: center;
    padding: 48px 32px 40px;
    border-radius: 16px;
    margin-bottom: 32px;
}
.cs-guest__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    margin-bottom: 20px;
}
.cs-guest__icon svg {
    color: #fff;
}
.cs-guest__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 10px;
    line-height: 1.3;
}
.cs-guest__subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    line-height: 1.6;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
}

/* Features */
.cs-guest__features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}
.cs-guest__feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.cs-guest__feature-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}
.cs-guest__feature-icon--blue {
    background: #dbeafe;
    color: #2563eb;
}
.cs-guest__feature-icon--green {
    background: #dcfce7;
    color: #16a34a;
}
.cs-guest__feature-icon--purple {
    background: #f3e8ff;
    color: #7c3aed;
}
.cs-guest__feature strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
    color: #1f2937;
}
.cs-guest__feature span {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

/* Actions */
.cs-guest__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}
.cs-guest__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}
.cs-guest__btn--primary {
    background: #2563eb;
    color: #fff;
    border: none;
}
.cs-guest__btn--primary:hover {
    background: #1d4ed8;
    color: #fff;
}
.cs-guest__btn--outline {
    background: #fff;
    color: #2563eb;
    border: 2px solid #2563eb;
}
.cs-guest__btn--outline:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

/* Footer */
.cs-guest__footer {
    text-align: center;
}
.cs-guest__footer p {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}
.cs-guest__footer a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}
.cs-guest__footer a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .cs-guest__hero {
        padding: 36px 20px 32px;
        border-radius: 12px;
    }
    .cs-guest__title {
        font-size: 1.3rem;
    }
    .cs-guest__actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cs-guest__btn {
        justify-content: center;
    }
}
