:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #e2e4e9;
  --text: #14171f;
  --text-2: #4b5160;
  --text-muted: #747a88;
  --brand: #12325e;
  --brand-2: #1c5cab;
  --accent: #2a78d6;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #6250d6;
  --series-8: #e34948;
  --good: #0ca30c;
  --good-bg: #e3f5e3;
  --good-fg: #0b5e0b;
  --mid-bg: #fff3d6;
  --mid-fg: #7a5200;
  --critical: #d03b3b;
  --warn: #e09400;
  --bad-bg: #fbe4e4;
  --bad-fg: #9a2222;
  --ai-bg: #eef4fd;
  --ai-border: #b7d3f6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111214;
    --surface: #1a1a19;
    --surface-2: #222321;
    --border: #34352f;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-muted: #9a998f;
    --brand: #0d2240;
    --brand-2: #3987e5;
    --accent: #3987e5;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
  --series-6: #0ca30c;
  --series-7: #9085e9;
  --series-8: #e66767;
    --series-6: #0ca30c;
    --series-7: #9085e9;
    --series-8: #e66767;
    --good-bg: #173a17;
    --good-fg: #8fe08f;
    --mid-bg: #3d2f0d;
    --mid-fg: #f5cf73;
    --bad-bg: #4a1c1c;
    --bad-fg: #ffaaaa;
    --ai-bg: #16243a;
    --ai-border: #184f95;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111214;
  --surface: #1a1a19;
  --surface-2: #222321;
  --border: #34352f;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-muted: #9a998f;
  --brand: #0d2240;
  --brand-2: #3987e5;
  --accent: #3987e5;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #0ca30c;
  --series-7: #9085e9;
  --series-8: #e66767;
  --good-bg: #173a17;
  --good-fg: #8fe08f;
  --mid-bg: #3d2f0d;
  --mid-fg: #f5cf73;
  --bad-bg: #4a1c1c;
  --bad-fg: #ffaaaa;
  --ai-bg: #16243a;
  --ai-border: #184f95;
}

* { box-sizing: border-box; }
html, body { direction: rtl; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Rubik", "Assistant", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: .95rem; margin: 16px 0 8px; color: var(--text-2); }
.muted { color: var(--text-muted); font-weight: normal; }
.small { font-size: .85rem; }
.spacer { flex: 1; }

/* ---- סרגל עליון ---- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--brand); color: #fff; padding: 10px 20px;
}
.brand { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.logo { display: inline-block; transform: scaleX(-1); }
.logo.big { font-size: 2.4rem; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.mainnav a { color: #dbe6f5; padding: 6px 10px; border-radius: 6px; font-size: .95rem; }
.mainnav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.mainnav a.active { background: rgba(255,255,255,.18); color: #fff; }
.mainnav a.nav-cta { background: #2a78d6; color: #fff; }
.who { display: flex; gap: 8px; align-items: center; font-size: .9rem; white-space: nowrap; order: 99; }
.who-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 3px 12px; color: #fff; font-weight: 600; }
.who-chip small { font-weight: 400; color: #c9d8ee; }
.who-chip.off { background: transparent; color: #c9d8ee; font-weight: 400; border-style: dashed; }
.btn-link { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font: inherit; }
.demo-banner { background: var(--mid-bg); color: var(--mid-fg); text-align: center; font-size: .85rem; padding: 4px; }

.page { max-width: 1200px; margin: 0 auto; padding: 20px 16px 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.crumbs { font-size: .85rem; }
.actions, .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.card.empty, .center { text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 > .card { margin-bottom: 0; }
.grid2 { margin-bottom: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- כפתורים וטפסים ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); border-color: var(--critical); }
.btn.small { padding: 4px 10px; font-size: .85rem; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--text-2); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.check { flex-direction: row; align-items: center; gap: 6px; }
label.block { margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.form-grid .wide { grid-column: span 2; }
@media (max-width: 500px) { .form-grid .wide { grid-column: auto; } }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }

/* ---- KPI ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi-label { color: var(--text-muted); font-size: .85rem; }
.kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .8rem; color: var(--text-muted); }

/* ---- טבלאות ---- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl th { font-size: .82rem; color: var(--text-muted); font-weight: 600; background: var(--surface-2); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--surface-2); }
.grades td:first-child { min-width: 220px; }

/* ---- תגיות ציון/סטטוס (צבע + מילה, אף פעם לא צבע לבד) ---- */
.badge { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }
.badge small { font-weight: 500; font-size: .75rem; }
.sc-good { background: var(--good-bg); color: var(--good-fg); }
.sc-mid { background: var(--mid-bg); color: var(--mid-fg); }
.sc-bad { background: var(--bad-bg); color: var(--bad-fg); }
.sc-none { background: var(--surface-2); color: var(--text-muted); }
.status { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.st-open { color: var(--critical); }
.st-prog { color: var(--mid-fg); }
.st-done { color: var(--good-fg); }
.pill { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 8px; font-size: .78rem; color: var(--text-2); }
.comp-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.comp-tags span { font-size: .72rem; color: var(--text-muted); background: var(--surface-2); border-radius: 4px; padding: 0 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: .88rem; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: none; }
.list li.clickable { cursor: pointer; }
.list li.clickable:hover { background: var(--surface-2); }

.progress { display: inline-block; width: 80px; height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.progress div { height: 100%; background: var(--series-1); }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }

/* ---- רצועת סילבוס ---- */
.strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (max-width: 700px) { .strip { grid-template-columns: repeat(3, 1fr); } }
.step { border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); }
.step.done { background: var(--good-bg); color: var(--good-fg); }
.step.retry { background: var(--mid-bg); color: var(--mid-fg); }
.step.todo { background: var(--surface-2); color: var(--text-muted); }

/* ---- AI ---- */
.ai-box { background: var(--ai-bg); border: 1px solid var(--ai-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.ai-head { display: flex; justify-content: space-between; margin-bottom: 6px; }
.ai-tag { font-size: .78rem; color: var(--brand-2); font-weight: 600; }
.ai-text { white-space: pre-wrap; }
.hint { background: var(--mid-bg); color: var(--mid-fg); border-radius: 8px; padding: 6px 10px; font-size: .88rem; }

/* ---- טופס ציונים (טאבלט) ---- */
.grade-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.grade-label { flex: 1; min-width: 200px; }
.score-picker { display: flex; gap: 4px; flex-wrap: wrap; direction: ltr; }
.sp { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.sp:hover { border-color: var(--accent); }
.sp.on.sc-good { background: var(--good); color: #fff; border-color: var(--good); }
.sp.on.sc-mid { background: var(--warn); color: #fff; border-color: var(--warn); }
.sp.on.sc-bad { background: var(--critical); color: #fff; border-color: var(--critical); }
.sp.na.on { background: var(--text-muted); color: #fff; }
.add-action { display: flex; gap: 8px; margin-top: 10px; }
.add-action input { flex: 1; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -2px 8px rgba(0,0,0,.08); }

/* ---- מצב תחקיר ---- */
.debrief .card { font-size: 1.05rem; }
.debrief-crew { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.debrief-crew .card { margin: 0; }
.big-score { display: inline-block; font-size: 3rem; font-weight: 800; border-radius: 16px; padding: 4px 22px; margin: 6px 0; }

/* ---- גרפים ---- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .ref { stroke: var(--critical); stroke-dasharray: 4 4; stroke-width: 1; opacity: .7; }
.chart .axis { fill: var(--text-muted); font-size: 11px; }
.chart .axisline { stroke: var(--text-muted); }
.chart .val { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--text-2); margin: 4px 0; }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-left: 5px; vertical-align: middle; }
.hbars { display: flex; flex-direction: column; gap: 6px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 38%) 1fr 44px; gap: 8px; align-items: center; font-size: .88rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 4px 0 0 4px; margin-right: 0; }
.hbar-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-2); }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; }
.heat th { font-size: .78rem; color: var(--text-muted); font-weight: 600; padding: 4px; }
.heat td { text-align: center; padding: 8px 4px; border-radius: 4px; font-variant-numeric: tabular-nums; font-size: .88rem; }
.heat-scale { display: flex; align-items: center; gap: 2px; font-size: .78rem; color: var(--text-muted); margin-top: 6px; }
.heat-scale i { width: 18px; height: 10px; display: inline-block; }
.heat-scale span { margin: 0 6px; }
.tooltip { position: fixed; pointer-events: none; z-index: 100; background: #14171f; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: .85rem; max-width: 320px; opacity: 0; transition: opacity .1s; }

/* ---- כניסה ---- */
.login { max-width: 900px; margin: 30px auto; padding: 0 16px; }
.login-head { text-align: center; margin-bottom: 20px; }
.login-head h1 { font-size: 2rem; color: var(--brand-2); }
.user-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.user-btn { font: inherit; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.user-btn:hover { border-color: var(--accent); background: var(--ai-bg); }
.user-btn.admin { background: var(--brand); color: #fff; }
.user-btn.instructor { background: var(--ai-bg); }
.login-course h3 { margin: 10px 0 6px; }

/* ---- לקחים / ניהול ---- */
details.lesson, details.syl { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
details summary { cursor: pointer; }
.syl-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.syl-row input { flex: 1; min-width: 200px; }
.danger-zone { border-color: var(--critical); }

/* ---- אינפוגרפיקה ---- */
.infographic { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); }
.infographic header { background: linear-gradient(135deg, #12325e, #1c5cab); color: #fff; padding: 24px 28px; display: flex; justify-content: space-between; align-items: center; }
.infographic header h1 { font-size: 2.2rem; }
.ig-kicker { opacity: .8; font-size: .9rem; }
.ig-hero { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--border); }
.ig-hero div { background: var(--surface); text-align: center; padding: 18px 8px; }
.ig-hero b { display: block; font-size: 2.2rem; color: var(--brand-2); font-variant-numeric: tabular-nums; }
.ig-hero span { color: var(--text-muted); font-size: .9rem; }
@media (max-width: 700px) { .ig-hero { grid-template-columns: repeat(2, 1fr); } }
.ig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 28px; }
@media (max-width: 760px) { .ig-grid { grid-template-columns: 1fr; } }
.ig-list { padding-right: 20px; margin: 0; }
.ig-list li { padding: 6px 0; }
.ig-list li span { display: block; color: var(--text-muted); font-size: .88rem; }
.ig-lessons { padding: 0 28px 24px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #14171f; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 200; }

@media print {
  .no-print, .topbar, .demo-banner, .sticky-actions, .tooltip { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .card, .infographic { box-shadow: none; break-inside: avoid; }
  .infographic header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 600px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .page { padding: 14px 16px 80px; }
  .sp { width: 34px; height: 34px; }
}

/* מניעת גלילה אופקית במסכים צרים */
.grid2 > *, .kpis > *, .meta > *, .form-grid > * { min-width: 0; }
.card { min-width: 0; overflow-wrap: anywhere; }
select, input { max-width: 100%; }
@media (max-width: 600px) {
  .hbar { grid-template-columns: minmax(90px, 40%) 1fr 36px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .who-chip small { display: none; }
}

/* ---- הערות בוחנים ---- */
.fb-fab { position: fixed; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 150; background: #eb6834; color: #fff; border: none; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.fb-fab:hover { filter: brightness(1.08); }
.fb-panel { position: fixed; left: 18px; bottom: 76px; z-index: 160; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 100px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 14px; display: none; }
.fb-panel.open { display: block; }
.fb-panel.fb-hidden { display: none; }
.fb-panel label { margin-bottom: 10px; }
.fb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.btn-x { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1rem; }
.fb-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.fb-tabs button { background: none; border: none; font: inherit; padding: 6px 10px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; }
.fb-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.fb-pickrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-picked { font-size: .85rem; color: var(--text-2); }
.fb-status { margin-top: 10px; font-size: .85rem; }
.fb-warn { color: var(--mid-fg); }
.fb-item { border-bottom: 1px solid var(--border); padding: 8px 0; }
.fb-meta { font-size: .82rem; color: var(--text-muted); }
.fb-where { font-size: .78rem; color: var(--text-muted); }
.fb-msg { white-space: pre-wrap; margin-top: 2px; }
.fb-picking, .fb-picking * { cursor: crosshair !important; }
.fb-hl { outline: 3px solid #eb6834 !important; outline-offset: 2px; }
.fb-pickbar { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: #eb6834; color: #fff; text-align: center; padding: 10px; font-weight: 600; }
.fb-pickbar button { font: inherit; margin-right: 10px; background: #fff; color: #eb6834; border: none; border-radius: 6px; padding: 2px 10px; cursor: pointer; }

/* ---- חלון אישור ---- */
.modal-wrap { position: fixed; inset: 0; z-index: 400; background: rgba(10, 14, 22, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; max-width: 420px; width: 100%; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.modal p { margin: 0 0 14px; font-size: 1.02rem; white-space: pre-line; }
#fb-copybox { margin-top: 6px; font-size: .85rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== ארכיטקטורה חדשה: עמוד ראשי, כניסות, גיחה בשלבים ===== */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar .brand { color: #fff; text-decoration: none; }
.topbar .area { color: #dbe6f5; border-right: 1px solid rgba(255,255,255,.3); padding-right: 14px; font-weight: 600; }
.topbar .btn-link { text-decoration: none; display: inline-block; }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border-bottom: 1px solid var(--border); padding: 6px max(16px, env(safe-area-inset-right, 0px)) 6px max(16px, env(safe-area-inset-left, 0px)); }
.subnav a { padding: 6px 12px; border-radius: 6px; color: var(--text-2); }
.subnav a:hover { background: var(--surface-2); text-decoration: none; }
.subnav a.active { background: var(--ai-bg); color: var(--brand-2); font-weight: 600; }
.serial { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }
.serial.big { color: var(--brand-2); font-size: 1.1em; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; font-weight: 700; }

/* עמוד ראשי */
.home { max-width: 1000px; margin: 0 auto; }
.home-title { text-align: center; color: var(--brand-2); font-size: 2rem; margin: 10px 0 22px; }
.home-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 760px) { .home-actions { grid-template-columns: 1fr; } }
.home-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; min-height: 190px; padding: 22px 16px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 16px; color: var(--text); box-shadow: var(--shadow); transition: transform .12s, border-color .12s; }
.home-btn:hover, .home-btn:focus-visible { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.home-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.home-btn.primary .hb-sub { color: #e3eefc; }
.hb-icon { font-size: 2.6rem; line-height: 1; }
.hb-title { font-size: 1.5rem; font-weight: 800; }
.hb-sub { color: var(--text-muted); font-size: .95rem; }
@media (prefers-reduced-motion: reduce) { .home-btn { transition: none; } .home-btn:hover { transform: none; } }
.ip-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.ip-head h2 { margin: 0; }
.ip-find { display: flex; gap: 6px; }
.ip-find input { width: 110px; }

/* כניסה בקוד / סיסמה */
.gate { max-width: 420px; margin: 30px auto; text-align: center; }
.gate-icon { font-size: 2.6rem; }
.gate form { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.gate input { font-size: 1.3rem; text-align: center; width: 180px; letter-spacing: .2em; }
.gate-err { color: var(--critical); min-height: 1.4em; margin: 8px 0 0; }
.demo-hint { text-align: right; margin-top: 10px; font-size: .88rem; }
.demo-codes { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }

/* שלבים */
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; flex-wrap: wrap; }
.stepper li { flex: 1; min-width: 140px; }
.stepper li > a, .stepper li > span { display: block; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.stepper li b { display: inline-block; width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 50%; background: var(--border); color: var(--text); margin-left: 6px; }
.stepper li.on > * { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.stepper li.on b { background: #fff; color: var(--accent); }
.stepper li.done > * { color: var(--good-fg); background: var(--good-bg); }
.stepper li > a:hover { text-decoration: none; border-color: var(--accent); }
.run-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; font-size: 1.05rem; }

/* תדריך */
.brief-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.brief-card { background: var(--ai-bg); border: 1px solid var(--ai-border); border-radius: 10px; padding: 10px 14px; }
.brief-card h3 { margin: 0 0 6px; color: var(--brand-2); }
.brief-card ul { margin: 0; padding-right: 18px; }
.brief-card li { margin: 3px 0; }
.obj-list { margin: 0; padding-right: 22px; }
.obj-list li { padding: 4px 0; }

/* הערות במהלך הגיחה */
.live-obj { padding: 12px 16px; }
.live-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.live-title h3 { margin: 0; color: var(--text); font-size: 1rem; }
.notes { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.notes.small { font-size: .88rem; margin: 4px 0; }
.note { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 4px 8px; border-radius: 6px; background: var(--surface-2); }
.note.tone-pos { background: var(--good-bg); }
.note.tone-neg { background: var(--mid-bg); }
.note-at { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.note-text { flex: 1; min-width: 0; }
.note-input { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.note-input input { flex: 1; min-width: 180px; }
.btn.tone { font-size: 1rem; padding: 4px 10px; }

/* תחקיר */
.db-obj { border-bottom: 1px solid var(--border); padding: 10px 0; }
.db-obj:last-of-type { border-bottom: none; }
.db-obj .grade-row { border-bottom: none; padding: 4px 0; }
.lesson-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }
.sugg { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.chip-btn { font: inherit; font-size: .85rem; background: var(--mid-bg); color: var(--mid-fg); border: 1px dashed var(--mid-fg); border-radius: 999px; padding: 2px 10px; cursor: pointer; }
ul.lessons { margin: 0; padding-right: 20px; }
ul.lessons li { margin: 4px 0; }
.debrief-crew h3 { margin-top: 12px; }
.chip.instr { background: var(--ai-bg); }

/* סיכום אישי */
.infographic.personal { margin-bottom: 16px; }
.ig-band { padding: 16px 28px 4px; }
.ig-line { padding: 4px 28px 18px; margin: 0; color: var(--text-2); }

/* בונה גיחות */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.plan-card { display: flex; gap: 14px; align-items: center; color: var(--text); margin: 0; }
.plan-card:hover { border-color: var(--accent); text-decoration: none; }
.plan-card h2 { margin: 0 0 2px; }
.plan-order { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--ai-bg); color: var(--brand-2); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.plan-order.sm { width: 28px; height: 28px; font-size: .95rem; border-radius: 6px; }
.obj-edit { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.obj-edit-top { display: flex; gap: 6px; align-items: center; }
.obj-edit-top input { flex: 1; min-width: 0; }
.btn-x[disabled] { opacity: .3; cursor: default; }
.comp-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cp { flex-direction: row; align-items: center; gap: 4px; font-size: .85rem; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; color: var(--text-2); }
.cp input { margin: 0; }
.cp.on { background: var(--ai-bg); border-color: var(--ai-border); color: var(--brand-2); font-weight: 600; }

/* משתמשים */
.pin-in { width: 100px; text-align: center; font-variant-numeric: tabular-nums; }
tr.inactive td { opacity: .55; }

/* ===== סבב 3: טופס מסודר, יעדים עמד/חלקית, מיומנויות, קצב, עוגה ונרות, ערכת צבעים ===== */
.theme-pick select { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.35); padding: 4px 8px; font-size: .88rem; }
.theme-pick select option { color: #14171f; background: #fff; }

/* טופס גיחה חדשה: שתי שורות של שלושה שדות ברוחב שווה */
.fields3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; margin-bottom: 14px; }
@media (max-width: 700px) { .fields3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 600; color: var(--text-2); font-size: .9rem; }
.field select, .field input { width: 100%; height: 42px; }
.field-hint { margin: 0; min-height: 1.4em; color: var(--brand-2); font-size: .9rem; }

/* הערכת יעד */
.outcome-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.op { font: inherit; font-size: .92rem; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; min-height: 40px; }
.op:hover { border-color: var(--accent); }
.op-met.on { background: var(--good); border-color: var(--good); color: #fff; font-weight: 700; }
.op-partial.on { background: var(--warn); border-color: var(--warn); color: #fff; font-weight: 700; }
.op-not.on { background: var(--critical); border-color: var(--critical); color: #fff; font-weight: 700; }
.op-na.on { background: var(--text-muted); border-color: var(--text-muted); color: #fff; }
.pill.rel { background: var(--ai-bg); border-color: var(--ai-border); color: var(--brand-2); }
details.more-comps { margin-top: 8px; }
details.more-comps summary { color: var(--accent); padding: 6px 0; }
.db-figs { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.big-score { font-size: 2.4rem; }
.obj-frac { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .9rem; }

/* קצב והספק */
.pace-bar { position: relative; display: inline-block; width: 110px; height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; vertical-align: middle; }
.pb-done { position: absolute; top: 0; bottom: 0; right: 0; background: var(--series-1); border-radius: 5px; }
.pb-exp { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-right: -1px; background: var(--series-2); border-radius: 2px; }

/* ספירה לפי מדריך */
.count-tbl td.num, .count-tbl th { text-align: center; font-variant-numeric: tabular-nums; }
.count-tbl td:first-child, .count-tbl th:first-child { text-align: right; }
.count-tbl .total-row td { font-weight: 700; background: var(--surface-2); }

/* עוגה ונרות */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut { max-width: 100%; height: auto; flex: none; }
.donut .donut-c { fill: var(--text); font-size: 26px; font-weight: 800; }
.donut .axis { fill: var(--text-muted); font-size: 12px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.donut-legend li { display: grid; grid-template-columns: 12px 1fr auto 42px; gap: 8px; align-items: center; font-size: .9rem; }
.donut-legend i { width: 12px; height: 12px; border-radius: 3px; }
.donut-legend b { font-variant-numeric: tabular-nums; }
.donut-legend small { color: var(--text-muted); text-align: left; font-variant-numeric: tabular-nums; }
.candle-key { margin: 4px 0 0; }
.ig-grid .ig-wide { grid-column: 1 / -1; }

/* ===== עמוד ראשי פשוט: שלושה כפתורים ענקיים ===== */
.home { max-width: 1240px; padding-top: 12px; }
.home-actions { gap: 24px; margin: 8px 0 28px; }
.home-btn { min-height: clamp(240px, 46vh, 440px); border-radius: 28px; border-width: 3px; gap: 14px; }
.hb-icon { font-size: clamp(3.5rem, 8vw, 6rem); }
.hb-title { font-size: clamp(1.8rem, 3.6vw, 2.8rem); }
.home-btn.primary { box-shadow: 0 8px 24px rgba(42, 120, 214, .35); }
@media (max-width: 760px) {
  .home-actions { gap: 14px; }
  .home-btn { min-height: 150px; flex-direction: row; gap: 18px; }
}
.in-progress { margin-bottom: 20px; }
.in-progress h2 { font-size: 1.15rem; margin: 0 0 10px; }
.ip-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ip-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-radius: 16px; background: var(--mid-bg); border: 2px solid var(--warn); color: var(--text); }
.ip-item:hover { text-decoration: none; filter: brightness(1.03); }
.ip-who { font-size: 1.2rem; font-weight: 700; }
.ip-go { margin-top: 4px; font-weight: 700; color: var(--mid-fg); }
.home .ip-find { display: flex; gap: 8px; align-items: center; justify-content: center; flex-direction: row; color: var(--text-muted); font-size: .9rem; }
.home .ip-find label { flex-direction: row; }
.home .ip-find input { width: 90px; }
.hb-title { font-weight: 700; }
/* כרטיסי גיחות שלא סוכמו */
.ip-item { cursor: pointer; }
.ip-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ip-who { font-size: 1.35rem; }
.ip-instr { font-size: 1.05rem; font-weight: 600; color: var(--text-2); }
.ip-time { font-size: .9rem; color: var(--mid-fg); }
.ip-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ip-foot .serial { margin-right: auto; font-size: .8rem; }
.ip-item.stale { background: var(--bad-bg); border-color: var(--critical); }
.ip-item.stale .ip-time { color: var(--bad-fg); font-weight: 600; }
.ip-more { margin: 10px 0 0; font-weight: 600; }
.ip-more { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.ip-stale-note { color: var(--bad-fg); background: var(--bad-bg); border-radius: 999px; padding: 2px 12px; font-size: .88rem; }

/* ===== מסגרות ===== */
.frame-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-left: 8px; vertical-align: middle; flex: none; }
.frame-head { display: flex; align-items: center; font-size: 1.2rem; margin: 22px 0 10px; }
.frame-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.frame-pill { background: var(--ai-bg); border-color: var(--ai-border); color: var(--brand-2); font-weight: 600; }
.frames-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.frames-grid > .card { margin: 0; }
.frame-card h2 { display: flex; align-items: center; }
.frame-facts { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-2); margin-bottom: 10px; font-size: .92rem; }
.num-in { width: 64px; text-align: center; }
.ready-card { border: 2px solid var(--good); }
.frame-strip { padding: 10px 0; }
.frame-strip + .frame-strip { border-top: 1px dashed var(--border); }
.frame-strip.past { opacity: .75; }
.fs-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.live-group { margin: 22px 0 8px; font-size: 1.15rem; }
.grid2.flat { margin: 0; }
.mix-toggle { margin: 4px 0 10px; font-weight: 600; color: var(--text); font-size: .95rem; }
.mix-toggle input { width: 18px; height: 18px; }
.run-head > div { min-width: 0; flex: 1 1 240px; overflow-wrap: anywhere; }
.live-title { min-width: 0; }
.live-title h3 { overflow-wrap: anywhere; }
.note-input select { max-width: 100%; }

/* תקופות ומחזורים */
.term-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.term-bar { position: relative; width: 160px; max-width: 100%; height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.term-bar > div { position: absolute; top: 0; bottom: 0; right: 0; background: var(--series-2); }
.cohorts { display: grid; gap: 12px; }
.cohort { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); min-width: 0; }
.cohort.due { border-color: var(--critical, #d33); }
.cohort-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.cohort .btn { white-space: normal; text-align: start; }
.txt-bad { color: var(--critical, #d33); }
.end-panel { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.end-panel .row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.end-panel select { max-width: 100%; }

/* תפריט המשתמש המחובר */
.who { position: relative; }
button.who-chip { font: inherit; cursor: pointer; }
button.who-chip:hover, button.who-chip:focus-visible { background: rgba(255,255,255,.24); outline: none; }
.who-caret { font-size: .75em; opacity: .8; }
.who-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 220px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; white-space: nowrap; }
.who-menu[hidden] { display: none; }
.who-menu a, .who-menu button { display: block; text-align: start; padding: 9px 12px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.who-menu a:hover, .who-menu button:hover, .who-menu a:focus-visible, .who-menu button:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }

/* עמוד ראשי — הכפתורים במרכז המסך */
.page-home { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 120px); min-height: calc(100dvh - 120px); padding-bottom: 70px; }
.page-home .home { width: 100%; }

/* מספר גרסה בתחתית */
.app-foot { text-align: center; color: var(--text-2); font-size: .78rem; padding: 0 16px 14px; margin-top: -60px; }
.page-home + .app-foot { margin-top: -50px; }

/* גרסאות ופיתוח */
.ver-current { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ver-num { font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.ver-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .ver-grid { grid-template-columns: 1fr; } }
.ver-grid > * { min-width: 0; }
.ver-log, .roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ver-log > li { border-inline-start: 3px solid var(--border); padding-inline-start: 12px; }
.ver-log > li.cur { border-color: var(--accent); }
.ver-log ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--text-2); }
.ver-log ul li { margin: 2px 0; }
.ver-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ver-tag { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; font-weight: 700; font-size: .9rem; }
.roadmap > li { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.roadmap > li p { margin: 4px 0 0; }
.roadmap > li.rm-doing { border-color: var(--accent); }
