/* 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; }
/* Bidvane wordmark lockup (UK): two-tone word with a reversed "tenders" bar the
   exact width of the word (flex column + stretch). */
.bv-lock { display: inline-flex; flex-direction: column; align-items: stretch; line-height: 1; }
.bv-word { font-family: var(--font-display); font-size: 25px; line-height: .82; letter-spacing: -.01em;
  white-space: nowrap; -webkit-text-stroke: .6px; paint-order: stroke fill; }
.bv-word .b1 { color: var(--seal); -webkit-text-stroke-color: var(--seal); }
.bv-word .b2 { color: var(--ink); -webkit-text-stroke-color: var(--ink); }
.bv-bar { margin-top: 3px; padding: 2px 0 1px; border-radius: 3px; background: var(--accent);
  color: #fff; font-family: var(--font-body); font-weight: 800; text-transform: uppercase;
  font-size: 11px; letter-spacing: .22em; text-indent: .22em; text-align: center; }
.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; }
/* One-time attention glow on the צוות nav ICON only (not the link/text) — the
   icon keeps its native 18px size (no padding, which would shrink a border-box
   SVG) and pulses an orange halo. Cleared via the ``teams_seen`` cookie the
   first time the user opens the teams area. */
.nav a.nav-glow .nav-icon {
  color: var(--accent);
  border-radius: 50%;
  animation: navTeamsGlow 1.8s ease-in-out infinite;
}
@keyframes navTeamsGlow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  50%      { box-shadow: 0 0 7px 3px color-mix(in srgb, var(--accent) 45%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .nav a.nav-glow .nav-icon { animation: none; box-shadow: 0 0 6px 2px color-mix(in srgb, var(--accent) 40%, transparent); }
}

/* Expandable "בלוג" menu in the nav (native <details>). */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  list-style: none; cursor: pointer; color: var(--ink-soft); font-weight: 500;
  font-size: var(--t-sm); padding: var(--s2) var(--s3); border-radius: var(--r-control);
  display: inline-flex; align-items: center;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::marker { content: ""; }
.nav-dropdown > summary:hover { background: var(--paper); color: var(--ink); }
.nav-dropdown[open] > summary { color: var(--ink); background: var(--paper); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 50;
  min-width: 300px; max-width: 86vw; padding: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 2px;
}
.nav-dropdown-menu a {
  display: block; padding: 8px 10px; border-radius: var(--r-control);
  color: var(--ink); font-size: var(--t-sm); line-height: 1.45; font-weight: 500;
}
.nav-dropdown-menu a:hover { background: var(--seal-wash); text-decoration: none; }
.nav-dropdown-all { color: var(--accent-ink) !important; }
.nav-caret { display: inline-flex; margin-inline-start: 3px; transition: transform .15s ease; }
.nav-dropdown[open] > summary .nav-caret { transform: rotate(180deg); }
.nav-dropdown-label { padding: 6px 10px 2px; font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); }
.nav-dropdown-sep { display: block; height: 1px; background: var(--line); margin: 6px 4px; }

/* Public blog — listing + article. */
.blog-list { display: flex; flex-direction: column; gap: var(--s4); max-width: 760px; }
.blog-card { padding: var(--s4) var(--s5); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); box-shadow: var(--shadow); }
.blog-card-title { font-family: var(--font-display); font-size: var(--t-md); color: var(--ink); display: block; }
.blog-card-title:hover { color: var(--accent-ink); text-decoration: none; }
.blog-card-meta { font-size: var(--t-xs); margin: 4px 0 8px; }
.blog-card-excerpt { color: var(--ink-soft); margin: 0 0 10px; }
.blog-card-more { color: var(--accent-ink); font-weight: 700; font-size: var(--t-sm); }
.blog-article { max-width: 760px; }
.blog-article > h1 { font-size: var(--t-xl); line-height: 1.2; margin-bottom: 6px; }
.blog-article-meta { font-size: var(--t-sm); margin-bottom: var(--s5); }
.blog-body { color: var(--ink); line-height: 1.85; }
.blog-body h2 { font-family: var(--font-display); font-size: var(--t-lg); margin: var(--s5) 0 var(--s2); }
.blog-body p { margin: 0 0 var(--s3); }
.blog-body a { color: var(--accent-ink); }
.blog-refs { font-size: var(--t-sm); color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s4); }
.blog-cta { margin: var(--s6) 0 var(--s4); padding: var(--s5); background: var(--seal-wash); border-radius: var(--r-card); text-align: center; }
/* Comparison table for editorial posts (e.g. approaches to finding tenders). */
.blog-body table.cmp { width: 100%; border-collapse: collapse; margin: var(--s4) 0; font-size: var(--t-sm); line-height: 1.5; }
.blog-body table.cmp th, .blog-body table.cmp td { border: 1px solid var(--line); padding: var(--s2) var(--s3); text-align: start; vertical-align: top; }
.blog-body table.cmp thead th { font-family: var(--font-display); background: var(--bg-soft, var(--seal-wash)); }
.blog-body table.cmp tbody th { font-weight: 500; }
.blog-body table.cmp .cmp-us { background: var(--seal-wash); color: var(--accent-ink); font-weight: 700; }
.blog-cta p { margin: 0 0 var(--s3); font-weight: 500; }
.blog-back { margin-top: var(--s4); }
.blog-back a { color: var(--accent-ink); }
/* About page — "how it works" steps. */
.about-steps { display: flex; flex-wrap: wrap; gap: var(--s4); margin: var(--s3) 0 var(--s4); }
.about-step { flex: 1 1 180px; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.about-step-ic { display: inline-flex; color: var(--seal); margin-bottom: var(--s2); }
.about-step h3 { font-size: var(--t-md); margin: 0 0 4px; }
.about-step p { margin: 0; color: var(--ink-soft); font-size: var(--t-sm); }

/* ---------- 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); }

/* ---------- Saved pipeline page ---------- */
/* Header row: result count on one side, stage tally chips on the other. */
.saved-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s2) var(--s4); margin-bottom: var(--s4);
}
.saved-head .results-summary { margin: 0; }
.pipeline-summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.ps-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  cursor: pointer; font-family: inherit; transition: opacity .12s ease, background .12s ease;
}
.ps-pill:hover { background: var(--paper); }
.ps-pill b { color: inherit; font-weight: 700; }
/* Each pill is an independent on/off filter. "On" (visible) is the default,
   coloured look; "off" (hidden) dims it and strikes its count. */
.ps-pill.is-off { opacity: .4; background: var(--paper); }
.ps-pill.is-off b { text-decoration: line-through; }
.ps-pill.is-off:hover { opacity: .7; }
/* Show-all chip. */
.ps-clear {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600;
  border: 1px dashed var(--line); background: transparent; color: var(--ink-soft);
  cursor: pointer; font-family: inherit;
}
.ps-clear:hover { background: var(--paper); color: var(--ink); }
.ps-interested { color: var(--seal); border-color: color-mix(in srgb, var(--seal) 30%, var(--line)); }
.ps-preparing { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ps-submitted { color: var(--seal); border-color: color-mix(in srgb, var(--seal) 30%, var(--line)); }
.ps-won { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.ps-lost { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }

/* Card list — one clean card per saved tender. */
.saved-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s4); }
.saved-card {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 3px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.saved-card:hover { box-shadow: var(--shadow); }
/* Stage accent on the inline-start edge — at-a-glance pipeline color. */
.stage-accent-interested { border-inline-start-color: var(--seal); }
.stage-accent-preparing  { border-inline-start-color: var(--accent); }
.stage-accent-submitted  { border-inline-start-color: var(--seal); }
.stage-accent-won        { border-inline-start-color: var(--ok); }
.stage-accent-lost       { border-inline-start-color: var(--bad); }
.saved-card.is-missed { border-inline-start-color: var(--accent); }

.sc-row { display: flex; align-items: flex-start; gap: var(--s4); padding: var(--s4) var(--s5); cursor: pointer; }
.sc-main { flex: 1; min-width: 0; }
.sc-title { font-family: var(--font-display); font-size: var(--t-md); color: var(--ink); margin: 0 0 7px; line-height: 1.3; }
.sc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); color: var(--ink-soft); font-size: var(--t-sm); }
.sc-meta .dot { color: var(--line); }
.sc-pub { display: inline-flex; align-items: center; gap: 5px; }
.sc-pub .lucide { color: var(--ink-soft); }
.sc-deadline { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.sc-deadline.urgent { color: var(--accent-ink); }
.sc-deadline.soon { color: var(--check); }
.sc-deadline.passed { color: var(--ink-soft); }
.sc-has-note { display: inline-flex; align-items: center; gap: 4px; }

/* At-a-glance AI facts on the collapsed card — compact pills, one wrapping line. */
.sc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; margin-top: 7px; }
.sc-fact {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-xs); color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 9px; line-height: 1.7;
}
.sc-fact .lucide { color: var(--ink-soft); }
.sc-fact b { color: var(--ink); font-weight: 700; }
.sc-fact-warn { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-wash); }
.sc-fact-warn .lucide { color: var(--accent-ink); }
.sc-facts .t-conf-chip { line-height: 1.7; }

.sc-side { display: flex; align-items: center; gap: var(--s3); flex: none; }
.sc-caret { color: var(--ink-soft); display: inline-flex; transition: transform .15s ease; }
.t-row[aria-expanded="true"] .sc-caret { transform: rotate(180deg); color: var(--accent); }

/* Stage <select> rendered as a pill — the card's one prominent control. */
.stage-form { margin: 0; }
.stage-select {
  font-size: var(--t-xs); font-weight: 700; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  -webkit-appearance: none; appearance: none; text-align: center; text-align-last: center;
}
.stage-interested { border-color: var(--seal); background: var(--seal-wash); color: var(--seal); }
.stage-preparing  { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-ink); }
.stage-submitted  { border-color: var(--seal); background: var(--seal); color: #fff; }
.stage-won        { border-color: var(--ok); background: var(--ok-wash); color: var(--ok); }
.stage-lost       { border-color: var(--bad); background: var(--bad-wash); color: var(--bad); }

/* Expanded detail area. */
.sc-detail { border-top: 1px solid var(--line); background: var(--paper); padding: var(--s4) var(--s5); }
.sc-detail-grid { display: grid; grid-template-columns: 1fr 280px; gap: var(--s5); align-items: start; }
.sc-detail-main { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.sc-actions {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px dashed var(--line);
}
.sc-actions .inline { display: inline-flex; margin: 0; }
.note-form { margin: var(--s2) 0 0; }
/* Slim inline note field: borderless auto-growing textarea + a round save
   button sharing one rounded container; a tiny lock hint sits beneath it. */
.note-field {
  display: flex; align-items: flex-end; gap: var(--s2);
  border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--surface); padding: 5px 6px 5px 10px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.note-field:focus-within { border-color: var(--seal); box-shadow: 0 0 0 3px var(--seal-wash); }
.note-input {
  flex: 1; min-width: 0; border: 0; background: transparent; resize: none;
  font: inherit; color: var(--ink); line-height: 1.5; padding: 4px 0;
  max-height: 160px; overflow-y: auto;
}
.note-input:focus { outline: none; }
.note-save-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--seal-wash); color: var(--seal); transition: background .12s ease, color .12s ease;
}
.note-save-btn:hover { background: var(--seal); color: #fff; }
.note-save-btn.is-saved { background: var(--ok); color: #fff; }
.note-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: 5px; }
.note-hint { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); }
.note-hint .lucide { opacity: .8; }
.note-counter { font-size: var(--t-xs); font-variant-numeric: tabular-nums; flex: none; }
.note-counter.is-low { color: var(--accent-ink); font-weight: 700; }
@media (max-width: 760px) {
  .sc-detail-grid { grid-template-columns: 1fr; }
}

/* Controls row: stage filter then the outcome KPIs, flowing from the start and
   wrapping together as a tidy group (no forced split that isolates a chip). */
.pipeline-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); margin-bottom: var(--s4); }
.pipeline-summary { margin-bottom: 0; }

/* ---- View toggle (list / board) ---- */
.view-toggle { display: inline-flex; flex: none; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.vt-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft);
  font: inherit; font-size: var(--t-xs); font-weight: 600; cursor: pointer;
}
.vt-btn:hover { color: var(--ink); }
.vt-btn.is-active { background: var(--seal-wash); color: var(--seal); }

/* ---- Outcome KPI chips (compact, non-clickable; aligned with the filter) ---- */
.pipeline-stats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--paper); font-size: var(--t-xs); color: var(--ink-soft);
}
.stat-chip b { color: var(--ink); font-weight: 700; }
.stat-chip .stat-ok { color: var(--ok); }
.stat-chip .stat-bad { color: var(--bad); }
/* The awarded-value KPI: same size as the other chips, set apart by colour.
   (Own class — must not collide with the admin `.stat-value` display number.) */
.stat-chip.stat-money { background: var(--seal-wash); color: var(--seal); }
.stat-chip.stat-money b { color: var(--seal); }

/* ---- Won/lost award capture (compact) ---- */
.award-form {
  margin: var(--s2) 0; padding: var(--s2) var(--s3) var(--s3);
  border: 1px solid var(--line); border-radius: var(--r-control); background: var(--surface);
}
.award-form.stage-won { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok-wash) 50%, var(--surface)); }
.award-form.stage-lost { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); background: color-mix(in srgb, var(--bad-wash) 50%, var(--surface)); }
.award-head { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: var(--t-xs); color: var(--ink-soft); margin-bottom: 6px; }
.award-head .lucide { color: var(--check); }
.award-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s2); }
.award-row .field { flex: 1; min-width: 120px; margin: 0; }
.award-row .field span { font-size: var(--t-xs); }
.award-row .field input { padding: 6px 10px; }
.award-save { flex: none; padding: 7px 10px; align-self: flex-end; }

/* ---- Drag handle + reorder states (list + board) ---- */
.drag-handle {
  flex: none; display: inline-flex; align-items: center; align-self: flex-start;
  color: var(--ink-soft); cursor: grab; opacity: .5; margin-top: 2px;
  touch-action: none; transition: opacity .12s ease;
}
.drag-handle:hover { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
.saved-card.is-dragging, .kb-card.is-dragging { opacity: .45; }
.saved-card.drop-target { box-shadow: 0 -2px 0 var(--seal); }

/* ---- Kanban board ---- */
.kanban { display: flex; gap: var(--s3); overflow-x: auto; padding-bottom: var(--s3); align-items: flex-start; }
.kb-col {
  flex: 1 0 240px; min-width: 220px; max-width: 340px;
  background: var(--paper); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--line); border-radius: var(--r-card);
  display: flex; flex-direction: column;
}
.kb-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.kb-col-title { font-weight: 700; font-size: var(--t-sm); }
.kb-col-count { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; font-size: var(--t-xs); color: var(--ink-soft); }
.kb-col-body { padding: 10px; display: flex; flex-direction: column; gap: var(--s2); min-height: 64px; transition: background .12s ease; }
.kb-col-body.is-drop { background: var(--seal-wash); outline: 2px dashed var(--seal); outline-offset: -4px; border-radius: var(--r-control); }
.kb-empty { font-size: var(--t-xs); text-align: center; padding: var(--s3) 0; margin: 0; }

.kb-card {
  background: var(--surface); border: 1px solid var(--line);
  border-inline-start: 3px solid var(--line); border-radius: var(--r-control);
  box-shadow: var(--shadow-card); transition: box-shadow .15s ease, transform .15s ease, opacity .12s ease;
}
.kb-card.is-dragging { opacity: .45; }
/* Open card "grows" via the revealed detail + a lift; no transform scale —
   scaling leaks past the layout box and eats the gap to an adjacent open card. */
.kb-card.is-open { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--seal) 30%, var(--line)); position: relative; z-index: 2; }
.kb-compact { padding: 10px 11px; cursor: grab; }
.kb-compact:active { cursor: grabbing; }
.kb-title {
  font-size: var(--t-sm); font-weight: 700; color: var(--ink); margin: 0 0 5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.kb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; font-size: var(--t-xs); color: var(--ink-soft); }
.kb-deadline { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.kb-deadline.urgent { color: var(--accent-ink); }
.kb-deadline.soon { color: var(--check); }
.kb-deadline.passed { color: var(--ink-soft); }
.kb-ic { display: inline-flex; }
.kb-award { color: var(--ok); font-weight: 700; }

.kb-detail { padding: 10px 11px 11px; border-top: 1px solid var(--line); animation: kbReveal .18s ease; }
@keyframes kbReveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.kb-detail .t-detail-summary { font-size: var(--t-sm); }
.kb-detail-stage { margin: 0 0 var(--s2); }
.kb-detail-facts { display: flex; flex-wrap: wrap; gap: 4px 7px; font-size: var(--t-xs); margin-top: var(--s2); }
.kb-actions { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s2); }
.kb-actions .btn { padding: 4px 8px; }

/* ---------- Team / workspace ---------- */
.head-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.ws-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 700;
  background: var(--seal-wash); color: var(--seal); vertical-align: middle;
}
.ws-avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.assignee-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 10px; font-weight: 700;
  background: var(--accent-wash); color: var(--accent-ink);
}
.assign-form { margin: var(--s2) 0; display: flex; align-items: center; gap: var(--s2); }
.assign-label { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); }
.assign-select {
  width: auto; max-width: 11rem; font-size: var(--t-xs); font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.notes-block { margin-top: var(--s3); }
.notes-thread { border-top: 1px dashed var(--line); padding-top: var(--s3); }
.notes-head { font-size: var(--t-xs); font-weight: 700; color: var(--ink); margin-bottom: var(--s2); }
.notes-list { list-style: none; margin: 0 0 var(--s2); padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
/* Cap the thread at ~5 notes; scroll the rest so a long thread doesn't take
   over the card. (Newest are at the top.) */
.notes-list { max-height: 17rem; overflow-y: auto; padding-inline-end: 4px; }
.note-item { display: flex; align-items: flex-start; gap: var(--s2); }
.note-item .note-body { flex: 1; min-width: 0; }
.note-meta { font-size: var(--t-xs); color: var(--ink-soft); display: flex; gap: 6px; align-items: baseline; }
.note-text { font-size: var(--t-sm); color: var(--ink); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.note-del { flex: none; }
.notes-empty { font-size: var(--t-xs); }
.notes-add { display: flex; align-items: center; gap: var(--s2); }
.notes-input-wrap { position: relative; flex: 1; min-width: 0; }
.notes-input-wrap input { width: 100%; min-width: 0; }

/* @-mention chip inside a saved note. */
.note-text .mention {
  color: var(--accent-ink); font-weight: 700;
  background: color-mix(in srgb, var(--seal) 12%, transparent);
  border-radius: 4px; padding: 0 3px; unicode-bidi: plaintext;
}
/* A note that mentions the current viewer — highlighted row. */
.note-item.is-mentioned {
  background: color-mix(in srgb, var(--seal) 9%, transparent);
  border-inline-start: 3px solid var(--seal);
  border-radius: var(--r-control); padding: 6px 8px; margin-inline-start: -2px;
}
.note-item.is-mentioned.is-flash { animation: kbReveal .25s ease; box-shadow: 0 0 0 3px color-mix(in srgb, var(--seal) 30%, transparent); }
.note-mention-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--accent-ink); font-weight: 700; }
.note-mention-tag .lucide { color: var(--seal); }

/* @-mention picker dropdown (anchored under the composer input). */
.mention-pop {
  position: absolute; z-index: 30; inset-inline-start: 0; inset-inline-end: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 4px; max-height: 210px; overflow-y: auto;
}
.mention-opt {
  display: flex; align-items: center; gap: var(--s2); width: 100%;
  padding: 6px 8px; border: 0; background: transparent; cursor: pointer;
  border-radius: var(--r-control); text-align: start; color: var(--ink); font: inherit;
}
.mention-opt:hover, .mention-opt.is-active { background: var(--seal-wash); }
.mention-opt-name { font-weight: 600; font-size: var(--t-sm); }
.mention-opt-email { font-size: var(--t-xs); margin-inline-start: auto; }
.ws-upgrade { text-align: center; max-width: 560px; margin-inline: auto; padding: var(--s6) var(--s5); }
/* Settings tabs */
.settings-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: var(--s5); }
.stab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ink-soft); font: inherit; font-weight: 500; font-size: var(--t-sm); cursor: pointer; border-radius: var(--r-control) var(--r-control) 0 0; }
.stab:hover { color: var(--ink); background: var(--paper); }
.stab.is-active { color: var(--seal); border-bottom-color: var(--seal); }
.stab .lucide { flex: none; }
@media (max-width: 560px) { .stab span { display: none; } .stab { padding: 10px 14px; } }
.settings-panel[hidden] { display: none; }

/* Billing / subscription page */
.billing-card { max-width: 560px; margin-inline: auto; }
.billing-head { display: flex; align-items: flex-start; gap: var(--s4); margin-bottom: var(--s4); }
.billing-head h1 { font-size: var(--t-lg); margin: 0 0 4px; }
.billing-mark { flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--seal-wash); color: var(--seal); }
.billing-mark.ok { background: var(--ok-wash, #E7F3EC); color: var(--ok); }
.billing-meta { display: flex; gap: var(--s5); flex-wrap: wrap; margin: 0 0 var(--s4); }
.billing-meta dt { font-size: var(--t-xs); color: var(--ink-soft); margin-bottom: 2px; }
.billing-meta dd { margin: 0; font-weight: 700; color: var(--ink); }
.billing-trial { margin: 0 0 var(--s3); display: inline-flex; align-items: center; gap: 5px; }
.billing-secure { margin: var(--s3) 0 0; display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); }
.billing-actions { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.billing-cancel-form { margin: 0; }
.btn-cancel-sub { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-cancel-sub:hover { color: #c0392b; }
.ws-upgrade-mark { color: var(--seal); display: inline-flex; }
.ws-upgrade-list { list-style: none; margin: var(--s4) auto; padding: 0; display: inline-flex; flex-direction: column; gap: var(--s2); text-align: start; }
.ws-upgrade-list li { display: flex; align-items: center; gap: var(--s2); color: var(--ink); }
.ws-upgrade-list .lucide { color: var(--ok); }
.auth-actions { display: flex; gap: var(--s2); margin-top: var(--s3); }

/* ---- Workspace settings forms ---- */
.ws-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.ws-section-head h2 { margin: 0; }
.ws-seat-pill { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 4px 11px; border-radius: 999px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); }
.ws-rename { display: flex; gap: var(--s2); }
.ws-rename input { flex: 1; min-width: 0; }
.ws-name-static { font-weight: 700; color: var(--ink); margin: 0; }
/* Members + pending list */
.ws-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ws-member { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.ws-member:first-child { border-top: 0; }
.ws-member-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.ws-member-email { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.ws-you-chip { font-size: var(--t-xs); color: var(--seal); background: var(--seal-wash); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.ws-member.is-invited .ws-member-email { color: var(--ink-soft); }
.ws-member-role { flex: none; }
.role-pill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 600; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.role-pill.role-owner { color: var(--seal); border-color: color-mix(in srgb, var(--seal) 30%, var(--line)); }
.role-pill.role-admin { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.role-select { font-size: var(--t-xs); font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.role-select.role-owner { color: var(--seal); border-color: color-mix(in srgb, var(--seal) 30%, var(--line)); }
.role-select.role-admin { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ws-icon-btn { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ws-icon-btn:hover { background: var(--paper); color: var(--bad); }
.wn-copy.ws-icon-btn:hover { color: var(--seal); }
/* Invite card */
.ws-invite { display: flex; flex-direction: column; gap: var(--s3); }
.ws-invite-emails textarea { width: 100%; resize: vertical; min-height: 52px; }
.ws-invite-emails textarea.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash); }
.ws-invite-error { margin: 0; font-size: var(--t-sm); color: var(--bad); word-break: break-all; }
.ws-invite-foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.ws-invite-role { flex: none; display: inline-flex; align-items: center; gap: var(--s2); margin: 0; }
.role-inline-label { flex: none; font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); }
.ws-invite-foot .role-select { height: 40px; padding: 0 12px; }
.ws-invite-foot .btn-primary { height: 40px; }
.ws-invite-hint { font-size: var(--t-xs); display: inline-flex; align-items: flex-start; gap: 5px; margin: 0; }
.ws-sub { font-size: var(--t-sm); margin: var(--s5) 0 var(--s2); color: var(--ink); }
.ws-pending-list { margin-top: var(--s2); }
/* Teams-trial contact prompt (informational, not an error). */
.ws-trial-alert {
  display: flex; align-items: flex-start; gap: var(--s2);
  background: var(--seal-wash); border: 1px solid color-mix(in srgb, var(--seal) 30%, var(--line));
  color: var(--ink); border-radius: var(--r-control); padding: var(--s3) var(--s4); margin-bottom: var(--s4);
}
.ws-trial-alert .lucide { color: var(--seal); flex: none; margin-top: 2px; }
.ws-trial-alert a { color: var(--seal); font-weight: 700; }
/* Admin users table: badge for a user who's a non-owner member of a team. */
.member-team-badge {
  display: inline-flex; align-items: center; gap: 3px; vertical-align: middle;
  margin-inline-start: 5px; padding: 1px 8px; border-radius: 999px;
  font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
  background: var(--seal-wash); color: var(--seal);
  border: 1px solid color-mix(in srgb, var(--seal) 25%, var(--line));
}
.member-team-badge.role-admin { background: var(--accent-wash); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.member-team-badge .lucide { flex: none; }

/* ---- Admin workspace plan list ---- */
.ws-admin-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.ws-admin-item + .ws-admin-item { border-top: 1px solid var(--line); }
.ws-admin-row { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; }
.ws-admin-row:hover { background: var(--paper); }
.ws-admin-caret { color: var(--ink-soft); flex: none; transition: transform .15s ease; }
.ws-admin-row[aria-expanded="true"] .ws-admin-caret { transform: rotate(180deg); color: var(--accent); }
.ws-admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ws-admin-owner { font-weight: 700; color: var(--ink); }
.ws-admin-meta { font-size: var(--t-xs); display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.ws-admin-meta .lucide { vertical-align: middle; }
.ws-on { color: var(--ok); font-weight: 700; }
/* Segmented plan picker — click a segment to set the plan. */
.plan-seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface); }
.plan-seg .inline { margin: 0; }
.seg-btn { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: var(--t-xs); font-weight: 600; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.seg-btn:hover { background: var(--paper); color: var(--ink); }
.seg-btn.is-active { background: var(--seal); color: #fff; }
.seg-business.is-active { background: var(--ok); }
.ws-admin-detail { padding: var(--s3) var(--s5) var(--s4); background: var(--paper); border-top: 1px dashed var(--line); }
.ws-team-list { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ws-team-list li { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-sm); }
.ws-team-email { flex: 1; min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.role-ic { flex: none; display: inline-flex; }
.role-owner { color: var(--seal); }
.role-admin { color: var(--accent-ink); }
.role-member { color: var(--ink-soft); }
.invited-chip { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: var(--t-xs); color: var(--check); background: var(--check-wash); padding: 1px 8px; border-radius: 999px; }
.ws-team-list li.is-invited .ws-team-email { color: var(--ink-soft); }
.ws-seat-form { display: flex; align-items: center; gap: var(--s2); }

/* ---------- 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); }
/* Center each label's icon with its text (icons were sitting slightly high on
   the baseline) — applies wherever these card meta rows render. */
.fitcard-status span, .fitcard-context span { display: inline-flex; align-items: center; gap: 4px; }
.fitcard-status span .lucide, .fitcard-context span .lucide { margin: 0; }
.fitcard-context .dot { color: var(--line); }
.fitcard-summary { margin: var(--s3) 0 0; color: var(--ink); }
/* Key-facts strip under the summary — the real cards' compact inline facts
   (label: value), wrapping so the card stays its normal height. Middots keep
   each fact distinct. */
.fitcard-keyfacts { margin-top: var(--s3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s3); font-size: var(--t-sm); color: var(--ink-soft); }
.fitcard-keyfacts span { display: inline-flex; align-items: center; gap: 5px; }
.fitcard-keyfacts b { color: var(--ink); font-weight: 700; }
.fitcard-keyfacts .kf-sep { color: var(--line); }
.fitcard-keyfacts a { color: var(--seal); font-weight: 700; }
.fitcard-keyfacts a .lucide, .fitcard-keyfacts span .lucide { color: var(--seal); }
/* Demo card footer: secondary metadata split out of the strip (document + tour). */
.fitcard-foot .ff-doc, .fitcard-foot .ff-meta { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-sm); color: var(--ink-soft); }
.fitcard-foot .ff-doc a { color: var(--seal); font-weight: 700; }
.fitcard-foot .ff-doc .lucide, .fitcard-foot .ff-meta .lucide { color: var(--seal); }
.fitcard-foot .ff-meta b { color: var(--ink); font-weight: 700; }
.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; }
.fitcard-enrichment { padding: 0 var(--s5) var(--s3); display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- 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); }

/* Post-onboarding "matching in progress" loading state on the dashboard. */
.match-loading { text-align: center; padding: var(--s7) var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.match-loading h3 { color: var(--ink); margin: var(--s4) 0 var(--s2); }
.match-loading p { margin: 0; }
.match-loading-spin {
  display: inline-block; width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--seal-wash); border-top-color: var(--seal);
  animation: matchSpin .8s linear infinite;
}
@keyframes matchSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .match-loading-spin { animation-duration: 2s; } }

/* ---------- 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); }

/* ---- "What's new" panel ---- */
.whatsnew { padding: var(--s4) var(--s5) 0; }
.whatsnew-inner {
  max-width: var(--maxw); margin-inline: auto; position: relative;
  background: linear-gradient(180deg, var(--seal-wash), var(--surface));
  border: 1px solid color-mix(in srgb, var(--seal) 25%, var(--line));
  border-radius: var(--r-card); box-shadow: var(--shadow-card);
  padding: var(--s4) var(--s5); animation: kbReveal .2s ease;
}
.wn-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.wn-badge {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 2px 10px; border-radius: 999px; font-size: var(--t-xs); font-weight: 700;
  background: var(--seal); color: #fff;
}
.wn-badge .lucide { color: #fff; }
.wn-title { font-family: var(--font-display); font-weight: 400; font-size: var(--t-md); color: var(--ink); }
.wn-x {
  margin-inline-start: auto; flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 0; cursor: pointer; color: var(--ink-soft); background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
}
.wn-x:hover { background: var(--paper); color: var(--ink); }
.wn-intro { margin: 0 0 var(--s3); font-size: var(--t-sm); color: var(--ink-soft); line-height: 1.55; }
.wn-intro a { color: var(--accent-ink); font-weight: 700; }
.wn-items { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.wn-items li { display: flex; align-items: flex-start; gap: var(--s2); font-size: var(--t-sm); color: var(--ink); line-height: 1.5; }
.wn-items li b { font-weight: 700; }
.wn-ic { flex: none; color: var(--seal); margin-top: 1px; }
.wn-foot { margin-top: var(--s3); }
.wn-ok {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; border-radius: 999px; cursor: pointer;
  font-size: var(--t-sm); font-weight: 600; line-height: 1;
  color: var(--accent-ink); background: transparent;
  border: 1px solid color-mix(in srgb, var(--seal) 32%, var(--line));
  transition: background .15s ease, border-color .15s ease;
}
.wn-ok:hover { background: var(--seal-wash); border-color: color-mix(in srgb, var(--seal) 50%, var(--line)); }
.wn-ok .lucide { color: var(--seal); }

/* 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; cursor: pointer; }
.step-pill:hover { color: var(--ink); }
.step-pill:hover::before { border-color: var(--seal); }
.step-pill:focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; border-radius: var(--r-control); }
.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); }
/* "Continue with Google" — white button with the Google mark, per brand guidance. */
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s3);
  background: #fff; color: #3c4043; border: 1px solid var(--line);
  font-weight: 600;
}
.btn-google:hover { background: #f7f8f8; border-color: var(--ink-soft); text-decoration: none; }
.btn-google .g-logo { flex: none; }
/* "or" divider between Google sign-in and the email form. */
.auth-sep { display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0; color: var(--ink-soft); font-size: var(--t-sm); }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 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); }
.settings-readonly-note { display: flex; align-items: center; gap: 6px; }
/* The profile form is wrapped in a <fieldset> so we can disable it wholesale for
   non-admins; strip the element's native chrome so layout is unchanged. */
.settings-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.settings-fieldset[disabled] { opacity: .75; }
.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; }
/* Nudge the hero copy column (rotating headline + demo button) up slightly. */
.hero-copy { transform: translateY(-10px); }
.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; }
/* Shrink the public hero demo card 10% (scoped here only — the dashboard's real
   fitcards are unaffected). zoom (not transform) so the card's layout box shrinks
   too, keeping the gap to the next section natural instead of leaving slack. */
.hero-demo .fitcard { box-shadow: 0 10px 30px rgb(28 43 51 / 0.08); zoom: .9; }

.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: calc(var(--s5) * .95) var(--s5) calc(var(--s4) * .95);
  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-period { font-family: var(--font-body); font-size: var(--t-sm); color: var(--muted); font-weight: 500; }
.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); }
.price-seats { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s3);
  padding: 8px 12px; border-radius: var(--r-control); background: var(--accent-wash);
  color: var(--accent-ink); font-weight: 700; font-size: var(--t-sm); }
.price-seats .lucide { color: var(--accent-ink); }

/* 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);
}
/* Admin user-list email-verification badges. */
.verif-ok { color: var(--ok); font-weight: 700; }
.verif-no { color: var(--bad); font-weight: 700; cursor: help; }

.footer-links { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.footer-nav-link { color: var(--ink-soft); font-size: 12px; }
.footer-nav-link:hover { color: var(--accent-ink); }
.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; }
  /* The public "עוד" menu's 300px min-width overflows the viewport on phones
     (the text gets clipped off-screen). Anchor it to the sticky topbar and pin
     both inline edges so it spans the screen with a 10px margin instead. */
  .nav-dropdown { position: static; }
  .nav-dropdown-menu {
    top: calc(100% + 6px); inset-inline: 10px;
    min-width: 0; max-width: none; width: auto;
  }
  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-disclaimer { display: flex; align-items: flex-start; gap: 6px; justify-content: center; max-width: 680px; margin: var(--s6) auto 0; padding: var(--s3) var(--s4); background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: var(--r-card); color: var(--accent-ink); font-size: var(--t-sm); text-align: start; }
.demo-disclaimer .lucide { flex: none; margin-top: 2px; }
.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); position: relative; }
.t-docs-label { display: inline-flex; align-items: center; gap: 4px; }
.t-docs-list { margin-top: 4px; max-height: 128px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.t-doc-link { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--seal); line-height: 1.6; min-width: 0; flex-shrink: 0; }
.t-doc-link:hover { text-decoration: underline; }
/* "more files below" affordance: a soft fade + bobbing chevron pinned to the
   bottom of the scroll area, shown only when the list overflows and hidden
   once the user has scrolled to the end (classes toggled in base.html). */
.t-docs-more {
  position: absolute; inset-inline: 0; bottom: 0; height: 26px;
  display: none; align-items: flex-end; justify-content: center;
  background: linear-gradient(to top, var(--paper) 42%, transparent);
  color: var(--accent); pointer-events: none;
}
.t-detail-docs.has-scroll .t-docs-more { display: flex; }
.t-detail-docs.has-scroll.is-bottom .t-docs-more { display: none; }
.t-docs-more-ic { display: inline-flex; animation: docs-bob 1.5s ease-in-out infinite; }
@keyframes docs-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(2px); } }
@media (prefers-reduced-motion: reduce) { .t-docs-more-ic { animation: none; } }
.t-detail-pending { font-size: var(--t-sm); display: inline-flex; align-items: center; gap: 6px; }

/* Key-points / eligibility sections — same visual rhythm as t-detail-conds. */
.t-detail-kpoints h4 { font-size: var(--t-sm); display: flex; align-items: center; gap: 6px; margin: 0 0 var(--s2); color: var(--ink); }
.t-detail-kpoints h4 .lucide { color: var(--seal); }
.t-detail-kpoints ul { margin: 0; padding-inline-start: 20px; }
.t-detail-kpoints li { font-size: var(--t-sm); color: var(--ink-soft); margin: 3px 0; line-height: 1.45; }

/* Confidence row: stacks the label, chip and its plain-language explanation
   as a full-width block instead of the usual label/value flex split. */
.t-detail-facts > div.t-fact-block { flex-direction: column; align-items: stretch; gap: 5px; }
.t-conf-dd { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.t-conf-explain { font-size: var(--t-xs); color: var(--ink-soft); font-weight: 400; line-height: 1.5; }

/* Confidence badge in the side-facts panel. */
.t-conf-chip { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 1px 8px; }
.conf-high   { background: #d1fae5; color: #065f46; }
.conf-medium { background: #fef3c7; color: #92400e; }
.conf-low    { background: #fee2e2; color: #991b1b; }

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

/* ---------- Workspace calendar (deadlines) ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.cal-nav { display: flex; align-items: center; gap: var(--s2); }
.cal-arrow { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--r-control); border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.cal-arrow:hover { background: var(--paper); }
/* The chevron glyph points down; rotate it to horizontal month arrows.
   RTL: previous (right side) points right ›, next (left side) points left ‹. */
.cal-arrow .lucide { transform: rotate(-90deg); }
.cal-arrow-next .lucide { transform: rotate(90deg); }
.cal-month { font-family: var(--font-display); font-size: var(--t-lg); color: var(--ink); min-width: 8.5ch; text-align: center; }
.cal-today { height: 34px; }
.cal-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.cal-toggle { cursor: pointer; }

.cal-grid { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--surface); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--paper); border-bottom: 1px solid var(--line); }
.cal-weekdays span { padding: 8px 6px; text-align: center; font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); }
.cal-weekdays span.is-weekend { color: var(--accent-ink); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
/* Fixed, uniform cells so the date grid never shifts; overflow events collapse
   behind a "+N" button that expands the single cell on demand. */
.cal-cell { height: 124px; border-inline-start: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; position: relative; }
.cal-cell.is-expanded { height: auto; min-height: 124px; z-index: 3; box-shadow: var(--shadow-card); }
.cal-week:last-child .cal-cell { border-bottom: 0; }
.cal-cell:first-child { border-inline-start: 0; }
.cal-cell.is-other { background: var(--paper); }
.cal-cell.is-other .cal-daynum { color: var(--line); }
.cal-cell.is-weekend { background: color-mix(in srgb, var(--paper) 60%, var(--surface)); }
.cal-cell.is-today { background: var(--seal-wash); }
.cal-daynum { font-size: var(--t-xs); font-weight: 700; color: var(--ink-soft); align-self: flex-start; padding: 1px 4px; flex: none; }
.cal-cell.is-today .cal-daynum { background: var(--seal); color: #fff; border-radius: 6px; }
.cal-cell-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-cell-rest { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.cal-more { align-self: stretch; margin-top: auto; border: 0; background: var(--paper); color: var(--ink-soft); font: inherit; font-size: var(--t-xs); font-weight: 700; padding: 2px; border-radius: 5px; cursor: pointer; }
.cal-more:hover { background: var(--seal-wash); color: var(--seal); }

.cal-ev { display: flex; align-items: center; gap: 4px; padding: 1px 6px; min-height: 18px; border-radius: 5px; font-size: 11px; line-height: 1.35; overflow: hidden; }
.cal-ev .cal-ev-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover { text-decoration: none; filter: brightness(0.97); }
.cal-ev-time { font-weight: 700; flex: none; }
.cal-ev-who { flex: none; margin-inline-start: auto; width: 17px; height: 17px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); }
/* Milestones: solid, colored by kind; urgency intensifies the submission one. */
.cal-ms-submission { background: var(--accent-wash); color: var(--accent-ink); font-weight: 700; }
.cal-ms-submission.u-today, .cal-ms-submission.u-soon { background: var(--accent); color: #fff; }
.cal-ms-submission.u-today .cal-ev-who, .cal-ms-submission.u-soon .cal-ev-who { background: rgba(255,255,255,.25); border-color: transparent; color: #fff; }
.cal-ms-site_tour { background: var(--seal-wash); color: var(--seal); font-weight: 700; }
.cal-ms.u-passed { opacity: .55; }
/* Reminder flags: muted countdown pills. */
.cal-rem { background: var(--paper); color: var(--ink-soft); border: 1px dashed var(--line); }
.cal-rem .lucide { flex: none; }

.cal-agenda { display: flex; flex-direction: column; gap: var(--s2); }
.cal-ag-day { display: grid; grid-template-columns: 11rem 1fr; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.cal-ag-day.is-today .cal-ag-date { color: var(--seal); font-weight: 700; }
.cal-ag-date { color: var(--ink); font-size: var(--t-sm); }
.cal-ag-evs { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-ag-evs .cal-ev { padding: 5px 10px; font-size: var(--t-sm); border-radius: var(--r-control); }

.cal-subscribe { margin-top: var(--s5); }
.cal-sub-top { display: flex; align-items: flex-start; gap: var(--s3); }
.cal-sub-ic { flex: none; width: 40px; height: 40px; border-radius: var(--r-control); background: var(--seal-wash); color: var(--seal); display: inline-flex; align-items: center; justify-content: center; }
.cal-sub-intro h2 { margin: 0 0 2px; }
.cal-sub-intro p { margin: 0; }
/* URL + copy as one aligned unit. */
.cal-sub-field { display: flex; align-items: stretch; margin-top: var(--s4); border: 1px solid var(--line); border-radius: var(--r-control); overflow: hidden; background: var(--surface); transition: border-color .12s ease, box-shadow .12s ease; }
.cal-sub-field:focus-within { border-color: var(--seal); box-shadow: 0 0 0 3px var(--seal-wash); }
.cal-sub-url { flex: 1; min-width: 0; border: 0; background: transparent; height: 44px; padding: 0 12px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: var(--t-sm); color: var(--ink-soft); }
.cal-sub-url:focus { outline: none; }
.cal-sub-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; border-inline-start: 1px solid var(--line); background: var(--seal-wash); color: var(--seal); padding: 0 16px; cursor: pointer; font: inherit; font-weight: 700; font-size: var(--t-sm); white-space: nowrap; transition: background .12s ease, color .12s ease; }
.cal-sub-copy:hover { background: var(--seal); color: #fff; }
.cal-sub-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }
.cal-sub-apps { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-xs); }
.cal-sub-apps .lucide { color: var(--ok); }
.cal-rotate { margin: 0; }
.cal-rotate .btn { padding: 6px 12px; font-size: var(--t-xs); }

@media (max-width: 720px) {
  .cal-cell { height: 96px; padding: 2px; }
  .cal-cell.is-expanded { height: auto; }
  .cal-ev { font-size: 10px; padding: 1px 4px; gap: 2px; }
  .cal-ev-who { display: none; }  /* too tight on a phone-width cell */
  .cal-ag-day { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 460px) {
  .cal-sub-copy-label { display: none; }  /* icon-only copy on tiny screens */
  .cal-sub-copy { padding: 0 12px; }
}

/* Card flashed when arriving from the calendar (?focus=<id>). */
.saved-card.is-focused, .kb-card.is-focused {
  outline: 2px solid var(--seal); outline-offset: 2px; border-radius: var(--r-card);
  animation: focusFlash 2.4s ease;
}
@keyframes focusFlash {
  0%, 12% { box-shadow: 0 0 0 5px var(--seal-wash); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .saved-card.is-focused, .kb-card.is-focused { animation: none; } }

/* ---------- Notification center — left-edge expander ---------- */
/* A slim tab pinned to the left edge (the "hint"); clicking slides out a drawer
   with the deadline reminders. Kept out of the crowded top nav. */
.notif-dock { position: fixed; left: 0; top: 96px; z-index: 60; display: flex; align-items: flex-start; }
.notif-tab { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; background: var(--accent); color: #fff; border: 0; cursor: pointer; padding: 9px 7px; border-radius: 0 12px 12px 0; box-shadow: 2px 2px 8px rgb(28 43 51 / 0.18); }
.notif-tab:hover { filter: brightness(1.05); }
.notif-tab .lucide { color: #fff; }
.notif-badge { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #fff; color: var(--accent); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.notif-drawer { margin-inline-start: 6px; width: 340px; max-width: calc(100vw - 64px); max-height: 76vh; display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
/* LTR markets (UK): dock the alerts tab on the right edge; the drawer opens
   inward to the left. RTL (Hebrew) keeps the left-edge default above. */
html[dir="ltr"] .notif-dock { left: auto; right: 0; flex-direction: row-reverse; }
html[dir="ltr"] .notif-tab { border-radius: 12px 0 0 12px; box-shadow: -2px 2px 8px rgb(28 43 51 / 0.18); }
html[dir="ltr"] .notif-drawer { margin-inline-start: 0; margin-inline-end: 6px; }
.notif-head { display: flex; align-items: center; gap: 6px; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); font-size: var(--t-sm); }
.notif-close { margin-inline-start: auto; width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.notif-close:hover { background: var(--paper); color: var(--ink); }
.notif-head-title { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.notif-filter { display: inline-flex; }
.notif-filter .nf-btn { padding: 3px 9px; font-size: var(--t-xs); font-weight: 700; }
.notif-list { overflow-y: auto; }
.notif-list.mine-only .notif-item[data-mine="0"] { display: none; }
.notif-empty { padding: var(--s5) var(--s4); text-align: center; color: var(--ink-soft); font-size: var(--t-sm); }
.notif-item { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: 0; }
.notif-link { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.notif-link:hover { text-decoration: none; }
.notif-when { font-weight: 700; font-size: var(--t-xs); color: var(--accent-ink); }
.notif-item.u-today .notif-when, .notif-item.u-soon .notif-when { color: var(--accent); }
.notif-text { font-size: var(--t-sm); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-x { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.notif-x:hover { background: var(--paper); color: var(--ink); }
.notif-foot { display: flex; align-items: center; justify-content: center; gap: 4px; padding: var(--s3); color: var(--accent-ink); font-weight: 700; font-size: var(--t-sm); border-top: 1px solid var(--line); }
.notif-foot:hover { background: var(--paper); text-decoration: none; }

/* Mention alerts: an @-tag + a snippet of the note, distinct from deadline rows. */
.notif-mention { align-items: flex-start; }
.notif-mention .notif-link { flex-direction: row; align-items: flex-start; gap: var(--s2); }
.notif-ic { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--seal-wash); color: var(--seal); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.notif-mention .notif-text { white-space: normal; }
.notif-sub { font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-mention .notif-when { flex: none; font-weight: 500; color: var(--ink-soft); }

/* ---------- User guide (manual) ---------- */
.guide-note { display: flex; align-items: flex-start; gap: 6px; background: var(--bg-soft, #f8f8f8); border-inline-start: 3px solid var(--accent); border-radius: 4px; padding: var(--s3) var(--s4); margin: var(--s4) 0; font-size: var(--t-sm); color: var(--ink-soft); }
.guide-fields { display: grid; gap: var(--s3); margin: var(--s4) 0; }
.guide-fields dt { font-weight: 600; color: var(--ink); }
.guide-fields dd { margin: 2px 0 0 0; color: var(--ink-soft); font-size: var(--t-sm); }
.guide-fields ul { margin: 4px 0 0; padding-inline-start: 18px; }
.guide-fields ul li { margin: 2px 0; }
.guide-toc { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4) var(--s5); margin: var(--s5) 0; }
.guide-toc h2 { margin: 0 0 var(--s2); font-size: var(--t-md); font-family: var(--font-display); }
.guide-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.guide-toc a { color: var(--accent-ink); }
.guide .blog-body h2, .guide .blog-body h3 { scroll-margin-top: 84px; }  /* clear the sticky header on anchor jumps */
.settings-guide-link {
  display: flex; align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s5); margin-bottom: var(--s5);
  text-decoration: none; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--seal) 18%, var(--line));
  border-radius: var(--r-card);
  background: linear-gradient(135deg, var(--seal-wash), color-mix(in srgb, var(--seal-wash) 40%, var(--surface)));
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.settings-guide-link:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--seal) 45%, var(--line));
  box-shadow: 0 4px 16px -8px color-mix(in srgb, var(--seal) 50%, transparent);
}
.settings-guide-ic {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-control);
  background: var(--surface); color: var(--seal);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--seal) 20%, transparent);
}
.settings-guide-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-guide-text strong { font-family: var(--font-display); font-size: var(--t-md); }
.settings-guide-hint { font-size: var(--t-sm); color: var(--ink-soft); }
.settings-guide-cta {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-sm); font-weight: 700; color: var(--accent-ink);
}
.settings-guide-cta .lucide { transition: transform .15s ease; }
.settings-guide-link:hover .settings-guide-cta .lucide { transform: translate(-2px, -2px); }
@media (max-width: 560px) { .settings-guide-cta { display: none; } }
