/* 1. GLOBAL & ROOT */
:root { --bg: #f0f2f5; --card: #fff; --primary: #007bff; --open: #218838; --closed: #c82333; --fav: #f1c40f; --warn: #e67e22; --slack: #218838; --snow: #3498db; --danger-red: #f8d7da; --danger-border: #f5c6cb; --danger-text: #721c24; }
body { font-family: -apple-system, sans-serif; background: var(--bg); margin: 0; color: #1c1e21; overflow-x: hidden; }
header { background: #2c3e50; color: #fff; padding: 20px; text-align: center; position: relative; min-height: 80px; }

/* 2. HEADER BUTTONS */
#user-section { position: absolute; top: 15px; right: 15px; z-index: 100; display: flex; gap: 10px; }
.auth-btn-header { background: rgba(255,255,255,0.2); border: 1px solid #fff; color: #fff; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: bold; }
.delete-btn-header { background: rgba(255, 0, 0, 0.2); border: 1px solid #ff4444; color: #ffcccc; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: bold; }
.admin-btn { border-color: var(--fav) !important; color: var(--fav) !important; }

/* LOCATION FORECAST BAR */
.location-forecast-bar { background: #fff; padding: 12px 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; border-bottom: 1px solid #eee; justify-content: center; }
.loc-action-btn { background: #f0f2f5; border: 1px solid #ddd; padding: 10px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; color: #333; transition: all 0.2s; }
.loc-action-btn:hover { background: #e7f3ff; border-color: var(--primary); color: var(--primary); }
.loc-action-btn.rca-btn { background: #fff0f0; border-color: #e0c0c0; color: #b33; }
.loc-action-btn.rca-btn:hover { background: #ffe0e0; border-color: #c00; color: #c00; }
.pfma-notifier { background: #e7f3ff; color: #004085; border: 2px solid #b3d7ff; border-radius: 10px; padding: 10px 16px; margin-bottom: 8px; font-size: 0.85rem; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rca-notifier { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; margin-bottom: 8px; position: relative; }
.rca-notifier-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.rca-notifier-body { display: flex; flex-direction: column; gap: 2px; }
.rca-notifier-body strong { font-size: 0.85rem; }
.rca-notifier-name { font-size: 0.8rem; font-weight: 700; opacity: 0.9; }
.rca-notifier-detail { font-size: 0.75rem; opacity: 0.85; }
#map-notifications-overlay { position: absolute; top: 8px; left: 58px; right: 50px; z-index: 800; pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
#map-notifications-overlay > div { pointer-events: auto; }
.map-overlay-notif { box-shadow: 0 2px 12px rgba(0,0,0,0.15); position: relative; padding-right: 32px; }
.notif-dismiss { position: absolute; top: 4px; right: 6px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: inherit; opacity: 0.5; line-height: 1; padding: 2px 6px; }
.notif-dismiss:hover { opacity: 1; }
.map-notif-toggle-btn.notif-on { background: #fef3e2 !important; border-color: #e67e22 !important; }
.map-notif-toggle-btn.notif-on svg { stroke: #e67e22; }
.map-loading-indicator { position: absolute; bottom: 25%; left: 50%; transform: translateX(-50%); z-index: 800; background: rgba(255,255,255,0.92); backdrop-filter: blur(4px); border-radius: 20px; padding: 6px 16px; display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; color: #555; box-shadow: 0 2px 8px rgba(0,0,0,0.12); pointer-events: none; transition: opacity 0.3s; white-space: nowrap; }
.map-loading-spinner { width: 14px; height: 14px; border: 2px solid #ddd; border-top-color: #2563eb; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pfma-notifier.map-overlay-notif { background: rgba(231,243,255,0.92); backdrop-filter: blur(4px); }
.rca-notifier-danger.map-overlay-notif { background: rgba(248,215,218,0.92); backdrop-filter: blur(4px); }
.rca-notifier-caution.map-overlay-notif { background: rgba(253,235,208,0.92); backdrop-filter: blur(4px); }
.rca-notifier-safe.map-overlay-notif { background: rgba(212,237,218,0.92); backdrop-filter: blur(4px); }
.rca-notifier-danger { background: #f8d7da; color: var(--closed); border: 2px solid #f5c6cb; }
.rca-notifier-caution { background: #fdebd0; color: #7c4a03; border: 2px solid #f5cba7; }
.rca-notifier-safe { background: #d4edda; color: var(--open); border: 2px solid #c3e6cb; }
#rca-map { width: 100%; height: 400px; border-radius: 10px; margin-bottom: 0; z-index: 1; }
.rca-legend { font-size: 0.8rem; color: #666; text-align: center; margin-top: 6px; }
.rca-legend span { display: inline-flex; align-items: center; gap: 4px; margin: 0 8px; }
.rca-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
#rca-map .leaflet-control-layers { border-radius: 8px; font-size: 0.8rem; padding: 8px 12px; }
#rca-map .leaflet-control-layers label { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
/* Shared style for all custom map control buttons (gear, fullscreen, update location) */
.map-ctrl-btn, .rca-layer-gear-btn { width: 34px; height: 34px; background: #fff; border: 2px solid rgba(0,0,0,0.2); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 5px rgba(0,0,0,0.2); color: #333; padding: 0; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.map-ctrl-btn:hover, .rca-layer-gear-btn:hover, .rca-layer-gear-btn.active { background: #f0f4ff; color: var(--primary); border-color: var(--primary); }
/* Leaflet zoom buttons styled to match */
#rca-map .leaflet-control-zoom-in, #rca-map .leaflet-control-zoom-out { width: 34px !important; height: 34px !important; line-height: 32px !important; font-size: 1.3rem !important; background: #fff !important; border: 2px solid rgba(0,0,0,0.2) !important; color: #333 !important; box-shadow: 0 1px 5px rgba(0,0,0,0.2) !important; transition: background 0.15s, color 0.15s, border-color 0.15s !important; display: flex !important; align-items: center !important; justify-content: center !important; }
#rca-map .leaflet-control-zoom-in:hover, #rca-map .leaflet-control-zoom-out:hover { background: #f0f4ff !important; color: var(--primary) !important; border-color: var(--primary) !important; }
#rca-map .leaflet-bar { border: none !important; box-shadow: none !important; }
#rca-map .leaflet-control-zoom-in { border-radius: 6px 6px 0 0 !important; border-bottom-width: 1px !important; }
#rca-map .leaflet-control-zoom-out { border-radius: 0 0 6px 6px !important; }
.rca-layer-control { background: transparent !important; border: none !important; box-shadow: none !important; }
.rca-layer-panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 1000; background: #fff; border: 1px solid rgba(0,0,0,0.2); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.2); padding: 14px 16px; min-width: 180px; font-size: 0.82rem; }
.rca-layer-section-title { font-weight: 700; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.4px; color: #888; margin: 6px 0 4px; }
.rca-layer-section-title:first-child { margin-top: 0; }
.rca-layer-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; cursor: pointer; color: #333; white-space: nowrap; }
.rca-layer-row input { cursor: pointer; accent-color: var(--primary); }
.gps-marker-icon { background: none !important; border: none !important; }
@keyframes gps-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: 0.85; } }
.gps-marker-pulse { animation: gps-pulse 2s ease-in-out infinite; display: flex; align-items: center; justify-content: center; }
.gps-marker-static { animation: none; display: flex; align-items: center; justify-content: center; }
/* Map favourite markers */
.map-fav-marker { font-size: 1.6rem; line-height: 1; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35)); cursor: pointer; user-select: none; }
.map-fav-popup { text-align: center; min-width: 120px; }
.map-fav-popup-emoji { font-size: 2rem; display: block; margin-bottom: 4px; }
.map-fav-popup-note { font-size: 0.82rem; color: #333; margin-bottom: 8px; line-height: 1.4; }
.map-fav-popup-delete { background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 5px 10px; font-size: 0.78rem; cursor: pointer; color: #c82333; display: inline-flex; align-items: center; gap: 5px; }
.map-fav-popup-delete:hover { background: #fff0f0; border-color: #fca5a5; }
/* Emoji picker overlay */
.map-fav-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.map-fav-dialog { background: #fff; border-radius: 14px; padding: 20px; width: 92%; max-width: 400px; box-shadow: 0 8px 32px rgba(0,0,0,0.25); display: flex; flex-direction: column; gap: 12px; max-height: 85vh; }
.map-fav-dialog-title { font-weight: 800; font-size: 1rem; color: #2c3e50; text-align: center; }
.map-fav-emoji-scroll { overflow-y: auto; max-height: 280px; padding-right: 4px; }
.map-fav-group-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #999; margin: 8px 0 4px; }
.map-fav-group-label:first-child { margin-top: 0; }
.map-fav-emoji-row { display: flex; flex-wrap: wrap; gap: 4px; }
.map-fav-emoji-btn { font-size: 1.5rem; background: none; border: 2px solid transparent; border-radius: 8px; padding: 4px 5px; cursor: pointer; transition: border-color 0.12s, background 0.12s; line-height: 1; }
.map-fav-emoji-btn:hover { background: #f0f4ff; }
.map-fav-emoji-btn.selected { border-color: var(--primary); background: #e8f0ff; }
.map-fav-note-input { width: 100%; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; outline: none; box-sizing: border-box; }
.map-fav-note-input:focus { border-color: var(--primary); }
.map-fav-btns { display: flex; gap: 8px; }
.map-fav-btn-cancel { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 8px; background: #fff; cursor: pointer; font-size: 0.9rem; color: #555; }
.map-fav-btn-save { flex: 2; padding: 10px; border: none; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; font-size: 0.9rem; }
.map-fav-btn-save:disabled { opacity: 0.4; cursor: not-allowed; }
.map-fav-btn-save:not(:disabled):hover { background: #1a56db; }
.offline-status-box { padding: 10px 16px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; }
.offline-status-box.saved { background: #f0fdf4; border: 1px solid #86efac; color: #166534; }

/* 3. SEARCH & FILTERS */
.search-container { background: #fff; padding: 15px; position: sticky; top: 0; z-index: 50; border-bottom: 1px solid #ddd; }
.search-pinned { position: sticky; top: 0; z-index: 50; }
.search-row-integrated { display: flex; align-items: center; background: #f0f2f5; border: 1px solid #ddd; border-radius: 25px; padding: 2px; margin-bottom: 12px; height: 48px; }
.search-row-integrated input { flex: 1; border: none; background: transparent; padding: 10px 5px; outline: none; font-size: 1rem; }
.inner-search-btn { width: 44px; height: 44px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #666; transition: color 0.2s; }
.inner-search-btn.right { font-size: 1.6rem; line-height: 1; margin-right: 2px; }
.inner-search-btn.left { margin-left: 2px; }
#toggle-favs.active { color: var(--fav); }
#toggle-favs.active svg { fill: var(--fav); }

.filter-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 5px; }
.filter-controls button { flex: 1; min-width: 80px; padding: 10px; border: 1px solid #ddd; border-radius: 8px; background: #f8f9fa; cursor: pointer; font-size: 0.85rem; transition: all 0.15s; }
.filter-controls button.toolbar-open { background: #e7f3ff; color: var(--primary); border-color: #b3d7ff; font-weight: 700; }
.area-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.area-toolbar.collapsed { display: none !important; }
.area-row { display: contents; } /* lets area-btn flow inline in the toolbar */
.area-row.has-subareas-open { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.area-btn { padding: 6px 12px; border: 1px solid #ddd; background: #fff; font-size: 0.75rem; border-radius: 18px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.area-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.area-expand-icon { font-size: 0.85rem; font-weight: 900; transition: transform 0.2s ease; display: inline-block; }
.subarea-row { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; padding: 6px 0 4px 14px; }
.subarea-row.collapsed { display: none !important; }
.subarea-btn { padding: 6px 12px; border: 1px solid #ddd; background: #fff; font-size: 0.75rem; border-radius: 18px; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.subarea-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
#clear-all-filters-btn { background: #fff0f0; border: 1px solid var(--closed); color: var(--closed); font-size: 0.8rem; font-weight: 700; padding: 8px 16px; border-radius: 10px; cursor: pointer; width: 100%; margin-top: 6px; display: none; }
.close-toolbar-btn { display: none; width: 100%; padding: 10px; margin-top: 6px; background: #f0f4ff; border: 1px solid var(--primary); color: var(--primary); font-size: 0.8rem; font-weight: 700; border-radius: 10px; cursor: pointer; text-align: center; letter-spacing: 0.5px; }
.close-toolbar-btn:hover { background: var(--primary); color: #fff; }
.sort-toolbar { flex-direction: column; gap: 10px; padding: 12px 0; }
.sort-section { display: flex; flex-direction: column; gap: 6px; }
.sort-label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; color: #888; letter-spacing: 0.05em; }
.sort-hint { font-weight: 400; text-transform: none; color: #aaa; font-size: 0.65rem; }
.sort-toggle-btn { padding: 6px 14px; border: 1px solid #ddd; background: #fff; font-size: 0.75rem; border-radius: 18px; cursor: pointer; width: fit-content; font-weight: 600; }
.sort-toggle-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.sort-drag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.sort-drag-badge { padding: 6px 12px; border: 1px solid #ddd; background: #fff; font-size: 0.75rem; border-radius: 18px; cursor: grab; font-weight: 600; user-select: none; display: flex; align-items: center; gap: 5px; }
.sort-drag-badge:active { cursor: grabbing; }
.filter-chip { background: #e7f3ff; color: var(--primary); padding: 5px 12px; border-radius: 15px; font-size: 0.75rem; font-weight: 700; cursor: pointer; border: 1px solid #b3d7ff; }
#active-filters-summary { display: flex; flex-direction: column; gap: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-row:empty { display: none; }

/* 4. REGULATION CARDS */
.reg-card-container { background: #fff; margin: 15px; padding: 18px; border-radius: 12px; border-left: 6px solid #ccc; box-shadow: 0 1px 3px rgba(0,0,0,0.1); box-sizing: border-box; overflow: hidden; }
.reg-card-open { border-left-color: var(--open); }
.reg-card-closed { border-left-color: var(--closed); }
.reg-card-warn { border-left-color: var(--warn); }

/* TYPE BADGES */
.type-badge { font-size: 0.6rem; padding: 3px 8px; border-radius: 10px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.species-reg { background: #e7f3ff; color: var(--primary); border: 1px solid #b3d7ff; }
.general-rest { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.contamination-warn { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* REFINED BIVALVE CONTAMINATION STYLE */
.reg-card-bivalve { background: var(--danger-red) !important; border: 1px solid var(--danger-border) !important; border-left: 8px solid var(--closed) !important; color: var(--danger-text) !important; }
.reg-card-bivalve .reg-card-species { color: var(--danger-text) !important; font-size: 1.25rem; display: flex; align-items: center; gap: 10px; font-weight: 900; }
.reg-card-bivalve .reg-card-area-tag { background: rgba(0,0,0,0.05); color: var(--danger-text); border: 1px solid var(--danger-border); }
.reg-card-bivalve .reg-card-content-grid { background: rgba(255,255,255,0.5); border: 1px solid var(--danger-border); }
.reg-card-bivalve .reg-card-field strong { color: #856404; }
.reg-card-bivalve .reg-card-value { color: var(--danger-text); }
.reg-card-bivalve .reg-card-footer-link { color: #a94442; }
.reg-card-bivalve .reg-card-status-pill { color: var(--closed) !important; background: #f8d7da !important; }
.reg-card-bivalve .bio-icon { font-size: 1.8rem; filter: saturate(1.5); }

.reg-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.reg-card-area-tag { font-size: 0.7rem; background: #f0f2f5; padding: 4px 8px; border-radius: 4px; color: #666; font-weight: bold; }
.reg-card-btns { display: flex; gap: 6px; }
.reg-card-action { padding: 6px 10px; border: 1px solid #eee; background: #fafafa; border-radius: 6px; cursor: pointer; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; }
.reg-card-fav.fav-active { color: var(--fav); border-color: var(--fav); }
.reg-card-fav.fav-active svg { fill: var(--fav); }
.reg-card-species { font-size: 1.2rem; margin: 0 0 12px 0; font-weight: 800; color: #1c1e21; display: flex; align-items: center; gap: 8px; }
.card-type-icon { display: flex; align-items: center; flex-shrink: 0; }
.reg-card-content-grid { display: flex; gap: 15px; background: #f8f9fa; padding: 12px; border-radius: 8px; flex-wrap: wrap; }
.reg-card-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 80px; }
.reg-card-field strong { font-size: 0.65rem; text-transform: uppercase; color: #777; }
.reg-card-value { font-size: 0.85rem; font-weight: 600; color: #333; overflow-wrap: break-word; word-break: break-word; }
.reg-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.reg-card-status-pill { display: inline-block; padding: 5px 12px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; }
.reg-card-status-open { background: #d4edda; color: var(--open); }
.reg-card-status-closed { background: #f8d7da; color: var(--closed); }
.reg-card-status-restricted { background: #fdebd0; color: var(--warn); }
.reg-card-footer-link { font-size: 0.75rem; color: var(--primary); text-decoration: none; font-weight: 600; white-space: nowrap; }

/* 5. MODAL SYSTEM */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); overscroll-behavior: contain; }
body.modal-open { overflow: hidden; }
.modal-content { background: #fff; margin: 4vh auto; padding: 25px; width: 95%; max-width: 820px; height: 92vh; border-radius: 16px; position: relative; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
/* modal-body fills remaining vertical space; weather/tide scroll inside it */
#modal-body { flex: 1 1 0; overflow-y: auto; overflow-x: hidden; min-height: 0; position: relative; }
/* ── Map modal: full flex chain so rca-map fills all available space ── */
.modal-content.has-map #modal-body { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.modal-content.has-map .modal-tide-graph-container { flex: 1 1 0; display: flex; flex-direction: column; min-height: 0; margin: 0; padding: 0; background: transparent; }
.modal-content.has-map #rca-map { flex: 1 1 0; min-height: 0; height: auto !important; }
.modal-content.has-map #offline-map-section { flex: 0 0 auto; padding: 10px 0 2px; }
#modal-body { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; }
.close-modal { position: absolute; top: 10px; right: 15px; cursor: pointer; font-size: 1.8rem; color: #666; z-index: 20; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,0.9); }
.close-modal:hover { background: #f0f0f0; }
.modal-sticky-header { position: sticky; top: 0; background: #fff; z-index: 15; padding-bottom: 10px; margin: 0 -25px; padding: 0 25px 10px; }
.modal-sticky-header .modal-env-title { margin-bottom: 2px; padding-right: 36px; }
.modal-sticky-header-row { display: flex; align-items: center; justify-content: space-between; padding-right: 40px; }
.modal-sticky-header-row .modal-env-title { flex: 1; margin-bottom: 0; padding-right: 0; }
.modal-switch-btn { display: inline-flex; align-items: center; background: #f0f4ff; border: 1px solid #d0d8e8; color: #3b5998; font-size: 0.78rem; font-weight: 600; padding: 5px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.modal-switch-btn:hover { background: #dce5f5; border-color: #a0b0d0; }
.modal-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.modal-share-btn { display: inline-flex; align-items: center; justify-content: center; background: #f5f5f5; border: 1px solid #ddd; color: #666; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; padding: 0; }
.modal-share-btn:hover { background: #e8e8e8; color: #333; border-color: #bbb; }

/* 6. AUTH MODAL */
.auth-modal-card { background: #fff; margin: 10% auto; padding: 30px; width: 90%; max-width: 400px; border-radius: 20px; position: relative; box-shadow: 0 10px 40px rgba(0,0,0,0.2); box-sizing: border-box; }
.auth-modal-title { margin-top: 0; text-align: center; color: #2c3e50; font-size: 1.4rem; font-weight: 800; margin-bottom: 25px; }
.auth-modal-google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; border: 1px solid #ddd; padding: 12px; border-radius: 8px; font-weight: 600; cursor: pointer; color: #555; }
.auth-modal-divider { height: 1px; background: #e2e8f0; margin: 18px 0; }
.auth-modal-form { display: flex; flex-direction: column; gap: 12px; }
.auth-modal-input { padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem; outline: none; }
.auth-modal-primary-btn { background: var(--primary); color: white; border: none; padding: 14px; border-radius: 8px; font-weight: 800; cursor: pointer; font-size: 1rem; }
.auth-modal-primary-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-magic-hint { margin-top: 12px; text-align: center; font-size: 0.82rem; color: #64748b; line-height: 1.4; }

/* 7. ENVIRONMENTAL MODAL */
.modal-env-title { font-size: 1.4rem; margin-top: 0; margin-bottom: 20px; font-weight: 800; }
.modal-env-sun-info { display: flex; justify-content: space-around; font-size: 0.85rem; margin-bottom: 15px; padding: 12px; background: #fff9db; border-radius: 8px; font-weight: 500; color: #856404; border: 1px solid #ffeeba; }
.modal-env-sun-info b { font-weight: 800; margin-left: 4px; color: #533f03; }
.modal-env-hourly-container { margin: 15px 0; background: #fafafa; padding: 10px; border-radius: 8px; border: 1px solid #eee; }
.modal-env-hourly-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; }
.modal-env-hourly-item { flex: 0 0 110px; text-align: center; border-right: 1px solid #eee; padding: 0 8px; }
.modal-env-h-day { font-size: 0.6rem; color: var(--primary); font-weight: 900; text-transform: uppercase; display: block; margin-bottom: 2px; }
.modal-env-h-time { font-size: 0.7rem; color: #666; font-weight: bold; display: block; }
.modal-env-h-temp { font-size: 0.95rem; font-weight: 800; display: block; margin: 4px 0; }
.weather-icon-hit { filter: brightness(0.7) contrast(1.3); }
.modal-env-h-precip-block { margin-top: 5px; min-height: 45px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.h-precip-row { display: flex; flex-direction: column; gap: 2px; }
.precip-unit { display: flex; gap: 4px; justify-content: center; align-items: baseline; }
.modal-env-h-precip { font-size: 0.62rem; color: var(--primary); font-weight: 800; }
.modal-env-h-precip.snow { color: var(--snow); }
.modal-env-h-accum { font-size: 0.55rem; color: #666; font-weight: 900; }
.wind-arrow { display: inline-block; font-size: 0.8rem; font-weight: 900; line-height: 1; }
.wind-arrow.small { font-size: 0.65rem; }
.modal-env-h-wind-block { margin: 5px 0; background: #f0f2f5; padding: 5px; border-radius: 6px; }
.modal-env-h-direction { font-size: 0.6rem; font-weight: 900; color: var(--primary); display: block; margin-bottom: 2px; }
.modal-env-h-wind { font-size: 0.7rem; font-weight: 800; display: block; }
.modal-env-h-gust { font-size: 0.55rem; color: #666; font-weight: bold; display: block; margin-top: 2px; }

/* DAILY OUTLOOK */
.modal-env-day-block { padding: 12px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.modal-env-day-flex { display: flex; align-items: center; gap: 15px; }
.modal-env-day-huge-icon { width: 70px; height: 70px; background: transparent; flex-shrink: 0; }
.modal-env-day-content { flex: 1; }
.modal-env-day-main-row { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-env-day-title-group b { font-size: 0.95rem; color: #2c3e50; }
.modal-env-day-pop-row { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 4px; }
.precip-inline { display: flex; align-items: baseline; gap: 5px; }
.modal-env-day-pop { font-size: 0.72rem; font-weight: 800; color: var(--primary); }
.modal-env-day-pop.snow { color: var(--snow); }
.modal-env-day-accum { font-size: 0.65rem; font-weight: 900; color: #666; }
.modal-env-day-temp-main { font-size: 1.1rem; font-weight: 800; color: #333; }
.modal-env-day-marine-details { margin-top: 6px; }
/* Marine conditions summary badges (above 48-hr forecast) */
.modal-marine-summary { display: flex; gap: 10px; margin-bottom: 8px; }
.modal-marine-badge { flex: 1; background: #f0f4fa; border: 1px solid #d0daea; border-radius: 12px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.marine-badge-icon { font-size: 1rem; line-height: 1; color: #4a6fa5; }
.marine-badge-val { font-size: 1rem; font-weight: 900; color: #1c1e21; line-height: 1.2; }
.marine-badge-label { font-size: 0.65rem; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: 0.3px; }
.marine-disclaimer { font-size: 0.72rem; color: #999; margin: 4px 0 14px; text-align: center; font-style: italic; }

/* Wave row in 48-hr hourly cards */
.modal-env-h-wave { font-size: 0.65rem; color: #4a6fa5; font-weight: 800; margin-top: 5px; }
.wave-swell { font-weight: 600; color: #7a9fc5; }

/* Wave row in 10-day daily blocks */
.modal-env-day-wave { font-size: 0.75rem; color: #4a6fa5; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 4px; }

/* Snow row separator in daily precip */
.snow-sep { margin-top: 2px; }

.modal-env-day-wind-row { display: flex; align-items: baseline; gap: 10px; font-size: 0.75rem; background: #f9f9f9; padding: 4px 8px; border-radius: 4px; border: 1px solid #f0f0f0; width: fit-content; margin-bottom: 4px; }
.modal-env-day-wind { font-weight: 800; color: #333; display: flex; align-items: center; gap: 4px; }
.modal-env-day-gust { font-weight: 700; color: #777; font-size: 0.7rem; }
.modal-env-day-block.rough-sea { border-left: 4px solid var(--closed); background: #fff5f5; }

/* TIDE STYLES */
.modal-badges-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 190px; }
.modal-badges-grid.tide-badges { grid-template-columns: 1fr 1fr 1fr; width: 100%; }
.modal-badge-item { padding: 8px 10px; border-radius: 12px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.06); border: 1px solid transparent; }
.station-col { background: #e9ecf0; color: #3a4455; border-color: #d0d5dd; }
.slack-col   { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.current-col { background: #d0e8ff; color: #004085; border-color: #b8d9f7; }
.badge-tag { display: block; font-size: 0.5rem; font-weight: 900; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-val { font-size: 1rem; font-weight: 900; display: block; margin-top: 2px; }
.badge-sub { display: block; font-size: 0.55rem; font-weight: 700; opacity: 0.75; margin-top: 2px; }
.badge-sub.flow-strength { font-size: 0.85rem; font-weight: 900; opacity: 1; margin-top: 4px; }
.modal-tide-graph-container { margin: 20px 0; background: #f8f9fa; padding: 20px; border-radius: 12px; position: relative; }
.modal-tide-viewport { height: 280px; background: #fff; border: 1px solid #ddd; border-radius: 6px; position: relative; width: 100%; box-sizing: border-box; overflow: hidden; cursor: grab; user-select: none; touch-action: pan-y; }
.tide-tooltip { position: absolute; background: rgba(30,40,60,0.92); color: #fff; padding: 8px 12px; border-radius: 8px; pointer-events: none; z-index: 10; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }
.modal-tide-svg-label { font-size: 10px; fill: #666; font-weight: bold; font-family: sans-serif; }
.modal-tide-svg-day-label { font-size: 9.5px; fill: #333; font-weight: 900; font-family: sans-serif; }
.modal-tide-svg-now-label { font-size: 9px; fill: #dc2626; font-weight: 900; font-family: sans-serif; }
.tide-drag-hint { text-align: center; font-size: 0.68rem; color: #aaa; margin: -2px 0 10px; letter-spacing: 0.3px; }
.modal-now-label { font-size: 12px; fill: red; font-weight: 900; font-family: sans-serif; }
.modal-tide-legend { display: flex; justify-content: space-around; font-size: 0.8rem; margin-top: 15px; padding: 10px; background: #fff; border-radius: 8px; border: 1px solid #eee; }
.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    flex-shrink: 0;
}
.legend-od-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
    vertical-align: middle;
    background: linear-gradient(to right, #c0392b, #f1c40f, #27ae60, #2980b9);
    position: relative;
    top: -1px;
}
.tide-disclaimer { font-size: 0.65rem; color: #999; text-align: center; margin: 8px 0 0 0; line-height: 1.3; }
.cache-timestamp { font-size: 0.65rem; color: #aaa; text-align: center; margin: 12px 0 0 0; }
.modal-tide-table-title { font-size: 0.9rem; color: #666; margin: 25px 0 10px 0; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid #eee; padding-bottom: 5px; }
.modal-tide-scroll { overflow-y: auto; padding-top: 5px; flex: 1 1 auto; min-height: 120px; }
.modal-tide-group h5 { margin: 12px 0 6px 0; color: #444; font-size: 0.85rem; border-bottom: 1px solid #eee; padding-bottom: 2px; }
.modal-tide-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; padding: 6px 8px; border-bottom: 1px solid #f9f9f9; }
.modal-tide-type { font-weight: bold; text-transform: uppercase; font-size: 0.7rem; width: 50px; text-align: center; }
.modal-tide-type.high { color: var(--open); }
.modal-tide-type.low { color: var(--primary); }

/* 8. UI EXTRAS */
#back-to-top { display: none; position: fixed; bottom: 30px; right: 30px; z-index: 2000; background: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 50px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.4); font-weight: bold; }
.admin-action-btn { background: var(--primary); color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; margin-bottom: 5px; width: 100%; }
.admin-action-btn.secondary { background: #f0f2f5; color: #333; border: 1px solid #ddd; }
.scrape-options { background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px 14px; }
.scrape-options-label { font-size: 0.75rem; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: 0.4px; margin: 0 0 8px 0; }
.scrape-checkbox-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.88rem; color: #333; cursor: pointer; }
.scrape-checkbox-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.scrape-output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.scrape-output-badge { font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; }
.scrape-output-badge.running { background: #fff3cd; color: #856404; }
.scrape-output-badge.complete { background: #d4edda; color: #155724; }
.scrape-output-badge.error { background: #f8d7da; color: #721c24; }
#scrape-output-elapsed { font-size: 0.75rem; color: #888; }
.scrape-output-log { background: #1e1e1e; color: #d4d4d4; font-family: 'Courier New', Courier, monospace; font-size: 0.72rem; line-height: 1.5; padding: 10px 12px; border-radius: 6px; max-height: 280px; overflow-y: auto; margin: 0; white-space: pre-wrap; word-break: break-word; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 9. MOBILE RESPONSIVE */
/* NONNA depth legend */
#nonna-legend {
    display: none;
    position: absolute;
    bottom: 36px;
    right: 10px;
    z-index: 1000;
    background: rgba(255,255,255,0.95);
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    color: #1e293b;
    min-width: 120px;
    pointer-events: none;
}
.nonna-legend-img { display: block; max-width: 140px; border-radius: 4px; }
.nonna-legend-note { font-size: 0.58rem; color: #94a3b8; margin-top: 6px; line-height: 1.3; }

/* Location coords bar */
#location-coords-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    pointer-events: auto;
}
.coords-icon-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}
.coords-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
}
.coords-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    min-width: 0;
    transition: border-color 0.15s;
}
.coords-input-wrap:focus-within { border-color: #3b82f6; background: #fff; }
.coords-input {
    flex: 1;
    font-size: 0.8rem;
    font-family: monospace;
    color: #1e293b;
    background: transparent;
    border: none;
    padding: 5px 10px;
    outline: none;
    min-width: 0;
}
.coords-input.coords-input-error { color: #dc2626; }
.coords-copy-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-left: 1px solid #e2e8f0;
    padding: 0 9px;
    height: 100%;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.15s, background 0.15s;
}
.coords-copy-btn:hover { color: #3b82f6; background: #eff6ff; }
.coords-copy-btn.coords-copy-success { color: #16a34a; }
.inner-search-btn.share-copied { color: #16a34a !important; }
.coords-gmaps-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    border-left: 1px solid #e2e8f0;
    padding: 0 9px;
    height: 100%;
    cursor: pointer;
    color: #1a73e8;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.coords-gmaps-btn:hover { background: #eff6ff; color: #1558b0; }
.coords-error {
    font-size: 0.7rem;
    color: #dc2626;
    margin-top: 3px;
    padding-left: 2px;
}

/* Map click popup & Add Favorite button */
/* Allow popup to expand to fit the Add Favorite button */
.leaflet-popup-content-wrapper { min-width: max-content; }
.leaflet-popup-content { min-width: max-content; }
.map-click-popup .leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 3px 12px rgba(0,0,0,0.2); padding: 0; }
.map-click-popup .leaflet-popup-content { margin: 0; }
.map-click-popup-inner { padding: 10px 14px 12px; }
.map-click-coords { font-size: 0.75rem; font-family: monospace; color: #64748b; margin-bottom: 8px; }
.map-add-fav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.map-add-fav-btn:hover { background: #fefce8; border-color: #fde68a; color: #92400e; }
.map-popup-btn-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}
.map-popup-reposition-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 6px;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.map-popup-reposition-btn:hover { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* Favourite popup edit button */
.map-fav-popup-edit { background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 5px 10px; font-size: 0.78rem; cursor: pointer; color: #374151; display: inline-flex; align-items: center; gap: 5px; }
.map-fav-popup-edit:hover { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }

/* Search autocomplete dropdown */
.search-ac-drop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 260px;
    overflow-y: auto;
}
.search-ac-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-ac-item:hover,
.search-ac-item.active {
    background: #f0f7ff;
    color: #1d4ed8;
}

@media (max-width: 480px) {
    /* On mobile: search bar and filter buttons are never sticky, scroll with the page */
    .search-container { position: static; }
    /* Close toolbar button never shown on mobile */
    .close-toolbar-btn { display: none !important; }
    .modal-content { padding: 12px 14px; width: 100%; height: 100%; height: 100dvh; margin: 0; border-radius: 0; }
    .modal-content h2 { font-size: 1.15rem; }
    .auth-modal-card { padding: 20px; width: 94%; margin: 5% auto; }
    .close-modal { top: 8px; right: 10px; font-size: 1.5rem; width: 32px; height: 32px; }
    .modal-sticky-header { margin: 0 -14px; padding: 0 14px 8px; }
    #rca-map { height: auto !important; min-height: 0; border-radius: 6px; }
    .rca-legend { flex-wrap: wrap; gap: 4px; }
    .pfma-notifier { background: rgba(231,243,255,0.92); color: #004085; border: 2px solid #b3d7ff; border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: 0.8rem; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.rca-notifier { padding: 14px 16px; gap: 12px; }
    .rca-notifier-icon { font-size: 2rem; }
    .rca-notifier-body strong { font-size: 0.9rem; }
    .rca-notifier-name { font-size: 0.8rem; }
    .rca-notifier-detail { font-size: 0.75rem; }
    .modal-env-hourly-item { flex: 0 0 90px; }
    .modal-badges-grid { grid-template-columns: 1fr 1fr; width: 100%; }
    .modal-badges-grid.tide-badges { grid-template-columns: 1fr 1fr 1fr; }
    .modal-env-day-flex { gap: 10px; }
    .modal-env-day-huge-icon { width: 50px; height: 50px; }
    .modal-tide-viewport { height: 210px; }
    .offline-status-box { font-size: 0.8rem; }
    #offline-map-section .loc-action-btn { font-size: 0.75rem; padding: 8px 12px; }
}
/* ── ACCOUNT MODAL ──────────────────────────────────────────────────────────── */
.account-btn { border-color: rgba(255,255,255,0.6) !important; }
.acct-section { border: 1px solid #e8e8e8; border-radius: 10px; overflow: hidden; margin-bottom: 4px; }
.acct-section-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f8f9fa; border-bottom: 1px solid #e8e8e8; }
.acct-section-title { font-weight: 700; font-size: 0.88rem; color: #2c3e50; display: flex; align-items: center; gap: 6px; }
.acct-count { background: var(--primary); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 0.72rem; font-weight: 700; }
.acct-header-actions { display: flex; gap: 6px; }
.acct-select-btn { font-size: 0.72rem; padding: 3px 8px; border: 1px solid #ccc; border-radius: 5px; background: #fff; cursor: pointer; color: #555; }
.acct-delete-all-btn { font-size: 0.72rem; padding: 3px 8px; border: 1px solid #f0b8b8; border-radius: 5px; background: #fff8f8; cursor: pointer; color: #c82333; }
.acct-list { display: flex; flex-direction: column; max-height: 240px; overflow-y: auto; }
.acct-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #f0f0f0; transition: background 0.1s; }
.acct-item:last-child { border-bottom: none; }
.acct-item:hover { background: #fafafa; }
.acct-item-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.acct-item-icon { font-size: 1.1rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 22px; }
.acct-item-text { min-width: 0; }
.acct-item-title { font-size: 0.85rem; font-weight: 600; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-item-sub { font-size: 0.72rem; color: #888; margin-top: 1px; }
.acct-item-actions { display: flex; gap: 5px; flex-shrink: 0; }
.acct-share-btn { padding: 5px 8px; border: 1px solid #d0e4ff; border-radius: 6px; background: #f0f7ff; color: var(--primary); cursor: pointer; display: flex; align-items: center; }
.acct-share-btn:hover { background: #dbeafe; }
.acct-delete-btn { padding: 5px 8px; border: 1px solid #f0b8b8; border-radius: 6px; background: #fff8f8; color: #c82333; cursor: pointer; display: flex; align-items: center; }
.acct-delete-btn:hover { background: #ffe0e0; }
.acct-empty { color: #aaa; font-size: 0.82rem; text-align: center; padding: 16px; margin: 0; }
.acct-bulk-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f0f4ff; border-top: 1px solid #d0e0ff; font-size: 0.8rem; color: #555; }
.acct-bulk-delete-btn { margin-left: auto; padding: 5px 12px; border: none; border-radius: 6px; background: #c82333; color: #fff; font-size: 0.78rem; cursor: pointer; }
.acct-bulk-delete-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.acct-cancel-select-btn { padding: 5px 10px; border: 1px solid #ccc; border-radius: 6px; background: #fff; font-size: 0.78rem; cursor: pointer; color: #555; }
.acct-share-emoji-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.acct-share-emoji-btn { font-size: 1.3rem; background: #f8f9fa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 6px 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.acct-share-emoji-btn:hover { background: #f0f4ff; border-color: var(--primary); }
.acct-share-emoji-count { font-size: 0.72rem; background: #e0e0e0; border-radius: 10px; padding: 1px 6px; color: #555; font-weight: 700; }
.acct-email-section { padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acct-email-display { display: flex; align-items: center; gap: 8px; min-width: 0; }
.acct-email-text { font-size: 0.88rem; color: #334155; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-change-email-toggle { background: none; border: none; color: #2563eb; font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap; padding: 0; }
.acct-change-email-toggle:hover { text-decoration: underline; }
.acct-change-email-form { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.acct-change-email-input { padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; outline: none; width: 100%; box-sizing: border-box; }
.acct-change-email-input:focus { border-color: #3b82f6; }
.acct-change-email-btns { display: flex; gap: 8px; }
.acct-change-email-submit { background: var(--primary); color: white; border: none; padding: 8px 16px; border-radius: 7px; font-weight: 700; font-size: 0.82rem; cursor: pointer; }
.acct-change-email-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.acct-change-email-cancel { background: none; border: 1px solid #ddd; padding: 8px 16px; border-radius: 7px; font-size: 0.82rem; cursor: pointer; color: #64748b; }
.acct-change-email-success { font-size: 0.82rem; color: #16a34a; margin: 4px 0 0; line-height: 1.4; }
.acct-danger-zone { border-color: #fce8e8 !important; background: #fff8f8; padding: 12px 14px; }
.acct-danger-btn { background: none; border: 1px solid #f0b8b8; color: #c82333; border-radius: 7px; padding: 8px 14px; cursor: pointer; font-size: 0.82rem; width: 100%; }
.acct-danger-btn:hover { background: #ffe0e0; }
/* ── SHARE TOAST ──────────────────────────────────────────────────────────── */
.share-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2c3e50; color: #fff; padding: 18px 40px; border-radius: 12px; font-size: 1.1rem; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 99999; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
.share-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
/* ── MAP FAV POPUP SHARE ─────────────────────────────────────────────────── */
.map-fav-popup-actions { display: flex; gap: 6px; justify-content: center; margin-top: 6px; }
.map-fav-popup-share { background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 5px 10px; font-size: 0.78rem; cursor: pointer; color: #374151; display: inline-flex; align-items: center; gap: 5px; }
.map-fav-popup-share:hover { background: #f0f7ff; border-color: #bfdbfe; color: var(--primary); }

/* Station picker */
.station-clickable { cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.station-clickable:hover { background: #dce3ed; border-color: #aab4c4; }
.station-picker-dropdown { background: #fff; border: 1px solid #d0d5dd; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); margin: 8px 0; max-height: 280px; overflow-y: auto; }
.station-picker-header { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #888; padding: 10px 14px 6px; letter-spacing: 0.03em; }
.station-picker-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; cursor: pointer; transition: background 0.12s; border-top: 1px solid #f0f0f0; }
.station-picker-item:hover { background: #f0f4ff; }
.station-picker-item:first-of-type { border-top: none; }
.station-picker-name { font-size: 0.85rem; color: #333; }
.station-picker-dist { font-size: 0.75rem; color: #888; white-space: nowrap; margin-left: 12px; }
.station-picker-nodata { opacity: 0.4; cursor: default; }
.station-picker-nodata:hover { background: transparent; }
/* Location link */
.modal-location-link { display: inline-flex; align-items: center; font-size: 0.85rem; color: #556; cursor: pointer; padding: 4px 10px; margin: -2px 0 10px 0; border-radius: 8px; transition: background 0.15s, color 0.15s; }
.modal-location-link:hover { background: #eef1f6; color: #2563eb; }
/* Map forecast overlay */
.map-forecast-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: #fff; z-index: 10; overflow-y: auto; overflow-x: hidden; padding: 0 25px; border-radius: inherit; }
.map-forecast-overlay .modal-sticky-header { margin: 0 -25px; padding: 0 25px 10px; }
/* Map forecast controls */
.map-forecast-controls { display: flex; flex-direction: column; gap: 0; }
.map-forecast-controls .map-ctrl-btn { border-radius: 0; border-bottom: none; }
.map-forecast-controls .map-ctrl-btn:first-child { border-radius: 6px 6px 0 0; }
.map-forecast-controls .map-ctrl-btn:last-child { border-radius: 0 0 6px 6px; border-bottom: 2px solid rgba(0,0,0,0.2); }
/* Tide station markers */
.tide-station-marker { background: rgba(255,255,255,0.9); border: 2px solid #0369a1; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.2); display: flex !important; align-items: center; justify-content: center; padding-left: 2px; }
.legend-tide-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: rgba(255,255,255,0.9); border: 2px solid #0369a1; border-radius: 50%; vertical-align: middle; padding-left: 1px; }
.tide-station-popup-btn { display: block; width: 100%; margin-top: 6px; padding: 5px 12px; background: #0369a1; color: #fff; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.tide-station-popup-btn:hover { background: #0284c7; }
