/* 2base public page compositions: catalog, bases, market, tools and editorial. */
/* Ready-made base cards on /bases listing — Avito-style.
   No outer border, no shadow, just rounded cover image on top and plain
   text under it. Density of the listing creates the visual rhythm. */
.app-base-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  text-decoration: none;
  position: relative;
}
.app-base-card:hover .app-base-card__cover {
  transform: scale(1.01);
}
.app-base-card__cover {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
  background-color: var(--color-surface-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 200ms ease;
}
.app-base-card__cover--fallback {
  /* Tint, not the old near-black gradient: a wall of dark rectangles was the
     heaviest thing on a light listing page, and it read as «broken image»
     rather than «cover pending» (mockup uses the tint placeholder). */
  background-image: linear-gradient(135deg, var(--tint) 0%, var(--brand-200) 100%);
}
.app-base-card__body {
  padding: 0.75rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.app-base-card__title {
  font-weight: var(--font-weight-strong);
  font-size: var(--text-md);
  line-height: 1.3;
  color: var(--brand-700);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Count and the checkout total sit together: the sum is what the buyer
   compares between cards, the per-contact rate is the secondary hint. */
.app-base-card__count {
  font-size: var(--text-md);
  color: var(--gray-900);
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.app-base-card__count strong {
  color: var(--gray-900);
  font-weight: var(--font-weight-strong);
}
.app-base-card__count span {
  color: var(--color-text-muted);
}
.app-base-card__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.5rem;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.app-base-card__price strong {
  font-size: var(--text-md);
  font-weight: var(--font-weight-strong);
  color: var(--gray-900);
}
.app-base-card__price span {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-body);
  color: var(--color-text-muted);
}
.app-base-card__cov {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.7rem;
  list-style: none;
  padding: 0;
  margin: 0.1rem 0 0;
  /* Mono for the coverage counts (mockup): they are data, and the fixed
     advance keeps «тел. / email / сайт» aligned across a grid of cards. */
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.app-base-card__cov li {
  display: inline-flex;
  gap: 0.25rem;
}
.app-base-card__cov strong {
  color: var(--gray-900);
  font-weight: var(--font-weight-strong);
}

/* Category pages contain many SKUs with the same category cover. A compact
   data-first variant removes the repeated image wall while /bases keeps the
   image-led catalog cards. */
.app-base-card--compact {
  height: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 15px 16px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.app-base-card--compact:hover {
  border-color: var(--color-border-hover);
  background: var(--tint);
  transform: translateY(-1px);
}

.app-base-card--compact .app-base-card__body {
  height: 100%;
  padding: 0;
}

.app-base-card--compact .app-base-card__title {
  color: var(--ink);
}

.app-bases-mobile-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: -8px 0 20px;
  padding: 4px 0;
  scrollbar-width: none;
}

.app-bases-mobile-tabs::-webkit-scrollbar {
  display: none;
}

.app-bases-mobile-tabs a {
  min-height: var(--control-height);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border-control);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  padding: 0 14px;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
  text-decoration: none;
}

.app-bases-toolbar {
  margin: 0 0 var(--space-8);
}

.app-bases-toolbar > summary {
  list-style: none;
}

.app-bases-toolbar > summary::-webkit-details-marker {
  display: none;
}

.app-bases-toolbar__summary {
  display: none;
}

.app-bases-toolbar__body {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  border-block: 1px solid var(--color-border);
  padding: 16px 0;
}

.app-bases-toolbar__field {
  flex: 1 1 190px;
  min-width: 0;
}

.app-bases-toolbar__reset {
  flex: 0 0 auto;
  margin-bottom: 2px;
}

@media (min-width: 1024px) {
  .app-bases-mobile-tabs {
    display: none;
  }
}

@media (max-width: 1023px) {
  .app-bases-toolbar {
    overflow: hidden;
    border: 1px solid var(--color-border-control);
    border-radius: var(--radius-md);
    background: var(--color-surface);
  }

  .app-bases-toolbar__summary {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px;
    color: var(--ink);
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: var(--font-weight-strong);
  }

  .app-bases-toolbar__summary > span:last-child {
    color: var(--color-text-muted);
    font-size: var(--text-lg);
    font-weight: var(--font-weight-body);
    transition: transform var(--transition-fast);
  }

  .app-bases-toolbar[open] .app-bases-toolbar__summary > span:last-child {
    transform: rotate(45deg);
  }

  .app-bases-toolbar__body {
    border-top: 1px solid var(--color-border-control);
    border-bottom: 0;
    padding: 16px;
  }

  .app-bases-list > section {
    scroll-margin-top: calc(var(--app-header-height) + 12px);
  }
}

@media (max-width: 639px) {
  .app-bases-toolbar__field,
  .app-bases-toolbar__reset {
    width: 100%;
    flex-basis: 100%;
  }

  .app-bases-catalog [data-base-grid] {
    gap: 12px;
  }

  .app-bases-catalog [data-base-grid] > div {
    min-width: 0;
  }

  .app-bases-catalog .app-base-card {
    display: grid;
    min-height: 116px;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 12px;
  }

  .app-bases-catalog .app-base-card__cover {
    width: 104px;
    height: 104px;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
  }

  .app-bases-catalog .app-base-card__body {
    min-width: 0;
    justify-content: center;
    gap: 2px;
    padding: 0;
  }

  .app-bases-catalog .app-base-card--compact {
    display: flex;
    min-height: 0;
    padding: 14px;
  }

  .app-bases-catalog .app-base-card--compact .app-base-card__body {
    width: 100%;
    gap: 4px;
  }

  .app-bases-catalog .app-base-card__title,
  .app-bases-catalog .app-base-card__count,
  .app-bases-catalog .app-base-card__price strong {
    font-size: var(--text-sm);
  }

  .app-bases-catalog .app-base-card__cov {
    gap: 2px 8px;
    font-size: 0.625rem;
  }

  .app-bases-catalog .app-bases-card-mobile-extra,
  .app-bases-catalog .app-bases-region-mobile-extra,
  .app-bases-catalog .app-bases-search-extra {
    display: none;
  }

  .app-bases-catalog .is-expanded .app-bases-card-mobile-extra,
  .app-bases-catalog .is-expanded .app-bases-region-mobile-extra,
  .app-bases-catalog .is-expanded .app-bases-search-extra {
    display: block;
  }

  .app-bases-catalog .is-expanded .app-bases-region-mobile-extra {
    display: flex;
  }

  .app-bases-list > section {
    margin-bottom: 32px;
  }
}

/* Native file input — make the chooser button match our brand button style. */
input[type="file"]::file-selector-button {
  cursor: pointer;
}

/* Print styles */
@media print {
  nav, footer, .no-print { display: none !important; }
  body { background: white; color: black; }
}

/* ===== Catalog screens (redesign wave 1c) =====
   Mockup screens «Каталог» / «Категория каталога»: tint tiles for the
   sub-category breakdown, a 236px filter rail beside the listing, and
   section heads underlined in ink. */

.app-cat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 0.875rem;
}

.app-cat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--tint);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  min-height: 104px;
  color: inherit;
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.app-cat-tile:hover {
  background: var(--brand-200);
}

.app-cat-tile__name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
  line-height: 1.3;
  color: var(--ink);
}

.app-cat-tile__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: auto;
}

.app-cat-tile__desc {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--muted);
}

/* Listing shell: filter rail + results. Collapses at the mockup's 860px. */
.app-company-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 767px) {
  .app-company-shell {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

.app-side-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.625rem;
  padding: 0.5rem 0.375rem;
  border-radius: var(--radius-xs);
  font-size: var(--text-sm);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

.app-side-row:hover {
  background: var(--tint);
}

.app-side-row__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-body);
  color: var(--muted);
  white-space: nowrap;
}

/* Shared section header: one quiet rule and one baseline across every data
   family. Heavy black separators belonged to the old market-only layout. */
.app-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  border-bottom: 1px solid var(--color-border-control);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.app-sec-head__title {
  font-size: var(--text-md);
  font-weight: var(--font-weight-strong);
  color: var(--ink);
  margin: 0;
}

/* One company in a listing */
.app-co-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0.375rem;
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.app-co-row:hover {
  background: var(--tint);
}

.app-co-row__name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
  color: var(--ink);
  text-decoration: none;
}

.app-co-row__name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--color-border-hover);
}

.app-co-row__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 0.25rem;
}

.app-co-row__flags {
  display: flex;
  gap: 0.625rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}

.app-seo-disclosure {
  margin-top: 32px;
  border-top: 1px solid var(--color-border);
  padding-top: 16px;
}

.app-seo-disclosure > summary {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  cursor: pointer;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
  list-style: none;
}

.app-seo-disclosure > summary::-webkit-details-marker {
  display: none;
}

.app-seo-disclosure > summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--muted);
  font-family: var(--font-mono);
}

.app-seo-disclosure[open] > summary::after {
  content: "−";
}

.app-seo-disclosure > summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Canonical public hero. It shares the constructor's left edge and vertical
   rhythm; pages may place controls or actions below the lead without changing
   the H1 geometry. */
.app-page-hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 var(--page-hero-gap);
}

.app-page-hero > .app-mono-label:first-child {
  margin-bottom: var(--space-3);
}

.app-page-hero__title,
.app-page-hero > .app-page-title {
  margin: 0;
  color: var(--ink);
  font-size: var(--text-xl);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--letter-spacing);
  line-height: 1.1;
  text-wrap: balance;
}

.app-page-hero__lead,
.app-page-hero > p {
  max-width: var(--container-prose);
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.app-page-hero--workbench {
  min-height: 80px;
  justify-content: center;
  margin-bottom: var(--space-4);
}

@media (max-width: 767px) {
  .app-page-hero {
    margin-bottom: var(--space-6);
  }

  .app-page-hero__title,
  .app-page-hero > .app-page-title {
    font-size: var(--text-lg);
  }

  .app-page-hero--workbench {
    min-height: 72px;
    margin-bottom: var(--space-4);
  }
}

/* Shared stat-card grid used by market, review and account summaries. */

.app-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
}

.app-stat-strip__item {
  min-width: 0;
  border: 1px solid var(--color-border-control);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-4);
}

.app-stat-strip__v {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--letter-spacing);
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* Paired values («5,4 / 7,0 млн») need the smaller step or they wrap. */
.app-stat-strip__v--pair {
  font-size: var(--text-lg);
}

.app-stat-strip__k {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-top: 0.125rem;
}

@media (max-width: 639px) {
  .app-stat-strip__item {
    padding: var(--space-3);
  }

  .app-stat-strip__v {
    font-size: var(--text-lg);
  }

  .app-stat-strip__v--pair {
    font-size: var(--text-md);
  }
}

/* Ranked list row — «Отрасли» / «Регионы» / «Крупнейшие города». Heavier than
   .app-side-row (which is rail furniture): here the list IS the content. */
.app-side-row--rank {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8125rem 0.125rem;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-body);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--transition-fast);
}

a.app-side-row--rank:hover {
  background: var(--tint);
}

/* ===== Ready-made base detail (redesign wave 1c) =====
   Screen «Карточка базы» from the mockup: cover + fact ledger, a coverage
   strip the buyer reads as «what outreach does this support», and a sticky
   panel that leads with the record count. */

/* Cover placeholder for bases with no uploaded image. Light tint, not the
   old near-white gradient that read as a rendering failure. */
.app-cover-fallback {
  background: linear-gradient(135deg, var(--tint) 0%, var(--brand-200) 100%);
}

.app-cov {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: 26.25rem;
}

/* Market screens give the strip a wider column than the base card does. */
.app-cov--wide {
  max-width: 35rem;
  gap: 0.75rem;
}

.app-cov__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: var(--text-xs);
  color: var(--ink);
  margin-bottom: 0.3125rem;
}

.app-cov__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}

.app-cov__track {
  height: 7px;
  background: var(--tint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.app-cov__fill {
  height: 100%;
  background: var(--ink);
  border-radius: var(--radius-pill);
}

/* The mobile row is the one a cold-calling buyer looks for first — marker
   fill so it reads as the highlight of the strip, not another grey bar. */
.app-cov__fill--marker {
  background: var(--marker-dot);
}

.app-rb-buy__qty {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--letter-spacing);
  line-height: 1.05;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.app-rb-buy__price {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-strong);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.app-ready-base-main {
  display: grid;
  gap: var(--space-6);
}

.app-ready-base-product {
  align-items: stretch;
}

.app-ready-base-cover {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--tint);
}

.app-ready-base-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-ready-base-cover__fallback {
  display: flex;
  height: 100%;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  background: var(--ink);
  color: var(--color-surface);
}

.app-ready-base-cover__fallback span {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
}

.app-ready-base-cover__fallback strong {
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: var(--font-weight-strong);
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.app-ready-base-cover__fallback small {
  color: rgb(255 255 255 / 66%);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
}

.app-ready-base-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.app-ready-base-summary .app-page-title {
  margin-top: 8px;
}

.app-ready-base-lead {
  max-width: 34rem;
  margin-top: 12px;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.app-ready-base-value {
  display: grid;
  gap: 22px;
}

.app-ready-base-value__head {
  margin-bottom: 0;
}

.app-ready-base-value__head > div {
  display: grid;
  gap: 5px;
}

.app-ready-base-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--color-border);
}

.app-ready-base-metrics > div {
  min-width: 0;
  padding: 15px 14px 15px 0;
}

.app-ready-base-metrics > div + div {
  border-left: 1px solid var(--color-border);
  padding-left: 14px;
}

.app-ready-base-metrics dt {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.app-ready-base-metrics dd {
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-strong);
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-ready-base-coverage {
  display: grid;
  gap: 16px;
}

.app-ready-base-coverage__row {
  display: grid;
  gap: 7px;
}

.app-ready-base-coverage__row p {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.app-ready-base-fields {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.app-ready-base-fields__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
}

.app-ready-base-fields__head h3 {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-strong);
}

.app-ready-base-fields__head span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.app-ready-base-fields ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  margin-top: 14px;
}

.app-ready-base-fields li {
  position: relative;
  padding-left: 13px;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.app-ready-base-fields li::before {
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--marker-dot);
  content: "";
}

.app-ready-base-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.app-ready-base-constructor-link {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.app-ready-base-constructor-link:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-ready-base-phone-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.app-ready-base-phone-option input {
  margin-top: 2px;
}

.app-ready-base-phone-option > span {
  display: grid;
  gap: 2px;
}

.app-ready-base-phone-option strong {
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-strong);
}

.app-ready-base-phone-option small,
.app-ready-base-payment-note {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.app-ready-base-preview-body {
  padding-bottom: 20px;
}

.app-ready-base-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  border-top: 1px solid var(--color-border);
  padding: 16px 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.app-ready-base-preview-footer a {
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-ready-base-mobile-bar {
  display: none;
}

@media (max-width: 1023px) {
  .app-ready-base-layout {
    display: grid;
  }

  .app-ready-base-buy {
    order: 1;
    scroll-margin-top: calc(var(--app-header-height) + 12px);
  }

  .app-ready-base-main {
    order: 0;
  }

  .app-ready-base-mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-sticky);
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--color-border-control);
    background: var(--color-surface);
    padding: 10px 16px;
    box-shadow: 0 -8px 24px rgb(16 24 40 / 8%);
  }

  .app-ready-base-mobile-bar > div {
    display: grid;
    min-width: 0;
    gap: 1px;
  }

  .app-ready-base-mobile-bar strong {
    color: var(--ink);
    font-size: var(--text-md);
    font-variant-numeric: tabular-nums;
  }

  .app-ready-base-mobile-bar span {
    overflow: hidden;
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 639px) {
  .app-ready-base-cover,
  .app-ready-base-cover__fallback {
    min-height: 210px;
  }

  .app-ready-base-metrics dd {
    font-size: var(--text-sm);
  }

  .app-ready-base-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .app-ready-base-actions .app-btn {
    width: 100%;
  }

  .app-ready-base-metrics,
  .app-ready-base-fields ul {
    grid-template-columns: 1fr;
  }

  .app-ready-base-metrics > div + div {
    border-top: 1px solid var(--color-border);
    border-left: 0;
    padding-left: 0;
  }

  .app-ready-base-fields__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-ready-base-preview-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ===== Tool tabs (redesign wave 1c) =====
   The mockup's tool row. Anchors, not buttons: every tool is its own URL. */
.app-tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.app-tool-tab {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--ink);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.app-tool-tab:hover {
  background: var(--tint);
}

/* Mockup `tgl(true)` — the tool rail is the same toggle as the filter chips,
   so the current tool is marker-filled, not ink-filled. Ink is reserved for
   buttons that submit money (`qbtn`, primary CTA); the rail only says
   "you are here". */
.app-tool-tab--active {
  background: var(--marker);
  border-color: transparent;
  color: var(--ink);
  font-weight: var(--font-weight-strong);
}

.app-tool-tab--active:hover {
  background: var(--marker);
}

/* 404 / 410 / 5xx numeral — Inter 600, same face as the wordmark. */
.app-err-code {
  display: inline-block;
  position: relative;
  font-family: var(--font-sans);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--letter-spacing);
  line-height: 1;
  color: var(--ink);
  padding-bottom: 0.35rem;
}

.app-err-code::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--marker);
}

/* «Действует» inside dense listings (catalog rows, director cards, ИНН page).
   The palette has no green and an active company is the default state, so a
   marker dot carries it without reintroducing a second brand colour. */
.app-status-badge--live {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  background: none;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-body);
  color: var(--muted);
  white-space: nowrap;
}

.app-status-badge--live::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--marker-dot);
}

/* HTTP verb badge in the API docs — was green/blue pills. */
.app-api-method {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-xs);
  background: var(--tint);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--letter-spacing);
}

/* Article row — the mockup's blog list ("Блог 2base"): a rule-separated
   reading list, not a card grid. Covers were placeholders on every post, so
   the grid rendered twelve empty tinted boxes; the list drops them and lets
   the titles carry the page. */
.app-post-list {
  border-top: 1px solid var(--color-border);
}

.app-post-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.375rem 0.75rem;
  margin-inline: -0.75rem;
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition-fast);
}

.app-post-row:hover {
  background: var(--tint);
}

.app-post-row__body {
  max-width: 40rem;
}

.app-post-row__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-strong);
  letter-spacing: var(--letter-spacing);
  color: var(--ink);
}

/* Clamp lives in the component, not on a utility: app.css loads after
   tailwind.css, so any display declaration here would beat line-clamp-2's
   -webkit-box and silently unclamp the lede. */
.app-post-row__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 0.375rem;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--muted);
}

.app-post-row__go {
  flex-shrink: 0;
  align-self: center;
  font-size: var(--text-xs);
  color: var(--muted);
  white-space: nowrap;
}

.app-post-row:hover .app-post-row__go {
  color: var(--ink);
}

@media (max-width: 639px) {
  .app-post-row__go {
    display: none;
  }
}

/* Cards that are themselves links. Shadows are reserved for overlays, so the
   affordance is the border darkening, not a lift. */
.app-card--hover {
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.app-card--hover:hover {
  border-color: var(--muted);
}

/* Long-form proof stays crawlable but no longer dominates the visual page. */
.app-case-study {
  overflow: hidden;
}

.app-case-study__summary {
  display: block;
  padding: 1.5rem;
  cursor: pointer;
  list-style: none;
}

.app-case-study__summary::-webkit-details-marker { display: none; }

.app-case-study__summary::after {
  content: "Открыть полный разбор ↓";
  display: block;
  margin-top: 1rem;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing);
}

.app-case-study[open] .app-case-study__summary { border-bottom: 1px solid var(--color-border); }
.app-case-study[open] .app-case-study__summary::after { content: "Свернуть ↑"; }
.app-case-study__body { padding: 0.25rem 1.5rem 1.5rem; }

.app-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--control-height);
  padding: 1rem 1.5rem;
  color: var(--ink);
  font-weight: var(--font-weight-strong);
  cursor: pointer;
  list-style: none;
}

.app-disclosure-summary::-webkit-details-marker { display: none; }
.app-disclosure-summary::after { content: "↓"; margin-left: auto; font-family: var(--font-mono); }
details[open] > .app-disclosure-summary::after { content: "↑"; }

.app-link-index { border-top: 1px solid var(--color-border); }
.app-link-index__body { padding: 0 1.5rem 1.5rem; }

/* «Есть / Да / REST API» cells in the competitor table. Was emerald pills —
   the only green left on the public site after the redesign. Marker tint says
   the same "we have it" without reintroducing a second brand colour. */
.cmp-yes {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--marker-tint);
  color: var(--ink);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-strong);
  white-space: nowrap;
}

/* Section heading on content pages (about / methodology / press / …). The
   data screens use .app-sec-head, which pairs a title with a mono kicker; prose
   sections have nothing to put in that slot, so this is the same ink rule
   without the second column. */
h2.app-sec-head {
  font-size: var(--text-md);
  font-weight: var(--font-weight-strong);
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.625rem;
  margin: 0 0 1rem;
}
/* Public lists are data surfaces: strong scanability plus visible keyboard focus. */
.app-cat-tile:focus-visible,
.app-side-row:focus-visible,
.app-co-row__name:focus-visible,
.app-side-row--rank:focus-visible,
.app-tool-tab:focus-visible,
.app-base-card:focus-visible,
.article-row:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.app-side-row--ruled { border-bottom: 1px solid var(--color-border); }
.app-page-title { letter-spacing: var(--letter-spacing); }
.app-sec-head__meta {
  color: var(--muted);
  font-weight: var(--font-weight-body);
}
/* Pricing compares three factual options as a ruled ledger, not as sales cards. */
.pricing-guarantees {
  color: var(--muted);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  list-style: none;
}
.pricing-grid { border-top: 2px solid var(--ink); }
.pricing-option { border-bottom: 1px solid var(--color-border); }
@media (min-width: 1024px) {
  .pricing-option--middle {
    border-left: 1px solid var(--color-border);
    border-right: 1px solid var(--color-border);
  }
}
.pricing-option__price {
  font-size: var(--text-xl);
  letter-spacing: var(--letter-spacing);
}
.app-text-ink { color: var(--ink); }
/* Data visualizations and the print view keep functional dimensions out of markup. */
.graph-canvas { min-height: 31.25rem; }
.map-canvas {
  height: calc(100dvh - 13.75rem);
  min-height: 25rem;
}
.company-print__back {
  float: left;
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: 2.375rem;
  text-decoration: underline;
  text-decoration-color: var(--color-border-hover);
  text-underline-offset: 0.1875rem;
}
.company-print__hint {
  margin-left: 0.75rem;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}
