/* ===== המגע המרפא — עיצוב v1 · 60/30/10: #F4F5F1 / #02828B / #94C021 ===== */
:root {
  --teal: #02828B;
  --teal-dark: #026068;
  --lime: #94C021;
  --bg: #F4F5F1;
  --card: #FFFFFF;
  --ink: #1F2A2C;
  --muted: #6B7A7C;
  --red: #C0392B;
  --yellow: #D89B00;
  --green: #4E9F3D;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(2,130,139,.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Heebo', sans-serif;
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  min-height: 100vh;
}
#app { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* ---- Top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--teal); color: #fff;
  padding: 12px 20px; border-radius: var(--radius);
  margin-bottom: 18px; box-shadow: var(--shadow);
  flex-wrap: wrap; gap: 8px;
}
.topbar .brand { font-weight: 700; font-size: 1.15rem; }
.topbar .brand span { color: var(--lime); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: #fff; text-decoration: none; padding: 6px 12px;
  border-radius: 8px; font-size: .92rem;
}
.topbar nav a:hover, .topbar nav a.active { background: rgba(255,255,255,.18); }
.topbar .user { font-size: .85rem; opacity: .9; }

/* ---- Cards / layout ---- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.grid { display: grid; gap: 14px; }
.grid.cols2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
h1 { font-size: 1.5rem; margin-bottom: 12px; color: var(--teal-dark); }
h2 { font-size: 1.2rem; margin: 14px 0 8px; color: var(--teal-dark); }
h3 { font-size: 1.02rem; margin: 10px 0 6px; }
p, li { line-height: 1.55; }
.muted { color: var(--muted); font-size: .9rem; }
hr { border: none; border-top: 1px solid #e4e7e2; margin: 14px 0; }

/* ---- Buttons ---- */
button, .btn {
  font-family: inherit; font-size: .95rem; cursor: pointer;
  background: var(--teal); color: #fff; border: none;
  padding: 10px 18px; border-radius: 10px; text-decoration: none;
  display: inline-block; transition: filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button.lime { background: var(--lime); color: #223300; font-weight: 600; }
button.ghost { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
button.danger { background: var(--red); }
button.small { padding: 5px 12px; font-size: .84rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Forms ---- */
label { display: block; margin: 10px 0 4px; font-weight: 500; font-size: .92rem; }
input, select, textarea {
  font-family: inherit; font-size: .95rem; width: 100%;
  padding: 9px 12px; border: 1.5px solid #d9ded8; border-radius: 10px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; min-width: 140px; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.green { background: #e6f4e2; color: var(--green); }
.badge.yellow { background: #fdf3d7; color: var(--yellow); }
.badge.red { background: #fbe3e0; color: var(--red); }
.badge.teal { background: #e0f1f2; color: var(--teal-dark); }
.badge.lime-badge { background: #f0f7d8; color: #3f5c0c; }

/* ---- Checklist ---- */
.checkitem {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1.5px solid #e4e7e2; border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; background: #fff;
}
.checkitem:hover { border-color: var(--teal); }
.checkitem input { width: auto; margin-top: 4px; }
.checkitem.checked { border-color: var(--lime); background: #f7fbec; }

/* ---- Root selection ---- */
.root-card { border: 2px solid #e4e7e2; border-radius: var(--radius); padding: 14px; cursor: pointer; background: #fff; }
.root-card:hover { border-color: var(--teal); }
.root-card.selected { border-color: var(--lime); background: #f7fbec; }
.root-card .rid { font-size: .75rem; color: var(--muted); letter-spacing: .5px; }

/* ---- Alerts ---- */
.alert { padding: 14px 16px; border-radius: 10px; margin: 10px 0; font-weight: 500; }
.alert.red { background: #fbe3e0; color: var(--red); border-right: 4px solid var(--red); }
.alert.yellow { background: #fdf3d7; color: #7a5b00; border-right: 4px solid var(--yellow); }
.alert.green { background: #e6f4e2; color: #2d5c24; border-right: 4px solid var(--green); }
.alert.teal { background: #e0f1f2; color: var(--teal-dark); border-right: 4px solid var(--teal); }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: right; padding: 8px 10px; border-bottom: 1px solid #eceeea; }
th { color: var(--teal-dark); font-weight: 600; background: #f8faf6; }

/* ---- Patient today view ---- */
.streak {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, var(--teal), var(--teal-dark));
  color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px;
}
.streak .num { font-size: 2rem; font-weight: 700; color: var(--lime); }
.exercise-item {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1.5px solid #e4e7e2; border-radius: 12px;
  padding: 14px; margin-bottom: 10px;
}
.exercise-item.done { border-color: var(--lime); background: #f7fbec; }
.exercise-item .check {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--teal);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-weight: 700; color: #fff;
}
.exercise-item.done .check { background: var(--lime); border-color: var(--lime); }
.pain-scale { display: flex; gap: 5px; flex-wrap: wrap; }
.pain-scale button {
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background: #fff; color: var(--ink); border: 1.5px solid #d9ded8;
}
.pain-scale button.sel { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ---- Diagnosis test loop (1.2) ---- */
.conf-card { background: linear-gradient(120deg,#e0f1f2,#f0f7d8); border: 1.5px solid #cfe3c4; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.conf-card.ready { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(148,192,33,.25); }
.conf-pct { font-size: 1.5rem; font-weight: 800; color: var(--teal-dark); }
.conf-pct.ok { color: var(--lime-d, #6f8f16); }
.conf-bar { height: 12px; background: #dfe6da; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.conf-bar span { display: block; height: 100%; background: linear-gradient(90deg,var(--teal),var(--teal-dark)); transition: width .3s; border-radius: 999px; }
.conf-bar span.ok { background: linear-gradient(90deg,var(--lime),#6f8f16); }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1.5px solid #e4e7e2; border-radius: 10px; cursor: pointer; background: #fff; }
.rank-row:hover { border-color: var(--teal); }
.rank-row.lead { border-color: var(--lime); background: #f7fbec; }
.rank-pct { font-weight: 800; color: var(--teal-dark); min-width: 44px; }
.rank-name { flex: 1; font-size: .95rem; font-weight: 600; }
.test-list { display: flex; flex-direction: column; gap: 6px; }
.test-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid #eceeea; border-radius: 10px; background: #fbfcfa; }
.test-row.focus { border-color: #cfe3c4; background: #f7fbec; }
.test-name { flex: 1; font-size: .9rem; }
.focus-tag { background: var(--lime); color: #223300; font-size: .66rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.vid-btn { flex: 0 0 auto; width: 30px; height: 30px; padding: 0; border-radius: 50%; background: var(--teal); color: #fff; font-size: .8rem; }
.yn { display: flex; gap: 5px; flex: 0 0 auto; }
.ynbtn { padding: 5px 12px; font-size: .82rem; background: #fff; color: var(--muted); border: 1.5px solid #d9ded8; }
.ynbtn.pos { background: var(--green); color: #fff; border-color: var(--green); }
.ynbtn.neg { background: var(--red); color: #fff; border-color: var(--red); }
.vid-placeholder { background: #1c2426; color: #fff; border-radius: 12px; padding: 34px 10px; font-size: 2rem; }
.vid-placeholder span { display: block; font-size: .85rem; opacity: .8; margin-top: 6px; }

/* ---- Wizard steps ---- */
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.step-dot {
  padding: 5px 13px; border-radius: 999px; font-size: .8rem;
  background: #e4e7e2; color: var(--muted);
}
.step-dot.active { background: var(--teal); color: #fff; }
.step-dot.done { background: var(--lime); color: #223300; }

/* ---- Recovery timeline (2.1) ---- */
.timeline { position: relative; padding-inline-start: 8px; }
.tl-node { display: flex; gap: 12px; padding-bottom: 14px; position: relative; }
.tl-node:not(:last-child)::before { content: ''; position: absolute; right: 22px; top: 30px; bottom: 0; width: 2px; background: #e0e5db; }
.tl-dot { flex: 0 0 30px; height: 30px; border-radius: 50%; background: #e4e7e2; color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1; }
.tl-node.current .tl-dot { background: var(--teal); color: #fff; }
.tl-node.done .tl-dot { background: var(--lime); color: #223300; }
.tl-body { flex: 1; font-size: .92rem; }
.tl-body > div { color: var(--muted); margin-top: 2px; }
.tl-feel { background: #f7fbec; border-radius: 8px; padding: 6px 10px; margin-top: 6px; color: #3f5c0c !important; font-size: .85rem; }

/* ---- Exercise library by equipment (2.2) ---- */
.ex-lib { border: 1px solid #e4e7e2; border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.ex-lib-head { padding: 10px 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; background: #fbfcfa; }
.ex-lib-caret { margin-inline-start: auto; transition: transform .2s; }
.ex-lib.open .ex-lib-caret { transform: rotate(180deg); }
.ex-lib-body { max-height: 0; overflow: hidden; transition: max-height .25s; }
.ex-lib.open .ex-lib-body { max-height: 320px; }
.equip { padding: 8px 12px 12px; }
.equip-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: .88rem; }
.equip-row.rec { background: #f7fbec; }
.equip-lvl { flex: 0 0 60px; font-weight: 600; color: var(--teal-dark); }
.equip-eq { flex: 1; }
.equip-stars { color: var(--lime-d, #6f8f16); letter-spacing: 1px; }
.equip-rec { background: var(--lime); color: #223300; font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.equip-tip { margin-top: 8px; font-size: .84rem; color: var(--teal-dark); background: #e0f1f2; border-radius: 8px; padding: 8px 10px; }

/* ---- Auth ---- */
.auth-wrap { max-width: 420px; margin: 8vh auto; }
.auth-logo { text-align: center; margin-bottom: 18px; }
.auth-logo .big { font-size: 1.7rem; font-weight: 700; color: var(--teal-dark); }
.auth-logo .big span { color: var(--lime); }

/* ---- Course ---- */
.course-content { max-width: 820px; }
.course-content img { max-width: 100%; }
.course-content table { font-size: .85rem; }
.course-content code { background: #eef1ec; padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.course-content blockquote { border-right: 3px solid var(--lime); padding: 4px 12px; color: var(--muted); margin: 8px 0; }

/* ---- פס דמו ---- */
.demo-strip {
  background: #223300; color: #d9f18f; font-size: .8rem;
  text-align: center; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px;
}
.demo-strip a { color: var(--lime); }

/* ---- מסך כניסה דמו ---- */
.logo-circle {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; box-shadow: var(--shadow);
}
.demo-entry {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: #fff; color: var(--ink); border: 2px solid #e4e7e2;
  border-radius: var(--radius); padding: 16px; margin-top: 12px;
  text-align: right; font-size: .95rem;
}
.demo-entry:hover { border-color: var(--teal); filter: none; background: #f2f9f9; }
.demo-entry .ic {
  font-size: 1.7rem; width: 52px; height: 52px; flex-shrink: 0;
  background: #e0f1f2; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}

/* ---- ניווט תחתון (מובייל — כמו אפליקציה) ---- */
.bottomnav {
  display: none; position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
  background: #fff; border-top: 1px solid #e4e7e2;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(0,0,0,.07);
}
.bottomnav a {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--muted); font-size: .68rem; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px; border-radius: 10px;
}
.bottomnav a .ic { font-size: 1.35rem; }
.bottomnav a.active { color: var(--teal); }
.bottomnav a.active .ic { transform: scale(1.12); }

/* ---- מובייל ---- */
@media (max-width: 768px) {
  #app { padding: 8px 8px 84px; }
  .card { padding: 16px 14px; }
  .topbar { position: sticky; top: 8px; z-index: 40; padding: 10px 14px; }
  .topbar nav { display: none; }
  .topbar .user { font-size: .78rem; }
  .bottomnav { display: flex; }
  button, .btn { padding: 12px 18px; }
  h1 { font-size: 1.3rem; }
  .grid.cols2, .grid.cols3 { grid-template-columns: 1fr; }
  .pain-scale button { width: 34px; height: 34px; }
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* מבחני הכרעה מובנים (אשף אבחון · שלב תמונת כאב) */
.decis-block{background:#f0f7f8;border:1px solid #d6e6e6;border-radius:12px;padding:12px 14px;margin:10px 0}
.decis-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px dashed #cfe0e0}
.decis-row:last-of-type{border-bottom:none}
.decis-q{font-weight:600;color:var(--teal-dark);flex:1 1 auto}
.decis-opts{display:flex;gap:6px;flex:0 0 auto;flex-wrap:wrap}

/* אופק שיקום לפי משפחת רקמה (ציר-זמן) */
.fam-horizon{background:linear-gradient(120deg,#e0f1f2,#f0f7d8);border:1px solid #cfe0e0;border-radius:12px;padding:12px 14px;margin-bottom:12px}
.fam-tag{display:inline-block;background:var(--teal);color:#fff;font-size:.75rem;font-weight:700;border-radius:20px;padding:2px 12px;margin-inline-end:8px}
.tl-wk{color:var(--teal-dark);font-size:.8rem;font-weight:600;margin-inline-start:6px}
