/* ==========================================================================
   Tender page (the main selling screen) and the tender tables of the listing pages.
   Design v3 (owner, 2026-10-13): the approved „Tender“ and „Lots“ mock-ups, 1440 and 390 wide. Tokens and shared
   components: core/static/css/traxer.css. Status colours only for the deadline's urgency and the checklist's marks;
   the accent for actions, links and the chosen package / lots.
   ========================================================================== */

/* ------------------------------------------------------------ head: crumbs + last sync, pills, title, buyer line, actions */
.tender-head { padding-top: 20px; }
.tender-crumbs { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; font-size: 13px; }
.tender-crumbs .breadcrumbs { margin: 0; font-size: 13px; color: var(--muted); }
.tender-crumbs .breadcrumbs a { color: var(--muted); }
.tender-crumbs .breadcrumbs [aria-current="page"] { font-family: var(--font-num); font-weight: 500; color: var(--ink-2); }
/* the "/" ends a line instead of starting the next one */
.tender-crumbs .breadcrumbs li { white-space: nowrap; }
.tender-crumbs .breadcrumbs li + li::before { content: none; }
.tender-crumbs .breadcrumbs li:not(:last-child)::after { content: "/"; margin: 0 7px; color: var(--line-strong); }
.tender-crumbs__sync { display: inline-flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); white-space: nowrap; }
.tender-crumbs__sync svg { width: 14px; height: 14px; flex: none; }
.tender-crumbs__sync .num { font-weight: 500; }
.tender-head__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 56px; margin-top: 22px; }
.tender-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tender-pills .pill { text-decoration: none; }
.pill--line { background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
a.pill--line:hover { box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); }
.tender-pills__match:hover { color: var(--accent-ink); box-shadow: inset 0 0 0 1px #BFD0FF; }
.tender-title {
  margin: 16px 0 0; max-width: 30em; font: 800 30px/1.22 var(--font-display); letter-spacing: -.028em;
  text-wrap: pretty; overflow-wrap: anywhere;
}
.tender-title--long { font-size: 25px; line-height: 1.26; }
.tender-buyer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.tender-buyer > span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.tender-buyer > span + span::before { content: ""; width: 1px; height: 14px; margin: 0 14px 0 7px; background: var(--line); }
.tender-buyer__who svg { flex: none; color: var(--muted); }
.tender-buyer a { text-decoration: none; }
.tender-buyer__name { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.tender-buyer__name:hover { color: var(--accent); }
.tender-buyer__place { color: var(--accent); }
.tender-buyer__place:hover { color: var(--accent-ink); }
.tender-buyer__rop { font-weight: 500; color: var(--ink-2); }
.tender-head__actions { display: flex; gap: 10px; align-self: start; margin-top: 42px; }
.tender-head__actions .btn { min-height: 44px; }

/* ------------------------------------------------------------ facts strip: value, deadline (+ bar), term, criterion */
.fact-strip {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.62fr) minmax(0, .99fr) minmax(0, .9fr); margin: 28px 0 0;
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 36, .04);
}
.fact-strip > div { display: flex; flex-direction: column; min-width: 0; padding: 18px 24px; border-left: 1px solid var(--line-soft); }
.fact-strip > div:first-child { border-left: 0; }
.fact-strip dt { font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.fact-strip dd { margin: 0; }
.fact-strip dd.fact-strip__big { margin-top: 6px; font: 600 24px/32px var(--font-num); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.fact-strip__big .fs-amt__c, .fact-strip__unit { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--faint-deco); }
.fact-strip dd.fact-strip__term { font-family: var(--font-sans); font-size: 22px; }
.fact-strip dd.fact-strip__text { margin-top: 6px; font: 600 17px/32px var(--font-sans); color: var(--ink); }
.fact-strip dd.fact-strip__note { margin-top: 4px; font-size: 12.5px; line-height: 18px; color: var(--muted); }
.fact-strip dd.fact-strip__none { margin-top: 6px; font-size: 15px; font-weight: 500; line-height: 32px; color: var(--muted); }
.fact-strip__dl-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.fact-strip__left { text-align: right; }
.fact-strip__left dd { margin-top: 6px; }
.fact-strip__days.is-warn { color: var(--warn-ink); }
.fact-strip__days.is-crit { color: var(--crit); }
/* the bar from the publication to the deadline, today marked (role="img" with the same as text) */
.dl-track { --tone: var(--ok); position: relative; height: 6px; margin-top: 30px; border-radius: 3px; background: var(--soft); }
.dl-track b { position: absolute; inset: 0 auto 0 0; width: var(--p); border-radius: 3px; background: var(--tone); }
.dl-track i { position: absolute; top: 50%; left: var(--p); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--tone); box-shadow: 0 1px 2px rgba(11, 19, 36, .15); }
.dl-track--warn { --tone: var(--warn); }
.dl-track--crit { --tone: var(--crit); }
.dl-track__lbl { position: relative; display: flex; justify-content: space-between; margin-top: 7px; font: 500 11.5px/1.2 var(--font-num); color: var(--muted); }
/* „днес“ over the dot: centred on it mid-way, its left edge on it at the start and its right edge at the end (shifted by
   --p of its own width), so it never leaves the bar */
.dl-track__today { position: absolute; bottom: calc(100% + 8px); left: var(--p); transform: translateX(calc(-1 * var(--p)));
  font: 600 11.5px/1 var(--font-sans); font-style: normal; color: var(--tone); white-space: nowrap; }

/* ------------------------------------------------------------ body: the main column + the sticky side card, then „Как протича“
   Desktop: "top aside" / "flow aside"; under 1080px the card comes between the checklist and the steps (phones reach
   the price without scrolling past every section). */
.tender-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 384px; grid-template-rows: auto 1fr; grid-template-areas: "top aside" "flow aside";
  column-gap: 32px; row-gap: 20px; align-items: start; padding-block: 32px 56px;
}
.tender-body--closed { grid-template-areas: "top aside"; grid-template-rows: auto; }
.tender-top { grid-area: top; display: grid; gap: 20px; min-width: 0; }
.tender-aside { grid-area: aside; position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 12px; min-width: 0; }
.tender-flow { grid-area: flow; min-width: 0; }
@media (max-width: 1080px) {
  .tender-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "top" "aside" "flow"; row-gap: 24px; }
  .tender-body--closed { grid-template-areas: "top" "aside"; }
  .tender-aside { position: static; }
}

/* section tabs (in-page links; the targeted one is underlined in blue) */
.tender-tabs { gap: 4px; }
.tender-tabs a, .tender-tabs__off { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tender-tabs a:first-child { padding-left: 2px; }
.tender-tabs a.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.tender-tabs .tabs__count { margin: 0; padding: 4px 7px; font: 600 11.5px/1 var(--font-num); }
.tender-tabs a.is-active .tabs__count { background: var(--ink); color: #FFFFFF; }
.tender-tabs__off { color: var(--faint-deco); cursor: default; }
.tender-page:has(.tender-body [id]:target, .tender-rest [id]:target) .tender-tabs a.is-active { color: var(--muted); border-bottom-color: transparent; font-weight: 500; }
.tender-page:has(.tender-body [id]:target, .tender-rest [id]:target) .tender-tabs a.is-active .tabs__count { background: var(--soft); color: var(--ink-2); }
.tender-page:has(#obobshtenie:target) .tender-tabs a[href="#obobshtenie"],
.tender-page:has(#iziskvania:target, #saotvetstvie:target) .tender-tabs a[href="#iziskvania"],
.tender-page:has(#pozitsii:target) .tender-tabs a[href="#pozitsii"],
.tender-page:has(#dokumenti:target) .tender-tabs a[href="#dokumenti"],
.tender-page:has(#srokove:target) .tender-tabs a[href="#srokove"],
.tender-page:has(#razyasnenia:target) .tender-tabs a[href="#razyasnenia"],
.tender-page:has(#saobshtenia:target) .tender-tabs a[href="#saobshtenia"],
.tender-page:has(#sravnenie:target) .tender-tabs a[href="#sravnenie"],
.tender-page:has(#rezultat:target) .tender-tabs a[href="#rezultat"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------ „Какво ще Ви е необходимо“ */
.need { padding: 0; overflow: hidden; border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 36, .04); }
.need__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; padding: 22px 24px 18px; }
.need__head h2 { margin: 0; font: 700 19px/1.3 var(--font-display); letter-spacing: -.02em; }
.need__head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.need__legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.need__legend:empty { display: none; }
.need__legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.need__legend .need-mark { width: 14px; height: 14px; margin: 0; }
.need__legend .need-mark--ok { background: none; }
.need__legend .need-mark--ok svg, .need__legend .need-mark--warn svg { width: 14px; height: 14px; }
.need__legend .need-mark--we::after { width: 4px; height: 4px; }
/* the marks: ✓ in the profile, ⚠ check / missing, a blue ring – we prepare it, a dashed circle – not checked */
.need-mark { display: flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; }
.need-mark svg { width: 13px; height: 13px; }
.need-mark--ok { background: var(--ok-soft); color: var(--ok); }
.need-mark--warn { color: var(--warn); border-radius: 0; }
.need-mark--warn svg { width: 18px; height: 18px; }
.need-mark--we { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.need-mark--we::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.need-mark--q { border: 1.5px dashed var(--faint-deco); }
.need__match, .need__hint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 11px 24px;
  background: var(--canvas); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2);
}
.need__hint { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
.need__hint svg { flex: none; width: 15px; height: 15px; margin-top: 2px; color: var(--accent); }
.need__match .reasons { margin: 0; }
.need__hint a { color: var(--accent); text-decoration: none; font-weight: 600; }
.need__hint a:hover { color: var(--accent-ink); text-decoration: underline; }
.need__grp { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px 6px; }
.need__grp h3 { margin: 0; font: 600 11.5px/1.4 var(--font-sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.need__grp .num { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.need__grp--line { margin-top: 2px; border-top: 1px solid var(--line-soft); }
.need__row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 16px; align-items: start; padding: 14px 24px;
  border-top: 1px solid var(--line-soft); }
.need__grp + .need__row { border-top: 0; }
.need__head + .need__row { border-top: 1px solid var(--line-soft); }
.need__row--warn { background: color-mix(in srgb, var(--warn-soft) 45%, var(--bg)); }   /* a lighter --warn-soft: its „Липсва“ pill keeps its shape */
.need__main { min-width: 0; }
.need__main h3, .need__main h4 { margin: 0; font: 600 15px/1.4 var(--font-sans); letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
.need__main > p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.need__main > p .link { font-weight: 500; }
.need__main > p.need__src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.need__src svg { flex: none; color: var(--muted); }
.need__code { padding: 3px 6px; border-radius: 5px; background: var(--soft); font: 500 11.5px/1 var(--font-num); color: var(--ink-2); }
.need__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.need__tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.need__tip { margin: 4px 24px 12px; padding: 14px 16px; background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r);
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.need__tip-title { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.need__tip ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.need__basis { display: inline-block; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--soft);
  border-radius: 6px; padding: 0 6px; white-space: nowrap; }
.need__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin: 0; padding: 14px 24px;
  border-top: 1px solid var(--line-soft); background: var(--canvas); font-size: 13px; color: var(--muted); }
.need__foot p { flex: 1 1 260px; margin: 0; }
.need__foot .link { font-weight: 500; }
.need__foot .btn { flex: none; background: var(--bg); }
.need__note { margin: -8px 4px 0; }

/* ------------------------------------------------------------ „Как протича подготовката“ */
.tender-flow { padding: 20px 24px 22px; border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 36, .04); }
.tender-flow__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tender-flow__head h2 { margin: 0; font: 700 16px/1.3 var(--font-display); letter-spacing: -.02em; }
.tender-flow__head .link { font-size: 13px; font-weight: 600; }
.tender-flow__steps { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; }
.tender-flow__steps::before { content: ""; position: absolute; left: 14px; right: calc((100% - 64px) / 5 - 14px); top: 13px; height: 1px; background: var(--line); }
.tender-flow__steps li { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tender-flow__steps li > .num { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-bottom: 8px;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); font-size: 12.5px; color: var(--ink); }
.tender-flow__steps b { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tender-flow__steps li > span:last-child { font-size: 12.5px; line-height: 1.45; color: var(--muted); }

/* ------------------------------------------------------------ side card: the package and the exact price */
.buy { display: grid; gap: 0; padding: 24px; border-radius: 16px; box-shadow: 0 1px 2px rgba(11, 19, 36, .04), 0 24px 48px -28px rgba(11, 19, 36, .3); }
.buy__title { margin: 0; font: 700 19px/1.3 var(--font-display); letter-spacing: -.02em; }
.buy__lede { margin: 4px 0 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.buy__quote { display: grid; gap: 0; }
.buy__quote > .note { margin-top: 10px; }
.bq-scope { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 16px 0 0; padding: 10px 12px;
  border-radius: 10px; background: var(--canvas); font-size: 13px; color: var(--ink-2); }
.bq-scope b { font-weight: 600; }
.bq-scope .num:not(b) { font-weight: 500; white-space: nowrap; }
.bq-scope .link { flex: none; font-weight: 600; }
.bq-pkgs { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 12px 0 0; padding: 0; border: 0; }
.bq-pkg { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.bq-pkg:hover { border-color: var(--line-strong); }
.bq-pkg:has(input:checked), .bq-pkg.is-on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.bq-pkg:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.bq-pkg__pick { grid-column: 1 / -1; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; column-gap: 12px; align-items: center; cursor: pointer; }
.bq-pkg__pick::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }   /* the whole card selects */
.bq-pkg__pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.bq-pkg__name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: 14.5px; line-height: 1.35; }
.bq-pkg__name b { font-weight: 600; color: var(--ink); }
.bq-pkg__tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent-soft);
  color: var(--accent-ink); font-size: 11px; font-weight: 600; }
.bq-pkg__price { font-size: 15px; line-height: 1.35; color: var(--ink-2); white-space: nowrap; }
.bq-pkg:has(input:checked) .bq-pkg__price { color: var(--ink); }
.bq-pkg__sum { grid-column: 2 / -1; margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
/* a subscriber (orders.subscription): the free „Анализ“ of the month and the price frozen at the subscription's start */
.bq-pkg__sub { grid-column: 2 / -1; margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.bq-pkg__sub .text-ok { font-weight: 500; }
.bq-pkg__incl { grid-column: 2 / -1; display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.bq-pkg__incl li { display: flex; align-items: flex-start; gap: 8px; }
.bq-pkg__incl svg { flex: none; width: 13px; height: 13px; margin-top: 1px; }
.bq-pkg__incl .is-we svg { color: var(--ok); }
.bq-pkg__incl .is-check svg { color: var(--ink-2); }
.bq-pkg__incl .is-you { color: var(--muted); }
.bq-pkg__you { flex: none; width: 13px; height: 13px; margin-top: 1px; border: 1.5px solid var(--line-strong); border-radius: 50%; }
.bq-opts { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.bq-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; align-items: start; font-size: 13.5px; cursor: pointer; }
.bq-opt > span:not(.bq-opt__price) { min-width: 0; }
.bq-opt b { font-weight: 600; }
.bq-opt small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.bq-opt small .num { font-weight: 500; color: var(--ink-2); }
.bq-opt input[type="checkbox"]:not(.bq-switch) { width: 18px; height: 18px; margin: 1px 7px 0; accent-color: var(--accent); }
.bq-opt__price { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.bq-opt--switch { grid-template-columns: auto minmax(0, 1fr); }
/* „Плащане при успех“: a checkbox drawn as a switch (role="switch") */
.bq-switch { position: relative; flex: none; width: 32px; height: 18px; margin: 1px 0 0; border-radius: var(--r-pill); background: var(--line-strong);
  -webkit-appearance: none; appearance: none; cursor: pointer; transition: background-color .15s var(--ease); }
.bq-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg);
  box-shadow: 0 1px 2px rgba(11, 19, 36, .2); transition: transform .15s var(--ease); }
.bq-switch:checked { background: var(--ok); }
.bq-switch:checked::after { transform: translateX(14px); }
.bq-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.buy .total { display: grid; grid-template-columns: auto auto; justify-content: space-between; align-items: baseline; column-gap: 12px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.bq-total__k { font-size: 14px; font-weight: 600; color: var(--ink); }
.bq-total__k small { font-size: 13px; font-weight: 500; color: var(--muted); }
.bq-total__v .num { font: 600 34px/1 var(--font-num); letter-spacing: -.01em; color: var(--ink); white-space: nowrap; }
.bq-total__vat { grid-column: 2; margin-top: 6px; text-align: right; font-size: 12.5px; color: var(--muted); }
.buy .total > .bq-total__vat > .num { font: 500 12.5px/1.4 var(--font-num); letter-spacing: 0; }
.buy__quote > .btn { margin-top: 16px; min-height: 48px; }
.bq-trust { display: grid; gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.bq-trust li { display: flex; align-items: flex-start; gap: 8px; }
.bq-trust svg { flex: none; width: 13px; height: 13px; margin-top: 2px; color: var(--ok); }
.bq-trust .link { white-space: nowrap; }
.buy__list { list-style: none; margin: 12px 0; padding: 0; }
.buy__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.buy__list li:last-child { border-bottom: 0; }
.buy__list small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; }
.buy__list .num { font-weight: 600; white-space: nowrap; }
.buy > .note { margin-top: 10px; }
.buy .note .link { white-space: nowrap; }
/* „Нови поръчки като тази“ on a closed tender (tenders/_alerts_card.html): a quiet card, its buttons wrap */
.alerts-card { display: grid; gap: 12px; padding: 20px; }
.alerts-card__title { margin: 0; font: 700 17px/1.3 var(--font-display); letter-spacing: -.02em; }
.alerts-card__lede { margin: -6px 0 0; font-size: 13px; color: var(--muted); text-wrap: pretty; }
.alerts-card__options { display: grid; gap: 8px; }
.alerts-card__options .btn { white-space: normal; padding-block: 10px; line-height: 1.35; }
.tender-own { flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; }
.tender-own .link { font-weight: 500; }
/* the deadline note under the card */
.tender-countdown { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; }
.tender-countdown p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.tender-countdown p b { color: var(--ink); }
.tender-countdown__n { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px;
  border-radius: 12px; background: var(--soft); color: var(--ink); line-height: 1; }
.tender-countdown__n b { font: 600 20px/1 var(--font-num); }
.tender-countdown__n small { margin-top: 3px; font-size: 11px; color: var(--muted); }
.tender-countdown--warn .tender-countdown__n { background: var(--warn-soft); color: var(--warn-ink); }
.tender-countdown--crit .tender-countdown__n { background: var(--crit-soft); color: var(--crit); }
.tender-countdown--warn .tender-countdown__n small, .tender-countdown--crit .tender-countdown__n small { color: inherit; }
.tender-countdown--closed { grid-template-columns: minmax(0, 1fr); }
.tender-sync { padding-inline: 2px; }

/* ------------------------------------------------------------ under the grid: „Обобщение“, the lots, the other sections */
.tender-rest { display: grid; gap: 24px; min-width: 0; padding-bottom: var(--s-10); }
.tender-rest > .panel { border-radius: 16px; }
.facts-panel { padding: 0; overflow: hidden; }
/* „Обобщение“: the fact grid (tenders.facts), the „Няма“ chips, the BT codes */
.facts-panel__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft); }
.facts-panel__head h2 { margin: 0; font: 700 19px/1.3 var(--font-display); letter-spacing: -.02em; }
.facts-panel__src { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; color: var(--muted); }
.facts-panel .fact-table { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; column-gap: 0; margin: 0 0 0 -1px; }
.facts-panel .fact-table > div { min-width: 0; padding: 16px 24px; border-left: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.facts-panel .fact-table > .fact--w2 { grid-column: span 2; }
.facts-panel .fact-table > .fact--w3 { grid-column: 1 / -1; }
.facts-panel .fact-table dt { margin: 0; font-size: 12.5px; line-height: 18px; font-weight: 500; color: var(--muted); }
.facts-panel .fact-table dd { margin: 4px 0 0; font-size: 14.5px; line-height: 1.5; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.fact-table__note { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 400; line-height: 1.45; color: var(--muted); }
.facts-none { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: -1px; padding: 16px 24px 18px; border-top: 1px solid var(--line-soft); }
.facts-none__k { margin: 0 6px 0 0; font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.facts-none ul { display: contents; }
.facts-none li { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border: 1px solid var(--line-soft); border-radius: var(--r-pill);
  background: var(--canvas); font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.facts-none li svg { flex: none; color: var(--faint-deco); }
.facts-panel__bt { margin: 0; padding: 0 24px 16px; font-size: 12px; line-height: 1.45; color: var(--faint); }
.facts-none + .facts-panel__bt { margin-top: -6px; }
.fact-table + .facts-panel__bt { padding-top: 12px; }

.tender-subject { max-width: none; font-size: 14.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.lot-no { width: 48px; color: var(--muted); }
.doc-row h3 { font-size: 14px; overflow-wrap: anywhere; }
@media (max-width: 640px) { .doc-row { grid-template-columns: 24px minmax(0, 1fr) auto; } .doc-row .panel-row__side { grid-column: auto; } }
.result-contracts { list-style: none; margin: 0; padding: 0; }
.result-contract { padding: 14px 20px; border-top: 1px solid var(--line); }
.result-contract:first-child { border-top: 0; }
.result-contract__who { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.result-contract__meta { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.result-contract__meta > span + span::before { content: "·"; margin: 0 8px; color: var(--line-strong); }
.result-contract__meta .t-val { color: var(--ink-2); font-weight: 600; }
.result-contract__value { white-space: nowrap; }
.result-contract__amended { margin: 2px 0 0; font-size: 13px; color: var(--faint); }
@media (max-width: 640px) {
  .result-contract__meta { flex-direction: column; }
  .result-contract__meta > span + span::before { content: none; }
}
.result-staff__label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 14px 20px 6px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.result-staff__note { margin: 0; padding: 10px 20px 14px; border-top: 1px solid var(--line); }
.result-table__who .pill { margin-left: 6px; vertical-align: 1px; }
.need__tip--link { margin: 0; }
.need__tip--link .link { font-weight: 500; }

/* „Срокове и ход на процедурата“ (tenders.timeline) */
.timeline { list-style: none; margin: 0; padding: 4px 20px 8px; }
.timeline__item { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 11px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline__item:last-child { border-bottom: 0; }
.timeline__when { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.timeline__what b { font-weight: 600; color: var(--ink); }
.timeline__what .pill { margin-left: 6px; vertical-align: 1px; }
.timeline__detail { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; overflow-wrap: anywhere; }
.timeline__item.is-upcoming .timeline__when { color: var(--ink-2); }
.timeline__item--terminated .timeline__what b { color: var(--crit); }
.timeline__item--contract .timeline__what b { color: var(--ok); }
@media (max-width: 640px) {
  .timeline { padding-inline: 16px; }
  .timeline__item { grid-template-columns: 1fr; gap: 2px; }
}
.doc-names { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

/* „Още обществени поръчки“ (tenders.related) */
.related__group { padding: 12px 20px 14px; border-top: 1px solid var(--line); }
.related__group:first-of-type { border-top: 0; }
.related__title { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.related__list { list-style: none; margin: 0; padding: 0; }
.related__list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px dashed var(--line); }
.related__list li:last-child { border-bottom: 0; }
.related__link { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.related__link:hover { color: var(--accent); }
.related__meta { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.related__more { margin: 8px 0 0; font-size: 13.5px; }
@media (max-width: 640px) {
  .related__group { padding-inline: 16px; }
  .related__list li { grid-template-columns: 1fr; }
  .related__meta { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .lot-no { width: auto; }
  .lot-no::before { content: "№ "; }
  .result-table__who { font-weight: 500; }
}

/* ------------------------------------------------------------ „Сравнение на обособените позиции“ (tenders/_lot_compare.html; design v3 „Lots“) */
.lot-cmp__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft); }
.lot-cmp__h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lot-cmp__h h2 { margin: 0; font: 700 19px/1.3 var(--font-display); letter-spacing: -.02em; }
.lot-cmp__ask { margin: 0; font-size: 13px; color: var(--muted); }
.lot-cmp__limits { margin: 0; padding: 12px 24px 0; font-size: 14px; color: var(--ink-2); }
.lot-cmp__band { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 12px 24px; background: var(--canvas);
  border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2); }
.lot-cmp__band-k { font-weight: 600; color: var(--muted); white-space: nowrap; }
.lot-cmp__table { font-size: 14px; }
.panel > .table-wrap > .lot-cmp__table th { padding: 11px 16px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.panel > .table-wrap > .lot-cmp__table td { padding: 16px; vertical-align: middle; border-bottom-color: var(--line-soft); }
.panel > .table-wrap > .lot-cmp__table th:first-child, .panel > .table-wrap > .lot-cmp__table td:first-child { padding-left: 24px; }
.panel > .table-wrap > .lot-cmp__table th:last-child, .panel > .table-wrap > .lot-cmp__table td:last-child { padding-right: 24px; }
.lot-cmp__table tbody tr { position: relative; }
.lot-cmp__table th, .lot-cmp__table td:not(.lot-cmp__title) { white-space: nowrap; }
.panel > .table-wrap > .lot-cmp__table th.lot-cmp__price { white-space: normal; min-width: 9em; }
.lot-cmp__title .t-sub > span { white-space: nowrap; }
.lot-cmp__table tbody tr:has(input:checked) { background: var(--accent-soft); }
.lot-cmp__table tbody tr:has(input:checked) > td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.lot-cmp__pick { width: 52px; }
.lot-cmp__pick input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.lot-cmp__pick input:disabled { cursor: not-allowed; }
.lot-cmp .lot-no { width: 44px; font-size: 14px; color: var(--ink-2); }
.lot-cmp .lot-no label { cursor: pointer; }
.lot-cmp__title { min-width: 13.34em; overflow-wrap: anywhere; }
.lot-cmp__name { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.lot-cmp__title .pill { margin-left: 4px; vertical-align: 1px; }
.lot-cmp__title .t-sub { margin-top: 2px; font-size: 12.5px; }
.lot-cmp__title .t-sub .link { color: var(--muted); }
.lot-cmp__title .t-sub .link:hover { color: var(--accent); }
.lot-cmp__table .t-val { font-size: 15px; }
.lot-cmp__table .t-val__c { font-weight: 500; color: var(--faint-deco); }
.lot-cmp tr.is-terminated td { color: var(--faint); }
.lot-cmp tr.is-terminated .t-val { text-decoration: line-through; }
.lot-cmp__price { font-weight: 500; color: var(--ink-2); }
.lot-cmp__price .muted { display: block; font: 400 12px/1.3 var(--font-sans); color: var(--faint); }
.lot-cmp__phone { display: none; }
.lot-cmp__hint { display: grid; gap: 4px; padding: 12px 24px 14px; border-top: 1px solid var(--line-soft); }
.lot-cmp__hint p { margin: 0; }
.lot-cmp__hint > p:first-child:not(.lot-cmp__source) { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); }
.lot-cmp__hint svg { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.lot-cmp__source { margin: 0; }
.lot-cmp__lock { margin: 0; }
/* the dark summary bar (#lot-sum): the ticked lots, their value, the package and the price for them together */
.lot-cmp__sum { display: grid; gap: 10px; padding: 18px 24px; background: var(--ink); color: #FFFFFF; }
.lot-cmp__sum p { margin: 0; }
.lot-bar__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px 32px; }
.lot-bar__stats { display: flex; flex-wrap: wrap; align-items: stretch; margin: 0; }
.lot-bar__stats > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 24px; border-left: 1px solid rgba(255, 255, 255, .12); }
.lot-bar__stats > div:first-child { padding-left: 0; border-left: 0; }
.lot-bar__stats dt { font-size: 12px; font-weight: 500; color: var(--faint-deco); white-space: nowrap; }
.lot-bar__stats dd { margin: 0; font-size: 16px; line-height: 1.35; color: #FFFFFF; white-space: nowrap; }
.lot-bar__stats dd b { font-weight: 600; }
.lot-bar__c, .lot-bar__amt__c { color: var(--faint-deco); font-weight: 500; }
.lot-bar__amt { font-family: var(--font-num); font-weight: 600; }
.lot-bar__change { margin-left: 8px; color: #FFFFFF; font-size: 13px; font-weight: 500; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .35); text-underline-offset: 3px; }
.lot-bar__change:hover { color: #FFFFFF; text-decoration-color: #FFFFFF; }
.lot-bar__buy { display: flex; align-items: center; gap: 20px; }
.lot-bar__price { text-align: right; }
.lot-bar__price .num { display: block; font: 600 30px/1.05 var(--font-num); color: #FFFFFF; white-space: nowrap; }
.lot-bar__price small { display: block; margin-top: 5px; font-size: 12px; color: var(--faint-deco); white-space: nowrap; }
/* a white button on navy: the page's one blue button is the side card's (one primary per view) */
.lot-bar__btn { min-height: 46px; padding: 0 20px; border-color: #FFFFFF; background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.lot-bar__btn:hover { border-color: var(--accent-soft); background: var(--accent-soft); color: var(--ink); }
.lot-bar__note { font-size: 12.5px; color: var(--line-strong); }
.lot-bar__note .num { color: #FFFFFF; }
.lot-bar__hint { font-size: 14px; color: var(--line-strong); }
.lot-cmp__sum .lot-cmp__warn { font-size: 14px; }
@media (max-width: 900px) {
  .lot-bar__row { grid-template-columns: minmax(0, 1fr); }
  .lot-bar__buy { justify-content: space-between; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .12); }
  .lot-bar__price { text-align: left; }
}

/* ------------------------------------------------------------ tablets and phones */
@media (max-width: 1080px) {
  .tender-head__grid { column-gap: 32px; }
  .fact-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-strip > div { border-left: 0; border-top: 1px solid var(--line-soft); }
  .fact-strip > div:nth-child(-n+2) { border-top: 0; }
  .fact-strip > div:nth-child(2n) { border-left: 1px solid var(--line-soft); }
}
@media (max-width: 900px) {
  .tender-head__grid { grid-template-columns: minmax(0, 1fr); }
  .tender-head__actions { margin-top: 18px; }
  .facts-panel .fact-table { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts-panel .fact-table > .fact--w2 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  /* the lots: one card per lot – the checkbox and the title, then label / value rows */
  .panel > .table-wrap > .lot-cmp__table td { padding: 0; }
  .panel > .table-wrap > .lot-cmp__table td:first-child { padding-left: 0; }
  .panel > .table-wrap > .lot-cmp__table td:last-child { padding-right: 0; }
  .lot-cmp__table tr { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; padding: 16px; }
  .panel > .table-wrap > .lot-cmp__table tr { padding: 16px; }
  .lot-cmp__table tbody tr:has(input:checked) > td:first-child { box-shadow: none; }
  .lot-cmp__table tbody tr:has(input:checked) { box-shadow: inset 3px 0 0 var(--accent); }
  .lot-cmp__table td { grid-column: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
  .lot-cmp__table td.lot-cmp__pick { grid-column: 1; grid-row: 1; width: auto; }
  .lot-cmp__table td.lot-no { display: none; }
  .lot-cmp__table td.lot-cmp__title { display: block; grid-row: 1; }
  .lot-cmp__table tr:not(:has(.lot-cmp__pick)) td.lot-cmp__title { grid-column: 1 / -1; }
  .lot-cmp__table tr:not(:has(.lot-cmp__pick)) td { grid-column: 1 / -1; }
  .lot-cmp__table td.lot-cmp__title + td { padding-top: 10px; border-top: 1px dashed var(--line); }
  .lot-cmp__table td[data-label]::before { content: attr(data-label); font: 500 12.5px/1.4 var(--font-sans); color: var(--muted); }
  .lot-cmp__table td.num, .lot-cmp__table td.t-val { text-align: right; }
  .lot-cmp__title { min-width: 0; }
  .lot-cmp__phone { display: flex; }
}
@media (max-width: 640px) {
  .tender-head { padding-top: 14px; }
  .tender-crumbs { font-size: 12.5px; }
  .tender-crumbs__sync { white-space: normal; }
  .tender-head__grid { margin-top: 16px; }
  .tender-title, .tender-title--long { margin-top: 12px; font-size: 23px; line-height: 1.24; }
  .tender-buyer { gap: 6px 16px; margin-top: 12px; font-size: 13.5px; }
  .tender-buyer > span + span::before { content: none; }
  .tender-head__actions .btn--primary { flex: 1 1 auto; }
  .fact-strip { margin-top: 20px; }
  .fact-strip > div { padding: 14px 16px; }
  .fact-strip__value, .fact-strip__deadline { grid-column: 1 / -1; border-left: 0 !important; }
  .fact-strip > div:nth-child(2) { border-top: 1px solid var(--line-soft); }
  .fact-strip > div:nth-child(3) { border-left: 0; }
  .fact-strip > div:nth-child(4) { border-left: 1px solid var(--line-soft); }
  .fact-strip dd.fact-strip__big { font-size: 22px; }
  .fact-strip dd.fact-strip__text { font-size: 15px; line-height: 1.4; }
  .tender-body { padding-block: 24px 48px; row-gap: 20px; }
  .tender-tabs { margin-right: calc(-1 * var(--gutter)); padding-right: 48px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 64px), transparent); }
  .tender-tabs a, .tender-tabs__off { padding: 0 10px; }
  .need__head { padding: 18px 16px 14px; }
  .need__legend { gap: 6px 14px; white-space: normal; }
  .need__match, .need__hint { padding: 11px 16px; }
  .need__grp { padding: 14px 16px 6px; }
  .need__row { grid-template-columns: 20px minmax(0, 1fr); column-gap: 12px; padding: 14px 16px; }
  .need__side { grid-column: 2; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: center; margin-top: 8px; }
  .need__side:empty { display: none; }
  .need__tip { margin-inline: 16px; }
  .need__foot { padding: 14px 16px; }
  .need__foot .btn { width: 100%; }
  .tender-flow { padding: 18px 16px; }
  .tender-flow__steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tender-flow__steps::before { left: 13px; right: auto; top: 14px; bottom: 14px; width: 1px; height: auto; }
  .tender-flow__steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; row-gap: 1px; }
  .tender-flow__steps li > .num { grid-row: 1 / span 2; margin: 0; }
  .buy { padding: 20px 16px; }
  .bq-total__v .num { font-size: 30px; }
  .tender-rest { gap: 20px; padding-bottom: 48px; }
  .facts-panel__head { padding: 16px; }
  .facts-panel .fact-table { grid-template-columns: minmax(0, 1fr); }
  .facts-panel .fact-table > div { padding: 12px 16px; }
  .facts-panel .fact-table > .fact--w2, .facts-panel .fact-table > .fact--w3 { grid-column: auto; }
  .facts-none { padding: 14px 16px 16px; }
  .facts-none__k { width: 100%; }
  .facts-panel__bt { padding-inline: 16px; }
  .lot-cmp__head { padding: 16px; }
  .lot-cmp__band { flex-direction: column; gap: 2px; padding: 12px 16px; }
  .lot-cmp__hint { padding: 12px 16px; }
  .lot-cmp__sum { position: sticky; bottom: 0; z-index: 2; padding: 18px 16px; box-shadow: 0 -6px 18px -12px rgba(11, 19, 36, .3); }
  .lot-bar__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
  .lot-bar__stats > div { padding: 0 0 0 14px; }
  .lot-bar__stats > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .lot-bar__stats > div:nth-child(3) { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .12); }
  .lot-bar__buy { flex-direction: column; align-items: stretch; gap: 14px; }
  .lot-bar__price { display: flex; justify-content: space-between; align-items: baseline; }
  .lot-bar__price small { margin-top: 0; }
  .lot-bar__btn { width: 100%; }
}

/* small phones (≤400px): „Запази“ and „Започни подготовката“ share the row only while they fit */
@media (max-width: 400px) {
  .tender-head__actions { flex-wrap: wrap; }
  .tender-head__actions .btn { padding-inline: 14px; }
}

/* ------------------------------------------------------------ the CPV catalogue (/cpv/) and its picker */
.cpv-results:empty { display: none; }
.cpv-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cpv-option { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); font: 400 14px/1.4 var(--font-sans); text-align: left; text-decoration: none; cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.cpv-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.cpv-option .num { font-weight: 600; color: var(--ink-2); }
.cpv-option .chip__count { margin-left: auto; }
.cpv-option.is-added { border-color: var(--ok); background: var(--ok-soft); }
.cpv-options__note { margin: 8px 0 0; }
.cpv-meta .num { font-weight: 600; }
.cpv-tsprs { margin: 10px 0 0; }
.cpv-chain { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.cpv-chain li { padding-left: 14px; border-left: 2px solid var(--line); }
.cpv-chain li[aria-current] { border-left-color: var(--accent); color: var(--ink); font-weight: 500; }
.cpv-source { margin-top: 24px; }

/* ==========================================================================
   Listing pages: catalogue, archive, buyer / region / municipality / sector / participant pages
   ========================================================================== */
.listing-head { padding-block: 28px 4px; }
.listing-head .live-count { margin-top: 14px; }
.listing-head .lede { margin-top: 10px; }
.listing-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.listing-meta > * + *::before { content: "·"; margin: 0 8px; color: var(--line-strong); }
.listing-meta a { color: var(--accent); text-decoration: none; }
.listing-meta a:hover { color: var(--accent-ink); }
.listing-kpis { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 0; }
.listing-kpis .kpi { min-width: 150px; padding: 12px 16px; }
.listing-kpis .kpi dd { margin-top: 4px; font-size: 22px; }
.listing-filter { margin: 4px 0 0; }
.listing-filter .pill-search { max-width: 620px; }
.listing-body { padding-block: 20px var(--s-9); }
.listing-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }
.listing-section { padding-top: 28px; }
.listing-section:first-child { padding-top: 8px; }
.listing-section > .split-head { margin-bottom: 12px; align-items: baseline; }
.listing-section h2 { font: 700 20px/1.3 var(--font-display); letter-spacing: -.015em; margin: 0; }
.listing-note { margin: 0; }
.listing-empty { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 32px 16px; }
.link-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.link-chips .chip { white-space: normal; min-height: 34px; padding-block: 6px; line-height: 1.35; }
.market__panel, .overview__panel { display: grid; gap: 16px; }
.overview-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.overview-kpis .kpi dd { font-size: 22px; overflow-wrap: anywhere; }
.overview__label { margin: 0 0 -6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.overview__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-2); }
.listing-note { margin: 0 0 8px; }
.market-kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.market-kpis .kpi dd { font-size: 22px; overflow-wrap: anywhere; }
.market__label { padding: 4px 0 0; }
/* „По години“ (tenders.history.for_entity): stacked rows under 720px (.table--stack), the total row bold */
.market-years { display: grid; gap: 8px; min-width: 0; }
.history-table__year { font-weight: 500; color: var(--ink); white-space: nowrap; }
.history-table .history-table__sum td { font-weight: 600; }

/* tender table: <div class="listing-table"><table class="table table--hover">…</table></div> */
.listing-table { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.listing-table .table th { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.listing-table .table td { padding: 14px 18px; vertical-align: middle; }
.listing-table .table th.num { text-align: right; }
.listing-table .t-title { max-width: 41.354em; } /* 62ch */
.listing-table .t-sub a { text-decoration: none; }
.listing-table .t-sub a:hover { color: var(--accent); }
.listing-table .t-val { text-align: right; }
.listing-table .c-cat .pill { white-space: nowrap; }
.listing-table .c-dl, .listing-table .c-date { white-space: nowrap; }
.listing-table .c-ratio { text-align: right; color: var(--muted); white-space: nowrap; }
.listing-table .amount--none { font-size: 13px; }
.listing-table__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--canvas); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.entity-groups { display: grid; gap: 20px; }
.entity-table__title { margin: 0; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); background: var(--canvas); }
.entity-table .table td { padding-block: 12px; }
.entity-table td.c-count { width: 1%; white-space: nowrap; text-align: right; color: var(--muted); font-size: 13px; }
.entity-table td.c-count .num { font-weight: 600; color: var(--ink); font-size: 14.5px; }
@media (max-width: 860px) {
  .listing-table .table thead { display: none; }
  .listing-table .table, .listing-table .table tbody, .listing-table .table tr, .listing-table .table td { display: block; width: 100%; }
  .listing-table .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .listing-table .table tbody tr:last-child { border-bottom: 0; }
  .listing-table .table td { padding: 0; border: 0; }
  .listing-table .table td.c-title { grid-column: 1 / -1; }
  .listing-table .table td.c-cat { display: none; }
  .listing-table .table td.c-val, .listing-table .table td.c-date { text-align: left; }
  .listing-table .table td.c-dl { text-align: right; }
  .listing-table .table td.c-ratio { grid-column: 1 / -1; text-align: left; font-size: 13px; }
  .listing-table .table td.c-ratio::before { content: "спрямо прогнозната: "; color: var(--faint); font-family: var(--font-sans); }
  .entity-table .table tr { grid-template-columns: minmax(0, 1fr) auto; padding-block: 12px; }
  .entity-table .table td.c-title { grid-column: auto; }
  .entity-table td.c-count { width: auto; }
}
@media (max-width: 640px) {
  .listing-kpis .kpi { flex: 1 1 130px; min-width: 0; }
  .entity-table__title { padding-inline: 16px; }
}

/* ------------------------------------------------------------ long text: about 8 lines, then „Покажи целия текст“ */
.clamp__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; line-clamp: 8; overflow: hidden; }
.clamp__toggle:checked ~ .clamp__text { display: block; -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.clamp__more { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; }
.clamp__more:hover { color: var(--accent-ink); text-decoration: underline; }
.clamp__toggle:focus-visible ~ .clamp__more { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.clamp__toggle:checked ~ .clamp__more { display: none; }

/* ------------------------------------------------------------ „Запази“ and „Следите тази поръчка“ (watch app) */
.watch-btn { display: contents; }
#watch-box:empty { display: none; }
.watch-btn form { margin: 0; display: flex; }
.watch-btn__on { border-color: var(--ok); color: var(--ok); }
.watch-btn__on:hover { border-color: var(--ok); color: var(--ok); }
.watch-btn__error { flex-basis: 100%; margin: 0; font-size: 13px; color: var(--crit); }
.watch-timeline { list-style: none; margin: 0; padding: 4px 20px 12px; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.watch-timeline li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
.watch-timeline__when { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.watch-box__empty { margin: 0; padding: 4px 20px 14px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 640px) { .watch-btn form { flex: 1 1 auto; } .watch-btn form .btn { flex: 1 1 auto; } }

/* /porachki/: the row of sector links under the list */
.sector-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 20px 0 0; font-size: 14px; }
.sector-row__label { color: var(--muted); }
.sector-row a { color: var(--ink-2); text-decoration: none; }
.sector-row a:hover { color: var(--accent); }
.sector-row .num { color: var(--faint); font-size: 12.5px; }

/* ------------------------------------------------------------ a closed tender (owner, 21.10): its own content */
/* „Накратко за поръчката“ (tenders/_brief.html) */
.tender-brief__text { max-width: 48.025em; /* 72ch */ margin: 0; font: 400 16px/1.65 var(--font-sans); color: var(--ink-2); overflow-wrap: anywhere; }
.tender-brief__text .num { font-weight: 500; color: var(--ink); }
/* „Сравнение с други поръчки“ (tenders/_compare.html): a two-column list that stacks on a phone; verdicts muted */
.tender-compare__lede { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.tender-compare__sub { margin: 20px 0 10px; font: 600 15px/1.4 var(--font-sans); color: var(--ink); }
.compare { display: grid; margin: 0; border-top: 1px solid var(--line-soft); }
.compare__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 20px; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.compare dt { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.compare dd { margin: 0; font-size: 14px; color: var(--ink-2); }
.compare dd > .num { font-size: 16px; font-weight: 600; color: var(--ink); }
.compare__row--own dt { font-weight: 600; color: var(--ink); }
.compare__verdict { font-style: normal; color: var(--muted); }
.compare dd small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--faint); }
.tender-compare__foot { font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) {
  .compare__row { grid-template-columns: 1fr; }
}
/* the archive rows: the contract value with its % (tenders.history.attach_contracts) or the estimate */
.c-val__sub { display: block; margin-top: 2px; font: 400 12.5px/1.35 var(--font-sans); color: var(--muted); white-space: nowrap; }
.c-val__sub .num { font-weight: 500; }
