:root {
  color-scheme: light;
  --primary: #1f7a44;
  --primary-dark: #124d29;
  --teal: #2f9259;
  --teal-light: #e2f3e7;
  --accent: #46a94f;
  --accent-2: #58c25d;
  --accent-light: #e6f4e8;
  --amber: #f0a429;
  --amber-light: #fff5dc;
  --ink: #24332b;
  --muted: #5f7165;
  --bg: #f4f6ee;
  --bg-glow: #f4f6ee;
  --surface: #ffffff;
  --surface-2: #eaf1e8;
  --border: #dfe6db;
  --field-bg: #fbfdf9;
  --map-bg: #eaf1e4;
  --plot-idle: #a3b7a2;
  --plot-registered: #27ae60;
  --plot-unregistered: #a8a050;
  --danger: #c23b30;
  --danger-light: #fdeceb;
  --success-text: #1f6b38;
  --warn-bg: #fff5dc;
  --warn-text: #8f5a10;
  --header-bg: rgba(255, 255, 255, 0.86);
  --header-border: rgba(31, 122, 68, 0.16);
  --header-hover: rgba(31, 122, 68, 0.08);
  --header-text: #24332b;
  --header-muted: rgba(36, 51, 43, 0.66);
  --footer-grad: linear-gradient(120deg, #124d29, #1f7a44);
  --footer-text: #cfe0d4;
  --grad: linear-gradient(120deg, #1f7a44, #3a9c54 55%, #8bc34a);
  --shadow-sm: 0 1px 3px rgba(31, 122, 68, 0.08), 0 4px 12px rgba(31, 122, 68, 0.06);
  --shadow: 0 6px 20px rgba(31, 122, 68, 0.1);
  --shadow-lg: 0 18px 50px rgba(18, 77, 41, 0.22);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #5bd27e;
  --primary-dark: #a9e8bd;
  --teal: #4cc06d;
  --teal-light: #173a24;
  --accent: #5adf86;
  --accent-2: #6fe07f;
  --accent-light: #143722;
  --amber: #f0b429;
  --amber-light: #3d2c12;
  --ink: #dce8de;
  --muted: #9cb4a4;
  --bg: #10170f;
  --bg-glow: radial-gradient(1100px 480px at 18% -12%, rgba(90, 223, 134, 0.14), transparent 60%), radial-gradient(900px 420px at 85% 0%, rgba(240, 180, 41, 0.08), transparent 55%), #10170f;
  --surface: #162116;
  --surface-2: #1d2c1e;
  --border: #2c4430;
  --field-bg: #0f1710;
  --map-bg: #122017;
  --plot-idle: #3c5543;
  --plot-registered: #5adf86;
  --plot-unregistered: #a8b45a;
  --danger: #ef6a5e;
  --danger-light: #3a201d;
  --success-text: #7fd99a;
  --warn-bg: #3d2c12;
  --warn-text: #efc378;
  --header-bg: rgba(16, 23, 15, 0.9);
  --header-border: rgba(90, 223, 134, 0.2);
  --header-hover: rgba(90, 223, 134, 0.1);
  --header-text: #dce8de;
  --header-muted: rgba(220, 232, 222, 0.68);
  --footer-grad: linear-gradient(120deg, #0a1209, #13301d);
  --footer-text: #b6cdba;
  --grad: linear-gradient(120deg, #1f9e54, #45c96e 55%, #a5c64a);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --primary: #5bd27e;
    --primary-dark: #a9e8bd;
    --teal: #4cc06d;
    --teal-light: #173a24;
    --accent: #5adf86;
    --accent-2: #6fe07f;
    --accent-light: #143722;
    --amber: #f0b429;
    --amber-light: #3d2c12;
    --ink: #dce8de;
    --muted: #9cb4a4;
    --bg: #10170f;
    --bg-glow: radial-gradient(1100px 480px at 18% -12%, rgba(90, 223, 134, 0.14), transparent 60%), radial-gradient(900px 420px at 85% 0%, rgba(240, 180, 41, 0.08), transparent 55%), #10170f;
    --surface: #162116;
    --surface-2: #1d2c1e;
    --border: #2c4430;
    --field-bg: #0f1710;
    --map-bg: #122017;
    --plot-idle: #3c5543;
    --plot-registered: #5adf86;
    --plot-unregistered: #a8b45a;
    --danger: #ef6a5e;
    --danger-light: #3a201d;
    --success-text: #7fd99a;
    --warn-bg: #3d2c12;
    --warn-text: #efc378;
    --header-bg: rgba(16, 23, 15, 0.9);
    --header-border: rgba(90, 223, 134, 0.2);
    --header-hover: rgba(90, 223, 134, 0.1);
    --header-text: #dce8de;
    --header-muted: rgba(220, 232, 222, 0.68);
    --footer-grad: linear-gradient(120deg, #0a1209, #13301d);
    --footer-text: #b6cdba;
    --grad: linear-gradient(120deg, #1f9e54, #45c96e 55%, #a5c64a);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(47, 143, 80, 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg-glow);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s, color 0.25s;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--teal); }

h1, h2, h3, h4 {
  color: var(--primary-dark);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 0;
}
h1 { font-size: 2.1rem; margin-bottom: 10px; }
h2 { font-size: 1.6rem; margin-bottom: 14px; position: relative; padding-bottom: 9px; }
h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--grad);
}
h3 { font-size: 1.15rem; margin-bottom: 6px; }
h4 { font-size: 1rem; margin-bottom: 6px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--header-border);
  color: var(--header-text);
  transition: box-shadow 0.2s;
  animation: menuFloat 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes menuFloat {
  from { transform: translateY(-14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes pageFloat {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
::view-transition-old(root) { animation: vtOut 0.28s ease; }
::view-transition-new(root) { animation: vtIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes vtOut { to { transform: translateY(-18px); opacity: 0; } }
@keyframes vtIn { from { transform: translateY(18px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-main { animation: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
.site-header--scrolled { box-shadow: var(--shadow); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  flex-wrap: nowrap;
  padding-top: 5px;
  padding-bottom: 5px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--header-text);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; color: var(--header-text); }
.logo__icon {
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--header-hover);
  box-shadow: inset 0 0 0 1px var(--header-border);
}

.main-nav { display: flex; gap: 4px; flex: 1; align-items: center; position: relative; }
.main-nav a {
  color: var(--header-muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 7px 12px;
  border-radius: 10px;
  position: relative;
  z-index: 1;
  transition: color 0.15s, background 0.15s;
}
.main-nav a:hover { color: var(--primary); background: var(--header-hover); text-decoration: none; }
.main-nav a.is-active { color: #fff; }
.nav-bubble {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  border-radius: 10px;
  background: var(--grad);
  box-shadow: 0 3px 12px rgba(31, 122, 68, 0.35);
  pointer-events: none;
  z-index: 0;
  transition: left 0.4s cubic-bezier(0.22, 1, 0.36, 1), top 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.4s cubic-bezier(0.22, 1, 0.36, 1), height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.header-auth { display: flex; align-items: center; gap: 8px; }
.header-user { color: var(--header-muted); font-size: 0.9rem; font-weight: 500; white-space: nowrap; }

.cabinet-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(31, 122, 68, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cabinet-badge:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; color: #fff; }
.cabinet-badge .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; font-size: 0.7rem; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--header-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--header-text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.theme-toggle:hover { background: var(--header-hover); transform: translateY(-1px); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--amber);
  color: #0a3f4a;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  margin-left: auto;
  border: 1px solid var(--header-border);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.burger__line {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--header-text);
  transition: transform 0.2s, opacity 0.2s;
}
.burger.is-open .burger__line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open .burger__line:nth-child(2) { opacity: 0; }
.burger.is-open .burger__line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a { color: var(--ink); font-weight: 600; padding: 9px 4px; border-radius: 10px; transition: color 0.15s, background 0.15s; }
.mobile-menu a:hover { color: var(--primary); background: var(--header-hover); }
.mobile-menu a.is-active { color: #fff; background: var(--grad); }
.mobile-menu__nav { display: flex; flex-direction: column; }
.mobile-menu__auth { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px dashed var(--border); }

.site-main { flex: 1; padding: 24px 0 32px; animation: pageFloat 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

.btn {
  --btn-bg: var(--grad);
  --btn-color: #fff;
  --btn-border: transparent;
  --btn-shadow: 0 4px 14px rgba(14, 88, 99, 0.22);
  --btn-hover-shadow: 0 8px 22px rgba(31, 122, 68, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-color);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
  box-shadow: var(--btn-shadow);
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.15s,
    color 0.15s,
    border-color 0.15s,
    filter 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--btn-hover-shadow);
  text-decoration: none;
  color: var(--btn-color);
  filter: brightness(1.04);
}
.btn:active { transform: translateY(0); box-shadow: var(--btn-shadow); filter: brightness(0.97); }
.btn:focus-visible { outline: 3px solid rgba(47, 143, 80, 0.45); outline-offset: 2px; }

.btn-outline {
  --btn-bg: transparent;
  --btn-color: var(--primary);
  --btn-border: var(--primary);
  --btn-shadow: none;
  --btn-hover-shadow: 0 4px 14px rgba(31, 122, 68, 0.15);
}
.btn-outline:hover {
  --btn-bg: var(--primary);
  --btn-color: #fff;
  --btn-border: var(--primary);
}

.btn-sm { padding: 7px 14px; font-size: 0.86rem; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; }

.btn-primary {
  --btn-bg: var(--primary);
  --btn-hover-shadow: 0 8px 22px rgba(31, 122, 68, 0.32);
}
.btn-primary:hover { filter: brightness(1.06); }

.btn-danger {
  --btn-bg: var(--danger);
  --btn-shadow: 0 4px 14px rgba(194, 59, 48, 0.25);
  --btn-hover-shadow: 0 8px 22px rgba(194, 59, 48, 0.35);
}
.btn-danger:hover { filter: brightness(1.06); }

.btn:disabled {
  --btn-bg: var(--surface-2);
  --btn-color: var(--muted);
  --btn-border: var(--border);
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: none;
}

.btn-active {
  --btn-bg: var(--primary);
  --btn-color: #fff;
  --btn-border: var(--primary);
}
.btn-active:hover { --btn-bg: var(--primary-dark); --btn-border: var(--primary-dark); }

.address-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.address-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.address-strip__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 3px;
}
.address-strip__value {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--primary-dark);
}
.address-strip__route {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.9rem;
  font-weight: 600;
}
.address-strip__map-wrap {
  flex: 0 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.address-strip__map {
  display: block;
  width: 300px;
  height: 140px;
  border: 0;
}

.about {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 28px;
  align-items: start;
  margin-top: 22px;
}
.about h1 { margin: 0 0 10px; font-size: 1.8rem; }
.about__lead { color: var(--muted); font-size: 1.02rem; margin: 0 0 14px; }
.about__stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.about__stat {
  flex: 1 1 130px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
}
.about__stat b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--primary-dark); line-height: 1.15; }
.about__stat span { color: var(--muted); font-size: 0.85rem; }
.about__list { margin: 0; padding: 8px 0 0; list-style: none; }
.about__list li {
  padding: 8px 0 8px 30px;
  position: relative;
  border-bottom: 1px dashed var(--border);
  color: var(--ink);
  font-weight: 500;
}
.about__list li:last-child { border-bottom: 0; }
.about__list li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  top: 8px;
  color: var(--accent);
  font-weight: 800;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--teal); }
.card h3 { margin-top: 0; }

.advantages { margin-top: 26px; }
.advantages .card ul { padding-left: 18px; }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.news-grid .card h3 a { color: var(--primary-dark); }
.news-grid .card h3 a:hover { color: var(--teal); }

.form-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.form-card h1 { margin-top: 0; }

.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 7px; color: var(--primary-dark); }
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"],
.form-field input[type="number"],
.form-field input[type="tel"],
.form-field input[type="url"],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(22, 131, 156, 0.15);
}
.form-field .help-text { color: var(--muted); font-size: 0.85rem; margin-top: 5px; }
.form-checkbox { display: flex; gap: 10px; align-items: flex-start; }
.form-checkbox input { margin-top: 4px; accent-color: var(--accent); }
.form-radio .radio-group { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.form-radio .radio-label { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.form-radio .radio-label input { accent-color: var(--accent); }
.form-errors, .errorlist { color: var(--danger); font-size: 0.9rem; padding-left: 18px; margin: 6px 0; }
.form-errors.non-field { list-style: none; padding-left: 0; }

.alert { padding: 12px 18px; border-radius: 12px; margin-bottom: 18px; border: 1px solid var(--border); font-weight: 600; }
.alert-success { background: var(--accent-light); color: var(--success-text); }
.alert-error { background: var(--danger-light); color: var(--danger); }

.news-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.news-body img { max-width: 100%; border-radius: var(--radius); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gallery-grid figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}
.gallery-grid figure:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.gallery-grid img { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform 0.4s; }
.gallery-grid figure:hover img { transform: scale(1.05); }
.gallery-grid figcaption { padding: 10px 12px; color: var(--muted); font-size: 0.9rem; }

.map-page { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .map-page { grid-template-columns: 1fr; } }

.map-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-height: 300px;
}
.map-panel h3 { margin-top: 0; }
.map-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.map-search {
  flex: 1 1 200px;
  padding: 9px 14px 9px 40px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364777b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.2-3.2'/%3E%3C/svg%3E") no-repeat 14px center;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.map-search:focus {
  outline: none;
  border-color: var(--teal);
  background-color: var(--surface);
  box-shadow: 0 0 0 4px rgba(22, 131, 156, 0.15);
}
.map-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-active:hover { background: var(--primary-dark); color: #fff; }

.map-legend { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-size: 0.9rem; }
.map-legend-item { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 12px; border-radius: var(--radius-pill); font-weight: 600; color: var(--muted); }
.map-legend-swatch { width: 14px; height: 14px; border-radius: 5px; border: 1px solid var(--border); }

.plot-info { font-size: 0.95rem; }
.plot-info .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.plot-info .row b { color: var(--primary-dark); text-align: right; }

.owner-card {
  margin-top: 16px;
  padding: 16px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.owner-card.anonymous { background: var(--surface-2); }
.owner-item { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.owner-item:last-child { border-bottom: none; padding-bottom: 0; }
.owner-item:first-child { padding-top: 0; }
.owner-item p { margin: 4px 0; }
.owner-hidden { font-style: italic; }
.message-recipient {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--field-bg);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
}
.message-recipient:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(22, 131, 156, 0.15);
}

.site-footer {
  background: var(--footer-grad);
  color: var(--footer-text);
  margin-top: 28px;
}
.footer-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; padding: 28px 20px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { color: #fff; margin: 0 0 8px; font-size: 1rem; }
.footer-col a { color: var(--footer-text); font-weight: 500; }
.footer-col a:hover { color: #fff; }
.footer-col .logo { margin-bottom: 8px; color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.15); padding: 16px 20px; font-size: 0.85rem; }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 640px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 20px 24px;
  z-index: 100;
  display: none;
}
.cookie-banner--visible { display: block; }
.cookie-banner p { margin: 0 0 14px; }
.cookie-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-16 { margin-top: 12px; }
.mt-32 { margin-top: 22px; }
.mb-16 { margin-bottom: 12px; }

.map-svg-wrap {
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--map-bg);
  line-height: 0;
}
.map-svg { width: 100%; height: auto; }
.plot-shape { fill: var(--plot-idle); stroke: #ffffff; stroke-width: 1.2; cursor: pointer; transition: fill 0.15s, opacity 0.15s, stroke 0.15s, filter 0.15s; }
.plot-shape.registered { fill: var(--plot-registered); stroke: rgba(255,255,255,0.85); stroke-width: 1.6; }
.plot-shape.unregistered { fill: var(--plot-unregistered); }
.plot-shape:hover, .plot-shape.hover { fill: var(--amber); opacity: 0.92; }
.plot-shape.selected { stroke: #fff; stroke-width: 3; filter: drop-shadow(0 0 3px rgba(242, 162, 60, 0.8)); }
@media (max-width: 760px) {
  .plot-shape.registered { stroke: #fff; stroke-width: 2.2; filter: drop-shadow(0 0 2px rgba(91, 192, 101, 0.55)); }
  .plot-label { font-size: 8px; font-weight: 900; }
}
.plot-label { font-size: 7px; fill: #ffffff; font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; user-select: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }

.map-zoom { display: flex; gap: 8px; margin-bottom: 10px; }
.map-zoom .btn { padding: 4px 12px; font-size: 1.05rem; }

.plot-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.plot-photos img { width: 100%; height: 90px; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow-sm); }

.message-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.message-textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(22, 131, 156, 0.15);
}

.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--primary); border-color: var(--teal); text-decoration: none; }
.admin-tab.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.admin-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-stats .about__stat { flex: 1 1 120px; }

.admin-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.inline-form { display: inline; margin: 0; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table thead th { background: var(--bg); color: var(--muted); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.cell-muted { color: var(--muted); white-space: normal !important; min-width: 200px; }

.plot-tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: var(--radius-pill);
  background: var(--teal-light);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.82rem;
}
.status-pill { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 700; }
.status-ok { background: var(--accent-light); color: var(--success-text); }
.status-new { background: var(--warn-bg); color: var(--warn-text); }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.news-admin-list { display: grid; gap: 18px; }
.news-admin-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.news-admin-item h3 { margin-top: 0; }
.news-admin-body {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 14px;
  margin: 12px 0;
  max-height: 240px;
  overflow-y: auto;
}
.news-admin-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.section-header { margin-bottom: 24px; }
.section-header p { margin: 0; }

.category-label {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.contact-category { margin-bottom: 26px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th,
.data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table th { background: var(--surface-2); font-weight: 700; color: var(--primary-dark); font-size: 0.9rem; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background 0.12s; }
.data-table tbody tr:hover { background: rgba(31, 122, 68, 0.06); }
.data-table td { font-size: 0.95rem; }
.contacts-table td { word-break: break-word; }
.contact-row__company { font-weight: 600; }
.contact-row__contact { margin-top: 2px; }
.contact-row__actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.rating-count { color: var(--muted); font-size: 0.85rem; margin-left: 4px; }

.contact-detail__actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.contact-detail__title { font-size: 1.5rem; margin-bottom: 6px; word-break: break-word; }
.contact-detail__subtitle { margin-top: 0; margin-bottom: 12px; }
.contact-detail__info .info-row b { font-size: 0.92rem; }
@media (max-width: 760px) {
  .contact-detail__title { font-size: 1.25rem; }
}

.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.bulletin-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bulletin-card { display: flex; flex-direction: column; }
.bulletin-card__category {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  color: var(--success-text);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.bulletin-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.bulletin-card p { margin: 0 0 12px; color: var(--muted); font-size: 0.94rem; flex: 1; }
.bulletin-card__meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }

.poll-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.poll-card { display: flex; flex-direction: column; }
.poll-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.poll-card p { margin: 0 0 12px; color: var(--muted); font-size: 0.94rem; flex: 1; }
.poll-card__meta { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }

.poll-results { display: grid; gap: 12px; margin: 18px 0; }
.poll-result__label { display: flex; justify-content: space-between; font-size: 0.95rem; margin-bottom: 5px; }
.poll-result__bar { height: 10px; background: var(--surface-2); border-radius: var(--radius-pill); overflow: hidden; }
.poll-result__fill { height: 100%; background: var(--grad); border-radius: var(--radius-pill); transition: width 0.4s ease; }
.radio-label { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; }
.radio-label input { width: 18px; height: 18px; accent-color: var(--primary); }

.notifications-list { display: grid; gap: 12px; margin-top: 18px; }
.notification { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.notification--unread { border-left: 4px solid var(--primary); }
.notification__content p { margin: 4px 0; color: var(--muted); font-size: 0.94rem; }

.purchase-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.purchase-card { display: flex; flex-direction: column; }
.purchase-card h3 { margin: 0 0 8px; font-size: 1.05rem; }
.purchase-card p { margin: 0 0 12px; color: var(--muted); font-size: 0.94rem; flex: 1; }
.purchase-card__meta { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); margin-bottom: 12px; }
.purchase-card__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.purchase-card__header h3 { margin: 0; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-tabs a {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}
.filter-tabs a:hover { background: var(--header-hover); color: var(--primary); text-decoration: none; }
.filter-tabs a.is-active { background: var(--grad); color: #fff; border-color: transparent; }

.contact-detail__header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.contact-detail__header h1 { margin: 0; }

.badge--active { background: var(--success-text); color: #fff; }
.badge--completed { background: var(--primary); color: #fff; }
.badge--cancelled { background: var(--danger); color: #fff; }

.organizer-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 18px 0;
}
.organizer-panel h3 { margin: 0 0 12px; font-size: 1.05rem; }
.organizer-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.participants-list { margin-top: 22px; }
.participants-list h3 { margin-bottom: 12px; }
.participants-list ul { list-style: none; margin: 0; padding: 0; }
.participant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.participant-row:last-child { border-bottom: 0; }
.quantity-input { width: 100px; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 10px; }

.search-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.search-input {
  flex: 1;
  min-width: 220px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--field-bg);
  color: var(--ink);
  font-family: inherit;
}
.search-input:focus { outline: none; border-color: var(--primary); }

.contact-category { margin-bottom: 34px; }
.contact-category h2 { margin-bottom: 16px; }

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.contact-card { display: flex; flex-direction: column; }
.contact-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.contact-card__title { margin: 0; font-size: 1.08rem; word-break: break-word; }
.contact-card__service { color: var(--muted); font-size: 0.92rem; margin: 0 0 8px; }
.contact-card__contact { font-weight: 700; margin: 0 0 6px; }
.contact-card__name { color: var(--muted); font-size: 0.92rem; margin: 0 0 6px; }
.contact-card__comment { margin: 0 0 14px; color: var(--ink); font-size: 0.94rem; }
.contact-card__footer { margin-top: auto; }

.contact-detail { max-width: 720px; }
.contact-detail__rating { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.rating-summary { color: var(--muted); font-size: 0.95rem; }
.contact-detail__info { margin-top: 18px; }
.contact-detail__info .info-row { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.contact-detail__info .info-row:last-child { border-bottom: none; }
.back-link { display: inline-block; margin-bottom: 14px; font-size: 0.92rem; }

.star-rating { display: inline-flex; align-items: center; gap: 2px; color: var(--amber); }
.star-rating__value { margin-left: 5px; font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.star { flex-shrink: 0; }
.star--full { fill: currentColor; }
.star--half { stroke: currentColor; stroke-width: 1.2; }
.star--empty { fill: none; stroke: currentColor; stroke-width: 1.2; }

.star-rating-input { margin-bottom: 18px; }
.star-rating-input > label { display: block; font-weight: 700; margin-bottom: 7px; color: var(--primary-dark); }
.star-rating__stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-rating__label { cursor: pointer; display: inline-flex; color: var(--border); transition: color 0.15s; }
.star-rating__label input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-rating__label .star { fill: currentColor; }
.star-rating__stars .star-rating__label:hover,
.star-rating__stars .star-rating__label:hover ~ .star-rating__label,
.star-rating__stars input:checked + .star,
.star-rating__stars input:checked ~ .star-rating__label .star,
.star-rating__stars input:checked + .star-rating__label .star,
.star-rating__stars .star-rating__label:has(input:checked) .star,
.star-rating__stars .star-rating__label:has(input:checked) ~ .star-rating__label .star {
  color: var(--amber);
}
.star-rating__stars .star-rating__label:hover .star,
.star-rating__stars .star-rating__label:hover ~ .star-rating__label .star {
  color: var(--amber);
}

.reviews-list { display: grid; gap: 16px; margin-top: 16px; }
.review {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.review__header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.review__author { font-weight: 700; color: var(--primary-dark); }
.review__date { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.review p { margin: 0; }
.review--own { background: var(--accent-light); border-color: var(--accent-2); }

.mt-32 { margin-top: 32px; }
.text-sm { font-size: 0.9rem; }
.help-text { color: var(--muted); font-size: 0.85rem; }

.registration-progress { margin-top: 34px; }
.progress-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.progress-card__numbers { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.progress-card__current { font-size: 2.4rem; font-weight: 800; color: var(--primary); line-height: 1; }
.progress-card__total { font-size: 1.05rem; color: var(--muted); }
.progress-card__bar {
  height: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 14px;
}
.progress-card__fill {
  height: 100%;
  background: var(--grad);
  border-radius: var(--radius-pill);
  transition: width 0.8s ease;
}
.progress-card__cta { margin: 0; color: var(--ink); }
.progress-card__cta a { font-weight: 700; }

@media (max-width: 760px) {
  .header-inner { gap: 10px; min-height: 52px; }
  .main-nav, .header-auth { display: none; }
  .burger { display: flex; }
  .logo__text { font-size: 1.05rem; }
  .site-main { padding: 18px 0 28px; }

  .form-card { padding: 20px 16px; }
  .news-body { padding: 20px 16px; }
  .map-panel { padding: 14px; }
  .about { grid-template-columns: 1fr; padding: 22px 18px; gap: 18px; margin-top: 20px; }
  .about h1 { font-size: 1.5rem; }

  .address-strip__inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .address-strip__map-wrap { width: 100%; }
  .address-strip__map { width: 100%; height: 180px; }

  .footer-inner { padding: 24px 20px; gap: 20px; }
  .footer-bottom { font-size: 0.78rem; }

  .contacts-grid { grid-template-columns: 1fr; }
  .search-bar .btn { width: 100%; }
}

/* Помощник-лосёнок */
.helper-clip {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  font-size: 0.95rem;
  animation: clipEnter 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes clipEnter {
  from { transform: translateY(120px) rotate(-8deg); opacity: 0; }
  to { transform: translateY(0) rotate(0); opacity: 1; }
}

.helper-clip.is-leaving {
  animation: clipLeave 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes clipLeave {
  to { transform: translateY(120px) rotate(8deg); opacity: 0; }
}

.helper-clip__toggle {
  width: 100px;
  height: 144px;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.18));
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  animation: clipBob 3s ease-in-out infinite;
}

@keyframes clipBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.helper-clip__toggle:hover {
  transform: scale(1.08) rotate(-3deg);
  animation-play-state: paused;
}

.helper-clip__toggle:active { transform: scale(0.96); }

.helper-clip__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.12));
}

.helper-clip__eyes {
  animation: eyesLook 4s ease-in-out infinite;
}

@keyframes eyesLook {
  0%, 45%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
  55% { transform: translateX(-1px); }
  60% { transform: translateX(0); }
}

.helper-clip.is-blinking .helper-clip__eye {
  animation: blink 0.2s ease-in-out;
}

@keyframes blink {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

.helper-clip__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

.helper-clip__bubble {
  width: 340px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border: 2px solid #1f2937;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(15px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.22, 1, 0.36, 1), transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  color: #1f2937;
}

.helper-clip__bubble.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.helper-clip__bubble::after {
  content: "";
  position: absolute;
  right: 32px;
  bottom: -12px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-right: 2px solid #1f2937;
  border-bottom: 2px solid #1f2937;
  transform: rotate(45deg);
}

.helper-clip__close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s, transform 0.15s;
}

.helper-clip__close:hover { color: var(--danger); transform: scale(1.15); }

.helper-clip__text { margin: 0 24px 14px 0; color: #1f2937; line-height: 1.55; font-size: 0.98rem; }

.helper-clip__actions { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .helper-clip { right: 12px; bottom: 12px; }
  .helper-clip__toggle { width: 72px; height: 104px; }
  .helper-clip__bubble { width: calc(100vw - 24px); right: 0; }
  .helper-clip__bubble::after { right: 24px; }
}

/* --- Диалоги и чат --- */
.dialogs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 760px;
  margin: 0 auto;
}

.dialog-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dialog-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.dialog-card--unread {
  border-left: 4px solid var(--accent);
}

.dialog-card__avatar {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.dialog-card__body {
  flex: 1;
  min-width: 0;
}

.dialog-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.dialog-card__name {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog-card__time {
  font-size: 0.78rem;
  color: var(--muted);
  flex-shrink: 0;
}

.dialog-card__preview {
  font-size: 0.9rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog-card__you {
  color: var(--ink);
  margin-right: 4px;
}

.dialog-card__badge {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Чат */
.chat-container {
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
  height: calc(100vh - 180px);
  min-height: 400px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.chat-header__info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chat-header__avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.chat-header__name {
  font-weight: 700;
  font-size: 1rem;
}

.chat-header__status {
  font-size: 0.8rem;
  color: var(--muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  display: flex;
  max-width: 78%;
}

.chat-message--in {
  align-self: flex-start;
}

.chat-message--out {
  align-self: flex-end;
}

.chat-message__bubble {
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-message--in .chat-message__bubble {
  background: var(--surface-2);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.chat-message--out .chat-message__bubble {
  background: var(--accent-light);
  color: var(--success-text);
  border-bottom-right-radius: 4px;
}

.chat-message__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
}

.chat-message__time {
  font-size: 0.72rem;
  opacity: 0.75;
}

.chat-message__status {
  display: inline-flex;
  align-items: center;
}

.chat-message__tick {
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-message__tick--double path:first-child {
  opacity: 0.5;
}

.chat-message__tick--read {
  stroke: var(--accent);
}

.chat-form {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.chat-form textarea {
  flex: 1;
  resize: none;
  border-radius: 22px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  background: var(--field-bg);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  max-height: 140px;
  min-height: 46px;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(70, 169, 79, 0.12);
}

.chat-form button {
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

@media (max-width: 760px) {
  .chat-container {
    height: calc(100vh - 150px);
  }
  .chat-message {
    max-width: 88%;
  }
}

/* Всплывающие уведомления (toasts) */
.toast-container {
  position: fixed;
  top: 80px;
  right: 14px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 300px;
  width: calc(100vw - 28px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 34px 10px 12px;
  animation: toast-in 0.25s ease;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.toast--info { border-left-color: var(--accent); }
.toast--message { border-left-color: var(--primary); }

.toast__body {
  flex: 1;
  min-width: 0;
}

.toast__title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.toast__text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.toast__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.15rem;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}

.toast__close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateX(20px); }
}

.toast.hiding {
  animation: toast-out 0.2s ease forwards;
}

/* --- Реакции на сообщения --- */
.chat-message__reactions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  position: relative;
}

.chat-message--out .chat-message__reactions {
  justify-content: flex-end;
}

.chat-message__reaction,
.chat-message__reaction-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease;
}

.chat-message__reaction:hover,
.chat-message__reaction-add:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.chat-message__reaction--active {
  background: var(--accent-light);
  border-color: var(--accent);
}

.chat-message__reaction-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.chat-message__reaction-add {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
}

.chat-message__reaction-picker {
  position: absolute;
  bottom: 34px;
  left: 0;
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 10;
}

.chat-message--out .chat-message__reaction-picker {
  left: auto;
  right: 0;
}

.chat-message__reaction-picker.is-visible {
  display: flex;
}

.chat-message__reaction-option {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.chat-message__reaction-option:hover {
  transform: scale(1.15);
  background: var(--accent-light);
}
