
:root {
    --bg: #f2f2f7;
    --surface: rgba(255,255,255,.88);
    --surface-solid: #ffffff;
    --surface-2: #f7f7f8;
    --text: #111111;
    --text-2: #3a3a3c;
    --muted: #8e8e93;
    --separator: rgba(60,60,67,.16);
    --primary: #007aff;
    --primary-pressed: #006ee6;
    --danger: #ff3b30;
    --shadow: 0 10px 35px rgba(0,0,0,.13);
    --shadow-small: 0 4px 18px rgba(0,0,0,.10);
    --radius: 20px;
    --input: #f2f2f7;
}

html[data-theme="dark"] {
    --bg: #000000;
    --surface: rgba(28,28,30,.88);
    --surface-solid: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --text-2: #d1d1d6;
    --muted: #98989f;
    --separator: rgba(84,84,88,.65);
    --primary: #0a84ff;
    --primary-pressed: #409cff;
    --danger: #ff453a;
    --shadow: 0 14px 45px rgba(0,0,0,.45);
    --shadow-small: 0 5px 20px rgba(0,0,0,.35);
    --input: #2c2c2e;
}

* { box-sizing: border-box; }
html, body { margin:0; width:100%; height:100%; overflow:hidden; background:var(--bg); color:var(--text); }
body {
    font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    -webkit-font-smoothing:antialiased;
    letter-spacing:-.01em;
}
button,input,select,textarea { font:inherit; }

.topbar {
    height:58px;
    padding:0 16px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    background:var(--surface);
    border-bottom:1px solid var(--separator);
    backdrop-filter:saturate(180%) blur(22px);
    -webkit-backdrop-filter:saturate(180%) blur(22px);
    position:relative;
    z-index:2000;
}
.brand { display:flex; align-items:center; gap:9px; font-size:17px; font-weight:750; cursor:pointer; }
.brand-mark { width:29px; height:29px; display:grid; place-items:center; background:var(--primary); color:white; border-radius:9px; font-size:16px; }
.desktop-nav { display:flex; gap:3px; }
.desktop-nav a { color:var(--muted); text-decoration:none; padding:8px 11px; border-radius:10px; font-size:13px; font-weight:600; }
.desktop-nav a:hover { background:rgba(118,118,128,.12); color:var(--text); }
.top-actions { display:flex; align-items:center; gap:7px; }
.admin-badge{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;padding:2px 6px;border-radius:6px;background:#ef4444;color:#fff;font-size:.68em;font-weight:850;letter-spacing:.35px;line-height:1.15;text-transform:uppercase;box-shadow:0 1px 6px rgba(239,68,68,.18);margin-right:5px}.admin-badge + .you-badge{margin-left:2px}
.user-name { max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; font-weight:700; }
.logout-form { margin:0; }
.icon-btn,.glass-icon {
    width:36px; height:36px; border:0; border-radius:50%;
    display:grid; place-items:center; cursor:pointer;
    background:rgba(118,118,128,.12); color:var(--text);
    backdrop-filter:blur(15px); -webkit-backdrop-filter:blur(15px);
    font-size:17px;
}
.icon-btn:active,.glass-icon:active,.filter:active,.floating-add:active { transform:scale(.96); }

.map-page { height:calc(100vh - 58px); height:calc(100dvh - 58px); position:relative; background:var(--bg); }
#map { width:100%; height:100%; background:var(--bg); }
.leaflet-container { font-family:inherit; background:var(--bg); }
.leaflet-tile { max-width:none !important; }
/* The base OSM tiles are transformed as a whole pane in dark mode.
   This is more reliable than putting filters on individual tile images. */
/* Graphite Night — мягкая ночная палитра карты без API-ключей.
   OSM остаётся источником тайлов, фильтр меняет только их внешний вид. */
#map.dark-map .leaflet-tile-pane {
    filter: invert(0.88) hue-rotate(178deg) brightness(.72) contrast(1.16) saturate(.62);
}

/* Чуть сильнее отделяем карту от интерфейса, как в Graphite Night. */
html[data-theme="dark"] #map {
    background:#111315;
}
html[data-theme="dark"] .leaflet-control-attribution {
    background:rgba(17,19,21,.82) !important;
    color:#8d939a !important;
}
html[data-theme="dark"] .leaflet-control-attribution a {
    color:#aeb5bd !important;
}
/* leaflet-rotate@0.2.8 injects its own compass control. Fish Map has a
   dedicated north-reset control, so never show the plugin's extra button. */
.leaflet-control-rotate { display:none !important; }

/* Prevent mobile browser edge-swipe/overscroll UI from competing with map
   gestures. */
html, body { overscroll-behavior: none; }
.map-page, #map { overscroll-behavior: none; }

.leaflet-control-zoom {
    border:0 !important; box-shadow:var(--shadow-small) !important; border-radius:13px !important; overflow:hidden;
}
.leaflet-control-zoom a {
    width:38px !important; height:38px !important; line-height:38px !important;
    border:0 !important; color:var(--text) !important; background:var(--surface) !important;
}
.leaflet-control-zoom a+a { border-top:1px solid var(--separator) !important; }


.map-controls { position:absolute; right:14px; bottom:78px; z-index:700; }
.floating-add {
    border:0; border-radius:15px; min-height:46px; padding:0 16px;
    background:var(--primary); color:white; box-shadow:var(--shadow-small);
    font-size:14px; font-weight:700; cursor:pointer;
}
.floating-add span { font-size:18px; vertical-align:-1px; margin-right:4px; }

.filter-bar {
    position:absolute; left:10px; right:10px; bottom:10px; z-index:700;
    display:flex; gap:7px; overflow-x:auto; padding:2px 2px 5px;
    scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.filter-bar::-webkit-scrollbar { display:none; }
.filter {
    flex:0 0 auto; border:1px solid rgba(255,255,255,.35);
    background:var(--surface); color:var(--text); padding:9px 13px;
    border-radius:20px; box-shadow:var(--shadow-small); cursor:pointer;
    font-size:13px; font-weight:650; white-space:nowrap;
    backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px);
}
.filter.active { background:var(--text); color:var(--bg); }

.fish-marker-wrap { background:transparent !important; border:0 !important; }
.fish-marker {
    position:relative;
    width:42px; height:50px;
    display:grid; place-items:center;
    background:var(--primary);
    color:#fff;
    border:3px solid rgba(255,255,255,.96);
    border-radius:50% 50% 50% 7%;
    transform:rotate(-45deg);
    box-shadow:0 5px 16px rgba(0,0,0,.28);
    transition:transform .15s ease, box-shadow .15s ease;
}
.fish-marker::after {
    content:"";
    position:absolute;
    width:12px; height:12px;
    left:50%; top:50%;
    transform:translate(-50%,-50%);
    border-radius:50%;
    background:rgba(255,255,255,.96);
}
.fish-marker span {
    position:relative;
    z-index:1;
    font-size:17px;
    line-height:1;
    transform:rotate(45deg);
    filter:grayscale(1) brightness(0) invert(1);
}
.leaflet-marker-icon:hover .fish-marker {
    transform:rotate(-45deg) scale(1.08);
    box-shadow:0 7px 20px rgba(0,0,0,.34);
}

.location-dot-wrap { background:transparent !important; border:0 !important; }
.location-dot {
    position:relative; width:18px; height:18px; border-radius:50%;
    display:block; background:var(--primary); border:3px solid #fff;
    box-shadow:0 2px 9px rgba(0,0,0,.30), 0 0 0 4px rgba(0,122,255,.16);
}
.location-dot::before, .location-dot::after {
    content:""; position:absolute; inset:-8px; border:1.5px solid var(--primary);
    border-radius:50%; opacity:0; animation:location-pulse 2.2s ease-out infinite;
}
.location-dot::after { animation-delay:1.1s; }
.location-dot i { position:absolute; inset:3px; border-radius:50%; background:#fff; opacity:.95; }
@keyframes location-pulse {
    0% { transform:scale(.45); opacity:.42; }
    70% { transform:scale(1); opacity:0; }
    100% { transform:scale(1.05); opacity:0; }
}
.location-accuracy { fill:var(--primary); fill-opacity:.07; stroke:var(--primary); stroke-opacity:.22; stroke-width:1; }
.map-locate.is-loading { opacity:.7; pointer-events:none; }
.map-locate.is-active { box-shadow:0 0 0 3px rgba(0,122,255,.22), var(--shadow-small); }
.map-locate.is-tracking { color:var(--primary); }
.visually-hidden-file {
    position:absolute !important; width:1px !important; height:1px !important;
    padding:0 !important; margin:-1px !important; overflow:hidden !important;
    clip:rect(0,0,0,0) !important; white-space:nowrap !important;
    border:0 !important; opacity:0 !important; pointer-events:none !important;
}
.avatar-upload-btn { cursor:pointer; }

/* Profile avatar: keep uploaded photo inside the intended circular frame. */
.profile-mini {
    width:40px;
    height:40px;
    flex:0 0 40px;
    display:grid;
    place-items:center;
    overflow:hidden;
    border-radius:50%;
    background:var(--input);
    color:var(--primary);
    text-decoration:none;
    line-height:1;
}
.profile-mini img {
    display:block;
    width:100%;
    height:100%;
    max-width:100%;
    max-height:100%;
    object-fit:cover;
    object-position:center;
    border-radius:50%;
}
.profile-mini span {
    display:grid;
    place-items:center;
    width:100%;
    height:100%;
}


.map-search {
    position:absolute;
    left:14px;
    top:14px;
    width:min(390px, calc(100% - 28px));
    z-index:900;
}
.map-search-box {
    height:48px;
    display:flex;
    align-items:center;
    gap:8px;
    padding:0 10px 0 14px;
    border:1px solid var(--separator);
    border-radius:16px;
    background:var(--surface);
    box-shadow:var(--shadow-small);
    backdrop-filter:saturate(180%) blur(22px);
    -webkit-backdrop-filter:saturate(180%) blur(22px);
}
.map-search-box:focus-within {
    border-color:rgba(0,122,255,.42);
    box-shadow:0 7px 25px rgba(0,0,0,.14), 0 0 0 3px rgba(0,122,255,.10);
}
.map-search-box input {
    min-width:0;
    height:100%;
    margin:0;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none !important;
    font-size:14px;
}
.search-icon {
    flex:0 0 auto;
    color:var(--muted);
    font-size:23px;
    line-height:1;
    transform:rotate(-20deg);
}
.search-clear {
    flex:0 0 auto;
    width:28px;
    height:28px;
    border:0;
    border-radius:50%;
    background:var(--input);
    color:var(--muted);
    cursor:pointer;
    font-size:19px;
    line-height:1;
}
.search-results {
    margin-top:7px;
    overflow:hidden;
    border:1px solid var(--separator);
    border-radius:16px;
    background:var(--surface-solid);
    box-shadow:var(--shadow);
    backdrop-filter:blur(20px);
    -webkit-backdrop-filter:blur(20px);
}
.search-result {
    width:100%;
    display:flex;
    align-items:center;
    gap:10px;
    padding:11px 12px;
    border:0;
    border-bottom:1px solid var(--separator);
    background:transparent;
    color:var(--text);
    text-align:left;
    cursor:pointer;
}
.search-result:last-child { border-bottom:0; }
.search-result:hover { background:var(--input); }
.search-result-pin {
    flex:0 0 auto;
    width:30px; height:30px;
    display:grid; place-items:center;
    border-radius:10px;
    background:rgba(0,122,255,.11);
    color:var(--primary);
    font-size:17px;
}
.search-result-copy { min-width:0; flex:1; }
.search-result-copy b {
    display:block;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:13px;
}
.search-result-copy small {
    display:block;
    margin-top:2px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:var(--muted);
    font-size:11px;
}
.search-result-arrow { color:var(--muted); font-size:22px; }
.search-empty { padding:16px; color:var(--muted); text-align:center; font-size:13px; }

.map-controls {
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:8px;
}
.map-locate {
    width:42px;
    height:42px;
    border-radius:14px;
    font-size:20px;
}

.modal {
    position:fixed; inset:0; z-index:3000;
    background:rgba(0,0,0,.32);
    display:flex; align-items:center; justify-content:center; padding:16px;
    backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px);
}
.hidden { display:none !important; }
.modal-card {
    width:min(580px,100%); max-height:calc(100vh - 32px); max-height:calc(100dvh - 32px);
    overflow-y:auto; padding:21px; border-radius:24px;
    background:var(--surface-solid); color:var(--text);
    box-shadow:0 25px 80px rgba(0,0,0,.28);
    -webkit-overflow-scrolling:touch;
}
.sheet-grabber { display:none; width:36px; height:5px; border-radius:10px; background:var(--muted); opacity:.45; margin:0 auto 14px; }
.modal-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:16px; }
.modal-head h2 { margin:2px 0 0; font-size:26px; line-height:1.05; letter-spacing:-.04em; }
.eyebrow { color:var(--primary); font-size:10px; font-weight:800; letter-spacing:.10em; }
.close { border:0; width:34px; height:34px; border-radius:50%; background:var(--input); color:var(--text-2); font-size:23px; cursor:pointer; line-height:1; }

.form-section { padding:14px 0; border-top:1px solid var(--separator); }
.section-title { font-size:14px; font-weight:750; margin-bottom:7px; }
label { display:block; font-size:13px; font-weight:600; color:var(--text-2); margin:10px 0; }
input,select,textarea {
    display:block; width:100%; margin-top:6px; padding:12px 13px;
    border:1px solid transparent; border-radius:12px; outline:0;
    background:var(--input); color:var(--text);
    transition:.15s ease; -webkit-appearance:none; appearance:none;
}
select {
    background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
    background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%;
    background-size:5px 5px,5px 5px; background-repeat:no-repeat; padding-right:35px;
}
input:focus,select:focus,textarea:focus { border-color:rgba(0,122,255,.55); background:var(--surface-solid); box-shadow:0 0 0 3px rgba(0,122,255,.12); }
textarea { resize:vertical; min-height:86px; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.coords { padding:10px 12px; border-radius:12px; background:var(--input); color:var(--muted); font-size:12px; }
.custom-input { margin-top:7px; }
.submit-btn {
    width:100%; border:0; background:var(--primary); color:white;
    padding:13px 16px; border-radius:13px; font-weight:750; cursor:pointer;
    margin-top:11px; transition:transform .1s,background .15s;
}
.submit-btn:hover { background:var(--primary-pressed); }
.submit-btn:disabled { opacity:.55; }
.error { background:rgba(255,59,48,.10); color:var(--danger); border-radius:12px; padding:10px 12px; margin-top:10px; font-size:13px; }
.detail-coords { color:var(--muted); font-size:12px; }
.detail-description { color:var(--text-2); }
.detail-actions { display:flex; gap:8px; margin:15px 0; }
.detail-actions .submit-btn { margin:0; }
.danger-btn,.delete-catch { border:0; background:rgba(255,59,48,.10); color:var(--danger); padding:11px 13px; border-radius:12px; cursor:pointer; font-weight:650; }
.session { border-top:1px solid var(--separator); padding-top:15px; margin-top:15px; }
.session-date { font-size:14px; font-weight:750; margin-bottom:9px; }
.conditions { display:flex; flex-wrap:wrap; gap:7px; margin:7px 0 10px; }
.condition-chip { display:flex; flex-direction:column; gap:2px; padding:7px 9px; border-radius:10px; background:var(--input); color:var(--text-2); font-size:11px; }
.condition-chip b { color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.05em; }
.session-comment { color:var(--text-2); font-size:13px; margin:8px 0; }
.detail-catch { background:var(--input); border-radius:15px; padding:13px; margin-top:10px; }
.detail-catch-title { font-size:17px; font-weight:800; }
.catch-values { display:flex; flex-wrap:wrap; gap:7px; margin:7px 0; }
.catch-values span { background:rgba(0,122,255,.10); color:var(--primary); padding:5px 8px; border-radius:8px; font-size:12px; font-weight:700; }
.bait-line { font-size:13px; }
.photo-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin:10px 0; }
.photo-grid img { width:100%; aspect-ratio:1; object-fit:cover; border-radius:10px; cursor:pointer; }

.content-page {
    height:calc(100vh - 58px); height:calc(100dvh - 58px);
    overflow-y:auto; max-width:1100px; margin:0 auto; padding:28px 18px 50px;
}
.page-title { display:flex; justify-content:space-between; align-items:center; gap:15px; margin-bottom:22px; }
.page-title h1 { margin:0; font-size:32px; letter-spacing:-.04em; }
.page-title p { color:var(--muted); margin:5px 0 0; }
.catch-list { display:grid; gap:12px; }
.weather-auto-status{min-height:18px;margin:7px 0 4px;color:var(--muted);font-size:11px;line-height:1.35}.weather-auto-status.ready{color:#34c759}.weather-auto-status.error{color:var(--danger)}.weather-auto-status small{opacity:.75}
.catch-card {
    background:var(--surface); border:1px solid var(--separator); border-radius:17px; padding:10px;
    display:flex; gap:13px; box-shadow:0 3px 14px rgba(0,0,0,.05);
}
.catch-thumb,.catch-no-photo { width:115px; height:115px; flex:0 0 115px; border-radius:12px; object-fit:cover; }
.catch-no-photo { display:grid; place-items:center; background:var(--input); font-size:35px; }
.catch-fish { font-size:20px; font-weight:800; }
.catch-meta { color:var(--muted); font-size:12px; margin:4px 0; }
.catch-bait { margin:5px 0; }
.link-btn { border:0; background:none; padding:4px 0; color:var(--primary); cursor:pointer; font-weight:650; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:16px; }
.stat,.panel {
    background:var(--surface); border:1px solid var(--separator); border-radius:17px;
    box-shadow:0 3px 14px rgba(0,0,0,.05);
}
.stat { padding:20px; }
.stat b { display:block; font-size:32px; letter-spacing:-.04em; }
.stat span { color:var(--muted); }
.panel { padding:20px; margin-bottom:15px; }
.panel h2 { margin-top:0; }
.bar-row { display:grid; grid-template-columns:110px 1fr 35px; gap:10px; align-items:center; margin:10px 0; }
.bar-track { height:9px; background:var(--input); border-radius:10px; overflow:hidden; }
.bar { height:100%; background:var(--primary); border-radius:inherit; }
.empty,.loading { text-align:center; color:var(--muted); padding:35px 10px; }
.photo-card { background:transparent; border:0; box-shadow:none; padding:0; width:auto; overflow:visible; }
.photo-card img { max-width:100%; max-height:calc(100vh - 50px); border-radius:14px; }
.photo-card .close { position:fixed; top:15px; right:15px; }

@media (max-width:700px) {
    .topbar { height:54px; padding:0 11px; }
    .map-page { height:calc(100vh - 54px); height:calc(100dvh - 54px); }
    .desktop-nav a { display:none; }
    .brand { font-size:16px; }
    .map-controls { bottom:73px; right:10px; }
    .filter-bar { bottom:9px; }
    .grid-2 { grid-template-columns:1fr; }
    .stats-grid { grid-template-columns:1fr 1fr; }
    .content-page { height:calc(100vh - 54px); height:calc(100dvh - 54px); padding:18px 10px 40px; }
    .page-title { align-items:flex-start; flex-direction:column; }
    .page-title h1 { font-size:28px; }
    .catch-thumb,.catch-no-photo { width:90px; height:90px; flex-basis:90px; }
    .catch-card { padding:8px; }
    .catch-fish { font-size:17px; }
    .modal { padding:0; align-items:flex-end; }
    .modal-card {
        width:100%; max-height:94vh; max-height:94dvh;
        border-radius:24px 24px 0 0; padding:10px 16px calc(18px + env(safe-area-inset-bottom));
    }
    .sheet-grabber { display:block; }
    .modal-head h2 { font-size:23px; }
    .detail-actions { flex-direction:column; }
    .bar-row { grid-template-columns:85px 1fr 28px; }
    .condition-chip { flex:1 1 29%; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior:auto !important; transition:none !important; animation:none !important; }
}

/* UI additions */

.leader-avatar {
    display:grid; place-items:center; flex:0 0 auto; width:52px; height:52px; border-radius:50%;
    background:var(--primary); color:#fff; font-weight:800; font-size:20px;
}
.catch-user {
    display:inline-block; vertical-align:2px; margin-left:5px; padding:4px 7px;
    border-radius:8px; background:rgba(0,122,255,.10); color:var(--primary); font-size:10px; font-weight:750;
}
.leaderboard-card {
    overflow:hidden; background:var(--surface); border:1px solid var(--separator); border-radius:20px;
    box-shadow:var(--shadow-small); margin-bottom:15px;
}
.leaderboard-head,.leader-row { display:grid; grid-template-columns:60px 1fr 90px; align-items:center; }
.leaderboard-head { padding:11px 14px; color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; border-bottom:1px solid var(--separator); }
.leaderboard-head span:last-child { text-align:right; }
.leader-row { min-height:76px; padding:10px 14px; border-bottom:1px solid var(--separator); }
.leader-row:last-child { border-bottom:0; }
.leader-row.me { background:rgba(0,122,255,.075); }
.rank { font-size:16px; font-weight:800; color:var(--muted); }
.rank.podium { font-size:22px; }
.leader-person { display:flex; align-items:center; gap:10px; min-width:0; color:var(--text); text-decoration:none; }
.leader-person:hover b { text-decoration:underline; }
.leader-avatar { width:40px; height:40px; font-size:15px; overflow:hidden; }
.leader-avatar img { width:100%; height:100%; object-fit:cover; display:block; }
.leader-avatar-fallback { width:100%; height:100%; place-items:center; }
.leader-person b { display:block; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.leader-person small,.leader-score small { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.leader-score { text-align:right; }
.leader-score b { font-size:19px; }
.you-badge { color:var(--primary); font-size:10px; font-weight:800; }
.score-info p { color:var(--muted); line-height:1.5; margin-bottom:0; }

.auth-body { min-height:100dvh; overflow:auto; background:var(--bg); }
.auth-wrap { width:min(430px,100%); margin:0 auto; padding:10vh 18px 40px; text-align:center; }
.auth-logo { width:64px; height:64px; margin:0 auto 14px; display:grid; place-items:center; background:var(--primary); color:white; border-radius:20px; font-size:31px; box-shadow:0 10px 28px rgba(0,122,255,.25); }
.auth-title { font-size:31px; font-weight:850; letter-spacing:-.05em; }
.auth-subtitle { color:var(--muted); margin:5px 0 24px; }
.auth-card { text-align:left; background:var(--surface-solid); border:1px solid var(--separator); border-radius:24px; padding:16px; box-shadow:var(--shadow); }
.auth-segment { display:grid; grid-template-columns:1fr 1fr; padding:3px; border-radius:10px; background:var(--input); margin-bottom:15px; }
.auth-seg { border:0; border-radius:8px; padding:9px 7px; background:transparent; color:var(--muted); font-size:12px; font-weight:700; cursor:pointer; }
.auth-seg.active { background:var(--surface-solid); color:var(--text); box-shadow:0 1px 4px rgba(0,0,0,.08); }
.password-field { position:relative; }
.password-field input { padding-right:44px; width:100%; box-sizing:border-box; }
.password-toggle { position:absolute; right:6px; top:50%; transform:translateY(-50%); width:34px; height:34px; border:0; border-radius:10px; background:transparent; color:var(--muted); display:grid; place-items:center; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.password-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.password-toggle:hover { background:var(--input); color:var(--text); }
.password-toggle:active { transform:translateY(-50%) scale(.94); }
.auth-hint { color:var(--muted); font-size:11px; line-height:1.35; margin:-4px 3px 11px; }
.auth-note { color:var(--muted); font-size:10px; line-height:1.45; margin:13px 3px 3px; }
.auth-note b { color:var(--text-2); }

@media (max-width:700px) {
    .topbar { padding-right:8px; }
    .top-actions { gap:4px; }
    .bottom-nav {
        position:fixed; left:0; right:0; bottom:0; z-index:2500;
        display:grid; grid-template-columns:repeat(4,1fr); gap:0;
        padding:6px 5px calc(6px + env(safe-area-inset-bottom));
        background:var(--surface); border-top:1px solid var(--separator);
        backdrop-filter:saturate(180%) blur(22px); -webkit-backdrop-filter:saturate(180%) blur(22px);
    }
    .nav-item { text-decoration:none; color:var(--muted); text-align:center; font-size:17px; font-weight:700; padding:4px 0; }
    .nav-item span { display:block; font-size:9px; font-weight:650; margin-top:2px; }
    .map-controls { bottom:125px; }
    .filter-bar { bottom:64px; }
    .leaderboard-head,.leader-row { grid-template-columns:45px 1fr 75px; }
    .leaderboard-head { font-size:9px; }
}
@media (min-width:701px) { .bottom-nav { display:none; } }
.records-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.record-box { display:flex; gap:13px; align-items:flex-start; padding:15px; border-radius:16px; background:var(--input); min-height:145px; }
.record-icon { width:42px; height:42px; border-radius:13px; display:grid; place-items:center; background:var(--surface-solid); font-size:20px; flex:0 0 auto; }
.record-label { color:var(--muted); font-size:10px; font-weight:750; text-transform:uppercase; letter-spacing:.06em; }
.record-copy > strong { display:block; margin-top:3px; font-size:17px; }
.record-value { font-size:30px; font-weight:850; letter-spacing:-.05em; margin-top:2px; }
.record-date,.record-place { color:var(--muted); font-size:11px; margin-top:3px; }
.empty-record { align-items:center; }
.empty-record p { color:var(--muted); margin:4px 0 0; font-size:12px; }
.species-record-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:9px; }
.species-record { padding:12px; border-radius:13px; background:var(--input); }
.species-record b { display:block; font-size:14px; }
.species-record span,.species-record div { display:block; color:var(--muted); font-size:11px; margin-top:4px; }
@media (max-width:700px) {
 .records-grid { grid-template-columns:1fr; }
 .species-record-grid { grid-template-columns:1fr 1fr; }
}


/* Map refresh: touch-friendly mobile layout */
@media (max-width:700px) {
    .top-actions { gap:5px; }
    .map-search {
        left:10px;
        top:10px;
        width:calc(100% - 20px);
    }
    .map-search-box { height:46px; border-radius:15px; }
    .search-results { max-height:45dvh; overflow-y:auto; }
    .map-controls {
        right:10px;
        bottom:76px;
    }
    .floating-add {
        min-height:44px;
        padding:0 14px;
        border-radius:14px;
    }
    .map-locate {
        width:44px;
        height:44px;
    }
    .filter-bar {
        left:8px;
        right:8px;
        bottom:8px;
        padding-bottom:6px;
    }
    .filter {
        min-height:40px;
        padding:9px 13px;
    }
    .leaflet-control-zoom {
        margin-top:64px !important;
    }
    .leaflet-control-zoom a {
        width:42px !important;
        height:42px !important;
        line-height:42px !important;
    }
    .modal-card {
        max-height:96dvh;
    }
}

@media (min-width:701px) {
    .map-search { width:390px; }
}

/* ===== Final map/mobile pass ===== */
.map-page { height:calc(100vh - 58px); height:calc(100dvh - 58px); }
#map { touch-action:pan-x pan-y; }
.leaflet-marker-pane, .leaflet-overlay-pane, .leaflet-shadow-pane, .leaflet-control-container { z-index:400; }
.leaflet-control-attribution { 
    background:rgba(255,255,255,.76) !important;
    color:#666 !important;
    border-radius:8px 0 0 0;
    padding:2px 6px !important;
    font-size:10px !important;
    backdrop-filter:blur(8px);
}
html[data-theme="dark"] .leaflet-control-attribution { background:rgba(20,20,22,.78) !important; color:#aaa !important; }
.leaflet-control-attribution a { color:inherit !important; }

/* Search sits above the map but never steals the whole screen. */
.map-search { max-width:430px; }
.search-result { min-height:58px; }

/* The pin is a proper map pin, not a rotated rounded square. */
.fish-marker {
    width:38px; height:48px;
    border-radius:50% 50% 50% 0;
    transform:rotate(-45deg);
    border:2.5px solid rgba(255,255,255,.96);
}
.fish-marker::after { width:11px; height:11px; }
.fish-marker span { transform:rotate(45deg); font-size:16px; }

@media (max-width:700px) {
    /* On a phone the map itself is the app. Keep the header for other pages. */
    body:has(.map-page) .topbar { display:none; }
    body:has(.map-page) main { height:100dvh; }
    body:has(.map-page) .map-page { height:100dvh; min-height:100dvh; }

    .map-search {
        left:max(10px, env(safe-area-inset-left));
        right:max(10px, env(safe-area-inset-right));
        top:max(10px, env(safe-area-inset-top));
        width:auto;
        max-width:none;
    }
    .map-search-box {
        height:50px;
        border-radius:17px;
        padding-left:15px;
    }
    .map-search-box input { font-size:16px; }
    .search-results {
        max-height:min(52dvh, 420px);
        border-radius:17px;
    }

    .leaflet-control-zoom {
        margin-top:68px !important;
        margin-right:8px !important;
    }
    .leaflet-control-zoom a {
        width:42px !important; height:42px !important; line-height:42px !important;
    }

    .map-controls {
        right:10px;
        bottom:calc(104px + env(safe-area-inset-bottom));
        gap:8px;
    }
    .floating-add {
        min-height:48px;
        padding:0 15px;
        border-radius:15px;
        font-size:14px;
    }
    .map-locate { width:46px; height:46px; }
    .map-locate span { display:grid; place-items:center; width:100%; height:100%; }

    .filter-bar {
        left:8px; right:8px;
        bottom:calc(58px + env(safe-area-inset-bottom));
        padding:4px 2px 5px;
    }
    .filter {
        min-height:38px;
        padding:8px 12px;
        font-size:12px;
        box-shadow:0 3px 12px rgba(0,0,0,.16);
    }

    .bottom-nav {
        height:auto;
        padding:5px 5px calc(5px + env(safe-area-inset-bottom));
    }
    .nav-item { min-height:44px; display:flex; flex-direction:column; justify-content:center; align-items:center; }

    .leaflet-control-attribution { font-size:8px !important; max-width:62vw; }
    .leaflet-control-attribution a { text-decoration:none; }

    .fish-marker { width:35px; height:44px; }
    .fish-marker::after { width:10px; height:10px; }
    .fish-marker span { font-size:14px; }

    .modal-card { max-height:94dvh; }
}

@media (min-width:701px) {
    .map-search { width:430px; }
}

/* ===== Base map switcher ===== */
.map-layer-switch {
    position:absolute;
    top:14px;
    right:14px;
    z-index:950;
    display:flex;
    padding:3px;
    gap:2px;
    border:1px solid var(--separator);
    border-radius:13px;
    background:rgba(255,255,255,.88);
    box-shadow:var(--shadow-small);
    backdrop-filter:saturate(180%) blur(18px);
    -webkit-backdrop-filter:saturate(180%) blur(18px);
}
html[data-theme="dark"] .map-layer-switch {
    background:rgba(28,28,30,.90);
}
.map-layer-btn {
    min-width:78px;
    height:34px;
    padding:0 12px;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--text-2);
    font-size:12px;
    font-weight:750;
    cursor:pointer;
    transition:background .15s ease, color .15s ease, transform .1s ease;
}
.map-layer-btn:hover { background:rgba(118,118,128,.12); }
.map-layer-btn:active { transform:scale(.97); }
.map-layer-btn.active {
    background:var(--text);
    color:var(--bg);
    box-shadow:0 2px 8px rgba(0,0,0,.16);
}

/* Keep the zoom buttons below the layer switcher. */
.leaflet-top.leaflet-right .leaflet-control-zoom { margin-top:58px; }

/* OSM's standard map has much more natural color than the old grey vector style. */
#map .leaflet-tile-pane { transition:opacity .2s ease; }

@media (max-width:700px) {
    .map-layer-switch {
        top:68px;
        right:10px;
        border-radius:14px;
    }
    .map-layer-btn {
        min-width:76px;
        height:36px;
        font-size:12px;
    }
    .leaflet-top.leaflet-right .leaflet-control-zoom {
        margin-top:116px !important;
    }
}


/* ===== Fishing map upgrade: clusters + spot intelligence ===== */
.fish-cluster-wrap { background: transparent !important; border: 0 !important; }
.fish-cluster {
    width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center; gap:2px;
    color:#fff; background:var(--primary); border:3px solid rgba(255,255,255,.95);
    box-shadow:0 6px 18px rgba(0,0,0,.28); font-weight:800;
}
.fish-cluster span { font-size:16px; }
.fish-cluster b { font-size:13px; }

.spot-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; margin:14px 0 9px; }
.spot-stat { padding:10px 8px; border-radius:13px; background:var(--input); text-align:center; }
.spot-stat b { display:block; font-size:16px; line-height:1.1; }
.spot-stat span { display:block; margin-top:4px; color:var(--muted); font-size:9px; text-transform:uppercase; letter-spacing:.04em; }
.spot-fish-summary { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 13px; }
.spot-fish-summary span { background:rgba(0,122,255,.10); color:var(--primary); padding:6px 9px; border-radius:10px; font-size:11px; font-weight:650; }
.spot-fish-summary b { margin-left:3px; }

/* ===== v7 ===== */
.desktop-nav a.active{color:var(--text);background:rgba(118,118,128,.12)}
.history-filters{display:flex;gap:8px;flex-wrap:wrap}.history-filters select{min-width:150px}
.smart-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.smart-stat{padding:15px;border-radius:16px;background:var(--input)}.smart-stat span,.smart-stat small{display:block;color:var(--muted);font-size:11px}.smart-stat b{display:block;margin:5px 0 2px;font-size:20px}.monthly-stats{display:grid;gap:8px}
.nav-item.active{color:var(--primary)}.nav-icon{font-size:18px;line-height:18px}
@media(max-width:700px){.history-filters{width:100%}.history-filters select{flex:1;min-width:0}.smart-stats{grid-template-columns:1fr}}

/* ===== Waterbody UX ===== */
.waterbody-card { max-width: 720px; }
.waterbody-hero { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin:4px 0 12px; }
.waterbody-stat { padding:13px 10px; border-radius:15px; background:var(--input); text-align:center; }
.waterbody-stat b { display:block; font-size:20px; letter-spacing:-.03em; }
.waterbody-stat span { display:block; color:var(--muted); font-size:10px; margin-top:3px; }
.waterbody-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:14px 0 18px; }
.secondary-btn,.ghost-inline-btn { border:1px solid var(--separator); background:var(--surface-2); color:var(--text); border-radius:14px; min-height:44px; padding:0 14px; font-weight:700; cursor:pointer; }
.ghost-inline-btn { margin-top:7px; min-height:38px; width:100%; font-size:12px; }
.waterbody-link { display:block; border:0; padding:0; margin:5px 0 0; background:transparent; color:var(--primary); font-size:12px; font-weight:750; cursor:pointer; text-align:left; }
.waterbody-section-title { display:flex; justify-content:space-between; align-items:center; margin:18px 0 8px; font-size:13px; font-weight:800; }
.waterbody-section-title span { color:var(--muted); font-weight:700; font-size:11px; }
.waterbody-point-list,.waterbody-catch-list { display:flex; flex-direction:column; gap:7px; }
.waterbody-point,.waterbody-catch { width:100%; display:flex; align-items:center; gap:10px; border:1px solid var(--separator); background:var(--surface-2); color:var(--text); border-radius:14px; padding:11px; text-align:left; cursor:pointer; }
.waterbody-point:hover,.waterbody-catch:hover { background:rgba(118,118,128,.12); }
.point-pin { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:var(--surface-solid); flex:0 0 auto; }
.point-copy,.waterbody-catch span:nth-child(2) { min-width:0; flex:1; }
.point-copy b,.waterbody-catch b { display:block; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.point-copy small,.waterbody-catch small { display:block; color:var(--muted); margin-top:3px; font-size:11px; }
.point-arrow { color:var(--muted); font-size:21px; }
.waterbody-catch > span:first-child { width:32px; height:32px; display:grid; place-items:center; border-radius:10px; background:var(--surface-solid); flex:0 0 auto; }
.clear-waterbody-btn { width:100%; margin-top:14px; border:0; background:transparent; color:var(--muted); font-size:12px; padding:10px; cursor:pointer; }
.placement-hint { position:absolute; left:50%; top:72px; transform:translateX(-50%); z-index:980; padding:9px 14px; border-radius:14px; background:var(--surface); box-shadow:var(--shadow-small); backdrop-filter:blur(18px); font-size:12px; font-weight:750; white-space:nowrap; pointer-events:none; }
@media (max-width:700px) {
  .waterbody-card { width:100%; }
  .waterbody-hero { gap:6px; }
  .waterbody-stat { padding:11px 6px; }
  .waterbody-stat b { font-size:17px; }
  .waterbody-actions { grid-template-columns:1fr; }
  .placement-hint { top:66px; max-width:calc(100% - 24px); overflow:hidden; text-overflow:ellipsis; }
}


/* ===== v15 catch batch UX ===== */
.catch-section-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.catch-section-head > span:first-child { font-weight:800; }
.catch-section-note { color:var(--muted); font-size:11px; font-weight:650; white-space:nowrap; }
.catch-list { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.catch-row { padding:12px; border:1px solid var(--separator); border-radius:16px; background:var(--surface-2); }
.catch-row-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.catch-row-title { font-size:12px; font-weight:800; color:var(--text-2); }
.catch-remove { border:0; background:transparent; color:var(--muted); font-size:19px; width:32px; height:32px; border-radius:9px; cursor:pointer; }
.catch-remove:hover { background:rgba(118,118,128,.12); color:var(--danger); }
.catch-row .grid-2 { margin:0; }
.catch-row label { margin-top:8px; }
.catch-row .file-label-mini { display:flex; align-items:center; gap:10px; margin-top:9px; padding:10px 12px; border-radius:11px; background:var(--input); border:1px dashed var(--separator); cursor:pointer; user-select:none; transition:.15s ease; }
.file-label-mini:hover { border-color:var(--primary); background:color-mix(in srgb, var(--input) 88%, var(--primary)); }
.file-label-mini:active { transform:scale(.99); }
.file-label-mini .photo-upload-icon { display:grid; place-items:center; width:30px; height:30px; flex:0 0 30px; border-radius:9px; background:var(--primary); color:#fff; font-size:15px; }
.file-label-mini .photo-upload-copy { display:flex; flex-direction:column; min-width:0; }
.file-label-mini .mini-title { font-size:12px; font-weight:750; }
.file-label-mini .mini-sub { font-size:10px; color:var(--muted); margin-top:2px; }
.file-label-mini.has-files { border-style:solid; }
.file-label-mini input { display:none !important; }
.add-catch-row { width:100%; min-height:44px; margin-top:10px; border:1px dashed var(--separator); border-radius:13px; background:transparent; color:var(--primary); font-weight:800; cursor:pointer; }
.add-catch-row:hover { background:rgba(0,122,255,.07); }
.batch-hint { color:var(--muted); font-size:10px; line-height:1.4; margin-top:7px; }
@media (max-width:700px) {
  .catch-row { padding:10px; border-radius:15px; }
  .catch-row .grid-2 { grid-template-columns:1fr 1fr; }
  .file-label-mini { flex-wrap:wrap; }
  .file-label-mini input { max-width:100%; width:100%; margin-left:0; }
}

.weather-auto-status{margin-top:10px;padding:10px 12px;border-radius:12px;background:rgba(80,90,110,.08);font-size:13px;color:var(--muted,#777)}
.weather-auto-status.ready{background:rgba(50,160,90,.10);color:#277c47}.weather-auto-status.error{background:rgba(220,70,70,.10);color:#a33}.weather-auto-status small{display:block;margin-top:3px;opacity:.65}
.bite-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:14px}.bite-stat{padding:18px;border-radius:18px;background:var(--card,#fff);border:1px solid var(--border,#ddd);display:flex;flex-direction:column;gap:5px}.bite-stat b{font-size:28px}.bite-stat span,.panel-note{color:var(--muted,#777)}
.bite-chart-head{display:flex;justify-content:space-between;gap:15px}.hour-chart{height:230px;display:flex;align-items:flex-end;gap:5px;padding:18px 4px 4px}.hour-col{height:100%;flex:1;min-width:16px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:5px}.hour-bar-wrap{height:170px;width:100%;display:flex;align-items:flex-end}.hour-bar-wrap i{display:block;width:100%;border-radius:7px 7px 2px 2px;background:linear-gradient(180deg,#6c86a5,#34485f);min-height:2px}.hour-value{font-size:10px;color:var(--muted,#777);height:14px}.hour-col>span{font-size:10px;color:var(--muted,#777)}
.weather-factor-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.weather-factor{padding:14px;border:1px solid var(--border,#ddd);border-radius:16px}.weather-factor h3{margin:0 0 12px}.factor-row{margin:10px 0}.factor-label{display:flex;justify-content:space-between;font-size:13px}.factor-track{height:7px;background:rgba(100,110,120,.12);border-radius:99px;overflow:hidden;margin:5px 0}.factor-track i{display:block;height:100%;border-radius:99px;background:#52708e}.factor-row small{color:var(--muted,#777);font-size:11px}.best-factor{display:grid;grid-template-columns:1fr 1.5fr auto;gap:8px;align-items:center;padding:12px 0;border-bottom:1px solid var(--border,#ddd)}.best-factor:last-child{border-bottom:0}.best-factor strong{font-size:20px}.best-factor small{grid-column:2/4;color:var(--muted,#777)}.bite-note{color:var(--muted,#777)}
@media(max-width:700px){.bite-summary{grid-template-columns:1fr 1fr}.bite-stat:last-child{grid-column:1/-1}.weather-factor-grid{grid-template-columns:1fr}.best-factor{grid-template-columns:1fr auto}.best-factor small{grid-column:1/-1}.hour-chart{gap:2px}}
.page-title{display:flex;align-items:center;justify-content:space-between;gap:14px}.ghost-btn{border:1px solid var(--border,#ddd);background:var(--card,#fff);color:inherit;padding:10px 14px;border-radius:12px;cursor:pointer}.ghost-btn:disabled{opacity:.65;cursor:wait}
@media(max-width:700px){.page-title{align-items:flex-start;flex-direction:column}.ghost-btn{width:100%}}

/* ===== v21 polished bite page + mobile app UX ===== */
.bite-page{max-width:1180px;padding-top:30px}
.bite-header{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:22px}
.bite-header h1{margin:4px 0 5px;font-size:38px;letter-spacing:-.05em}
.bite-header p{margin:0;color:var(--muted);font-size:14px}
.bite-place-badge{max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:11px 14px;border:1px solid var(--separator);background:var(--surface);border-radius:14px;color:var(--text-2);font-weight:750;font-size:13px}
.bite-toolbar{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(180px,.7fr);gap:12px;padding:14px;border:1px solid var(--separator);background:var(--surface);border-radius:20px;box-shadow:var(--shadow-small);margin-bottom:10px}
.bite-control label{display:block;color:var(--muted);font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.06em;margin:0 0 7px}
.bite-control select,.bite-control input{width:100%;min-height:48px;margin:0}
.bite-status{min-height:42px;display:flex;align-items:center;padding:0 14px;margin-bottom:14px;border-radius:13px;color:var(--muted);font-size:12px;background:rgba(118,118,128,.07)}
.bite-status.loading{color:var(--primary)}.bite-status.ready{color:#27804a;background:rgba(50,160,90,.09)}.bite-status.error{color:#a33;background:rgba(220,70,70,.09)}
.bite-overview{display:grid;grid-template-columns:1.35fr .8fr .8fr;gap:12px;margin-bottom:14px}
.bite-overview>div{border:1px solid var(--separator);border-radius:20px;background:var(--surface);box-shadow:var(--shadow-small);padding:20px}
.bite-overview-main{background:linear-gradient(135deg,rgba(0,122,255,.10),rgba(0,122,255,.025))!important}
.bite-overview-label{font-size:12px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.06em}
.bite-score{display:flex;align-items:baseline;gap:5px;margin:2px 0}.bite-score strong{font-size:54px;line-height:1;letter-spacing:-.06em}.bite-score span{font-size:15px;color:var(--muted);font-weight:700}
.bite-verdict{font-size:14px;font-weight:750;color:var(--primary)}
.bite-overview-stat{display:flex;flex-direction:column;justify-content:center;gap:7px}.bite-overview-stat span{font-size:12px;color:var(--muted)}.bite-overview-stat strong{font-size:22px;letter-spacing:-.03em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.section-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:10px}.section-heading h2{margin:0;font-size:20px;letter-spacing:-.03em}.section-heading p{margin:4px 0 0;color:var(--muted);font-size:12px}
.chart-legend{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11px}.chart-legend i{width:9px;height:9px;border-radius:50%;background:var(--primary)}
.bite-chart-panel{padding:20px 20px 12px}.bite-svg-wrap{height:310px;width:100%;overflow:hidden}.bite-svg-wrap svg{display:block;width:100%;height:100%;overflow:visible}
.chart-grid{stroke:var(--separator);stroke-width:1}.chart-axis,.chart-label{fill:var(--muted);font-size:11px}.chart-area{fill:rgba(0,122,255,.10)}.chart-line{fill:none;stroke:var(--primary);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.chart-dot{fill:var(--surface-solid);stroke:var(--primary);stroke-width:2}.chart-best{fill:var(--primary);stroke:var(--surface-solid);stroke-width:3}.chart-best-label{fill:var(--text);font-size:12px;font-weight:800}.bite-chart-empty{height:260px;display:grid;place-items:center;color:var(--muted)}
.bite-weather-panel{padding:20px}.bite-factors{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.bite-factor{padding:14px;border-radius:15px;background:var(--surface-2);border:1px solid var(--separator);min-width:0}.bite-factor span{display:block;color:var(--muted);font-size:11px;margin-bottom:6px}.bite-factor strong{display:block;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Mobile-first improvements for all non-map pages. */
@media(max-width:700px){
  html,body{overflow-x:hidden}
  body{padding-bottom:0}
  .topbar{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .top-actions .user-name,.logout-form{display:none}
  .content-page{max-width:none;width:100%;box-sizing:border-box;padding:15px 10px calc(84px + env(safe-area-inset-bottom));height:calc(100dvh - 54px);}
  .page-title h1{font-size:27px}.page-title{gap:12px;margin-bottom:15px}
  .stats-grid{grid-template-columns:1fr 1fr;gap:8px}.stat{padding:14px;border-radius:15px}.stat b{font-size:27px}.panel{padding:15px;border-radius:16px;margin-bottom:10px}
  .catch-card{gap:10px;border-radius:15px}.catch-thumb,.catch-no-photo{width:82px;height:82px;flex-basis:82px}.catch-info{min-width:0}.catch-fish{font-size:16px}.catch-values span{font-size:11px}
  .history-filters{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:7px}.history-filters select{min-width:0;width:100%}
  .bar-row{grid-template-columns:74px 1fr 25px;gap:7px}.smart-stats{gap:8px}.waterbody-hero{grid-template-columns:repeat(2,1fr)}
  .bite-page{padding-top:17px}.bite-header{align-items:flex-start;flex-direction:column;gap:10px;margin-bottom:14px}.bite-header h1{font-size:29px}.bite-header p{font-size:13px;line-height:1.4}.bite-place-badge{max-width:100%;padding:9px 12px}
  .bite-toolbar{grid-template-columns:1fr;gap:8px;padding:11px;border-radius:16px}.bite-control select,.bite-control input{min-height:46px;font-size:16px}
  .bite-status{margin-bottom:10px;min-height:40px;font-size:11px}.bite-overview{grid-template-columns:1fr 1fr;gap:8px}.bite-overview>div{padding:15px;border-radius:16px}.bite-overview-main{grid-column:1/-1}.bite-score strong{font-size:48px}.bite-overview-stat strong{font-size:18px}
  .bite-chart-panel{padding:14px 10px 8px}.section-heading{align-items:flex-start}.section-heading h2{font-size:18px}.chart-legend{display:none}.bite-svg-wrap{height:235px}.chart-label{font-size:10px}.chart-axis{font-size:10px}
  .bite-weather-panel{padding:14px}.bite-factors{grid-template-columns:1fr 1fr;gap:7px}.bite-factor{padding:11px;border-radius:13px}.bite-factor strong{font-size:14px}
  .bottom-nav{z-index:2000}
}

@media(min-width:701px){body:not(:has(.map-page)){min-width:320px}.bottom-nav{display:none}}

/* Better standalone/PWA behavior when the page is saved to the home/desktop. */
@media(display-mode: standalone){
  .topbar{padding-top:env(safe-area-inset-top);height:calc(58px + env(safe-area-inset-top))}
  .content-page{height:calc(100dvh - 58px - env(safe-area-inset-top));padding-bottom:calc(70px + env(safe-area-inset-bottom))}
  .bottom-nav{padding-bottom:calc(5px + env(safe-area-inset-bottom))}
}
/* Bite v22 redesign */
.bite-page{max-width:1100px}.bite-toolbar{grid-template-columns:minmax(0,1fr) 210px}.bite-overview{grid-template-columns:minmax(260px,1.4fr) .8fr .9fr}.bite-overview-main{position:relative;overflow:hidden}.bite-overview-main:after{content:'';position:absolute;width:150px;height:150px;border-radius:50%;right:-55px;top:-65px;background:rgba(0,122,255,.07)}
.bite-score strong{font-variant-numeric:tabular-nums}.bite-verdict{display:flex;align-items:center;gap:7px}.bite-verdict:before{content:'';width:8px;height:8px;border-radius:50%;background:currentColor}.bite-chart-panel .section-heading{margin-bottom:4px}.bite-svg-wrap{height:330px}.bite-weather-panel{margin-top:14px}.bite-factors{grid-template-columns:repeat(3,1fr)}.bite-factor{min-height:78px;display:flex;flex-direction:column;justify-content:center}.bite-factor strong{font-variant-numeric:tabular-nums}.bite-factor small{display:block;margin-top:5px;color:var(--muted);font-size:10px}.bite-method{margin-top:12px;padding:12px 14px;border-radius:14px;background:var(--surface-2);color:var(--muted);font-size:12px;line-height:1.5}
@media(max-width:700px){.bite-toolbar{grid-template-columns:1fr}.bite-overview{grid-template-columns:1fr 1fr}.bite-overview-main{grid-column:1/-1}.bite-factors{grid-template-columns:1fr 1fr}.bite-svg-wrap{height:255px}.bite-page{padding-bottom:80px}.bite-method{font-size:11px}}
@media(max-width:420px){.bite-overview{grid-template-columns:1fr}.bite-overview-main{grid-column:auto}.bite-factors{grid-template-columns:1fr}.bite-score strong{font-size:50px}}

/* v23 — compact filter drawer + settings */
.filter-drawer-toggle {
    position:absolute; left:14px; bottom:14px; z-index:1001;
    display:flex; align-items:center; gap:8px; min-height:44px; padding:0 14px;
    border:1px solid rgba(255,255,255,.32); border-radius:15px;
    background:var(--surface); color:var(--text); box-shadow:var(--shadow-small);
    backdrop-filter:saturate(180%) blur(22px); -webkit-backdrop-filter:blur(22px);
    cursor:pointer; font-size:13px;
}
.filter-drawer-toggle .filter-chevron { font-size:15px; opacity:.6; transition:transform .2s; }
.filter-drawer-toggle[aria-expanded="true"] .filter-chevron { transform:rotate(180deg); }
.filter-drawer {
    position:absolute; left:14px; bottom:66px; z-index:1002; width:min(620px,calc(100% - 28px));
    padding:12px; border:1px solid var(--separator); border-radius:18px; background:var(--surface-solid);
    box-shadow:var(--shadow); backdrop-filter:blur(25px); -webkit-backdrop-filter:blur(25px);
    transform:translateY(8px); opacity:0; pointer-events:none; transition:.18s ease;
}
.filter-drawer.open { transform:translateY(0); opacity:1; pointer-events:auto; }
.filter-drawer-head { display:flex; justify-content:space-between; align-items:center; padding:2px 3px 10px; color:var(--text); }
.filter-drawer-head button { border:0; background:var(--input); color:var(--muted); width:30px; height:30px; border-radius:50%; font-size:20px; cursor:pointer; }
.filter-grid { display:flex; flex-wrap:wrap; gap:7px; }
.filter-bar { display:none !important; }
.filter-grid .filter { box-shadow:none; }
.filter-backdrop { position:absolute; inset:0; z-index:1000; background:rgba(0,0,0,.12); }
.filter-backdrop.hidden { display:none; }

.settings-page { max-width:820px; margin:0 auto; padding-bottom:110px; }
.settings-header { margin-bottom:18px; }
.settings-header h1 { margin:3px 0 4px; font-size:32px; letter-spacing:-.03em; }
.settings-header p { margin:0; color:var(--muted); }
.settings-card { background:var(--surface-solid); border:1px solid var(--separator); border-radius:22px; margin:12px 0; overflow:hidden; box-shadow:var(--shadow-small); }
.settings-card-head { padding:20px 22px 8px; }
.settings-card h2,.settings-card h3 { margin:0; }
.settings-card p { color:var(--muted); margin:5px 0 0; font-size:13px; line-height:1.45; }
.profile-editor { display:flex; gap:18px; align-items:center; padding:14px 22px 22px; }
.avatar-large { width:88px; height:88px; flex:0 0 88px; border-radius:50%; display:grid; place-items:center; overflow:hidden; background:var(--input); color:var(--primary); font-size:32px; font-weight:800; }
.avatar-large img { width:100%; height:100%; object-fit:cover; }
.profile-copy { min-width:0; display:flex; flex-direction:column; gap:3px; }
.profile-copy strong { font-size:18px; }
.profile-copy > span { color:var(--muted); font-size:13px; }
.profile-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.primary-small,.ghost-small { border:0; border-radius:11px; min-height:38px; padding:0 13px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; font-size:13px; font-weight:700; }
.primary-small { background:var(--primary); color:white; }
.ghost-small { background:var(--input); color:var(--text); }
.profile-copy small { color:var(--muted); min-height:16px; }
.settings-row { min-height:76px; padding:16px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid var(--separator); }
.settings-card > .settings-row:first-child { border-top:0; }
.settings-row > div:first-child { min-width:0; }
.settings-row h3 { font-size:15px; }
.settings-row select { min-width:145px; }
.segmented { display:flex; padding:3px; background:var(--input); border-radius:12px; }
.segmented button { border:0; background:transparent; color:var(--muted); border-radius:9px; padding:8px 11px; cursor:pointer; font-size:13px; font-weight:700; }
.segmented button.active { background:var(--surface-solid); color:var(--text); box-shadow:0 1px 5px rgba(0,0,0,.12); }
.setting-check { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; background:rgba(52,199,89,.14); color:#34c759; font-weight:900; }
.settings-saved { position:fixed; left:50%; bottom:90px; transform:translateX(-50%); z-index:3000; background:#1c1c1e; color:white; padding:10px 16px; border-radius:14px; box-shadow:var(--shadow); }
.settings-saved.hidden { display:none; }

@media (max-width:700px) {
  .topbar { height:54px; padding:0 10px; }
  .desktop-nav { display:none; }
  .brand { font-size:16px; }
  .brand-mark { width:28px; height:28px; }
  .user-name,.settings-top-btn { display:none; }
  .profile-mini { width:36px; height:36px; }
  .map-page { height:calc(100dvh - 54px); }
  .map-search { top:10px; left:10px; width:calc(100% - 20px); }
  .map-layer-switch { top:66px !important; right:10px !important; }
  .map-controls { right:10px; bottom:74px; }
  .floating-add { min-height:44px; padding:0 13px; }
  .filter-drawer-toggle { left:10px; bottom:10px; }
  .filter-drawer { left:10px; bottom:62px; width:calc(100% - 20px); padding:10px; max-height:55dvh; overflow:auto; }
  .filter-grid { gap:6px; }
  .filter-grid .filter { padding:9px 11px; }
  .settings-page { padding:18px 12px 105px; }
  .settings-header h1 { font-size:28px; }
  .profile-editor { padding:14px 16px 18px; gap:13px; align-items:flex-start; }
  .avatar-large { width:72px; height:72px; flex-basis:72px; border-radius:50%; font-size:26px; }
  .settings-card-head { padding:18px 16px 7px; }
  .settings-row { padding:15px 16px; align-items:center; }
  .settings-row select { min-width:125px; max-width:45%; }
  .segmented button { padding:8px 8px; }
  .settings-info .settings-row { min-height:70px; }
}

/* ===== v25 mobile navigation + map rotation polish ===== */
input[type="file"].visually-hidden-file,
input[type="file"][data-field="photos"] {
    display:none !important;
}

.map-bearing-reset {
    width:42px;
    height:42px;
    border-radius:14px;
    font-size:18px;
    transition:transform .15s ease, opacity .15s ease;
}
.map-bearing-reset:not(.hidden) { display:grid; place-items:center; }
.map-bearing-reset:active { transform:scale(.94); }

@media (max-width:700px) {
    /* Six compact tabs: no wrapping, no giant empty second row. */
    .bottom-nav {
        grid-template-columns:repeat(6, minmax(0,1fr)) !important;
        height:auto !important;
        min-height:68px;
        padding:5px 3px calc(5px + env(safe-area-inset-bottom)) !important;
        gap:0;
    }
    .nav-item {
        min-width:0;
        min-height:58px;
        padding:4px 1px 2px !important;
        display:flex !important;
        flex-direction:column;
        justify-content:center;
        align-items:center;
        gap:3px;
        font-size:10px !important;
        line-height:1;
        overflow:hidden;
    }
    .nav-item .nav-icon {
        display:block;
        font-size:21px !important;
        line-height:22px;
        width:100%;
        text-align:center;
    }
    .nav-item > span:last-child {
        display:block;
        max-width:100%;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
        font-size:9px !important;
        font-weight:700;
        margin:0 !important;
    }

    body:has(.map-page) .map-page { height:100dvh; min-height:100dvh; }
    #map { touch-action:pan-x pan-y; overscroll-behavior:none; -webkit-user-select:none; user-select:none; }

    .map-controls {
        right:10px;
        bottom:calc(86px + env(safe-area-inset-bottom));
        gap:8px;
    }
    .map-locate,
    .map-bearing-reset {
        width:48px;
        height:48px;
        border-radius:15px;
        font-size:20px;
    }
    .floating-add {
        min-height:48px;
        padding:0 15px;
        border-radius:15px;
        font-size:14px;
    }

    .filter-drawer-toggle {
        left:10px;
        bottom:calc(78px + env(safe-area-inset-bottom));
        min-height:46px;
        padding:0 15px;
        border-radius:15px;
        font-size:14px;
    }
    .filter-drawer {
        left:10px;
        bottom:calc(132px + env(safe-area-inset-bottom));
        width:calc(100% - 20px);
        max-height:55dvh;
    }

    .leaflet-top.leaflet-right .leaflet-control-zoom {
        margin-top:116px !important;
        margin-right:8px !important;
    }

    /* Make the settings screen comfortable on narrow phones. */
    .settings-page { padding:18px 12px calc(88px + env(safe-area-inset-bottom)); }
    .settings-row { gap:12px; }
    .profile-actions { width:100%; }
    .profile-actions .primary-small,
    .profile-actions .ghost-small { min-height:44px; }
}

@media (min-width:701px) {
    .map-bearing-reset { margin-bottom:0; }
}


/* v26: softer markers + wanted fishing places + simpler add flow */
.fish-marker { opacity:.78; }
.fish-marker span { opacity:.95; }
.fish-marker-wrap.wanted-marker-wrap .fish-marker { background:rgba(52,199,89,.72); border-color:rgba(255,255,255,.82); box-shadow:0 5px 16px rgba(0,0,0,.22); }
.fish-marker-wrap.wanted-marker-wrap .fish-marker span { filter:none; color:#fff; font-size:22px; font-weight:800; }
.fish-marker-wrap.wanted-marker-wrap .fish-marker::after { background:rgba(255,255,255,.78); }
.spot-create-card { overflow-x:hidden; }
.spot-type-step { padding:4px 2px 6px; }
.spot-step-kicker { color:var(--primary); font-size:10px; font-weight:850; letter-spacing:.11em; margin-bottom:8px; }
.spot-type-step h2 { margin:0; font-size:28px; letter-spacing:-.04em; }
.spot-type-step p { margin:7px 0 18px; color:var(--muted); font-size:13px; }
.spot-type-options { display:grid; gap:10px; }
.spot-type-option { width:100%; display:grid; grid-template-columns:48px 1fr 22px; align-items:center; gap:12px; padding:13px; border:1px solid var(--separator); border-radius:17px; background:var(--surface-2); color:var(--text); text-align:left; cursor:pointer; transition:.15s ease; }
.spot-type-option:hover { border-color:rgba(0,122,255,.5); transform:translateY(-1px); }
.spot-type-option:active { transform:scale(.99); }
.spot-type-option > span:nth-child(2) { display:flex; flex-direction:column; gap:3px; min-width:0; }
.spot-type-option b { font-size:14px; }
.spot-type-option small { color:var(--muted); font-size:11px; line-height:1.25; }
.spot-type-option strong { color:var(--muted); font-size:25px; font-weight:400; text-align:right; }
.spot-type-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; background:rgba(0,122,255,.12); font-size:24px; }
.spot-type-icon.want { background:rgba(52,199,89,.13); color:#34c759; }
.optional { color:var(--muted); font-size:10px; font-weight:500; }
.want-submit { background:#34c759; }
.want-submit:hover { background:#2fb653; }
@media (max-width:700px) {
  .spot-create-card { width:100%; max-height:88dvh; padding:18px; border-radius:24px 24px 0 0; margin-top:auto; }
  .spot-type-step h2 { font-size:25px; }
  .spot-type-option { min-height:72px; padding:11px; }
}

/* v27: wanted fish + cleaner mobile catch form */
.fish-cluster.wanted-cluster {
    background:rgba(52,199,89,.88) !important;
    border-color:rgba(255,255,255,.92) !important;
    box-shadow:0 6px 18px rgba(20,100,45,.32);
}
.fish-cluster.wanted-cluster span { color:#fff; }
.wanted-fish-chips { display:flex; flex-wrap:wrap; gap:7px; margin-top:8px; }
.wanted-fish-chip { margin:0; cursor:pointer; font-size:12px; font-weight:650; }
.wanted-fish-chip input { position:absolute; opacity:0; pointer-events:none; width:1px; height:1px; }
.wanted-fish-chip span { display:block; padding:8px 10px; border-radius:11px; background:var(--input); color:var(--text-2); border:1px solid transparent; transition:.15s ease; }
.wanted-fish-chip input:checked + span { background:rgba(52,199,89,.15); border-color:rgba(52,199,89,.55); color:#34c759; }
.wanted-fish-chip span:hover { border-color:var(--separator); }

/* Keep the add-catch sheet focused: core fields first, details compact. */
.catch-row { background:var(--input); border-radius:16px; padding:12px; }
.catch-row label { margin:8px 0; }
.catch-row-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:4px; }
.catch-row-title { font-size:13px; font-weight:800; color:var(--text); }
.catch-remove { width:30px; height:30px; border:0; border-radius:9px; background:rgba(255,59,48,.09); color:var(--danger); font-size:20px; cursor:pointer; }
.catch-row .file-label-mini { background:var(--surface-solid); }

@media (max-width:700px) {
    .wanted-fish-chips { gap:6px; }
    .wanted-fish-chip span { padding:8px 9px; }
    .spot-create-card .modal-head h2 { font-size:23px; }
    #catchFlow .form-section { padding:11px 0; }
    #catchFlow .batch-hint { font-size:10px; }
}

/* v27.1: compact catch sheet */
.compact-place-section .grid-2 { gap:8px; }
.extra-catch-details, .catch-extra-details { border:1px solid var(--separator); border-radius:14px; background:var(--input); margin:10px 0; overflow:hidden; }
.extra-catch-details > summary, .catch-extra-details > summary { list-style:none; cursor:pointer; padding:12px 13px; font-size:13px; font-weight:750; color:var(--text-2); }
.extra-catch-details > summary::-webkit-details-marker, .catch-extra-details > summary::-webkit-details-marker { display:none; }
.extra-catch-details > summary::after, .catch-extra-details > summary::after { content:'＋'; float:right; color:var(--muted); font-size:18px; line-height:12px; }
.extra-catch-details[open] > summary::after, .catch-extra-details[open] > summary::after { content:'−'; }
.extra-catch-body, .catch-extra-body { padding:0 12px 12px; }
.catch-extra-details { margin:8px 0 0; background:rgba(255,255,255,.035); }
.catch-extra-details > summary { padding:9px 10px; font-size:12px; }
.catch-extra-body { padding:0 10px 10px; }
.compact-weather-section { padding-bottom:10px; }
.wanted-fish-summary span { background:rgba(52,199,89,.13); color:#34c759; }

/* v28: smoother map gestures + polished catch fish picker */
#map .leaflet-zoom-animated,
#map .leaflet-map-pane,
#map .leaflet-objects-pane,
#map .leaflet-overlay-pane,
#map .leaflet-marker-pane {
    will-change: transform;
}
#map .leaflet-tile-pane { will-change: transform; }

.catch-field-label {
    margin: 10px 0 7px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-2);
}
.catch-field-label b { color: var(--danger); }
.catch-fish-grid {
    display:grid;
    grid-template-columns:repeat(3, minmax(0,1fr));
    gap:7px;
}
.catch-fish-option {
    min-height:46px;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:7px;
    padding:8px 9px;
    border:1px solid var(--separator);
    border-radius:13px;
    background:var(--surface-solid);
    color:var(--text-2);
    cursor:pointer;
    text-align:left;
    font-size:12px;
    font-weight:700;
    transition:transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.catch-fish-option:hover { border-color:rgba(0,122,255,.45); transform:translateY(-1px); }
.catch-fish-option:active { transform:scale(.98); }
.catch-fish-option.selected {
    background:rgba(0,122,255,.10);
    color:var(--primary);
    border-color:rgba(0,122,255,.58);
    box-shadow:0 0 0 2px rgba(0,122,255,.08);
}
.catch-fish-icon {
    width:28px; height:28px; flex:0 0 28px;
    display:grid; place-items:center;
    border-radius:9px;
    background:rgba(0,122,255,.10);
    font-size:15px;
}
.catch-fish-option.selected .catch-fish-icon { background:rgba(0,122,255,.16); }

@media (max-width:700px) {
    .catch-fish-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
    .catch-fish-option { min-height:50px; padding:8px 9px; font-size:12px; border-radius:14px; }
}


/* v29 catch fish compact selector */
.catch-fish-more { margin-top:7px; }
.catch-fish-expand { width:100%; margin-top:7px; min-height:38px; border:1px dashed var(--separator); border-radius:12px; background:transparent; color:var(--primary); font-weight:800; cursor:pointer; transition:.15s ease; }
.catch-fish-expand:hover { background:rgba(0,122,255,.06); }
.catch-fish-expand span { display:inline-block; margin-left:4px; transition:transform .15s ease; }
.catch-fish-expand.expanded { background:var(--input); }

/* v30: compact catch selector and clean photo/comment hierarchy */
.catch-photo-upload { margin-top:9px !important; }
.catch-bait-field { display:block; margin-top:9px; }
.catch-bait-field input { margin-top:6px; }
.catch-extra-details { margin-top:10px; }
@media (max-width:600px) {
  .catch-fish-primary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .catch-fish-expand { min-height:40px; font-size:13px; }
  .catch-photo-upload { min-height:52px; }
}

/* Catch form: shared trip details and photos */
.catch-photos-block { margin: 12px 0 10px; }
.file-label-mini {
    display:flex; align-items:center; justify-content:center; min-height:48px;
    padding:11px 14px; border:1px dashed var(--separator); border-radius:14px;
    background:var(--input); color:var(--text); font-size:14px; font-weight:750;
    cursor:pointer; transition:.18s ease; text-align:center;
}
.file-label-mini:hover { border-color:var(--primary); background:rgba(0,122,255,.07); }
.file-label-mini input[type="file"] { display:none !important; }
.photo-status { margin-top:6px; text-align:center; color:var(--muted); font-size:12px; }
.extra-catch-details { margin:10px 0 8px; }
.extra-catch-details > summary { font-size:14px !important; }
.extra-catch-body textarea { width:100%; resize:vertical; min-height:82px; }
.session-details-grid { display:none !important; }
@media (max-width: 620px) {
  .file-label-mini { min-height:50px; }
}


/* Clickable authors in spot details */
.spot-owner-row{display:flex;align-items:center;gap:7px;margin:7px 0 12px;color:var(--muted);font-size:13px}
.spot-owner-label{flex:0 0 auto}
.spot-owner-link{display:inline-flex;align-items:center;gap:7px;color:var(--text);font-weight:750;text-decoration:none;border-radius:10px;padding:3px 7px 3px 3px;transition:background .15s}
.spot-owner-link:hover{background:var(--input)}
.spot-owner-avatar{width:28px;height:28px;flex:0 0 28px;border-radius:50%;object-fit:cover;display:grid;place-items:center;background:var(--input);color:var(--primary);font-size:12px;font-weight:850;overflow:hidden}
.spot-owner-avatar img{width:100%;height:100%;object-fit:cover}
.spot-owner-avatar-placeholder{display:grid}
.catch-user{display:inline-flex;align-items:center;gap:5px;margin-left:6px;color:var(--text);text-decoration:none;vertical-align:middle;font-size:13px;font-weight:700}
.catch-user:hover{text-decoration:underline}
.catch-user img,.catch-user-avatar-placeholder{width:22px;height:22px;border-radius:50%;object-fit:cover;display:inline-grid;place-items:center;background:var(--input);color:var(--primary);font-size:10px;font-weight:800}
@media(max-width:700px){.spot-owner-row{margin:6px 0 10px}.spot-owner-avatar{width:30px;height:30px;flex-basis:30px}.catch-user{font-size:12px}}

/* Social / profiles */
.social-page,.profile-page{max-width:920px;margin:0 auto;padding-bottom:110px}
.social-search{margin:18px 0}.social-search h2{margin:0 0 12px}.friend-search-row{display:flex;gap:9px}.friend-search-row input{flex:1;min-width:0}
.social-section{margin-top:22px}.section-head{display:flex;align-items:center;justify-content:space-between}.section-head h2{margin:0 0 10px}.count-badge{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:11px;background:var(--primary);color:#fff;font-size:12px;vertical-align:2px}
.user-card{display:flex;align-items:center;gap:12px;padding:12px 14px;margin:7px 0;background:var(--surface-solid);border:1px solid var(--separator);border-radius:16px;box-shadow:var(--shadow-small)}
.user-avatar{width:46px;height:46px;flex:0 0 46px;overflow:hidden;border-radius:50%;display:grid;place-items:center;background:var(--input);color:var(--primary);font-weight:800;text-decoration:none}.user-avatar img{width:100%;height:100%;object-fit:cover}.user-main{min-width:0;flex:1}.user-main a{color:var(--text);text-decoration:none}.user-main b{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-main small{display:block;color:var(--muted);margin-top:3px}.user-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.request-pending,.friend-state{font-size:12px;color:var(--muted);font-weight:700}.search-error,.success-message{padding:12px;border-radius:12px;margin-top:10px;background:var(--input);color:var(--text-2)}
.profile-hero{padding:12px 0 20px}.profile-back{color:var(--muted);text-decoration:none;font-size:13px}.profile-identity{display:flex;align-items:center;gap:16px;margin:18px 0 14px}.avatar-xl{width:88px;height:88px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--input);color:var(--primary);font-size:32px;font-weight:850;flex:0 0 88px}.avatar-xl img{width:100%;height:100%;object-fit:cover}.profile-identity h1{margin:0;font-size:30px}.profile-identity p{margin:5px 0;color:var(--muted);font-weight:700}.profile-identity small{color:var(--muted)}.profile-stats h2{margin:26px 0 10px}.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.stat-grid>div{background:var(--surface-solid);border:1px solid var(--separator);border-radius:16px;padding:15px;text-align:center}.stat-grid b{display:block;font-size:24px}.stat-grid span{font-size:12px;color:var(--muted)}.record-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.record-card{background:var(--surface-solid);border:1px solid var(--separator);border-radius:16px;padding:14px}.record-card>span{font-size:12px;color:var(--muted);font-weight:750}.big-catch{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--separator)}.big-catch:last-child{border-bottom:0}.big-catch b,.big-catch small{display:block}.big-catch small{color:var(--muted);margin-top:3px;font-size:11px}.big-catch strong{white-space:nowrap}.fish-stat-list{background:var(--surface-solid);border:1px solid var(--separator);border-radius:16px;overflow:hidden}.fish-stat-list>div{display:flex;justify-content:space-between;gap:12px;padding:11px 14px;border-bottom:1px solid var(--separator)}.fish-stat-list>div:last-child{border-bottom:0}.fish-stat-list span{color:var(--muted);font-size:12px;text-align:right}.private-profile{text-align:center;padding:55px 20px;background:var(--surface-solid);border:1px solid var(--separator);border-radius:18px}.private-icon{font-size:35px}.private-profile p{color:var(--muted)}.friend-code{border:0;background:var(--input);color:var(--text);font:inherit;font-weight:850;letter-spacing:1px;padding:9px 13px;border-radius:10px;cursor:pointer}.switch{position:relative;width:48px;height:29px;flex:0 0 48px}.switch input{opacity:0;width:0;height:0}.switch span{position:absolute;inset:0;background:#aaa;border-radius:30px;transition:.2s}.switch span:before{content:"";position:absolute;width:23px;height:23px;left:3px;top:3px;border-radius:50%;background:#fff;transition:.2s;box-shadow:0 1px 3px rgba(0,0,0,.25)}.switch input:checked+span{background:var(--primary)}.switch input:checked+span:before{transform:translateX(19px)}
@media(max-width:700px){.social-page,.profile-page{padding:8px 14px calc(90px + env(safe-area-inset-bottom))}.friend-search-row{gap:7px}.friend-search-row .primary-btn{padding-inline:14px}.user-card{padding:10px}.user-actions{max-width:48%;}.user-actions button{font-size:12px}.stat-grid{grid-template-columns:repeat(2,1fr)}.record-grid{grid-template-columns:1fr}.profile-identity h1{font-size:25px}.avatar-xl{width:72px;height:72px;flex-basis:72px;font-size:27px}.profile-hero .profile-actions{margin-left:88px}.fish-stat-list>div{display:block}.fish-stat-list span{display:block;text-align:left;margin-top:3px}.friend-code-row{align-items:center}}
@media (max-width:700px){
  .bottom-nav{grid-template-columns:repeat(7,minmax(0,1fr)) !important}
  .bottom-nav .nav-item > span:last-child{font-size:8.5px !important}
  .bottom-nav .nav-item .nav-icon{font-size:19px !important}
}

/* Friends search — единая стилистика с остальными кнопками приложения */
.friend-search-row .primary-btn {
    flex:0 0 96px;
    min-height:46px;
    padding:0 16px;
    border:0;
    border-radius:12px;
    background:var(--primary);
    color:#fff;
    font-size:14px;
    font-weight:750;
    cursor:pointer;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    transition:transform .15s, opacity .15s, filter .15s;
}
.friend-search-row .primary-btn:hover { filter:brightness(1.06); }
.friend-search-row .primary-btn:active { transform:scale(.98); }
.friend-search-row .primary-btn:disabled { opacity:.55; cursor:default; }

@media(max-width:700px){
    .friend-search-row { display:grid; grid-template-columns:minmax(0,1fr) 88px; align-items:stretch; }
    .friend-search-row input { width:100%; min-height:46px; }
    .friend-search-row .primary-btn { width:100%; min-height:46px; padding:0 10px; }
}

/* Messenger */
.chat-page{max-width:1120px;margin:0 auto;padding-bottom:110px}.chat-page-title{margin-bottom:14px}.messenger{height:min(700px,calc(100vh - 170px));min-height:520px;display:grid;grid-template-columns:310px minmax(0,1fr);background:var(--surface-solid);border:1px solid var(--separator);border-radius:20px;overflow:hidden;box-shadow:var(--shadow-small)}.chat-sidebar{border-right:1px solid var(--separator);background:var(--surface-solid);overflow-y:auto}.chat-sidebar-head{height:62px;padding:0 16px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--separator);font-size:18px}.chat-mobile-close{display:none}.chat-list-item{width:100%;border:0;border-bottom:1px solid color-mix(in srgb,var(--separator) 60%,transparent);background:transparent;color:var(--text);display:flex;align-items:center;gap:11px;text-align:left;padding:11px 13px;cursor:pointer}.chat-list-item:hover,.chat-list-item.active{background:var(--input)}.chat-avatar,.chat-head-avatar,.message-avatar{border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--input);color:var(--primary);font-weight:850;flex:0 0 auto}.chat-avatar{width:44px;height:44px;font-size:20px}.chat-avatar img,.chat-head-avatar img,.message-avatar img{width:100%;height:100%;object-fit:cover}.chat-list-main{min-width:0;display:block;flex:1}.chat-list-main b,.chat-list-main small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-list-main small{color:var(--muted);margin-top:4px;font-size:12px}.chat-window{min-width:0;display:grid;grid-template-rows:auto 1fr auto;background:var(--bg)}.chat-head{height:62px;padding:8px 17px;display:flex;align-items:center;gap:11px;background:var(--surface-solid);border-bottom:1px solid var(--separator)}.chat-head-avatar{width:42px;height:42px;font-size:19px}.chat-head b,.chat-head small{display:block}.chat-head small{color:var(--muted);font-size:12px;margin-top:2px}.chat-back{display:none;border:0;background:transparent;color:var(--text);font-size:34px;line-height:1;cursor:pointer}.messages{overflow-y:auto;padding:20px 22px;display:flex;flex-direction:column;gap:11px}.message-row{display:flex;align-items:flex-end;gap:8px;max-width:78%}.message-row.mine{margin-left:auto;flex-direction:row-reverse}.message-avatar{width:30px;height:30px;font-size:11px}.message-body{min-width:0}.message-meta{display:flex;align-items:center;gap:7px;margin:0 5px 4px;font-size:11px;color:var(--muted)}.message-row.mine .message-meta{justify-content:flex-end}.message-meta a{color:var(--muted);text-decoration:none;font-weight:700}.message-meta a:hover{color:var(--text);text-decoration:underline}.message-bubble{display:inline-block;max-width:100%;padding:9px 12px;border-radius:15px 15px 15px 5px;background:var(--surface-solid);border:1px solid var(--separator);line-height:1.4;overflow-wrap:anywhere}.message-row.mine .message-bubble{background:var(--primary);border-color:var(--primary);color:#fff;border-radius:15px 15px 5px 15px}.chat-compose{display:flex;gap:9px;padding:11px;border-top:1px solid var(--separator);background:var(--surface-solid)}.chat-compose textarea{flex:1;resize:none;max-height:130px;min-height:44px;border:1px solid var(--separator);background:var(--input);color:var(--text);border-radius:14px;padding:11px 13px;font:inherit;outline:none}.chat-compose textarea:focus{border-color:var(--primary)}.chat-compose button{width:46px;height:44px;align-self:flex-end;border:0;border-radius:13px;background:var(--primary);color:#fff;font-size:19px;cursor:pointer}.chat-empty{display:grid;place-items:center;min-height:120px;padding:25px;text-align:center;color:var(--muted);font-size:14px;line-height:1.5}.chat-sidebar .chat-empty{padding:30px 18px}
@media(max-width:700px){.chat-page{padding:8px 10px calc(82px + env(safe-area-inset-bottom));height:calc(100vh - 65px);box-sizing:border-box}.chat-page-title{display:none}.messenger{height:calc(100vh - 80px - env(safe-area-inset-bottom));min-height:0;display:block;border-radius:16px;position:relative}.chat-sidebar,.chat-window{position:absolute;inset:0;width:100%;height:100%;transition:transform .2s ease}.chat-sidebar{z-index:2;border-right:0}.chat-window{z-index:1;transform:translateX(100%)}.messenger.mobile-chat-open .chat-sidebar{transform:translateX(-100%)}.messenger.mobile-chat-open .chat-window{transform:translateX(0)}.chat-mobile-close{display:none}.chat-back{display:block}.messages{padding:14px 12px}.message-row{max-width:88%}.chat-compose{padding:8px}.chat-compose textarea{min-height:42px}.chat-head{height:58px}.chat-sidebar-head{height:58px}.chat-list-item{padding:12px 13px}.bottom-nav{z-index:2000}}
.friend-chat-link{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
.profile-chat-link{text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
@media(max-width:700px){.profile-chat-link{min-height:42px;padding:0 14px}}


/* ===== Mobile navigation v2: five clean tabs + More sheet ===== */
.mobile-more-backdrop{display:none}
.mobile-more-menu{display:none}
.nav-more-btn{border:0;background:transparent;font:inherit;cursor:pointer}
.more-tile-form{margin:0}
.more-tile-button{width:100%;border:0;font:inherit;cursor:pointer}
.profile-code-line{display:block;color:var(--muted);font-size:11px;margin-top:5px}
@media(max-width:700px){
  .bottom-nav{
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    min-height:70px !important;
    height:70px !important;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom)) !important;
    gap:4px !important;
    border-top:1px solid var(--separator);
    background:color-mix(in srgb,var(--surface-solid) 92%,transparent);
  }
  .nav-item{
    min-height:56px !important;
    padding:5px 3px 3px !important;
    border-radius:13px;
    display:flex !important;
    align-items:center;
    justify-content:center;
    gap:3px;
    color:var(--muted);
    font-size:10px !important;
    line-height:1 !important;
    text-decoration:none;
    -webkit-tap-highlight-color:transparent;
  }
  .nav-item.active{color:var(--primary);background:color-mix(in srgb,var(--primary) 10%,transparent)}
  .nav-item:active{transform:scale(.97)}
  .nav-item .nav-icon{font-size:21px !important;line-height:22px !important;width:auto !important}
  .nav-item > span:last-child{font-size:10px !important;font-weight:700 !important;margin-top:1px !important;white-space:nowrap}
  .nav-more-btn{color:var(--muted)}
  .mobile-more-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.38);z-index:2998;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
  .mobile-more-backdrop.open{display:block}
  .mobile-more-menu{position:fixed;left:10px;right:10px;bottom:calc(78px + env(safe-area-inset-bottom));z-index:2999;display:block;padding:9px 12px 14px;background:var(--surface-solid);border:1px solid var(--separator);border-radius:22px;box-shadow:0 18px 55px rgba(0,0,0,.35);transform:translateY(18px);opacity:0;pointer-events:none;transition:transform .18s ease,opacity .18s ease}
  .mobile-more-menu.open{transform:translateY(0);opacity:1;pointer-events:auto}
  .mobile-more-grabber{width:38px;height:4px;border-radius:4px;background:var(--muted);opacity:.45;margin:1px auto 10px}
  .mobile-more-head{display:flex;align-items:center;justify-content:space-between;padding:0 4px 9px;font-size:18px}
  .mobile-more-head button{width:30px;height:30px;border:0;border-radius:50%;background:var(--input);color:var(--text);font-size:22px;line-height:1;cursor:pointer}
  .mobile-more-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .more-tile{min-height:76px;padding:10px 6px;border:1px solid var(--separator);border-radius:15px;background:var(--input);color:var(--text);text-decoration:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center}
  .more-tile span{font-size:22px;line-height:24px}
  .more-tile b{font-size:11px;line-height:1.15}
  .more-tile:active{transform:scale(.97)}
  .profile-editor .admin-badge{font-size:11px;padding:3px 7px;border-radius:6px;margin-right:4px}
  .profile-editor .profile-copy strong{display:block;font-size:21px;line-height:1.2}
}
@media(max-width:380px){
  .bottom-nav{padding-left:4px !important;padding-right:4px !important;gap:2px !important}
  .nav-item > span:last-child{font-size:9px !important}
  .nav-item .nav-icon{font-size:19px !important}
  .mobile-more-menu{left:7px;right:7px}
  .more-tile{min-height:70px}
}

.message-status{font-size:10px;color:var(--muted);margin-top:3px;text-align:right;min-height:12px;}

/* ===== Mobile chat final layout ===== */
@media(max-width:700px){
  .chat-page{
    height:calc(100dvh - 54px);
    min-height:0;
    padding:10px 8px calc(76px + env(safe-area-inset-bottom));
    overflow:hidden;
  }
  .messenger{
    width:100%;
    height:100%;
    min-height:0;
    border-radius:17px;
  }
  .chat-window{
    grid-template-rows:58px minmax(0,1fr) auto;
  }
  .messages{
    min-height:0;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .chat-compose{
    position:relative;
    z-index:4;
    padding:8px;
    padding-bottom:max(8px, env(safe-area-inset-bottom));
  }
  .chat-compose textarea{
    min-width:0;
    width:100%;
    min-height:43px;
    max-height:112px;
    font-size:16px;
  }
  .chat-compose button{
    flex:0 0 44px;
    width:44px;
    height:43px;
  }
  .chat-head{padding:7px 10px;}
  .chat-sidebar-head{padding:0 12px;}
  body.mobile-more-open{overflow:hidden;}
}


/* Восстановление пароля */
.reset-card { padding:20px; }
.reset-step-badge {
    display:inline-flex; align-items:center; padding:5px 9px; border-radius:999px;
    background:var(--input); color:var(--muted); font-size:10px; font-weight:800;
    margin-bottom:10px;
}
.reset-heading { margin:0 0 5px; font-size:21px; letter-spacing:-.02em; }
.reset-description { margin:0 0 17px; color:var(--muted); font-size:12px; line-height:1.45; }
.auth-info {
    margin-bottom:14px; padding:11px 12px; border-radius:12px;
    background:var(--input); color:var(--text-2); font-size:12px; line-height:1.4;
}
.auth-back {
    display:block; margin:14px 0 2px; text-align:center; color:var(--primary);
    text-decoration:none; font-size:12px; font-weight:700;
}
.auth-back:hover { text-decoration:underline; }
.reset-card input:disabled { opacity:.55; cursor:not-allowed; }

.forgot-password-link {
    display:block; width:max-content; max-width:100%; margin:12px auto 2px;
    color:var(--primary); text-decoration:none; font-size:12px; font-weight:700;
}
.forgot-password-link:hover { text-decoration:underline; }
