:root {
  --bg: #f4f6f5; --card: #ffffff; --ink: #1b2622; --muted: #66746e; --line: #dde3e0;
  --accent: #1d6f5f; --accent-soft: #e2f0ec; --warn: #b5541c; --good: #2a8a4a; --mid: #c79a1b; --bad: #b8433a;
  --past: #eef1ef; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --land: #eceee6; --water: #d3e6f0; --shoreline: #7d9aa8; --note-bg: #fbefe6; --note-ink: #7a3a12; --neg-bg: #f6e3e1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111715; --card: #19211e; --ink: #e5ece9; --muted: #93a29b; --line: #2a3531;
    --accent: #5cc2a8; --accent-soft: #1d332d; --past: #151c19; --shadow: none;
    --land: #1c2420; --water: #22394a; --shoreline: #3f6577; --note-bg: #3a2518; --note-ink: #f0c7a8; --neg-bg: #3b2220;
  }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #111715; --card: #19211e; --ink: #e5ece9; --muted: #93a29b; --line: #2a3531;
    --accent: #5cc2a8; --accent-soft: #1d332d; --past: #151c19; --shadow: none;
    --land: #1c2420; --water: #22394a; --shoreline: #3f6577; --note-bg: #3a2518; --note-ink: #f0c7a8; --neg-bg: #3b2220;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0; font-weight: 650; }
button, select, input { font: inherit; color: inherit; }
select, input { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand h1 { font-size: 18px; }
.brand .sub { color: var(--muted); font-size: 12.5px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.controls label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 11px; cursor: pointer; }
.seg button.on { background: var(--accent); color: #fff; }
.btn { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.file { display: inline-flex; align-items: center; }

.strip-wrap { padding: 10px 16px 4px; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.day { flex: 0 0 82px; scroll-snap-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 7px; text-align: center; cursor: pointer; position: relative; }
.day.past { background: var(--past); }
.day.today { border-color: var(--accent); }
.day.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.day .dw { font-size: 10px; white-space: nowrap; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.day .dd { font-weight: 600; font-size: 13px; }
.day .idx { margin: 4px auto 2px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 14px; }
.day .tw { font-size: 11px; color: var(--muted); }
.day .tag { position: absolute; top: 3px; right: 4px; font-size: 9.5px; color: var(--muted); }
.day.has-catch::after { content: ""; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 12px; padding: 8px 16px; }
@media (max-width: 980px) { .grid { grid-template-columns: 1fr; } }
.mapcol { position: relative; }
#map { height: 680px; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
@media (max-width: 980px) { #map { height: 460px; } }
.legend { position: absolute; left: 10px; bottom: 10px; z-index: 500; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; font-size: 11.5px; box-shadow: var(--shadow); max-width: 260px; }
.legend .bands { display: flex; margin: 4px 0; }
.legend .bands span { flex: 1; height: 10px; }
.legend .ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: 10.5px; }
.legend .hover { margin-top: 4px; font-weight: 600; min-height: 1.3em; }

.panel { display: flex; flex-direction: column; gap: 10px; max-height: 680px; overflow-y: auto; padding-right: 2px; }
@media (max-width: 980px) { .panel { max-height: none; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.dayhead { display: flex; align-items: center; gap: 12px; }
.bigidx { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 22px; font-weight: 750; flex: none; }
.dayhead h2 { font-size: 16px; }
.dayhead .kind { color: var(--muted); font-size: 12.5px; }
.wx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; margin-top: 10px; font-size: 12.5px; }
.wx div b { display: block; font-size: 14px; }
.wx div span { color: var(--muted); }
.notes { margin: 10px 0 0; padding: 0; list-style: none; }
.notes li { background: var(--note-bg); color: var(--note-ink); border-radius: 8px; padding: 6px 9px; margin-top: 5px; font-size: 12.5px; }

.sp { cursor: pointer; }
.sp + .sp { margin-top: 0; }
.sp .row { display: flex; align-items: center; gap: 10px; }
.sp .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.sp .nm { font-weight: 600; flex: 1; }
.sp .bar { width: 110px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.sp .bar i { display: block; height: 100%; border-radius: 4px; }
.sp .val { width: 30px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sp .detail { display: none; margin-top: 10px; font-size: 13px; }
.sp.open .detail { display: block; }
.sp.open { border-color: var(--accent); }
.sp .detail h4 { margin: 10px 0 3px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.sp .detail ul { margin: 0; padding-left: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chip { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 2px 9px; font-size: 12px; }
.chip.neg { background: var(--neg-bg); color: var(--bad); }
.hours { display: flex; align-items: flex-end; gap: 1px; height: 46px; margin-top: 6px; }
.hours i { flex: 1; background: var(--accent); opacity: .85; border-radius: 2px 2px 0 0; }
.hours i.win { background: var(--warn); }
.hlabels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.spotlist { margin: 4px 0 0; padding-left: 18px; }
.spotlist a { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px dotted; }

.history { padding: 6px 16px 24px; }
.hist-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; }
.hist-head h2 { font-size: 16px; }
.hist-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.hist-legend i { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; border-radius: 2px; }
#chart { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); overflow-x: auto; }
#chart svg { display: block; }
#chart text { fill: var(--muted); font-size: 10.5px; }
.fine { color: var(--muted); font-size: 12px; max-width: 980px; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); padding: 0; width: min(860px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.dlg { padding: 16px; }
.jform { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.jform label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.jform .wide { grid-column: span 2; }
.jform .ll { display: flex; gap: 4px; }
.jform .ll input { width: 90px; }
@media (max-width: 640px) { .jform { grid-template-columns: 1fr 1fr; } }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.jtable { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; }
.jtable th, .jtable td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.jtable button { border: 0; background: none; color: var(--bad); cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 9px; z-index: 2000; font-size: 13px; }
.leaflet-popup-content { font-size: 13px; line-height: 1.4; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: 14px; }
.leaflet-popup-content .muted { color: #6a7570; }
.spot-ico { border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; }
.spot-ico.dim { opacity: .45; }
.spot-ico.hot { box-shadow: 0 0 0 3px rgba(255,170,40,.85); }
.catch-ico { font-size: 18px; text-shadow: 0 0 2px #fff; }
.picking #map { cursor: crosshair; }

.offline #map { background: var(--land); }
.place-lbl { background: transparent; border: 0; box-shadow: none; color: var(--ink); font-size: 11.5px; font-weight: 600; text-shadow: 0 0 3px var(--land), 0 0 3px var(--land); padding: 0; }
.place-lbl::before { display: none; }
.trib-lbl { color: var(--shoreline); font-size: 10.5px; font-style: italic; white-space: nowrap; text-shadow: 0 0 3px var(--land); }
.leaflet-control-layers-toggle { background-image: none !important; width: auto !important; height: auto !important; padding: 6px 10px; font-size: 12px; color: #222; text-decoration: none; }
.leaflet-control-layers-toggle::after { content: "Слои"; }
.leaflet-popup-content .muted { color: #6a7570; }

.bigidx { display: flex; align-items: baseline; justify-content: center; padding-top: 14px; }
.bigidx small { font-size: 11px; font-weight: 600; opacity: .85; margin-left: 1px; }
.spot-ico.chat { border-radius: 5px; }

.plan { background: #fff4e6; color: #5c2d0a; border-radius: 8px; padding: 6px 8px; margin: 6px 0; line-height: 1.45; }
.boat-ico { font-size: 18px; line-height: 22px; text-align: center; filter: drop-shadow(0 0 2px #fff); }
.arrowhead { color: #e8590c; font-size: 16px; line-height: 18px; text-align: center; text-shadow: 0 0 2px #fff; }
.plan-lbl { background: #e8590c; color: #fff; border: 0; font-weight: 600; font-size: 11.5px; padding: 2px 6px; box-shadow: none; }
.plan-lbl::before { display: none; }
.legend .marks { margin-top: 4px; color: var(--muted); font-size: 11px; }
.legend .marks[open] { display: grid; gap: 3px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.legend .mk { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: #7a5bd1; color: #fff; font-size: 9px; font-style: normal; vertical-align: -3px; margin-right: 3px; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.legend .mk.chat { border-radius: 4px; background: #1f8a70; }
.legend .mk.hot { box-shadow: 0 0 0 2px rgba(255,170,40,.9); }
.legend .marks summary { cursor: pointer; color: var(--accent); }
.plan-lbl.boat { background: #1d6f5f; }

.add-mark { background: var(--card); color: var(--accent); border: 2px solid rgba(0,0,0,.2); border-radius: 6px; padding: 5px 9px; font: 600 12.5px/1.2 inherit; cursor: pointer; }
.del-mark { margin-top: 6px; padding: 3px 9px; font-size: 12px; color: var(--bad); border-color: var(--bad); }
.bays h3 { font-size: 14px; margin-bottom: 8px; }
.bays .vs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bays .vs > div { border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; }
.bays .vs > div.win { border-color: var(--accent); background: var(--accent-soft); }
.bays .vs span { display: block; font-size: 12px; color: var(--muted); }
.bays .vs b { font-size: 18px; }
.bays .verdict { font-weight: 650; margin: 8px 0 4px; }
.bays .why { margin: 0; padding-left: 18px; font-size: 12.5px; }
.bays .why li.bay::marker { color: #2fa36b; }
.bays .why li.main::marker { color: #3480c0; }
.bays a { color: var(--accent); cursor: pointer; border-bottom: 1px dotted; }

.my-mark { width: 22px; height: 22px; display: grid; place-items: center; font-size: 20px; line-height: 1; color: #f4b400; text-shadow: 0 0 2px #000, 0 0 1px #000; }
.spot-ico.chart { border-radius: 5px; }
.legend .mk.star { background: none; border: 0; box-shadow: none; color: #f4b400; font-size: 14px; text-shadow: 0 0 1px #000; }
.legend .mk.chart { border-radius: 4px; }

.leaflet-top.leaflet-left .add-mark { display: block; margin-top: 6px; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26,115,232,.25), 0 1px 4px rgba(0,0,0,.4); }
.cond { margin: 4px 0; padding-left: 0; list-style: none; font-size: 12.5px; }
.cond li { margin: 2px 0; }
.water h3 { font-size: 14px; margin-bottom: 8px; }
.wrows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wrows > div { border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; }
.wrows span { display: block; font-size: 11.5px; color: var(--muted); }
.wrows b { display: block; font-size: 15px; }
.wrows i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }
