:root {
  color-scheme: light dark;

  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #dde2ea;
  --text: #1a2234;
  --muted: #6b7387;

  --header-bg: #14213d;
  --header-text: #eef1f8;
  --header-muted: #9fadc9;

  --accent: #2461e0;
  --accent-hover: #1a4bb8;
  --accent-soft: #eaf0fd;

  --favorite: #d9971f;
  --favorite-soft: #fbf1de;

  --viewed-bg: #eef0f4;
  --viewed-text: #8992a3;
  --viewed-badge-bg: #dfe3ea;
  --viewed-badge-text: #5b6478;

  --notice-bg: #fdf6e8;
  --notice-border: #ecd9a8;
  --notice-text: #7a5a15;

  --rgis-ok: #1f8a4c;
  --rgis-warn: #b8590f;
  --rgis-error: #c23b3b;
  --rgis-pending: #6b7387;
}

* {
  box-sizing: border-box;
}

html {
  /* The header intentionally bleeds full-bleed via negative margins below —
     that must never cause the *page* to gain a horizontal scrollbar (as
     opposed to the deliberate one on .table-scroll). */
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0 auto;
  max-width: 1600px;
  padding: 0 20px 60px;
  color: var(--text);
  background: var(--bg);
  /* No overflow-x here on top of html's (above): setting it on *both*
     turns body into its own scroll container (overflow-y implicitly
     becomes `auto` per the CSS overflow computed-value rule), which
     silently breaks `position: sticky` for every descendant — including
     the table header's sticky top:0, which is why it never actually stuck
     while scrolling through a long lot list. html's rule alone already
     fully prevents the page-level horizontal scrollbar. */
}

/* On wide/ultrawide monitors the 1600px cap left huge unused margins while
   the lots table (17 columns) still had to cram into that same width and
   wrapped every cell onto several lines. Let the container grow in steps so
   the extra space actually goes to the table instead of sitting empty. */
@media (min-width: 1700px) {
  body { max-width: 2200px; }
}

@media (min-width: 2400px) {
  body { max-width: 2800px; }
}

/* ---------- header ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 -20px 20px;
  padding: 16px 20px;
  background: var(--header-bg);
  color: var(--header-text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.updated-at {
  margin: 0;
  font-size: 0.78rem;
  color: var(--header-muted);
  white-space: nowrap;
}

.updated-at.updated-warn {
  color: var(--notice-text);
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 6px;
  padding: 3px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--header-text);
}

.tabs {
  display: flex;
  flex-wrap: wrap; /* на телефоне вкладки переносятся, а не растягивают страницу */
  gap: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--header-muted);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--header-text);
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab-count {
  display: inline-flex;
  min-width: 18px;
  justify-content: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  line-height: 18px;
}

.tab.active .tab-count {
  background: rgba(255, 255, 255, 0.28);
}

/* ---------- filters ---------- */

#filters {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.vri-group {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0;
}

.vri-group legend {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 4px;
}

.vri-group .checkbox {
  font-size: 0.82rem;
  white-space: normal;
}

.vri-more {
  flex-basis: 100%;
}

.vri-more summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--accent);
  padding: 4px 0;
  user-select: none;
}

.vri-more summary:hover {
  color: var(--accent-hover);
}

.vri-more[open] summary {
  margin-bottom: 8px;
}

.vri-more .vri-group {
  margin-bottom: 8px;
}

.vri-more .vri-group:last-child {
  margin-bottom: 0;
}

label {
  color: var(--muted);
}

select, input[type="number"], input[type="search"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}

select:focus, input[type="number"]:focus, input[type="search"]:focus, input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.region-field {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 220px;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.dropdown-toggle:hover {
  border-color: var(--accent);
}

.dropdown-toggle #region-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-caret {
  color: var(--muted);
  flex-shrink: 0;
}

.dropdown-panel[hidden] {
  display: none;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
  padding: 10px;
}

.dropdown-panel input[type="search"] {
  width: 100%;
  margin-bottom: 8px;
}

.dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dropdown-item {
  padding: 5px 6px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--accent-soft);
}

.dropdown-item[hidden] {
  display: none;
}

.dropdown-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.link-button {
  background: none;
  border: none;
  padding: 2px 0;
  margin-top: 4px;
  color: var(--accent);
  font-size: 0.78rem;
  cursor: pointer;
  text-align: left;
}

.link-button:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

input[type="number"] {
  width: 90px;
}

.search-field {
  flex: 1 1 220px;
  min-width: 180px;
}

.search-field input[type="search"] {
  width: 100%;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.future {
  margin-left: auto;
}

.count {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pagination-bottom {
  justify-content: center;
  margin-top: 12px;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-indicator {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.page-size {
  margin-left: 4px;
}

.hidden-note[hidden] {
  display: none;
}

.hidden-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  color: var(--notice-text);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  margin: 0 0 12px;
}

.hidden-note::before {
  content: "ⓘ";
  font-size: 1rem;
  line-height: 1;
}

/* ---------- table ---------- */

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* Nudge buttons for scrolling the (often wider-than-viewport) table
   sideways with a click — a mouse-friendly stand-in for the two-finger
   trackpad swipe Mac users get for free. Shown/positioned from app.js,
   only while the table both overflows and is actually on screen.
   `position: sticky` doesn't work for this: `.table-scroll` needs
   `overflow-x: auto` for the deliberate horizontal scrollbar, and per the
   CSS overflow spec that forces an implicit `overflow-y: auto` on it too
   (you can't have non-visible on one axis and visible on the other) — which
   silently makes `.table-scroll` its own (never-actually-scrolling)
   vertical scroll container, so anything sticky inside it sticks relative
   to that instead of the page. `position: fixed`, positioned and
   shown/hidden from app.js (tracks the table's live bounding rect, visible
   only while the table is actually on screen), sidesteps that entirely. */
.table-scroll-nudge {
  display: none;
  position: fixed;
  top: 50vh;
  transform: translateY(-50%);
  z-index: 20;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.table-scroll-nudge.is-visible {
  display: flex;
}

.table-scroll-nudge:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.table-scroll-nudge:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

@media (max-width: 720px) {
  .table-scroll-nudge {
    display: none !important;
  }
}

table {
  width: 100%;
  min-width: 1180px; /* forces .table-scroll's overflow-x on narrow screens
                         instead of squeezing every column unreadably thin */
  border-collapse: collapse;
  font-size: 0.88rem;
}

/* 17 columns is a lot of real tabular data — there's no percentage split
   that makes Название/Адрес roomy AND keeps every short column single-line
   below ~1850px. Two things tried and reverted here, for the record:
   (1) pure auto layout: browser starves Название down to ~110px the moment
   the "hard" nowrap columns claim their content width, which is just as bad
   as the original bug; (2) fixed layout with a ~1550px floor: the numeric
   columns sat right at their bare minimum, and font-metric differences
   across OS/browsers pushed some over it, silently ellipsis-truncating
   actual auction dates. This is fixed layout again, but with a taller floor
   (see .lots-table below) so the "hard" columns get real headroom instead
   of their bare minimum, and no ellipsis — if something is ever still too
   tight it overflows visibly instead of hiding data. Below the floor,
   .table-scroll's horizontal scroll is the honest answer (styled below to
   be easy to drag with a mouse, not just a Mac trackpad swipe). */
.lots-table {
  table-layout: fixed;
  min-width: 1850px;
}

/* РГИС only ever has real content on the "Избранное" tab (checks only run
   for favorited lots — see app.js triggerRgisCheck); on "Все лоты" every
   row showed the same "добавьте в ★" placeholder, which is noise rather
   than information. Toggled via .hide-rgis-col on tab switch (app.js) —
   collapsing both the cells and their <col> (colgroup) so the freed 6%
   goes to Функциональное назначение instead of sitting empty. */
.lots-table.hide-rgis-col th:nth-child(6),
.lots-table.hide-rgis-col td:nth-child(6) {
  display: none;
}

.lots-table.hide-rgis-col colgroup col:nth-child(6) {
  width: 0;
}

.lots-table.hide-rgis-col colgroup col:nth-child(8) {
  width: 15%; /* было 9% — плюс освободившиеся 6% от РГИС */
}

.lots-table th:nth-child(4), .lots-table td:nth-child(4),   /* источник */
.lots-table th:nth-child(5), .lots-table td:nth-child(5),   /* регион */
.lots-table th:nth-child(9), .lots-table td:nth-child(9),   /* площадь */
.lots-table th:nth-child(10), .lots-table td:nth-child(10), /* цена */
.lots-table th:nth-child(11), .lots-table td:nth-child(11), /* дата торгов */
.lots-table th:nth-child(12), .lots-table td:nth-child(12), /* приём заявок до */
.lots-table th:nth-child(14), .lots-table td:nth-child(14), /* статус */
.lots-table th:nth-child(15) {                               /* просмотрено */
  white-space: nowrap;
}

/* Easy to grab with a mouse — Mac trackpads get horizontal swipe for free,
   everyone else was stuck hunting for a thin default scrollbar (or just
   zooming the page out instead). */
.table-scroll {
  scrollbar-width: auto;
}

.table-scroll::-webkit-scrollbar {
  height: 14px;
}

.table-scroll::-webkit-scrollbar-track {
  background: var(--bg);
}

.table-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 7px;
  border: 3px solid var(--bg);
}

.table-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

th.sortable:hover {
  color: var(--text);
}

th.sortable::after {
  content: "⇅";
  margin-left: 4px;
  opacity: 0.4;
  font-size: 0.75rem;
}

th.sortable.sort-asc::after {
  content: "↑";
  opacity: 1;
  color: var(--accent);
}

th.sortable.sort-desc::after {
  content: "↓";
  opacity: 1;
  color: var(--accent);
}

th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  background: var(--surface);
  /* Higher than .table-scroll-nudge's z-index: 20 — the nudge buttons are
     centered on the table's live left/right edge and deliberately overlap
     it by ~17px (see the comment there), which otherwise paints over
     whatever header text happens to sit at the viewport's vertical middle.
     Same opaque background on both, so this just makes the header cleanly
     win that overlap instead of getting visually clipped by a round button. */
  z-index: 21;
}

th.col-fav, td.col-fav {
  padding-left: 12px;
  padding-right: 0;
  width: 1%;
}

td.col-viewed {
  width: 1%;
}

td.col-rgis {
  font-size: 0.85rem;
  white-space: nowrap;
}

td.col-rgis.rgis-ok { color: var(--rgis-ok); }
td.col-rgis.rgis-warn { color: var(--rgis-warn); font-weight: 600; }
td.col-rgis.rgis-error { color: var(--rgis-error); }
td.col-rgis.rgis-pending, td.col-rgis.rgis-unknown { color: var(--muted); font-style: italic; }

td.col-rgis.rgis-pick {
  white-space: normal;
  min-width: 220px;
  max-width: 320px;
}

.rgis-pick-label {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 4px;
}

.rgis-pick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rgis-candidate-btn {
  text-align: left;
  font-size: 0.82rem;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: normal;
}

.rgis-candidate-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

tr:hover td {
  background: var(--accent-soft);
}

tr.row-viewed td {
  background: var(--viewed-bg);
  color: var(--viewed-text);
}

tr.row-viewed:hover td {
  background: #e5e8ee;
}

.viewed-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--viewed-badge-bg);
  color: var(--viewed-badge-text);
  font-size: 0.72rem;
  white-space: nowrap;
  vertical-align: middle;
}

.star-button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px;
  color: var(--border);
  transition: color 0.15s ease, transform 0.1s ease;
}

.star-button:hover {
  color: var(--favorite);
  transform: scale(1.15);
}

.star-button.is-favorite {
  color: var(--favorite);
}

td.col-fav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pano-button {
  font-size: 0.95rem;
  line-height: 1;
  padding: 4px;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.pano-button:hover {
  opacity: 1;
  transform: scale(1.15);
}

.hide-button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 4px;
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.hide-button:hover {
  opacity: 1;
  transform: scale(1.15);
}

.hide-button.is-hidden {
  opacity: 0.9;
  color: var(--rgis-error);
}

tr.row-hidden td {
  background: var(--viewed-bg);
  opacity: 0.6;
}

a.lot-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

a.lot-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.vri-tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  margin-right: 3px;
  white-space: nowrap;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  body {
    padding: 0 12px 40px;
  }

  .app-header {
    margin: 0 -12px 16px;
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  #filters {
    padding: 12px;
    gap: 12px;
  }

  .field {
    flex: 1 1 100%;
  }

  input[type="number"] {
    width: 100%;
  }

  .future {
    margin-left: 0;
  }

  .result-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    width: 100%;
    justify-content: space-between;
  }

  .page-size {
    margin-left: 0;
  }
}

/* ---------- dark mode ---------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151f;
    --surface: #171d2b;
    --border: #2a3242;
    --text: #e7ebf4;
    --muted: #8b93a8;

    --header-bg: #0b1626;
    --header-text: #f1f4fb;
    --header-muted: #8492b0;

    --accent: #4c85f0;
    --accent-hover: #6f9cf3;
    --accent-soft: #1c2a48;

    --favorite: #e0ab3f;
    --favorite-soft: #3a2f1a;

    --viewed-bg: #1b2130;
    --viewed-text: #6e7690;
    --viewed-badge-bg: #262e40;
    --viewed-badge-text: #97a0b6;

    --notice-bg: #2c2412;
    --notice-border: #4d3f1c;
    --notice-text: #e0bf72;

    --rgis-ok: #4caf7d;
    --rgis-warn: #e0a24f;
    --rgis-error: #e07a7a;
    --rgis-pending: #8b93a8;
  }

  tr.row-viewed:hover td { background: #202838; }
}

/* ---------- investment model modal ---------- */

.invest-btn {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.invest-btn:hover {
  background: var(--accent);
  color: #fff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 24, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 24px 28px 28px;
  width: 100%;
  max-width: 760px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow-x: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h2 {
  font-size: 1.15rem;
  margin: 0;
}

.modal-close {
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
}

.modal-close:hover {
  color: var(--text);
}

.modal-lot-title {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 6px 0 18px;
}

.invest-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.invest-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
}

.invest-field label {
  color: var(--muted);
}

.invest-field input, .invest-field select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  min-width: 140px;
}

.invest-run-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 9px 18px;
  font-weight: 600;
  cursor: pointer;
  height: fit-content;
}

.invest-run-btn:hover {
  background: var(--accent-hover);
}

.invest-run-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.invest-history {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.invest-history-label {
  color: var(--muted);
}

.invest-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.invest-history-item {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.invest-history-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.invest-result {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.55;
}

.invest-result h1, .invest-result h2, .invest-result h3 {
  margin: 1.1em 0 0.5em;
}

.invest-result table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.85rem;
}

.invest-result th, .invest-result td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.invest-result blockquote {
  border-left: 3px solid var(--favorite);
  background: var(--favorite-soft);
  margin: 10px 0;
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}

.invest-svg {
  background: #10151f;
  border-radius: 8px;
  padding: 12px;
  margin: 14px 0;
}

.invest-pending {
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 700px) {
  .modal { padding: 18px 16px 22px; }
  .invest-field input, .invest-field select { min-width: 0; width: 100%; }
  .invest-form { flex-direction: column; align-items: stretch; }
}

/* ---------- справочник ставок ---------- */

#rates-view {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.rates-intro {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  max-width: 760px;
  margin: 4px 0 18px;
}

.rate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.rate-form input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
  flex: 1 1 160px;
}

.rate-form button {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
}

.rate-form button:hover {
  background: var(--accent-hover);
}

.rates-table {
  width: 100%;
  /* Overrides the global `table { min-width: 1180px }` (style.css:469) meant
     for the much wider main lots table — this one has 6 narrow columns and
     doesn't need that forced floor, which was otherwise stretching it past
     its container regardless of table-layout/colgroup. */
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.rates-table th {
  background: var(--bg);
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left;
  padding: 10px 10px;
}

.rates-table td {
  border-top: 1px solid var(--border);
  padding: 6px 8px;
}

.rates-table input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 0.85rem;
  background: transparent;
  color: var(--text);
}

.rates-table input:hover, .rates-table input:focus {
  border-color: var(--border);
  background: var(--bg);
}

.rate-actions {
  white-space: nowrap;
}

.rate-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rate-save-btn, .rate-delete-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.rate-save-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rate-delete-btn:hover {
  border-color: var(--rgis-error);
  color: var(--rgis-error);
}

.rates-empty {
  color: var(--muted);
  font-style: italic;
  margin-top: 16px;
}

.rates-table-scroll {
  overflow-x: auto;
  border-radius: 10px;
}

@media (max-width: 700px) {
  .rate-form { flex-direction: column; }
  .rates-table { min-width: 640px; }
}

/* ---------- аккаунт, тарифы, пейвол ---------- */

.account-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.85rem;
  color: var(--header-text);
}

.account-bar .link-button { color: var(--header-muted); }
.account-bar .link-button:hover { color: var(--header-text); }

.account-email {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-badge {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--header-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.plan-badge-active { color: #8fe0b0; border-color: rgba(143, 224, 176, 0.4); }
.plan-badge-admin { color: #f0c674; border-color: rgba(240, 198, 116, 0.4); }

.btn-primary,
.btn-secondary {
  border-radius: 8px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.app-header .btn-secondary { color: var(--header-text); border-color: rgba(255, 255, 255, 0.35); }
.app-header .btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }

.unlock-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.unlock-btn:hover { border-color: var(--accent); color: var(--accent); }

.paywall-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin: 14px 0 6px;
  padding: 18px 20px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
}

.paywall-banner[hidden] { display: none; }

.paywall-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.paywall-text span { color: var(--muted); font-size: 0.9rem; }
.paywall-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.modal-narrow { max-width: 420px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.auth-field input,
.auth-field textarea {
  font: inherit;
  font-size: 1rem;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.auth-consent { font-size: 0.82rem; line-height: 1.4; align-items: flex-start; }
.auth-consent a { color: var(--accent); }
.auth-reason { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }
.auth-error { margin: 0; color: var(--rgis-error); font-size: 0.88rem; }
.auth-switch { margin: 16px 0 0; font-size: 0.88rem; color: var(--muted); }
.auth-switch .link-button { color: var(--accent); }

.pricing-lot { margin: 10px 0 0; color: var(--muted); font-size: 0.9rem; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card h3 { margin: 0; font-size: 1rem; }
.plan-price { margin: 0; font-size: 1.5rem; font-weight: 700; }
.plan-price small { font-size: 0.8rem; font-weight: 400; color: var(--muted); }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 0.88rem; line-height: 1.5; flex: 1; }
.plan-hint { margin: 0; font-size: 0.8rem; color: var(--muted); }
.pricing-note { margin: 16px 0 0; font-size: 0.8rem; color: var(--muted); }
.pricing-note a { color: var(--accent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--header-bg);
  color: var(--header-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 200;
  font-size: 0.92rem;
}

.toast[hidden] { display: none; }
.toast-error { background: #7a2020; }

@media (max-width: 720px) {
  .account-bar { justify-content: flex-start; }
  .paywall-actions { width: 100%; }
  .paywall-actions .btn-primary { flex: 1; }
}

.tab[hidden] { display: none; }

@media (max-width: 720px) {
  .updated-at { white-space: normal; }
}

/* ---------- дерево ВРИ ---------- */
.vri-tree { display: block; }
.vri-tree-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
.vri-tree-toolbar input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.vri-selected { color: var(--accent); font-size: 0.85rem; font-weight: 600; }
.vri-section { border-top: 1px solid var(--border); padding: 6px 0; }
.vri-section[hidden] { display: none; }
.vri-section > summary { cursor: pointer; font-size: 0.9rem; padding: 2px 0; }
.vri-section-code { display: inline-block; min-width: 1.6em; color: var(--muted); font-variant-numeric: tabular-nums; }
.vri-section-count { color: var(--accent); font-size: 0.8rem; }
.vri-section-all { margin: 6px 0 4px 1.6em; font-weight: 600; font-size: 0.85rem; }
.vri-section-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2px 16px; margin-left: 1.6em; }
.vri-item[hidden] { display: none; }
.vri-code { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .vri-section-list { grid-template-columns: 1fr; margin-left: 0; } }

/* ---------- мои поиски ---------- */
#save-search-btn { margin-left: auto; margin-right: 12px; }
.app-header ~ #lots-view .btn-secondary { color: var(--accent); }
.searches-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.searches-head h2 { margin: 0 0 6px; font-size: 1.2rem; }
.searches-intro { margin: 0; color: var(--muted); max-width: 60ch; }
.searches-channels { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 0.9rem; }
.tg-ok { color: var(--rgis-ok); font-weight: 600; }
.searches-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.searches-list:empty { display: none; }
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 14px 18px; border-top: 1px solid var(--border); }
.search-row:first-child { border-top: none; }
.search-main { display: flex; flex-direction: column; gap: 3px; flex: 1 1 280px; min-width: 0; }
.search-desc { color: var(--muted); font-size: 0.85rem; }
#searches-view { padding: 0 0 40px; }
#searches-view[hidden] { display: none; }

/* ---------- инвестмодель ---------- */
.modal-wide { max-width: 1100px; }
.fm-note { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }
.fm-scenarios { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.fm-scenarios button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.88rem; cursor: pointer; }
.fm-scenarios button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fm-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.fm-group { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px 12px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fm-group[hidden], .fm-form label[hidden] { display: none; }
.fm-group legend { font-size: 0.8rem; font-weight: 700; color: var(--muted); padding: 0 4px; }
.fm-form label { display: flex; flex-direction: column; gap: 3px; font-size: 0.78rem; color: var(--muted); }
.fm-form input, .fm-form select { font: inherit; font-size: 0.92rem; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); width: 100%; min-width: 0; }
.fm-result { margin-top: 16px; }
.fm-verdict { padding: 12px 16px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
.fm-verdict.fm-go { background: color-mix(in srgb, var(--rgis-ok) 15%, transparent); color: var(--rgis-ok); }
.fm-verdict.fm-border { background: var(--notice-bg); color: var(--notice-text); }
.fm-verdict.fm-nogo { background: color-mix(in srgb, var(--rgis-error) 13%, transparent); color: var(--rgis-error); }
.fm-warning { margin: 0 0 8px; color: var(--notice-text); background: var(--notice-bg); border: 1px solid var(--notice-border); border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; }
.fm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fm-kpi { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.fm-kpi span { font-size: 0.75rem; color: var(--muted); }
.fm-kpi strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.fm-block { margin-top: 16px; min-width: 0; }
.fm-block h4 { margin: 0 0 6px; font-size: 0.9rem; }
.fm-sub { margin: 0 0 6px; font-size: 0.78rem; color: var(--muted); }
.fm-table-wrap { overflow-x: auto; }
.fm-cf, .fm-sens, .fm-compare { border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; width: 100%; }
.fm-cf th, .fm-cf td, .fm-sens th, .fm-sens td, .fm-compare th, .fm-compare td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.fm-cf td:first-child, .fm-compare td:first-child { text-align: left; }
.fm-cf th { color: var(--muted); font-weight: 600; }
.fm-strong td { font-weight: 700; }
.fm-neg { color: var(--rgis-error); }
.fm-sens td.fm-go, .fm-compare td.fm-go { color: var(--rgis-ok); }
.fm-sens td.fm-border, .fm-compare td.fm-border { color: var(--notice-text); }
.fm-sens td.fm-nogo, .fm-compare td.fm-nogo { color: var(--rgis-error); }
.fm-sens td.fm-base { outline: 2px solid var(--accent); outline-offset: -2px; font-weight: 700; }
.fm-current td { background: var(--accent-soft); }
.fm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.fm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 18px; }
.fm-ai-hint { font-size: 0.8rem; color: var(--muted); }

.fm-market { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; margin-top: 12px; }
.fm-market[hidden] { display: none; }
.fm-market > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.fm-market span { font-size: 0.8rem; color: var(--muted); }
.fm-market strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.fm-market strong.fm-go { color: var(--rgis-ok); } .fm-market strong.fm-nogo { color: var(--rgis-error); }
.fm-market em { grid-column: 1 / -1; font-style: normal; font-size: 0.75rem; color: var(--muted); }
.lease-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 4px; background: var(--notice-bg); color: var(--notice-text); font-size: 0.7rem; vertical-align: 1px; }

/* ---------- разбор документации ---------- */
.docs-review { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.docs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px 16px; }
.docs-head h3 { margin: 0; font-size: 1rem; }
.docs-head .fm-note { margin-top: 4px; max-width: 70ch; }
.docs-files { margin-top: 10px; font-size: 0.85rem; }
.docs-files ul { margin: 6px 0 0; padding-left: 18px; }
.docs-files li span { color: var(--muted); }
.docs-files .docs-skipped { color: var(--notice-text); }

/* ---------- карта ---------- */
#map-view[hidden] { display: none; }
#lots-view.is-map .result-bar,
#lots-view.is-map #hidden-note,
#lots-view.is-map .table-scroll-wrap,
#lots-view.is-map #pagination-bottom { display: none; }
.map-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin: 14px 0 8px; }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.8rem; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.dot-exact { background: #c7995b; } .dot-settlement { background: #2461e0; } .dot-district { background: #7d8aa3; }
#lots-map { height: min(68vh, 720px); min-height: 380px; border: 1px solid var(--border); border-radius: 10px; }
.map-note { font-size: 0.75rem; color: var(--muted); margin: 8px 0 24px; }
.map-note a { color: inherit; }
.map-popup { display: flex; flex-direction: column; gap: 4px; min-width: 220px; max-width: 280px; font: inherit; }
.map-popup strong { font-size: 0.88rem; line-height: 1.3; }
.map-popup-meta { font-size: 0.78rem; color: #6b7387; }
.map-popup-num { font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.map-popup-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large { background-color: rgba(36, 97, 224, 0.2); }
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div { background-color: rgba(36, 97, 224, 0.82); color: #fff; font-weight: 600; }
/* тёмная тема: затемнённая подложка OSM */
.tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.6); }

/* ---------- админ: источники ---------- */
#sources-view { padding-bottom: 40px; }
#sources-view[hidden] { display: none; }
.sources-title { margin: 6px 0 6px; font-size: 1.2rem; }
.sources-list { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.source-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) auto minmax(260px, 1.5fr); gap: 10px 20px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); border-left: 3px solid var(--rgis-ok); }
.source-row:first-child { border-top: none; }
.source-warn { border-left-color: var(--rgis-warn); } .source-fail { border-left-color: var(--rgis-error); }
.source-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.source-state { font-size: 0.82rem; color: var(--muted); }
.source-fail .source-state { color: var(--rgis-error); font-weight: 600; } .source-warn .source-state { color: var(--rgis-warn); }
.source-error { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-history { display: flex; gap: 3px; }
.source-history i { font-style: normal; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; font-size: 0.7rem; }
.h-ok { background: color-mix(in srgb, var(--rgis-ok) 18%, transparent); color: var(--rgis-ok); }
.h-fail { background: color-mix(in srgb, var(--rgis-error) 18%, transparent); color: var(--rgis-error); }
.source-nums { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.82rem; color: var(--muted); }
.source-nums b { color: var(--text); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .source-row { grid-template-columns: 1fr; } }

/* Бренд: «EGAS Лотос» + подзаголовок — что делает сервис */
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text h1 { line-height: 1.1; }
.brand-sub { margin: 0; font-size: 0.82rem; color: var(--header-muted); }


/* ===== Продукт (2026-10-09): кабинет, клиенты, поддержка, тур, подвал ===== */
.auth-field textarea { resize: vertical; min-height: 110px; }
.auth-forgot { align-self: flex-start; margin-top: -6px; font-size: 0.85rem; }
[hidden] { display: none !important; }

.verify-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  margin: 0 -20px; padding: 10px 20px;
  background: var(--notice-bg); border-bottom: 1px solid var(--notice-border); color: var(--notice-text); font-size: 0.88rem;
}

.product-view { margin-top: 20px; }
.product-title { margin: 0 0 16px; font-size: 1.35rem; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.acc-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; min-width: 0; }
.acc-card h3 { margin: 0 0 12px; font-size: 1rem; }
.acc-wide { grid-column: 1 / -1; }
.acc-big { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; }
.acc-muted { color: var(--muted); font-size: 0.85rem; }
p.acc-muted { margin: 6px 0 12px; line-height: 1.45; }
.acc-ok { color: var(--rgis-ok); font-weight: 600; }
.acc-warn { color: var(--rgis-warn); font-weight: 600; }
.acc-row { margin: 8px 0; font-size: 0.9rem; }
.acc-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.acc-form .auth-field { align-self: stretch; }
.acc-foot { margin-top: 18px; }
.acc-list { list-style: none; margin: 0; padding: 0; }
.acc-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--border); }
.acc-list li:first-child { border-top: 0; padding-top: 0; }
.table-wrap { overflow-x: auto; }
.acc-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 0.88rem; } /* без глобального table{min-width:1180px} */
#cl-users, #clients-view .table-wrap .acc-table { min-width: 720px; }
.acc-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.78rem; padding: 6px 10px 8px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.acc-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.acc-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--favorite-soft); color: var(--favorite); }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi-tile span { color: var(--muted); font-size: 0.82rem; }
.kpi-tile b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.kpi-alert { border-color: var(--rgis-warn); }
.kpi-alert b { color: var(--rgis-warn); }
.funnel { display: flex; flex-direction: column; gap: 8px; }
.fn-step { position: relative; display: grid; grid-template-columns: 200px 70px 1fr; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 6px; overflow: hidden; font-size: 0.9rem; }
.fn-bar { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); border-radius: 6px; z-index: 0; }
.fn-step > :not(.fn-bar) { position: relative; z-index: 1; }
.fn-step b { text-align: right; font-variant-numeric: tabular-nums; }
.cl-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cl-head h3 { margin: 0; }
.cl-head input { font: inherit; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); min-width: 240px; }
.sup-msg { padding: 10px 0; border-top: 1px solid var(--border); }
.sup-msg:first-child { border-top: 0; padding-top: 0; }
.sup-msg p { margin: 6px 0; white-space: pre-wrap; font-size: 0.9rem; }
.sup-new { border-left: 3px solid var(--rgis-warn); padding-left: 10px; }
@media (max-width: 640px) { .fn-step { grid-template-columns: 1fr auto; } .fn-step .acc-muted { grid-column: 1 / -1; } }

.app-footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.82rem; }
.app-footer-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; margin-bottom: 10px; }
.app-footer-links .link-button { padding: 0; }
.app-footer-links a, .app-footer-links .link-button { color: var(--muted); font-size: inherit; text-decoration: none; }
.app-footer-links a:hover { color: var(--text); }
.app-footer-note { margin: 6px 0; max-width: 110ch; line-height: 1.5; }

.tour { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; width: min(440px, calc(100vw - 32px)); }
.tour-card { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); }
.tour-card h3 { margin: 2px 0 6px; font-size: 1.02rem; }
.tour-card p { margin: 0; font-size: 0.9rem; line-height: 1.45; }
.tour-step { color: var(--muted); font-size: 0.78rem !important; }
.tour-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 14px; }
.tour-target { outline: 3px solid var(--accent) !important; outline-offset: 4px; box-shadow: 0 0 0 9999px rgba(10, 18, 35, 0.35) !important; border-radius: 8px; position: relative; z-index: 5; transition: outline-color 0.2s; }

.cookie-note { position: fixed; left: 16px; bottom: 16px; z-index: 250; display: flex; gap: 12px; align-items: center; max-width: min(520px, calc(100vw - 32px)); padding: 12px 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); font-size: 0.85rem; }

/* «также на …» — тот же лот на других площадках (склейка дублей) */
.also-on { margin-top: 3px; font-size: 0.75rem; color: var(--muted); }
.also-on a { color: var(--muted); }
