/* Модуль «рынок»: госзакупки 44/223 и индекс цен. Только токены из base.css.
   Общие для посадочных страниц полосы призыва (.cta-band) и перелинковка (.cat-related) - в catalog.css. */

.mk-gap { margin-top: 16px; }
.mk-small { font-size: 13px; }
.mk-section { margin-top: 32px; }
.mk-section > h2 { margin-bottom: 12px; }
.mk-empty p { max-width: 60ch; }
.mk-cta { margin-top: 36px; }

/* Цена */
.mk-median { font-family: var(--mono); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.mk-median-big { display: block; font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -0.04em; margin: 6px 0 4px; }
.mk-range { display: block; color: var(--muted); font-size: 12.5px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mk-few { color: var(--warn); font-size: 14px; }
.mk-change { display: inline-block; font-size: 12.5px; font-weight: 650; padding: 2px 8px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-up { background: var(--brand-soft); color: var(--brand-ink); }
.mk-down { background: var(--info-soft); color: var(--info); }

/* Сводка по позиции */
.mk-summary { display: flex; justify-content: space-between; align-items: center; gap: 20px 32px; flex-wrap: wrap; }
.mk-summary-label { color: var(--muted); font-size: 14px; }
.mk-summary-main .mk-change { margin-top: 4px; }
.mk-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 32px; margin: 0; }
.mk-facts div { display: flex; flex-direction: column; }
.mk-facts dt { color: var(--muted); font-size: 13px; }
.mk-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.mk-empty-card h2 { margin-bottom: 8px; }
.mk-empty-card p { max-width: 64ch; color: var(--ink-2); }
.mk-country { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.mk-country .mk-range { display: inline; }

/* Что откроется после регистрации - плашка .lockn (public.css) */
.mk-unlock-btn { margin-top: 10px; }
.lockn a.btn-wood, .lockn a.btn-wood:hover { color: oklch(0.99 0.005 60); text-decoration: none; }

.mk-table td { vertical-align: middle; }
.table th.num, .table td.num { text-align: right; } /* base.css: .table th/td перебивает .num */
.mk-table td.num .mk-median { display: block; }
.mk-flat { border: 0; border-radius: 0; box-shadow: none; }

.mk-tags, .mk-regions { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mk-tags li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 12px; font-size: 14px; }
.mk-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 24px; }
.mk-regions li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mk-regions li > span:last-child { text-align: right; }

.mk-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.mk-list li { padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; }
.mk-list li + li { border-top: 1px solid var(--line); }
.mk-list a { font-weight: 600; overflow-wrap: anywhere; }
.mk-list-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; }

/* График */
.mk-chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-1); }
.mk-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.mk-chart-band { fill: var(--brand-soft); }
.mk-chart-line { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.mk-chart-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.mk-chart-axis { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; font-variant-numeric: tabular-nums; }


/* Госзакупки: фильтры и карточки */
.mk-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px 16px; align-items: end; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; box-shadow: var(--shadow-1); }
.mk-filters-actions { display: flex; gap: 8px; }
.mk-count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.mk-cards { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.mk-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-1); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.mk-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.mk-card-top { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.mk-operator { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.mk-deadline { margin-left: auto; }
.mk-card-title { font-weight: 650; font-size: 16.5px; line-height: 1.4; color: var(--ink); overflow-wrap: anywhere; }
.mk-card-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mk-card-title:hover { color: var(--brand-hover); text-decoration: none; }
.mk-card-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 14px; }
.mk-card-meta span { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; min-width: 0; }
.mk-card-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.mk-nmck { font-weight: 700; font-variant-numeric: tabular-nums; }
.mk-nmck .muted { font-weight: 400; font-size: 13.5px; }
.mk-card-groups { display: flex; flex-wrap: wrap; gap: 6px; }

.mk-detail-grid { grid-template-columns: minmax(0, 1fr) 340px; }
.mk-detail-grid > * { min-width: 0; }
.mk-badges { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.mk-ext-title { overflow-wrap: anywhere; max-width: 52ch; }
.mk-aside p { margin: 0 0 12px; }
.mk-aside .btn-block + p { margin-top: 8px; }
.mk-aside .btn-block { white-space: normal; text-align: center; padding: 10px 16px; line-height: 1.3; }
.mk-aside-soft { background: var(--brand-soft); border-color: transparent; box-shadow: none; }
.mk-aside-soft p { color: var(--ink-2); }

@media (max-width: 1100px) {
  .mk-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .mk-facts { grid-template-columns: repeat(2, auto); }
}
@media (max-width: 720px) {
  .mk-filters { grid-template-columns: minmax(0, 1fr); }
  .mk-filters-actions .btn { flex: 1; }
  .mk-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
  .mk-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .mk-median-big { font-size: 26px; white-space: normal; }
  .mk-col-hide { display: none; }
  .mk-stack thead { display: none; }
  .mk-stack tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); padding: 12px 16px; gap: 4px; border-bottom: 1px solid var(--line); }
  .mk-stack tbody tr:last-child { border-bottom: 0; }
  .mk-stack tbody td { padding: 0; border: 0; }
  .mk-stack tbody td.num { text-align: left; }
  .mk-stack tbody td.mk-col-hide { display: none; }
  .mk-card { padding: 14px 16px; }
  .mk-deadline { margin-left: 0; }
  .mk-chart { padding: 12px; }
  .mk-chart svg { height: 170px; }
  .mk-regions { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v3: цены в стиле главной ---------- */
.mk-gap { margin-top: 16px; }
.mk-note { font-size: 13px; color: var(--muted); margin: -6px 2px 0; }
.mk-groups { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mk-groups .pn + .pn { margin-top: 0; }
.mk-group { scroll-margin-top: 80px; }
.mk-rows { width: 100%; border-collapse: collapse; }
.mk-rows td { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.mk-rows tr:last-child td { border-bottom: 0; }
.mk-rows tbody tr:hover td { background: var(--surface-2); }
.mk-rows .nm { min-width: 0; }
.mk-rows .nm a { font-weight: 600; color: var(--ink); }
.mk-rows .nm a:hover { color: var(--brand-ink); }
.mk-rows .r { text-align: right; white-space: nowrap; }
.mk-rows .ch { width: 1%; }
.mk-rows .t { font-family: var(--mono); color: var(--muted); font-size: 13px; white-space: nowrap; }
.mk-when { display: block; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; }
.mk-change { font-family: var(--mono); font-weight: 600; }

.mk-sum { display: flex; justify-content: space-between; align-items: center; gap: 18px 32px; flex-wrap: wrap; padding: 20px 22px; }
.mk-sum-label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mk-sum-main { min-width: 0; }
.mk-sum-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.mk-sum-facts div { background: var(--surface); padding: 10px 14px; }
.mk-sum-facts dt { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.mk-sum-facts dd { margin: 2px 0 0; font-weight: 650; font-family: var(--mono); font-size: 14.5px; white-space: nowrap; }

.mk-few-box h2 { font-size: 20px; margin-bottom: 6px; }
.mk-few-box p { color: var(--ink-2); max-width: 64ch; }
.mk-pn-note { margin: 0; padding: 12px 16px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.pn > .mk-pn-note:last-child { border-bottom: 0; }
.mk-side-text p { font-size: 14px; color: var(--ink-2); line-height: 1.5; margin: 0 0 10px; }
.mk-links li { align-items: center; }
.mk-links li .ico { color: var(--faint); flex: 0 0 auto; }
.mk-src li { color: var(--ink-2); }

.mk-article { min-width: 0; }
.mk-article .pn-body { padding: 8px 28px 24px; max-width: 78ch; }
.mk-article h2 { font-size: 20px; margin: 24px 0 10px; letter-spacing: -0.02em; }
.mk-article p, .mk-article li { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.mk-article ol, .mk-article ul { padding-left: 22px; margin: 0 0 1em; }
.mk-article li { margin-bottom: 8px; }
.mk-access-list li { flex-direction: column; gap: 2px; }
.mk-access-list b { font-family: var(--font); font-size: 13px; color: var(--muted); }
.mk-access-list span { color: var(--ink); }
.mk-access { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mk-access th, .mk-access td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.mk-access th { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--muted); }
.mk-access td:first-child, .mk-access th:first-child { text-align: left; padding-left: 16px; }
.mk-access tr:last-child td { border-bottom: 0; }

@media (max-width: 760px) {
  .mk-rows tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .mk-rows, .mk-rows tbody { display: block; }
  .mk-rows tr:last-child { border-bottom: 0; }
  .mk-rows td { display: block; padding: 0; border: 0; }
  .mk-rows .nm { grid-column: 1 / -1; }
  .mk-rows .r { text-align: left; white-space: normal; }
  .mk-rows .ch { text-align: right; align-self: start; }
  .mk-sum { padding: 16px; }
  .mk-sum-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .mk-median-big { font-size: 27px; white-space: normal; }
  .mk-article .pn-body { padding: 4px 16px 18px; }
  .mk-article p, .mk-article li { font-size: 15.5px; }
}

/* Кнопки заголовка не растягиваются на половину строки (.ph > div в public.css) */
.ph > .ph-acts { flex: 0 1 auto; }
@media (max-width: 760px) { .ph > .ph-acts { flex: 1 1 100%; } }
