/* ===========================================================================
   קו באג — מערכת עיצוב
   טיפוגרפיה: Heebo (כותרות), Assistant (גוף), Spline Sans Mono (מספרים/מדדים)
   צבעים: בסיס ניטרלי-קריר, מותג אינדיגו, חומרה ענבר→אדום, תקין ירוק.
   =========================================================================== */
:root {
  /* בסיס */
  --bg: oklch(0.985 0.004 250);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.975 0.005 250);
  --line: oklch(0.92 0.006 250);
  --line-strong: oklch(0.86 0.008 250);
  --ink: oklch(0.26 0.02 260);
  --ink-soft: oklch(0.48 0.02 260);
  --ink-faint: oklch(0.64 0.015 260);

  /* מותג */
  --brand: oklch(0.52 0.16 264);
  --brand-soft: oklch(0.95 0.03 264);
  --brand-ink: oklch(0.42 0.16 264);

  /* חומרה */
  --high: oklch(0.585 0.20 25);
  --high-bg: oklch(0.955 0.04 25);
  --med: oklch(0.70 0.15 65);
  --med-bg: oklch(0.96 0.05 75);
  --low: oklch(0.80 0.12 95);
  --low-bg: oklch(0.97 0.04 95);
  --ok: oklch(0.62 0.13 152);
  --ok-bg: oklch(0.96 0.03 152);

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px oklch(0.4 0.03 260 / 0.06), 0 1px 3px oklch(0.4 0.03 260 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.4 0.03 260 / 0.10), 0 1px 3px oklch(0.4 0.03 260 / 0.06);
  --shadow-lg: 0 16px 48px oklch(0.35 0.03 260 / 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Assistant", system-ui, sans-serif;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

#root { height: 100%; }

.num {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-feature-settings: "tnum" 1;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---------- מבנה ראשי ---------- */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  height: 66px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  z-index: 1200;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "Heebo", sans-serif;
}
.brand .glyph {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand);
  display: grid; place-items: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  cursor: pointer; text-decoration: none;
}
.brand .glyph svg { display: block; }
.brand h1 {
  font-size: 21px; font-weight: 800; margin: 0;
  letter-spacing: -0.01em;
}
.brand h1 .beta {
  display: inline-block; vertical-align: middle; margin-inline-start: 6px;
  font-family: "Spline Sans Mono", monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--detour, #ef8a17); background: #fff3e2; border: 1px solid #f3c98a;
  border-radius: 999px; padding: 1px 7px; transform: translateY(-1px);
}
.brand h1 .ver {
  display: inline-block; vertical-align: middle; margin-inline-start: 4px;
  font-family: "Spline Sans Mono", monospace; font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--ink-faint, #8a8f98);
  transform: translateY(-1px); cursor: pointer; user-select: none;
  border-bottom: 1px dotted transparent; transition: color .15s, border-color .15s;
}
.brand h1 .ver:hover { color: var(--detour, #ef8a17); border-bottom-color: currentColor; }
.brand h1 .ver:focus-visible { outline: 2px solid var(--detour, #ef8a17); outline-offset: 2px; border-radius: 3px; }

/* חלון "מה חדש" */
.changelog { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 2px; }
.cl-rel { }
.cl-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.cl-ver {
  font-family: "Spline Sans Mono", monospace; font-size: 13px; font-weight: 700;
  color: var(--detour, #ef8a17);
}
.cl-date { font-size: 11px; color: var(--ink-faint, #8a8f98); }
.changelog ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 5px; }
.changelog li { font-size: 13px; line-height: 1.5; color: var(--ink, #2b2b2b); }
.brand .tag {
  font-size: 11.5px; color: var(--ink-faint); margin: 0;
  font-weight: 600;
}

.topbar .spacer { flex: 1; }

/* ---------- חיפוש ---------- */
.search {
  position: relative;
  width: 340px;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 42px 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 11px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.search input::placeholder { color: var(--ink-faint); font-weight: 500; }
.search .icon {
  position: absolute;
  right: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px;
  border: 2px solid var(--ink-faint);
  border-radius: 50%;
  pointer-events: none;
}
.search .icon::after {
  content: ""; position: absolute;
  width: 7px; height: 2px; background: var(--ink-faint);
  bottom: -3px; left: -4px; transform: rotate(45deg); border-radius: 2px;
}
.suggest {
  position: absolute;
  top: calc(100% + 6px); right: 0; left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 50;
}
.suggest button {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 11px 14px;
  border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink);
  text-align: right;
}
.suggest button:hover { background: var(--surface-2); }
.suggest .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

/* ---------- גוף: side panel + map ---------- */
.body { flex: 1; display: flex; min-height: 0; }

.panel {
  width: var(--panel-w, 396px);
  flex-shrink: 0;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── מפריד אנכי נגרר בין הפאנל למפה ── */
.col-resizer {
  flex: 0 0 6px; width: 6px; align-self: stretch;
  cursor: col-resize; position: relative; z-index: 620;
  background: var(--line);
  display: flex; align-items: center; justify-content: center;
  transition: background .14s;
}
.col-resizer:hover, body.col-resizing .col-resizer { background: var(--brand); }
.col-resizer .cr-grip {
  width: 2px; height: 34px; border-radius: 2px;
  background: var(--ink-faint); opacity: .55; transition: opacity .14s, background .14s;
}
.col-resizer:hover .cr-grip, body.col-resizing .col-resizer .cr-grip { background: #fff; opacity: .9; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing iframe, body.col-resizing .map-wrap { pointer-events: none; }

.panel-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head .city {
  font-family: "Heebo", sans-serif;
  font-size: 23px; font-weight: 800; margin: 0 0 3px;
  letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 8px;
}
.panel-head .sub { font-size: 13px; color: var(--ink-soft); margin: 0; font-weight: 600; }

/* כרטיסי סיכום */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px; }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}
.stat .v { font-family: "Spline Sans Mono", monospace; font-size: 23px; font-weight: 600; color: var(--ink); line-height: 1; }
.stat .v.alert { color: var(--high); }
.stat .k { font-size: 11px; color: var(--ink-soft); margin-top: 5px; font-weight: 600; }
.stat .u { font-size: 12px; color: var(--ink-faint); font-weight: 600; }

.list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 20px 10px;
}
/* מחוון רגישות */
.sens { padding: 4px 20px 14px; }
.sens-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.sens-top span { font-family: "Heebo", sans-serif; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
.sens-top b { font-family: "Spline Sans Mono", monospace; font-size: 13px; font-weight: 600; color: var(--brand); }
.sens input[type="range"] { width: 100%; accent-color: var(--brand); height: 22px; cursor: pointer; }
.sens-hint { font-family: "Assistant", sans-serif; font-size: 11px; color: var(--ink-faint); margin-top: 3px; line-height: 1.4; }
.list-head h3 { font-family: "Heebo", sans-serif; font-size: 13px; font-weight: 700; margin: 0; color: var(--ink-soft); text-transform: none; letter-spacing: .02em; }
.list-head .list-title {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-family: "Heebo", sans-serif; font-size: 16px; font-weight: 800; color: var(--ink);
}
.list-head .list-title .lh-count {
  font-family: "Assistant", sans-serif; font-size: 13px; font-weight: 700; color: var(--ink-soft);
}
.list-head .count {
  font-family: "Spline Sans Mono", monospace;
  font-size: 12px; font-weight: 600;
  background: var(--high-bg); color: var(--high);
  padding: 2px 8px; border-radius: 20px;
}

.cards { flex: 1; overflow-y: auto; padding: 0 14px 16px; display: flex; flex-direction: column; gap: 8px; }

/* כרטיס בעיה */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: pointer;
  background: var(--surface);
  transition: border-color .14s, box-shadow .14s, transform .14s;
  position: relative;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.card.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.card.ok { opacity: .92; }

.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.badge-line {
  font-family: "Spline Sans Mono", monospace;
  font-weight: 600; font-size: 15px; color: white;
  min-width: 38px; height: 30px; padding: 0 8px;
  border-radius: 8px; display: grid; place-items: center;
}
.card-route { flex: 1; min-width: 0; }
.card-route .name { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.card-route .op { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; margin-top: 1px; }

.sev {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.sev.high { background: var(--high-bg); color: var(--high); }
.sev.medium { background: var(--med-bg); color: oklch(0.52 0.13 60); }
.sev.low { background: var(--low-bg); color: oklch(0.52 0.10 90); }
.sev.ok { background: var(--ok-bg); color: var(--ok); }

.card-body {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}
.card-body .big { font-family: "Spline Sans Mono", monospace; font-size: 20px; font-weight: 600; color: var(--high); line-height: 1; }
.card-body .big .un { font-size: 12px; color: var(--ink-soft); }
.card-body .gap-desc { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; line-height: 1.35; }
.card-body .gap-desc b { color: var(--ink); font-weight: 700; }

/* בלוק הסבר "למה זו תקלה" */
.card-body.detour { flex-direction: column; align-items: stretch; gap: 9px; }
.card-body .why { display: flex; flex-direction: column; gap: 6px; }
.card-body .why-row {
  display: grid; grid-template-columns: 52px 1fr; gap: 9px; align-items: start;
  font-size: 12.5px; color: var(--ink-soft); font-weight: 600; line-height: 1.4;
}
.card-body .why-row b { color: var(--ink); font-weight: 700; }
.card-body .why-lbl {
  font-size: 10.5px; font-weight: 800; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 0; text-align: center; letter-spacing: .02em;
}
.card-body .why-row.fix .why-lbl { background: #fef3e2; border-color: #f3c98a; color: #b5660a; }
.card-body .why-row.fix { color: #8a5208; }
.card-body .why-row.fix b { color: #6b3e04; }

.card.ok .card-body { background: var(--ok-bg); }
.card.ok .card-body .ok-text { color: var(--ok); font-size: 13px; font-weight: 700; }

/* ---------- בורר סוג מפה (רקע) ---------- */
.map-style {
  position: absolute; top: 14px; left: 14px; z-index: 600;
  display: flex; gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-radius: 10px;
  padding: 3px;
}
.map-style .sbtn {
  border: 0; background: none; cursor: pointer;
  font-family: "Heebo", sans-serif; font-size: 12.5px; font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 13px; border-radius: 7px;
  transition: background .12s, color .12s;
}
.map-style .sbtn.on { background: var(--brand); color: #fff; }
.map-style .sbtn:not(.on):hover { color: var(--ink); }

/* ---------- מפה ---------- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: var(--surface-2); }

.map-legend {
  position: absolute; top: 14px; right: 14px; z-index: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow-md);
  padding: 12px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.map-legend .row { display: flex; align-items: center; gap: 9px; margin: 6px 0; }
.map-legend .row:first-child { margin-top: 0; }
.map-legend .row:last-child { margin-bottom: 0; }
.map-legend .swatch { width: 22px; height: 4px; border-radius: 3px; flex-shrink: 0; }
.map-legend .swatch.normal { background: #2563eb; }
.map-legend .swatch.bad { background: var(--high); height: 5px; }
.map-legend .swatch.detour { background: #ef8a17; height: 5px; }
.map-legend .swatch.alt { background: #1f9d57; height: 5px; }
.map-legend .swatch.opt { background: #7c3aed; height: 5px; }
.map-legend .swatch.stop { width: 11px; height: 11px; border-radius: 50%; background: white; border: 3px solid #2563eb; }

.map-toggle {
  position: absolute; bottom: 18px; right: 14px; z-index: 600;
  display: flex; flex-direction: column; gap: 7px;
}
.map-toggle .chip {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  border-radius: 9px;
  padding: 8px 13px;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft);
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.map-toggle .chip.on { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-soft); }
.map-toggle .chip.export.line { color: var(--brand-ink); border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.map-toggle .chip.export.line:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.map-toggle .chip .sw { width: 14px; height: 14px; border-radius: 4px; border: 2px solid currentColor; }
.map-toggle .chip.on .sw { background: var(--brand); border-color: var(--brand); }

/* tooltip לסגמנט במפה */
.seg-tip {
  background: var(--ink); color: white;
  border: 0; border-radius: 8px;
  padding: 7px 10px; font-family: "Assistant", sans-serif; font-weight: 700;
  font-size: 12.5px; box-shadow: var(--shadow-md);
}
.seg-tip .km { font-family: "Spline Sans Mono", monospace; }
.seg-tip .man { display: inline-block; margin-top: 3px; font-size: 11.5px; opacity: 0.92; font-weight: 600; }
.leaflet-tooltip.seg-tip::before { display: none; }

/* חלונית זהות קו — נפתחת בלחיצה על מסלול */
.leaflet-popup.line-popup .leaflet-popup-content-wrapper {
  background: var(--surface); border-radius: 12px;
  box-shadow: var(--shadow-md); padding: 0;
}
.leaflet-popup.line-popup .leaflet-popup-content { margin: 0; }
.leaflet-popup.line-popup .leaflet-popup-tip { background: var(--surface); }
.line-pop {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px 11px 12px; direction: rtl;
}
.line-pop .ln {
  flex-shrink: 0; min-width: 34px; height: 34px; padding: 0 9px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; color: white;
  font-family: "Heebo", sans-serif; font-weight: 900; font-size: 16px;
}
.line-pop .meta { display: flex; flex-direction: column; gap: 1px; }
.line-pop .meta b {
  font-family: "Heebo", sans-serif; font-weight: 800; font-size: 14px;
  color: var(--ink); white-space: nowrap;
}
.line-pop .meta span {
  font-family: "Assistant", sans-serif; font-weight: 600; font-size: 12px;
  color: var(--ink-soft);
}

/* empty state */
.empty {
  flex: 1; display: grid; place-items: center; text-align: center; padding: 40px;
}
.empty .e-inner { max-width: 320px; }
.empty h2 { font-family: "Heebo", sans-serif; font-size: 20px; margin: 0 0 8px; }
.empty p { color: var(--ink-soft); font-size: 14px; line-height: 1.5; font-weight: 500; }

/* פאנל עיקוף נבחר מ"כל הארץ" */
.ci-panel { padding: 16px 18px; overflow-y: auto; }
.ci-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ci-back {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--brand-ink);
  border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.ci-back:hover { background: var(--brand-soft); border-color: var(--brand); }
.ci-x {
  border: 0; background: var(--surface-2); width: 30px; height: 30px; border-radius: 8px;
  font-size: 18px; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.ci-x:hover { background: var(--line); }
.ci-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 4px; }
.ci-line { font-family: "Heebo", sans-serif; font-size: 24px; font-weight: 800; color: var(--ink); }
.ci-op { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.ci-seg { font-size: 15px; color: var(--ink); font-weight: 600; line-height: 1.45; margin-bottom: 12px; overflow-wrap: anywhere; }
.ci-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ci-ref { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.ci-metrics { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.ci-m {
  flex: 1; min-width: 120px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.ci-m b { font-family: "Spline Sans Mono", monospace; font-size: 22px; font-weight: 600; color: var(--ink); }
.ci-m span { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.ci-reason { font-size: 14px; line-height: 1.6; color: var(--ink-soft); font-weight: 500; margin: 0 0 14px; overflow-wrap: anywhere; }
.ci-hint { font-size: 12.5px; line-height: 1.6; color: var(--ink-faint); font-weight: 500; margin: 0; }

/* scrollbar */
.cards::-webkit-scrollbar { width: 9px; }
.cards::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 2px solid var(--surface); }

/* leaflet marker label */
.stop-label {
  font-family: "Assistant", sans-serif; font-size: 11px; font-weight: 700;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.stop-label.key {
  font-weight: 800; color: #6b3e04;
  background: #fff3e2; border-color: #f3c98a;
}
.gap-label {
  font-family: "Heebo", sans-serif; font-weight: 800; color: white;
  background: var(--high); border: 0; border-radius: 7px; padding: 3px 9px;
  box-shadow: var(--shadow-md); white-space: nowrap; font-size: 12.5px;
}
.gap-label .km { font-family: "Spline Sans Mono", monospace; }
.gap-label.detour { background: #ef8a17; }

/* ----- תגיות סוג באג בכרטיס ----- */
.card-body.gap .big, .big:not(.orange) { color: var(--high); }
.card-body.detour { background: var(--med-bg); }
.big.orange { color: #d97a0a; }
.issue-tags { display: flex; gap: 7px; margin-top: 9px; }
/* כפתור הורדת נתוני הקו לבדיקה — בתחתית כרטיס התקלה */
.card-export {
  width: 100%; margin-top: 9px;
  border: 1px dashed var(--brand); border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand-ink);
  font-family: "Heebo", sans-serif; font-size: 12.5px; font-weight: 700;
  padding: 8px 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .14s, color .14s, border-color .14s;
}
.card-export:hover { background: var(--brand); color: #fff; border-color: var(--brand); }.itag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 20px;
}
.idot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.idot.gap { background: var(--high); }
.idot.detour { background: #ef8a17; }
.idot.loop { background: #ef8a17; }

/* פירוט עיקופים מול סיבובים */
.breakdown {
  display: flex; gap: 8px; padding: 0 20px 8px; flex-wrap: wrap;
}
.bd-item {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 11px;
  font-family: "Assistant", sans-serif; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.bd-item b { font-family: "Heebo", sans-serif; font-weight: 800; color: var(--ink); font-size: 14px; }

/* ----- כפתור מידע (?) ----- */
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1.5px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font-family: "Heebo", sans-serif; font-weight: 800; font-size: 17px;
  cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ----- הצעת העלאה בחיפוש ----- */
.suggest-upload {
  border-top: 1px solid var(--line) !important;
  color: var(--brand-ink) !important; font-weight: 700 !important;
  font-size: 13px !important; gap: 9px !important;
}
.suggest-upload .plus {
  width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft);
  color: var(--brand); display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
.suggest-country {
  color: var(--brand-ink) !important; font-weight: 700 !important; font-size: 13px !important; gap: 9px !important;
}
.suggest-country .plus { width: 18px; height: 18px; display: grid; place-items: center; flex-shrink: 0; background: none; }
.suggest-upload { color: var(--ink-soft) !important; font-weight: 600 !important; }
.suggest .demo-tag { color: var(--ink-faint); font-size: 12px; font-weight: 500; }

/* ----- חיפוש-עיר בתוך "כל הארץ" ----- */
.country-city { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.country-cityinput {
  flex: 1; min-width: 160px; height: 38px; border: 1.5px solid var(--line-strong);
  border-radius: 10px; padding: 0 12px; font-family: "Assistant", sans-serif; font-size: 14px;
  background: var(--surface); color: var(--ink);
}
.country-cityinput:focus { outline: none; border-color: var(--brand); }
.country-citybtn { width: auto !important; height: 38px; padding: 0 16px; }
.country-controls .chip-city.on { background: var(--high-bg); border-color: var(--high); color: var(--high); }

/* ----- מודאל הסבר ----- */
.info-modal .how { display: flex; flex-direction: column; gap: 16px; margin: 6px 0 4px; }
.how-row { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.how-row > div { min-width: 0; }
.how-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.how-dot.gap { background: var(--high); }
.how-dot.detour { background: #ef8a17; }
.how-dot.ok { background: #1f9d57; }
.how-dot.ai { background: var(--brand); }
.how-step {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 2px;
  background: var(--brand-soft); color: var(--brand-ink);
  font-family: "Spline Sans Mono", monospace; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}
.how-row b { font-family: "Heebo", sans-serif; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.how-row p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- כפתור העלאה ---------- */
.upload-btn {
  display: flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 16px;
  border: 1.5px solid var(--brand);
  background: var(--brand); color: white;
  border-radius: 11px; cursor: pointer;
  font-family: "Heebo", sans-serif; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: filter .14s, transform .1s;
}
.upload-btn:hover { filter: brightness(1.08); }
.upload-btn:active { transform: translateY(1px); }
.upload-btn .u-ico { font-size: 15px; }

/* ---------- כפתור דיווח ---------- */
.report-btn {
  display: flex; align-items: center; gap: 7px;
  height: 42px; padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  border-radius: 11px; cursor: pointer;
  font-family: "Heebo", sans-serif; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: border-color .14s, background .14s, transform .1s;
}
.report-btn:hover { border-color: var(--high); background: var(--high-bg); color: var(--high); }
.report-btn:active { transform: translateY(1px); }
.report-btn .u-ico { font-size: 15px; }

/* ---------- פאנל דיווח ---------- */
.report-panel { overflow-y: auto; }
.report-head { position: relative; }
.report-back {
  border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--brand-ink);
  padding: 0 0 8px;
}
.report-back:hover { text-decoration: underline; }
.report-step { padding: 14px 16px 0; }
.report-label {
  display: block; font-family: "Heebo", sans-serif; font-size: 12px; font-weight: 700;
  color: var(--ink-faint); letter-spacing: .02em; margin-bottom: 7px;
}
.report-search { position: relative; }
.report-search input, .report-text {
  width: 100%; box-sizing: border-box;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 14px; padding: 10px 12px;
}
.report-search input:focus, .report-text:focus { outline: none; border-color: var(--brand); }
.report-suggest {
  position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); overflow: hidden; max-height: 240px; overflow-y: auto;
}
.report-suggest button {
  display: block; width: 100%; text-align: right; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  padding: 9px 12px;
}
.report-suggest button:hover { background: var(--brand-soft); }
.report-dirs { display: flex; flex-direction: column; gap: 6px; }
.report-dir {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 9px 11px; text-align: right;
}
.report-dir.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.report-hint {
  font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; line-height: 1.5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.report-tip {
  font-size: 11.5px; color: var(--brand-ink); background: var(--brand-soft);
  border-radius: var(--radius-sm); padding: 7px 10px; margin: 0 0 9px; line-height: 1.45;
}
.report-clear {
  border: 0; background: var(--surface-2); cursor: pointer; color: var(--high);
  font-family: inherit; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px;
}
.report-stops {
  max-height: 280px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: flex; flex-direction: column;
}
.report-stop {
  display: flex; align-items: center; gap: 9px;
  border: 0; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer;
  font-family: inherit; padding: 8px 11px; text-align: right;
}
.report-stop:last-child { border-bottom: 0; }
.report-stop:hover { background: var(--surface-2); }
.report-stop.marked { background: var(--high-bg); }
.report-stop.anchor { box-shadow: inset 3px 0 0 var(--high); }
.report-stop .rs-idx {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink-soft);
  font-family: "Spline Sans Mono", monospace; font-size: 11px; font-weight: 600;
}
.report-stop.marked .rs-idx { background: var(--high); color: white; }
.report-stop .rs-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 600; color: var(--ink); }
.report-stop .rs-id { font-family: "Spline Sans Mono", monospace; font-size: 10.5px; color: var(--ink-faint); }
.report-actions { display: flex; gap: 8px; padding: 14px 16px; }
.report-analyze, .report-export {
  flex: 1; border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 10px;
  transition: filter .14s;
}
.report-analyze { border: 0; background: var(--brand); color: white; }
.report-analyze:hover:not(:disabled) { filter: brightness(1.08); }
.report-export { border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.report-export:hover:not(:disabled) { border-color: var(--brand); }
.report-analyze:disabled, .report-export:disabled { opacity: .45; cursor: not-allowed; }
.report-result {
  margin: 0 16px 16px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
}
.report-result .rr-verd { font-size: 13px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rr-src {
  font-family: "Assistant", sans-serif; font-size: 10px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px; letter-spacing: 0.01em;
}
.rr-src.ai { background: var(--brand-soft); color: var(--brand-ink); }
.rr-src.quick { background: var(--surface-2, #eef0f4); color: var(--ink-soft); }
.report-result .rr-reason { font-size: 13px; font-weight: 600; line-height: 1.5; }
.report-result .rr-engine {
  margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700;
}
.report-result .rr-engine.caught { color: oklch(0.40 0.10 152); }
.report-result .rr-engine.missed { color: var(--high); }
.report-result .rr-miss {
  margin-top: 7px; font-size: 12.5px; font-weight: 600; line-height: 1.5;
  color: var(--ink-soft); background: var(--surface); border-radius: var(--radius-sm); padding: 8px 10px;
}
.report-result .rr-miss b { color: var(--ink); }
.report-result.real { background: var(--high-bg); }
.report-result.real .rr-verd { color: var(--high); }
.report-result.noise { background: var(--ok-bg); }
.report-result.noise .rr-verd { color: oklch(0.40 0.10 152); }
.report-result.cover { background: var(--brand-soft); }
.report-result.cover .rr-verd { color: var(--brand-ink); }
.report-result.doubt { background: var(--surface-2); }
.report-result.doubt .rr-verd { color: var(--ink-soft); }
.report-email {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 100%; margin-top: 11px; cursor: pointer;
  border: 0; border-radius: var(--radius-sm);
  background: var(--high, #d8392f); color: #fff;
  font-family: "Heebo", sans-serif; font-weight: 800; font-size: 13px;
  padding: 10px 12px; transition: filter .14s;
}
.report-email:hover { filter: brightness(1.08); }
.report-email .re-sub {
  font-family: "Assistant", sans-serif; font-weight: 600; font-size: 10.5px;
  opacity: 0.92; direction: ltr;
}

/* ---------- מודאל ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 3000;
  background: oklch(0.3 0.02 260 / 0.45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
}
.modal {
  width: 480px; max-width: 100%;
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  animation: pop .16s ease-out;
  max-height: calc(100dvh - 48px); overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ----- חלון "כל הארץ" ----- */
.country-modal { width: 760px; }
.country-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; }
.country-controls .chip {
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 11px; font-family: "Heebo", sans-serif; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s;
}
.country-controls .chip:hover { background: var(--line); }
.country-controls .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.country-controls .chip .chip-n { opacity: .7; font-weight: 700; }
.country-controls .chip.on .chip-n { opacity: .9; }
.country-controls .chip-sort { border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
.country-controls .chip-sort.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.country-table td.waste { font-weight: 700; color: var(--high); }
.country-search {
  flex: 1; min-width: 140px; height: 34px; border: 1px solid var(--line-strong);
  border-radius: 10px; padding: 0 10px; font-family: "Assistant", sans-serif; font-size: 14px;
  background: var(--surface); color: var(--ink);
}
.country-table { overflow-x: auto; max-height: 60dvh; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; }
.country-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.country-table thead th {
  position: sticky; top: 0; background: var(--bg); text-align: right; font-weight: 800;
  color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.country-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.country-table tbody tr:hover { background: var(--bg); }
.country-table tbody tr.clickable { cursor: pointer; }
.country-table tbody tr.clickable:hover { background: var(--brand-soft); }
.country-table .map-ico { opacity: 0; font-size: 12px; transition: opacity .12s; }
.country-table tr.clickable:hover .map-ico { opacity: .8; }
.country-table td.num { font-family: "Spline Sans Mono", monospace; white-space: nowrap; }
.country-table td.seg { line-height: 1.4; }
.country-table td.empty { text-align: center; color: var(--ink-faint); padding: 22px; }
.country-table td.report-cell { padding: 4px 6px; text-align: center; width: 1%; }
.report-flag {
  border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1;
  padding: 5px; border-radius: 8px; opacity: .55; transition: opacity .12s, background .12s;
}
.report-flag:hover { opacity: 1; background: var(--bg); }
.report-issue-modal { width: 420px; }
.report-field { display: flex; flex-direction: column; gap: 5px; margin: 12px 0; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.report-field select, .report-field textarea {
  font-family: "Assistant", sans-serif; font-size: 14px; font-weight: 500; color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 8px 10px;
  background: var(--surface); resize: vertical;
}
.report-field select:focus, .report-field textarea:focus { outline: none; border-color: var(--brand); }
.report-submit { width: 100%; margin-top: 4px; }
/* הדוח הארצי ישר בפאנל (לא בחלון) */
.country-panel { padding: 14px 16px; overflow-y: auto; }
.country-panel .modal-head { margin-bottom: 8px; }
.country-panel .modal-head h2 { font-size: 19px; }
.country-panel .country-table { max-height: none; overflow-y: visible; }
.vd { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.vd-real { background: var(--high-bg); color: var(--high); }
.vd-noise { background: var(--line); color: var(--ink-soft); }
.vd-doubt { background: var(--med-bg); color: var(--med); }
.vd-incomp { background: var(--bg); color: var(--ink-faint); }
.vd-cover { background: var(--brand-soft); color: var(--brand-ink); }
.seg-dir, .ci-dir { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.line-mkt { font-size: 10.5px; color: var(--ink-faint); }
.vd-mapdbt { background: #fef3c7; color: #92400e; }
.chip-mapdbt.on { background: #f59e0b; color: #fff; }
.osrm-flag {
  display: inline-block; margin-inline-start: 5px; font-size: 11px; font-weight: 700;
  color: var(--med); background: var(--med-bg); border-radius: 999px; padding: 1px 7px;
  white-space: nowrap; cursor: help;
}
@media (max-width: 560px) { .country-modal { width: 100%; } .country-table { font-size: 12px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h2 { font-family: "Heebo", sans-serif; font-size: 21px; font-weight: 800; margin: 0; }
.modal-head .x {
  border: 0; background: var(--surface-2); width: 32px; height: 32px; border-radius: 9px;
  font-size: 22px; line-height: 1; color: var(--ink-soft); cursor: pointer;
}
.modal-head .x:hover { background: var(--line); }
.modal-note { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; font-weight: 500; margin: 4px 0 18px; overflow-wrap: anywhere; }
.modal-note b { color: var(--ink); font-weight: 700; }
.modal-note b { overflow-wrap: anywhere; }

.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.select {
  width: 100%; height: 44px; padding: 0 12px; margin-bottom: 16px;
  border: 1.5px solid var(--line-strong); border-radius: 11px;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink);
  background: var(--surface); cursor: pointer;
}
.select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.drop {
  border: 2px dashed var(--line-strong); border-radius: 14px;
  padding: 26px; text-align: center; cursor: pointer;
  transition: border-color .14s, background .14s; margin-bottom: 18px;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop.has { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.drop-empty { color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.drop-empty .up { font-size: 30px; color: var(--ink-faint); margin-bottom: 6px; }
.drop-file { display: flex; align-items: center; gap: 13px; justify-content: center; text-align: right; min-width: 0; }
.drop-file > div { min-width: 0; }
.drop-file .zip {
  font-family: "Spline Sans Mono", monospace; font-weight: 600; font-size: 13px;
  background: var(--ok); color: white; padding: 8px 10px; border-radius: 9px;
}
.drop-file .fn { font-size: 14.5px; font-weight: 700; color: var(--ink); word-break: break-all; overflow-wrap: anywhere; }
.drop-file .fs { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.btn-primary {
  width: 100%; height: 48px; border: 0; border-radius: 12px;
  background: var(--brand); color: white; cursor: pointer;
  font-family: "Heebo", sans-serif; font-size: 16px; font-weight: 700;
  transition: filter .14s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:disabled { background: var(--line-strong); color: var(--surface); cursor: not-allowed; }

.btn-secondary {
  width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: transparent; color: var(--ink); cursor: pointer;
  font-family: "Heebo", sans-serif; font-size: 15px; font-weight: 600;
  transition: background .14s, filter .14s;
}
.btn-secondary:hover { background: var(--line); }

.progress { margin-top: 6px; }
.progress-bar { height: 10px; background: var(--surface-2); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.progress-fill { height: 100%; background: var(--brand); border-radius: 20px; transition: width .25s ease; }
.progress-text { display: flex; justify-content: space-between; margin-top: 9px; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.modal-hint { font-size: 12px; color: var(--ink-faint); text-align: center; margin: 12px 0 0; font-weight: 500; }
.trend-line { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: 6px 0 0; font-weight: 600; }
.trend-val { font-weight: 700; }
.trend-val.up { color: var(--high); }   /* עלייה בעיקופים/בזבוז = החמרה */
.trend-val.down { color: var(--ok); }   /* ירידה = שיפור */
.modal-credit {
  font-size: 12px; color: var(--ink-faint); text-align: center;
  margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  font-weight: 500;
}
.modal-credit b { color: var(--ink-soft); font-weight: 700; }
.modal-credit a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.modal-credit a:hover { text-decoration: underline; }
.job-error { margin-top: 14px; background: var(--high-bg); color: var(--high); padding: 11px 13px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }

/* ===========================================================================
   נייד — פריסה אנכית: סרגל עליון קומפקטי, מפה למעלה, פאנל גלילה למטה
   =========================================================================== */
@media (max-width: 760px) {
  /* סרגל עליון — שתי שורות, ללא דחיסת טקסט */
  .topbar {
    height: auto;
    min-height: 0;
    padding: 10px 14px;
    gap: 9px;
    flex-wrap: wrap;
  }
  .topbar .spacer { display: none; }
  .brand { flex: 1 1 auto; min-width: 0; gap: 9px; }
  .brand > div { min-width: 0; }
  .brand h1 { font-size: 18px; white-space: nowrap; }
  .brand .tag {
    font-size: 11px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .brand .glyph { width: 30px; height: 30px; flex-shrink: 0; }

  .icon-btn { width: 38px; height: 38px; font-size: 16px; }
  .upload-btn { height: 38px; padding: 0 13px; font-size: 13.5px; white-space: nowrap; }
  .map-toggle .chip { white-space: nowrap; }

  /* חיפוש — שורה שנייה, רוחב מלא */
  .search { order: 9; flex: 1 1 100%; width: 100%; }
  .search input { height: 40px; }

  /* נייד: כל הדף נגלל כמסמך אחד — לא נעילה לגובה המסך עם גלילה פנימית זעירה */
  html, body { height: auto; min-height: 100%; }
  #root { height: auto; }
  .app { height: auto; min-height: 100%; overflow: visible; }

  /* גוף — אנכי */
  .body { flex-direction: column; min-height: 0; }
  .col-resizer { display: none; }
  .map-wrap {
    order: -1;
    flex: none;
    height: 320px;
    width: 100%;
    border-bottom: 1px solid var(--line);
  }
  .panel {
    width: 100%;
    flex: none;
    min-height: 0;
    border-left: none;
    overflow: visible;
  }
  /* הכרטיסים זורמים עם הדף במקום אזור גלילה פנימי קטנטן */
  .cards { overflow: visible; flex: none; }

  /* צפיפות נוחה למגע */
  .panel-head { padding: 14px 16px 10px; }
  .panel-head .city { font-size: 21px; }
  .stats { padding: 12px 16px; gap: 8px; }
  .list-head { padding: 4px 16px 8px; }
  .cards { padding: 0 12px 16px; }

  /* מקרא — קומפקטי יותר כדי לא לכסות את המפה */
  .map-legend { top: 10px; right: 10px; padding: 9px 11px; font-size: 11.5px; }
  .map-legend .row { margin: 5px 0; gap: 7px; }
  .map-toggle { bottom: 12px; right: 10px; }

  /* בנייד מזמזמים בהצבעות — כפתורי ה-+/- מיותרים */
  .leaflet-control-zoom { display: none !important; }

  /* מודאל — צמוד לקצוות כדי שטקסט ארוך לא ייחתך */
  .modal-overlay { padding: 12px; align-items: flex-start; }
  .modal { padding: 18px; border-radius: 16px; max-height: calc(100dvh - 24px); }
  .modal-head h2 { font-size: 19px; }
  .info-modal .how { gap: 13px; }
  .modal-note, .how-row p, .modal-hint { font-size: 13px; }
}

/* מסכים צרים מאוד — מסתירים את תיאור-המשנה כדי שהכותרת לא תידחס */
@media (max-width: 420px) {
  .brand .tag { display: none; }
  .upload-btn .u-ico { display: none; }
}

/* ---------- בוררות AI ---------- */
.ai-verdict { margin-top: 9px; }
.ai-btn {
  width: 100%;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  color: var(--brand-ink);
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .14s, border-color .14s;
}
.ai-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.ai-loading {
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm);
  text-align: center;
}
.ai-err {
  font-size: 12px; font-weight: 600; color: var(--ink-faint);
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-sm);
  text-align: center;
}
/* ---------- ניתוח AI אינלייני (נפרס לרוחב הפאנל) ---------- */
.ai-analysis {
  border-radius: var(--radius); border: 1px solid var(--line);
  padding: 12px 13px; display: flex; flex-direction: column; gap: 11px;
}
.ai-analysis .aa-head { display: flex; align-items: center; gap: 9px; }
.ai-analysis .ai-verd {
  font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 20px;
  white-space: nowrap; flex-shrink: 0; color: #fff;
}
.ai-analysis .aa-title {
  font-family: "Heebo", sans-serif; font-weight: 800; font-size: 13.5px;
  color: var(--ink); flex: 1; min-width: 0;
}
.ai-analysis .ai-redo {
  border: 0; background: none; cursor: pointer; color: var(--ink-faint);
  font-size: 15px; padding: 2px 4px; border-radius: 6px; line-height: 1; flex-shrink: 0;
  transition: background .12s, color .12s;
}
.ai-analysis .ai-redo:hover { background: rgba(0,0,0,.06); color: var(--ink); }
/* רצף תחנות-הסמך (Flow Context) */
.ai-analysis .aa-flow {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; display: flex; flex-direction: column; gap: 10px;
}
.ai-analysis .aa-flow-lbl { font-size: 11px; font-weight: 800; color: var(--ink-faint); letter-spacing: .02em; }
.ai-analysis .seqrow {
  display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; align-items: start;
}
.ai-analysis .seqlbl {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.ai-analysis .seqtag {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
  background: var(--high-bg); color: oklch(0.42 0.14 25);
}
.ai-analysis .seqtag.ref { background: var(--ok-bg); color: oklch(0.40 0.10 152); }
.ai-analysis .seqchain { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ai-analysis .seqstop {
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px;
}
.ai-analysis .seqstop.core { color: var(--ink); font-weight: 800; border-color: var(--line-strong); background: var(--surface); }
.ai-analysis .seqarrow { color: var(--ink-faint); font-size: 12px; }
.ai-analysis .aa-note {
  grid-column: 1 / -1; font-size: 12px; color: oklch(0.48 0.13 55);
  font-weight: 600; line-height: 1.5; margin-top: 2px;
}
.ai-analysis .aa-reason {
  font-size: 13.5px; line-height: 1.7; font-weight: 600;
  overflow-wrap: anywhere;
}
/* גוונים לפי הכרעה */
.ai-analysis.real { background: var(--high-bg); border-color: oklch(0.85 0.07 25); }
.ai-analysis.real .ai-verd { background: var(--high); }
.ai-analysis.real .aa-reason { color: oklch(0.40 0.13 25); }
.ai-analysis.noise { background: var(--ok-bg); border-color: oklch(0.85 0.06 152); }
.ai-analysis.noise .ai-verd { background: var(--ok); }
.ai-analysis.noise .aa-reason { color: oklch(0.38 0.09 152); }
.ai-analysis.cover { background: var(--brand-soft); border-color: oklch(0.85 0.05 255); }
.ai-analysis.cover .ai-verd { background: var(--brand); }
.ai-analysis.cover .aa-reason { color: var(--brand-ink); }
.ai-analysis.doubt { background: var(--surface-2); }
.ai-analysis.doubt .ai-verd { background: var(--ink-faint); }
.ai-analysis.doubt .aa-reason { color: var(--ink-soft); }
/* "לא ניתן להשוואה" — נייטרלי-אפור, נבדל מ"כיסוי לגיטימי" (כחול) ומ"רעש" (ירוק) */
.ai-analysis.incomp { background: var(--surface-2); border-color: var(--line); border-style: dashed; }
.ai-analysis.incomp .ai-verd { background: oklch(0.55 0.02 260); }
.ai-analysis.incomp .aa-reason { color: var(--ink-soft); }
.ai-analysis .aa-merged-row.incomp .amr-verd { color: oklch(0.50 0.02 260); }
/* פאנל רחב — הטקסט נושם: שורה ארוכה יותר וגופן מעט גדול */
@media (min-width: 1000px) {
  .ai-analysis .aa-reason { font-size: 14px; line-height: 1.75; }
}

/* ---------- באנר בדיקה-לבדיקה אוטומטית ---------- */
.ai-review-bar {
  display: flex; align-items: center; gap: 9px;
  margin: 12px 16px 0; padding: 10px 13px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
}
.ai-review-bar.working { background: var(--brand-soft); color: var(--brand-ink); }
.ai-review-bar.done { background: var(--ok-bg); color: oklch(0.40 0.10 152); }
.ai-review-bar .arb-spin {
  width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid var(--brand); border-top-color: transparent;
  animation: arb-spin 0.8s linear infinite;
}
@keyframes arb-spin { to { transform: rotate(360deg); } }

/* ---------- קטע תקלות שסוננו ---------- */
/* ---------- חצי כיוון נסיעה על המסלול ---------- */
.dir-arrow {
  font-size: 12px; line-height: 14px; width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Arial", sans-serif;
  text-shadow: 0 0 2px rgba(255,255,255,.95), 0 0 2px rgba(255,255,255,.95);
  pointer-events: none; user-select: none;
}
.seg-filter {
  display: flex; gap: 6px; padding: 4px 0 10px;
}
.seg {
  flex: 1; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--ink-soft);
  padding: 7px 6px; transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap;
}
.seg:hover { border-color: var(--line-strong); }
.seg.on { background: var(--brand); border-color: var(--brand); color: #fff; }
/* קו "בספק" — מעומעם מעט אך נשאר גלוי ולחיץ ברשימה הראשית */
.card.dim { opacity: 0.66; }
.card.dim:hover, .card.dim.active { opacity: 1; }

/* ---------- קישור משרד התחבורה בתיבת ההעלאה ---------- */
.modal-note .mot-link {
  color: var(--brand, #2563eb); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px; word-break: break-all; direction: ltr;
  unicode-bidi: embed; display: inline-block;
}
.modal-note .mot-link:hover { color: var(--brand-ink, #1e40af); }

/* ---------- עיגון מדויק של תווית העיקוף מעל הנקודה (Anchor Fix) ---------- */
/* iconAnchor=0,0 ב-JS ⇒ שורש ה-marker יושב בדיוק על ה-lat/lng. התווית עצמה
   ממוקמת אבסולוטית: מרכז-אופקי (translateX -50%) ובסיסה מעט מעל הנקודה. */
.gap-pin { width: 0; height: 0; }
.gap-pin .gap-label {
  position: absolute; left: 0; bottom: 8px;
  transform: translateX(-50%);
}
/* תווית שם-תחנה קבועה — divIcon מעוגן בדיוק מעל הנקודה (כמו gap-pin), אמין
   לטקסט עברי ארוך בכל זום/מובייל (במקום tooltip קבוע שברח שמאלה). */
.stop-pin { width: 0; height: 0; }
.stop-pin .stop-name {
  position: absolute; left: 0; bottom: 9px;
  transform: translateX(-50%);
  font-family: "Assistant", sans-serif; font-size: 11px; font-weight: 700;
  color: var(--ink); background: var(--surface, #fff);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
  box-shadow: var(--shadow-sm); white-space: nowrap; pointer-events: none;
}
/* תוויות שמות-תחנות (Tooltip) — איפוס שולי-ברירת-המחדל והחץ של Leaflet כדי
   שבסיס התווית יעוגן בדיוק מעל נקודת הדגימה, בכל זום ובמובייל, בלי ריחוף. */
.leaflet-tooltip.stop-label { margin: 0; }
.leaflet-tooltip.stop-label::before { display: none !important; }

/* ---------- כרטיס באג מאוחד (Identical Bug Consolidation) ---------- */
.badge-stack { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.badge-stack .badge-line { font-size: 13px; padding: 2px 6px; }
.card.merged .card-route .op { color: var(--high); font-weight: 700; }
.ai-analysis .aa-fallback {
  font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 20px;
  background: var(--med-bg); color: oklch(0.46 0.12 60); white-space: nowrap; flex-shrink: 0;
}
.ai-analysis .aa-merged {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.ai-analysis .aa-merged-lbl { font-size: 11px; font-weight: 800; color: var(--ink-faint); letter-spacing: .02em; }
.ai-analysis .aa-merged-row {
  display: grid; grid-template-columns: max-content max-content 1fr; gap: 4px 9px;
  align-items: start; padding-top: 8px; border-top: 1px solid var(--line);
}
.ai-analysis .aa-merged-row:first-of-type { padding-top: 0; border-top: 0; }
.ai-analysis .amr-num {
  font-family: "Spline Sans Mono", monospace; font-weight: 600; font-size: 12px;
  color: #fff; padding: 1px 7px; border-radius: 6px; align-self: center;
}
.ai-analysis .amr-verd {
  font-size: 11px; font-weight: 800; align-self: center; white-space: nowrap;
}
.ai-analysis .aa-merged-row.real .amr-verd { color: var(--high); }
.ai-analysis .aa-merged-row.noise .amr-verd,
.ai-analysis .aa-merged-row.cover .amr-verd { color: oklch(0.42 0.10 152); }
.ai-analysis .aa-merged-row.doubt .amr-verd { color: var(--ink-faint); }
.ai-analysis .amr-reason {
  grid-column: 1 / -1; font-size: 12.5px; line-height: 1.55; font-weight: 600;
  color: var(--ink-soft); overflow-wrap: anywhere;
}

.ci-city { color: #64748b; font-weight: 700; font-size: 13.5px; }
.seg-city { color: #64748b; font-weight: 600; font-size: 12.5px; }

/* תוויות תחנות-הקצה של התקלה — מודגשות וקבועות (בקשת משתמש: שמות בלחיצה) */
.stop-pin .stop-name.fault-stop {
  background: #fff7ed; border: 2px solid #ea7317; color: #7c2d12;
  font-weight: 800; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
