/* =========================================================
   RunRoam — עיצוב
   ערכת צבעים אחת, שני מצבים. כל צבע מוגדר על :root ומוחלף
   בלבד בבלוקים של המצב הכהה, כך שהחלפת ערכה לא משאירה פערים.
   ========================================================= */

/* כל כלל display שאנחנו כותבים גובר על ברירת המחדל של הדפדפן
   ל-[hidden], כי שניהם באותה עדיפות מקור והשלנו יותר ספציפי. זה כבר
   הפיל שלושה אלמנטים נפרדים — פאנל ההעדפות, רצועת מזג האוויר
   ו"אפשרויות נוספות" — שכולם פשוט לא נסגרו. כלל אחד כאן סוגר את
   כל המשפחה, כולל אלמנטים שטרם נכתבו. */
[hidden] { display: none !important; }

:root {
  color-scheme: light;

  --bg:            #eef1ee;
  --surface:       #ffffff;
  --surface-2:     #f5f7f5;
  --surface-3:     #ecefec;
  --ink:           #101a15;
  --ink-2:         #45544c;
  --ink-3:         #617067;
  --line:          #dde3de;
  --line-2:        #c8d1ca;

  --accent:        #10935c;
  --accent-hot:    #0c7a4c;
  --accent-soft:   #dcf2e6;
  --accent-ink:    #ffffff;
  --action-bg:     #087e4a;
  --accent-text:   #0c7a4c;

  --amber:         #b6740c;
  --amber-soft:    #fbeed6;
  --danger:        #c2401f;
  --danger-soft:   #fbe3dc;
  --danger-ink:    #ffffff;
  --violet:        #6b4fbb;

  --route-1:       #10935c;
  --route-2:       #2f6fd0;
  --route-3:       #cc2a72;

  --shadow-sm: 0 1px 2px rgba(16, 26, 21, .06), 0 2px 6px -2px rgba(16, 26, 21, .08);
  --shadow-md: 0 2px 4px rgba(16, 26, 21, .05), 0 12px 28px -12px rgba(16, 26, 21, .22);
  --shadow-lg: 0 4px 8px rgba(16, 26, 21, .06), 0 26px 60px -22px rgba(16, 26, 21, .34);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --font: "Heebo", "Noto Sans Hebrew", "Segoe UI", system-ui, -apple-system, "Arial Hebrew", Arial, sans-serif;
  --panel-w: 396px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
  /* המצב הכהה מוגדר במלואו בשני הסלקטורים דרך המשתנים שלמטה */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #0b100d;
    --surface:     #141b17;
    --surface-2:   #1a231e;
    --surface-3:   #212b25;
    --ink:         #e9f0eb;
    --ink-2:       #a4b3aa;
    --ink-3:       #839389;
    --line:        #26312b;
    --line-2:      #364138;

    --accent:      #3fcb85;
    --accent-hot:  #5fdd9b;
    --accent-soft: #16301f;
    --accent-ink:  #06120c;
    --action-bg:   #3fcb85;
    --accent-text: #3fcb85;

    --amber:       #e5a944;
    --amber-soft:  #2e2413;
    --danger:      #f2765a;
    --danger-soft: #33190f;
    --danger-ink:  #06120c;
    --violet:      #a58ef0;

    --route-1:     #3fcb85;
    --route-2:     #6ba6f5;
    --route-3:     #ff7ab5;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 32px -14px rgba(0, 0, 0, .8);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, .5), 0 30px 70px -24px rgba(0, 0, 0, .9);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0b100d;
  --surface:     #141b17;
  --surface-2:   #1a231e;
  --surface-3:   #212b25;
  --ink:         #e9f0eb;
  --ink-2:       #a4b3aa;
  --ink-3:       #839389;
  --line:        #26312b;
  --line-2:      #364138;

  --accent:      #3fcb85;
  --accent-hot:  #5fdd9b;
  --accent-soft: #16301f;
  --accent-ink:  #06120c;
  --action-bg:   #3fcb85;
  --accent-text: #3fcb85;

  --amber:       #e5a944;
  --amber-soft:  #2e2413;
  --danger:      #f2765a;
  --danger-soft: #33190f;
  --danger-ink:  #06120c;
  --violet:      #a58ef0;

  --route-1:     #3fcb85;
  --route-2:     #6ba6f5;
  --route-3:     #ff7ab5;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, .45), 0 14px 32px -14px rgba(0, 0, 0, .8);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, .5), 0 30px 70px -24px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }

::selection { background: var(--accent-soft); color: var(--accent-hot); }

:where(button, input, a, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ===================== שלד ===================== */

.shell {
  position: fixed;
  inset: 0;
  display: grid;
  /* בעברית העמודה הראשונה היא הימנית, ולכן הלוח מקבל את צד הפתיחה של הקריאה */
  grid-template-columns: var(--panel-w) 1fr;
  grid-template-rows: 1fr;
}

.map {
  grid-column: 2;
  grid-row: 1;
  height: 100%;
  background: var(--surface-2);
  z-index: 1;
}

.leaflet-container { font-family: var(--font); background: var(--surface-2); }
.leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 94%, transparent) !important;
  color: var(--ink-2) !important;
  font-size: 10px !important;
  backdrop-filter: blur(6px);
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-bar a {
  background: var(--surface) !important;
  color: var(--ink) !important;
  border-color: var(--line) !important;
}
.leaflet-bar a:hover { background: var(--surface-2) !important; }

/* ===================== כלי מפה ===================== */

.map-tools {
  position: absolute;
  z-index: 400;
  top: 16px;
  /* הלוח יושב בקצה הימני ומעלינו ב-z-index, ולכן מרחק של 16 פיקסלים
     מקצה המסך היה מחביא את הכפתורים לגמרי מתחתיו. נעגנים לקצה הלוח
     כדי להישאר בתוך שטח המפה. ‏(ה-media query של מובייל דורס את זה,
     שם הלוח הוא גיליון תחתון ברוחב מלא.) */
  right: calc(var(--panel-w) + 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background .15s var(--ease), transform .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.is-unavailable { opacity: .55; }
.fit-balloon {
  position: fixed;
  z-index: 2000;
  max-width: min(260px, calc(100vw - 16px));
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.fit-balloon::after {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--tail-x, 50%);
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
}
.icon-btn svg {
  width: 19px; height: 19px;
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#btn-theme .i-moon { display: none; }
:root[data-theme="dark"] #btn-theme .i-sun { display: none; }
:root[data-theme="dark"] #btn-theme .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #btn-theme .i-sun { display: none; }
  :root:not([data-theme="light"]) #btn-theme .i-moon { display: block; }
}

.map-hint {
  position: absolute;
  z-index: 400;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: drop .3s var(--ease);
  pointer-events: none;
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ===================== לוח ===================== */

.panel {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  min-height: 0;
  z-index: 500;
  box-shadow: var(--shadow-lg);
}

.panel-grip { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(150deg, var(--accent), var(--accent-hot));
  box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--accent) 55%, transparent);
  flex: none;
}
.brand-mark svg {
  width: 23px; height: 23px;
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.brand-mark circle { fill: var(--accent-ink); stroke: none; }
.brand-text h1 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.brand-text p { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.panel-scroll::-webkit-scrollbar { width: 9px; }
.panel-scroll::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 99px;
  border: 3px solid var(--surface);
}

.block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.block:last-of-type { border-bottom: 0; }

.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.block-head h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.muted { color: var(--ink-3); font-size: 12px; }

/* ===================== שדות ===================== */

.field { position: relative; }
.field + .field { margin-top: 12px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}
.input-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 10px 4px 10px 10px;
  font-size: 14px;
  outline: none;
}
.input-wrap input::placeholder { color: var(--ink-3); }

.pin {
  width: 11px; height: 11px;
  border-radius: 50%;
  margin-inline-start: 12px;
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}
.pin-start { background: var(--accent); color: var(--accent); }
.pin-end { background: var(--danger); color: var(--danger); }

.clear-btn {
  border: 0; background: none;
  color: var(--ink-3);
  font-size: 19px; line-height: 1;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.clear-btn:hover { color: var(--ink); }

.plain {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s var(--ease);
}
.plain:focus { border-color: var(--accent); background: var(--surface); }

/* שדה התאריך רחב מהותית משדה הקצב: הוא נושא תאריך מלא ושעה, ובגופן
   גיבוי (כשה-CDN של הגופן חסום) הוא רחב עוד יותר ונחתך באמצע. חלוקה
   לא שווה של השורה נותנת לו את המקום שהוא באמת צריך. */
.duo { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 12px; }
#input-time { font-size: 13px; padding-inline: 8px; }
/* בלי זה פריט גריד לא מוכן להתכווץ מתחת לרוחב התוכן שלו, ושדה התאריך
   מרחיב את העמודה שלו על חשבון השכנה עד כדי חפיפה. */
.duo > * { min-width: 0; }
.duo input, .duo .plain, .duo .pace-wrap { width: 100%; box-sizing: border-box; }
.pace-wrap { position: relative; display: flex; align-items: center; }
.pace-wrap .plain { padding-inline-end: 48px; }
.unit-inline {
  position: absolute;
  inset-inline-end: 12px;
  font-size: 12px;
  color: var(--ink-3);
  pointer-events: none;
}

/* ---- השלמה אוטומטית ---- */

.suggest {
  position: absolute;
  z-index: 60;
  top: calc(100% + 5px);
  inset-inline: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
}
.suggest button {
  display: block;
  width: 100%;
  text-align: start;
  border: 0;
  background: none;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.on { background: var(--accent-soft); }
.suggest .s-name { font-size: 13.5px; font-weight: 600; display: block; }
.suggest .s-ctx { font-size: 11.5px; color: var(--ink-3); display: block; }
.suggest .s-empty { padding: 12px; font-size: 13px; color: var(--ink-3); text-align: center; }

/* ---- מתג ---- */

.loop-row { margin-top: 12px; }
.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 38px; height: 22px;
  border-radius: 99px;
  background: var(--line-2);
  position: relative;
  flex: none;
  transition: background .2s var(--ease);
}
.switch-thumb {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(-16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-size: 13px; color: var(--ink-2); }
.switch.compact .switch-label { font-size: 12.5px; }

/* ===================== מרחק ===================== */

.distance-readout {
  display: flex;
  align-items: baseline;
  gap: 4px;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 3px 10px;
}
.distance-readout:focus-within { border-color: var(--accent); }
.distance-readout input {
  width: 58px;
  border: 0; background: none; outline: none;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  text-align: end;
  padding: 2px 0;
}
.distance-readout input::-webkit-outer-spin-button,
.distance-readout input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.distance-readout input { -moz-appearance: textfield; }
.distance-readout .unit { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* המחוון עצמו גבוה כדי שאפשר יהיה לתפוס אותו באצבע; מה שנראה כפס דק
   הוא המסילה שמצוירת בתוכו. קודם גובה האלמנט היה חמישה פיקסלים — כלומר
   שטח המגע היה חמישה פיקסלים — והידית רק גלשה מעליו ויזואלית. בטלפון
   זה אומר שכל גרירה מתחילה בפספוס. */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  background: none;
  outline: none;
  margin: 0;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}
.slider::-moz-range-track {
  height: 5px;
  border-radius: 99px;
  background: var(--line);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px; height: 19px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform .12s var(--ease);
}
.slider::-webkit-slider-thumb:active { transform: scale(1.15); cursor: grabbing; }
.slider::-moz-range-thumb {
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--surface);
  border: 2.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.slider.slim { height: 26px; }
.slider.slim::-webkit-slider-runnable-track { height: 4px; }
.slider.slim::-moz-range-track { height: 4px; }
.slider.slim::-webkit-slider-thumb { width: 15px; height: 15px; border-width: 2px; margin-top: -5.5px; }
.slider.slim::-moz-range-thumb { width: 15px; height: 15px; border-width: 2px; }

/* סימוני חלוקה מתחת לסרגל — מראים לאן מושכים וכמה. */
.ticks {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  /* המחוון גבוה מהמסילה שנראית בתוכו, ולכן הסימונים נמשכים כלפי מעלה */
  margin-top: -8px;
  /* ריפוד של חצי רוחב הידית, כדי שהסימון הקיצוני יעמוד בדיוק מול קצה הטווח */
  padding: 0 7px;
  margin-top: 3px;
  pointer-events: none;
}
.ticks i {
  width: 1.5px;
  height: 5px;
  border-radius: 1px;
  /* צבע המסילה עצמה חלש מדי כדי לשמש סימון — צריך ניגוד מול הרקע. */
  background: var(--ink-3);
  opacity: .45;
}
.ticks i.major { height: 8px; opacity: .8; }
.pref-ends { margin-top: 3px; }

.chips {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.chips button {
  flex: 1;
  min-width: 44px;
  padding: 6px 4px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .14s var(--ease);
}
.chips button:hover { border-color: var(--line-2); color: var(--ink); }
.chips button.on {
  background: var(--accent-hot);
  border-color: var(--accent-hot);
  color: var(--accent-ink);
}

/* ===================== העדפות ===================== */

.disclosure {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: start;
}
.disclosure > span:first-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.disclosure-meta {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--accent-hot);
  font-weight: 600;
}
.disclosure svg {
  width: 16px; height: 16px;
  fill: none; stroke: var(--ink-3);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .2s var(--ease);
}
.disclosure[aria-expanded="true"] svg { transform: rotate(180deg); }

.prefs { padding-top: 6px; display: grid; gap: 14px; }
/* כלל display סתם, בלי תנאי, מנצח את ברירת המחדל של הדפדפן ל-hidden
   בכל מקרה — מוצא (author) גובר על מוצא (user-agent) בקסקדה בלי קשר
   לספציפיות. בלי השורה הבאה הפאנל לא יכול היה להיסגר אף פעם: ה-JS
   כן החליף את התכונה כמו שצריך, אבל שום דבר לא הגיב לזה חזותית. */
.pref-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.pref-head label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.pref-head output { font-size: 11.5px; color: var(--accent-text); font-weight: 600; }
.pref-ends {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

/* ===================== כפתור ראשי ===================== */

.cta {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  border: 0;
  border-radius: var(--r-md);
  background: linear-gradient(165deg, var(--action-bg), var(--accent-hot));
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 14px -3px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), filter .15s var(--ease);
}
.cta:hover { filter: brightness(1.06); box-shadow: 0 4px 20px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.cta:active { transform: translateY(1px); }
.cta:disabled { opacity: .6; cursor: progress; }
.cta-spinner {
  position: absolute;
  inset-inline-end: 16px;
  top: 50%;
  margin-top: -8px;
  width: 16px; height: 16px;
  border: 2px solid color-mix(in srgb, var(--accent-ink) 35%, transparent);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  display: none;
}
.cta.loading .cta-spinner { display: block; animation: spin .7s linear infinite; }

.status {
  margin-top: 10px;
  font-size: 12.5px;
  min-height: 18px;
  color: var(--ink-3);
  text-align: center;
}
.status.error { color: var(--danger); font-weight: 600; }

/* ===================== מזג אוויר ===================== */

.weather { display: grid; gap: 10px; }  /* אותו תיקון בדיוק — ראה הערה ליד .prefs. */
.wx-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.wx-temp {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.wx-meta { flex: 1; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.wx-meta b { color: var(--ink-2); font-weight: 600; }
.wx-sun { text-align: end; font-size: 11px; color: var(--ink-3); line-height: 1.5; white-space: nowrap; }

.tip {
  display: flex;
  gap: 9px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.45;
  border-inline-start: 3px solid;
}
.tip b { display: block; font-size: 12.5px; }
.tip.info { background: var(--accent-soft); border-color: var(--accent); color: var(--ink-2); }
.tip.info b { color: var(--accent-hot); }
.tip.warn { background: var(--amber-soft); border-color: var(--amber); color: var(--ink-2); }
.tip.warn b { color: var(--amber); }

/* ===================== כרטיסי מסלול ===================== */

.results { padding-top: 16px; border-top: 1px solid var(--line); }
.block-head.sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  padding-block: 6px 8px;
  margin: 0;
}

.route-safety-intro, .route-safety-notice {
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  border-radius: var(--r-md);
  background: var(--amber-soft);
  color: var(--ink);
  line-height: 1.55;
  font-size: 12.5px;
  padding: 9px 11px;
  margin: 0 0 11px;
}
.route-safety-notice { font-size: 13px; margin-top: 10px; }

.route-card {
  display: block;
  width: 100%;
  text-align: start;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 13px 14px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.route-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.route-card.on {
  border-color: var(--rc, var(--accent));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc, var(--accent)) 14%, transparent);
}

.rc-top { display: flex; align-items: center; gap: 9px; }
.rc-swatch {
  width: 9px;
  height: 26px;
  border-radius: 99px;
  background: var(--rc, var(--accent));
  flex: none;
}
.rc-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; flex: 1; }
/* מה שמשותף לכל האפשרויות נאמר פעם אחת מעליהן, כדי שהכרטיס עצמו
   יוכל להתמסר להבדל. */
.rc-shared {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ההבדל מול המסלול המוביל — הסיבה היחידה לבחור כרטיס אחר מהראשון. */
.rc-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--rc, var(--accent-hot));
  font-variant-numeric: tabular-nums;
}

.rc-stats {
  display: flex;
  gap: 16px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.rc-stat { line-height: 1.25; }
.rc-stat b {
  display: block;
  direction: ltr;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.rc-stat span { font-size: 10.5px; color: var(--ink-3); }

/* נקודות הקושי: האחרונה מתמלאת חלקית, כדי ש-3.4 ו-3.1 ייראו שונה. */
.rc-stat b.dots { display: flex; gap: 3px; align-items: center; height: 16px; }
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(to left, var(--ink) var(--fill), color-mix(in srgb, var(--ink) 18%, transparent) var(--fill));
}

.rc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag.alert { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
/* חפיפה לריצות קודמות: לא אזהרה ולא שבח — עובדה שכדאי לדעת לפני שבוחרים. */
.tag.warn { background: var(--surface-3); color: var(--ink-2); border-color: transparent; }
.tag.good { background: var(--accent-soft); color: var(--accent-hot); border-color: transparent; }

/* ===================== פירוט ===================== */

.detail { padding-top: 16px; border-top: 1px solid var(--line); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 14px;
}
.stat-cell { background: var(--surface); padding: 10px 8px; text-align: center; }
.stat-cell b {
  display: block;
  direction: ltr;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-cell span { font-size: 10.5px; color: var(--ink-3); }
.stat-note { margin: 6px 2px 0; font-size: 11px; line-height: 1.5; color: var(--ink-3); }
.stat-grid > .stat-cell:last-child:nth-child(3n+1) { grid-column: 1 / -1; }

.chart {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 10px 4px;
  margin-bottom: 14px;
}
/* שבוע שלם. */
.cta.secondary {
  margin-top: 8px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
}
.cta.secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-hot); }

.week-row {
  /* שתי שורות: היום והמרחק למעלה, מבנה האימון והקצב מתחת. "‏7.4 ק"מ"
     הוא מרחק ולא אימון, ובלי השורה השנייה זו רשימה ולא תוכנית. */
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 2px 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 6px;
  font: inherit;
  text-align: start;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.week-row:hover:not(:disabled) { border-color: var(--accent); }
.week-row.waiting { cursor: default; opacity: .7; }
.week-day { font-size: 13px; font-weight: 700; color: var(--ink); min-width: 46px; }
.week-kind { font-size: 12.5px; color: var(--ink-2); flex: 1; }
.week-state { font-size: 12.5px; font-weight: 700; color: var(--accent-hot); font-variant-numeric: tabular-nums; }
.week-state.pending { color: var(--ink-3); font-weight: 400; }
.week-state.bad { color: var(--danger-ink); font-weight: 400; }
.week-state.rest { color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.week-detail {
  grid-column: 1 / -1;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.week-row.is-rest {
  background: transparent;
  border-style: dashed;
  cursor: default;
}
.week-row.is-rest .week-day,
.week-row.is-rest .week-kind { color: var(--ink-3); font-weight: 500; }

/* המסלולים שלי — היסטוריה מקומית. */
.history-note { margin: 10px 0 0; font-size: 11px; color: var(--ink-3); }
.link-btn {
  font: inherit;
  font-size: 12px;
  color: var(--ink-3);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}
.link-btn:hover { color: var(--accent-hot); }
.hist-row { display: flex; align-items: stretch; gap: 6px; margin-bottom: 6px; }
.hist-open {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  text-align: start;
  font: inherit;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.hist-open:hover { border-color: var(--accent); }
.hist-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.hist-meta { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hist-remove {
  padding: 0 10px;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-3);
  background: none;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
}
.hist-remove:hover { color: var(--danger-ink); border-color: var(--danger-ink); }

/* ברזיות: על המפה ובשורה שמתחת לנתונים. */
.marker-water {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2f8fd0;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
.water-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.water-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f8fd0;
  flex: none;
}

/* כפתור הכניסה לניווט הקולי — הראשון שרואים בפירוט המסלול. */
.run-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  margin-bottom: 14px;
  font: inherit;
  font-size: 15.5px;
  font-weight: 800;
  color: #06120c;
  background: linear-gradient(165deg, #3fcb85, #2fa96c);
  border: none;
  border-radius: 14px;
  cursor: pointer;
}
.run-cta:hover:not(:disabled) { filter: brightness(1.05); }
.run-cta:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.run-cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* התאמת אורך על המסלול הנבחר. */
.tweak {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.tweak span { font-size: 11.5px; color: var(--ink-3); margin-inline-end: auto; }
.tweak button {
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.tweak button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-hot); }
.tweak button:disabled { opacity: .45; cursor: default; }

/* כשל בהעשרה: נאמר בפירוש מה חסר ומה עדיין תקף, במקום מקף שקט. */
.notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent-hot);
  border-radius: 10px;
}

.chart-empty p {
  margin: 0;
  padding: 18px 12px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.chart-head h3 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.chart-head span { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; direction: ltr; }
.chart svg { display: block; width: 100%; height: 92px; overflow: visible; }
.chart-cursor { font-size: 11px; color: var(--ink-2); text-align: center; padding: 4px 0 2px; min-height: 20px; font-variant-numeric: tabular-nums; direction: rtl; }

/* ---- פסי הרכב ---- */
.compo { margin-bottom: 14px; }
.compo h3 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
/* שורת החזרות, גלויה רק באימון אינטרוולים. */
.reps {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.reps label,
.reps .reps-label { font-size: 12px; color: var(--ink-3); }
.reps .chips { margin: 0; }
.reps output { font-size: 12px; color: var(--accent-hot); font-weight: 600; width: 100%; }

/* בורר סוג האימון. הצ'יפים יושבים מעל המחוונים כי הם מזיזים אותם,
   וההסבר מתחתם אומר למה נבחר מה שנבחר. */
.workouts { margin-bottom: 8px; }
/* חמישה צ'יפים שחולקים שורה שווה בשווה חתכו את "התאוששות" באייפון.
   כאן הרוחב נקבע לפי המילה, והשורה נשברת כשצריך במקום לגזום. */
.workouts button {
  flex: 0 1 auto;
  padding-inline: 10px;
  white-space: nowrap;
}
.workout-state {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.workout-hint {
  margin: 0;
  min-height: 16px;
  font-size: 12px;
  color: var(--ink-3);
}
.workout-clear {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--ink-3);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  /* יעד לאגודל, לא לעכבר */
  min-height: 32px;
}
.workout-clear:hover { color: var(--ink); border-color: var(--line-2); }

.compo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; gap: 10px; }
.compo-toggle { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); cursor: pointer; }
.compo-toggle input { accent-color: var(--accent); }
/* הנתון הכי שימושי במסך היה מוצג ברצועה בעובי כמה פיקסלים, והמקרא
   ישב מתחתיה במרחק. עכשיו היא מספיק עבה כדי לשאת את האחוזים בתוכה. */
.compo-bar {
  display: flex;
  height: 28px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-3);
}
.compo-bar i {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  overflow: hidden;
  font-size: 11px;
  font-weight: 700;
  font-style: normal;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  font-variant-numeric: tabular-nums;
}
.compo-key { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.compo-key div { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
.compo-key i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.compo-key b { font-variant-numeric: tabular-nums; color: var(--ink); }
.compo-note { margin: 7px 0 0; font-size: 11.5px; color: var(--ink-3); }

.status .retry {
  margin-inline-start: 6px;
  padding: 3px 10px;
  font: inherit;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--action-bg);
  border: 0;
  border-radius: 99px;
  cursor: pointer;
}

/* מקרא סקאלת המדרון, מתחת לגרף הגובה. */
.grade-key {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 10px;
  color: var(--ink-3);
}
.grade-key span { display: flex; align-items: center; gap: 4px; }
.grade-key span:last-child { margin-inline-start: auto; }
.grade-key i { width: 14px; height: 4px; border-radius: 2px; }

/* גרף גובה זעיר על הכרטיס, כדי שאפשר יהיה להשוות בין שלוש אפשרויות
   בלי ללחוץ על כל אחת בתורה. */
.rc-spark {
  margin-top: 9px;
  height: 26px;
}
.rc-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* ---- ייצוא ---- */
.export-more { margin-top: 8px; }
.export-more .export-grid { margin-top: 7px; }


.export h3 { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; align-items: stretch; }
.export-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .14s var(--ease);
}
.export-btn:hover { border-color: var(--accent); background: var(--surface); }
.export-btn.primary {
  grid-column: 1 / -1;
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.export-btn.primary:hover { filter: brightness(1.15); }
.export-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* הקישור למדריך יושב בין רשת הייצוא לבין הערת המגבלות, כי זה הרגע
   שבו מסתכלים על שבעה כפתורים ולא יודעים באיזה ללחוץ. */
.export-guide {
  display: grid;
  grid-template-columns: 20px 1fr 16px;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.5;
  text-decoration: none;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.export-guide:hover { border-color: var(--accent); background: var(--accent-soft); }
.export-guide b { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink); }
.export-guide svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.export-guide .guide-fwd { width: 16px; height: 16px; stroke: var(--ink-3); stroke-width: 2.2; }

.export-note { font-size: 11px; color: var(--ink-3); margin-top: 8px; line-height: 1.5; }

/* ---- הוראות ---- */
.dirs { margin-top: 14px; }
.dirs ol { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.dirs li {
  display: flex;
  gap: 9px;
  align-items: baseline;
  padding: 7px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.dirs li:last-child { border-bottom: 0; }
.dir-turn { color: var(--ink-2); flex: none; font-weight: 600; }
.dir-street { flex: 1; color: var(--ink); }
.dir-street i { font-style: normal; color: var(--ink-3); }

/* גרסה דקה של כפתור הפתיחה, לשימוש בתוך מקטע ולא ככותרת שלו. */
.disclosure.slim {
  width: 100%;
  padding: 7px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  background: none;
  border: 0;
}
.dir-dist { color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; font-size: 11.5px; }

.credits {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.6;
}
.credits a { color: var(--ink-2); }

/* הבקשה למשוב היא הסיבה שהמוצר יוצא לאוויר עכשיו, ולכן היא לא
   מתחבאת בגודל 11 פיקסל עם שאר הקרדיטים. */
.credits-ask {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--accent-soft);
  border-radius: var(--r-md);
  padding: 11px 13px;
  margin-bottom: 12px;
}
.credits-ask strong { color: var(--ink); }
.credits-ask a { color: var(--accent-hot); font-weight: 600; text-decoration: underline; }

/* צמוד להודעת שגיאה: הרגע היחיד שבו המשתמש יודע משהו שאנחנו לא. */
.report-problem {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===================== סמני מפה ===================== */

.marker-pin {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  display: grid;
  place-items: center;
}
.marker-pin b {
  transform: rotate(45deg);
  font-size: 11px;
  font-weight: 800;
}
/* לבן על ‏--accent שטוח לא עובר AA בשום ערכת נושא (3.93:1 בהיר, 2.08:1 כהה) —
   דיו כהה קבוע כן, בשתי הערכות. */
.marker-start b { color: #06120c; }
.marker-end b { color: var(--danger-ink); }
.marker-start { background: var(--accent); }
.marker-end { background: var(--danger); }
/* הנקודה שממנה נבנו המסלולים שמוצגים, כשהסמן החי כבר זז ממנה */
.marker-ghost {
  background: transparent;
  border-style: dashed;
  border-color: var(--accent);
  box-shadow: none;
  opacity: .85;
}
.marker-ghost b { color: var(--accent-text); }

/* קווים ששייכים לנקודת התחלה קודמת — נשארים, אבל לא מתחזים לעדכניים */
.map-stale .leaflet-overlay-pane { opacity: .32; }
.map-stale .marker-km { opacity: .4; }

.stale-note {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--amber) 55%, transparent);
  border-radius: var(--r-md);
  background: var(--amber-soft);
}
.stale-note p { margin: 0 0 10px; font-size: 13px; line-height: 1.45; }
.stale-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stale-actions button {
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
}
.stale-actions button:first-child {
  background: var(--action-bg);
  color: var(--accent-ink);
  border-color: transparent;
}
.marker-km {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--rc, var(--accent));
  display: grid; place-items: center;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.cursor-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 6px rgba(0,0,0,.4);
}

/* ===================== רספונסיבי ===================== */

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; }
  .map { grid-column: 1; grid-row: 1; }

  .panel {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    align-self: end;
    /* הגובה והתקרה מנוהלים בפיקסלים (bindSheet): יחידות חלון חיות
       (vh/dvh) משתנות כשהמקלדת נפתחת בדפדפנים שמכווצים את החלון —
       Samsung Internet, WebView של וואטסאפ/פייסבוק, פיירפוקס — והגיליון
       היה מתקפל לחצי בכל הקשה על שדה. dvh נשאר רק כברירת מחדל לפני
       שה-JS רץ: בספארי בנייד ‎100vh גבוה מהחלון בגובה סרגל הכתובת. */
    max-height: var(--sheet-max, 100dvh);
    height: var(--sheet-h, 46vh);
    border-inline-end: 0;
    border-top: 1px solid var(--line);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transition: height .28s var(--ease);
  }
  /* תוך כדי גרירה אין הנפשה — אחרת הגיליון רודף אחרי האצבע באיחור
     של ‎.28s, וזו הסיבה שהוא הרגיש כאילו אי אפשר לתפוס אותו. */
  .panel.dragging { transition: none; }
  .panel.full { border-radius: 0; border-top-color: transparent; }

  /* iOS מזכיר את עצמו בכל מקד שמתחת ל-16px: מזיז את כל הדף בזום
     אוטומטי על פוקוס, וכל הקשה אחרי זה "קופצת". 16px בלוח בנייד —
     זו הבעיה, והתיקון הוא הגודל, לא חסימת הזום (maximum-scale פוגע
     בנגישות). */
  .panel input:not([type="checkbox"]):not([type="range"]):not([type="radio"]),
  .panel textarea,
  .panel select {
    font-size: 16px;
  }

  .panel-grip {
    display: block;
    padding: 13px 0 7px;
    cursor: grab;
    touch-action: none;
    flex: none;
  }
  .panel-grip span {
    display: block;
    width: 46px; height: 5px;
    margin: 0 auto;
    border-radius: 99px;
    background: var(--line-2);
  }
  .panel.dragging .panel-grip { cursor: grabbing; }
  .panel.dragging .panel-grip span { background: var(--accent); }
  /* הכותרת היא המשך הידית: יחד זה יעד אחיזה שאפשר לפגוע בו באגודל */
  .brand { padding: 8px 18px 12px; touch-action: none; cursor: grab; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .panel-scroll { padding: 4px 18px 30px; }
  .map-tools { top: auto; bottom: calc(var(--sheet-h, 46vh) + 14px); right: 14px; flex-direction: row; }
  /* כפתור התפריט עובר לפינה הימנית העליונה — יציאה קבועה מהשורה התחתונה */
  #btn-menu { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); right: 10px; z-index: 460; }
  /* באנגלית (LTR) הכפתור עובר שמאלה, באותו צד שהתפריט נפתח, ולא מתנגש בכפתור החזרה שבצד ימין */
  [dir="ltr"] #btn-menu { right: auto; left: 10px; }
  /* מתחת לכפתור התפריט ולכפתורי מצב התוצאות, כדי שלא יסתירו את פקד הזום */
  .leaflet-top.leaflet-left { top: calc(env(safe-area-inset-top, 0px) + 62px); }
  .export-grid { grid-template-columns: 1fr; }
  /* בספארי אמיתי ל-datetime-local יש רוחב טבעי רחב בהרבה מכרום —
     הפורמט המקומי כולל שם חודש מלא ("6 בספט' 2026"), ו-min-width:0
     על תא הגריד לא כופה על הבקרה המקורית להצטמצם. שני השדות היו
     חופפים באייפון גם אחרי שהתיקון הקודם עבד ב-Chromium. הפתרון
     שלא תלוי בניחוש הרוחב המדויק: כל שדה מקבל שורה משלו. */
  .duo { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* מספרים עם סימן או יחידה לועזית נשארים בכיוון לטיני בתוך טקסט עברי */
.export-btn { text-align: start; line-height: 1.35; }
.copy-label { display: inline-block; }

/* ===================== רשימת תפוצה ===================== */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.subscribe {
  margin-top: 22px;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.subscribe-lede {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 11px;
}
.subscribe-lede strong { color: var(--ink); }

.subscribe-form { display: flex; gap: 8px; }
.subscribe-form input {
  flex: 1;
  min-width: 0;              /* בלי זה השדה דוחף את הכפתור מחוץ למסך צר */
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
}
.subscribe-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.subscribe-form button {
  flex: none;
  padding: 9px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--action-bg);
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
}
.subscribe-form button:hover { background: var(--accent-hot); }
.subscribe-form button:disabled { opacity: .6; cursor: default; }

.subscribe-note {
  margin-top: 9px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}
.subscribe-status:not(:empty) { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.subscribe-status.error { color: var(--danger); font-weight: 600; }
.subscribe-done { font-size: 13.5px; font-weight: 600; color: var(--accent-hot); }

/* במסך צר השדה והכפתור נדחסים; עדיף שתי שורות מאשר כפתור חתוך */
@media (max-width: 380px) {
  .subscribe-form { flex-wrap: wrap; }
  .subscribe-form button { width: 100%; }
}

/* ===================== תמיכה ===================== */

/* קישור, לא ווידג'ט צף. הוא יושב בשובל ליד שאר הקרדיטים ולא
   מתחרה בשום דבר — מי שלא לוחץ מקבל בדיוק את אותו מוצר. */
.support-note {
  margin-top: 8px;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--ink-3);
}
.support-link {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.location-quality { margin: 8px 0 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; line-height: 1.6; }

.route-intent label,.intent-head strong { font-size:12px; font-weight:600; }
.intent-head { display:flex;align-items:center;justify-content:space-between;margin:14px 0 10px; }
.intent-head button,.via-item button { border:0;background:none;color:var(--accent-text);font:inherit;font-size:12px;padding:4px; }
.intent-help { font-size:11px;color:var(--ink-3);line-height:1.7;margin:8px 0 14px; }
#route-note { width:100%;box-sizing:border-box;resize:vertical;min-height:72px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);color:var(--ink);padding:12px;font:inherit;font-size:13px;margin-top:8px; }
.via-item { display:flex;gap:9px;align-items:center;padding:10px;background:var(--surface-2);border:1px solid var(--line);border-radius:12px;margin-bottom:7px;font-size:12px; }
.via-item .via-label { flex:1;text-align:right; }
.via-number { background:var(--action-bg);color:var(--accent-ink);width:22px;height:22px;border-radius:50%;display:grid;place-items:center; }

/* Explicit place search avoids requests on every keystroke. */
.point-search { display: block; margin-top: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--accent-text); font: inherit; font-size: 12px; cursor: pointer; }
.point-search:disabled { opacity: .65; cursor: wait; }

.avoidance-alternative{display:block;width:100%;min-height:44px;white-space:normal;padding:12px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;cursor:pointer;margin-bottom:12px}

/* Language switch (i18n) */
.lang-switch{box-sizing:border-box;position:absolute;top:10px;inset-inline-start:10px;z-index:60;direction:ltr;
  padding:7px 14px;border-radius:999px;border:1px solid rgba(18,60,45,.35);background:rgba(247,244,235,.92);
  color:#123c2d;font:inherit;font-size:13px;line-height:1;cursor:pointer;white-space:nowrap}
.lang-switch:hover{background:#f7f4eb}
.lang-switch:focus-visible{outline:3px solid #cce6ae;outline-offset:2px}
header.top,.hero{position:relative}

/* ===================== חלונות צד (היסטוריה / צור קשר) ===================== */
.sheet-win { position: fixed; inset: 0; z-index: 1280; background: rgba(6,18,12,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-win[hidden] { display: none; }
.sheet-win-panel { background: var(--surface, #fff); color: var(--ink, #123c2d); width: min(560px, 100%); max-height: min(88dvh, 100%); display: flex; flex-direction: column; border-radius: 16px 16px 0 0; font: 15px Arial, sans-serif; box-shadow: 0 -8px 40px rgba(6,18,12,.35); }
.sheet-win-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line, #e3e9e3); }
.sheet-win-head h2 { font-size: 17px; margin: 0; flex: 1; }
.sheet-win-close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted, #4c6b5c); cursor: pointer; padding: 2px 8px; }
.sheet-win-body { overflow-y: auto; padding: 12px 18px 22px; }
.sheet-win-body .history { margin: 0; }
.history-empty { color: var(--muted, #4c6b5c); font-size: 14px; text-align: center; padding: 18px 0; }
.contact-lede { font-size: 14px; line-height: 1.6; }
.contact-lede a { color: #087e4a; font-weight: 600; }
@media (min-width: 901px) {
  .sheet-win { align-items: center; }
  .sheet-win-panel { border-radius: 16px; max-height: 80vh; }
}

/* ---- עוד אפשרויות ---- */
#more-options-toggle { display: flex; align-items: center; gap: 6px; width: 100%; margin: 10px 0 0; padding: 11px 4px; background: none; border: none; border-top: 1px solid var(--line, #e3e9e3); color: #087e4a; font: 600 14px Arial, sans-serif; cursor: pointer; text-align: start; }
#more-options-toggle .chev { transition: transform .15s; font-size: 12px; }
#more-options-toggle.open .chev { transform: rotate(180deg); }
.submenu-toggle { display: flex; align-items: center; gap: 6px; width: 100%; margin: 2px 0 0; padding: 9px 4px; background: none; border: none; border-top: 1px dashed var(--line, #e3e9e3); color: #087e4a; font: 600 13.5px Arial, sans-serif; cursor: pointer; text-align: start; }
.submenu-toggle .chev { transition: transform .15s; font-size: 12px; }
.submenu-toggle.open .chev { transform: rotate(180deg); }
.submenu-body { padding-bottom: 4px; }
.submenu:first-child .submenu-toggle { border-top: none; }

/* Parent options and nested groups have distinct surfaces and indentation. */
#more-options-toggle { background:var(--accent-soft); color:var(--ink); border:1px solid var(--line-2); border-radius:var(--r-md); padding:12px; font-weight:700; }
#more-options { margin:10px 0 12px; padding-inline-start:12px; border-inline-start:3px solid var(--accent); }
#more-options .submenu { margin:8px 0; border:1px solid var(--line); border-radius:var(--r-md); overflow:hidden; background:var(--surface); }
#more-options .submenu-toggle { margin:0; padding:12px; border:0; color:var(--ink-2); background:var(--surface-2); font-weight:600; }
#more-options .submenu-toggle.open { color:var(--ink); background:var(--surface-3); }
#more-options .submenu-body { padding:0 10px 8px; }
.timing-clear { margin-top:6px; padding:7px 10px; border:1px solid var(--line-2); border-radius:var(--r-sm); background:var(--surface-2); color:var(--ink-2); font:inherit; font-size:12px; cursor:pointer; }

/* The optional analytics choice occupies its own strip, not the builder. */
body.rr-consent-open .shell { bottom: var(--rr-consent-space, 184px); }
body.rr-consent-open #auth-screen { bottom: var(--rr-consent-space, 184px); padding-bottom:24px; }
body.rr-consent-open .sheet-win { bottom: var(--rr-consent-space, 184px); }
@media (max-width:900px) {
  body.rr-consent-open .panel { max-height:calc(var(--sheet-max,100dvh) - var(--rr-consent-space,184px)); }
  body.rr-consent-open .map-tools { bottom:calc(min(var(--sheet-h,46vh),calc(var(--sheet-max,100dvh) - var(--rr-consent-space,184px))) + 14px); }
}

/* נקודת חובה: כתובת קודם, מפה כאפשרות משנית */
.via-search { display:flex;gap:8px;margin:0 0 8px; }
.via-search input { flex:1;min-width:0;height:44px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font:inherit;font-size:14px;color:inherit; }
.via-search button { flex:none;height:44px;padding:0 16px;border:0;border-radius:12px;background:var(--action-bg);color:var(--accent-ink);font:inherit;font-size:13px;font-weight:600; }
#via-suggestions { margin:0 0 8px; }
.via-map-link { border:0;background:none;color:var(--accent-text);font:inherit;font-size:12px;padding:6px 0;margin-bottom:6px; }

.drawer-lang { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid var(--line); }
.drawer-lang label { font-size:14px;font-weight:600; }
.drawer-lang select { min-width:130px;height:44px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font:inherit;font-size:14px;color:inherit; }

/* מעברים רכים: מופיעים במקום לקפוץ. prefers-reduced-motion מקצר אותם לאפס (לעיל). */
@keyframes rr-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes rr-fade { from { opacity:0; } to { opacity:1; } }
@keyframes rr-drawer-in { from { opacity:0; transform:translateX(-24px); } to { opacity:1; transform:none; } }
[dir="rtl"] .drawer:not([hidden]) { animation:rr-drawer-in .22s ease-out both; }
.drawer:not([hidden]) { animation:rr-drawer-in .22s ease-out both; }
[dir="rtl"] .drawer:not([hidden]) { animation-name:rr-drawer-in-rtl; }
@keyframes rr-drawer-in-rtl { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:none; } }
.drawer-backdrop:not([hidden]) { animation:rr-fade .2s ease-out both; }
#results:not([hidden]), #detail:not([hidden]) { animation:rr-in .26s ease-out both; }
.sheet-win:not([hidden]) .sheet-win-panel { animation:rr-in .22s ease-out both; }
.route-card { transition:border-color .18s ease, transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
body { animation:rr-fade .24s ease-out both; }
body.lang-leaving { opacity:0; transition:opacity .16s ease-in; }
.doc-body { line-height: 1.6; font-size: 15px; }
.doc-body h1 { font-size: 20px; margin: 0 0 10px; }
.doc-body h2 { font-size: 17px; margin: 18px 0 6px; }
.doc-body a { color: var(--accent-text, #0d6b43); }

/* בורר שפה: דגלי SVG מקומיים, בלי תלות בפונט אימוג'י של המכשיר */
#drawer .drawer-lang { flex-direction:column;align-items:stretch;justify-content:flex-start;gap:8px; }
#drawer .drawer-lang label { text-align:start; }
#drawer .lang-picker { display:grid;grid-template-columns:repeat(3,1fr);gap:6px; }
#drawer .lang-picker button { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;width:100%;min-height:56px;padding:6px 4px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font:inherit;font-size:13px;line-height:1.2;color:var(--ink);text-align:center;cursor:pointer; }
#drawer .lang-picker button img { flex:none;border-radius:2px;box-shadow:0 0 0 1px rgba(0,0,0,.18); }
#drawer .lang-picker button[aria-pressed="true"] { border-color:var(--accent,#0a8a52);box-shadow:0 0 0 1px var(--accent,#0a8a52);font-weight:700; }

/* Real in-progress metric only: shown while a background request is running. */
.metric-spin { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--line, #d8d2c6); border-top-color: var(--ink-2, #555); border-radius: 50%; animation: metric-spin .9s linear infinite; vertical-align: middle; }
@keyframes metric-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .metric-spin { animation: none; border-top-color: var(--line, #d8d2c6); background: radial-gradient(circle, var(--ink-2, #555) 0 3px, transparent 4px); } }
/* The checked thumb travels toward the end edge: left-to-right needs +16px (the base rule is for RTL). */
[dir="ltr"] .switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
