/* styles.css — עיצוב כהה בסגנון WHOOP, עברית RTL, בנוי קודם כול לאייפון */

:root {
  --bg: #101518;          /* תחתית מעבר הרקע הרשמי #283339 → #101518 */
  --bg-top: #283339;
  --surface: #1A2127;
  --surface-2: #222B32;
  --line: #2B353D;
  --text: #FFFFFF;
  --muted: #8A9099;

  /* צבעי המדדים — זהים לשפה הוויזואלית של WHOOP */
  --green: #16EC06;
  --yellow: #FFDE00;
  --red: #FF0026;
  --strain: #0093E7;
  --sleep: #7BA1BB;

  /* מהנחיות המותג: Teal לכפתורי פעולה, הדגשות, הערכות חיוביות וצורך שינה;
     Recovery Blue לנתוני התאוששות שאין להם דירוג (HRV, דופק במנוחה, נשימה…) */
  --teal: #00F19F;
  --recovery-blue: #67AEE6;

  --deep: #0060A8;
  --rem: #3FA9F5;
  --light: #9FC7E8;
  --awake: #454C55;

  --radius: 16px;
  --tabbar: 58px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

a { color: inherit; text-decoration: none; }

/* מספר עם יחידה לטינית ("34 ms") מתהפך בתוך פסקה עברית.
   plaintext קובע את כיוון כל ערך לפי התו החזק הראשון שבו, ולכן
   "34 ms" נשאר LTR ו"7 שע׳ 49 דק׳" נשאר RTL — בלי לעטוף כל ערך ביד. */
.v, .rv, .m-value, .tc-last, .w-strain, .i-delta, .big, .sl-val, .zval, .ring-value {
  unicode-bidi: plaintext;
}

html { background: var(--bg); }

body {
  margin: 0;
  /* מעבר הרקע מהנחיות המותג; נגלל עם התוכן כי iOS מתעלם מ-background-attachment: fixed */
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg) 520px) no-repeat, var(--bg);
  color: var(--text);
  font-family: 'Heebo', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  direction: rtl;
  /* מונע את ה"גומי" של iOS שמושך את כל העמוד ומגלה רקע לבן */
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* גובה מלא אמיתי באייפון — 100vh שקרי כשסרגל ספארי מוצג */
#app {
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 8px) 14px calc(var(--tabbar) + var(--safe-bottom) + 24px);
  max-width: 560px;
  margin-inline: auto;
}

/* ייחוס חובה לפי הנחיות המותג של WHOOP ("Data by WHOOP"). כפסאודו-אלמנט הוא
   שורד כל רינדור מחדש של המסך, בלי שכל תצוגה תצטרך לזכור להוסיף אותו. */
#app::after {
  content: "Data by WHOOP";
  display: block; margin-top: 28px; text-align: center; direction: ltr;
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; opacity: .7;
}

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- כותרת עליונה ---------- */

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 2px 14px;
}
.wordmark { font-weight: 900; font-size: 15px; letter-spacing: .26em; }
.who { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar .date { color: var(--muted); font-size: 13px; text-align: left; }

.page-title { font-size: 26px; font-weight: 900; margin: 2px 0 14px; letter-spacing: -0.02em; }
.section-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .12em; margin: 26px 2px 10px; text-transform: uppercase;
}

/* ---------- כרטיסים ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.recovery { background: var(--green); }
.dot.sleep { background: var(--sleep); }
.dot.strain { background: var(--strain); }

.big { font-size: 42px; font-weight: 900; line-height: 1.05; letter-spacing: -0.03em; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

.rows { margin-top: 14px; display: grid; gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; background: var(--surface); font-size: 14px;
}
.rk { color: var(--muted); }
.rv { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- גיבור: טבעת ההתאוששות ---------- */

.hero {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 18px 16px; margin-bottom: 12px;
}
.hero-body { flex: 1; min-width: 0; }
.hero .label { color: var(--muted); font-size: 12px; letter-spacing: .1em; font-weight: 700; }
.hero .headline { font-size: 22px; font-weight: 900; margin: 4px 0 10px; letter-spacing: -0.02em; }

.ring { flex: none; }
.ring-value { font-size: 34px; font-weight: 900; font-family: inherit; }
.ring-sub { font-size: 11px; fill: var(--muted); font-weight: 600; }
.mini-ring-text { font-size: 15px; font-weight: 800; }

.vitals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.vital .k { color: var(--muted); font-size: 11px; }
.vital .v { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.vital .delta { font-size: 11px; font-weight: 600; }
.delta.good { color: var(--teal); }
.delta.bad { color: var(--red); }
.delta.flat { color: var(--muted); }

/* ---------- שלושת המדדים הראשיים ---------- */

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; cursor: pointer;
}
.metric:active { background: var(--surface-2); }
.metric .m-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.metric .m-value { font-size: 26px; font-weight: 900; margin-top: 6px; font-variant-numeric: tabular-nums; }
.metric .m-sub { color: var(--muted); font-size: 11px; margin-top: 2px; }

/* ---------- גרפים ---------- */

.spark { width: 100%; height: 56px; display: block; }
.strain-scale { width: 100%; height: 58px; display: block; }
.axis { fill: var(--muted); font-size: 9px; font-weight: 600; }

.linechart { position: relative; }
.linechart svg { width: 100%; height: 190px; display: block; }
.chart-range {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; margin-top: 2px;
}
.chart-empty { color: var(--muted); font-size: 13px; padding: 22px 0; text-align: center; }

.barchart { display: flex; align-items: flex-end; gap: 2px; }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; border-radius: 2px; }

.trends { display: grid; gap: 10px; }
.trend-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 6px; }
.tc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.tc-title { font-size: 13px; color: var(--muted); font-weight: 700; }
.tc-last { font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }

/* ---------- שלבי שינה ואזורי דופק ---------- */

.stages-bar, .zones {
  display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); margin: 10px 0;
}
.stages-bar span, .zones span { display: block; height: 100%; }
.stages-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; }
.sl { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.sl-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.sl-label { color: var(--muted); }
.sl-val { margin-inline-start: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-pct { color: var(--muted); min-width: 34px; text-align: left; font-variant-numeric: tabular-nums; }

.zones-detail { display: grid; gap: 7px; margin-top: 10px; }
.zrow { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.zdot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.zlabel { color: var(--muted); min-width: 48px; }
.zbar { flex: 1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.zbar i { display: block; height: 100%; }
.zval { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 42px; text-align: left; }

/* ---------- אימונים ---------- */

.workout {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
}
.w-main { flex: 1; min-width: 0; }
.w-name { font-weight: 800; font-size: 15px; }
.w-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.w-strain { font-weight: 900; font-size: 20px; color: var(--strain); font-variant-numeric: tabular-nums; }

/* ---------- יומן ---------- */

.day-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.day-nav .d-label { font-weight: 800; font-size: 16px; }
.nav-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  width: 40px; height: 40px; border-radius: 12px; font-size: 18px; cursor: pointer;
}
.nav-btn:disabled { opacity: .35; }

.j-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 6px;
}
.j-label { font-size: 14px; flex: 1; }

/* מתג בסגנון iOS — 44px גובה מגע, כמו שאפל דורשת */
.toggle { position: relative; width: 52px; height: 31px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; }
.toggle .track {
  position: absolute; inset: 0; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; transition: background .2s;
}
/* ב-RTL צד ההתחלה הוא ימין: כבוי = ידית מימין, דלוק = זזה שמאלה.
   transform לא מתהפך לפי כיוון, לכן ההזזה שלילית בשני המקרים. */
.toggle .knob {
  position: absolute; top: 3px; inset-inline-start: 3px; width: 25px; height: 25px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.toggle input:checked ~ .track { background: var(--teal); border-color: var(--teal); }
.toggle input:checked ~ .knob { transform: translateX(-21px); }

.scale-pick { display: flex; gap: 6px; }
.scale-pick button {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px;
}
.scale-pick button[aria-pressed="true"] { background: var(--teal); color: #000; border-color: var(--teal); }

.num-input {
  width: 72px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); text-align: center;
  font-size: 16px; /* 16px ומעלה מונע זום אוטומטי בשדה טקסט ב-iOS */
  font-family: inherit;
}

.insight {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
}
.insight .i-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.insight .i-label { font-weight: 700; font-size: 14px; }
.insight .i-delta { font-weight: 900; font-size: 17px; font-variant-numeric: tabular-nums; }
.insight .i-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---------- פקדים ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #000; font-weight: 800; font-size: 16px;
  padding: 14px 22px; border-radius: 999px; border: 0; text-decoration: none;
  min-height: 48px; cursor: pointer; font-family: inherit;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: .5; }

.btn-sm {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 14px; font-size: 14px; font-weight: 700;
  min-height: 40px; cursor: pointer; font-family: inherit;
}

select, input[type="time"] {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font-size: 16px; font-family: inherit; min-height: 40px;
}

.segmented {
  display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; margin-bottom: 14px;
}
.segmented button {
  flex: 1; background: transparent; border: 0; color: var(--muted);
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 9px 4px;
  border-radius: 9px; min-height: 38px; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); }

.set-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; }
.set-line label { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ---------- מצבים ---------- */

.loading, .empty { color: var(--muted); text-align: center; padding: 40px 12px; font-size: 14px; }
.notice {
  background: rgba(255, 0, 38, .1); border: 1px solid rgba(255, 0, 38, .35);
  border-radius: 12px; padding: 14px; font-size: 14px; margin-bottom: 12px;
}
.notice.info { background: rgba(0, 147, 231, .1); border-color: rgba(0, 147, 231, .35); }

.connect { text-align: center; padding: 15vh 10px; }
.connect h1 { font-size: 28px; margin-bottom: 10px; }
.connect p { color: var(--muted); font-size: 15px; margin-bottom: 26px; }

.progress { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--teal); transition: width .3s; }

/* ---------- סרגל ניווט תחתון ---------- */

.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tabbar) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(16, 21, 24, .92);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); text-decoration: none; font-size: 10px; font-weight: 700;
  background: none; border: 0; font-family: inherit; cursor: pointer;
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.tab[aria-current="page"] { color: var(--text); }

/* ---------- משיכה לרענון ---------- */

.ptr {
  position: fixed; top: calc(var(--safe-top) + 6px); inset-inline: 0; z-index: 40;
  display: flex; justify-content: center; pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.ptr.on { opacity: 1; }
.ptr span {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; font-size: 12px; color: var(--muted);
}

/* ---------- מדדי הבוקר מתחת לחוגות ---------- */

.vitals-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 8px; margin-bottom: 12px;
}
.vitals-strip:active { background: var(--surface-2); }
.vitals-cell { text-align: center; min-width: 0; }
/* התווית נשברת לשתי שורות בעמודה צרה; הסמל נשאר צמוד למילה האחרונה */
.vc-label { color: var(--muted); font-size: 10px; line-height: 1.3; }
.vc-label .info-btn { width: 13px; height: 13px; font-size: 9px; margin-inline-start: 3px; }
.vc-value { font-weight: 800; font-size: 16px; margin-top: 3px; unicode-bidi: plaintext; white-space: nowrap; }
.vc-delta { font-size: 9px; line-height: 1.3; margin-top: 2px; min-height: 12px; }

/* ---------- ציר זמן יומי ---------- */

.timeline svg { width: 100%; height: 72px; display: block; border-bottom: 2px solid var(--line); }
.timeline-axis {
  display: flex; justify-content: space-between;
  color: var(--muted); font-size: 10px; font-weight: 600;
  font-variant-numeric: tabular-nums; margin-top: 4px;
}
.tl-list { display: grid; gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; margin-top: 12px; }
.tl-item { display: flex; align-items: center; gap: 10px; background: var(--surface-2); padding: 8px 12px; font-size: 13px; }
.tl-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.tl-name { flex: 1; font-weight: 700; min-width: 0; }
.tl-strain { font-weight: 800; color: var(--strain); font-variant-numeric: tabular-nums; }

/* ---------- רשימת אזורי דופק ---------- */

.zone-list { display: grid; gap: 12px; margin-top: 12px; }
.zone-row { display: flex; align-items: flex-start; gap: 10px; }
.zone-row .zdot { width: 10px; height: 10px; border-radius: 3px; flex: none; margin-top: 5px; }
.zone-main { flex: 1; min-width: 0; }
.zone-head { display: flex; align-items: baseline; gap: 8px; }
.zone-name { font-weight: 800; font-size: 14px; }
.zone-range { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.zone-desc { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 1px; }
.zone-time { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; unicode-bidi: plaintext; }

/* ---------- מרכיבי ציון (מסך השינה) ---------- */

.comp { margin-bottom: 14px; }
.comp:last-child { margin-bottom: 0; }
.comp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.comp-label { font-size: 14px; }
.comp-value { font-weight: 800; font-size: 15px; unicode-bidi: plaintext; white-space: nowrap; }
.comp-value small { font-weight: 600; font-size: 12px; opacity: .85; }
.comp-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.comp-bar i { display: block; height: 100%; border-radius: 4px; transition: width .4s; }

/* ---------- רצף, חוגות, היום שלי והלוח ---------- */

.streak {
  display: inline-flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700;
  margin-bottom: 12px;
}

.dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.dial {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px 14px;
}
.dial:active { background: var(--surface-2); }
.dial .ring { width: 96px; height: 96px; }
.dial .ring-value { font-size: 23px; }
.dial-label { font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; }
.dial-sub { font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3; }

.day-card {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px;
}
.dc-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.dc-main { font-size: 26px; font-weight: 900; margin-top: 6px; letter-spacing: -0.02em; }
.dc-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.edit-btn {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700;
  font-family: inherit; letter-spacing: 0; text-transform: none; cursor: pointer; min-height: 32px;
}

.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dash-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 12px 8px; min-width: 0;
}
.dt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.dt-label { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; align-items: center; min-width: 0; }
.dt-value { font-size: 19px; font-weight: 900; font-variant-numeric: tabular-nums; unicode-bidi: plaintext; white-space: nowrap; }
.dt-delta { font-size: 11px; font-weight: 600; min-height: 15px; margin-top: 2px; }
.dash-tile .spark { height: 40px; }
.dash-tile .chart-empty { padding: 10px 0; font-size: 11px; }

.edit-list { display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.edit-row { display: flex; align-items: center; gap: 10px; background: var(--surface-2); padding: 8px 12px; }
.edit-name { flex: 1; font-size: 14px; font-weight: 600; }
.edit-row button {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: 16px; font-family: inherit; cursor: pointer;
}
.edit-row button:disabled { opacity: .3; }
.edit-move { display: flex; gap: 6px; }
.edit-x { color: var(--red) !important; }
.edit-add { color: var(--teal) !important; }

/* ---------- כפתור ⓘ ולוח מידע ---------- */

.info-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; flex: none;
  margin-inline-start: 6px; vertical-align: middle;
  border: 1.5px solid currentColor; border-radius: 50%;
  color: var(--muted); opacity: .8;
  font: italic 700 11px/1 Georgia, 'Times New Roman', serif;
  /* הכפתור יושב גם בכותרות עם ריווח אותיות ואותיות רישיות — מאפסים */
  letter-spacing: 0; text-transform: none;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
/* אזור מגע של 44px כנדרש באייפון, בלי להגדיל את הסמל עצמו */
.info-btn::after { content: ''; position: absolute; inset: -14px; }
.info-btn:active, .info-btn:focus-visible { color: var(--text); opacity: 1; outline: none; }

/* בעמודות הצרות של המדדים החיוניים התווית והסמל חייבים להישאר בשורה אחת —
   שבירה לשורה שנייה הופכת את כל הרשת ללא אחידה */
/* רק תווית של מילה אחת; טקסט עם רווחים חייב להישאר inline כדי לא לאבד אותם */
.metric .m-label { display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.vital .k .info-btn, .metric .info-btn { width: 15px; height: 15px; font-size: 10px; margin-inline-start: 4px; }
.nowrap { white-space: nowrap; }
/* minmax(0,…) ולא 1fr: אחרת תוכן ארוך מותח את העמודה אל מחוץ לכרטיס */
.vitals { grid-template-columns: repeat(2, minmax(0, 1fr)); }

html.sheet-lock, html.sheet-lock body { overflow: hidden; }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 99;
  background: rgba(0, 0, 0, .6);
  opacity: 0; transition: opacity .22s;
}
.sheet-backdrop.open { opacity: 1; }

.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 100;
  max-width: 560px; margin-inline: auto; max-height: 82dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 20px 20px 0 0;
  padding-bottom: var(--safe-bottom);
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.sheet.open { transform: none; }

.sheet-handle { width: 36px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 18px 6px; flex: none; }
.sheet-head h3 { font-size: 21px; font-weight: 900; }
.sheet-close {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; font-family: inherit;
}
.sheet-body {
  overflow-y: auto; padding: 6px 18px 24px;
  font-size: 15px; line-height: 1.65;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.sheet-body p { margin: 0 0 12px; }

.info-rows { display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; margin: 4px 0 14px; }
.info-row { background: var(--surface-2); padding: 10px 14px; }
.ir-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ir-name { font-weight: 800; }
.ir-range { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ir-text { color: var(--muted); font-size: 13px; margin-top: 2px; }

.info-note {
  background: rgba(0, 147, 231, .1); border: 1px solid rgba(0, 147, 231, .3);
  border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- שמות הציונים של WHOOP ----------
   השם הרשמי באנגלית ומתחתיו התרגום — במקומות צרים (חוגות, אריחים). */
.sn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; }
.sn-en { direction: ltr; letter-spacing: .02em; }
.sn-he { font-size: .85em; font-weight: 600; opacity: .8; }
.dt-label .sn { align-items: flex-start; }

/* ---------- הצעת התקנה (אנדרואיד ומחשב) ---------- */
.install-toast {
  position: fixed; z-index: 40;
  inset-inline: 12px; bottom: calc(var(--tabbar) + var(--safe-bottom) + 10px);
  max-width: 536px; margin-inline: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  font-size: 14px; font-weight: 600;
}
.install-toast span { flex: 1; }
.install-toast .btn-sm { background: var(--teal); color: #000; border-color: var(--teal); }
.install-x {
  background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1;
  width: 36px; height: 36px; cursor: pointer; font-family: inherit;
}
