/* ==========================================================================
   Охотничий портал — минималистичная тема
   Светлый фон, нейтральные серые, один сдержанный акцент.
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --subtle: #F7F7F6;
  --hover: #F2F2F0;
  --ink: #18181B;
  --muted: #71717A;
  --line: #E4E4E7;
  --line-soft: #EFEFF1;
  --accent: #2F5D46;
  --accent-hover: #264C39;
  --accent-wash: #EEF3F0;
  --warn: #9A5B13;
  --warn-wash: #FBF5EC;
  --danger: #B42318;
  --danger-wash: #FDF1F0;

  /* старые имена — для JS (графики, карта) и обратной совместимости */
  --spruce: var(--ink);
  --spruce-2: #A1A1AA;
  --spruce-3: #71717A;
  --lichen: var(--subtle);
  --paper: var(--surface);
  --blaze: var(--accent);
  --blaze-ink: var(--accent);
  --blaze-wash: var(--accent-wash);
  --moss: var(--accent);
  --moss-wash: var(--accent-wash);
  --bark: #A1A1AA;

  --font-display: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 4px;
  --r: 6px;
  --r-lg: 8px;
  --sidebar: 232px;
  --focus: 0 0 0 3px rgba(47, 93, 70, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; color: var(--ink); }
h1 { font-size: 1.6rem; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
small { font-size: .82rem; }
b { font-weight: 600; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.tnum, .num, .figure, .figure-sm { font-variant-numeric: tabular-nums lining-nums; }
.grow { flex: 1 1 auto; min-width: 0; }
.ico { flex: none; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 20px 12px 12px;
  background: var(--subtle);
  border-right: 1px solid var(--line);
  color: var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px; }
.brand img { display: none; }
.brand span { font-weight: 600; font-size: .98rem; line-height: 1.25; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r);
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: .93rem;
  transition: background-color .12s, color .12s;
}
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link.is-active { background: var(--hover); color: var(--ink); }
.nav-link.is-active .ico { color: var(--ink); }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 1; min-width: 0; padding: 4px 6px; border-radius: var(--r); }
.me:hover { background: var(--hover); }
.me b { display: block; color: var(--ink); font-size: .88rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: var(--muted); }

.main { padding: 32px clamp(18px, 3vw, 40px) 56px; max-width: 1240px; width: 100%; }

/* ---------- заголовки страниц ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head-tight { margin: 32px 0 14px; align-items: center; }
.lede { margin-top: 4px; color: var(--muted); font-size: .95rem; max-width: 62ch; }
.h-section { font-size: 1.15rem; }
.crumbs { margin-bottom: 6px; font-size: .85rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs a::before { content: "← "; }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- элементы управления ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 7px 14px;
  border: 1px solid transparent; border-radius: var(--r);
  font: 500 .9rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--subtle); }
.btn-quiet { background: transparent; color: var(--muted); padding-inline: 10px; }
.btn-quiet:hover { color: var(--ink); background: var(--hover); }
.btn-danger { background: var(--surface); border-color: var(--line); color: var(--danger); }
.btn-danger:hover { background: var(--danger-wash); border-color: #F2C9C5; }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: .84rem; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--r); background: transparent; color: var(--muted); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.link { color: var(--accent); font-weight: 500; font-size: .88rem; text-decoration: none; }
.link:hover { text-decoration: underline; }

input, select, textarea {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
  font: 400 .93rem/1.4 var(--font-body);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--accent); }
input[type="color"] { padding: 3px; height: 36px; cursor: pointer; }
.head-tools input, .head-tools select { width: auto; }
.head-tools input[type="search"] { min-width: 220px; }

.field { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 500; font-size: .86rem; color: var(--ink); padding: 0; }
.field small { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.align-end { align-items: end; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.inline-form { display: flex; align-items: flex-end; gap: 10px; }
.inline-form.end { justify-content: flex-end; }
form.inline { display: inline; }

.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: var(--r); background: var(--hover); width: fit-content; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; padding: 5px 12px; font-weight: 500; font-size: .87rem; color: var(--muted); border-radius: var(--r-sm); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

.form-error { padding: 10px 12px; border-radius: var(--r); background: var(--danger-wash); color: var(--danger); font-size: .9rem; }
.form-error ul { margin: 0; padding-left: 18px; }

/* ---------- уведомления ---------- */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.flash { padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--subtle); font-size: .92rem; }
.flash-error { border-color: #F2C9C5; background: var(--danger-wash); color: var(--danger); }
.notice {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--subtle); color: var(--ink);
  font-weight: 500; font-size: .92rem; text-decoration: none;
}
.notice .ico { color: var(--warn); }
.notice:hover { background: var(--hover); }

/* ---------- панели и сетки ---------- */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-form { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }
.grid-hunt { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; min-width: 0; }
.panel > h2, .panel-head { margin-bottom: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.panel-head h2 { margin: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head.pad-x { padding: 16px 20px 0; }
.panel.narrow { max-width: 720px; }
.panel.attention { border-color: #EAD9BF; background: var(--warn-wash); }
.danger-zone { margin-top: 8px; }
.pad { padding: 20px; }
.empty { color: var(--muted); padding: 6px 0; font-size: .92rem; }

/* ---------- итоговая строка ---------- */
.tally {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  margin-bottom: 16px; overflow: hidden;
}
.tally-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tally-cell { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-left: 1px solid var(--line); min-width: 0; }
.tally-cell:first-child { border-left: 0; }
.tally-cell strong {
  font-weight: 600; font-size: 1.75rem; line-height: 1.1; letter-spacing: -.02em;
  color: var(--ink); font-variant-numeric: lining-nums tabular-nums;
}
.tally-cell strong small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tally-cell > span { color: var(--muted); font-size: .85rem; line-height: 1.3; }

/* ---------- списки ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--line-soft); }
.list > li:first-child { border-top: 0; }
.row, .row-link { display: flex; align-items: center; gap: 12px; padding: 9px 0; min-width: 0; }
.row-link { text-decoration: none; margin: 0 -8px; padding-inline: 8px; border-radius: var(--r); }
.row-link:hover { background: var(--subtle); }
.row b, .row-link b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row small, .row-link small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > a.grow { text-decoration: none; font-weight: 500; }
.row > a.grow:hover { color: var(--accent); }
.figure { font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.figure-sm { font-weight: 500; color: var(--ink); min-width: 3.2em; text-align: right; }
.ranking { counter-reset: rank; }

.datechip {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: var(--r); background: var(--subtle); line-height: 1.1;
}
.datechip b { font-weight: 600; font-size: 1rem; color: var(--ink); }
.datechip span { font-size: .7rem; color: var(--muted); }

.avatar {
  flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--hover); color: var(--muted); font-weight: 500; font-size: .75rem; letter-spacing: .02em;
}
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); white-space: nowrap;
  font-size: .76rem; font-weight: 500; line-height: 1.6; vertical-align: middle;
  background: var(--hover); color: var(--muted);
}
.badge-done, .badge-active { background: var(--accent-wash); color: var(--accent); }
.badge-planned { background: var(--warn-wash); color: var(--warn); }
.badge-cancelled, .badge-expired { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge-used { background: var(--hover); color: var(--muted); }

.meter { flex: none; display: inline-block; width: 120px; height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; vertical-align: middle; }
.meter > span { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.meter.is-full > span { background: var(--accent); }
.meter-row { display: inline-flex; align-items: center; gap: 10px; }
.tally-cell .meter { width: 100%; margin: 6px 0 2px; }
.progress-panel { margin-bottom: 16px; }
.progress-panel .meter { width: 100%; height: 6px; }
.progress-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.progress-head b { font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.progress-head span { color: var(--muted); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-weight: 500; font-size: .8rem; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent;
}
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--subtle); }
.table .num { text-align: right; }
.table a { text-decoration: none; font-weight: 500; }
.table a:hover { color: var(--accent); }
.table tr.is-off td { color: var(--muted); }
.table tr.is-pending td { background: var(--warn-wash); }
.table tr:target td { background: var(--accent-wash); }
.table-compact td, .table-compact th { padding: 8px 6px; }
.table-compact th:first-child, .table-compact td:first-child { padding-left: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.person b { display: block; font-weight: 500; }
.person small { display: block; color: var(--muted); }

/* ---------- охоты ---------- */
.hunt-list { list-style: none; margin: 0; padding: 0; }
.hunt-list li + li { border-top: 1px solid var(--line-soft); }
.hunt-row { display: flex; align-items: center; gap: 14px; padding: 10px 20px; text-decoration: none; }
.hunt-row:hover { background: var(--subtle); }
.hunt-row b { display: block; font-weight: 500; }
.hunt-row small { display: block; color: var(--muted); }
.hunt-list li.is-mine .datechip { background: var(--accent-wash); }
.hunt-list li.is-mine .datechip b { color: var(--accent); }
.hunt-figs { display: flex; gap: 14px; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.hunt-figs > span { display: inline-flex; align-items: center; gap: 5px; min-width: 38px; }
.hunt-figs .has { color: var(--ink); font-weight: 500; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 16px; }
.facts dt { font-size: .8rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.facts a { color: var(--accent); text-decoration: none; }
.note { padding: 10px 12px; background: var(--subtle); border-radius: var(--r); margin-bottom: 16px; white-space: pre-line; font-size: .92rem; }
.mini-map { height: 240px; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }

.harvest-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.harvest-form h3 { margin-bottom: 12px; }
.harvest-grid { display: grid; grid-template-columns: 1.6fr 1.2fr .6fr .8fr .8fr; gap: 12px; margin-bottom: 14px; }
.harvest-grid .span-2 { grid-column: 1 / -1; }

.picklist { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow: auto; }
.picklist li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r); }
.picklist li + li { margin-top: 1px; }
.picklist li.is-on { background: var(--subtle); }
.pick { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; font-size: .92rem; }
.picklist select { width: 128px; min-height: 30px; padding: 3px 8px; font-size: .84rem; }
.picklist li:not(.is-on) select { opacity: .45; }

/* ---------- профиль охотника ---------- */
.license {
  display: flex; align-items: center; gap: 20px;
  padding: 0 0 24px; border-bottom: 1px solid var(--line);
}
.license.is-off { opacity: .65; }
.license-body { flex: 1; min-width: 0; }
.license-kind { color: var(--muted); font-size: .85rem; }
.license-kind .tnum { color: var(--ink); }
.license h1 { margin: 2px 0 16px; }
.license-meta { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 10px 36px; margin: 0; justify-content: start; }
.license-meta dt { font-size: .78rem; color: var(--muted); }
.license-meta dd { margin: 2px 0 0; color: var(--ink); font-size: .92rem; }
.license-flag { display: inline-block; margin-top: 14px; padding: 1px 8px; border-radius: var(--r-sm); background: var(--hover); font-size: .78rem; color: var(--muted); }
.license-seal { flex: none; order: -1; align-self: flex-start; }
.license-seal span {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--hover); color: var(--muted); font-weight: 500; font-size: 1.1rem;
}

/* ---------- вход ---------- */
.page-login { background: var(--subtle); }
.login { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-art { display: none; }
.login-form { width: 100%; max-width: 360px; }
.login-form form { width: 100%; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.login-form h1 { font-size: 1.3rem; }
.login-estate-sm { color: var(--muted); font-size: .88rem; margin-bottom: -10px; }

.page-error { display: grid; place-items: center; min-height: 100vh; }
.error-box { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 24px; max-width: 420px; }
.error-code { font-weight: 600; font-size: 3.5rem; line-height: 1; color: var(--ink); letter-spacing: -.03em; }

/* ---------- карта ---------- */
.page-map .main { padding: 0; max-width: none; height: 100vh; position: relative; }
.page-map .flashes { position: absolute; z-index: 1001; top: 12px; left: 50%; transform: translateX(-50%); width: min(520px, 90%); }
.map-wrap { position: relative; height: 100%; }
.map { position: absolute; inset: 0; background: var(--line-soft); }
.map-panel {
  position: absolute; z-index: 1000; top: 12px; left: 12px; bottom: 12px; width: 300px;
  display: flex; flex-direction: column; gap: 12px; padding: 16px 14px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 4px 16px -8px rgba(0, 0, 0, .15);
}
.map-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.map-panel-head h1 { font-size: 1.15rem; }
.map-panel-toggle { display: none; }
.feature-lists { flex: 1; overflow: auto; margin: 0 -6px; padding: 0 6px; }
.map-panel.is-collapsed { bottom: auto; }
.map-panel.is-collapsed .feature-lists, .map-panel.is-collapsed #featureSearch, .map-panel.is-collapsed .map-hint { display: none; }
.map-hint { display: flex; flex-direction: column; gap: 10px; font-size: .8rem; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--line-soft); }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 3px; }

.fl-group + .fl-group { margin-top: 12px; }
.fl-head { display: flex; align-items: center; gap: 8px; padding: 4px 2px 4px; cursor: pointer; font-weight: 500; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fl-count { margin-left: auto; font-size: .78rem; font-weight: 400; color: var(--muted); }
.fl-group ul { list-style: none; margin: 0; padding: 0; }
.fl-group.is-hidden ul { opacity: .45; }
.fl-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--r);
  background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
}
.fl-item:hover { background: var(--subtle); }
.fl-name { flex: 1; min-width: 0; font-weight: 400; font-size: .9rem; line-height: 1.25; }
.fl-name small { display: block; color: var(--muted); font-size: .76rem; }
.fl-meta { font-size: .78rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fl-empty { padding: 4px 8px; color: var(--muted); font-size: .85rem; }
.sw { flex: none; display: inline-block; }
.sw-area { width: 14px; height: 12px; border-radius: 2px; background: color-mix(in srgb, var(--c) 25%, transparent); border: 1.5px solid var(--c); }
.sw-trail { width: 16px; height: 0; border-top: 2px dashed var(--c); }
.sw-point { width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin: 0 2px; }

.poi { background: none; border: 0; }
.poi-pin {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c, #71717A); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.poi-pin svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.leaflet-tooltip.area-label {
  background: transparent; border: 0; box-shadow: none; padding: 0;
  font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px #fff;
}
.leaflet-tooltip.area-label::before { display: none; }
.hide-labels .area-label { display: none; }
.leaflet-tooltip.trail-label { font-family: var(--font-body); font-weight: 500; border-radius: var(--r-sm); }
.leaflet-container { font-family: var(--font-body); }
.leaflet-container .leaflet-control-attribution { padding: 0 6px; font-size: 10px; line-height: 16px; color: var(--muted); background: rgba(255, 255, 255, .6); border-top-left-radius: var(--r-sm); }
.leaflet-container .leaflet-control-attribution a { color: var(--muted); text-decoration: none; }
.leaflet-container .leaflet-control-attribution a:hover { color: var(--ink); text-decoration: underline; }
.leaflet-popup-content-wrapper { border-radius: var(--r-lg); box-shadow: 0 4px 16px -6px rgba(0, 0, 0, .2); }
.leaflet-popup-content { margin: 12px 14px; }
.pop h3 { font-size: 1rem; margin: 2px 0 6px; }
.pop p { margin: 0 0 6px; font-size: .88rem; line-height: 1.45; }
.pop .pop-cat { color: var(--muted); font-size: .78rem; margin: 0; }
.pop .pop-stats { padding-top: 8px; border-top: 1px solid var(--line-soft); }
.pop-link { color: var(--accent) !important; font-weight: 500; text-decoration: none; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pop-actions button { border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); padding: 3px 9px; font: 500 .8rem var(--font-body); cursor: pointer; color: var(--ink); }
.pop-actions button:hover { background: var(--subtle); }
.pop-actions button.danger { color: var(--danger); }
.is-editing .leaflet-interactive { cursor: move; }

.edit-bar {
  position: absolute; z-index: 1001; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .2); font-size: .9rem;
}
.edit-bar[hidden] { display: none; }

.dialog { width: min(480px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); }
.dialog::backdrop { background: rgba(0, 0, 0, .3); }

/* ---------- путёвка для печати ---------- */
.page-print { background: var(--subtle); padding: 24px; }
.print-tools { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.voucher { max-width: 720px; margin: 0 auto; padding: 44px 52px; background: #fff; border: 1px solid var(--line); }
.voucher header { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--ink); margin-bottom: 20px; }
.voucher-estate { color: var(--muted); }
.voucher h1 { margin: 6px 0 4px; font-size: 1.6rem; }
.voucher-fields { display: grid; gap: 0; margin: 0; }
.voucher-fields div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.voucher-fields dt { color: var(--muted); }
.voucher-fields dd { margin: 0; font-weight: 500; }
.voucher-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 48px; }
.voucher-sign div { display: grid; gap: 4px; }
.voucher-sign span { font-size: .8rem; color: var(--muted); }
.voucher-sign i { display: block; height: 32px; border-bottom: 1px solid var(--ink); }
@media print {
  .page-print { background: #fff; padding: 0; }
  .print-tools { display: none; }
  .voucher { border: 0; padding: 24px 0; }
}

/* ---------- адаптивность ---------- */
@media (max-width: 1180px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tally-cell:nth-child(n + 4) { border-top: 1px solid var(--line); }
  .tally-cell:nth-child(4) { border-left: 0; }
  .harvest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .license-meta { grid-template-columns: repeat(2, minmax(0, auto)); }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 1100;
    padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink);
  }
  .topbar-brand { font-weight: 600; font-size: .98rem; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar {
    position: fixed; z-index: 1200; left: 0; top: 0; bottom: 0; width: min(280px, 84vw);
    transform: translateX(-100%); transition: transform .2s ease-out;
  }
  .nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .3); }
  .grid-2, .grid-form, .grid-hunt { grid-template-columns: 1fr; }
  .page-map .main { height: calc(100vh - 49px); height: calc(100dvh - 49px); }
}

@media (max-width: 760px) {
  .main { padding: 20px 14px 40px; }
  .grid-3 { grid-template-columns: 1fr; }
  .tally, .tally-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tally-cell { border-left: 0; border-top: 1px solid var(--line); }
  .tally-cell:nth-child(-n + 2) { border-top: 0; }
  .tally-cell:nth-child(2n) { border-left: 1px solid var(--line); }
  .tally:not(.tally-4) .tally-cell:first-child { grid-column: 1 / -1; }
  .tally:not(.tally-4) .tally-cell:nth-child(2) { border-left: 0; border-top: 1px solid var(--line); }
  .tally:not(.tally-4) .tally-cell:nth-child(2n) { border-left: 0; }
  .tally:not(.tally-4) .tally-cell:nth-child(2n + 1):not(:first-child) { border-left: 1px solid var(--line); }
  .tally-cell strong { font-size: 1.5rem; }
  .cols-2 { grid-template-columns: 1fr; }
  .harvest-grid { grid-template-columns: 1fr 1fr; }
  .head-tools, .head-tools input[type="search"] { width: 100%; }
  .head-tools input[type="search"] { min-width: 0; flex: 1; }
  .license { align-items: flex-start; }
  .license-seal span { width: 44px; height: 44px; font-size: .95rem; }
  .license-meta { grid-template-columns: 1fr 1fr; gap: 10px 20px; }
  .hunt-row { flex-wrap: wrap; padding: 10px 16px; }
  .hunt-row .grow { flex-basis: calc(100% - 56px); }
  .hunt-figs { margin-left: 56px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .map-panel { top: 10px; left: 10px; right: 10px; width: auto; bottom: 10px; }
  .map-panel-toggle { display: inline-grid; }
  .map-panel.is-collapsed { padding-block: 10px; }
  .edit-bar { flex-wrap: wrap; justify-content: center; width: calc(100% - 24px); }
  .voucher { padding: 28px 22px; }
  .voucher-fields div { grid-template-columns: 1fr; gap: 2px; }
  .table th, .table td { padding: 9px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
