/* TenderRadar components. Built on tokens.css. RTL-first, logical properties. */

/* The HTML [hidden] attribute must always win: components like .btn set an
   explicit `display`, which otherwise beats the UA `[hidden]{display:none}` on
   specificity and leaves "hidden" elements visible (e.g. the wizard's Next
   button lingering on the final step). Keep this first so it's overridable
   only by an even more specific intentional rule. */
[hidden] { display: none !important; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--s5); padding-block: var(--s6); }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: var(--maxw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--s3) var(--s5);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark { color: var(--seal); display: inline-flex; }
.nav { display: flex; align-items: center; gap: var(--s1); }
.nav a { color: var(--ink-soft); padding: var(--s2) var(--s3); border-radius: var(--r-control); font-weight: 500; font-size: var(--t-sm); }
.nav a:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); background: var(--paper); }
/* The signup CTA is a button inside the nav; .nav a (grey, with a pale hover
   background) would otherwise win on specificity over .btn-primary and make the
   button white-on-white on hover. Pin colour and the hover background so it
   matches the page's other primary CTAs. */
.nav a.btn-primary, .nav a.btn-primary:hover { color: #fff; }
.nav a.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.nav-icon { display: inline-flex; vertical-align: -3px; margin-inline-end: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: 10px var(--s4); border-radius: var(--r-control);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-family: var(--font-body); font-size: var(--t-sm); font-weight: 500; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--paper); border-color: #d3d6cd; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-lg { padding: 14px var(--s6); font-size: var(--t-md); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-ink); }
.btn-block { width: 100%; }
/* Submit-in-progress state (set by the form loading handler in base.html): a
   spinner + locked button so the click clearly registered while the server works. */
.btn.is-loading { cursor: progress; opacity: .92; pointer-events: none; }
.btn.is-loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: btn-spin .6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before { animation: none; } }

/* ---------- Forms ---------- */
label { font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.field > span, .field-label { font-size: var(--t-sm); color: var(--ink); font-weight: 500; }
input, select, textarea {
  font-family: var(--font-body); font-size: var(--t-sm); color: var(--ink);
  padding: 10px var(--s3); border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--surface); width: 100%;
}
input:hover, select:hover, textarea:hover { border-color: #d3d6cd; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--seal); outline-offset: 1px; border-color: var(--seal); }
select { cursor: pointer; }

.alert { padding: var(--s3) var(--s4); border-radius: var(--r-control); border: 1px solid var(--bad); background: var(--bad-wash); color: var(--bad); margin-bottom: var(--s4); }
.alert-ok { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }

/* ---------- Chips (pure-CSS selectable via :has(:checked)) ---------- */
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px var(--s3); border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); font-size: var(--t-sm); font-weight: 500;
  cursor: pointer; transition: background .12s, border-color .12s, color .12s; user-select: none;
}
.chip:hover { background: var(--paper); }
.chip input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; margin: 0; }
.chip:has(input:checked), .chip.selected { background: var(--seal-wash); border-color: var(--seal); color: var(--seal); font-weight: 700; }
.chip:has(input:focus-visible) { outline: 2px solid var(--seal); outline-offset: 2px; }

.cert-group { margin-bottom: var(--s4); }
.cert-group > .cert-label { font-size: var(--t-xs); color: var(--ink-soft); font-weight: 700; margin-bottom: var(--s2); display: block; }

/* Deadline chip */
.deadline-chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
}
.deadline-chip.soon { border-color: var(--check); background: var(--check-wash); color: var(--check); }
.deadline-chip.urgent { border-color: var(--accent); background: var(--accent); color: #fff; }
.deadline-chip.passed { color: var(--ink-soft); background: var(--paper); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.section-title { margin: var(--s6) 0 var(--s4); display: flex; align-items: baseline; gap: var(--s3); }
.section-title .count { color: var(--ink-soft); font-size: var(--t-sm); font-family: var(--font-body); }

/* ---------- Score seal ---------- */
.seal { position: relative; display: inline-grid; place-items: center; }
.seal svg { display: block; transform: rotate(0deg); }
.seal .seal-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.seal .seal-num b { font-family: var(--font-display); color: var(--seal); line-height: 1; }
.seal .seal-num small { display: block; font-size: 9px; color: var(--ink-soft); letter-spacing: .04em; margin-top: 2px; }
.seal.size-lg .seal-num b { font-size: 26px; }
.seal.size-sm .seal-num b { font-size: 15px; }
.seal.size-sm .seal-num small { display: none; }

/* ---------- Fit Card (תעודת התאמה) ---------- */
.fitcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.fitcard + .fitcard { margin-top: var(--s5); }
.fitcard-head { display: flex; gap: var(--s4); padding: var(--s4) var(--s5); align-items: flex-start; }
.fitcard-head .seal { flex: none; }
.fitcard-main { flex: 1; min-width: 0; }
.fitcard-title { font-family: var(--font-display); font-size: var(--t-md); color: var(--ink); margin: 0 0 6px; }
/* "חדש" corner ribbon — tenders added to the system in the last 24h. A light-red
   diagonal banner across the top-left corner of the card (clipped by the card's
   overflow:hidden), so it's highly visible without covering any tender text.
   Tooltip on hover explains it. */
.new-ribbon {
  position: absolute; top: 14px; left: -44px; z-index: 2;
  width: 140px; text-align: center; transform: rotate(-45deg);
  background: #f4a9a9; color: #7a1414;
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; padding: 3px 0; cursor: default;
  box-shadow: 0 1px 3px rgb(28 43 51 / 0.18);
}
/* When the ribbon is present, push the card head clear of the corner so a long
   title never tucks under the diagonal banner (RTL: long lines reach the left
   corner where the ribbon sits). */
.new-ribbon + .fitcard-head { padding-top: 42px; }
.new-ribbon + .fitcard-head .seal { margin-top: -6px; }
/* Two predictable rows under the title: primary signal (verdict + deadline)
   on its own row so it doesn't shift with the publisher line length. */
.fitcard-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: 0 0 6px; font-size: var(--t-sm); }
.fitcard-status .verdict-ok { color: var(--ok); font-weight: 700; }
.fitcard-status .verdict-no { color: var(--accent-ink); font-weight: 700; }
.fitcard-context { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); color: var(--ink-soft); font-size: var(--t-sm); }
.fitcard-context .dot { color: var(--line); }
.fitcard-summary { margin: var(--s3) 0 0; color: var(--ink); }
.fitcard-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s5); border-top: 1px solid var(--line); background: var(--paper); }
.fitcard-actions { display: inline-flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.fitcard-actions .hide-form { display: inline-flex; margin: 0; }
.fitcard-actions .btn { padding: 6px var(--s3); font-size: var(--t-sm); }
.hide-btn { color: var(--ink-soft); }
.hide-btn:hover { color: var(--bad); background: var(--bad-wash); }
/* Save / bookmark toggle: outline when unsaved, filled accent when saved. */
.save-btn { color: var(--ink-soft); }
.save-btn:hover { color: var(--accent-ink); background: rgba(232, 101, 13, 0.08); }
.save-btn.is-saved { color: var(--accent); }
.save-btn.is-saved .lucide { fill: var(--accent); }
.saved-chip { border-color: var(--accent); background: rgba(232, 101, 13, 0.10); color: var(--accent-ink); }

/* ---------- Admin tabs ---------- */
.admin-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line);
  margin: var(--s4) 0; }
.admin-tab { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
  border-bottom: 2px solid transparent; padding: var(--s3) var(--s4); margin-bottom: -1px;
  font: inherit; font-weight: 500; color: var(--ink-soft); cursor: pointer; }
.admin-tab:hover { color: var(--ink); }
.admin-tab.is-active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.tab-panel > .section-title:first-child { margin-top: 0; }
/* Client-sorted admin tables */
.sortable-table th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-table th.th-sort:hover { color: var(--accent-ink); }
.sortable-table th.th-sort.sorted::after { content: "▾"; font-size: .7em; margin-inline-start: 4px; }
.sortable-table th.th-sort.sorted[data-dir="asc"]::after { content: "▴"; }

/* ---------- Admin feature flags ---------- */
.admin-hint { margin-bottom: var(--s3); font-size: var(--t-sm); }
.flag-row { display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.flag-row:first-of-type { border-top: 0; }
.flag-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.flag-label { font-weight: 600; }
.flag-info .muted { font-size: var(--t-sm); }
/* Compact toggle switch (replaces the bulky checkbox + save button). */
.switch { position: relative; flex: none; cursor: pointer; line-height: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { display: inline-block; width: 40px; height: 22px; border-radius: 999px;
  background: var(--line); transition: background .15s; position: relative; }
.switch-track::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: inset-inline-start .15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { inset-inline-start: 20px; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--seal); outline-offset: 2px; }

/* ---------- Dashboard unlock banner (flagged) ---------- */
.unlock-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  margin-bottom: var(--s5); padding: var(--s3) var(--s4);
  border: 1px solid var(--accent); border-radius: var(--r-card); background: var(--accent-wash); }
.ub-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700;
  font-size: var(--t-sm); color: var(--accent-ink); }
.ub-title .ic { color: var(--accent); }
.ub-items { display: flex; flex-wrap: wrap; gap: 6px; }
.ub-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--surface); font-size: var(--t-sm); font-weight: 600;
  color: var(--ink); transition: background .15s ease, color .15s ease; }
.ub-item:hover { background: var(--accent); color: #fff; text-decoration: none; }
.ub-item .ub-count { font-family: var(--font-display); color: var(--accent); }
.ub-item:hover .ub-count { color: #fff; }

/* Hidden-card fade-out (smooth dismissal feel when a card disappears post-hide) */
.fitcard.fading-out { animation: fade-out .26s ease forwards; }
@keyframes fade-out { to { opacity: 0; transform: translateY(-4px); } }

/* Browse: hidden rows */
.row-hidden { opacity: .58; }
.row-hidden td { background: var(--paper); }
.row-actions { white-space: nowrap; }
.row-actions .inline { display: inline-flex; margin: 0; }
.row-actions .btn { padding: 4px var(--s3); }
/* "למקור המכרז" keeps its text while the actions column is wide enough, and
   collapses to an icon-only button (tooltip preserved) once the column gets too
   narrow — so the label never spills past the cell edge. The browse table
   carries three action buttons so it tightens first (~900px); the demo table
   has fewer buttons and can hold the label down to ~780px. */
@media (max-width: 900px) {
  .row-actions .btn-label { display: none; }
}
@media (min-width: 781px) and (max-width: 900px) {
  .demo-body .row-actions .btn-label { display: inline; }
}
.hidden-chip { background: var(--paper); border-color: var(--line); color: var(--ink-soft); }

details.fitcard-details > summary { list-style: none; cursor: pointer; color: var(--accent-ink); font-weight: 600; font-size: var(--t-sm); display: flex; align-items: center; gap: 6px; padding: var(--s3) var(--s5); }
details.fitcard-details > summary:hover { background: var(--paper); }
details.fitcard-details > summary::-webkit-details-marker { display: none; }
details.fitcard-details > summary .chev { transition: transform .18s ease; }
details.fitcard-details[open] > summary .chev { transform: rotate(180deg); }

.conditions { display: grid; gap: var(--s4); padding: var(--s4) var(--s5) var(--s5); border-top: 1px dashed var(--line); }
.cond-group h4 { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: var(--t-sm); font-weight: 700; margin: 0 0 var(--s2); }
.cond-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cond-group li { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--t-sm); }
.cond-group li .ic { flex: none; margin-top: 2px; }
.cond-ok h4 { color: var(--ok); } .cond-ok .ic { color: var(--ok); }
.cond-bad h4 { color: var(--bad); } .cond-bad .ic { color: var(--bad); }
.cond-check h4 { color: var(--check); } .cond-check .ic { color: var(--check); }
.fitcard-extra { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); padding: 0 var(--s5) var(--s4); color: var(--ink-soft); font-size: var(--t-sm); }
.fitcard-extra b { color: var(--ink); font-weight: 600; }

/* ---------- Readiness (action plan) — behind the "readiness" flag ---------- */
/* A distinct but quiet summary tile: a neutral (not coloured) inset so it reads
   as a separate block from the flat condition lists below — the level colour
   shows only through the inline-start accent, the badge, and the gauge bar. */
.readiness { margin: var(--s4) var(--s5) 0; padding: var(--s3) var(--s4);
  background: var(--paper); border-radius: var(--r-control);
  border-inline-start: 3px solid var(--line); display: grid; gap: 7px; }
.readiness .rd-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.rd-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--t-sm); }
.rd-frac { font-weight: 600; font-size: var(--t-xs); color: var(--ink-soft); }
.rd-bar { height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rd-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.rd-sub { margin: 0; font-size: var(--t-xs); line-height: 1.5; color: var(--ink-soft); }
.rd-cta { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: var(--t-sm); font-weight: 600; color: var(--accent-ink); }
.rd-cta:hover { text-decoration: underline; }
/* One-click "I have this" quick-add of a required certification. */
.rd-quickadd { display: grid; gap: 6px; }
.rd-qa-label { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs);
  font-weight: 600; color: var(--ink-soft); }
.rd-qa-label .ic { color: var(--ok); }
.rd-qa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rd-qa-form { margin: 0; }
.rd-qa-btn { display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  font-size: var(--t-xs); font-weight: 600; color: var(--ink); padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  transition: background .15s ease, color .15s ease, border-color .15s ease; }
.rd-qa-btn:hover { background: var(--ok); border-color: var(--ok); color: #fff; }
.rd-qa-btn:hover .lucide { color: #fff; }
.rd-qa-btn .lucide { color: var(--ok); }
/* Responsibility reminder shown only when the panel reads "ready". */
.rd-disclaimer { display: flex; align-items: flex-start; gap: 5px; margin: 2px 0 0;
  font-size: var(--t-xs); line-height: 1.45; color: var(--ink-soft);
  border-top: 1px solid var(--line); padding-top: 6px; }
.rd-disclaimer .ic { flex: none; margin-top: 2px; color: var(--ink-soft); }
/* Per-level accent: the inline-start rule + badge + bar fill carry the colour. */
.rd-ready { border-inline-start-color: var(--ok); }
.rd-ready .rd-badge, .rd-ready .rd-badge .ic { color: var(--ok); }
.rd-ready .rd-bar > span { background: var(--ok); }
.rd-almost { border-inline-start-color: var(--check); }
.rd-almost .rd-badge, .rd-almost .rd-badge .ic { color: var(--check); }
.rd-almost .rd-bar > span { background: var(--check); }
.rd-blocked { border-inline-start-color: var(--bad); }
.rd-blocked .rd-badge, .rd-blocked .rd-badge .ic { color: var(--bad); }
.rd-blocked .rd-bar > span { background: var(--bad); }
.rd-none .rd-badge { color: var(--ink-soft); }

.seal-ring { animation: drawRing .55s ease-out both; }
@keyframes drawRing { from { stroke-dashoffset: var(--circ); } }

/* Dashboard stagger-in */
.fade-rise { opacity: 0; transform: translateY(8px); animation: fadeRise .4s ease forwards; }
@keyframes fadeRise { to { opacity: 1; transform: none; } }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); }
.page-sub { margin: var(--s2) 0 0; font-size: var(--t-sm); }

/* Sort toggle (segmented control) */
.sort-toggle { display: inline-flex; align-items: center; gap: var(--s2); flex-shrink: 0; }
.sort-label { display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-xs); color: var(--ink-soft); font-weight: 500; }
.sort-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); padding: 2px; }
.sort-seg .sort-opt {
  padding: 3px 10px; border-radius: 999px;
  color: var(--ink-soft); font-size: var(--t-xs); font-weight: 600; line-height: 1.4;
  white-space: nowrap;
  transition: background .12s ease, color .12s ease;
}
.sort-seg .sort-opt:hover { color: var(--ink); text-decoration: none; }
.sort-seg .sort-opt.is-active { background: var(--accent); color: #fff; }

.match-list { display: flex; flex-direction: column; gap: var(--s5); }
/* Save-from-matches: the card swipes left and fades, then collapses so the list
   closes the gap. Applied to the .fade-rise wrapper around each card. */
.match-list .fade-rise.is-swiping {
  transition: transform .34s ease, opacity .34s ease;
  transform: translateX(-115%); opacity: 0; pointer-events: none;
}
.match-list .fade-rise.is-removing {
  transition: max-height .26s ease, margin .26s ease, opacity .26s ease;
  max-height: 0 !important; margin: 0 !important; opacity: 0; overflow: hidden;
}
/* Disappearing confirmation toast (e.g. "moved to saved list"). */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px);
  z-index: 1000; max-width: 90vw;
  background: var(--ink); color: #fff; font-size: var(--t-sm); font-weight: 500;
  padding: 10px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgb(28 43 51 / 0.28);
  display: inline-flex; align-items: center; gap: 8px;
  opacity: 0; transition: opacity .25s ease, transform .25s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ic { color: var(--ok); display: inline-flex; }
@media (prefers-reduced-motion: reduce) {
  .match-list .fade-rise.is-swiping, .match-list .fade-rise.is-removing, .toast { transition: none; }
}

/* Dashboard is a focused work queue — keep it to a comfortable reading column. */
.work-queue { max-width: 760px; margin-inline: auto; }
.work-queue .fitcard-title { font-size: var(--t-lg); }
.work-queue .fitcard-summary { max-width: 60ch; }

/* ---------- Tables (browse / admin) ---------- */
/* overflow must stay visible (not auto) or it becomes a scroll container and
   the page-level sticky <thead> stops working. The 5-column table fits the
   container at desktop widths; mobile switches to the card layout below. */
.table-wrap { overflow: visible; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: var(--s3); margin-top: var(--s5); flex-wrap: wrap; }
.pager-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px var(--s3); border-radius: var(--r-control); border: 1px solid var(--line); color: var(--ink); font-size: var(--t-sm); font-weight: 600; }
.pager-btn:hover { background: var(--paper); text-decoration: none; }
.pager-btn.is-disabled { color: var(--ink-soft); opacity: .5; pointer-events: none; }
/* RTL: "הקודם" (prev) points right, "הבא" (next) points left. The chevron icon
   points down by default — rotate it to horizontal arrows. */
.pager-prev { transform: rotate(-90deg); }
.pager-next { transform: rotate(90deg); }
.pager-pages { display: inline-flex; align-items: center; gap: 2px; }
.pager-num { min-width: 30px; text-align: center; padding: 6px 8px; border-radius: var(--r-control); color: var(--ink-soft); font-size: var(--t-sm); font-weight: 600; }
.pager-num:hover { background: var(--paper); color: var(--ink); text-decoration: none; }
.pager-num.is-current { background: var(--accent); color: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
/* Locked column widths (via the colgroup) so expanding a row never reflows the
   table; the actions column is sized to fit 'למקור המכרז' + icons on one line.
   Long detail tokens break so the detail cell can't widen anything either. */
table.data.tenders-table { table-layout: fixed; }
/* break-word (not anywhere): only chop a token that truly can't fit; normal
   multi-word text still wraps at spaces, so values never split mid-word. */
.t-detail, .t-detail * { overflow-wrap: break-word; }
table.data th, table.data td { padding: var(--s3) var(--s4); text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* Pin the column headers below the sticky topbar (~61px) while scrolling a
   long table; a bottom border keeps them legible over the rows beneath. */
table.data thead th { position: sticky; top: 64px; z-index: 20; background: var(--paper); color: var(--ink-soft); font-weight: 700; font-size: var(--t-xs); box-shadow: inset 0 -1px 0 var(--line); }
table.data th.sortable { padding: 0; }
table.data th.sortable a {
  display: flex; align-items: center; gap: 4px; padding: var(--s3) var(--s4);
  color: inherit; text-decoration: none; transition: color .12s;
}
table.data th.sortable a:hover { color: var(--ink); text-decoration: none; background: var(--surface); }
table.data th.sort-active a { color: var(--accent-ink); }
.sort-arrow { transition: transform .12s ease; opacity: .9; }
.sort-arrow.asc { transform: rotate(180deg); }
table.data tbody tr:hover { background: var(--paper); }
table.data tbody tr:last-child td { border-bottom: none; }
.row-expired { opacity: .55; }
.t-title { font-weight: 500; color: var(--ink); max-width: 46ch; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-soft); }
.status-dot.ok::before { background: var(--ok); }
.status-dot.failed::before { background: var(--bad); }
.status-dot.running::before { background: var(--check); }

/* ---------- Admin stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s4); }
.stat-card { padding: var(--s5); }
.stat-card.stat-alert { border-color: var(--bad); background: var(--bad-wash); }
.stat-label { color: var(--ink-soft); font-size: var(--t-sm); }
.stat-value { font-family: var(--font-display); font-size: var(--t-lg); margin-top: 4px; }
.stat-flag { color: var(--bad); font-size: var(--t-xs); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.err { font-size: var(--t-xs); }
form.inline { display: inline; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--ink-soft); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-card); }
.empty h3 { color: var(--ink); margin-bottom: var(--s2); }

/* ---------- Public (SEO) pages: browse + tender detail ---------- */
.crumbs { font-size: var(--t-sm); color: var(--ink-soft); margin-bottom: var(--s3); }
.crumbs a { color: var(--accent-ink); }
.crumb-sep { margin-inline: 6px; color: var(--ink-soft); }
.cat-nav { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.cat-chip { padding: 5px var(--s3); border-radius: 999px; border: 1px solid var(--line); font-size: var(--t-sm); color: var(--ink); background: var(--surface); }
.cat-chip:hover { border-color: var(--seal); text-decoration: none; }
.cat-chip.is-active { background: var(--seal); border-color: var(--seal); color: #fff; }
.pub-link { color: var(--ink); font-weight: 500; }
.pub-link:hover { color: var(--accent-ink); }
.cat-cell { color: var(--ink-soft); }
.pub-note { font-size: var(--t-xs); margin-top: var(--s3); }
.pub-cta { text-align: center; margin: var(--s7) auto 0; max-width: 600px; padding: var(--s6) var(--s5); background: var(--seal-wash); border-radius: var(--r-card); }
.pub-cta h2 { margin-bottom: var(--s2); }
.pub-cta p { color: var(--ink-soft); margin-bottom: var(--s4); }
.pub-tender-head h1 { font-size: var(--t-lg); }
.pub-tender-meta { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s2); color: var(--ink-soft); font-size: var(--t-sm); }
.pub-tender-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.pub-tender-body { display: grid; grid-template-columns: 1fr 300px; gap: var(--s5); margin-top: var(--s5); align-items: start; }
.pub-tender-summary { font-size: var(--t-md); line-height: 1.6; }
.pub-tender-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
@media (max-width: 720px) { .pub-tender-body { grid-template-columns: 1fr; } }
.pub-gate { text-align: center; padding: var(--s6) var(--s5); background: var(--seal-wash); border: 1px solid var(--line); border-radius: var(--r-card); }
.pub-gate-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--seal); margin-bottom: var(--s3); }
.pub-gate h2 { font-size: var(--t-md); margin-bottom: var(--s2); }
.pub-gate p { color: var(--ink-soft); margin-bottom: var(--s4); }
.pub-gate-alt { font-size: var(--t-sm); margin-top: var(--s3); margin-bottom: 0; }
.pub-gate-alt a { color: var(--accent-ink); }
/* Trial-countdown bar for signed-in trial users (every app page). */
.trial-bar { background: var(--accent-wash); border-bottom: 1px solid var(--line); }
.trial-bar.is-expired { background: #FDECEC; }
.trial-bar-inner { max-width: var(--maxw); margin-inline: auto; padding: 8px var(--s5);
  display: flex; align-items: center; justify-content: center; gap: var(--s3);
  flex-wrap: wrap; text-align: center; font-size: var(--t-sm); color: var(--ink); }
.trial-bar .lucide { color: var(--accent); flex: none; }
.trial-bar b { font-weight: 700; }
.trial-bar-cta { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  font-weight: 700; color: var(--accent-ink); }
.trial-bar-cta:hover { text-decoration: underline; }
.trial-bar-x { margin-inline-start: var(--s2); flex: none; width: 26px; height: 26px;
  border-radius: 50%; border: 0; cursor: pointer; color: var(--accent-ink);
  background: rgba(177, 74, 5, .14); display: inline-flex; align-items: center; justify-content: center; }
.trial-bar-x:hover { background: rgba(177, 74, 5, .26); color: var(--accent-ink); }

/* Launch offer banner under the header (landing only). Dark & premium — slim
   navy bar, the offer glowing in orange, a sleek pill CTA. */
.promo-banner { background: linear-gradient(100deg, #14202A 0%, #1E2E3A 100%);
  color: #E9EDEA; border-bottom: 1px solid rgba(255,255,255,.08); }
.promo-banner-inner { max-width: var(--maxw); margin-inline: auto; padding: 9px var(--s5);
  display: flex; align-items: center; justify-content: center; gap: var(--s3);
  flex-wrap: wrap; text-align: center; font-size: var(--t-sm); color: #E9EDEA; }
.promo-badge { display: inline-flex; align-items: center; gap: 5px; flex: none;
  background: rgba(255,255,255,.10); color: #fff; font-weight: 700; font-size: var(--t-xs);
  padding: 3px 10px; border-radius: 999px; letter-spacing: .2px; }
.promo-badge .lucide { color: var(--accent); }
.promo-msg b { color: #FF8A3D; font-weight: 800; text-shadow: 0 0 16px rgb(255 138 61 / .35); }
.promo-sub { color: rgb(233 237 234 / .6); }
.promo-banner-cta { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  background: var(--accent); color: #fff; font-weight: 700; border-radius: 999px;
  padding: 5px 14px; box-shadow: 0 2px 8px rgb(232 101 13 / .35);
  transition: background .12s ease, transform .12s ease; }
.promo-banner-cta:hover { background: #F4761E; color: #fff; text-decoration: none; transform: translateY(-1px); }

.facet-block { margin-top: var(--s6); }
.facet-block h2 { display: flex; align-items: center; gap: 6px; font-size: var(--t-md); margin-bottom: var(--s3); }
.facet-block h2 .lucide { color: var(--seal); }
.pub-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.pub-links a { font-size: var(--t-sm); color: var(--ink); }
.pub-links a:hover { color: var(--accent-ink); }
.faq { margin-top: var(--s7); max-width: 760px; }
.faq h2 { font-size: var(--t-lg); margin-bottom: var(--s4); }
.faq details { border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--ink-soft); margin-top: var(--s2); line-height: 1.6; }
.footer-nav a { color: var(--ink-soft); font-size: 12px; }
.footer-nav a:hover { color: var(--accent-ink); }

/* ---------- Error page (404 / fallback) ---------- */
.errpage { text-align: center; max-width: 520px; margin-inline: auto; padding: var(--s8) var(--s5); }
.errpage-code { font-family: var(--font-display); font-size: 96px; font-weight: 800; line-height: 1; color: var(--seal); opacity: .22; }
.errpage h1 { margin: var(--s2) 0; }
.errpage p { margin-bottom: var(--s5); }
.errpage-actions { display: flex; gap: var(--s3); justify-content: center; flex-wrap: wrap; }

/* ---------- Wizard ---------- */
.wizard { max-width: 640px; margin-inline: auto; }
.wizard > h1 { margin-bottom: var(--s4); }
.steps { list-style: none; display: flex; gap: var(--s2); padding: 0; margin: 0 0 var(--s5); flex-wrap: wrap; counter-reset: step; }
.step-pill { counter-increment: step; display: flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-soft); padding: 4px 0; flex: 1; min-width: 90px; }
.step-pill::before { content: counter(step); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; background: var(--surface); flex: none; }
.step-pill.active { color: var(--seal); }
.step-pill.active::before { background: var(--seal); color: #fff; border-color: var(--seal); }
.step-pill.current { color: var(--ink); font-weight: 700; }
.wizard-step { padding: var(--s5); }
.wizard-step h2 { font-size: var(--t-md); margin-bottom: var(--s4); }
.wizard-step .field { margin-bottom: var(--s4); }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.chip-row .chip { padding: 8px var(--s4); font-size: var(--t-sm); }
.wizard-nav { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s4); }
.preview-note { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: var(--t-sm); margin: var(--s5) 0 var(--s2); }
.preview-note .lucide { color: var(--ok); }
.preview-card { border-style: dashed; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 130px); display: grid; place-items: center; padding: var(--s5); }
.auth-card { width: 100%; max-width: 400px; padding: var(--s6); }
.auth-card h1 { font-size: var(--t-lg); margin-bottom: var(--s5); }

/* ---------- Settings ---------- */
.settings-block { padding: var(--s5); margin-bottom: var(--s4); }
.settings-block h2 { font-size: var(--t-md); margin-bottom: var(--s2); }
.settings-intro { font-size: var(--t-sm); color: var(--ink-soft); margin-bottom: var(--s4); }
.stacked .field { margin-bottom: var(--s4); }
/* Grouped subsections inside the long profile form, divided by a hairline. */
.settings-group { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s4); }
.settings-group:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.settings-group:last-of-type { margin-bottom: var(--s4); }
.settings-subhead { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm);
  font-weight: 700; color: var(--ink); margin-bottom: var(--s3); }
.settings-subhead .lucide { color: var(--seal); flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4); }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--s2); }
.check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.check input { width: auto; }
/* Inline control rows (digest toggle, change email): control + button on one
   line, button pinned to the end and vertically aligned with its control. */
.settings-row { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.settings-row.align-end { align-items: flex-end; }
.settings-row .field { margin-bottom: 0; }
.settings-row .grow { flex: 1 1 220px; }
.settings-row .btn { margin-inline-start: auto; }
.settings-hint { font-size: var(--t-sm); color: var(--ink-soft); margin-bottom: var(--s3); }
@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .settings-row .btn { margin-inline-start: 0; }
}

/* ---------- Filter bar (browse) ---------- */
/* Filters scroll away with the page so the table's own header can stay pinned
   (see table.data thead below). Both being sticky would overlap. */
.filterbar { background: var(--paper); padding-block: var(--s3); margin-bottom: var(--s4); }
.filterbar form { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; }
.filterbar .field { margin: 0; min-width: 150px; flex: 1 1 150px; }

/* Free-text search — full-width row above the filter dropdowns */
.search-row { display: flex; gap: var(--s2); width: 100%; align-items: center; margin-bottom: var(--s1); }
.search-box { position: relative; flex: 1; display: flex; align-items: center; }
.search-box .search-ic { position: absolute; inset-inline-start: var(--s3); color: var(--ink-soft); pointer-events: none; }
.search-box input {
  width: 100%; padding-block: 11px; padding-inline-start: 42px; padding-inline-end: 36px;
  font-size: var(--t-md); border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface);
}
.search-box input:focus { outline: 2px solid var(--seal); outline-offset: 1px; border-color: var(--seal); }
.search-clear { position: absolute; inset-inline-end: var(--s3); color: var(--ink-soft); display: inline-flex; padding: 0; border: 0; background: none; cursor: pointer; }
.search-clear:hover { color: var(--ink); }
.search-row .btn { padding: 11px var(--s4); flex: none; }
.filterbar .field > span { font-size: var(--t-xs); color: var(--ink-soft); }
.filterbar .actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.filter-check { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); }
.filter-check input { width: auto; }

/* Compact "show" toggles (expired / hidden) — chip-style instead of long labels */
.show-toggles { display: inline-flex; align-items: center; gap: var(--s2); margin-inline-end: var(--s2); }
.show-label { font-size: var(--t-xs); color: var(--ink-soft); font-weight: 600; margin-inline-end: 2px; }
.chip-show { padding: 4px 10px; font-size: var(--t-xs); gap: 4px; }
.chip-show svg { vertical-align: -2px; }

/* ---------- Landing ---------- */
.hero { position: relative; overflow: hidden; background: var(--paper); border-bottom: 1px solid var(--line); }
/* Brand gradient glow stretched behind the hero — soft blueprint-blue + warm
   orange light, blurred. Sits beneath the content (z-index). */
.hero::before {
  content: ""; position: absolute; inset: -12% -6%; pointer-events: none; z-index: 0;
  background:
    radial-gradient(46% 60% at 80% 8%, rgba(22, 85, 122, 0.30), transparent 70%),
    radial-gradient(42% 55% at 12% 40%, rgba(232, 101, 13, 0.22), transparent 72%),
    radial-gradient(48% 50% at 96% 88%, rgba(22, 85, 122, 0.16), transparent 72%);
  filter: blur(40px);
}
.hero-inner { position: relative; z-index: 1; max-width: var(--maxw); margin-inline: auto; padding: var(--s8) var(--s5);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); align-items: center; }
.hero-copy h1 { font-size: var(--t-2xl); line-height: 1.1; }
/* Rotating headline — items share one grid cell so the box sizes to the
   tallest line (no layout shift). Construction-themed "brick laying": JS splits
   each line into word blocks (.brick) that drop into place with a slight
   overshoot, staggered right-to-left; the outgoing line drops away first. */
.rotator { display: grid; }
.rot-item { grid-column: 1; grid-row: 1; }
/* Each word flies in from a scattered position (JS sets --tx/--ty/--rot per
   brick) and glides into place, staggered — the headline assembles itself. */
.brick {
  display: inline-block;
  opacity: 0;
  transform: translate(var(--tx, 0), var(--ty, -0.6em)) rotate(var(--rot, 0deg)) scale(.92);
  transition:
    opacity .63s ease,
    transform .92s cubic-bezier(.16, 1, .3, 1);    /* slow, smooth glide-and-settle */
  will-change: opacity, transform;
}
.rot-item.is-active .brick { opacity: 1; transform: none; }
.rot-item.is-leaving .brick {
  opacity: 0; transform: translateY(0.5em) scale(.96);
  transition-delay: 0s !important; transition-duration: .35s;
}
@media (prefers-reduced-motion: reduce) {
  .brick { transition: none; transform: none; }
  .rot-item.is-active .brick { opacity: 1; }
}
.hero-copy .lead { font-size: var(--t-md); color: var(--ink-soft); margin: var(--s4) 0 var(--s5); max-width: 30ch; }
.hero-cta { display: flex; gap: var(--s3); flex-wrap: wrap; }
.hero-demo .fitcard { box-shadow: 0 10px 30px rgb(28 43 51 / 0.08); }

.strip { border-block: 1px solid var(--line); background: var(--surface); }
.strip-inner { max-width: var(--maxw); margin-inline: auto; padding: var(--s6) var(--s5);
  display: flex; align-items: flex-start; justify-content: center; gap: var(--s4); flex-wrap: wrap; }
.step { text-align: center; max-width: 220px; flex: 1 1 200px; }
.step-ic { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--seal-wash); color: var(--seal); margin-bottom: var(--s2); }
.step h3 { margin-bottom: 4px; }
.step p { color: var(--ink-soft); font-size: var(--t-sm); margin: 0; }
/* Top-aligned so every step's icon + title line up regardless of text length;
   nudge the connector down to sit at the icons' vertical centre. */
.step-arrow { color: var(--line); transform: rotate(90deg); margin-top: 14px; }

/* Live stats: a few honest, daily-updated counts under the hero. Kept slim and
   transparent — a quiet row that sits on the page, not a heavy coloured band. */
.stats-band { background: transparent; }
.stats-inner { max-width: 760px; margin-inline: auto; padding: var(--s5) var(--s5) var(--s4);
  display: flex; justify-content: center; flex-wrap: wrap; text-align: center; }
.stat { padding-inline: var(--s6); }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat-num { display: block; font-family: var(--font-display); font-size: var(--t-lg);
  font-weight: 700; line-height: 1.05; color: var(--seal); }
.stat-label { display: block; margin-top: 5px; font-size: var(--t-xs); color: var(--ink-soft); }
@media (max-width: 560px) {
  .stat { flex-basis: 42%; padding-inline: var(--s3); }
  .stat + .stat { border-inline-start: 0; }
}

.coverage { background: var(--ink); color: #E9EDEA; }
.coverage-inner { max-width: var(--maxw); margin-inline: auto; padding: var(--s5);
  display: flex; align-items: center; gap: var(--s3); justify-content: center; text-align: center; font-size: var(--t-sm); }
.coverage b { color: #fff; font-weight: 700; }

.pricing { max-width: var(--maxw); margin-inline: auto; padding: var(--s7) var(--s5); }
.price-grid { display: flex; justify-content: center; margin-top: var(--s5); }
.price-card { position: relative; padding: var(--s6); max-width: 360px; width: 100%; text-align: start; }
/* Floating pill straddling the card's top edge — a clean, designed touch. */
.price-badge { position: absolute; top: 0; inset-inline: 0; margin-inline: auto; width: max-content;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); font-weight: 700;
  color: #fff; background: var(--seal); border-radius: 999px; padding: 5px 14px;
  box-shadow: 0 6px 16px rgba(22, 85, 122, 0.28); letter-spacing: .01em; }
.price-badge .lucide { color: #fff; }
.price-name { color: var(--ink-soft); font-weight: 700; }
.price-amount { font-family: var(--font-display); font-size: var(--t-xl); margin: var(--s2) 0; }
.price-list { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; gap: var(--s2); font-size: var(--t-sm); }
.price-list li { display: flex; align-items: center; gap: var(--s2); color: var(--ink); }
.price-list .lucide { color: var(--ok); }

/* Below ~880px three steps can't sit side-by-side without an ugly 2+1 wrap,
   so stack them into a clean vertical flow with the connector pointing down. */
@media (max-width: 880px) {
  .strip-inner { flex-direction: column; align-items: center; gap: var(--s5); }
  .step { max-width: 360px; flex: none; }
  .step-arrow { transform: rotate(0deg); margin-top: 0; }
}

@media (max-width: 720px) {
  .hero-inner { grid-template-columns: 1fr; padding: var(--s6) var(--s4); gap: var(--s5); }
  .hero-copy h1 { font-size: var(--t-xl); }
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); color: var(--ink-soft); font-size: var(--t-xs); background: var(--surface); }
.footer-inner {
  max-width: var(--maxw); margin-inline: auto; padding: var(--s5);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3);
}
.footer-product { color: var(--ink-soft); }
.footer-meta { display: inline-flex; align-items: baseline; gap: 6px; }
.footer-rights { color: var(--ink-soft); font-size: var(--t-xs); }
.footer-contact-label { color: var(--ink-soft); font-weight: 500; }
.footer-contact { color: var(--ink); font-weight: 500; }
.footer-contact:hover { color: var(--accent-ink); text-decoration: underline; }
.disclaimer { color: var(--ink-soft); font-size: var(--t-xs); border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s5); text-align: center; }

/* Responsive: stack the browse table into cards on narrow screens */
@media (max-width: 600px) {
  .table-wrap { border: none; background: transparent; overflow: visible; }
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: var(--s3); padding: var(--s2) var(--s4); }
  table.data td { border: none; padding: 6px 0; display: flex; justify-content: space-between; gap: var(--s4); align-items: center; }
  table.data td[data-label]::before { content: attr(data-label); color: var(--ink-soft); font-size: var(--t-xs); font-weight: 700; flex: none; }
  table.data td .t-title { white-space: normal; max-width: none; text-align: start; }
  table.data td[data-label="כותרת"] { display: block; }
  table.data td[data-label=""]::before { display: none; }
}

@media (max-width: 720px) {
  .container { padding-inline: var(--s4); padding-block: var(--s5); }
  .topbar-inner { padding: var(--s3) var(--s4); }
  .nav a { padding: var(--s2); }
  .nav a .label { display: none; }
  .nav-icon { margin: 0; }
  h1 { font-size: var(--t-lg); }
  .fitcard-head { flex-direction: row; padding: var(--s4); }
  .filterbar { position: static; }
}

/* ── Tenders table skeleton (async-load placeholder) ───────────────────── */
.skeleton-table { pointer-events: none; }
.skeleton-table thead th { color: var(--ink-soft); }
.skel {
  display: inline-block; height: 14px; border-radius: 6px; vertical-align: middle;
  background: linear-gradient(90deg, var(--paper) 25%, var(--line) 37%, var(--paper) 63%);
  background-size: 400% 100%;
  animation: skel-shimmer 1.3s ease-in-out infinite;
}
.skel-lg { width: 80%; }
.skel-md { width: 55%; }
.skel-sm { width: 40%; }
.skel-chip { width: 84px; height: 22px; border-radius: 999px; }
@keyframes skel-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}

/* Dashboard match-card skeleton (reuses .skel shimmer) */
.skel-card { pointer-events: none; }
.skel-card .skel { display: block; }
.skel-card .s-seal { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.skel-card .s-l1 { height: 18px; width: 72%; }
.skel-card .s-l2 { height: 13px; width: 45%; margin-top: 10px; }
.skel-card .s-l3 { height: 12px; width: 92%; margin-top: 16px; }

/* ── Table footer: centered pager + page-size selector ─────────────────── */
.table-foot {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: var(--s3); margin-top: var(--s5);
}
.table-foot .pager { margin-top: 0; }                 /* pager sits in the middle column */
.per-page {
  grid-column: 3; justify-self: end;
  display: inline-flex; align-items: center; gap: var(--s2);
  font-size: var(--t-sm); white-space: nowrap;
}
.per-page select {
  padding: 6px var(--s3); border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--surface); color: var(--ink); font-size: var(--t-sm);
}
@media (max-width: 640px) {
  .table-foot { grid-template-columns: 1fr; justify-items: center; }
  .per-page { grid-column: 1; justify-self: center; }
}

/* ══ Live demo ════════════════════════════════════════════════════════════ */

/* Live-demo launcher — a compact, single-row accent-edge banner under the hero
   text (right column): orange spine, one line + a small CTA. Clean and small;
   clicking pops open the centered demo. */
:root { --ease-pop: cubic-bezier(.34, 1.25, .5, 1); }

.demo-banner {
  position: relative; overflow: hidden; width: auto; max-width: 100%; cursor: pointer; white-space: nowrap;
  margin-top: var(--s5); display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-control);
  padding: 9px var(--s4); padding-inline-start: calc(var(--s4) + 6px);
  color: var(--ink); font-weight: 700; font-size: var(--t-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  animation: demo-banner-glow 3s ease-in-out infinite;
}
.demo-banner::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 5px; background: var(--accent);
}
.demo-banner:hover {
  transform: translateY(-2px); border-color: var(--accent); animation: none;
  box-shadow: 0 8px 20px rgb(28 43 51 / 0.12), 0 0 22px 3px rgb(232 101 13 / 0.30);
}
@keyframes demo-banner-glow {
  0%, 100% { box-shadow: var(--shadow), 0 0 13px 0 rgb(232 101 13 / 0.16); }
  50%      { box-shadow: var(--shadow), 0 0 22px 3px rgb(232 101 13 / 0.30); }
}
.demo-banner:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; }

.demo-banner-ic {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
}
.demo-banner-arrow { display: inline-flex; color: var(--accent); transform: rotate(90deg); }   /* chevron → points (RTL) left */
.demo-banner:hover .demo-banner-arrow { animation: demo-nudge .7s ease-in-out infinite; }
@keyframes demo-nudge { 0%, 100% { transform: rotate(90deg) translateY(0); } 50% { transform: rotate(90deg) translateY(3px); } }

@media (prefers-reduced-motion: reduce) {
  .demo-banner { transition: none; animation: none; box-shadow: var(--shadow), 0 0 14px 0 rgb(232 101 13 / 0.2); }
  .demo-banner:hover { transform: none; }
}

/* Scrim dims + blurs the landing while the demo is open. */
body.demo-active { overflow: hidden; }
.demo-scrim {
  position: fixed; inset: 0; z-index: 190; background: rgb(28 43 51 / 0.5);
  opacity: 0; pointer-events: none; transition: opacity .45s ease;
  backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px);
}
body.demo-active .demo-scrim {
  opacity: 1; pointer-events: auto;
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
}

/* Centered demo stage with margins (landing shows, dimmed, around the edges).
   The demo page assembles its OWN modules (brick effect) once loaded inside. */
.demo-stage {
  position: fixed; z-index: 200; inset: 6vh 6vw; border-radius: 16px; overflow: hidden;
  background: var(--paper); box-shadow: 0 30px 90px rgb(28 43 51 / 0.45);
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
/* The stage itself appears almost instantly — the brick assembly inside is the
   entrance, so it runs in parallel with the overlay rather than after it. */
body.demo-active .demo-stage { opacity: 1; pointer-events: auto; }
.demo-stage-iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (prefers-reduced-motion: reduce) {
  .demo-launch, .demo-scrim, .demo-stage { transition: none; }
  .demo-launch-eyebrow .pulse { animation: none; }
}

@media (max-width: 640px) {
  .demo-stage { inset: 0; border-radius: 0; }
  /* Landing launcher: centered under the (centered) hero text on phones.
     Small bottom gap so it reads as distinct from the tender example below. */
  .demo-banner { display: flex; width: fit-content; max-width: 100%; margin-inline: auto; margin-bottom: 3px; }
}

/* ── Demo chrome (inside the iframe) ── */
.demo-body { background: var(--paper); }
/* Bricks-to-assemble start hidden so a cold load never flashes them in place
   first; the (inline) assemble script reveals them by dropping this class. */
.demo-anim [data-brick] { opacity: 0; }
.demo-topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s4);
  padding: var(--s3) var(--s5); background: var(--surface); border-bottom: 1px solid var(--line);
}
/* Brand in the demo bar — same look as the real site's top nav. */
.demo-brand { flex: none; }
.demo-topbar-fill { flex: 1; }
.demo-nav { display: flex; gap: var(--s2); flex: 1; }
.demo-nav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  border-radius: var(--r-control); color: var(--ink-soft); font-weight: 500; font-size: var(--t-sm);
}
.demo-nav a:hover { background: var(--paper); color: var(--ink); }
.demo-nav a.active { background: var(--seal-wash); color: var(--seal); font-weight: 700; }
.demo-top-right { display: flex; align-items: center; gap: var(--s3); flex: none; }
.demo-profile { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: var(--t-sm); }
.demo-switch { font-size: var(--t-xs); color: var(--seal); }
.demo-close {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 7px 12px; border-radius: var(--r-control);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-size: var(--t-sm);
}
.demo-close:hover { border-color: var(--bad); color: var(--bad); }

.demo-shell { padding: var(--s5); }
.demo-main { min-width: 0; max-width: 820px; margin-inline: auto; }

/* "This is a partial demo" ribbon, under the topbar on every demo screen. */
.demo-notice {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px var(--s5); font-size: var(--t-sm); color: var(--accent-ink);
  background: var(--accent-wash); border-bottom: 1px solid var(--line);
}
.demo-notice .lucide { flex: none; color: var(--accent); }

/* Profile chooser */
.demo-chooser { max-width: 1080px; margin: 0 auto; padding: var(--s7) var(--s5); text-align: center; }
.demo-chooser h1 { font-size: var(--t-xl); margin-bottom: var(--s2); }
.demo-chooser-sub { max-width: 640px; margin: 0 auto var(--s6); }
.demo-profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s4); }
.demo-profile-card {
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s5); box-shadow: var(--shadow-card);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
/* The whole card is the click target. A transparent submit button is stretched
   over it so a click/tap anywhere — and keyboard focus + Enter — starts the demo. */
.demo-profile-go {
  position: absolute; inset: 0; width: 100%; height: 100%;
  margin: 0; padding: 0; border: 0; background: transparent;
  border-radius: inherit; cursor: pointer; appearance: none;
}
.demo-profile-card:hover { transform: translateY(-3px); border-color: var(--seal); box-shadow: var(--shadow-card-hover, 0 8px 24px rgba(0,0,0,.1)); }
.demo-profile-card:hover .demo-profile-cta { gap: 8px; }
.demo-profile-card:focus-within { border-color: var(--seal); box-shadow: 0 0 0 3px var(--seal-wash); }
.demo-profile-go:focus { outline: none; }
.demo-profile-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 16px; background: var(--seal-wash); color: var(--seal);
}
.demo-profile-card h3 { font-size: var(--t-md); }
.demo-profile-card p { font-size: var(--t-sm); color: var(--ink-soft); min-height: 42px; }
.demo-profile-class { font-size: var(--t-xs); color: var(--accent-ink); font-weight: 700; margin-bottom: var(--s2); }
/* Subtle text CTA (replaces the big orange button — the card itself is clickable). */
.demo-profile-cta {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--accent); font-weight: 700; font-size: var(--t-sm);
  transition: gap .18s ease;
}

/* Source-gated popup */
.demo-modal {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  padding: var(--s4); background: rgb(28 43 51 / 0.5);
}
.demo-modal-card {
  background: var(--surface); border-radius: var(--r-card); padding: var(--s6) var(--s5);
  max-width: 420px; text-align: center; box-shadow: 0 20px 50px rgb(28 43 51 / 0.35);
}
.demo-modal-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%; background: var(--seal-wash); color: var(--seal); margin-bottom: var(--s3);
}
.demo-modal-card h3 { font-size: var(--t-md); margin-bottom: var(--s2); }
.demo-modal-card p { color: var(--ink-soft); font-size: var(--t-sm); margin-bottom: var(--s4); line-height: 1.5; }
.demo-modal-actions { display: flex; gap: var(--s2); justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  .demo-launch, .demo-stage, .demo-stage-frame,
  body.demo-active > .topbar, body.demo-active > main, body.demo-active > .footer { transition: none; }
}

@media (max-width: 820px) {
  .demo-nav a span { display: none; }             /* icons-only nav on small */
}

/* Phone: the demo top bar must fit the width so the exit (✕) stays on screen —
   drop the brand/profile/switch, tighten spacing, leaving nav + close. */
@media (max-width: 640px) {
  .demo-topbar { gap: var(--s2); padding: var(--s2) var(--s3); }
  .demo-brand, .demo-profile, .demo-switch { display: none; }
  .demo-shell { padding: var(--s4) var(--s3); }
}

/* ── Browse/saved table: click-to-expand row details ─────────────────────── */
.t-row { cursor: pointer; }
.t-row:hover { background: var(--paper); }
.t-caret {
  display: inline-flex; vertical-align: -2px; margin-inline-end: 6px; color: var(--ink-soft);
  transition: transform .2s ease, color .2s ease;
}
.t-row[aria-expanded="true"] .t-caret { transform: rotate(180deg); color: var(--accent); }
.t-row[aria-expanded="true"] > td { background: var(--paper); }
/* Continue the detail's accent edge up through the expanded row (its leftmost
   cell shares the table's left edge with the full-width detail cell below). */
.t-row[aria-expanded="true"] > td:last-child { box-shadow: inset 3px 0 0 var(--accent); }
/* The detail cell stays a real table-cell so colspan spans the full row width;
   the layout lives on an inner grid. A soft paper panel with an accent edge
   ties it to the row it belongs to. */
.t-detail-row > td.t-detail {
  padding: 0; border-top: 0;
  background: var(--paper); border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--accent);   /* accent edge on the (RTL) right */
}
.t-detail-inner {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: var(--s4) var(--s6); align-items: start;
  padding: var(--s4) var(--s5) var(--s5);
}
.t-detail-main { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.t-detail-summary { font-size: var(--t-sm); color: var(--ink); line-height: 1.6; margin: 0; }
.t-detail-conds h4 { font-size: var(--t-sm); display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); color: var(--ink); }
.t-detail-conds h4 .lucide { color: var(--seal); }
.t-detail-conds ul { margin: 0; padding-inline-start: 20px; }
.t-detail-conds li { font-size: var(--t-sm); color: var(--ink-soft); margin: 3px 0; line-height: 1.45; }
.t-detail-conds li b { color: var(--ink); }

/* Facts: a tidy label/value list filling the side column. */
.t-detail-side { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.t-detail-facts { margin: 0; display: flex; flex-direction: column; gap: 7px; }
.t-detail-facts > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  font-size: var(--t-sm); border-bottom: 1px dashed var(--line); padding-bottom: 6px;
}
.t-detail-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.t-detail-facts dt { color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; }
.t-detail-facts dt .lucide { color: var(--ink-soft); }
.t-detail-facts dd { margin: 0; color: var(--ink); font-weight: 700; text-align: start; }
.t-detail-docs { font-size: var(--t-sm); color: var(--ink-soft); display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.t-detail-docs a { color: var(--seal); }
.t-detail-docs a:hover { text-decoration: underline; }
.t-detail-pending { font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 720px) {
  .t-detail-inner { grid-template-columns: 1fr; }
}
