/* מי תוקף, מה נפגע, ואיפה — MODULE sv-table.css: the search combobox (#sv-search) and the table view (#sv-tableview).
   House components: .ifc-search / .ifc-results and .ifc-table from Israel_Freedom_Center_Network/prototype/ifc-viz.css,
   renamed to the sv- prefix. Tokens come from .sv (sv-viz.css). Data colours are set inline by the script; the accent is
   used only for chrome (the selected tab, links). No dashed lines. */

/* ---------------------------------------------------------------- search combobox (house .ifc-search) */
.sv-search { z-index: 50; }
.sv-search input { width: 100%; font: inherit; font-family: var(--sans); font-size: 15px; line-height: 1.3; padding: .4rem .7rem .4rem 2rem; min-height: 34px;
  border: 1px solid var(--hair); border-radius: 4px; background: var(--surface); color: var(--ink); -webkit-appearance: none; appearance: none; }
.sv-search input::placeholder { color: var(--muted-text); opacity: 1; }
.sv-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sv-search input:not(:placeholder-shown) ~ svg { display: none; }               /* the clear button takes the icon's place */
.sv-q-clear { position: absolute; inset-inline-end: .15rem; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 50%; background: none;
  color: var(--muted-text); font-size: 13px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sv-q-clear:hover { background: var(--accent-soft); color: var(--ink); }
.sv-search input:hover { border-color: var(--muted); }
.sv-search input:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink-soft); }
.sv-search > svg { position: absolute; inset-inline-end: .6rem; top: 50%; transform: translateY(-50%); pointer-events: none; display: block; }
.sv-results { position: absolute; z-index: 50; inset-inline-start: 0; top: calc(100% + 4px); width: max(100%, 23rem); max-width: calc(100vw - 1.5rem);
  max-height: min(26rem, 62vh); overflow: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--hair); border-radius: 4px;
  box-shadow: 0 6px 24px rgba(43,39,36,.14); padding: .2rem 0 .3rem; font-family: var(--sans); font-size: 14px; color: var(--ink); }
.sv-results .grp { font-size: 12px; font-weight: 700; color: var(--muted-text); letter-spacing: .03em; padding: .5rem .75rem .2rem; cursor: default; }
.sv-results [role="group"] + [role="group"] .grp { border-top: 1px solid var(--hair); margin-top: .2rem; }
.sv-results .opt { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem .75rem; min-height: 40px; cursor: pointer; line-height: 1.35; }
.sv-results .opt[aria-selected="true"] { background: var(--accent-soft); box-shadow: inset -3px 0 0 var(--accent); }
.sv-results .opt .ic { flex: none; width: 15px; display: flex; justify-content: center; padding-top: .2rem; }
.sv-results .opt .ic svg { display: block; }
.sv-results .opt .tx { min-width: 0; flex: 1; }
.sv-results .opt .nm { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-results .opt small { display: block; font-size: 12.5px; color: var(--muted-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-results .opt.more .nm { font-weight: 700; color: var(--accent); }
.sv-results .none { padding: .6rem .75rem; font-size: 13.5px; color: var(--muted-text); line-height: 1.45; }

/* ---------------------------------------------------------------- table view (house .ifc-table) */
.sv-table { margin-top: .75rem; font-family: var(--sans); color: var(--ink); outline: none; }
.sv-tv-top { display: flex; align-items: flex-end; justify-content: space-between; gap: .5rem 1rem; border-bottom: 1px solid var(--hair); }
.sv-tv-tabs { display: flex; flex-wrap: wrap; gap: 0 .15rem; min-width: 0; }
.sv-tv-tabs [role="tab"] { border: 0; border-bottom: 3px solid transparent; background: none; padding: .45rem .55rem .35rem; margin-bottom: -1px; cursor: pointer;
  font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; min-height: 40px; display: inline-flex; align-items: baseline; gap: .35rem; }
.sv-tv-tabs [role="tab"]:hover { color: var(--ink); border-bottom-color: var(--hair); }
.sv-tv-tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.sv-tv-tabs .ct { font-size: 12.5px; font-weight: 400; color: var(--muted-text); font-variant-numeric: tabular-nums; }
.sv-tv-tabs .ct:empty { display: none; }
.sv-tv-backbtn { flex: none; margin-bottom: .35rem; }

.sv-tv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding: .55rem 0 .35rem; }
.sv-tv-readout { margin: 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; min-width: 0; flex: 1 1 22rem; }
.sv-tv-readout .main { font-weight: 700; color: var(--ink); }
.sv-tv-readout .mu, .sv-tv-readout .flt, .sv-tv-readout .lens { color: var(--muted-text); }
.sv-tv-readout .sv-linkbtn { font-size: 13px; }
.sv-tv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; }
.sv-tv-chk { display: inline-flex; align-items: center; gap: .35rem; font-size: 13.5px; cursor: pointer; min-height: 32px; }
.sv-tv-chk input { accent-color: var(--ink); width: 16px; height: 16px; margin: 0; }
.sv-tv-radius { display: inline-flex; align-items: center; gap: .35rem; font-size: 13px; color: var(--muted-text); }
.sv-tv-radius .sv-rangesel button { min-height: 30px; min-width: 2rem; }
.sv-tv-find { font: inherit; font-size: 13.5px; width: 11.5rem; padding: .3rem .55rem; min-height: 32px; border: 1px solid var(--hair); border-radius: 4px; background: var(--surface); color: var(--ink); }
.sv-tv-find::placeholder { color: var(--muted-text); opacity: 1; }
.sv-tv-find:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.sv-tv-csv { white-space: nowrap; }
.sv-tv-note { margin: 0 0 .45rem; }
.sv-tv-note p { margin: 0 0 .2rem; font-size: 12.5px; color: var(--muted-text); line-height: 1.45; max-width: 60rem; }
.sv-tv-note b.gap { color: var(--ink-soft); font-weight: 700; }

/* the scroller: a fixed-height box with a sticky header; rows are virtualised (fixed heights, set per tab) */
.sv-tv-box { position: relative; }
.sv-tv-shade { position: absolute; top: 1px; inset-inline-end: 1px; width: 28px; pointer-events: none; z-index: 4; border-radius: 0 0 0 4px;
  background: linear-gradient(to right, rgba(43,39,36,.12), rgba(43,39,36,0)); }
.sv-tv-wrap { --rh: 46px; position: relative; max-height: min(74vh, 760px); min-height: 12rem; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--hair); border-radius: 4px; background: var(--surface); outline: none; }
.sv-tv-wrap:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.sv-tv-wrap[data-tab="events"] { --rh: 62px; }
.sv-tv-wrap.compact[data-tab="events"] { --rh: 70px; }
.sv-tv-wrap table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13.5px; line-height: 1.3; }
.sv-tv-wrap th { position: sticky; top: 0; z-index: 2; background: var(--paper); text-align: start; vertical-align: bottom; font-weight: 700; font-size: 12.5px;
  color: var(--ink-soft); padding: 0; border-bottom: 1px solid var(--ink-soft); }
.sv-tv-wrap th button, .sv-tv-wrap th .nos { display: flex; align-items: flex-end; gap: .2rem; width: 100%; min-height: 40px; border: 0; background: none; padding: .35rem .5rem;
  font: inherit; font-weight: 700; color: inherit; text-align: start; cursor: pointer; line-height: 1.2; }
.sv-tv-wrap th .nos { cursor: default; }
.sv-tv-wrap th button:hover { color: var(--ink); background: var(--accent-soft); }
.sv-tv-wrap th button:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.sv-tv-wrap th .lb { display: block; min-width: 0; }
.sv-tv-wrap th .lb svg { display: inline-block; vertical-align: -2px; margin-inline-end: .1rem; }
.sv-tv-wrap th .ar { font-size: 9px; color: var(--ink); flex: none; padding-bottom: 2px; }
.sv-tv-wrap th[aria-sort] { color: var(--ink); }
.sv-tv-wrap th.cur, .sv-tv-wrap td.cur { background-color: #fbf8f4; }
.sv-tv-wrap th.cur { background-color: var(--accent-soft); }
/* the first column stays in view when the table scrolls sideways (phones, tablets) */
.sv-tv-wrap th:first-child, .sv-tv-wrap td:first-child { position: sticky; inset-inline-start: 0; }
.sv-tv-wrap th:first-child { z-index: 3; }
.sv-tv-wrap td:first-child { z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--hair); }
.sv-tv-wrap td { height: var(--rh); padding: .3rem .5rem; border-bottom: 1px solid var(--hair); vertical-align: middle; overflow: hidden; }
.sv-tv-wrap td.n, .sv-tv-wrap th.n { font-variant-numeric: tabular-nums lining-nums; }
.sv-tv-wrap td.n { white-space: nowrap; }
.sv-tv-wrap tr.sp td { padding: 0; border: 0; height: auto; background: none; box-shadow: none; position: static; }
.sv-tv-wrap tr.r { cursor: pointer; }
.sv-tv-wrap tr.r:hover td { background-color: var(--accent-soft); }
.sv-tv-wrap tr.r:focus { outline: none; }
.sv-tv-wrap tr.r:focus-visible td { background-color: var(--accent-soft); box-shadow: inset 0 2px 0 var(--ink), inset 0 -2px 0 var(--ink); }
.sv-tv-wrap tr.r.static { cursor: default; }
.sv-tv-wrap tr.r.pin td { background-color: var(--paper); font-weight: 700; border-bottom: 1px solid var(--ink-soft); }
.sv-tv-wrap tr.r.pin:hover td { background-color: var(--accent-soft); }
.sv-tv-wrap tr.r.static:hover td { background-color: var(--paper); }
.sv-tv-wrap tr.r.sel td { background-color: var(--accent-soft); }
.sv-tv-wrap tr.r.sel td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
.sv-tv-wrap tr.empty td { position: static; box-shadow: none; height: auto; padding: 1.2rem .8rem; color: var(--muted-text); font-size: 14px; text-align: center; white-space: normal; }
/* the Hebrew lens greys out (never removes) what was not published in Hebrew */
.sv-tv-wrap tr.r.ghost td { color: var(--muted-text); }
.sv-tv-wrap tr.r.ghost .sv-tv-k { background: var(--muted); }
.sv-tv-wrap tr.r.ghost b { font-weight: 600; }

/* cell layouts (each fits the fixed row height; overflowing text is clipped with an ellipsis) */
.sv-tv-wrap .c2, .sv-tv-wrap .c3 { min-width: 0; }
.sv-tv-wrap .c2 > *, .sv-tv-wrap .c3 > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-tv-wrap .c2 > .l1 { font-weight: 600; }
.sv-tv-wrap td.n .c2 > .l1, .sv-tv-wrap .c2.w > .l1, .sv-tv-wrap .c2.dt > .l1 { font-weight: 400; }
.sv-tv-wrap .c2.dt > .l1 { font-variant-numeric: tabular-nums lining-nums; }
.sv-tv-wrap .c2.gap > .l1 { font-weight: 700; color: var(--ink-soft); }
.sv-tv-wrap .c2.gap > .l1, .sv-tv-wrap .c2.gap > small { white-space: normal; }
.sv-tv-wrap tr.gaprow td { height: auto; }
.sv-tv-wrap tr.gaprow td.n b { font-size: 14px; }
/* compact (phone) events: three clipped lines in one cell */
.sv-tv-wrap .cm { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sv-tv-wrap .cm > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-tv-wrap .cm .l1 b { font-weight: 700; }
.sv-tv-wrap .cm .l2 { font-size: 12.5px; color: var(--ink-soft); }
.sv-tv-wrap .cm .l2 .ic { display: inline-flex; gap: 2px; vertical-align: -2px; margin-inline-end: .3rem; }
.sv-tv-wrap .cm .l2 .ic svg { display: block; }
.sv-tv-wrap .cm .l3 { font-family: var(--serif); font-size: 13px; color: var(--ink); }
.sv-tv-wrap tr.ghost .cm .l2, .sv-tv-wrap tr.ghost .cm .l3 { color: var(--muted-text); }
/* the dead: the published text wraps (this table is short, so it is never virtualised) */
.sv-tv-wrap .cv .v { display: block; line-height: 1.4; }
.sv-tv-wrap .cv > small { display: block; margin-top: 1px; }
.sv-tv-wrap[data-tab="dead"] td { overflow: visible; }
.sv-tv-wrap.natural td { height: auto; min-height: var(--rh); }
.sv-tv-wrap.natural tr.r td { height: var(--rh); }
.sv-tv-wrap.natural .ci > .cl, .sv-tv-wrap.natural .c2 > .l1 { white-space: normal; }
.sv-tv-wrap small { font-size: 12px; color: var(--muted-text); font-weight: 400; }
.sv-tv-wrap .c3 > .l2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-family: var(--serif); font-size: 13.5px; line-height: 1.3; color: var(--ink); }
.sv-tv-wrap tr.ghost .c3 > .l2 { color: var(--muted-text); }
.sv-tv-wrap .ci { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.sv-tv-wrap .ci > .ic { flex: none; display: flex; }
.sv-tv-wrap .ci > .ic svg { display: block; }
.sv-tv-wrap .ci > .cl, .sv-tv-wrap .ci > .c2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-tv-wrap .ci > .cl.wrap { white-space: normal; overflow: visible; }   /* «מה נפגע»: three types wrap, never an ellipsis */
.sv-tv-wrap .cl.b { font-weight: 700; }
.sv-tv-wrap .mu { color: var(--muted-text); }
.sv-tv-wrap .ce { display: inline-flex; align-items: center; gap: .1rem; white-space: nowrap; }
.sv-tv-k { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff;
  font-weight: 700; font-size: 11.5px; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px #fff; }
.sv-tv-hb { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
.sv-tv-hb i { display: block; height: 8px; border-radius: 0 2px 2px 0; flex: none; }
.sv-tv-hb i.ink { background: var(--ink-soft); }
.sv-tv-hb i.hollow { background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1099px) {
  .sv-tv-tabs [role="tab"] { font-size: 14px; padding-inline: .45rem; }
}
@media (max-width: 767px) {
  .sv-search input { font-size: 16px; min-height: 44px; padding-inline-end: 2.8rem; }   /* 16 px: iOS does not zoom into the field */
  .sv-results { width: 100%; max-height: min(24rem, 58svh); }
  .sv-q-clear { width: 40px; height: 40px; font-size: 15px; }
  .sv-results .opt { min-height: 44px; padding-block: .45rem; }
  .sv-table { margin-top: .5rem; }
  .sv-tv-top { flex-direction: column-reverse; align-items: stretch; border-bottom: 0; gap: .2rem; }
  .sv-tv-backbtn { align-self: flex-end; margin: 0; min-height: 44px; font-size: 13.5px; }
  .sv-tv-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--hair);
    -webkit-mask-image: linear-gradient(to left, #000 85%, transparent); mask-image: linear-gradient(to left, #000 85%, transparent); }
  .sv-tv-tabs::-webkit-scrollbar { display: none; }
  .sv-tv-tabs [role="tab"] { flex: none; min-height: 44px; font-size: 14.5px; }
  .sv-tv-tools { width: 100%; }
  .sv-tv-find { flex: 1 1 8rem; width: auto; min-height: 44px; font-size: 16px; order: 1; }
  .sv-tv-csv { order: 2; }
  .sv-tv-radius, .sv-tv-chk { order: 3; }
  .sv-tv-csv, .sv-tv-radius .sv-rangesel button { min-height: 44px; }
  .sv-tv-radius .sv-rangesel button { min-width: 44px; }
  .sv-tv-chk { min-height: 44px; }                 /* the label is the checkbox's target */
  .sv-tv-wrap { max-height: 72svh; }
  .sv-tv-wrap table { font-size: 13px; }
  .sv-tv-wrap td { padding: .25rem .4rem; }
  .sv-tv-wrap th button, .sv-tv-wrap th .nos { padding: .3rem .4rem; min-height: 44px; }
}
@media (forced-colors: active) {
  .sv-results .opt[aria-selected="true"] { outline: 2px solid Highlight; }
  .sv-tv-tabs [role="tab"][aria-selected="true"] { border-bottom-color: Highlight; }
}
@media print {
  .sv-search, .sv-tv-tools, .sv-tv-backbtn { display: none; }
  .sv-tv-wrap { max-height: none; overflow: visible; }
}
