/* ================================================================
   DELTA — מערכת עיצוב: "יוקרה כהה" (בהשראת WHOOP / OURA)
   פחם כמעט-שחור עם גוון ירקרק, כרטיסים בשכבות עדינות, וזהב שמפניה
   כאקסנט היחיד. הכל נשען על טוקנים — אף מסך לא מגדיר צבע משלו.
   שני עקרונות מבניים שנשארו: רשימות מופרדות בקו שיער ולא בכרטיס
   לכל שורה, ומספרים עומדים בפני עצמם בלי אריח מסביב.
   יש ערכה אחת בלבד (כהה) — כמו WHOOP/OURA; color-scheme: dark
   גורם גם לפקדים המובנים (תאריך, גלילה) להיות כהים.
   ================================================================ */
:root {
    color-scheme: dark;

    --bg:        #0c0f0e;
    --bg-soft:   #111514;
    --card:      #151a18;
    --card-2:    #1c2220;
    --line:      #232a27;
    --text:      #f1ede4;
    --muted:     #bdb7ab;
    --dim:       #8a918d;

    --accent:      #d9b779;   /* זהב שמפניה — כפתורים, מצב פעיל, הסמל */
    --accent-ink:  #e6c994;   /* אותו גוון, בהיר מספיק לטקסט קטן על כהה */
    --accent-2:    #f0dcae;
    --accent-deep: #f6ecd6;
    --on-accent:   #17130b;   /* טקסט על משטח זהב */
    --ink:         #080a09;
    --sky:         #9fb7b0;
    --lime:      #7fc8a0;
    --orange:    #e3a76f;
    --pink:      #e59ab7;
    --purple:    #b4aaf0;
    --green:     #7fc8a0;
    --red:       #ef8a80;
    --amber:     #e6c26e;

    --accent-soft: #1f1b13;
    --sky-soft:    #16201e;
    --lime-soft:   #14241c;
    --orange-soft: #2a2016;
    --purple-soft: #1e1c2c;

    --grad: linear-gradient(135deg, #e6c994 0%, #c9a263 100%);
    --grad-warm: linear-gradient(135deg, #f0dcae 0%, #d9b779 50%, #a8834a 100%);
    --grad-cool: linear-gradient(135deg, #c9a263 0%, #e6c994 100%);

    --radius: 16px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    --hairline-gold: rgba(217, 183, 121, .26);
    --focus-ring: rgba(217, 183, 121, .24);
    --nav-h: 66px;
    --safe-b: env(safe-area-inset-bottom, 0px);

    /* משטחים חצי-שקופים ודמות האנטומיה */
    --topbar-bg: rgba(12, 15, 14, .86);
    --nav-bg:    rgba(12, 15, 14, .94);
    --seg-on:    #262d2a;
    --bm-skin:   #2a3230;
    --bm-edge:   #3a4440;
    --chart-label: #7d847f;

    /* חמש רמות מפת הגוף — דיו ורקע רך לכל רמה */
    --lv1-ink: #7fd1a8;  --lv1-soft: #14281f;
    --lv2-ink: #a4d39a;  --lv2-soft: #1a2a1c;
    --lv3-ink: #e6c26e;  --lv3-soft: #2c2715;
    --lv4-ink: #e8a66c;  --lv4-soft: #2e2217;
    --lv5-ink: #f2938c;  --lv5-soft: #2f1c1a;

    --font: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-feature-settings: "tnum" 1;   /* ספרות ברוחב אחיד — מספרים לא "קופצים" */
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    /* clip ולא hidden: hidden הופך את body למיכל גלילה ושובר כל position:sticky בעמוד */
    overflow-x: clip;
}
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }

body { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
body.no-nav { padding-bottom: 0; }

a { color: var(--accent-ink); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 8px; font-weight: 600; line-height: 1.28; letter-spacing: -.1px; color: var(--text); }
h1 { font-size: 21px; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
p  { margin: 0 0 10px; line-height: 1.65; color: var(--muted); }

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 780px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

.topbar {
    position: sticky; top: 0; z-index: 50;
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
}
.topbar-inner {
    max-width: 780px; margin: 0 auto;
    display: flex; align-items: center; gap: 12px;
}
.topbar-wide .topbar-inner { max-width: 1240px; }
.topbar h1 { font-size: 19px; margin: 0; flex: 1; }
.topbar .sub { font-size: 12px; color: var(--dim); margin: 2px 0 0; }

.brand { display: flex; align-items: center; gap: 9px; }
/* אריח בהיר — בדיוק כמו האייקון בטלפון: משולש כחול על רקע נקי */
.brand-mark, .brand-tile {
    width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft);
    display: grid; place-items: center; flex-shrink: 0;
}
.brand-tile svg { width: 60%; height: 60%; }
/* הכיתוב הוא SVG מצויר, לא טקסט — כאן רק המרווח מתחתיו */
.brand svg[role="img"] { display: block; }
.brand .sub { margin-top: 3px; }

.icon-btn {
    width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--muted); display: grid; place-items: center;
    font-size: 17px; cursor: pointer; position: relative; flex-shrink: 0;
}
.icon-btn:active { transform: scale(.94); }
.badge-dot {
    position: absolute; top: -4px; left: -4px; min-width: 18px; height: 18px;
    border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px;
    display: grid; place-items: center; padding: 0 5px; font-weight: 700;
}

.page { padding: 12px 0 20px; }

/* ---------------------------------------------------------------- cards */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px 14px;
    margin-bottom: 10px;
}
.card.tight { padding: 10px 11px; }
/* המסלול המומלץ — המסגרת היחידה בעובי 2 במערכת, בכוונה */
.card-featured { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.card-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin-bottom: 9px;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { font-size: 12.5px; color: var(--dim); }

/* ההירו הוא הפוקוס: גוון מנטה רך, פינות גדולות יותר והרמה חזקה מכרטיס רגיל */
/* ההירו: אותו פחם, קו זהב דק והילה חמה עדינה מלמעלה — לא צבע מלא */
.hero {
    background:
        radial-gradient(120% 70% at 85% -10%, rgba(217, 183, 121, .10), transparent 60%),
        linear-gradient(180deg, #181d1b 0%, var(--card) 100%);
    border: 1px solid var(--hairline-gold); color: var(--text);
    border-radius: 20px; padding: 16px;
    position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero::after { display: none; }
.hero::before { display: none; }
.hero h1, .hero h2, .hero h3 { color: var(--text); position: relative; }
.hero p { color: var(--muted); position: relative; }
.hero .small, .hero .dim { color: var(--dim) !important; }

/* ---------------------------------------------------------------- stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-grid.g3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.g2 { grid-template-columns: repeat(2, 1fr); }
/* מספר עם תווית מתחתיו, בלי אריח מסביב */
.stat {
    background: transparent; border: none; box-shadow: none;
    border-radius: 0; padding: 2px 0; text-align: start;
    min-width: 0; overflow: hidden;
}
.stat-grid {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 13px 14px; gap: 6px 18px; margin-bottom: 10px;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
}
.stat-value {
    font-size: 21px; font-weight: 600; line-height: 1.1; letter-spacing: -.3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-label {
    font-size: 11.5px; color: var(--dim); margin-top: 3px;
    white-space: normal; line-height: 1.3; overflow-wrap: anywhere;
}
.stat.link {
    cursor: pointer; font-family: inherit; text-align: start; position: relative;
    text-decoration: none; color: inherit;
}
.stat.link::after {
    content: ""; position: absolute; inset-inline-start: 0; bottom: -2px;
    width: 14px; height: 2px; border-radius: 2px; background: var(--line);
}
.stat.link:active { opacity: .6; }
.stat-detail { animation: statin .18s ease-out; }
@keyframes statin { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 12px; }
.quick-item {
    display: flex; align-items: center; gap: 10px; padding: 12px;
    background: var(--card-2); border: none; border-radius: var(--radius-sm);
    font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
    text-decoration: none; cursor: pointer; text-align: start;
}
.quick-item:active { opacity: .7; }
.quick-links { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 2px 2px; }
.quick-links a { font-size: 13px; color: var(--accent-ink); }
.stat-sub { font-size: 11px; margin-top: 2px; white-space: normal; line-height: 1.3; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border-radius: 12px; border: none;
    background: var(--grad); color: var(--on-accent); font-weight: 700; font-size: 15px;
    cursor: pointer; font-family: inherit; transition: transform .12s, opacity .12s;
    text-decoration: none; box-shadow: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }
.btn-ghost {
    background: var(--card); color: var(--text); border: 1px solid var(--line);
    box-shadow: none;
}
.btn-outline { background: transparent; color: var(--accent-ink); border: 1.5px solid var(--accent); box-shadow: none; }
.btn-danger { background: transparent; color: var(--red); border: 1px solid var(--red); box-shadow: none; }
.btn-warm { background: var(--grad-warm); color: var(--on-accent); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; box-shadow: none; }
.btn-lg { padding: 12px 18px; font-size: 15.5px; border-radius: 13px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; min-width: 120px; }

/* ---------------------------------------------------------------- chips */
.chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px;
    border-radius: 999px; background: var(--card); border: 1px solid var(--line);
    font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 600;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
/* בלי זה השבבים נדחסים ומתפצלים לשתי שורות במקום לגלול */
.chip-row > .chip { flex: 0 0 auto; white-space: nowrap; }
.chip-row.wrap { flex-wrap: wrap; overflow-x: visible; }

.pill {
    display: inline-block; padding: 4px 11px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700;
}
.pill.green { background: var(--lime-soft); color: var(--green); }
.pill.red   { background: var(--accent-soft); color: var(--accent-ink); }
.pill.amber { background: var(--orange-soft); color: var(--orange); }
.pill.cyan  { background: var(--accent-soft); color: var(--accent-ink); }
.pill.gray  { background: var(--card-2); color: var(--muted); }

/* ---------------------------------------------------------------- forms */
.form-group { margin-bottom: 14px; min-width: 0; }
.form-group > input, .form-group > select, .form-group > textarea { min-width: 0; max-width: 100%; }
.form-group label {
    display: block; font-size: 13px; color: var(--muted);
    margin-bottom: 6px; font-weight: 600;
}
input[type=text], input[type=password], input[type=number], input[type=date],
input[type=email], input[type=tel], input[type=time], input[type=search],
select, textarea {
    width: 100%; padding: 13px 14px; border-radius: 13px;
    border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
    font-size: 16px; font-family: inherit; outline: none;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent); background: var(--card);
    box-shadow: 0 0 0 3px var(--focus-ring);
}
::placeholder { color: var(--dim); opacity: .55; font-weight: 400; }
input[type=date], input[type=time] { text-align: right; min-height: 46px; }
input[type=date]::-webkit-date-and-time-value { text-align: right; }
input:required:invalid { border-color: var(--line); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: none; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row > * { min-width: 0; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-row-3 > * { min-width: 0; }
.form-row-3 .form-group:has(input[type=date]),
.form-row .form-group:has(input[type=date]) { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--dim); margin-top: 4px; }

/* סרגל מקטעים — רקע אפור בהיר, הפעיל לבן עם צל */
.seg { display: flex; gap: 4px; flex-wrap: wrap; background: var(--card-2);
       padding: 4px; border-radius: 14px; }
.seg input { display: none; }
.seg label {
    flex: 1; min-width: 80px; text-align: center; padding: 10px 8px; margin: 0;
    border-radius: 11px; border: none; background: transparent;
    color: var(--muted); font-size: 13.5px; cursor: pointer; font-weight: 600;
}
.seg input:checked + label {
    background: var(--seg-on); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------- lists */
/* שורות מופרדות בקו דק. כרטיס לכל שורה יצר קיר של קופסאות. */
.list { display: flex; flex-direction: column; background: var(--card);
        border-radius: var(--radius); overflow: hidden; }
.list-item {
    display: flex; align-items: center; gap: 12px; padding: 13px 14px;
    background: transparent; border: none; box-shadow: none; border-radius: 0;
    border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
/* בתוך כרטיס הרקע כבר לבן — הרשימה לא צריכה רקע משלה */
.card > .list, .card .list { background: transparent; border-radius: 0; }
.list-item .grow { flex: 1; min-width: 0; }
/* כותרת ותיאור כ-span בתוך .grow — בשתי שורות, לא מודבקים זה לזה */
.list-item .grow > .title, .list-item .grow > .meta { display: block; }
.list-item .title { font-weight: 600; font-size: 15px; }
.list-item .meta { font-size: 12.5px; color: var(--dim); margin-top: 3px; }
.list-item.link:active { background: var(--card-2); }

.avatar {
    width: 42px; height: 42px; border-radius: 14px; background: var(--grad);
    display: grid; place-items: center; font-weight: 800; color: var(--on-accent);
    font-size: 16px; flex-shrink: 0;
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; border-radius: 11px; }

/* ---------------------------------------------------------------- progress */
.bar { height: 8px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.bar.thin { height: 6px; }

/* ---------------------------------------------------------------- nav */
.bottomnav {
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 60;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b);
}
.bottomnav-inner {
    max-width: 780px; margin: 0 auto; height: var(--nav-h);
    display: grid; grid-template-columns: repeat(5, 1fr);
}
.navitem {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--dim); font-size: 10.5px; text-decoration: none; font-weight: 600;
    position: relative;
}
.navitem .ico { font-size: 20px; line-height: 1; }
.navitem.on { color: var(--accent-ink); }
.navitem.on::after {
    content: ""; position: absolute; bottom: 7px; left: 50%; transform: translateX(-50%);
    width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.navitem.center .ico {
    width: 46px; height: 46px; border-radius: 50%; background: var(--accent);
    display: grid; place-items: center; color: var(--on-accent); margin-top: -16px;
    box-shadow: 0 4px 16px rgba(217, 183, 121, .28); font-size: 22px;
}
.navitem.center::after { display: none; }
/* כפתור ה-+ הוא <button> — בלי זה הדפדפן מצייר לו רקע אפור של כפתור מערכת */
button.navitem { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }

/* ---------------------------------------------------------------- flash */
.flash {
    padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 14px;
    border: none; display: flex; gap: 9px; align-items: flex-start; font-weight: 600;
}
.flash.success { background: var(--lime-soft); color: var(--green); }
.flash.error   { background: var(--orange-soft); color: var(--red); }
.flash.warn    { background: var(--orange-soft); color: var(--orange); }
.flash.info    { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------------------------------------------------------------- empty */
.empty { text-align: center; padding: 36px 20px; color: var(--dim); }
.empty .ico { font-size: 44px; margin-bottom: 10px; opacity: .45; }

/* ---------------------------------------------------------------- icons */
.icn { display: inline-block; vertical-align: -0.18em; flex-shrink: 0; }
.icn-box {
    width: 40px; height: 40px; border-radius: 13px; background: var(--accent-soft);
    display: grid; place-items: center; color: var(--accent); flex-shrink: 0;
    border: none;
}
.icn-box.sm { width: 32px; height: 32px; border-radius: 10px; }
.icn-box.lg { width: 46px; height: 46px; border-radius: 15px; }
.icn-box.accent { background: var(--accent-soft); color: var(--accent); }
.icn-box.lime { background: var(--lime-soft); color: var(--green); }
.icn-box.orange { background: var(--orange-soft); color: var(--orange); }
.icn-box.purple { background: var(--purple-soft); color: var(--purple); }
.icn-box.red { background: var(--accent-soft); color: var(--accent); }
.hero .icn-box { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------- צילום ארוחה */
.cam-card {
    background: var(--card); box-shadow: var(--shadow);
    border: 1px dashed var(--hairline-gold);
    border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
}
.cam-result {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-sm); overflow: hidden;
}
.cam-preview { width: 100%; height: 170px; object-fit: cover; display: block; }
.cam-loading { padding: 14px; text-align: center; }
.cam-loading .typing { justify-content: center; }
.meal-thumb {
    width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
    flex-shrink: 0;
}

/* תמונת תרגיל ממוזערת — ברשימות ובבחירת תרגיל */
.ex-thumb {
    width: 46px; height: 46px; border-radius: 13px; object-fit: cover;
    flex-shrink: 0; background: var(--card-2);
}
.ex-thumb.lg { width: 58px; height: 58px; border-radius: 15px; }

/* ---------------------------------------------------------------- הדגמה */
.demo-photo {
    position: relative; aspect-ratio: 4 / 3;
    height: auto; max-height: 300px; min-height: var(--demo-h, 165px);
    border-radius: var(--radius); overflow: hidden; background: var(--card-2);
}
/* contain ולא cover: cover חתך לתרגילים חצי דמות. עדיף שוליים מאשר
   הדגמה שהראש או המשקולת שלה מחוץ למסגרת. */
.demo-photo img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; animation: demoflip 2.6s ease-in-out infinite;
}
.demo-photo img:nth-of-type(2) { animation-delay: 1.3s; }
@keyframes demoflip {
    0%, 42% { opacity: 1; }
    50%, 92% { opacity: 0; }
    100% { opacity: 1; }
}
/* אנימציה אמיתית — יושבת בדיוק באותה מסגרת של התצלומים */
/* קליפ האנימציה מגיע ריבועי — מסגרת ריבועית מבטלת פסים בצדדים */
.demo-photo.clip {
    /* width:100% ולא margin:auto — התוכן הוא absolute, ולכן בלי רוחב
       מפורש התיבה מתכווצת לאפס בתוך גריד. */
    aspect-ratio: 1 / 1; width: 100%; max-width: 300px; max-height: 300px;
    justify-self: center; min-height: 0;
    /* הקליפים מצולמים על רקע כהה (rgb 17,23,26) — המסגרת באותו צבע כדי
       שגם במצב בהיר הם ייראו כחלון מעוצב ולא כמלבן שחור מודבק */
    background: #11171a; border-radius: var(--radius-sm); overflow: hidden;
}
.demo-photo video.demo-clip {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: contain; display: block; background: #11171a;
}
.demo-tag {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    background: rgba(12, 18, 32, .62); backdrop-filter: blur(4px);
    color: #fff; font-size: 10.5px; padding: 4px 10px; border-radius: 99px;
}
@media (prefers-reduced-motion: reduce) {
    .demo-photo img { animation: none; }
    .demo-photo img:nth-of-type(2) { opacity: 0; }
    /* הווידאו נשאר גלוי ומוקפא על פריים אחד — להסתיר אותו זה להשאיר
       את המשתמש בלי הדגמה בכלל. ההשהיה נעשית ב-JS. */
}

.demo {
    background: var(--card-2);
    border-radius: var(--radius); padding: 6px; overflow: hidden; position: relative;
}
.demo-label {
    position: absolute; top: 10px; right: 12px; font-size: 11px;
    color: var(--dim); z-index: 2;
}
.figure-svg { display: block; margin: 0 auto; }

/* דמות אנטומית — הדגמה שהשרירים העובדים נצבעים בה תוך כדי התנועה */
.demo-anat { cursor: pointer; display: flex; flex-direction: column; }
.demo-anat > [data-anatomy] { flex: 1; min-height: 0; display: flex; align-items: center; }
.demo-anat .anat-svg { max-height: 100%; }
.demo-anat .is-paused .anat-svg { opacity: .82; }
.anat-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
    font-size: 11px; color: var(--dim); padding: 2px 0 4px;
}
.anat-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 5px; }

.demo-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; align-items: stretch; }
@media (max-width: 560px) { .demo-row { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- מפת שרירים */
.bodymap {
    background: var(--card-2); border: none;
    border-radius: var(--radius); padding: 10px 6px 6px;
}
.bodymap-views { display: flex; justify-content: center; gap: 4px; }
.bodysvg { max-width: 50%; height: auto; }
.bodymap-views.single .bodysvg { max-width: 66%; }
/* מפת השרירים כתמונה — אותה דמות שבהדגמות, מלפנים ומאחור */
.bodyimg {
    max-width: 50%; height: auto; width: auto; object-fit: contain;
    background: transparent;
}
.bodymap-legend .dim { color: var(--dim); }
.bodymap-legend {
    display: flex; justify-content: center; gap: 14px; font-size: 11px;
    color: var(--dim); padding: 6px 0 2px;
}
.bodymap-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-left: 5px; }
.muscle-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---------------------------------------------------------------- workout */
.ex-card { background: var(--card); box-shadow: var(--shadow); border: none;
           border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.ex-card.done { box-shadow: 0 0 0 1.5px rgba(47, 163, 107, .5), var(--shadow); }
.ex-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ex-num {
    width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft);
    display: grid; place-items: center; font-size: 13px; font-weight: 700;
    color: var(--accent); flex-shrink: 0;
}
.ex-title { font-weight: 700; font-size: 16px; }
.ex-meta { font-size: 12.5px; color: var(--dim); margin-top: 3px; }

/* ---------- כרטיס תרגיל מתקפל ---------- */
.ex-card.collapsed .ex-body { display: none; }
.ex-card.collapsed { padding: 10px 12px; }
.ex-card.finished {
    background: var(--lime-soft);
    box-shadow: 0 0 0 1.5px rgba(47, 163, 107, .35);
}
.ex-card.finished .ex-title { color: var(--green); }
.ex-toggle {
    display: flex; align-items: center; gap: 11px; width: 100%; cursor: pointer;
    background: none; border: none; padding: 0; font-family: inherit; text-align: right;
    color: inherit;
}
.ex-toggle .chev { color: var(--dim); transition: transform .2s; flex-shrink: 0; }
.ex-card:not(.collapsed) .ex-toggle .chev { transform: rotate(180deg); }
.ex-progress {
    font-size: 11.5px; font-weight: 700; color: var(--accent-ink);
    background: var(--accent-soft); border-radius: 99px; padding: 3px 9px; flex-shrink: 0;
}
.ex-card.finished .ex-progress { background: rgba(47, 163, 107, .18); color: var(--green); }
.ex-body { margin-top: 12px; }

/* ---------- שורת סט עם כפתורי הגדלה/הקטנה ---------- */
.set-row {
    display: grid; grid-template-columns: 20px 1fr 1fr 40px; gap: 6px;
    align-items: center; margin-bottom: 8px;
}
.set-row .idx { text-align: center; font-size: 12.5px; color: var(--dim); font-weight: 700; }
.step {
    display: grid; grid-template-columns: 26px 1fr 26px; align-items: center;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
    overflow: hidden; min-width: 0;
}
.step button {
    height: 40px; border: none; background: none; color: var(--muted);
    font-size: 17px; font-weight: 700; cursor: pointer; padding: 0; line-height: 1;
}
.step button:active { background: var(--card-2); }
.step input {
    border: none; background: none; text-align: center; padding: 9px 0;
    font-size: 16px; font-weight: 700; min-width: 0; border-radius: 0;
}
.step input:focus { box-shadow: none; background: none; }
.set-row .ok {
    height: 42px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card-2); color: var(--dim); font-size: 16px; cursor: pointer;
    display: grid; place-items: center;
}
.set-row.done .ok { background: var(--green); border-color: transparent; color: var(--card); }
.set-row.done .step { background: var(--lime-soft); border-color: transparent; }
.set-row.done .step input { color: var(--green); }
.set-head {
    display: grid; grid-template-columns: 20px 1fr 1fr 40px; gap: 6px;
    font-size: 11px; color: var(--dim); text-align: center; margin-bottom: 6px;
}
/* העתקה לסט הבא */
.copy-next {
    grid-column: 2 / 4; justify-self: start; margin: -4px 0 8px;
    background: none; border: none; color: var(--accent-ink); font-size: 12px;
    font-weight: 700; cursor: pointer; padding: 2px 0; font-family: inherit;
    display: none;
}
.set-row.done + .copy-next { display: block; }
/* מחשבון הפלטות — מופיע כשנוגעים בשדה משקל של תרגיל מוט */
.plate-hint {
    font-size: 12px; font-weight: 700; color: var(--accent-ink);
    background: var(--accent-soft); border-radius: 10px; padding: 7px 10px;
    margin-bottom: 8px;
}

/* שורת ההיסטוריה — מה עשית בפעם הקודמת */
.prev-line {
    font-size: 12px; color: var(--dim); background: var(--card-2);
    border-radius: 10px; padding: 7px 10px; margin-bottom: 10px;
    display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.prev-line b { color: var(--muted); font-weight: 700; }

.rest-timer {
    position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); right: 16px; left: 16px;
    max-width: 748px; margin: 0 auto; z-index: 70;
    background: var(--grad); color: var(--on-accent); border-radius: 16px; padding: 12px 16px;
    display: none; align-items: center; justify-content: space-between; gap: 12px;
    box-shadow: var(--shadow-lg); font-weight: 700;
}
.rest-timer.on { display: flex; }
.rest-timer .t { font-size: 24px; font-variant-numeric: tabular-nums; }
.rest-timer .track {
    position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
    background: rgba(23, 19, 11, .22); border-radius: 0 0 16px 16px; overflow: hidden;
}
.rest-timer .track > span { display: block; height: 100%; background: var(--on-accent); width: 0; transition: width .25s linear; }

/* ---------------------------------------------------------------- מסך המאמן */
/* ---------------------------------------------------------------- chat */
.chat {
    display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px;
    max-width: 100%; overflow-x: clip;
}
.bubble {
    max-width: min(86%, 520px); padding: 13px 15px; border-radius: 18px; font-size: 15px;
    line-height: 1.6; white-space: pre-wrap;
    /* טקסט ארוך או קישור בלי רווחים חייב להישבר, אחרת הבועה בורחת מהמסך */
    overflow-wrap: anywhere; word-break: break-word; min-width: 0;
}
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble.me { align-self: flex-start; background: var(--grad); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-end; background: var(--card); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble.ai p { color: var(--text); }
.chat-input {
    position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 6px);
    display: flex; gap: 8px; padding: 10px 0;
    background: linear-gradient(to top, var(--bg) 74%, transparent);
}
.chat-input input { min-width: 0; flex: 1 1 auto; }
.chat-input .btn { flex-shrink: 0; white-space: nowrap; }
.typing { display: flex; gap: 4px; padding: 14px; align-self: flex-end; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25 } 30% { opacity: 1 } }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 12px; text-align: right; border-bottom: 1px solid var(--line); }
th { font-size: 12px; color: var(--dim); font-weight: 600; white-space: nowrap; }
td { white-space: nowrap; }
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }

/* ---------------------------------------------------------------- charts */
.chart { width: 100%; height: 180px; display: block; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--dim); margin-top: 8px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 5px; }

/* ---------------------------------------------------------------- misc */
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: left; }
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 14px; }
.mb0 { margin-bottom: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.wrap-anywhere { overflow-wrap: anywhere; }
.grow { flex: 1; min-width: 0; }

details.acc { border: none; box-shadow: var(--shadow); border-radius: var(--radius-sm);
              background: var(--card); margin-bottom: 10px; }
details.acc summary {
    padding: 14px; cursor: pointer; font-weight: 600; list-style: none;
    display: flex; align-items: center; justify-content: space-between;
}
details.acc summary::-webkit-details-marker { display: none; }
details.acc[open] summary { border-bottom: 1px solid var(--line); }
details.acc .acc-body { padding: 14px; }

.modal-bg {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .62); z-index: 100;
    display: none; align-items: flex-end; justify-content: center;
    backdrop-filter: blur(3px);
    opacity: 0; transition: opacity .2s ease;
}
.modal-bg.on { display: flex; }
.modal-bg.in { opacity: 1; }
.modal {
    background: var(--card); border: none;
    border-radius: 20px 20px 0 0; padding: 16px 14px calc(16px + var(--safe-b));
    width: 100%; max-width: 780px; max-height: 88vh; overflow-y: auto;
    transform: translateY(100%); transition: transform .24s cubic-bezier(.2, .7, .4, 1);
}
.modal-bg.in .modal { transform: none; }
@media (prefers-reduced-motion: reduce) {
    .modal-bg, .modal { transition: none; }
}

/* ---------------------------------------------------------------- תנועה
   כניסה רכה למסך ולכרטיסים — אפליקציה שמרגישה חיה, לא מסמך שקופץ.
   הכל מאחורי prefers-reduced-motion, וחד-פעמי בעליית העמוד. */
@media (prefers-reduced-motion: no-preference) {
    body { animation: pageIn .22s ease-out both; }
    @keyframes pageIn { from { opacity: 0 } to { opacity: 1 } }

    main.page > .hero,
    main.page > .card:not(.stat-detail),
    main.page > .stat-grid,
    main.page > .grid-2,
    main.page > a.card {
        animation: riseIn .34s ease-out both;
    }
    @keyframes riseIn {
        from { opacity: 0; transform: translateY(10px) }
        to   { opacity: 1; transform: none }
    }

    /* גרפים נמתחים במקום להופיע גמורים. מצב ההסתרה ההתחלתי חי רק כאן —
       כך שבמצב reduced-motion הגרף פשוט מצויר מלא ותקין. */
    .chart-line { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: drawLine .7s ease-out forwards; }
    @keyframes drawLine { to { stroke-dashoffset: 0 } }
    .chart-bar { transform-box: fill-box; transform-origin: bottom; animation: growBar .45s ease-out both; }
    @keyframes growBar { from { transform: scaleY(0) } to { transform: scaleY(1) } }
}
.modal-handle { width: 44px; height: 4px; border-radius: 99px; background: var(--line);
                margin: -8px auto 14px; }

/* ---------------------------------------------------------------- desktop */
@media (min-width: 900px) {
    .stat-grid { gap: 14px; }
    .page { padding: 22px 0 32px; }
    .bottomnav-inner { max-width: 620px; }
    .bottomnav { right: 50%; left: auto; transform: translateX(50%);
                 max-width: 660px; border-radius: 22px 22px 0 0;
                 border: 1px solid var(--line); border-bottom: none;
                 box-shadow: 0 -4px 24px rgba(0, 0, 0, .4); }
    .admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
}

@media (max-width: 420px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-value { font-size: 20px; }
    h1 { font-size: 22px; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
}

/* מסך התחברות/הרשמה */
.auth-wrap {
    max-width: 440px; margin: 0 auto;
    padding: calc(env(safe-area-inset-top, 0px) + 26px) 18px 40px;
}
.no-topbar { padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
.auth-logo {
    width: 66px; height: 66px; border-radius: 22px; background: var(--accent-soft);
    display: grid; place-items: center; margin: 0 auto 16px;
    box-shadow: 0 6px 18px rgba(217, 183, 121, .12);
}
.auth-logo svg { width: 58%; height: 58%; }
.step-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.step-dots i { width: 26px; height: 4px; border-radius: 99px; background: var(--line); }
.step-dots i.on { background: var(--accent); }

@media print {
    .topbar, .bottomnav, .btn, .rest-timer { display: none !important; }
    body { background: #fff; color: #000; padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}


/* ---------------------------------------------------------------- צפיפות למסך טלפון
   על מסך של 6 אינץ' המכולות הגדולות אכלו חצי מסך. כאן מקטינים אותן
   בלבד — כרטיסי הסטטיסטיקה, השבבים והכפתורים הקטנים נשארים כמו שהם,
   וכל שטח מגע נשאר מעל 44 פיקסל. */
@media (max-width: 480px) {
    .page { padding: 10px 0 18px; }
    .card { padding: 12px 13px; margin-bottom: 9px; }
    .hero { padding: 13px 14px; }
    .hero h2 { font-size: 17.5px; margin: 4px 0 3px; }
    .hero p { font-size: 13.5px; margin-bottom: 9px; }
    h1 { font-size: 20px; }
    .btn-lg { padding: 11px 16px; font-size: 15px; }
    .grid-2, .grid-3 { gap: 9px; }
    .list-item { padding: 10px 11px; }
    .demo-photo { --demo-h: 145px; }
    .ex-card { padding: 12px; }
    .ex-card.collapsed { padding: 9px 11px; }
}

/* ---------------------------------------------------------------- הסכמה לתקנון */
.agree {
    display: flex; gap: 9px; align-items: flex-start; margin: 4px 0 14px;
    background: var(--card-2); border-radius: var(--radius-sm); padding: 11px 12px;
    cursor: pointer;
}
.agree input { width: 20px; height: 20px; flex-shrink: 0; margin: 1px 0 0; accent-color: var(--accent); }
.agree a { text-decoration: underline; }
.legal-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
               margin: 18px 0 4px; font-size: 12px; }
.legal-links a { color: var(--dim); }

/* ---------------------------------------------------------------- מפת הגוף */
.bm-skel { fill: var(--bm-skin); stroke: var(--bm-edge); }
.bm-lines { stroke: var(--bm-skin); }
.bm-cap { fill: var(--chart-label); }
.bodymap.status { background: transparent; padding: 0; }
.bodymap.status .bodysvg { max-width: 50%; }
.body-legend {
    display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center;
    margin-top: 10px; font-size: 11.5px; color: var(--dim);
}
.body-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block;
                 margin-inline-end: 5px; vertical-align: -1px; }
.score-dot {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    display: grid; place-items: center; font-weight: 800; font-size: 13px;
}
.lv1-ink { color: var(--lv1-ink); } .lv2-ink { color: var(--lv2-ink); }
.lv3-ink { color: var(--lv3-ink); } .lv4-ink { color: var(--lv4-ink); }
.lv5-ink { color: var(--lv5-ink); }
.score-dot.lv1 { background: var(--lv1-soft); color: var(--lv1-ink); }
.score-dot.lv2 { background: var(--lv2-soft); color: var(--lv2-ink); }
.score-dot.lv3 { background: var(--lv3-soft); color: var(--lv3-ink); }
.score-dot.lv4 { background: var(--lv4-soft); color: var(--lv4-ink); }
.score-dot.lv5 { background: var(--lv5-soft); color: var(--lv5-ink); }
.muscle-card { padding: 11px 12px; }
.muscle-card.open { box-shadow: 0 0 0 1.5px var(--line); }
.mgshape { transition: opacity .15s; }
.mgshape:active { opacity: .6; }

/* ===== מוכנות יומית (מסך הבית) — readiness.brief ===== */
.hero .tb-reason, .hero .tb-week, .hero .tb-muscles, .hero .tb-list, .hero .tb-opt { background: var(--bg-soft); }
.today-brief .tb-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.tb-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .3px; color: var(--accent-ink); }
.tb-eyebrow.tb-rest { color: var(--amber); }
.tb-eyebrow.tb-done_today { color: var(--green); }
.tb-title { margin: 4px 0 3px; font-size: 20px; line-height: 1.25; }
.tb-ring { flex-shrink: 0; }
.tb-ring .trk { fill: none; stroke: var(--line); stroke-width: 6; }
.tb-ring .val { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.tb-ring.lv-high .val { stroke: var(--green); }
.tb-ring.lv-mid .val { stroke: var(--amber); }
.tb-ring.lv-low .val { stroke: var(--red); }
.tb-ring .num { font-size: 19px; font-weight: 800; fill: var(--text); font-variant-numeric: tabular-nums; }
.tb-ring .lbl { font-size: 8.5px; fill: var(--dim); }
.tb-reason { display: flex; gap: 8px; align-items: flex-start; background: var(--card);
    border-radius: 11px; padding: 9px 11px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.tb-week { display: flex; gap: 4px; align-items: stretch; background: var(--card);
    border-radius: 11px; padding: 8px 8px; margin-bottom: 10px; }
.tb-dayc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 3px 0; border-radius: 8px; min-width: 0; }
.tb-dayc.is-today { background: var(--accent-soft); }
.tb-dayc .dw { font-size: 11px; color: var(--dim); }
.tb-dayc .dn { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tb-dayc .dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--line); }
.tb-dayc .dot.on { background: var(--accent); border-color: var(--accent); }
.tb-dayc .dot.act { border-color: var(--accent); border-style: dashed; }
.tb-weeksum { display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding-inline-start: 8px; margin-inline-start: 2px; border-inline-start: 1px solid var(--line); min-width: 48px; }
.tb-weeksum b { font-size: 18px; }
.tb-muscles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px;
    background: var(--card); border-radius: 11px; padding: 10px 12px; margin-bottom: 10px; }
.tb-m { display: grid; grid-template-columns: 62px minmax(0, 1fr) 36px; gap: 8px; align-items: center; font-size: 12px; }
.tb-m .nm { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-m.focus .nm { color: var(--text); font-weight: 700; }
.tb-m .pc { text-align: end; color: var(--dim); font-size: 11px; }
.tb-m .bar > span.lv-high, .tb-opt .r.lv-high { background: var(--green); }
.tb-m .bar > span.lv-mid { background: var(--amber); }
.tb-m .bar > span.lv-low { background: var(--red); }
.tb-list { background: var(--card); border-radius: 11px; padding: 9px 11px; margin-bottom: 10px; }
.tb-alt-h { margin: 12px 0 6px; }
.tb-alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 7px; }
.tb-alt form { margin: 0; }
.tb-opt { width: 100%; text-align: start; background: var(--card); border: 1px solid var(--line);
    border-radius: 11px; padding: 8px 10px; cursor: pointer; color: var(--text); font: inherit;
    display: flex; flex-direction: column; gap: 2px; }
.tb-opt:hover { border-color: var(--accent); }
.tb-opt .t { font-weight: 700; font-size: 13px; }
.tb-opt .s { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-opt .r { font-size: 11px; font-weight: 700; margin-top: 2px; background: none !important; }
.tb-opt .r.lv-high { color: var(--green); } .tb-opt .r.lv-mid { color: var(--amber); } .tb-opt .r.lv-low { color: var(--red); }
.tb-pace { display: flex; gap: 6px; align-items: flex-start; margin-top: 10px; line-height: 1.5; }
@media (max-width: 360px) { .tb-muscles { grid-template-columns: 1fr; } }

/* ===== חתימה על ההסכם ושאלון כשירות ===== */
.consent-card .agree { margin-bottom: 10px; }
.parq-q { display: flex; gap: 12px; align-items: center; justify-content: space-between;
    padding: 9px 0; border-bottom: 1px solid var(--line); }
.parq-q:last-of-type { border-bottom: 0; }
.parq-t { font-size: 13.5px; line-height: 1.5; flex: 1; min-width: 0; }
.parq-seg { flex-shrink: 0; width: 116px; flex-wrap: nowrap; }
.parq-seg label { min-width: 0; padding: 8px 6px; }
.parq-warn { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm);
    background: var(--orange-soft); color: var(--text); font-size: 13px; line-height: 1.55; }
.sign-box { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sign-box input { font-size: 17px; font-style: italic; letter-spacing: .3px; }

/* ===== מוטיבציה: להבה, מדליות, חגיגה, תחרויות ===== */
/* הלהבה — דולקת (זהב חם), בסכנה (קו זהב פועם), כבויה (אפור) */
.flame { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.flame b { font-size: 14px; font-weight: 700; }
.flame .fl-body { fill: none; stroke: var(--dim); stroke-width: 1.6; stroke-linejoin: round; }
.flame .fl-core { fill: none; }
.flame .fl-base { stroke: var(--line); stroke-width: 1.6; stroke-linecap: round; }
.flame-lit .fl-body { fill: url(#flameGrad); stroke: #f0c27a; }
.flame-lit .fl-core { fill: #fff3d6; }
.flame-lit .fl-base { stroke: rgba(240, 194, 122, .45); }
.flame-lit b { color: #f3cf8f; }
.flame-risk .fl-body { stroke: var(--accent); }
.flame-risk b { color: var(--accent); }
.flame-out b { color: var(--dim); }
@media (prefers-reduced-motion: no-preference) {
    .flame-lit svg { animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
    .flame-risk svg { animation: riskpulse 1.6s ease-in-out infinite; }
}
@keyframes flicker { 0%,100% { transform: scale(1) } 45% { transform: scale(1.06, .97) } 70% { transform: scale(.97, 1.04) } }
@keyframes riskpulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.flame-btn { height: 38px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line);
    background: var(--card); color: var(--text); cursor: pointer; font-family: inherit; flex-shrink: 0; }
.flame-btn:active { transform: scale(.95); }
.streak-hero .big-flame .flame b { font-size: 0; }
.streak-hero .big-flame { width: 64px; height: 64px; border-radius: 18px; background: var(--bg-soft);
    display: grid; place-items: center; flex-shrink: 0; }

/* רשת הביטחון של הרצף: גחלים, מגנים, משימת הצלה */
.flame-embers .fl-body { fill: rgba(227, 167, 111, .16); stroke: var(--orange); stroke-dasharray: 3 2.2; }
.flame-embers .fl-core { fill: var(--orange); opacity: .8; }
.flame-embers .fl-base { stroke: rgba(227, 167, 111, .5); }
.flame-embers b { color: var(--orange); }
@media (prefers-reduced-motion: no-preference) {
    .flame-embers .fl-core { animation: ember 2.8s ease-in-out infinite; }
}
@keyframes ember { 0%,100% { opacity: .35 } 50% { opacity: 1 } }
.fl-shields { display: inline-flex; gap: 1px; margin-inline-start: 2px; font-style: normal; }
.fl-shields svg { fill: var(--sky); opacity: .85; }
.to-best { margin-top: 12px; padding: 9px 12px; border-radius: 12px; background: var(--bg-soft);
    display: flex; gap: 8px; align-items: center; color: var(--muted); }
.to-best b { color: var(--accent-ink); }
.shield-row { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--line); }
.shield-pips { display: flex; gap: 4px; flex-shrink: 0; }
.shield-pips .sp { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
    border: 1px dashed var(--line); color: var(--dim); }
.shield-pips .sp.on { border: 1px solid rgba(159, 183, 176, .45); background: var(--sky-soft); color: var(--sky); }
.embers-card { border-color: rgba(227, 167, 111, .35);
    background: radial-gradient(120% 90% at 100% 0%, rgba(227, 167, 111, .12), transparent 60%), var(--card); }
.embers-card .big-flame { width: 52px; height: 52px; border-radius: 16px; background: var(--orange-soft);
    display: grid; place-items: center; flex-shrink: 0; }
.embers-card .big-flame .flame b { font-size: 0; }
.rescue { margin-top: 12px; }
.rescue-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.rescue-clock { display: inline-flex; gap: 5px; align-items: center; color: var(--orange); white-space: nowrap; }
.rescue-steps { display: flex; flex-direction: column; gap: 6px; }
.rs { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); text-align: start;
    font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.rs .dim { font-weight: 400; }
.rs-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: var(--orange-soft); color: var(--orange); }
.rs.done { border-color: rgba(127, 200, 160, .35); cursor: default; }
.rs.done .rs-dot { background: var(--lime-soft); color: var(--green); }
.rs.done b { text-decoration: line-through; text-decoration-color: rgba(127, 200, 160, .6); }
.cel-icon.cel-shield { color: var(--sky); }
.cel-icon.cel-rescue { color: var(--orange); }

/* מדליות: צבעי מתכת לפי דרגה */
.medal { display: block; flex-shrink: 0; }
.medal .md-disc { fill: #121615; }
.medal .md-icon { stroke: var(--text); }
.medal .md-num { font-size: 15px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.medal.locked .md-track { fill: none; stroke: var(--line); stroke-width: 4; }
.medal.locked .md-prog { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; opacity: .75; }
.medal.locked .md-icon { stroke: var(--dim); }
.medal.locked .md-num { fill: var(--dim); }
.tier-bronze .mt-hi { stop-color: #e6b089; } .tier-bronze .mt-lo { stop-color: #9b5f38; }
.tier-silver .mt-hi { stop-color: #eef0f2; } .tier-silver .mt-lo { stop-color: #8d959c; }
.tier-gold   .mt-hi { stop-color: #f3dca8; } .tier-gold   .mt-lo { stop-color: #b8904f; }
.tier-platinum .mt-hi { stop-color: #f1efff; } .tier-platinum .mt-lo { stop-color: #9e9ac4; }
.medal.earned.tier-bronze .md-icon { stroke: #efc3a1; }
.medal.earned.tier-silver .md-icon { stroke: #f2f4f6; }
.medal.earned.tier-gold .md-icon { stroke: #f3dca8; }
.medal.earned.tier-platinum .md-icon { stroke: #eceaff; }

.medal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px 8px; }
.medal-cell { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; min-width: 0; }
.medal-cell .mc-t { font-size: 12px; font-weight: 600; line-height: 1.3; }
.medal-cell .mc-s { font-size: 10.5px; color: var(--dim); }
.medal-cell:not(.earned) .mc-t { color: var(--muted); }
.next-medals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.next-medal { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.next-medal .nm-t { font-size: 12px; font-weight: 600; line-height: 1.3; }
.next-medal .nm-p { font-size: 11px; color: var(--dim); }

/* חגיגה */
.celebrate-bg .modal.celebrate { text-align: center; padding-top: 26px;
    background: radial-gradient(90% 60% at 50% 0%, rgba(217, 183, 121, .16), transparent 70%), var(--card); }
.cel-medal, .cel-icon { display: flex; justify-content: center; margin-bottom: 10px; color: var(--accent); }
.cel-eyebrow { font-size: 12px; font-weight: 700; color: var(--accent-ink); letter-spacing: .3px; }
.cel-title { margin: 6px 0 4px; font-size: 22px; }
.cel-sub { color: var(--muted); margin: 0 auto; max-width: 320px; }
.cel-more { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.cel-row { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
    .celebrate-bg.in .cel-medal svg, .celebrate-bg.in .cel-icon svg { animation: medalIn .7s cubic-bezier(.2, 1.4, .4, 1) both; }
}
@keyframes medalIn { from { transform: scale(.4) rotate(-25deg); opacity: 0 } to { transform: none; opacity: 1 } }

/* תחרויות */
.challenge.joined { border-color: var(--hairline-gold); }
.board { margin-top: 10px; }
.board-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center;
    padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.board-row:last-child { border-bottom: 0; }
.board-row.me { background: var(--accent-soft); border-radius: 8px; }
.board-row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-row .vl { font-weight: 700; }
.rk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--muted); }
.rk-1 { background: linear-gradient(180deg, #f3dca8, #b8904f); color: var(--on-accent); }
.rk-2 { background: linear-gradient(180deg, #eef0f2, #8d959c); color: #16191b; }
.rk-3 { background: linear-gradient(180deg, #e6b089, #9b5f38); color: #1d120a; }
.share-card { border-color: var(--hairline-gold); }
.share-link { background: var(--bg-soft); border-radius: 10px; padding: 9px 11px; font-size: 12.5px;
    word-break: break-all; text-align: left; }

/* שורת המוטיבציה במסך הבית */
.motiv-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; padding: 10px; }
.ms-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 4px; border-radius: 12px; text-decoration: none; color: var(--text); text-align: center; min-width: 0; }
.ms-cell:active { background: var(--bg-soft); }
.ms-l { font-size: 11.5px; color: var(--muted); line-height: 1.3; }

/* ===== התראות ===== */
.push-prompt { display: flex; gap: 10px; align-items: center; }
.push-prompt[hidden] { display: none; }
.card.push-prompt { border-color: var(--hairline-gold); }

/* ===== בר תחתון: קפסולה צפה עם נתונים חיים ===== */
:root { --nav-h: 64px; }
body { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 26px); }
.bottomnav.capsule {
    left: 12px; right: 12px; bottom: calc(var(--safe-b) + 10px);
    max-width: 480px; margin: 0 auto; border-radius: 32px;
    background: rgba(21, 26, 24, .86); backdrop-filter: blur(18px) saturate(1.2);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    border: 1px solid var(--hairline-gold); padding-bottom: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}
.capsule .bottomnav-inner { height: var(--nav-h); display: flex; align-items: center;
    justify-content: space-between; padding: 0 7px; max-width: none; gap: 2px; }
.capsule .navitem { flex: 1 1 0; min-width: 0; height: 50px; border-radius: 25px; gap: 6px;
    flex-direction: row; justify-content: center; color: var(--dim); font-size: 12.5px; font-weight: 600;
    transition: flex-grow .35s cubic-bezier(.4, 0, .2, 1), background .3s, color .3s; }
.capsule .navitem::after { display: none !important; }
.capsule .navitem .nl { max-width: 0; overflow: hidden; white-space: nowrap; opacity: 0;
    transition: max-width .35s cubic-bezier(.4, 0, .2, 1), opacity .25s; }
.capsule .navitem.on { flex-grow: 2.1; background: var(--grad); color: var(--on-accent); }
.capsule .navitem.on .nl { max-width: 64px; opacity: 1; }
.capsule .navitem .ico { position: relative; display: grid; place-items: center; line-height: 0; }
.capsule .navitem.center { flex: 0 0 54px; height: 54px; border-radius: 50%; background: var(--bg-soft);
    color: var(--accent); border: 1px solid var(--hairline-gold); }
.capsule .navitem.center .ico { width: auto; height: auto; margin: 0; background: none; box-shadow: none; color: inherit; }
.capsule .navitem.center:active { transform: scale(.92); }
.nav-dot { position: absolute; top: -2px; left: -3px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 0 2px #151a18; }
.navitem.on .nav-dot { box-shadow: 0 0 0 2px #d9b779; background: var(--on-accent); }
/* טבעות קטנות בבר */
.mini-ring .trk { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 3.5; }
.mini-ring .val { fill: none; stroke-width: 3.5; stroke-linecap: round; }
.mini-ring text { font-size: 11px; font-weight: 700; fill: currentColor; font-family: var(--font); }
.mini-ring text.sm { font-size: 8.5px; }
.mini-ring.lv-high .val { stroke: var(--green); } .mini-ring.lv-mid .val { stroke: var(--amber); }
.mini-ring.lv-low .val { stroke: var(--red); } .mini-ring.gold .val { stroke: var(--accent); }
.navitem.on .mini-ring .trk { stroke: rgba(23, 19, 11, .18); }
.navitem.on .mini-ring .val { stroke: var(--on-accent); }

/* מסך "אני" */
.me-head { display: flex; gap: 12px; align-items: center; margin: 4px 0 14px; }
.me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.me-tile { display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 13px; text-decoration: none; color: var(--text); min-width: 0; }
.me-tile:active { background: var(--card-2); }
.me-tile .icn-box { margin-bottom: 6px; }
.me-tile .mt-t { font-weight: 600; }
.me-tile .mt-v { font-size: 19px; font-weight: 600; }
.me-tile .mt-s { font-size: 11.5px; color: var(--dim); line-height: 1.35; }

/* שורת השעון בכרטיס ההמלצה */
.tb-wear { display: flex; flex-wrap: wrap; gap: 6px 14px; background: var(--bg-soft); border-radius: 11px;
    padding: 8px 11px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.tb-wear b { color: var(--text); font-weight: 700; margin-inline-end: 3px; }
a.brand:active { opacity: .7; }

/* מסך החיבורים */
.integ-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.integ-logo { width: 42px; height: 42px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--line);
    display: grid; place-items: center; color: var(--accent); font-weight: 800; font-size: 18px; flex-shrink: 0; }
.integ-t { font-weight: 600; }

/* ===== מעברים חלקים בין עמודים (View Transitions) =====
   הדפדפן מצלם את העמוד הישן והחדש ומנפיש ביניהם. הברים העליון והתחתון
   מקבלים שם קבוע — הם נשארים במקום בזמן שהתוכן מתחלף, וכדור הזהב של
   הלשונית הפעילה (navpill) גולש מהמיקום הישן לחדש. בלי תמיכה (דפדפן ישן)
   — ה-JS ב-DELTA.navFlip עושה את אותה גלישה של הכדור. */
@view-transition { navigation: auto; }
.topbar { view-transition-name: topbar; }
.bottomnav.capsule { view-transition-name: navbar; }
.capsule .navitem.on { view-transition-name: navpill; }
main.page { view-transition-name: page; }

@media (prefers-reduced-motion: no-preference) {
    ::view-transition-group(navpill) { animation-duration: .42s; animation-timing-function: cubic-bezier(.3, 1.25, .45, 1); }
    ::view-transition-old(navpill), ::view-transition-new(navpill) { height: 100%; animation-duration: .3s; }
    ::view-transition-old(page) { animation: vtOut .18s ease-in both; }
    ::view-transition-new(page) { animation: vtIn .3s cubic-bezier(.2, .8, .3, 1) both; }
    ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }
    @keyframes vtOut { to { opacity: 0; transform: scale(.985) } }
    @keyframes vtIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
    /* כשיש מעבר — העמוד כבר נכנס ברכות; בלי כניסה כפולה של הגוף */
    @supports (view-transition-name: none) {
        body { animation: none; }
        main.page > .hero, main.page > .card:not(.stat-detail), main.page > .stat-grid,
        main.page > .grid-2, main.page > a.card { animation-duration: .26s; }
    }
}
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* לחיצה על לשונית — תגובה מיידית גם לפני שהעמוד הבא נטען */
.capsule .navitem:active { transform: scale(.94); }
.capsule .navitem.pressing:not(.on) { background: rgba(217, 183, 121, .14); color: var(--text); }
/* גלישת הכדור בלי View Transitions (DELTA.navFlip) */
.capsule .navitem.flip { transition: transform .42s cubic-bezier(.3, 1.25, .45, 1), flex-grow .35s cubic-bezier(.4, 0, .2, 1); }

/* מחשב: הקפסולה נשארת קפסולה צפה במרכז (דורס את כלל הבר הישן לשולחני) */
@media (min-width: 900px) {
    .bottomnav.capsule { right: 0; left: 0; transform: none; max-width: 520px; margin: 0 auto;
        border-radius: 32px; border: 1px solid var(--hairline-gold); }
}

/* צ'ק-אין בוקר */
.feel-card { padding-bottom: 12px; transition: opacity .3s, transform .3s; }
.feel-card.sending { opacity: .55; transform: scale(.985); pointer-events: none; }
.feel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.feel-title { font-weight: 700; font-size: 17px; margin-top: 2px; }
.feel-xp { font-size: 12px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft);
    border: 1px solid rgba(217, 183, 121, .25); border-radius: 999px; padding: 4px 9px; flex-shrink: 0; }
.feel-row { display: flex; align-items: center; gap: 10px; }
.feel-l { width: 84px; flex-shrink: 0; font-size: 14px; color: var(--muted); }
.feel-row.set .feel-l { color: var(--text); }
.feel-scale { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; direction: ltr; }
.fv { height: 38px; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft);
    color: var(--dim); font: 700 14px var(--font); cursor: pointer; transition: background .15s, color .15s, transform .1s; }
.fv:active { transform: scale(.92); }
.fv.fill { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(217, 183, 121, .3); }
.fv.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.feel-scale.rev .fv.fill { background: var(--orange-soft); color: var(--orange); border-color: rgba(227, 167, 111, .3); }
.feel-scale.rev .fv.on { background: var(--orange); color: var(--on-accent); border-color: var(--orange); }
.feel-ends { display: grid; grid-template-columns: 84px 1fr 1fr; gap: 10px; font-size: 11px; color: var(--dim);
    margin: 3px 0 9px; }
.feel-ends span:nth-child(2) { text-align: right; }   /* RTL: חצי ימני = 5 */
.feel-ends span:nth-child(3) { text-align: left; }

/* זירה: רמה וליגה שבועית */
.level-card { display: flex; gap: 14px; align-items: center; }
.lv-badge { width: 58px; height: 58px; flex-shrink: 0; display: grid; place-items: center; border-radius: 18px;
    background: linear-gradient(145deg, #f0dcae, #b8904f); color: var(--on-accent);
    box-shadow: 0 6px 22px rgba(217, 183, 121, .22), inset 0 1px 0 rgba(255, 255, 255, .5); }
.lv-badge span { font-size: 24px; font-weight: 800; }
.lv-title { font-weight: 700; font-size: 18px; margin: 1px 0 7px; }
.lv-bar { height: 8px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--line); }
.lv-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.lv-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.league-card { --tier: #c98d5f; }
.league-card.tier-l1 { --tier: #cfd4d9; } .league-card.tier-l2 { --tier: #e6c26e; }
.league-card.tier-l3 { --tier: #7fa7e0; } .league-card.tier-l4 { --tier: #e07f8f; } .league-card.tier-l5 { --tier: #b9e6f0; }
.league-card .card-head h3 { color: var(--tier); display: flex; gap: 7px; align-items: center; }
.league-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lg-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; background: var(--bg-soft);
    font-size: 14px; border: 1px solid transparent; }
.lg-rank { width: 22px; text-align: center; font-weight: 700; color: var(--dim); flex-shrink: 0; }
.lg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-xp { font-weight: 700; flex-shrink: 0; }
.lg-row.z-up .lg-rank { color: var(--green); }
.lg-row.z-down .lg-rank { color: var(--red); }
.lg-row.me { border-color: rgba(217, 183, 121, .45); background: var(--accent-soft); }
.lg-row.me .lg-name { font-weight: 700; color: var(--accent-ink); }
.lg-cut { list-style: none; font-size: 11px; color: var(--green); text-align: center; padding: 2px 0;
    border-bottom: 1px dashed rgba(127, 200, 160, .4); margin-bottom: 3px; }
.xp-how { margin-top: 12px; }
.xp-how summary { cursor: pointer; color: var(--muted); }
.xp-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; margin-top: 8px; color: var(--muted); }
.xp-grid b { color: var(--accent-ink); }
.dash-hello { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.lv-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--muted); flex-shrink: 0; }
.lv-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800;
    background: linear-gradient(145deg, #f0dcae, #b8904f); color: var(--on-accent); }
.lv-mini { width: 38px; height: 5px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.lv-mini i { display: block; height: 100%; background: var(--accent); }
.lv-wk { font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.lv-wk::after { content: " נק'"; font-weight: 400; color: var(--dim); font-family: var(--font); }

/* מרוץ מול עצמך */
.race { padding: 12px 14px; transition: border-color .4s; }
.race-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.race-lane { display: grid; grid-template-columns: 44px 1fr 52px; align-items: center; gap: 8px; margin: 5px 0; }
.race-lane .rl { font-size: 12px; color: var(--muted); }
.race-lane b { font-size: 13px; text-align: left; }
.rb { position: relative; height: 10px; border-radius: 99px; background: var(--bg-soft); border: 1px solid var(--line); overflow: hidden; }
.rb i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: 99px;
    transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.rb .finish { position: absolute; inset-block: 0; inset-inline-end: 0; width: 2px; background: repeating-linear-gradient(0deg, var(--text) 0 2px, transparent 2px 4px); opacity: .5; }
.race-lane.me i { background: linear-gradient(270deg, var(--accent-2), var(--accent)); }
.race-lane.ghost i { background: repeating-linear-gradient(135deg, rgba(159, 183, 176, .55) 0 6px, rgba(159, 183, 176, .3) 6px 12px); }
.race-lane.ghost b, .race-lane.ghost .rl { color: var(--dim); }
.race-status { margin-top: 7px; color: var(--muted); }
.race.ahead .race-status { color: var(--green); }
.race.behind .race-status { color: var(--orange); }
.race.beat { border-color: rgba(217, 183, 121, .55); }
.race.beat .race-status { color: var(--accent-ink); font-weight: 700; }
.ex-ghost { margin-inline-start: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; background: var(--bg-soft);
    border: 1px solid var(--line); color: var(--dim); font-family: var(--mono, inherit); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.ex-ghost.ahead { color: var(--green); border-color: rgba(127, 200, 160, .4); background: var(--lime-soft); }

/* הסיכום השבועי — סטוריז במסך מלא */
html.stories-open, html.stories-open body { overflow: hidden; }
.stories { position: fixed; inset: 0; z-index: 900; background: #070908; display: grid; place-items: center;
    touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.st-frame { position: relative; width: 100%; height: 100%; max-width: 480px; overflow: hidden;
    background: radial-gradient(120% 70% at 85% 0%, rgba(217, 183, 121, .16), transparent 60%), var(--bg);
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 20px calc(env(safe-area-inset-bottom, 0px) + 22px);
    display: flex; flex-direction: column; }
@media (min-width: 700px) {
    .st-frame { height: min(92vh, 860px); border-radius: 28px; border: 1px solid var(--line);
        box-shadow: 0 30px 90px rgba(0, 0, 0, .6); }
}
.st-bars { display: flex; gap: 4px; direction: rtl; }
.st-bars span { flex: 1; height: 3px; border-radius: 3px; background: rgba(241, 237, 228, .18); overflow: hidden; }
.st-bars i { display: block; height: 100%; width: 0; background: var(--text); }
.st-top { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 4px; position: relative; z-index: 3; }
.st-brand { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.st-close { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
.st-deck { position: relative; flex: 1; }
.st-card { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    gap: 10px; opacity: 0; transform: translateY(14px) scale(.985); pointer-events: none;
    transition: opacity .45s ease, transform .55s cubic-bezier(.2, .8, .2, 1); }
.st-card.on { opacity: 1; transform: none; pointer-events: auto; }
.st-eyebrow { font-size: 14px; font-weight: 700; color: var(--accent-ink); letter-spacing: .3px; }
.st-huge { font-size: clamp(46px, 13vw, 64px); line-height: 1.02; margin: 0; font-weight: 800; }
.st-h2 { font-size: clamp(24px, 6.6vw, 30px); line-height: 1.3; margin: 0; font-weight: 700; }
.st-big { display: flex; align-items: baseline; gap: 2px; line-height: .95; }
.st-big b { font-size: clamp(88px, 27vw, 128px); font-weight: 800;
    background: linear-gradient(180deg, var(--accent-deep), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.st-big span { font-size: 30px; color: var(--muted); font-weight: 600; }
.st-sub { font-size: 18px; color: var(--muted); }
.st-line { font-size: 18px; line-height: 1.5; color: var(--text); margin: 6px 0 0; max-width: 380px; }
.st-hint { position: absolute; bottom: 0; inset-inline: 0; text-align: center; font-size: 13px; color: var(--dim); }
.st-mark { margin-bottom: 18px; filter: drop-shadow(0 10px 40px rgba(217, 183, 121, .35)); }
.st-card.on .st-mark { animation: stMark 1.1s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes stMark { from { opacity: 0; transform: scale(.6) rotate(-12deg); } }
.st-card.on .st-big b { animation: stPop .8s cubic-bezier(.2, 1.3, .4, 1) .1s both; }
@keyframes stPop { from { opacity: 0; transform: translateY(20px) scale(.8); } }
.st-strip { display: flex; gap: 8px; margin-top: 8px; }
.st-strip span { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); }
.st-strip i { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-soft); }
.st-strip .on { color: var(--accent-ink); }
.st-strip .on i { background: linear-gradient(145deg, var(--accent-2), var(--accent)); border-color: var(--accent); }
.st-pill { display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px; border-radius: 99px;
    background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.st-chip { display: inline-block; padding: 6px 14px; border-radius: 99px; font-weight: 700; font-size: 16px; }
.st-chip.up { background: var(--lime-soft); color: var(--green); }
.st-chip.down { background: var(--orange-soft); color: var(--orange); }
.st-bars2 { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.st-bars2 > div { display: grid; grid-template-columns: 96px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.st-bars2 .b { height: 14px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.st-bars2 .b i { display: block; height: 100%; border-radius: 99px; background: var(--dim); }
.st-bars2 .me .b i { background: linear-gradient(270deg, var(--accent-2), var(--accent)); }
.st-bars2 .me { color: var(--text); }
.st-bars2 b { text-align: left; }
.st-card.on .st-bars2 .b i { animation: stGrow 1s cubic-bezier(.2, .8, .2, 1) .2s both; }
@keyframes stGrow { from { width: 0; } }
.st-list { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.st-li { display: flex; gap: 10px; padding: 13px 15px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: 16px; }
.st-li b { color: var(--accent-ink); }
.st-flame .flame b { display: none; }
.st-grid { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.st-grid > div { padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line);
    display: flex; flex-direction: column; gap: 2px; }
.st-grid b { font-size: 26px; font-weight: 800; }
.st-grid span { font-size: 13px; color: var(--muted); }
.st-medals { display: flex; flex-wrap: wrap; gap: 12px; }
.st-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 18px; position: relative; z-index: 4; }
.st-tap { position: absolute; top: 70px; bottom: 0; z-index: 2; background: none; border: 0; padding: 0; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
.st-tap.prev { right: 0; width: 32%; }
.st-tap.next { left: 0; width: 68%; }

/* כרטיס הסיכום במסך הבית (ראשון–שני) */
.recap-card { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
    background: radial-gradient(110% 120% at 100% 0%, rgba(217, 183, 121, .16), transparent 60%), var(--card);
    border-color: rgba(217, 183, 121, .3); }
.recap-card .rc-rings { display: flex; gap: 3px; flex-shrink: 0; }
.recap-card .rc-rings i { width: 8px; height: 44px; border-radius: 99px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); opacity: .9; }
.recap-card .rc-rings i:nth-child(2) { opacity: .55; } .recap-card .rc-rings i:nth-child(3) { opacity: .3; }
@media (min-width: 900px) {
    .feel-row, .feel-ends { max-width: 520px; }
}
