/* ============================================================
   AI NAVI — מערכת עיצוב
   "מפת מטרו רגועה": שמנת, קווים צבעוניים, תחנות, שלטי דרך.
   ============================================================ */

:root {
  /* רקעים */
  --bg: #FAF7F0;
  --bg-2: #F3EFE6;
  --surface: #FFFFFF;
  --surface-warm: #FDFBF6;

  /* דיו */
  --ink: #26303C;
  --ink-soft: #3D4854;
  --muted: #67727E;
  --line-soft: rgba(38, 48, 60, 0.10);
  --line-softer: rgba(38, 48, 60, 0.06);

  /* קווי המערכת */
  --teal: #33807E;
  --teal-deep: #23605E;
  --teal-tint: #DCEBE9;
  --sky: #4E92C2;
  --sky-tint: #DEEBF5;
  --sage: #5F8F5C;
  --sage-tint: #DFEADB;
  --lavender: #7E6DAE;
  --lavender-tint: #E7E1F2;
  --peach: #C77A47;
  --peach-tint: #F7E3D3;
  --mustard: #A98A1F;
  --mustard-tint: #F2E7C2;

  /* צבעי מצב */
  --ok: #3E7D53;
  --ok-tint: #DFEBDF;
  --warn: #B36A22;
  --warn-tint: #F6E6D2;
  --risk: #B05548;
  --risk-tint: #F4DDD8;
  --info: #45719F;
  --info-tint: #DFE8F2;
  --create: #7E63B5;
  --create-tint: #E8E1F4;

  /* טיפוגרפיה */
  --font-display: "Secular One", "Heebo", sans-serif;
  --font-body: "Heebo", "Assistant", sans-serif;

  /* צורה */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(38,48,60,.05), 0 4px 14px rgba(38,48,60,.06);
  --shadow-2: 0 2px 6px rgba(38,48,60,.07), 0 14px 34px rgba(38,48,60,.10);
  --shadow-3: 0 8px 20px rgba(38,48,60,.10), 0 28px 60px rgba(38,48,60,.14);

  --ease-out: cubic-bezier(.22, .8, .3, 1);
}

/* ---------- בסיס ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
  line-height: 1.55;
  font-size: 17px;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--teal-deep); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--teal-tint); }

/* רקע נייר: נקודות-רשת + הילות רכות */
.paper-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 700px at 12% -10%, rgba(78,146,194,.09), transparent 60%),
    radial-gradient(900px 650px at 95% 15%, rgba(126,109,174,.08), transparent 55%),
    radial-gradient(1000px 700px at 45% 115%, rgba(51,128,126,.09), transparent 55%),
    radial-gradient(rgba(38,48,60,.055) 1.1px, transparent 1.3px),
    var(--bg);
  background-size: auto, auto, auto, 26px 26px, auto;
}

/* ---------- רכיבים משותפים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-weight: 700; text-decoration: none; text-align: center;
  padding: .8em 1.6em; border-radius: var(--r-pill);
  background: var(--ink); color: #fff;
  box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s;
  min-height: 48px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--teal); }
.btn--primary:hover { background: var(--teal-deep); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line-soft); }
.btn--ghost:hover { background: var(--surface); }
.btn--big { font-size: 1.2rem; padding: 1em 2.2em; }

.chip {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .35em .9em; border-radius: var(--r-pill);
  background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-soft);
  font-size: .92rem; font-weight: 600; color: var(--ink-soft);
}

.card {
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); border: 1px solid var(--line-softer);
}

/* תחנת מטרו (עיגול עם טבעת) */
.station {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 5px solid var(--teal);
  box-shadow: 0 0 0 3px var(--surface);
  flex: none;
}

/* תג קו ממוספר */
.line-badge {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.35rem; color: #fff;
  box-shadow: var(--shadow-1);
}

/* מיפוי צבעים לפי data-color */
[data-color="teal"]     { --c: var(--teal);     --c-tint: var(--teal-tint); }
[data-color="sky"]      { --c: var(--sky);      --c-tint: var(--sky-tint); }
[data-color="sage"]     { --c: var(--sage);     --c-tint: var(--sage-tint); }
[data-color="lavender"] { --c: var(--lavender); --c-tint: var(--lavender-tint); }
[data-color="peach"]    { --c: var(--peach);    --c-tint: var(--peach-tint); }
[data-color="mustard"]  { --c: var(--mustard);  --c-tint: var(--mustard-tint); }
[data-color="info"]     { --c: var(--info);     --c-tint: var(--info-tint); }
[data-color="create"]   { --c: var(--create);   --c-tint: var(--create-tint); }
[data-color="risk"]     { --c: var(--risk);     --c-tint: var(--risk-tint); }
[data-color="ok"]       { --c: var(--ok);       --c-tint: var(--ok-tint); }
[data-color="warn"]     { --c: var(--warn);     --c-tint: var(--warn-tint); }

/* הודעת אזהרה / מידע */
.notice {
  display: flex; gap: .8em; align-items: flex-start;
  padding: 1em 1.2em; border-radius: var(--r-md);
  background: var(--warn-tint); border-right: 5px solid var(--warn);
  font-size: .98rem; text-align: right;
}
.notice--risk { background: var(--risk-tint); border-right-color: var(--risk); }
.notice--info { background: var(--info-tint); border-right-color: var(--info); }
.notice--ok { background: var(--ok-tint); border-right-color: var(--ok); }
.notice .notice-icon { flex: none; font-size: 1.2em; line-height: 1.3; }

/* ============================================================
   מצגת
   ============================================================ */
.deck-body { overflow: hidden; height: 100dvh; }

.deck { position: fixed; inset: 0; }

.slide {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(20px, 4vw, 56px) clamp(20px, 5vw, 72px) clamp(64px, 8vh, 96px);
  overflow-y: auto;
}
.slide.active { display: flex; }
.slide-inner { width: 100%; max-width: 1180px; margin: auto; }

/* אנימציית כניסה */
.slide.active .slide-inner { animation: slideIn .5s var(--ease-out) both; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* טיפוגרפיית שקופית */
.slide h1 { font-size: clamp(2.1rem, 5.4vw, 4.2rem); }
.slide h2 { font-size: clamp(1.7rem, 4vw, 3rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-family: var(--font-body); font-weight: 700; font-size: clamp(.85rem, 1.4vw, 1.05rem);
  color: var(--c, var(--teal)); letter-spacing: .02em; margin-bottom: .9em;
}
.eyebrow::before { content: ""; width: 26px; height: 5px; border-radius: 3px; background: var(--c, var(--teal)); }
.lead { font-size: clamp(1.15rem, 2.3vw, 1.7rem); color: var(--ink-soft); max-width: 24em; }
.big-quote {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3.6vw, 2.7rem);
  line-height: 1.3; color: var(--ink);
}
.slide .accent { color: var(--c, var(--teal)); }

/* חשיפה הדרגתית */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .45s var(--ease-out), transform .45s var(--ease-out); }
[data-reveal].revealed { opacity: 1; transform: none; }

/* HUD */
.hud {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 18px 12px; pointer-events: none;
  font-size: .85rem; color: var(--muted);
}
.hud > * { pointer-events: auto; }
.hud-section { display: flex; align-items: center; gap: .5em; font-weight: 700; }
.hud-section .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--teal)); }
.hud-count { font-variant-numeric: tabular-nums; font-weight: 600; }
.hud-keys { color: var(--muted); opacity: .75; }
.hud-keys kbd {
  font-family: inherit; background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 0 .4em; margin-inline: .1em; box-shadow: 0 1px 0 var(--line-soft);
}

/* פס התקדמות מפולח לפי חלקים */
.progress-rail {
  position: fixed; inset-inline: 0; bottom: 0; height: 6px; z-index: 41;
  display: flex; gap: 3px; padding: 0 6px 4px; direction: rtl;
}
.progress-seg { flex: 1; border-radius: 3px; background: var(--line-soft); position: relative; overflow: hidden; }
.progress-seg .fill {
  position: absolute; inset: 0; transform-origin: right center;
  background: var(--c, var(--teal)); transform: scaleX(0);
  transition: transform .35s var(--ease-out);
}

/* מגירת מנחה */
.notes-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(400px, 92vw); z-index: 60;
  background: var(--surface); box-shadow: var(--shadow-3);
  transform: translateX(-105%); transition: transform .3s var(--ease-out);
  display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line-soft);
}
.notes-drawer.open { transform: none; }
.notes-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--line-soft); }
.notes-head .sec { font-size: .85rem; font-weight: 700; color: var(--c, var(--teal)); }
.notes-head h3 { font-size: 1.25rem; margin-top: 2px; }
.notes-meta { display: flex; gap: 14px; margin-top: 10px; font-size: .88rem; color: var(--muted); flex-wrap: wrap; }
.notes-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.notes-list { padding: 16px 20px; overflow-y: auto; flex: 1; display: grid; gap: 12px; align-content: start; }
.notes-list li { list-style: none; padding: 10px 14px; background: var(--surface-warm); border-radius: var(--r-sm); border-right: 4px solid var(--c, var(--teal)); font-size: .95rem; }
.notes-list ul { margin: 0; padding: 0; display: contents; }
.notes-next { padding: 12px 20px 16px; border-top: 1px solid var(--line-soft); font-size: .88rem; color: var(--muted); }
.notes-next b { color: var(--ink); }
.notes-close { position: absolute; top: 10px; left: 10px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.notes-close:hover { background: var(--bg-2); }

/* רשת קפיצה */
.jump-grid {
  position: fixed; inset: 0; z-index: 70; background: rgba(250, 247, 240, .96);
  display: none; overflow-y: auto; padding: 48px clamp(16px, 5vw, 64px);
}
.jump-grid.open { display: block; }
.jump-grid h2 { margin-bottom: 20px; }
.jump-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.jump-item {
  text-align: right; padding: 12px 14px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line-soft);
  display: flex; gap: 10px; align-items: center; transition: transform .15s var(--ease-out), box-shadow .15s;
}
.jump-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.jump-item.current { outline: 3px solid var(--c, var(--teal)); }
.jump-item .n { font-family: var(--font-display); color: var(--c, var(--teal)); min-width: 1.6em; }
.jump-item .game-tag { margin-inline-start: auto; font-size: .72rem; background: var(--peach-tint); color: var(--peach); padding: 2px 8px; border-radius: var(--r-pill); font-weight: 700; }

/* ---------- רכיבי שקופיות ---------- */

/* שקופית 2: הצפה */
.flood-wall { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 900px; margin: 28px auto 0; }
.flood-chip {
  padding: .45em 1em; border-radius: var(--r-pill); font-weight: 600; font-size: clamp(.8rem, 1.6vw, 1.05rem);
  background: var(--surface); border: 1.5px solid var(--line-soft); color: var(--ink-soft);
  box-shadow: var(--shadow-1);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.flood-wall.cleared .flood-chip { opacity: 0; transform: scale(.6) translateY(10px); pointer-events: none; }
.flood-wall .flood-chip:nth-child(3n) { transition-delay: .05s; }
.flood-wall .flood-chip:nth-child(3n+1) { transition-delay: .12s; }
.flood-after { margin-top: 26px; }

/* כרטיסי טעויות / רשימות גדולות */
.stack { display: grid; gap: 14px; margin-top: 30px; }
.mistake {
  display: flex; gap: 16px; align-items: center; text-align: right;
  padding: 18px 22px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line-softer); box-shadow: var(--shadow-1);
  font-size: clamp(1.05rem, 2vw, 1.4rem); font-weight: 600;
}
.mistake .x {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--risk-tint); color: var(--risk); font-family: var(--font-display); font-size: 1.3rem;
}

/* מסלול Waze מקביל */
.waze-compare { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 3vw, 40px); margin-top: 34px; align-items: stretch; }
.waze-col { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-softer); box-shadow: var(--shadow-1); }
.waze-col h3 { font-size: 1.2rem; color: var(--c, var(--teal)); margin-bottom: 14px; display: flex; align-items: center; gap: .5em; }
.flow { display: flex; flex-direction: column; gap: 0; }
.flow-step { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: clamp(1rem, 1.9vw, 1.25rem); }
.flow-step .station { border-color: var(--c, var(--teal)); width: 16px; height: 16px; border-width: 4px; }
.flow-link { width: 4px; height: 26px; margin-inline-start: 6px; background: var(--c-tint, var(--teal-tint)); border-radius: 2px; }

/* מפת ששת הצמתים */
.junction-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2vw, 22px); margin-top: 34px; counter-reset: junction; }
.junction {
  position: relative; padding: 20px 18px 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line-softer); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 6px; text-align: right;
  transition: transform .18s var(--ease-out), box-shadow .18s;
}
.junction:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.junction .j-num {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-tint); color: var(--c); font-family: var(--font-display); font-size: 1.15rem;
  border: 2.5px solid var(--c); margin-bottom: 4px;
}
.junction .j-q { font-weight: 700; font-size: clamp(1rem, 1.9vw, 1.3rem); }
.junction .j-hint { font-size: .9rem; color: var(--muted); }

/* רשת אפשרויות (קטגוריות בצמתים) */
.opt-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; justify-content: center; }
.opt-tile {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .7em 1.2em; border-radius: var(--r-md); font-weight: 700; font-size: clamp(.95rem, 1.8vw, 1.2rem);
  background: var(--surface); border: 2px solid var(--line-soft); color: var(--ink-soft);
  transition: transform .15s var(--ease-out), border-color .15s, background .15s;
  min-height: 48px;
}
.opt-tile:hover { transform: translateY(-2px); border-color: var(--c, var(--teal)); }
.opt-tile[aria-pressed="true"] { background: var(--c-tint, var(--teal-tint)); border-color: var(--c, var(--teal)); color: var(--ink); }
.opt-tile .emoji { font-size: 1.15em; }

/* משחק בחר-שניים */
.pick-two-note { margin-top: 18px; font-weight: 700; min-height: 1.6em; }
.pick-two-note.over { color: var(--risk); }
.pick-two-note.done { color: var(--ok); }

/* נהג / נווט / נוסע */
.mode-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 2.5vw, 26px); margin-top: 32px; }
.mode-card { padding: 26px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-softer); box-shadow: var(--shadow-1); text-align: center; }
.mode-card .icon { font-size: 2.4rem; margin-bottom: 8px; }
.mode-card h3 { font-size: clamp(1.3rem, 2.6vw, 1.9rem); color: var(--c, var(--teal)); }
.mode-card p { margin-top: 8px; color: var(--ink-soft); font-size: clamp(.95rem, 1.7vw, 1.15rem); }
.mode-card .sub { margin-top: 10px; font-size: .88rem; color: var(--muted); }

/* הדגמה: כרטיס משימה */
.task-poster {
  margin: 30px auto 0; max-width: 760px; padding: clamp(24px, 4vw, 44px);
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  border-top: 8px solid var(--c, var(--sage));
  font-size: clamp(1.25rem, 2.8vw, 2rem); font-family: var(--font-display); line-height: 1.45;
}

/* בחירות ההדגמה בצמתים */
.demo-choices { display: grid; gap: 12px; margin-top: 28px; max-width: 820px; margin-inline: auto; }
.demo-choice {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--line-softer); box-shadow: var(--shadow-1);
  text-align: right; font-size: clamp(1rem, 1.9vw, 1.25rem);
}
.demo-choice .j-tag {
  flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c-tint); color: var(--c); border: 2px solid var(--c); font-family: var(--font-display); font-size: .95rem;
}
.demo-choice b { color: var(--c); }

/* מסלולים (מהיר/מקצועי/מתקדם) */
.route-steps { margin: 30px auto 0; max-width: 720px; display: flex; flex-direction: column; }
.route-step { display: flex; gap: 16px; align-items: flex-start; text-align: right; }
.route-step .rail { display: flex; flex-direction: column; align-items: center; flex: none; }
.route-step .rail .station { border-color: var(--c, var(--teal)); }
.route-step .rail .pipe { width: 5px; flex: 1; min-height: 30px; background: var(--c-tint, var(--teal-tint)); border-radius: 3px; }
.route-step:last-child .rail .pipe { visibility: hidden; }
.route-step .body { padding-bottom: 18px; }
.route-step .t { font-weight: 700; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.route-step .d { color: var(--muted); font-size: clamp(.9rem, 1.6vw, 1.05rem); }
.route-verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; max-width: 720px; margin-inline: auto; }
.verdict-card { padding: 14px 18px; border-radius: var(--r-md); font-size: clamp(.95rem, 1.7vw, 1.1rem); }
.verdict-card.plus { background: var(--ok-tint); border-right: 5px solid var(--ok); }
.verdict-card.minus { background: var(--warn-tint); border-right: 5px solid var(--warn); }
.verdict-card b { display: block; margin-bottom: 2px; }

/* הצבעות */
.poll { display: grid; gap: 12px; margin-top: 28px; max-width: 780px; margin-inline: auto; }
.poll-opt {
  position: relative; overflow: hidden; text-align: right;
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  border-radius: var(--r-md); background: var(--surface); border: 2px solid var(--line-soft);
  font-size: clamp(1rem, 2vw, 1.3rem); font-weight: 600;
  transition: border-color .15s, transform .15s var(--ease-out);
}
.poll-opt:hover { transform: translateY(-2px); border-color: var(--c, var(--teal)); }
.poll-opt .letter {
  flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--c-tint, var(--teal-tint)); color: var(--c, var(--teal)); font-family: var(--font-display); font-size: 1.2rem;
}
.poll-opt .bar {
  position: absolute; inset: 0; z-index: 0; transform-origin: right center; transform: scaleX(0);
  background: var(--c-tint, var(--teal-tint)); opacity: .55; transition: transform .5s var(--ease-out);
}
.poll-opt > :not(.bar) { position: relative; z-index: 1; }
.poll-opt .count { margin-inline-start: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; min-width: 2em; text-align: left; }
.poll-opt.chosen { border-color: var(--c, var(--teal)); }
.poll-opt.correct { border-color: var(--ok); background: var(--ok-tint); }
.poll-opt.correct .letter { background: var(--ok); color: #fff; }
.poll-reveal { margin-top: 20px; max-width: 780px; margin-inline: auto; }
.poll-reveal[hidden] { display: none; }

/* משחק תקציב */
.budget-wrap { margin-top: 26px; }
.budget-meter {
  display: flex; align-items: center; gap: 16px; max-width: 640px; margin: 0 auto 20px;
  background: var(--surface); padding: 12px 18px; border-radius: var(--r-pill); box-shadow: var(--shadow-1);
}
.budget-meter .track { flex: 1; height: 14px; border-radius: 7px; background: var(--bg-2); overflow: hidden; }
.budget-meter .fill { height: 100%; width: 0%; border-radius: 7px; background: var(--teal); transition: width .35s var(--ease-out), background .35s; }
.budget-meter.over .fill { background: var(--risk); }
.budget-meter .nums { font-family: var(--font-display); font-size: 1.3rem; min-width: 3.2em; text-align: center; }
.budget-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 860px; margin-inline: auto; }
.budget-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 18px 12px; min-width: 122px; border-radius: var(--r-md);
  background: var(--surface); border: 2px solid var(--line-soft); box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease-out), border-color .15s, background .15s;
}
.budget-card:hover { transform: translateY(-3px); }
.budget-card .emoji { font-size: 1.7rem; }
.budget-card .name { font-weight: 700; }
.budget-card .cost { font-size: .85rem; color: var(--muted); font-weight: 700; }
.budget-card[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-tint); }
.budget-msg { margin-top: 18px; min-height: 2em; font-weight: 700; max-width: 720px; margin-inline: auto; }

/* מפת משפחות */
.family-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 1.6vw, 18px); margin-top: 28px; }
.family-line {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: right;
  background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--line-softer);
  box-shadow: var(--shadow-1); transition: transform .15s var(--ease-out), box-shadow .15s;
}
.family-line:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.family-line .line-badge { background: var(--c); }
.family-line .name { font-weight: 700; font-size: clamp(.98rem, 1.8vw, 1.2rem); }
.family-line .tag { font-size: .85rem; color: var(--muted); }
.family-line[aria-expanded="true"] { outline: 3px solid var(--c); }
.family-detail {
  margin-top: 20px; padding: clamp(18px, 3vw, 30px); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-2); border-top: 6px solid var(--c, var(--teal));
  text-align: right;
}
.family-detail[hidden] { display: none; }
.family-detail h3 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.3rem, 2.6vw, 1.9rem); }
.family-detail .uses { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.family-detail .fit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
@media (max-width: 720px) { .family-detail .fit { grid-template-columns: 1fr; } }

/* משפטי מפתח */
.principles { display: grid; gap: 12px; margin-top: 30px; max-width: 860px; margin-inline: auto; }
.principle {
  padding: 16px 22px; border-radius: var(--r-md); background: var(--surface);
  border-right: 6px solid var(--c, var(--teal)); box-shadow: var(--shadow-1);
  font-family: var(--font-display); font-size: clamp(1.1rem, 2.3vw, 1.6rem); text-align: right;
}

/* ============================================================
   הנווט (שאלון + תוצאה)
   ============================================================ */
.navi-page { min-height: 100dvh; display: flex; flex-direction: column; }
.navi-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px); border-bottom: 1px solid var(--line-softer);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .mark { width: 38px; height: 38px; }
.brand .t { font-family: var(--font-display); font-size: 1.25rem; }
.brand .t small { display: block; font-family: var(--font-body); font-size: .72rem; color: var(--muted); font-weight: 600; margin-top: -2px; }

.navi-main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 4vw, 40px) 80px; }

/* מסך פתיחה של הנווט */
.navi-hero { text-align: center; padding-top: clamp(12px, 4vh, 40px); }
.navi-hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); }
.navi-hero .lead { margin: 14px auto 0; }
.task-input {
  display: block; width: 100%; max-width: 640px; margin: 26px auto 0;
  padding: 1.1em 1.3em; font: inherit; font-size: 1.1rem; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line-soft); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); resize: vertical; min-height: 3.6em; text-align: right;
}
.task-input:focus-visible { outline-offset: 0; border-color: var(--sky); }
.hero-examples { margin-top: 14px; color: var(--muted); font-size: .95rem; min-height: 1.6em; }
.hero-examples b { color: var(--teal-deep); }

/* אשף */
.wizard-progress { display: flex; gap: 5px; margin-bottom: 26px; }
.wizard-progress .wseg { flex: 1; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; position: relative; }
.wizard-progress .wseg .fill { position: absolute; inset: 0; background: var(--teal); transform: scaleX(0); transform-origin: right; transition: transform .3s var(--ease-out); }
.wizard-progress .wseg.done .fill, .wizard-progress .wseg.now .fill { transform: none; }
.wizard-progress .wseg.now .fill { background: var(--sky); }

.wizard-q h2 { font-size: clamp(1.5rem, 3.6vw, 2.4rem); }
.wizard-q .q-hint { color: var(--muted); margin-top: 6px; }
.answers { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.answers .opt-tile { font-size: 1.05rem; }
.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 34px; gap: 12px; }
.wizard-nav .spacer { flex: 1; }

/* מסך תוצאה */
.result-head { text-align: center; margin-bottom: 10px; }
.result-head h1 { font-size: clamp(1.9rem, 5vw, 3.1rem); }
.result-summary {
  margin: 18px auto 0; max-width: 640px; padding: 16px 22px; text-align: center;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1);
  font-size: 1.08rem; border-top: 5px solid var(--teal);
}
.result-section { margin-top: 36px; }
.result-section > h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); margin-bottom: 16px; display: flex; align-items: center; gap: .5em; }
.result-section > h2::before { content: ""; width: 22px; height: 6px; border-radius: 3px; background: var(--teal); }

.result-route { display: flex; flex-direction: column; }
.result-stop { display: flex; gap: 16px; }
.result-stop .rail { display: flex; flex-direction: column; align-items: center; flex: none; padding-top: 6px; }
.result-stop .rail .pipe { width: 5px; flex: 1; min-height: 24px; background: var(--teal-tint); border-radius: 3px; }
.result-stop:last-child .rail .pipe { visibility: hidden; }
.result-stop .stop-card { flex: 1; margin-bottom: 14px; padding: 16px 18px; }
.stop-card .stop-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stop-card .role { font-weight: 700; font-size: 1.12rem; }
.stop-card .tool-pill {
  margin-inline-start: auto; display: inline-flex; align-items: center; gap: .4em;
  background: var(--c-tint, var(--teal-tint)); color: var(--c, var(--teal-deep));
  padding: .25em .8em; border-radius: var(--r-pill); font-weight: 700; font-size: .95rem;
}
.stop-card .why { color: var(--ink-soft); margin-top: 6px; font-size: .97rem; }
.stop-card .io { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; font-size: .9rem; }
.stop-card .io > div { background: var(--surface-warm); border: 1px solid var(--line-softer); border-radius: var(--r-sm); padding: 8px 12px; }
.stop-card .io b { color: var(--muted); font-size: .8rem; display: block; }
.stop-card .check { margin-top: 10px; font-size: .92rem; color: var(--warn); font-weight: 600; }
.stop-card.human-stop { border-right: 5px solid var(--mustard); }
.stop-card.human-stop .tool-pill { background: var(--mustard-tint); color: var(--mustard); }

.alt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.alt-card { padding: 16px 18px; }
.alt-card h3 { font-size: 1.1rem; color: var(--c, var(--teal)); display: flex; gap: .5em; align-items: center; }
.alt-card p { margin-top: 8px; font-size: .95rem; color: var(--ink-soft); }

.prompt-box {
  position: relative; background: var(--ink); color: #F2EFE7; border-radius: var(--r-md);
  padding: 20px 22px 20px 20px; font-size: 1rem; line-height: 1.7; box-shadow: var(--shadow-2);
}
.prompt-box .copy-btn {
  position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.14); color: #fff;
  padding: .4em 1em; border-radius: var(--r-pill); font-size: .88rem; font-weight: 700;
  transition: background .15s;
}
.prompt-box .copy-btn:hover { background: rgba(255,255,255,.26); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 40px; }

.tools-note { margin-top: 40px; font-size: .88rem; color: var(--muted); text-align: center; max-width: 620px; margin-inline: auto; }

/* מצב הקרנה לתוצאה */
.present-mode .navi-main { max-width: 1100px; font-size: 1.15rem; }
.present-mode .navi-header { display: none; }

/* ============================================================
   דף שער (index)
   ============================================================ */
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }
.gate h1 { font-size: clamp(2.6rem, 8vw, 5rem); }
.gate .lead { margin: 16px auto 0; }
.gate-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 44px; width: min(760px, 100%); }
.gate-card {
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: right;
  padding: 26px 24px; border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--line-softer); box-shadow: var(--shadow-1); text-decoration: none; color: var(--ink);
  transition: transform .18s var(--ease-out), box-shadow .18s;
}
.gate-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.gate-card h2 { font-size: 1.5rem; color: var(--c, var(--teal)); }
.gate-card p { color: var(--muted); font-size: .98rem; }
.gate-card .go { margin-top: 8px; font-weight: 700; color: var(--c, var(--teal)); }
.gate-foot { margin-top: 46px; font-size: .85rem; color: var(--muted); max-width: 560px; }

/* ============================================================
   רספונסיביות
   ============================================================ */
@media (max-width: 900px) {
  .junction-map { grid-template-columns: repeat(2, 1fr); }
  .family-board { grid-template-columns: repeat(2, 1fr); }
  .alt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .waze-compare, .mode-cards, .route-verdict, .gate-cards { grid-template-columns: 1fr; }
  .junction-map { grid-template-columns: 1fr 1fr; }
  .family-board { grid-template-columns: 1fr; }
  .stop-card .io { grid-template-columns: 1fr; }
  .hud-keys { display: none; }
  .slide { padding-bottom: 80px; }
}

/* ============================================================
   הדפסה (תוצאת הנווט)
   ============================================================ */
@media print {
  .paper-bg { display: none; }
  body { background: #fff; font-size: 12pt; }
  .navi-header, .result-actions, .wizard-nav, .prompt-box .copy-btn { display: none !important; }
  .navi-main { max-width: none; padding: 0; }
  .card, .stop-card, .prompt-box { box-shadow: none; border: 1px solid #ccc; }
  .prompt-box { background: #f4f4f4; color: #111; }
  .result-stop, .alt-card, .notice { break-inside: avoid; }
}

/* ============================================================
   הפחתת תנועה
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .slide.active .slide-inner { animation: none; }
  [data-reveal] { transition: none; }
}
