@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --bg: #000000;
    --surface: #111111;
    --surface2: #1a1a1a;
    --border: #2a2a2a;
    --accent: #95ca24;
    --accent2: #95ca24;
    --text: #e0e0e0;
    --muted: #9e9e9e;
    --card-bg: #0d0d0d;
    --pill-yes: #1a2a00;
    --pill-yes-text: #95ca24;
    --pill-no: #2a1010;
    --pill-no-text: #cc6666;
    --pill-partial: #1e1e00;
    --pill-partial-text: #c8c840;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  header {
    background: #000000;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 140px;
    flex-shrink: 0;
    z-index: 1200;
    position: relative;
  }
  .logo {
    display: flex;
    align-items: center;
    white-space: nowrap;
    filter: drop-shadow(0 0 8px rgba(149,202,36,0.25));
  }
  .logo svg { display: block; }
  .logo img, .logo-img { height: 120px; width: auto; display: block; padding: 10px 0; }
  .logo span { font-style: normal; color: #9e9e9e; font-weight: 300; }
  .map-nav { display:flex; align-items:center; gap:0.25rem; }
  .map-nav-link { color:var(--muted); text-decoration:none; font-size:0.85rem; padding:0.4rem 0.7rem; border-radius:8px; transition:all 0.15s; white-space:nowrap; }
  .map-nav-link:hover { color:var(--text); background:var(--surf2); }
  .map-burger { display:none; flex-direction:column; justify-content:center; gap:5px; width:36px; height:36px; background:none; border:1px solid var(--border); border-radius:8px; cursor:pointer; padding:7px; flex-shrink:0; margin-left:0.5rem; }
  .map-burger span { display:block; height:2px; background:var(--text); border-radius:2px; transition:transform 0.2s,opacity 0.2s; }
  .map-burger.is-open span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
  .map-burger.is-open span:nth-child(2) { opacity:0; transform:scaleX(0); }
  .map-burger.is-open span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }
  .map-mob-menu { display:none; position:fixed; top:90px; left:0; right:0; background:var(--surface); border-bottom:2px solid var(--accent); padding:0.5rem 1rem 0.75rem; flex-direction:column; gap:0.1rem; z-index:9999; box-shadow:0 12px 40px rgba(0,0,0,0.6); }
  .map-mob-menu.is-open { display:flex; }
  .map-mob-menu a { display:flex; align-items:center; color:var(--muted); text-decoration:none; font-size:0.95rem; font-weight:500; padding:0.45rem 0.9rem; border-radius:10px; transition:background 0.15s,color 0.15s; }
  .map-mob-menu a:hover { color:var(--text); background:var(--surf2); }

  .result-count {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
  }
  .result-count strong { color: var(--accent2); font-size: 1rem; }

  /* ── Header Search Bar ── */
  .header-search {
    position: relative;
    z-index: 1100;
    width: 300px;
    flex-shrink: 0;
  }
  .header-search-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    padding: 0.45rem 2.2rem 0.45rem 2rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .header-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(149,202,36,0.12);
  }
  .header-search-input::placeholder { color: var(--muted); }
  .header-search-icon {
    position: absolute;
    left: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
    align-items: center;
  }
  .header-search-clear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    display: none;
    align-items: center;
    line-height: 1;
  }
  .header-search-clear:hover { color: var(--text); }
  .header-search-clear.visible { display: flex; }
  .search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 1300;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    display: none;
  }
  .search-dropdown.open { display: block; }
  .search-dropdown::-webkit-scrollbar { width: 4px; }
  .search-dropdown::-webkit-scrollbar-track { background: transparent; }
  .search-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .search-result-item {
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
  }
  .search-result-item:last-child { border-bottom: none; }
  .search-result-item:hover, .search-result-item.active {
    background: var(--surface2);
  }
  .search-result-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
  }
  .search-result-name mark {
    background: transparent;
    color: var(--accent);
    font-weight: 700;
  }
  .search-result-meta {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.1rem;
  }
  .search-no-results {
    padding: 0.7rem 0.9rem;
    font-size: 0.82rem;
    color: var(--muted);
    font-style: italic;
  }

  .filters {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
  }
  .filter-toggle-btn { display: none; }
  .filter-content { display: contents; }
  .filter-break { display: none; }
  .filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .filter-label {
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    color: var(--accent);
    white-space: nowrap;
  }
  select, input[type=number] {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.3rem 1.6rem 0.3rem 0.65rem;
    border-radius: 7px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l3 3 3-3' stroke='%23666' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
  }
  select:focus, input[type=number]:focus { border-color: var(--accent); color: var(--text); }
  select:hover { border-color: #3a3a3a; }
  select { cursor: pointer; }
  select option { background: var(--surface2); }
  input[type=number] { width: 80px; background-image: none; padding-right: 0.5rem; }

  .toggle-btn {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.3rem 0.7rem;
    border-radius: 7px;
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .toggle-btn.active {
    background: var(--pill-yes);
    border-color: var(--accent);
    color: var(--pill-yes-text);
  }
  .toggle-btn:hover:not(.active) { border-color: #3a3a3a; color: var(--text); }
  .reset-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.3rem 0.8rem;
    border-radius: 7px;
    font-size: 0.8rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto;
  }
  .reset-btn:hover { border-color: #3a3a3a; color: var(--text); }

  .main {
    display: flex;
    flex: 1;
    overflow: hidden;
  }

  #map { flex: 1; min-width: 0; }

  /* ── Map Controls Panel ── */
  #map-controls {
    position: absolute;
    bottom: 30px;
    left: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }
  .map-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    color: #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    flex-shrink: 0;
  }
  .map-ctrl-btn:hover { background: #2a2a2a; border-color: #95ca24; }
  .map-ctrl-btn.locating { border-color: #95ca24; color: #95ca24; animation: locate-spin 1s linear infinite; }
  .map-ctrl-btn.active   { background: #1a2a00; border-color: #95ca24; color: #95ca24; }
  .map-ctrl-btn.satellite-on { background: #101a28; border-color: #4a9eff; color: #4a9eff; }
  @keyframes locate-spin { to { transform: rotate(360deg); } }

  #map-scale {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 8px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 64px;
  }
  #map-scale-bar { height: 3px; background: #95ca24; border-radius: 2px; width: 60px; transition: width 0.3s; }
  #map-scale-label { font-size: 0.65rem; color: #9e9e9e; font-family: 'DM Sans', sans-serif; white-space: nowrap; }

  .user-location-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #4a9eff;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(74,158,255,0.4);
    position: relative;
  }
  .user-location-dot::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(74,158,255,0.25);
    animation: location-pulse 2s ease-out infinite;
  }
  @keyframes location-pulse {
    0%   { transform: translate(-50%,-50%) scale(0.5); opacity: 1; }
    100% { transform: translate(-50%,-50%) scale(2);   opacity: 0; }
  }

  /* Override cluster colours to match theme */
  .marker-cluster-small { background-color: rgba(180,180,180,0.15); }
  .marker-cluster-small div { background-color: rgba(140,140,140,0.7); color: #fff; font-family: 'DM Sans',sans-serif; font-size: 0.75rem; }
  .marker-cluster-medium { background-color: rgba(180,180,180,0.15); }
  .marker-cluster-medium div { background-color: rgba(140,140,140,0.7); color: #fff; font-family: 'DM Sans',sans-serif; font-size: 0.75rem; }
  .marker-cluster-large { background-color: rgba(180,180,180,0.15); }
  .marker-cluster-large div { background-color: rgba(140,140,140,0.7); color: #fff; font-family: 'DM Sans',sans-serif; font-size: 0.75rem; }

  .marker-cluster, .marker-cluster *, .marker-cluster:focus, .marker-cluster:hover,
  .marker-cluster:focus-visible, .marker-cluster div, .marker-cluster div:focus,
  .marker-cluster div:hover, .marker-cluster div:focus-visible,
  .leaflet-marker-icon, .leaflet-marker-icon:focus, .leaflet-marker-icon:hover,
  .leaflet-marker-icon:focus-visible, .leaflet-interactive:focus, .leaflet-interactive:hover {
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .cards-panel {
    width: 380px;
    flex-shrink: 0;
    background: var(--bg);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .cards-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
  }
  .cards-scroll::-webkit-scrollbar { width: 4px; }
  .cards-scroll::-webkit-scrollbar-track { background: transparent; }
  .cards-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  .card-img-wrap {
    width: 100%;
    height: 110px;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 0.6rem;
    background: var(--surface2);
    position: relative;
    flex-shrink: 0;
  }
  .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.4s;
  }
  .card-img-wrap img.loaded { opacity: 1; }
  .card-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    opacity: 0.15;
    transition: opacity 0.3s;
  }
  .card-img-wrap.has-img .card-img-placeholder { opacity: 0; }
  .card-img-attribution {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.55);
    font-size: 0.58rem;
    padding: 0.1rem 0.35rem;
    border-radius: 4px 0 0 0;
    text-decoration: none;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .lake-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
  }
  .lake-card:hover { border-color: var(--accent); background: var(--surface2); }
  .lake-card.selected { border-color: var(--accent2); background: var(--surface2); }
  .card-name {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 0.25rem;
    line-height: 1.3;
  }
  .card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.5rem;
  }
  .card-meta span { color: var(--muted); }
  .card-meta .dist-calais { color: var(--muted); font-size: 0.8rem; }
  .card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
  }
  .pill {
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
  }
  .pill.yes { background: var(--pill-yes); color: var(--pill-yes-text); }
  .pill.no { background: var(--pill-no); color: var(--pill-no-text); }
  .pill.partial { background: var(--pill-partial); color: var(--pill-partial-text); }
  .pill.type { background: var(--surface2); color: var(--muted); }
  .pill.carp { background: #1e2d1a; color: #8fbe5a; border: 1px solid #3a5a28; }
  .card-species {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
  }
  .card-rules {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
  .card-rule {
    font-size: 0.8rem;
    color: var(--muted);
    line-height: 1.4;
    display: flex;
    gap: 0.35rem;
  }
  .card-rule span { color: var(--text); }
  .night-sectors-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.15rem;
  }
  .night-sector-permit {
    color: var(--muted);
    font-size: inherit;
  }
  .card-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
  }
  .card-link {
    font-size: 0.78rem;
    color: var(--muted) !important;
    text-decoration: none !important;
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.15s;
  }
  .card-link:hover { background: var(--surface2); border-color: var(--accent); color: var(--text) !important; }
  .card-link.licence { color: var(--muted) !important; }

  .card-weather {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
  }
  .weather-now {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    margin-bottom: 0.4rem;
    align-items: center;
  }
  .weather-now .wval { color: var(--text); font-weight: 500; }
  .weather-forecast { display: flex; gap: 0.3rem; }
  .wday {
    flex: 1;
    background: var(--surface2);
    border-radius: 5px;
    padding: 0.25rem 0.3rem;
    text-align: center;
    font-size: 0.74rem;
    line-height: 1.5;
  }
  .wday .wday-name { color: var(--muted); }
  .wday .wday-icon { font-size: 1rem; display: block; }
  .wday .wday-temp { color: var(--text); font-weight: 500; }
  .wday .wday-rain { color: #9e9e9e; }
  .weather-loading { color: var(--muted); font-size: 0.68rem; font-style: italic; }

  /* ── Draggable floating popup panels ── */
  .drag-popup {
    position: absolute;
    z-index: 800;
    width: 380px;
    background: var(--card-bg);
    border: 2px solid var(--accent);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.15s;
  }
  .drag-popup.dragging { box-shadow: 0 16px 48px rgba(0,0,0,0.7); }
  .drag-popup-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.4rem 0.15rem 0.75rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
  }
  .drag-popup-handle:active { cursor: grabbing; }
  .drag-popup-handle-label {
    visibility: hidden;
    width: 0;
    overflow: hidden;
    flex-shrink: 0;
  }
  .drag-popup-handle-dots {
    color: var(--muted);
    opacity: 0.4;
    font-size: 0.85rem;
    letter-spacing: 2px;
    line-height: 1;
    flex: 1;
  }
  .drag-popup-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    font-size: 0.78rem;
    transition: color 0.15s;
    flex-shrink: 0;
  }
  .drag-popup-close:hover { color: var(--text); }
  .drag-popup-body {
    padding: 0.85rem;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  .drag-popup-body::-webkit-scrollbar { width: 4px; }
  .drag-popup-body::-webkit-scrollbar-track { background: transparent; }
  .drag-popup-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

  .popup-weather {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
  }
  .popup-weather .weather-now { gap: 0.3rem 0.6rem; }
  .popup-weather .weather-forecast { gap: 0.3rem; }
  .popup-weather .wday { font-size: 0.75rem; }
  .leaflet-popup-content-wrapper {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  .leaflet-popup-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
  @media (max-width: 700px) {
    .leaflet-popup-content { max-height: calc(100vh - 280px); }
  }

  /* ── Mobile bottom sheet ── */
  .mobile-sheet-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.22s;
  }
  .mobile-sheet-backdrop.open { opacity: 1; }
  .mobile-sheet {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1001;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    max-height: 78vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 env(safe-area-inset-bottom, 0.5rem);
  }
  .mobile-sheet.open { transform: translateY(0); }
  .mobile-sheet-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem 0.5rem;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    z-index: 1;
  }
  .mobile-sheet-drag {
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto;
    flex: 1;
  }
  .mobile-sheet-close {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
  }
  .mobile-sheet-close:hover { border-color: var(--accent); color: var(--text); }
  .mobile-sheet-content {
    padding: 0.6rem 0.85rem 0;
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
  }
  @media (min-width: 701px) {
    .mobile-sheet-backdrop, .mobile-sheet { display: none !important; }
  }

  .leaflet-popup-tip { background: var(--surface); }
  .popup-name { display: none; }
  /* Meta rows — muted text, spans also muted to kill inline accent colours */
  .popup-row {
    font-size: 0.8rem;
    color: var(--muted) !important;
    margin: 0 0 0.5rem 0;
    display: block;
    line-height: 1.4;
  }
  /* For rule-type rows (Night sector, Electric motors) the span is the value — make it white like card-rule span */
  .popup-row span { color: var(--text) !important; }
  /* But kill accent on the meta spans that app.js colours green (acres, distance) via inline style */
  .popup-row span[style*="color"] { color: var(--muted) !important; }
  .popup-links {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
  }
  .popup-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--muted) !important;
    text-decoration: none !important;
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    transition: all 0.15s;
  }
  .popup-link:hover { border-color: var(--accent); color: var(--text) !important; }

  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--muted);
    font-size: 0.9rem;
    gap: 0.5rem;
    text-align: center;
    padding: 2rem;
  }
  .empty-state .fish-icon { font-size: 2.5rem; opacity: 0.4; }

  .lake-dot {
    width: 9px; height: 9px;
    background: var(--accent);
    border: 2px solid rgba(149,202,36,0.25);
    border-radius: 50%;
  }
  .lake-dot.selected {
    background: var(--accent);
    border-color: rgba(149,202,36,0.35);
    width: 13px; height: 13px;
  }
  .satellite-mode .lake-dot { background: #ffffff; border-color: rgba(255,255,255,0.35); }
  .satellite-mode .lake-dot.selected { background: #ffffff; border-color: rgba(255,255,255,0.5); }

  /* ── Mobile tab bar ── */
  .mobile-tabs {
    display: none;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .mobile-tab {
    flex: 1;
    padding: 0.6rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.73rem;
    cursor: pointer;
    transition: all 0.15s;
  }
  .mobile-tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }

  /* ── Card action buttons ── */
  .card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid var(--border);
  }
  .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.38rem 0.5rem;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
    user-select: none;
  }
  @media (max-width: 700px) {
    .action-btn { font-size: 0.78rem; padding: 0.3rem 0.2rem; gap: 0.15rem; }
  }
  .action-btn:hover { border-color: var(--accent); color: var(--text); }
  .action-btn.fav-active  { background: #1a2a00; border-color: var(--accent); color: var(--accent); }
  .action-btn.short-active { background: #0d2a1e; border-color: var(--accent); color: var(--pill-yes-text); }
  .action-btn.review-btn  { border-color: var(--border); }
  .action-btn.review-btn:hover { border-color: #9e9e9e; color: #9e9e9e; }
  .action-btn.suggest-btn { border-color: var(--border); }
  .action-btn.suggest-btn:hover { border-color: var(--accent2); color: var(--accent2); }
  .action-btn .review-count {
    background: var(--surface);
    border-radius: 99px;
    padding: 0 0.3rem;
    font-size: 0.76rem;
    color: var(--muted);
    min-width: 16px;
    text-align: center;
  }

  /* ── Header icons ── */
  .header-icons {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    align-items: center;
  }
  .hdr-icon-btn {
    position: relative;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 36px; height: 36px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
  }
  .hdr-icon-btn:hover {
    border-color: #3a3a3a;
    color: var(--text);
    background: var(--surface2);
  }
  .toggle-btn svg, .mobile-tab svg, .action-btn svg,
  .hdr-icon-btn svg, .card-link svg, .popup-link svg { vertical-align: middle; flex-shrink: 0; }
  .toggle-btn { display: inline-flex; align-items: center; gap: 0.4rem; }
  .mobile-tab { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; }
  .card-link  { display: inline-flex; align-items: center; gap: 0.3rem; }
  .popup-link { display: inline-flex; align-items: center; gap: 0.3rem; }
  .toggle-btn svg { transition: all 0.2s ease; }
  .hdr-icon-btn svg { color: var(--muted); transition: color 0.15s; }
  .hdr-icon-btn:hover svg { color: var(--text); }
  .card-link, .popup-link { transition: all 0.15s; }
  .hdr-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--accent2);
    color: #000000;
    font-size: 0.55rem;
    font-weight: 700;
    border-radius: 99px;
    padding: 0.05rem 0.3rem;
    min-width: 16px;
    text-align: center;
    display: none;
  }
  .hdr-badge.visible { display: block; }

  /* ── Side drawer ── */
  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .drawer-overlay.open { opacity: 1; pointer-events: all; }
  .drawer {
    position: fixed;
    top: 0; right: 0;
    width: min(420px, 100vw);
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    z-index: 501;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s cubic-bezier(.4,0,.2,1);
    box-shadow: -8px 0 40px rgba(0,0,0,0.4);
  }
  .drawer.open { transform: translateX(0); }
  .drawer-header {
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    height: 56px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 0.75rem;
  }
  .drawer-title {
    font-family: 'DM Sans', sans-serif; font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent2);
    flex: 1;
  }
  .drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .drawer-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }
  .drawer-tab .tab-badge {
    background: var(--surface2);
    border-radius: 99px;
    padding: 0 0.35rem;
    font-size: 0.65rem;
    color: var(--muted);
  }
  .drawer-tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
  .drawer-tab.active .tab-badge { background: rgba(149,202,36,0.15); color: var(--accent2); }
  .drawer-body { flex: 1; overflow-y: auto; padding: 0.75rem; }
  .drawer-body::-webkit-scrollbar { width: 4px; }
  .drawer-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--muted);
    font-size: 0.85rem;
    gap: 0.5rem;
    text-align: center;
  }
  .drawer-empty .di { font-size: 2rem; opacity: 0.3; }
  .drawer-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s;
    line-height: 1;
  }
  .drawer-close:hover { color: var(--text); }

  .mini-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .mini-card:hover { border-color: var(--accent); }
  .mini-card-header { display:flex; gap: 0.75rem; align-items: flex-start; }
  .mini-card-info { flex: 1; min-width: 0; }
  .mini-card-name {
    font-family: 'DM Sans', sans-serif; font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mini-card-meta { font-size: 0.72rem; color: var(--muted); }
  .mini-card-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
  }
  .mini-card-remove:hover { color: var(--pill-no-text); }

  /* ── Modals ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .modal-overlay.open { opacity: 1; pointer-events: all; }
  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: min(480px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: translateY(12px);
    transition: transform 0.2s;
  }
  .modal-overlay.open .modal { transform: translateY(0); }
  .modal-header {
    display: flex;
    align-items: flex-start;
    padding: 1.1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border);
    gap: 0.75rem;
  }
  .modal-title { font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 0.95rem; color: var(--text); flex: 1; line-height: 1.3; }
  .modal-subtitle { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
  .modal-body { flex: 1; overflow-y: auto; padding: 1rem 1.25rem; }
  .modal-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; justify-content: flex-end; }
  .modal-btn {
    padding: 0.45rem 1rem;
    border-radius: 7px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
  }
  .modal-btn:hover { border-color: #3a3a3a; }
  .modal-btn.primary { background: var(--accent); border-color: var(--accent); color: #000000; font-weight: 600; }
  .modal-btn.primary:hover { opacity: 0.88; }

  .star-row { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
  .star { font-size: 1.6rem; cursor: pointer; opacity: 0.25; transition: opacity 0.1s, transform 0.1s; line-height: 1; }
  .star.lit { opacity: 1; }
  .star:hover { transform: scale(1.15); }

  .review-field-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.35rem;
  }
  .review-textarea {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    resize: vertical;
    min-height: 90px;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 0.85rem;
  }
  .review-textarea:focus { border-color: var(--accent); }
  .review-tag-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.85rem; }
  .review-tag {
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
  }
  .review-tag.selected { background: var(--pill-yes); border-color: var(--accent); color: var(--pill-yes-text); }

  .review-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.5rem;
  }
  .review-item-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
  .review-item-name {
    font-family: 'DM Sans', sans-serif; font-weight: 600;
    font-size: 0.82rem; color: var(--text); flex: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .review-stars { font-size: 0.75rem; letter-spacing: 0.05em; }
  .review-item-tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 0.4rem; }
  .review-item-tag { font-size: 0.68rem; padding: 0.1rem 0.4rem; border-radius: 99px; background: var(--pill-yes); color: var(--pill-yes-text); }
  .review-item-text { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
  .review-item-date { font-size: 0.68rem; color: var(--muted); opacity: 0.6; margin-top: 0.3rem; }
  .review-item-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 0 0.2rem; transition: color 0.15s; opacity: 0.5; }
  .review-item-remove:hover { color: var(--pill-no-text); opacity: 1; }

  @media (max-width: 700px) {
    body { overflow: hidden; }
    header { padding: 0 0.5rem; height: 90px; gap: 0.25rem; }
    .logo { flex-shrink: 0; }
    .logo svg { height: 24px; width: auto; }
    .logo-img { height: 70px !important; padding: 10px 0; width: auto; }
    .result-count { display: none; }
    /* Hide the 3 icon buttons on mobile — accessed via drawer anyway */
    .hdr-icon-btn { display: none; }
    .header-icons { gap: 0.25rem; margin-left: 0; }
    .map-nav { display:none; }
    .map-burger { display:flex; }
    .header-search { width: 90px; margin-left: auto; flex-shrink: 1; min-width: 0; }
    .header-search-input { font-size: 0.7rem; padding-left: 1.6rem; }

    .filters { padding: 0.4rem 0.6rem; gap: 0.25rem 0.25rem; row-gap: 0.2rem; flex-wrap: wrap; overflow-x: visible; position: relative; }
    .filters.filters-collapsed { padding: 0; gap: 0; }
    .filters.filters-collapsed > *:not(.filter-drag-handle) { display: none; }
    .filter-drag-handle { width: 100%; display: flex; justify-content: center; align-items: center; padding: 3px 0; cursor: pointer; background: var(--surface); border-top: 1px solid var(--border); }
    .filters.filters-collapsed .filter-drag-handle { border-top: none; border-bottom: 1px solid var(--border); }
    .filter-drag-pip { color: var(--muted); opacity: 0.6; transition: transform 0.2s; display: flex; align-items: center; }
    .filter-label { display: none; }
    .filter-group { flex-shrink: 0; gap: 0; }
    .filter-group select { font-size: 0.73rem; padding: 0.3rem 0.2rem; width: calc(33.33vw - 0.65rem); box-sizing: border-box; }
    .filter-break { display: block; width: 100%; height: 0; }
    .filter-group:has(#f-species) { flex: 2 1 0; min-width: 0; }
    #f-species { width: 100%; }
    .filters input[type=number] { width: calc(25vw - 0.65rem); font-size: 0.73rem; padding: 0.3rem 0.2rem; box-sizing: border-box; }
    #f-night { flex: 1; font-size: 0.73rem; padding: 0.3rem 0.4rem; }
    #f-boats, #f-bivouac { flex: 1; font-size: 0.73rem; padding: 0.3rem 0.4rem; }
    .reset-btn { font-size: 0.73rem; padding: 0.3rem 0.5rem; margin-left: 0; flex-shrink: 0; }
    .mobile-tabs { display: flex; }
    #map-controls { bottom: 70px; }
    .main { flex-direction: column; }
    #map { flex: 1; min-height: 0; display: none; }
    #map.tab-active { display: block; }
    .cards-panel { width: 100%; border-left: none; border-top: 1px solid var(--border); flex: 1; min-height: 0; display: none; }
    .cards-panel.tab-active { display: flex; }
    .popup-name { font-size: 0.95rem; }
    .popup-row  { font-size: 0.8rem; }
    .popup-link { font-size: 0.78rem; }
  }

/* ═══════════════════════════════════════════════════════════════════
   Auth & membership CSS
   ═══════════════════════════════════════════════════════════════════ */

.hdr-auth-btn {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 7px;
  height: 36px;
  padding: 0 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.hdr-auth-btn:hover { opacity: 0.85; }

.hdr-upgrade-btn {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 7px;
  height: 36px;
  padding: 0 0.85rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.hdr-upgrade-btn:hover { background: rgba(149,202,36,0.1); }

.hdr-logout-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  height: 36px;
  padding: 0 0.75rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.hdr-logout-btn:hover { color: var(--text); border-color: var(--muted); }

.user-menu { position: relative; }
.user-menu-logout {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 7px;
  height: 36px;
  padding: 0 0.65rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.user-menu-logout:hover { color: var(--text); border-color: #3a3a3a; }

.upgrade-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
}
.ub-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.ub-title-full {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}
.ub-title-mobile { display: none; }
.ub-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.25rem;
  vertical-align: middle;
  flex-shrink: 0;
}
.ub-feat {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.ub-price {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.ub-price strong { color: var(--text); font-weight: 500; }
.ub-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.ub-btn {
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 7px;
  padding: 0.35rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.ub-btn:hover { opacity: 0.88; }
.ub-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0.2rem 0.3rem;
  transition: color 0.15s;
  white-space: nowrap;
}
.ub-dismiss:hover { color: var(--text); }
.ub-title-mobile { display: none; }

.auth-tabs { display: flex; gap: 0.25rem; }
.auth-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem 0.4rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab:hover  { color: var(--text); }
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-error {
  font-size: 0.78rem;
  color: #e05555;
  min-height: 1rem;
  margin-bottom: 0.25rem;
}

/* ── Mobile header & banner fixes ───────────────────────────────── */
@media (max-width: 700px) {
  /* Header — hide upgrade button so logo fits */
  #upgrade-btn { display: none !important; }
  .hdr-auth-btn { font-size: 0.68rem; padding: 0 0.5rem; height: 30px; white-space: nowrap; flex-shrink: 0; }
  .user-menu-logout { font-size: 0.68rem; padding: 0 0.5rem; height: 30px; white-space: nowrap; flex-shrink: 0; }

  /* Banner — wrap to two rows on mobile */
  .upgrade-banner { padding: 0.25rem 0.75rem; gap: 0.2rem; flex-wrap: wrap; }
  .ub-text { gap: 0.25rem 0.5rem; flex-wrap: wrap; line-height: 1.3; }
  .ub-title-full { display: none; }
  .ub-title-mobile { display: inline; font-size: 0.72rem; color: var(--accent); font-weight: 500; white-space: nowrap; }
  .ub-feat { font-size: 0.72rem; }
  .ub-feat-hide { display: flex; }
  .ub-price { display: flex; font-size: 0.72rem; }
  .ub-btn { padding: 0.25rem 0.75rem; font-size: 0.75rem; }
  .ub-dismiss { font-size: 0.68rem; }
  .ub-actions { flex-shrink: 0; gap: 0.35rem; }
}
