/* Fursa UI v2 — competitors pages (slice 3.4): the /competitors list, one
   company profile (/competitors/company) and the comparison page
   (/competitors/compare). One 880px column per page.

   The list and the company history reuse §21's .fx-tcards (real table under
   .tablewrap.fx-tcards, tr.fx-sortbar strip, tr.fx-card-row cards): this file
   only gives each page its grid template and per-cell placement, never the
   card face. The list's #competitor-results is outerHTML-swapped on every
   keystroke — a swap that is not a .doc swap, so html.fx-quiet is never set —
   and the card entrance would re-stagger on each character: it is switched
   off here for this list only (the shared component is untouched).

   Ordinary tables (extremes, breakdowns, compare, shared) sit in
   .tablewrap.fx-table. The compare pickers keep v1's [data-combo] contract —
   compare-combo.js owns .is-open / aria-expanded / .combo-option.is-active —
   while this file re-skins the popover and options with v2 tokens. */

/* ==========================================================================
   1. /competitors — list
========================================================================== */

html[data-ui="v2"] .fx-page--competitors{
  display:grid; gap:var(--fx-space-6); align-content:start;
  max-inline-size:880px; margin-inline:auto; inline-size:100%;
}

html[data-ui="v2"] .fx-page--competitors .fx-competitors__head{
  display:flex; flex-wrap:wrap; align-items:center;
  gap:var(--fx-space-3) var(--fx-space-4);
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__lead{
  flex:1 1 auto; min-inline-size:0; display:grid; gap:4px;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__lead .fx-title{margin:0}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__lead .fx-lede{margin:0}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__compare{flex:none; align-self:center}

html[data-ui="v2"] .fx-page--competitors .fx-competitors__form{
  display:grid; gap:var(--fx-space-3); margin:0;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__form .fx-scope-pills{
  justify-self:start;
}

/* Everything the live search swaps lives inside #competitor-results. */
html[data-ui="v2"] .fx-page--competitors .fx-competitors__results{
  display:grid; gap:var(--fx-space-3); align-content:start; min-inline-size:0;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__res-head{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__res-lead{
  flex:1 1 auto; min-inline-size:0;
  display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__res-lead h2{margin:0}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__count{
  margin:0; font-size:var(--fx-text-sm); color:var(--fx-text-muted); white-space:nowrap;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__export{margin:0; flex:none; align-self:center}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__coverage{margin:0; max-inline-size:none}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__notes{margin:0}

/* The live-swap trap: #competitor-results is outerHTML-swapped per keystroke
   and per scope change without html.fx-quiet, so the shared entrance is off
   for this list (page-scoped; the component itself keeps it). */
html[data-ui="v2"] .fx-page--competitors #competitor-results tr.fx-card-row{animation:none}

/* Card grid: line 1 the company name; line 2 the meta phrase
   «N المنافسات · M مرات الفوز · X٪» flowing from the start edge; the 11rem
   end column holds total won (tabular) with the «قارن» link under it. The
   rank cell stays in the DOM for the sorter but is clipped out like th.n. */
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody tr.fx-card-row{
  grid-template-columns:max-content max-content max-content minmax(0,1fr) 11rem;
  grid-template-areas:
    "title title title title end"
    "bids  wins  rate  .     end";
  column-gap:var(--fx-space-4);
}
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.n{
  position:absolute; inset-inline-start:auto; top:auto; z-index:auto;
  inline-size:1px; block-size:1px; margin:-1px; padding:0;
  overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
}
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title{grid-area:title; min-inline-size:0}
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-bids{grid-area:bids}
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-wins{grid-area:wins}
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-rate{grid-area:rate}
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-won{grid-area:end}
/* The end column stacks: amount on top, the quiet «قارن» link under it. */
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.fx-tcards__end{
  flex-direction:column; align-items:flex-end; justify-content:center; gap:1px;
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__won{
  color:var(--fx-text); font-size:var(--fx-text-sm); font-weight:var(--fx-weight-semibold);
}
html[data-ui="v2"] .fx-page--competitors .fx-competitors__row-link{font-size:var(--fx-text-2xs)}

/* «·» separators ride on the preceding meta cell so a wrapped line never
   opens with one. */
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-bids::after,
html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-wins::after{
  content:"·" / ""; margin-inline-start:6px; color:var(--fx-text-subtle);
}

/* app.css sticks the rank column and the company-name column of any
   .competitor-results table under 1280px (v1's real-table layout). Inside
   this card list both cells are grid items — neutralise the sticky columns
   (the shared component's generic opt-out cannot out-specify the
   .competitor-results-specific rules). */
@media (max-width:1279px){
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards table.competitor-results.fx-tcards__table :is(th,td):first-child,
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards table.competitor-results.fx-tcards__table :is(th,td):nth-child(2){
    position:static; inset-inline-start:auto; z-index:auto;
    inline-size:auto; min-inline-size:0;
    background:transparent; box-shadow:none;
  }
}

/* ≤768px — name, then the meta phrase with the end cell at the line's end;
   a pushed end cell wraps to its own line, start-aligned. */
@media (max-width:768px){
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody tr.fx-card-row{
    display:flex; flex-wrap:wrap; align-items:baseline;
    column-gap:8px; row-gap:2px;
  }
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title{order:1; flex-basis:100%}
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-bids{order:2}
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-wins{order:3}
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-rate{order:4; margin-inline-end:auto}
  html[data-ui="v2"] .fx-page--competitors .tablewrap.fx-tcards .fx-tcards__table tbody td.col-won{
    order:5; align-self:auto;
  }
}

/* ==========================================================================
   2. /competitors/company — one company's profile
========================================================================== */

html[data-ui="v2"] .fx-page--competitor{
  display:grid; gap:var(--fx-space-6); align-content:start;
  max-inline-size:880px; margin-inline:auto; inline-size:100%;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__head{display:grid; gap:4px}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__head .fx-title{margin:0}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__spellings{
  margin:0; font-size:var(--fx-text-sm); color:var(--fx-text-muted);
}

/* The head's top row: the back crumb at the reading start, the small
   «قارن مع منافس آخر» pill at the reading end, vertically centred. Both
   share one line while they fit; the pill wraps under the breadcrumb
   otherwise. The trailing margin keeps the same air under the row the
   page-level crumb gap used to give the title. */
html[data-ui="v2"] .fx-page--competitor .fx-competitor__head-row{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:var(--fx-space-2) var(--fx-space-4);
  margin-block-end:var(--fx-space-3);
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__head-row .fx-crumbs{margin-block-end:0}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__head-row .fx-competitor__actions{margin:0; flex:none}

/* Four headline tiles. Long totals shrink with the viewport and may wrap,
   never clip — same treatment as the agency award stats. */
html[data-ui="v2"] .fx-page--competitor .fx-competitor__stats{
  display:grid; gap:var(--fx-space-3);
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
@media (max-width:860px){
  html[data-ui="v2"] .fx-page--competitor .fx-competitor__stats{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}
@media (max-width:480px){
  html[data-ui="v2"] .fx-page--competitor .fx-competitor__stats{
    grid-template-columns:minmax(0, 1fr);
  }
}
html[data-ui="v2"] .fx-page--competitor .fx-stat__value{
  min-inline-size:0; overflow-wrap:anywhere;
  font-size:clamp(var(--fx-text-xl), 3.4vw, var(--fx-text-3xl));
}
html[data-ui="v2"] .fx-page--competitor .fx-stat__sub{overflow-wrap:anywhere}

/* Price extremes: the metric name is a row header — keep the sunken label
   look but restore body-text weight/size so it reads as data, not a 2xs
   column header. The tender reference stays an end-aligned link column. */
html[data-ui="v2"] .fx-page--competitor .competitor-extremes tbody th[scope="row"]{
  color:var(--fx-text); font-size:var(--fx-text-sm); font-weight:var(--fx-weight-semibold);
}
html[data-ui="v2"] .fx-page--competitor .competitor-extremes td a{
  color:var(--fx-link); text-decoration:none; font-weight:var(--fx-weight-medium);
}
html[data-ui="v2"] .fx-page--competitor .competitor-extremes td a:hover{color:var(--fx-link-hover); text-decoration:underline; text-underline-offset:3px}

/* Under 1280px app.css treats label-less .tablewrap tables as wide reference
   data — 8rem cell floors, a 12rem sticky first column, 16rem link cells —
   which pushes these short tables (3–4 columns, and the breakdowns) into
   sideways scroll. Same opt-out the agency page applies on
   .fx-award-years: cells shrink and wrap instead, the first column unsticks
   (the shared §20.6 opt-out cannot out-specify the :not(:has()) rules). */
@media (max-width:1279px){
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-table table{
    inline-size:100%; min-inline-size:0;
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-table table :is(th,td){
    min-inline-size:0; min-width:0; padding-inline:10px; white-space:normal;
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-table table :is(th,td):first-child{
    position:static; inset-inline-start:auto; z-index:auto;
    box-shadow:none; background:transparent;
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-table table thead th:first-child{
    background:var(--surface-2);
  }
}

/* The two breakdown tables stack — one per row, full width — at every
   viewport (side by side they squeezed agency names to one word per line
   and pushed the by-year table into sideways scroll). */
html[data-ui="v2"] .fx-page--competitor .fx-competitor__breakdowns{
  display:grid; gap:var(--fx-space-5); align-content:start;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__break{display:grid; gap:var(--fx-space-3); align-content:start; min-inline-size:0}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__break h2{margin:0}
/* Column budget on both breakdown tables: the label column takes the
   remaining width and wraps normally; the three numeric columns shrink to
   their tabular, end-aligned content — no inner horizontal scroll ≥768px. */
html[data-ui="v2"] .fx-page--competitor .fx-competitor__break .tablewrap.fx-table table{
  inline-size:100%;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__break .tablewrap.fx-table table :is(th,td):first-child{
  inline-size:auto;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__break .tablewrap.fx-table table :is(th,td):not(:first-child){
  inline-size:1%; white-space:nowrap;
}

/* History section head: title + count at the start, export at the end. */
html[data-ui="v2"] .fx-page--competitor .fx-competitor__history{
  display:grid; gap:var(--fx-space-3); align-content:start; min-inline-size:0;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__sec-head{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__sec-lead{
  flex:1 1 auto; min-inline-size:0;
  display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__sec-lead h2{margin:0}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__count{
  margin:0; font-size:var(--fx-text-sm); color:var(--fx-text-muted); white-space:nowrap;
}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__export{margin:0; flex:none; align-self:center}
html[data-ui="v2"] .fx-page--competitor .fx-competitor__notes{margin:0}

/* History card: line 1 the tender link (its reference muted under it),
   line 2 the meta «date · agency · ترتيب X من N» vertically centred against
   the end stack — offer (tabular), won/lost chip, award value. Won rows get
   the success colour on the shared 3px start-edge bar. */
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody tr.fx-card-row{
  grid-template-columns:max-content minmax(0,1.4fr) max-content minmax(0,1fr) 11rem;
  grid-template-areas:
    "title title title title offer"
    "date  agency rank  .     res"
    "date  agency rank  .     awd";
  column-gap:var(--fx-space-4);
}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody tr.fx-card-row.is-winner::before{
  background:var(--fx-success);
}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title{grid-area:title; min-inline-size:0}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-date{grid-area:date; align-self:center}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-agency{grid-area:agency; align-self:center; min-inline-size:0}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-rank{grid-area:rank; align-self:center}
/* Three stacked cells share the 11rem end column; each keeps the shared
   .fx-tcards__end hairline (the stacked borders join into one edge) and
   pushes its content to the line's end. */
html[data-ui="v2"] .fx-page--competitor .fx-tcards__table tbody td:is(.col-offer,.col-result,.col-award){
  justify-content:flex-end;
}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-offer{
  grid-area:offer; color:var(--fx-text); font-weight:var(--fx-weight-semibold); font-size:var(--fx-text-sm);
}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-result{grid-area:res}
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-award{grid-area:awd; color:var(--fx-text-subtle)}
/* The meta line shows the date only; the stored time stays in the DOM for
   the sorter. */
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-date .dt-time{display:none}
/* The muted reference inside the title cell. */
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title .row-meta{
  margin-block-start:2px; font-size:var(--fx-text-2xs); color:var(--fx-text-subtle);
}
/* Meta separators ride on the preceding cell — trailing, never leading,
   so a wrapped line never opens with «·». */
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-date::after,
html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-agency::after{
  content:"·" / ""; margin-inline:6px; color:var(--fx-text-subtle);
}

/* ≤768px — the title cell dissolves (display:contents) so its two boxes
   join the card flow directly: the tender link alone on line 1, then the
   meta phrase «reference · date · agency · rank»; the offer/chip/award
   group is pushed to the line's end by the last meta cell's auto end
   margin (or wraps under, start-aligned). Every «·» trails its item — the
   reference's ::after included, and none on the last meta cell — so no
   wrapped line ever opens with one. */
@media (max-width:768px){
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody tr.fx-card-row{
    display:flex; flex-wrap:wrap; align-items:baseline;
    column-gap:8px; row-gap:2px;
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title{display:contents}
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title > a{
    order:1; flex-basis:100%; min-inline-size:0;
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title .row-meta{
    order:2; margin-block-start:0;
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-title .row-meta::after{
    content:"·" / ""; margin-inline:6px; color:var(--fx-text-subtle);
  }
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-date{order:3}
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-agency{order:4}
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-rank{order:5; margin-inline-end:auto}
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-offer{order:6}
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-result{order:7}
  html[data-ui="v2"] .fx-page--competitor .tablewrap.fx-tcards .fx-tcards__table tbody td.col-award{order:8}
}

/* ==========================================================================
   3. /competitors/compare — two companies side by side
========================================================================== */

html[data-ui="v2"] .fx-page--compare{
  display:grid; gap:var(--fx-space-6); align-content:start;
  max-inline-size:880px; margin-inline:auto; inline-size:100%;
}
html[data-ui="v2"] .fx-page--compare .fx-crumbs{margin-block-end:calc(-1 * var(--fx-space-2))}
html[data-ui="v2"] .fx-page--compare .fx-compare__head{display:grid; gap:4px}
html[data-ui="v2"] .fx-page--compare .fx-compare__head .fx-title{margin:0}
html[data-ui="v2"] .fx-page--compare .fx-compare__head .fx-lede{margin:0}

/* #compare-page is the scope form's outerHTML swap target — everything below
   the head lives inside it; the entrance would replay on every scope change
   so it stays off. */
html[data-ui="v2"] .fx-page--compare .fx-compare__body{
  display:grid; gap:var(--fx-space-4); align-content:start; min-inline-size:0;
}
html[data-ui="v2"] .fx-page--compare .fx-compare__scope{margin:0}
html[data-ui="v2"] .fx-page--compare .fx-compare__scope .fx-scope-pills{justify-self:start}

/* Pickers — one card, two bordered fields side by side (stacked <768px). */
html[data-ui="v2"] .fx-page--compare .fx-compare__pickers{
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:var(--fx-space-4); align-items:start;
}
@media (max-width:768px){
  html[data-ui="v2"] .fx-page--compare .fx-compare__pickers{grid-template-columns:minmax(0,1fr)}
}
/* v1 draws each picker as its own bordered box — inside the v2 card it is a
   flat field column instead (no card in a card). */
html[data-ui="v2"] .fx-page--compare .compare-picker{
  display:flex; flex-direction:column; gap:var(--fx-space-2);
  min-inline-size:0; padding:0; border:0; background:transparent;
}
html[data-ui="v2"] .fx-page--compare .fx-compare__label{margin:0}
html[data-ui="v2"] .fx-page--compare .compare-name{
  align-self:flex-start;
  font-size:var(--fx-text-sm); font-weight:var(--fx-weight-medium);
  color:var(--fx-link); text-decoration:none;
}
html[data-ui="v2"] .fx-page--compare .compare-name:hover{
  color:var(--fx-link-hover); text-decoration:underline; text-underline-offset:3px;
}

/* The combobox dropdown: v1's position/open mechanics stay; the popover,
   head, options and empty state take v2 tokens. */
html[data-ui="v2"] .fx-page--compare .combo-icon{color:var(--fx-text-subtle)}
html[data-ui="v2"] .fx-page--compare .combo-list{
  padding:6px;
  background:var(--fx-surface-raised); border:1px solid var(--fx-border);
  border-radius:var(--fx-radius-md); box-shadow:var(--fx-shadow-lg);
}
html[data-ui="v2"] .fx-page--compare .combo-head{
  top:-6px; margin:-6px -6px 4px; padding:8px 10px 6px;
  background:inherit; border-radius:var(--fx-radius-md) var(--fx-radius-md) 0 0;
  font-size:var(--fx-text-2xs); font-weight:var(--fx-weight-semibold); color:var(--fx-text-muted);
}
html[data-ui="v2"] .fx-page--compare .combo-option{
  padding:8px 10px; border-radius:var(--fx-radius-sm);
  color:var(--fx-text); text-decoration:none;
}
html[data-ui="v2"] .fx-page--compare .combo-option:hover,
html[data-ui="v2"] .fx-page--compare .combo-option.is-active{
  background:var(--fx-surface-hover); color:var(--fx-text);
}
/* v1 marks the chosen option with an inset edge; here the name just takes
   the primary colour. */
html[data-ui="v2"] .fx-page--compare .combo-option[aria-selected="true"]{box-shadow:none}
html[data-ui="v2"] .fx-page--compare .combo-option[aria-selected="true"] .combo-name{color:var(--fx-primary)}
html[data-ui="v2"] .fx-page--compare .combo-name{font-size:var(--fx-text-sm); font-weight:var(--fx-weight-semibold)}
html[data-ui="v2"] .fx-page--compare .combo-meta{font-size:var(--fx-text-2xs); color:var(--fx-text-subtle)}
html[data-ui="v2"] .fx-page--compare .combo-empty{margin:8px 10px; font-size:var(--fx-text-sm); color:var(--fx-text-muted)}

/* Note + export sit on one quiet line above the metrics table. */
html[data-ui="v2"] .fx-page--compare .fx-compare__meta{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px;
}
html[data-ui="v2"] .fx-page--compare .fx-compare__meta .fx-compare__note{flex:1 1 auto; margin:0; max-inline-size:none}
html[data-ui="v2"] .fx-page--compare .fx-compare__export{margin:0; flex:none}
html[data-ui="v2"] .fx-page--compare .fx-compare__note{margin:0; max-inline-size:none}

/* Metric table: the row header keeps the label look but reads as data;
   better/worse marks use token colours (dark-mode aware); the direction
   line under each metric name is a small muted line. */
html[data-ui="v2"] .fx-page--compare .compare-table tbody th[scope="row"]{
  color:var(--fx-text); font-size:var(--fx-text-sm); font-weight:var(--fx-weight-semibold);
}
html[data-ui="v2"] .fx-page--compare .compare-dir{
  font-size:var(--fx-text-2xs); font-weight:var(--fx-weight-regular); color:var(--fx-text-subtle);
}
html[data-ui="v2"] .fx-page--compare .compare-table td.is-better,
html[data-ui="v2"] .fx-page--compare .compare-shared td.is-better{
  background:var(--fx-success-bg); color:var(--fx-success); font-weight:var(--fx-weight-semibold);
}
html[data-ui="v2"] .fx-page--compare .compare-table td.is-worse,
html[data-ui="v2"] .fx-page--compare .compare-shared td.is-worse{
  background:var(--fx-danger-bg); color:var(--fx-danger); font-weight:var(--fx-weight-semibold);
}
html[data-ui="v2"] .fx-page--compare .compare-legend{margin:0; display:flex; flex-wrap:wrap; align-items:center; gap:4px 6px}
html[data-ui="v2"] .fx-page--compare .compare-legend .swatch{
  inline-size:12px; block-size:12px; border-radius:3px; margin-inline:2px;
}
html[data-ui="v2"] .fx-page--compare .compare-legend .swatch.is-better{
  background:var(--fx-success-bg); box-shadow:inset 0 0 0 1px var(--fx-success-border);
}
html[data-ui="v2"] .fx-page--compare .compare-legend .swatch.is-worse{
  background:var(--fx-danger-bg); box-shadow:inset 0 0 0 1px var(--fx-danger-border);
}

/* Section heads inside the swap body. */
html[data-ui="v2"] .fx-page--compare .fx-compare__sec-head{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px;
  margin-block-start:var(--fx-space-2);
}
html[data-ui="v2"] .fx-page--compare .fx-compare__sec-lead{
  flex:1 1 auto; min-inline-size:0;
  display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px;
}
html[data-ui="v2"] .fx-page--compare .fx-compare__sec-lead h2{margin:0}
html[data-ui="v2"] .fx-page--compare .fx-compare__count{
  margin:0; font-size:var(--fx-text-sm); color:var(--fx-text-muted); white-space:nowrap;
}

/* The shared-tenders table stays a real table; a content min-width keeps the
   five columns readable on phones — the .fx-table wrap scrolls inline. */
html[data-ui="v2"] .fx-page--compare .fx-compare__shared-wrap .compare-shared{min-width:560px}
/* Rank meta under each offer reads as a small muted line. */
html[data-ui="v2"] .fx-page--compare .compare-shared td .row-meta{
  margin-block-start:2px; font-size:var(--fx-text-2xs); color:var(--fx-text-subtle);
}
html[data-ui="v2"] .fx-page--compare .compare-shared td.titlecell .row-meta{white-space:normal}

/* The two company tender lists: a 2-column grid of hairline lists (one
   column <768px); won items get a success edge. */
html[data-ui="v2"] .fx-page--compare .fx-compare__columns{
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--fx-space-5);
}
@media (max-width:768px){
  html[data-ui="v2"] .fx-page--compare .fx-compare__columns{grid-template-columns:minmax(0,1fr)}
}
html[data-ui="v2"] .fx-page--compare .compare-column{
  display:grid; gap:var(--fx-space-2); align-content:start; min-inline-size:0;
}
html[data-ui="v2"] .fx-page--compare .compare-column h3.fx-compare__company{
  margin:0; font-size:var(--fx-text-base); font-weight:var(--fx-weight-semibold); line-height:var(--fx-leading-ui);
}
html[data-ui="v2"] .fx-page--compare .compare-column h3.fx-compare__company a{
  color:var(--fx-text); text-decoration:none;
}
html[data-ui="v2"] .fx-page--compare .compare-column h3.fx-compare__company a:hover{color:var(--fx-primary)}
html[data-ui="v2"] .fx-page--compare .compare-column .fx-compare__count{margin:0}

html[data-ui="v2"] .fx-page--compare .fx-compare__tenders{
  list-style:none; margin:0; padding:0; display:grid;
  border-block-start:1px solid var(--fx-border);
}
html[data-ui="v2"] .fx-page--compare .fx-compare__tenders li{
  display:grid; gap:2px; min-inline-size:0;
  padding:8px 0; padding-inline-start:var(--fx-space-3);
  border:0; border-block-end:1px solid var(--fx-border); border-radius:0;
}
html[data-ui="v2"] .fx-page--compare .fx-compare__tenders li.is-winner{
  border-color:var(--fx-border);
  box-shadow:inset calc(var(--fx-dir) * 3px) 0 0 var(--fx-success);
}
html[data-ui="v2"] .fx-page--compare .fx-compare__tenders li a{
  color:var(--fx-text); font-size:var(--fx-text-sm); font-weight:var(--fx-weight-medium);
  text-decoration:none;
}
html[data-ui="v2"] .fx-page--compare .fx-compare__tenders li a:hover{color:var(--fx-primary)}
html[data-ui="v2"] .fx-page--compare .fx-compare__tenders .row-meta{
  display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px;
  font-size:var(--fx-text-2xs); color:var(--fx-text-subtle);
}
html[data-ui="v2"] .fx-page--compare .fx-compare__tenders .row-meta > span:not(.fx-chip):not(:last-child)::after{
  content:" ·"; color:var(--fx-text-subtle);
}
