/* ------------------------------------------------------------------ tokens
   The archive wears goinfo.co.il's skin, the same one the professional pages
   and the protocols archive wear: the same three named themes behind the same
   data-theme attribute, written to the same localStorage key, so a theme
   chosen anywhere on the site holds here and back again.

   The names this sheet already used - --line, --card, --badge, --accent-soft -
   are kept and only re-tinted, so nothing below had to be renamed; --border,
   --surface, --shadow, --radius and the two font stacks are new, and are what
   the site strip is built from. */
:root {
  --bg: #fbfaf8;
  --fg: #14191d;
  --muted: #56626b;
  --line: #e2e0da;
  --border: #e2e0da;
  --card: #ffffff;
  --accent: #1d6b64;
  --accent-soft: #e6f0ee;
  --surface: #e6f0ee;
  --badge: #dfeeeb;
  --visited: #6a4c93;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20,25,29,.06), 0 8px 24px -16px rgba(20,25,29,.35);
  --font-head: 'Rubik', system-ui, 'Segoe UI', Arial, sans-serif;
  --font-body: 'Noto Sans Hebrew', 'Rubik', system-ui, 'Segoe UI', Arial, sans-serif;
  /* The header keeps the home page's column - 430px plus its inset - on a
     phone and on a desktop alike, so it is the same header and not a wider
     copy of it. */
  --head-w: 462px;
}

/* The OS preference, outranked further down by whatever the reader picked. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151a;
    --fg: #e8eaec;
    --muted: #98a4ac;
    --line: #26313a;
    --border: #26313a;
    --card: #161d23;
    --accent: #5cc4b6;
    --accent-soft: #12312e;
    --surface: #12312e;
    --badge: #1b2b33;
    --visited: #c58af9;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.8);
  }
}

/* :root-scoped, not a bare attribute selector: the picker buttons carry
   data-theme themselves, and a bare selector would repaint the button in a
   theme the page is not. */
:root[data-theme="clouds"] {
  --bg: #fbfaf8; --fg: #14191d; --muted: #56626b; --line: #e2e0da;
  --border: #e2e0da; --card: #ffffff; --accent: #1d6b64; --accent-soft: #e6f0ee;
  --surface: #e6f0ee; --badge: #dfeeeb; --visited: #6a4c93; --radius: 12px;
  --shadow: 0 1px 2px rgba(20,25,29,.06), 0 8px 24px -16px rgba(20,25,29,.35);
}
:root[data-theme="fashion"] {
  --bg: #0d0b08; --fg: #f3ecdc; --muted: #b7a67f; --line: #3c3320;
  --border: #3c3320; --card: #221c12; --accent: #ddb44f; --accent-soft: #18140d;
  --surface: #18140d; --badge: #241d10; --visited: #c9a3d4; --radius: 3px;
  --shadow: 0 1px 2px rgba(0,0,0,.5);
}
:root[data-theme="zebra"] {
  --bg: #ffffff; --fg: #111111; --muted: #5c5c5c; --line: #cfcfcf;
  --border: #cfcfcf; --card: #ffffff; --accent: #111111; --accent-soft: #f0f0f0;
  --surface: #f0f0f0; --badge: #f0f0f0; --visited: #111111; --radius: 6px;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  max-width: 62rem;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--font-body);
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

nav {
  font-size: .9rem;
  color: var(--muted);
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

h1 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 .5rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }

.lede { color: var(--muted); max-width: 46rem; }

.cta {
  display: inline-block;
  margin: .5rem 0 1.5rem;
  padding: .6rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

/* ---- metadata tables ---- */

dl.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .35rem 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
/* Under the title: מכרז סגור / פתוח עד <date> (Ram 2026-09-17). */
.tender-state { display: inline-block; border-radius: 999px; padding: 2px 11px; font-size: .9rem; font-weight: 600; margin: 0 0 .6rem; }
.tender-state.closed { background: #fde8e8; color: #8a1f1f; border: 1px solid #f3b4b4; }
.tender-state.open { background: #e3f6e8; color: #1d5f2e; border: 1px solid #a9dcb5; }
[data-theme="fashion"] .tender-state.closed { background: #4a1c1c; color: #ffd6d6; border-color: #7a3030; }
[data-theme="fashion"] .tender-state.open { background: #163f22; color: #cdeed5; border-color: #2e6b3d; }
dl.meta dt { color: var(--muted); font-size: .88rem; }
dl.meta dd { margin: 0; }

/* The award block is the result - the supplier who won and for how much.
   It gets a visual weight the rest of the metadata doesn't. */
.award dl.meta {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.desc p { margin: .4rem 0; white-space: pre-wrap; }

/* ---- earlier rounds ----
   The same job goes out again and again. Only the newest round is offered to
   the search, and it carries the others here; an earlier round keeps its page
   and points forward to the current one. */
.rounds { margin: 1rem 0; padding: .8rem 1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px; }
.rounds h2 { margin: 0 0 .3rem; font-size: 1rem; }
.rounds .note { margin: 0 0 .5rem; color: var(--muted); font-size: .9rem; }
.rounds ul { margin: 0; padding-inline-start: 1.2rem; }
.rounds li { margin: .35rem 0; }
.rounds .when { display: block; color: var(--muted); font-size: .85em; }
.rounds-old { background: var(--accent-soft); }

/* The way out of one tender and into every round of the same role. On every
   record page, so it is there when the rounds list is not. */
.same-role { margin: .6rem 0 0; font-size: .95rem; }

.docs ul { margin: .4rem 0; padding-inline-start: 1.2rem; }
.docs li { margin: .25rem 0; }
/* The archived copy, offered after the publisher's own link. Deliberately
   quiet: it is the fallback for when the original 404s, not the main route. */
.docs .mirror, .docs .doc-src { color: var(--muted); font-size: .85em; margin-inline-start: .4rem; }

/* Extracted document text, collapsed by default - a tender page is a summary
   first, and some of these run to tens of thousands of characters. */
.doc-text { margin: .6rem 0; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .8rem; background: var(--card); }
.doc-text summary { cursor: pointer; font-size: .9em; color: var(--muted); }
.doc-text .doc-body { font-size: .9em; margin: .6rem 0 0; max-height: 60vh; overflow-y: auto; line-height: 1.6; }
.doc-text .doc-body p { margin: 0 0 .5em; }
/* Word's hanging indent, two characters per numbering level: the clause's
   first line starts at its level's indent and every wrapped line after it
   lines up under the text, not under the number. --lvl is set per paragraph
   by build.py from the depth of the number (1 -> 1, 1.1 -> 2). */
.doc-text .dt-item { padding-inline-start: calc(var(--lvl, 1) * 2ch); text-indent: -2ch; }
/* The point in "1." is bidi-neutral, sitting between a digit and Hebrew -
   without isolation the paragraph renders it as ".1". */
.doc-text .dt-num { unicode-bidi: isolate; }
.doc-text .doc-body a { overflow-wrap: anywhere; }
.doc-text-note { color: var(--muted); font-size: .8em; margin: .5rem 0 0; }

.src-link {
  display: inline-block;
  margin-top: 1.5rem;
  font-weight: 600;
}

/* ---- listings ---- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0;
}
.filters select, .filters input {
  padding: .45rem .6rem;
  font: inherit;
  font-size: .92rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.filters input { flex: 1 1 14rem; min-width: 0; }

.pub-note { color: var(--muted); font-size: .85rem; margin: 0 0 .6rem; }
.pager { font-size: .92rem; margin: .8rem 0; }
.pager .off { color: var(--muted); }

ul.tender-list, ul.stats { list-style: none; margin: 0; padding: 0; }

ul.tender-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
}
/* The listing filter toggles li.hidden. The UA's [hidden]{display:none} loses
   to the display:flex above, so a filtered-out row stayed on screen: the count
   said "1 (מתוך 831)" and 831 rows showed (Ram, 2026-09-13). */
ul.tender-list li[hidden] { display: none; }
ul.tender-list li a { flex: 1 1 22rem; }
ul.tender-list .date { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
ul.tender-list .badge {
  font-size: .78rem;
  padding: .1rem .5rem;
  background: var(--badge);
  border-radius: 999px;
  color: var(--muted);
}
ul.tender-list .sup { font-size: .82rem; color: var(--muted); flex-basis: 100%; }

ul.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--card);
  border-radius: 8px;
}
ul.stats strong { display: block; font-size: 1.35rem; }
ul.stats li { color: var(--muted); font-size: .9rem; }

.build-time { color: var(--muted); font-size: .8rem; margin-top: 2.5rem; }

@media (max-width: 34rem) {
  dl.meta { grid-template-columns: 1fr; gap: 0 0; }
  dl.meta dt { margin-top: .5rem; }
}

/* --- הסוכן החכם header ---------------------------------------------------
   Ported from site/opportunities.py, which owns the board's copy. The token
   names differ: this stylesheet calls them --fg/--muted/--line and has no
   --shadow, so those are substituted rather than the rules copied verbatim.
   The archive's accent is blue where the board's is teal, and that is correct
   - the header should look like the page it is on. */
.tiles { display: grid; align-items: stretch; gap: 10px; margin: 0 0 22px;
         grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(84px, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px;
        padding: 10px 12px; text-align: center;
        display: flex; flex-direction: column; justify-content: center; }
.tile b { display: block; font-size: 22px; font-weight: 700; line-height: 1.25;
          font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tile span { color: var(--muted); font-size: 12px; letter-spacing: .03em; }
.agent-card { background: var(--card); border: 1px solid var(--line);
              border-radius: 10px; padding: 8px 12px;
              display: flex; align-items: center; gap: 10px; }
.robot { width: 26px; height: 26px; flex: none; color: var(--accent); }
.agent-text { min-width: 0; flex: 1 1 auto; text-align: start; }
.agent-text b { display: block; font-size: 14px; line-height: 1.25; }
/* One line high, so a message that does not fit shortens rather than pushing
   the whole row taller. */
.agent-text span { color: var(--muted); font-size: 11.5px; line-height: 1.3;
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-act { flex: none; display: flex; align-items: center; }
.agent-go { font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 7px 16px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; text-decoration: none; white-space: nowrap; }
.agent-go.ghost { background: none; color: var(--accent); }
.agent-go.ghost:hover { background: var(--accent-soft); }
.agent-blurb { margin: -8px 0 18px; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 13.5px;
  line-height: 1.5; max-width: 70ch; }
@media (max-width: 760px) {
  /* Three across: there are exactly three counts, and two columns leave the
     last one alone on a row of its own. */
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agent-card { grid-column: 1 / -1; flex-wrap: wrap; }
  .agent-act { flex: 1 0 100%; justify-content: center; }
  .tile { padding: 8px 6px; }
  .tile b { font-size: 19px; }
  .tile span { font-size: 11px; letter-spacing: 0; }
}


/* ------------------------------------------------------- the site strip
   goinfo.co.il's own header, in the shape the home page gives it: the same
   column width, the same wordmark, the same theme switch, the same field and
   the same chips - and under them this archive's own search box. The twin of
   the block in protocols' style.css; if one changes, both change. */
.site-shell { max-width: var(--head-w); margin: 0 auto; padding: 14px 16px 18px; font-family: var(--font-body); }
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.site-brand { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; color: var(--fg); text-decoration: none; }
.site-brand:hover { color: var(--accent); }

/* The switch, in the home page's treatment: a soft track holding three
   borderless buttons, the chosen one lifted out in the card colour. */
.theme-pick {
  display: flex; gap: 2px; padding: 2px; flex: none;
  border: 0; border-radius: 999px; background: var(--surface);
}
.theme-pick button {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px 9px; border: 0; border-radius: 999px; background: none;
  color: var(--muted); font: 500 0.75rem/1 var(--font-body);
  white-space: nowrap; cursor: pointer;
}
.theme-pick svg { width: 15px; height: 15px; }
.theme-pick button:hover { color: var(--fg); }
.theme-pick button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }

/* Both fields are the home page's: one pill, an icon at the start. The site's
   search comes first and the archive's second. */
.gi-find, .site-find {
  display: flex; align-items: center; gap: 10px; margin-top: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 18px; box-shadow: var(--shadow);
  transition: box-shadow .15s ease, border-color .15s ease;
}
.gi-find:focus-within, .site-find:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 30%, transparent);
}
.gi-find input[type="search"], .site-find input[type="search"] {
  flex: 1 1 auto; min-width: 0; border: 0; background: none; color: inherit;
  font: 500 1.05rem/1 var(--font-body); padding: 17px 0; outline: none;
}
.gi-find input::placeholder, .site-find input::placeholder { color: var(--muted); opacity: .85; }
/* The magnifier is the submit button, so the form works with no script and
   still looks like the home page's, which has no button at all. */
.gi-find > button[type="submit"] {
  flex: none; display: inline-flex; border: 0; background: none;
  color: var(--muted); cursor: pointer; padding: 0;
}
.gi-find > button[type="submit"]:hover { color: var(--accent); }
.site-find-icon { width: 20px; height: 20px; flex: none; color: var(--muted); }
/* The archive's box keeps a named action: two identical pills on one screen
   leave nothing to say which one searches the tenders. */
.site-find button[type="submit"] {
  flex: none; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--card);
  font: 600 0.85rem/1 var(--font-body); padding: 10px 16px;
}
.site-find button[type="submit"]:hover { filter: brightness(1.08); }

/* The topics, as the home page lays them out: a centred row that wraps. Never
   one flattened line and never a sideways scroller - the shape of the block is
   how a reader sees there are eleven. */
.gi-cats { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 16px; }
.gi-cats a {
  display: inline-flex; align-items: center; text-decoration: none;
  font: 500 0.875rem/1 var(--font-body); color: var(--fg);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 12px;
}
.gi-cats a:hover { border-color: var(--accent); color: var(--accent); }

.site-rule { border: 0; border-top: 1px solid var(--border); margin: 18px 0 0; }
/* The link row: a centred flex row rather than centred text, so anything
   added to it sits beside the links. */
.site-find-all {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 4px 10px; margin: 10px 0 0; font-size: 0.82rem; color: var(--muted);
}
.site-find-all a { color: var(--accent); text-decoration: none; }
.site-find-all a:hover { text-decoration: underline; }

/* <body> is the page's own column, so the strip has to break out of its
   padding to sit on the ground above it. */
body > .site-shell { margin-top: -0.5rem; }
