/* auth.css */
/* auth.css — the login door and the operator's own page. Its own file so no
   brief edits another's. Geometry is unchanged; only the colours are tokens. */

.door-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-5);
}

.door {
  width: 100%;
  max-width: 420px;
  padding: 28px 26px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.door-mark {
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .02em;
}

.door-title {
  margin: 0 0 10px;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.door-text {
  margin: 0 0 20px;
  color: var(--dim);
}

.door-form { margin: 0 0 14px; }

.door-label {
  display: block;
  margin: 0 0 6px;
  color: var(--dim);
  font-size: var(--fs-xs);
}

.door-code {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4em;
  text-align: center;
}
.door-code:focus { border-color: var(--accent); }

.door-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-none);
  border-radius: var(--radius-sm);
  color: var(--fg);
}

.door-button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.door-button:hover { opacity: .92; }

/* The second way in: Telegram above, the providers the operator opened below,
   separated by a word rather than a rule so the two read as one choice. */
.door-split {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--dim);
  font-size: var(--fs-xs);
}
.door-split::before,
.door-split::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.door-providers {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}
.door-providers li + li { margin-top: 8px; }

.door-provider {
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  text-align: center;
  text-decoration: none;
}
.door-provider:hover { border-color: var(--accent); }

.door-state {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--dim);
}

.door-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
}

.door-hint {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}
.door-hint code { color: var(--fg); }

.door-foot {
  margin: 12px 0 0;
  color: var(--dim);
  font-size: var(--fs-xs);
}

/* the switch on the door: the theme is a visitor's choice before they sign in */
.door-theme {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--dim);
  font-size: var(--fs-sm);
  line-height: 1;
  cursor: pointer;
}
.door-theme:hover { color: var(--fg); border-color: var(--line-strong); }

/* who is signed in, in the account menu */
.who { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.who-trial { color: var(--st-tpl); font-size: var(--fs-xs); }
.who-name { color: var(--fg); }
.who-out { color: var(--dim); font-size: var(--fs-sm); }

.door-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 16px 0;
  font-size: var(--fs-sm);
}
.door-facts dt { color: var(--dim); }
.door-facts dd { margin: 0; color: var(--fg); font-variant-numeric: tabular-nums; }

/* P5's account list: a real table, unlike .door-facts, which is two columns. */
.admin-table {
  width: 100%;
  margin: 12px 0;
  border-collapse: collapse;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.admin-table th {
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-weight: normal;
  text-align: left;
}
.admin-table td {
  padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line);
  color: var(--fg);
}

/* base.css */
/* base.css — the page frame: the two columns (rail, main), the gutters, and
   the floor the footer sits on. Colours and type live in theme.css; nothing
   here names a colour or a size that is not a token. */

.app {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1 1 auto;
  width: 100%;
  padding: var(--sp-3) var(--gutter) var(--sp-6);
}

/* Reading pages keep a column; the list is the one page that wants the width. */
.content-inner {
  width: 100%;
  max-width: var(--measure);
}

.muted { color: var(--dim); }

/* billing.css */
/* billing.css — the subscription page: a reading column, no dashboard. */

.billing {
  max-width: 34rem;
  display: grid;
  gap: var(--sp-4);
}
.billing h2 { margin: 0; }
.billing-state { font-size: var(--fs-md); margin: 0; }
.billing-meter {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
}
.billing-meter b { font-size: var(--fs-xl); font-weight: 600; line-height: 1; }
.billing-meter span { color: var(--dim); }
.billing-limit {
  margin: 0;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-tpl);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.billing-error {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-none);
  border-radius: var(--radius-sm);
}
.billing-pay {
  display: grid;
  gap: var(--sp-2);
  justify-items: start;
}
.billing-pay button {
  padding: var(--sp-2) var(--sp-5);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.billing-pay button:hover { opacity: .92; }
.billing-fine {
  margin: 0;
  color: var(--dim);
  font-size: var(--fs-xs);
}

/* brand-cards.css */
/* brand-cards.css — the catalogue as brands.

   The city switcher above the list, the brand's own head, and the small
   vocabulary the brand rows add to the row shell.css draws. */

.cities {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin: 0 0 var(--sp-3);
}
.city-chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--dim);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.city-chip:hover { border-color: var(--line-strong); color: var(--fg); text-decoration: none; }
.city-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.card[data-kind="brand"] .card-name a { color: inherit; }
.badge-none { color: var(--site-none); }
.badge-site { color: var(--site-ok); }
.card-count { color: var(--dim); font-variant-numeric: tabular-nums; }

/* the venue section under the grid: a query that named a venue, not a brand */
.section-head {
  margin: var(--sp-5) 0 var(--sp-2);
  color: var(--dim);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* the brand page head */
.brand-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin: 0 0 var(--sp-4);
  max-width: var(--measure);
}
.brand-name { margin: 0; font-size: var(--fs-xl); font-weight: 600; }
.brand-meta { margin: 0; color: var(--dim); font-size: var(--fs-sm); }
.brand-back { color: var(--dim); font-size: var(--fs-sm); }

/* jobs.css */
/* jobs.css — the collect form and the job page. */

.collect {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin: 0 0 var(--sp-4);
}
.collect input[type="text"] {
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--fs-sm);
}
.collect input[type="text"]:focus { border-color: var(--accent); }
.collect input[name="city"] { flex: 1 1 220px; min-width: 160px; }
.collect input[name="country"] {
  flex: 0 0 56px;
  width: 56px;
  text-transform: uppercase;
  text-align: center;
}
/* The niche picker is a field of the same row, not a badge: it must not change
   the height of the form when it appears, so it copies the city input's box. */
.collect .niche-pick {
  height: 36px;
  padding: 0 var(--sp-2);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.collect .niche-pick:focus { border-color: var(--accent); }
.collect .niche-pick[hidden] { display: none; }
.collect button {
  height: 36px;
  padding: 0 var(--sp-4);
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.collect button:hover { opacity: .92; }

.job { max-width: var(--measure); }
.job-title { margin: 0 0 var(--sp-3); font-size: var(--fs-lg); }
.job-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-2);
}

.job-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--line);
  color: var(--fg);
  font-size: var(--fs-xs);
}
.job-badge[data-status="running"] { background: var(--accent); color: var(--accent-ink); }
.job-badge[data-status="done"] { background: var(--st-ok); color: var(--bg); }
.job-badge[data-status="failed"] { background: var(--st-none); color: var(--bg); }

.job-percent {
  color: var(--dim);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.job-bar {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--line);
  overflow: hidden;
  appearance: none;
}
.job-bar::-webkit-progress-bar { background: var(--line); border-radius: var(--radius-pill); }
.job-bar::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-pill); }
.job-bar::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-pill); }

.job-message { min-height: 1.4em; margin: var(--sp-2) 0; color: var(--dim); }
.job-note {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--fg);
  font-size: var(--fs-sm);
}
.job-next { margin-top: var(--sp-4); }
.job-next a { text-decoration: underline; text-underline-offset: 3px; }
.job-error { color: var(--st-none); }
.job-error a { color: inherit; }

/* the list of an account's own runs */
.jobs { max-width: var(--measure); }
.jobs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}
.jobs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.jobs-item:last-child { border-bottom: 0; }
.jobs-item:hover { background: var(--card-hover); }
.jobs-item a { display: flex; align-items: center; gap: var(--sp-2); }
.jobs-item a:hover { text-decoration: none; }
.jobs-item .muted { font-variant-numeric: tabular-nums; }

.job-elapsed { font-variant-numeric: tabular-nums; }

/* metrics.css */
/* metrics.css — the operator's numbers. One page, read only, no script.

   The page is its own file because it draws numbers across every account, not
   one account's list: `.door` (auth.css) gives it the frame and the ink, and
   this file widens the panel so a five-column table fits without a horizontal
   scroll. Colours and spacing are tokens from theme.css; nothing here names a
   colour of its own. */

.metrics {
  max-width: var(--measure);
  align-self: center;
  margin: var(--sp-5) 0;
}

.metrics .door-title { margin-top: var(--sp-5); }

.metrics-table {
  width: 100%;
  margin: 0 0 var(--sp-4);
  border-collapse: collapse;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.metrics-table th,
.metrics-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.metrics-table tr:first-child th {
  color: var(--dim);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.metrics-table th { font-weight: 600; white-space: nowrap; }

/* The number, then the bar that says how big it is against the row's biggest.
   A zero-length bar stays invisible rather than drawing a hairline that reads
   as "some". */
.metrics-n { display: inline-block; min-width: 3ch; }

.metrics-bar {
  display: inline-block;
  width: 96px;
  height: 6px;
  margin-left: var(--sp-2);
  background: var(--card-hover);
  border-radius: var(--radius-pill);
  overflow: hidden;
  vertical-align: middle;
}

.metrics-fill {
  display: block;
  height: 100%;
  background: var(--accent);
}

.metrics-share {
  margin-left: var(--sp-2);
  color: var(--dim);
  font-size: var(--fs-xs);
}

/* «—» is an answer, not a missing style: no event of that kind exists. */
.metrics-dash { color: var(--st-soc); }

.metrics-note {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--fs-sm);
}

.metrics-problems {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-none);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--fs-sm);
}

.metrics-kinds code,
.metrics-tail code { color: var(--accent); font-family: var(--font-mono); }

.metrics-tail td { color: var(--dim); white-space: nowrap; }

.metrics-footer {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-6);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

.metrics-dim { color: var(--dim); font-size: var(--fs-xs); }

/* A phone reads three columns worse than four: let the table keep its numbers
   and scroll, rather than wrap a kind name into syllables. */
@media (max-width: 640px) {
  .metrics { margin: var(--sp-3) 0; }
  .metrics-table { display: block; overflow-x: auto; }
  .metrics-bar { width: 48px; }
}

/* search.css */
/* search.css — the pager the list turns with, and only that. */

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-4) 0 var(--sp-2);
  font-size: var(--fs-sm);
}

/* the page numbers: every page you can turn to, the one you are on filled */
.pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--sp-1);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.pager-num:hover { background: var(--card-hover); color: var(--fg); text-decoration: none; }
.pager-num.is-current { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pager-gap {
  min-width: var(--sp-4);
  color: var(--dim);
  text-align: center;
}

/* the two steps that carry a caption, kept as buttons */
.pager-step {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  white-space: nowrap;
}
.pager-step:hover { border-color: var(--fg); text-decoration: none; }
.pager-gap.pager-step { border-color: transparent; }

.pager-where {
  margin-left: auto;
  color: var(--dim);
  font-size: var(--fs-xs);
}

@media (max-width: 500px) {
  .pager-where { flex-basis: 100%; margin-left: 0; }
}

/* settings.css */
/* settings.css — «Настройки»: the tabs, the rows, and the two display choices
   (density, text size) that theme.js puts on <html>. */

.settings { max-width: 40rem; display: grid; gap: var(--sp-4); }
.settings-title { margin: 0; font-size: var(--fs-lg); }
.settings h2 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); }
.billing .settings-title { margin: 0; font-size: var(--fs-lg); }

.settings-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  justify-self: start;
}
.settings-tab {
  padding: var(--sp-1) var(--sp-4);
  border-radius: var(--radius-pill);
  color: var(--dim);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.settings-tab:hover { background: var(--card-hover); color: var(--fg); text-decoration: none; }
.settings-tab.is-active, .settings-tab.is-active:hover { background: var(--accent); color: var(--accent-ink); }

.settings-group { display: grid; gap: 0; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
}
.settings-label { display: grid; gap: 2px; min-width: 0; }
.settings-name { font-size: var(--fs-md); }
.settings-hint { color: var(--dim); font-size: var(--fs-sm); }

.settings-choice {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
  flex-shrink: 0;
}
.settings-choice button {
  padding: var(--sp-1) var(--sp-3);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.settings-choice button:hover { background: var(--card-hover); color: var(--fg); }
.settings-choice button.is-active { background: var(--accent); color: var(--accent-ink); }

/* what the choices do everywhere */
html[data-density="compact"] .card { padding: var(--sp-2); gap: 2px; }
html[data-density="compact"] .grid { gap: var(--sp-1); }
html[data-text="large"] {
  --fs-xs: 15px;
  --fs-sm: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;
  --fs-xl: 30px;
}

/* shell.css */
/* shell.css — the product chrome: the rail, the sticky header, the status row,
   the list of rows, the empty states and the footer.

   The list is the product, so the card is a row here, not a tile: one line of
   the chain's name and what is known about it, one place for the phone. */

/* ------------------------------------------------------------------ rail */

.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: var(--rail);
  flex: 0 0 var(--rail);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-2);
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-1);
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: var(--fs-xs);
  line-height: 1;
}
.rail-item:hover {
  background: var(--card);
  color: var(--fg);
  text-decoration: none;
}
.rail-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.rail-icon { font-size: 17px; line-height: 1; }
.rail-caption { font-size: var(--fs-xs); text-align: center; }
.rail-version {
  margin-top: auto;
  align-self: center;
  color: var(--dim);
  font-size: var(--fs-xs);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* A phone gets a bottom tab bar: the same three sections, within thumb reach,
   and no 56px stripe eating a tenth of the width. */
@media (max-width: 760px) {
  .rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    width: auto;
    height: 56px;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    padding: 0 var(--sp-1);
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .rail-item {
    flex: 1 1 0;
    justify-content: center;
    padding: var(--sp-1) 0;
  }
  .rail-version { display: none; }
  .main { padding-bottom: 56px; }
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 24rem) minmax(0, 1fr) auto auto;
  grid-template-areas: "product search selects theme menu";
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-2) var(--gutter);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.product {
  grid-area: product;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.product:hover { text-decoration: none; }

.search { grid-area: search; min-width: 0; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 var(--sp-3);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--fs-sm);
}
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--accent); }

.selects {
  grid-area: selects;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  min-width: 0;
}
.select {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--dim);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.select[title="Город"] { color: var(--fg); border-color: var(--line-strong); }
/* A select is a button with a list behind it: same pill as the placeholders it
   replaced, its own arrow (a native one cannot be themed), and the same size as
   the text around it. */
select.select {
  appearance: none;
  -webkit-appearance: none;
  padding: 3px 22px 3px 9px;
  background-color: transparent;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 12px) 50%, calc(100% - 8px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  font: inherit;
  font-size: var(--fs-xs);
  color: var(--dim);
  cursor: pointer;
}
select.select:hover, select.select:focus-visible { color: var(--fg); border-color: var(--line-strong); }

.theme-toggle {
  grid-area: theme;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--dim);
  font-size: var(--fs-sm);
  line-height: 1;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--line-strong); }

.menu { grid-area: menu; position: relative; }
.menu > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 32px;
  padding: 0 var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  color: var(--fg);
  font-size: var(--fs-sm);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { border-color: var(--line); }
.menu[open] > summary { border-color: var(--line-strong); }
.menu-caret { color: var(--dim); font-size: var(--fs-xs); }
.menu-body {
  position: absolute;
  right: 0;
  top: calc(100% + var(--sp-2));
  z-index: 50;
  width: 240px;
  padding: var(--sp-3);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.menu-body .who-trial { color: var(--st-tpl); font-size: var(--fs-xs); }
.menu-body .who-out { color: var(--dim); font-size: var(--fs-sm); }

@media (max-width: 1000px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "product theme menu"
      "search search search";
  }
}

/* A phone shows the city in the switcher under the header, not as four
   placeholder chips: two rows of chrome, then the list. */
@media (max-width: 760px) {
  .selects { display: none; }
  .topbar { padding: var(--sp-2) var(--gutter); }
}

/* ------------------------------------------------------------- status row */

.statusrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-4);
  padding: var(--sp-2) var(--gutter);
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: var(--fs-xs);
}
.statusrow > span:first-child { color: var(--fg); }

.legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); }
.legend-item { color: var(--dim); }
.legend-item:hover { color: var(--fg); }
.legend-item::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--dim);
  vertical-align: 1px;
}
.legend-item.st-none::before { background: var(--site-none); }
.legend-item.st-template::before { background: var(--site-tpl); }
.legend-item.st-social::before { background: var(--site-soc); }
.legend-item.st-ok::before { background: var(--site-ok); }
.legend-item.st-unknown::before { background: var(--dim); }

.chip {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
}
.chip.is-active { border-color: var(--accent); color: var(--accent); }

/* ------------------------------------------------------- notices, meters */

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.notice-text { margin: 0; }
.notice .collect { margin: 0; }

.meter-full {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--st-tpl);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
}
.meter-full a { color: var(--dim); }

/* ------------------------------------------------------------------- list */

/* the «Готовы купить» / «Мои лиды» switch: one control with two states */
.views {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  margin: 0 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card);
}
.view {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--dim);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.view:hover { background: var(--card-hover); color: var(--fg); text-decoration: none; }
.view.is-active { background: var(--accent); color: var(--accent-ink); }
.view.is-active:hover { background: var(--accent); color: var(--accent-ink); }

/* «Скачать CSV» sits in the same switch, separated by the divider: it is the
   third thing to do with the list, not a second control to find. */
.view-download {
  border-left: 1px solid var(--line);
  margin-left: 2px;
  padding-left: 12px;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
}
.view-download:hover { background: var(--card-hover); color: var(--fg); }

/* Two cards across on a desktop, one on a phone. The grid used to be one
   full-width table of rows; two columns turn each entry into a card, so the type
   keeps the size it had and the wider column is what holds the extra words. */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-2);
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--dim);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.card:hover { background: var(--card-hover); }
.card:focus-within { background: var(--card-hover); }

.card[data-status="none"] { border-left-color: var(--site-none); }
.card[data-status="template"] { border-left-color: var(--site-tpl); }
.card[data-status="social"] { border-left-color: var(--site-soc); }
.card[data-status="ok"] { border-left-color: var(--site-ok); }
.card[data-status="unknown"] { border-left-color: var(--dim); }

.card-badges { display: flex; align-items: center; gap: var(--sp-1); }
.badge-status {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--dim);
}
.badge-new {
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.card-rating {
  margin-left: auto;
  color: var(--dim);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.card-name {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
}
.card-name a:hover { text-decoration: underline; }
.card-meta {
  margin: 0;
  color: var(--dim);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}
.card-contacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  font-size: var(--fs-sm);
}
.phone {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.phone:hover { border-color: var(--fg); text-decoration: none; }
.phone[data-empty] { color: var(--dim); border-style: dashed; }
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  min-width: 30px;
  padding: 0 var(--sp-1);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--dim);
  font-size: var(--fs-xs);
  line-height: 1;
  cursor: pointer;
}
.copy:hover, .copy:focus-visible { border-color: var(--line-strong); color: var(--fg); }
.copy[data-copied] { border-color: var(--line-strong); color: var(--st-ok); }
.icon-site {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--dim);
}
.icon-site:hover { color: var(--fg); background: var(--card); text-decoration: none; }
.icon-site .ic-globe { display: block; }

/* one row on a wide card: status on the left, the name in the middle, the phone
   on the right, so the eye can run down the phones without reading. Two cards
   share the width now, so this needs a screen where a single card is still
   wide — below it the card stacks, which is what a narrow column wants. */
@media (min-width: 1500px) {
  .card {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr) auto;
    grid-template-areas:
      "badges name contacts"
      "badges meta contacts";
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: var(--sp-4);
    row-gap: 2px;
    padding: var(--sp-2) var(--sp-4);
    min-height: 56px;
  }
  .card-badges {
    grid-area: badges;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .card-rating { margin-left: 0; }
  .card-name { grid-area: name; }
  .card-meta { grid-area: meta; }
  .card-contacts {
    grid-area: contacts;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
}

/* ------------------------------------------------------------- empty state */

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  margin: var(--sp-4) 0;
  padding: var(--sp-5);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--dim);
  font-size: var(--fs-sm);
}
.empty p { margin: 0; color: var(--fg); }
.empty a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.empty code {
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--fg);
}

/* ----------------------------------------------------------------- footer */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  padding: var(--sp-3) var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: var(--fs-xs);
}
.footer a { color: var(--dim); }
.footer a:hover { color: var(--fg); }
.footer-dim { color: var(--dim); }

/* ------------------------------------------------------------------ thumb */
/* A thumb is not a cursor: on a phone every control a row carries gets a
   44px box. This block sits last so it beats the density rules above. */
@media (max-width: 760px) {
  .copy, .icon-site, .phone, .theme-toggle { height: 44px; min-height: 44px; }
  .copy, .icon-site, .theme-toggle { min-width: 44px; }
  .icon-site, .phone { padding: 0 var(--sp-3); }
  .search input { height: 44px; }
  .rail-item { min-height: 44px; }
  .card { padding: var(--sp-2) var(--sp-3); }
}

/* theme.css */
/* theme.css — the design tokens, the reset and the type.

   This is the only file allowed to name a colour: every other stylesheet and
   every template reaches for var(--token). The tokens are light by default;
   the dark values live behind [data-theme="dark"] and behind the operating
   system's setting, so a visitor who has never touched the switch gets the
   theme their machine asked for. theme.js writes the switch's choice onto
   <html data-theme> before the body paints, so the page never flashes.

   Sorted into the bundle by filename, so this file lands last. That is
   deliberate: element-level rules here are the floor, component rules in the
   other files sit on top of it. */

:root {
  color-scheme: light;

  /* surfaces and ink */
  --bg: #f6f7f8;
  --panel: #ffffff;
  --card: #ffffff;
  --card-hover: #f3f4f6;
  --line: #e2e5e9;
  --line-strong: #cdd2d9;
  --fg: #17181a;
  --dim: #5c626b;

  /* one accent: the primary action and the active state, nothing else */
  --accent: #b4470a;
  --accent-ink: #ffffff;
  --accent-soft: #fbeee6;

  /* lead status, text on --card, each at or above 4.5:1 */
  --st-none: #b42318;
  --st-tpl: #8a5a00;
  --st-soc: #6941c6;
  --st-ok: #176b40;

  /* the site's state as a sales signal, not a verdict: no site is the green
     light (go and sell it), a site that already works is the red one. Kept apart
     from --st-*, which still mean good/bad for jobs, errors and lead marks. */
  --site-none: #176b40;
  --site-soc: #8a5a00;
  --site-tpl: #b54708;
  --site-ok: #b42318;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* the brief's five sizes, and nothing between them */
  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs-md: 16px;
  --fs-lg: 20px;
  --fs-xl: 28px;
  --lh: 1.45;
  --lh-tight: 1.2;

  /* space, in one scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --gutter: var(--sp-4);

  /* shape */
  --radius: 10px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* layout */
  --measure: 960px;
  --rail: 72px;
  --shadow-pop: 0 12px 32px -12px rgb(0 0 0 / .24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0d0f;
    --panel: #111214;
    --card: #16181b;
    --card-hover: #1c1f23;
    --line: #26292e;
    --line-strong: #363b42;
    --fg: #e9ebee;
    --dim: #9aa0a8;
    --accent: #ff7a2f;
    --accent-ink: #191008;
    --accent-soft: #2a1a11;
    --st-none: #f0736b;
    --st-tpl: #e3b34f;
    --st-soc: #b394f0;
    --st-ok: #5cc98d;
    --site-none: #5cc98d;
    --site-soc: #e3b34f;
    --site-tpl: #f0975a;
    --site-ok: #f0736b;
    --shadow-pop: 0 12px 32px -12px rgb(0 0 0 / .6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0d0f;
  --panel: #111214;
  --card: #16181b;
  --card-hover: #1c1f23;
  --line: #26292e;
  --line-strong: #363b42;
  --fg: #e9ebee;
  --dim: #9aa0a8;
  --accent: #ff7a2f;
  --accent-ink: #191008;
  --accent-soft: #2a1a11;
  --st-none: #f0736b;
  --st-tpl: #e3b34f;
  --st-soc: #b394f0;
  --st-ok: #5cc98d;
  --site-none: #5cc98d;
  --site-soc: #e3b34f;
  --site-tpl: #f0975a;
  --site-ok: #f0736b;
  --shadow-pop: 0 12px 32px -12px rgb(0 0 0 / .6);
}

@media (min-width: 900px) {
  :root { --gutter: var(--sp-6); }
}

/* the reset */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--fs-sm);
  line-height: var(--lh);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0 0 var(--sp-2);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -.01em;
}
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

p { margin: 0 0 var(--sp-3); }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

code, kbd { font-family: var(--font-mono); font-size: .92em; }

button, input, select, textarea { font: inherit; color: inherit; }

::selection { background: var(--accent-soft); color: var(--fg); }

/* one focus ring, everywhere, on the accent */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

.muted { color: var(--dim); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.num, .phone, .card-count, .pager-where, .job-percent, time {
  font-variant-numeric: tabular-nums;
}

/* ui.css */
/* ui.css — the catalogue as a work order.

   Sorted into the bundle by filename, so this file lands after every other one:
   it is the layer that decides what a stranger sees first, and it may overrule
   the row the earlier files drew. Nothing here names a colour — the tokens in
   theme.css do.

   Two viewports decide the rules: 390 px first, then 1440 px. A card is read
   top to bottom like a job ticket — who, where, why call, what to press — and
   the phone is the only control on it. */

/* -------------------------------------------------------------- the card */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
  min-height: 148px;
}
.card:hover { border-color: var(--line-strong); }
.card:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent-soft);
  outline-offset: 0;
}

/* The name, twice the size of the facts under it, and two lines at most. A
   chain called «Салон красоты «Афродита» на Вайнера» must not push the card
   taller than its neighbour: the clamp keeps the row level. */
.card-name {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-tight);
  min-height: calc(2 * var(--fs-lg) * 1.2);
}
.card-name a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  color: var(--fg);
  text-decoration: none;
}
.card-name a:hover { text-decoration: underline; }
/* One tap target: the name's link is stretched over the whole card, so a thumb
   aimed at the address opens the same page as a thumb aimed at the name. The
   controls in `.card-contacts` are lifted above it and keep their own hrefs. */
.card-name a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
}

/* niche · venues in city · rating */
.card-meta {
  margin: 0;
  color: var(--dim);
  font-size: var(--fs-xs);
  line-height: 1.35;
}
.card-meta .card-niche { color: var(--fg); opacity: .72; }
.card-meta .card-rating {
  margin-left: 0;
  color: var(--dim);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.card-meta .card-rating[data-rating] { color: var(--fg); opacity: .72; }

/* The street, on one line: the address decides whether a call is worth it and
   a wrapped address makes every card a different height. */
.card-address {
  margin: 0;
  overflow: hidden;
  color: var(--dim);
  font-size: var(--fs-xs);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The reason to call. «без сайта» is the point of the card, so it is the only
   coloured sentence in the grid — not one grey badge among five. */
.card-why {
  margin: 0;
  color: var(--dim);
  font-size: var(--fs-sm);
  line-height: 1.3;
}
.why-none, .badge-none { color: var(--site-none); font-weight: 600; }
.why-social { color: var(--site-soc); font-weight: 600; }
.why-tpl { color: var(--site-tpl); font-weight: 600; }
.card-why .badge-status { font-size: var(--fs-sm); font-weight: 600; }

/* The phone, last and pushed to the bottom so the chips line up across a row. */
.card-contacts {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: 2px;
}
.phone {
  height: 32px;
  border-color: var(--line-strong);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.phone a { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); }
.phone a:hover { text-decoration: none; }
/* The mask is the offer: the digits behind it cost one lead, and the button
   that spends it says so in one word. */
.phone-go {
  padding-left: 8px;
  border-left: 1px solid var(--line-strong);
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.phone:hover .phone-go { color: var(--accent); }
.icon-soc {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  color: var(--dim);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .03em;
}
.icon-soc:hover { background: var(--card-hover); color: var(--fg); text-decoration: none; }

/* -------------------------------------------------------------- the grid */

/* One column on a phone, two on a laptop, three when the window is wide enough
   that a card still holds a name, an address and a phone without wrapping. */
@media (min-width: 1280px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
}

/* The 1500 px row in shell.css was drawn for the badge-and-name card; the card
   is a column now, at every width. */
@media (min-width: 1500px) {
  .card {
    display: flex;
    grid-template-columns: none;
    grid-template-areas: none;
    gap: 6px;
    padding: var(--sp-3) var(--sp-4);
    min-height: 148px;
  }
  .card-name, .card-meta, .card-contacts { grid-area: auto; }
  .card-contacts { justify-content: flex-start; }
}

/* --------------------------------------------------------- first visit */

/* One sentence, above the cities: what the page is, before the list is asked to
   explain itself. No hero and no photograph — the grid is one scroll away and
   that is where the money is. */
.intro {
  margin: 0 0 var(--sp-3);
  max-width: var(--measure);
  color: var(--fg);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

/* ------------------------------------------------------------- empty states */

.empty-title { color: var(--fg); font-size: var(--fs-md); font-weight: 600; }
.empty-hints {
  display: grid;
  gap: var(--sp-1);
  margin: 0;
  padding-left: 1.1em;
  color: var(--dim);
  font-size: var(--fs-sm);
}
.empty-hints li::marker { color: var(--line-strong); }

/* ----------------------------------------------------------- brand page */

/* The chain's switchboard, said once and said plainly, before the venues: a
   reader who wants to call the chain should not scroll to the tenth row to find
   the same number a tenth time. */
.chain-phone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
}
.chain-phone-label {
  color: var(--dim);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chain-phone-note {
  flex: 1 1 100%;
  color: var(--dim);
  font-size: var(--fs-xs);
}

/* Ten venues, then one plain control: a chain of 244 is not 244 rows before
   the reader has decided it is the chain they want. */
.show-all { margin-top: var(--sp-3); }
.show-all > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--fg);
  font-size: var(--fs-sm);
  cursor: pointer;
  list-style: none;
}
.show-all > summary::-webkit-details-marker { display: none; }
.show-all > summary:hover { border-color: var(--line-strong); }
.show-all[open] > summary { margin-bottom: var(--sp-3); }

/* ------------------------------------------------------------- lead page */

/* LEAD_PAGE carries its own inline grid; the type, the rows and the buttons are
   this file's. The number is the product, so it is set as one: large, selectable
   and next to the button that copies it. */
.lead h2 { font-size: var(--fs-xl); font-weight: 600; line-height: var(--lh-tight); }
.lead ul li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  color: var(--dim);
  font-size: var(--fs-sm);
}
.lead ul li a { color: var(--fg); overflow-wrap: anywhere; }
.lead .phone { height: 44px; padding: 0 var(--sp-3); font-size: var(--fs-md); }
.lead .phone a { font-family: var(--font-mono); }

/* The next step, in the accent colour and never smaller than a thumb: sending
   the message and asking for the demo are the two things this page exists for. */
.door-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.door-button:hover { border-color: var(--fg); }
.door-button:disabled { color: var(--dim); cursor: default; }
.outreach > .door-button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
.outreach > .door-button:first-child:hover { background: var(--accent); filter: brightness(1.08); }
.demo { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* --------------------------------------------------------------- a thumb */

/* Below the laptop breakpoint every control the card carries gets a 44 px box
   and the card itself gets the width it needs to breathe. */
@media (max-width: 899px) {
  .card { min-height: 0; padding: var(--sp-3); }
  .card-name { min-height: 0; font-size: var(--fs-lg); }
  .phone, .icon-soc { height: 44px; }
  .phone a { min-height: 44px; }
  .phone-go { font-size: var(--fs-sm); }
  .chain-phone .phone { height: 44px; }

  /* Cities on one line that can be swiped. Ten chips of «Казань, 12 569 мест»
     were three rows of chrome above the first card — the selector answered a
     question ("what else is there?") that comes after "is there anything for
     me?". The count goes, the name stays, and the row scrolls sideways with no
     scrollbar eating the gutter. */
  .cities {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--sp-3));
    padding-inline: var(--sp-3);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }
  .cities::-webkit-scrollbar { display: none; }
  .city-chip { flex: 0 0 auto; scroll-snap-align: start; }
  .chip-n { display: none; }
}

/* A venue row inside a brand page: the address is the heading, so the row needs
   no two-line clamp and no 148 px floor — ten of them have to fit where one
   chain card used to. */
.card-venue { min-height: 0; gap: 4px; padding: var(--sp-2) var(--sp-3); }
.card-venue .card-name { min-height: 0; font-size: var(--fs-md); }
.card-venue .card-name a { -webkit-line-clamp: 1; }
.card-name-small { color: var(--dim); }
@media (max-width: 899px) {
  .card-venue { padding: var(--sp-3); }
}

/* ------------------------------------------------------------------ *
 * The customer's memory of a lead: status on the card, chips above the
 * list. Colours are the existing tokens — --st-tpl is the amber already
 * used for a template site, --st-ok the green of a site that exists — so
 * the board does not invent a second colour language.
 * ------------------------------------------------------------------ */
.card[data-lead="wrote"] { border-left-color: var(--st-tpl); }
.card[data-lead="answered"] { border-left-color: var(--st-ok); }
.card[data-lead="closed"] { border-left-color: var(--line-strong); background: var(--bg); }
.card[data-lead="closed"] .card-name,
.card[data-lead="closed"] .card-meta,
.card[data-lead="closed"] .card-address,
.card[data-lead="closed"] .card-why { opacity: .5; }

.lead-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  position: relative;
  margin-top: auto;
  padding-top: var(--sp-1);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
}
.lead-word { color: var(--dim); margin-right: var(--sp-1); }
.lead-word:empty { display: none; }
.lead-word:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: middle;
}
.card[data-lead="wrote"] .lead-word { color: var(--st-tpl); }
.card[data-lead="answered"] .lead-word { color: var(--st-ok); }
.card[data-lead="closed"] .lead-word { color: var(--dim); }

.lead-btn {
  font: inherit;
  font-size: var(--fs-xs);
  line-height: 1.4;
  padding: 1px 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--dim);
  cursor: pointer;
}
.lead-btn:hover { color: var(--fg); border-color: var(--line-strong); }
.lead-btn.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.lead-star {
  position: absolute;
  top: calc(-1 * var(--sp-2));
  right: 0;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  border: none;
  background: none;
  color: var(--dim);
  cursor: pointer;
}
.lead-star[aria-pressed="true"] { color: var(--accent); }
.lead-error {
  flex-basis: 100%;
  margin: 2px 0 0;
  color: var(--st-none);
  font-size: var(--fs-xs);
}

/* The lead's own page: the same marks, one size up, status written out. */
.lead-controls-lg {
  gap: var(--sp-1);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  font-size: 1rem;
}
.lead-controls-lg .lead-word { margin-right: var(--sp-2); font-size: 1rem; font-weight: 600; }
.lead-controls-lg .lead-btn { padding: 4px 12px; font-size: 1rem; }
.lead-controls-lg .lead-star { position: static; font-size: 1.4rem; }

/* Chips above the list: the chosen filter is the URL, not a script state. */
.state-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2) var(--sp-3);
  margin: var(--sp-3) 0 var(--sp-2);
}
.state-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.state-chip {
  color: var(--dim);
  font-size: var(--fs-xs);
  text-decoration: none;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.state-chip:hover { color: var(--fg); border-color: var(--line-strong); }
.state-chip.is-active {
  color: var(--fg);
  border-color: var(--line-strong);
  background: var(--card);
  font-weight: 600;
}
.state-chip-star.is-active { color: var(--accent); }
.state-counts { margin: 0; color: var(--dim); font-size: var(--fs-xs); }
.card[data-lead] .card-name { padding-right: 1.5rem; }
