/*
 * © 2026 רחוק מתוק. כל הזכויות שמורות. אין להעתיק, לשכפל, להפיץ, לשנות או להשתמש בקוד, בעיצוב או בשם, כולם או חלקם, ללא אישור מראש ובכתב מבעל הזכויות.
 */
/* רחוק מתוק — מערכת עיצוב */
:root {
  --bg: #FFF6EE;
  --bg2: #FFEADB;
  --card: #FFFFFF;
  --card2: #FFF9F4;
  --ink: #3A2530;
  --ink2: #765E6B;
  --ink3: #8A7480;
  --line: #F2E1D7;
  --pink: #FF6FA3;
  --pink-d: #E8508A;
  --pink-l: #FFD6E5;
  --dough: #F2C27E;
  --dough-d: #D99A55;
  --dough-l: #FADDB0;
  --green: #1FBF7C;
  --green-l: #D4F7E7;
  --warn: #FF9A3D;
  --hot: #FF4D66;
  --gold: #F6C445;
  --shadow: 0 14px 34px -16px rgba(170, 70, 105, .45);
  --shadow-s: 0 6px 16px -8px rgba(170, 70, 105, .35);
  --r-xl: 32px;
  --r-l: 24px;
  --r-m: 18px;
  --r-s: 12px;
  --font: 'Rubik', 'Varela Round', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --round: 'Varela Round', 'Rubik', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1419; --bg2: #2A1B22; --card: #2C1F26; --card2: #33242C; --ink: #FFF1F6; --ink2: #CDB3BF; --ink3: #8E7480;
    --line: #3F2E37; --pink-l: #5A2A3E; --green-l: #173E2F; --dough-l: #5A4127;
    --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7); --shadow-s: 0 6px 16px -8px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1419; --bg2: #2A1B22; --card: #2C1F26; --card2: #33242C; --ink: #FFF1F6; --ink2: #CDB3BF; --ink3: #8E7480;
  --line: #3F2E37; --pink-l: #5A2A3E; --green-l: #173E2F; --dough-l: #5A4127;
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7); --shadow-s: 0 6px 16px -8px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% -5%, var(--pink-l) 0, transparent 38%),
    radial-gradient(circle at 105% 18%, var(--dough-l) 0, transparent 34%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

#app { max-width: 520px; margin: 0 auto; padding: calc(14px + var(--safe-t)) 16px calc(110px + var(--safe-b)); }

/* ---------- כותרת ---------- */
.top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand svg { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 4px 6px rgba(200, 90, 120, .25)); }
.brand h1 { margin: 0; font-family: var(--round); font-size: 26px; letter-spacing: -.3px; line-height: 1; }
.brand h1 small { display: block; font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-top: 5px; letter-spacing: 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow-s); font-size: 20px; position: relative; transition: transform .15s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn .dot { position: absolute; top: 7px; left: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 2px var(--card); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---------- סינון קטגוריות ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px 4px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; min-height: 44px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-s);
  font-size: 14px; font-weight: 600; color: var(--ink2); white-space: nowrap; transition: all .15s;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.chip.lock { background: transparent; box-shadow: inset 0 0 0 2px var(--line); }

/* ---------- כרטיס ראשי ---------- */
.hero {
  position: relative; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow);
  padding: 14px 16px 18px; text-align: center; overflow: hidden; margin-bottom: 18px;
  transition: box-shadow .4s, transform .15s;
}
.hero::before {
  content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, var(--tint, var(--pink-l)) 0, transparent 62%); opacity: .55; pointer-events: none; transition: background .5s;
}
.hero.is-done { box-shadow: 0 0 0 3px var(--green), 0 18px 40px -16px rgba(31, 191, 124, .6); }
.hero.is-hot { animation: hotPulse 1.2s ease-in-out infinite; }
@keyframes hotPulse { 50% { box-shadow: 0 0 0 3px var(--hot), var(--shadow); } }
.hero-head { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; }
.hero-tag { font-size: 12px; font-weight: 700; color: var(--pink-d); background: var(--pink-l); padding: 4px 10px; border-radius: 999px; }
.hero-name { position: relative; font-family: var(--round); font-size: 21px; margin: 2px 40px 0; display: flex; align-items: center; justify-content: center; gap: 7px; }
.hero-name > span:not(.hero-star) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-star { font-size: 15px; background: var(--pink-l); width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.hero-desc { position: relative; color: var(--ink2); font-size: 13.5px; margin: 3px 0 0; }
.hero-tap { position: relative; display: block; width: 100%; border-radius: var(--r-l); padding: 6px 0 0; }
.hero-tap:active .donut-wrap { transform: scale(.96); }
.donut-wrap { position: relative; width: min(48vw, 196px); aspect-ratio: 1; margin: 6px auto 0; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.donut-wrap svg { width: 100%; height: 100%; overflow: visible; display: block; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.donut-face {
  width: 37%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  font-size: clamp(34px, 11vw, 50px); background: var(--card); box-shadow: inset 0 3px 10px rgba(120, 60, 30, .18);
}
.donut-face img { width: 100%; height: 100%; object-fit: cover; }
.clock-big {
  position: relative; font-family: var(--font); font-weight: 800; font-size: clamp(40px, 12.5vw, 56px); letter-spacing: -1px;
  line-height: 1; margin-top: 8px; color: var(--ink); transition: color .4s;
}
.clock-big .plus { font-size: .6em; vertical-align: .32em; margin-left: 2px; }
.clock-label { position: relative; font-size: 14px; color: var(--ink2); font-weight: 600; margin-top: 8px; min-height: 20px; }
.phase-warn .clock-big { color: var(--warn); }
.phase-hot .clock-big { color: var(--hot); }
.phase-done .clock-big { color: var(--green); text-shadow: 0 0 22px rgba(31, 191, 124, .45); }
.phase-done .clock-label { color: var(--green); }
.hero-cta {
  position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  background: linear-gradient(135deg, var(--pink), var(--pink-d)); color: #fff; font-weight: 700; font-size: 17px;
  padding: 13px 26px; border-radius: 999px; box-shadow: 0 10px 22px -10px var(--pink-d);
}
.hero-cta.soft { background: var(--card2); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.hero-meta { position: relative; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.hero-links { position: relative; display: flex; justify-content: center; margin-top: 8px; }
.link-btn { font-size: 13.5px; font-weight: 600; color: var(--ink2); padding: 8px 14px; min-height: 44px; border-radius: 999px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.link-btn:hover { color: var(--pink-d); }
/* מצב מיקוד: רק הסופגנייה והזמן, גדולים, בלי הסחות */
#app.focus > :not(.home-body), #app.focus .home-side, #app.focus .hero .more-btn, #app.focus .hero-meta, #app.focus .hero-desc { display: none !important; }
#app.focus .home-body { display: block; max-width: 560px; margin: 0 auto; }
#app.focus .hero { min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); display: flex; flex-direction: column; justify-content: center; margin: 0; background: transparent; box-shadow: none; }
#app.focus .hero.is-done { box-shadow: none; }
#app.focus .hero.is-hot { animation: none; }
#app.focus .donut-wrap { width: min(76vw, 340px); }
#app.focus .clock-big { font-size: clamp(52px, 17vw, 92px); margin-top: 18px; }
#app.focus .clock-label { font-size: 16px; }
.pill { font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: var(--card2); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink2); }
.pill b { color: var(--ink); }

.more-btn {
  position: absolute; top: 10px; left: 10px; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  color: var(--ink2); background: color-mix(in srgb, var(--card) 70%, transparent); z-index: 2; font-size: 20px; line-height: 1;
}
/* אזור לחיצה של 44 פיקסלים סביב ⋯ (קשה לפספס ולהתחיל מונה בטעות) */
.more-btn::before { content: ''; position: absolute; inset: -5px; border-radius: 14px; }
.more-btn:active { background: var(--line); }
.more-btn svg { width: 20px; height: 20px; }

/* ---------- רשת הרגלים ---------- */
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 4px 10px; }
.section-title h2 { font-size: 16px; margin: 0; color: var(--ink2); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 470px) { .grid { gap: 14px; } }
.tile {
  position: relative; aspect-ratio: 1 / 1.04; border-radius: var(--r-l); background: var(--card); box-shadow: var(--shadow-s);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px 10px 12px;
  transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .3s; overflow: hidden; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.tile::before { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, var(--tint) 0, transparent 70%); opacity: .5; transition: opacity .3s; }
.tile.running::before { opacity: .95; }
.tile:active, .tile.pressing { transform: scale(.95); }
.tile.phase-done { box-shadow: 0 0 0 3px var(--green), var(--shadow-s); }
.tile.phase-hot { box-shadow: 0 0 0 3px var(--hot), var(--shadow-s); }
.tile.phase-warn { box-shadow: 0 0 0 3px var(--warn), var(--shadow-s); }
.tile-ring { position: relative; width: 62%; aspect-ratio: 1; }
.tile-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tile-face {
  position: absolute; inset: 15%; border-radius: 30%; display: grid; place-items: center; overflow: hidden;
  font-size: clamp(30px, 10vw, 42px); background: var(--card); box-shadow: 0 4px 10px -4px rgba(120, 60, 30, .3);
}
.tile-face img { width: 100%; height: 100%; object-fit: cover; }
.tile-name { position: relative; font-weight: 700; font-size: 15px; margin-top: 9px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-time { position: relative; font-weight: 800; font-size: 17px; margin-top: 3px; color: var(--ink); }
.tile-sub { position: relative; font-size: 12px; color: var(--ink2); font-weight: 600; margin-top: 2px; }
.tile.idle .tile-time { font-size: 13px; color: var(--ink2); font-weight: 600; }
.tile.phase-warn .tile-time { color: var(--warn); }
.tile.phase-hot .tile-time { color: var(--hot); }
.tile.phase-done .tile-time { color: var(--green); }
.tile-play {
  position: absolute; bottom: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow-s); font-size: 11px; color: var(--pink-d);
}
.tile.add { background: transparent; box-shadow: inset 0 0 0 2.5px var(--line); border: 0; color: var(--ink2); gap: 8px; }
.tile.add::before { display: none; }
.tile.add .plus-c { width: 56px; height: 56px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow-s); display: grid; place-items: center; font-size: 30px; color: var(--pink); font-weight: 300; }
.tile.add span { font-weight: 700; font-size: 14.5px; }

/* ---------- מצב ריק ---------- */
.empty { text-align: center; padding: 30px 16px 10px; }
.empty svg { width: 150px; height: 150px; }
.empty h2 { font-family: var(--round); margin: 14px 0 6px; font-size: 22px; }
.empty p { color: var(--ink2); margin: 0 auto 18px; max-width: 300px; line-height: 1.5; }

/* ---------- כפתורים ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 18px;
  font-weight: 700; font-size: 16.5px; transition: transform .12s, filter .2s; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--pink-d)); color: #fff; box-shadow: 0 10px 20px -10px var(--pink-d); }
.btn.green { background: linear-gradient(135deg, #34D399, var(--green)); color: #fff; box-shadow: 0 10px 20px -10px var(--green); }
.btn.ghost { background: var(--card2); box-shadow: inset 0 0 0 2px var(--line); }
.btn.danger { background: #FFE3E7; color: #D12C47; }
:root[data-theme="dark"] .btn.danger { background: #4A1F28; color: #FF8A9C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { background: #4A1F28; color: #FF8A9C; } }
.btn.link { background: none; color: var(--ink2); font-weight: 600; padding: 10px; }
.btn small { display: block; font-weight: 500; font-size: 12.5px; opacity: .85; }
.btn-col { display: flex; flex-direction: column; gap: 10px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.fab {
  position: fixed; bottom: calc(22px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 8px; padding: 15px 24px; border-radius: 999px; font-weight: 700; font-size: 16px;
  background: var(--ink); color: var(--bg); box-shadow: 0 14px 30px -12px rgba(58, 37, 48, .6);
}
.fab:active { transform: translateX(-50%) scale(.95); }
.fab .p { font-size: 22px; line-height: 0; }

/* ---------- גיליון תחתון ---------- */
.sheet-back {
  position: fixed; inset: 0; background: rgba(40, 20, 30, .42); z-index: 50; opacity: 0; transition: opacity .25s;
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.sheet-back.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 520px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; background: var(--bg);
  border-radius: 30px 30px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); transform: translateY(100%);
  transition: transform .34s cubic-bezier(.2, .9, .25, 1.05); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); overscroll-behavior: contain;
}
.sheet-back.show .sheet { transform: translateY(0); }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 2px auto 12px; }
.sheet h3 { font-family: var(--round); font-size: 21px; margin: 4px 0 4px; text-align: center; }
.sheet .lead { text-align: center; color: var(--ink2); margin: 0 0 16px; line-height: 1.5; font-size: 15px; }
.sheet-emoji { font-size: 54px; text-align: center; line-height: 1.1; margin: 4px 0 6px; }
.sheet-close { position: absolute; }

/* תפריט */
.menu { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--shadow-s); }
.menu button { display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-align: right; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--line); }
.menu button:last-child { border-bottom: 0; }
.menu button:active { background: var(--card2); }
.menu .mi { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--card2); font-size: 18px; flex: none; }
.menu .mt { flex: 1; }
.menu .mt small { display: block; color: var(--ink2); font-weight: 500; font-size: 12.5px; margin-top: 1px; }
.menu .danger { color: #D12C47; }
.menu-head { display: flex; align-items: center; gap: 12px; margin: 0 4px 14px; }
.menu-head .f { width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; font-size: 30px; overflow: hidden; background: var(--tint); }
.menu-head .f img { width: 100%; height: 100%; object-fit: cover; }
.menu-head b { font-size: 18px; display: block; }
.menu-head span { color: var(--ink2); font-size: 13.5px; }

/* ---------- טפסים ---------- */
.field { margin-bottom: 16px; }
.field > label, .field > .lbl { display: block; font-weight: 700; font-size: 14px; margin: 0 4px 7px; color: var(--ink2); }
.input {
  width: 100%; padding: 14px 15px; border-radius: 16px; border: 0; background: var(--card); box-shadow: inset 0 0 0 2px var(--line);
  font-size: 16px; transition: box-shadow .15s; outline: none;
}
.input:focus { box-shadow: inset 0 0 0 2px var(--pink); }
.hint { font-size: 12.5px; color: var(--ink2); margin: 6px 4px 0; line-height: 1.45; }

.face-pick { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.face-prev { width: 76px; height: 76px; border-radius: 24px; display: grid; place-items: center; font-size: 44px; background: var(--tint); overflow: hidden; flex: none; box-shadow: var(--shadow-s); }
.face-prev img { width: 100%; height: 100%; object-fit: cover; }
.face-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.small-btn { padding: 10px 12px; border-radius: 13px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; justify-content: center; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; background: var(--card); border-radius: 18px; padding: 8px; box-shadow: inset 0 0 0 2px var(--line); max-height: 152px; overflow-y: auto; }
.emoji-grid button { aspect-ratio: 1; font-size: 25px; border-radius: 12px; transition: transform .12s; }
.emoji-grid button[aria-pressed="true"] { background: var(--pink-l); box-shadow: inset 0 0 0 2px var(--pink); }
.emoji-grid button:active { transform: scale(.88); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6); transition: transform .15s; }
.swatch[aria-pressed="true"] { transform: scale(1.12); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.seg { display: flex; background: var(--card); border-radius: 16px; padding: 4px; box-shadow: inset 0 0 0 2px var(--line); gap: 4px; }
.seg button { flex: 1; padding: 10px 10px; min-height: 44px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.quick button { padding: 9px 13px; min-height: 44px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; font-size: 14px; }
.quick button[aria-pressed="true"] { background: var(--pink); color: #fff; box-shadow: none; }
.dur { display: flex; gap: 10px; align-items: stretch; }
.dur .unit { flex: 1; display: flex; align-items: center; background: var(--card); border-radius: 16px; box-shadow: inset 0 0 0 2px var(--line); overflow: hidden; }
.dur .unit:focus-within { box-shadow: inset 0 0 0 2px var(--pink); }
.dur input { width: 100%; border: 0; background: none; padding: 13px 4px 13px 12px; font-size: 18px; font-weight: 700; text-align: center; outline: none; min-width: 0; }
.dur .unit span { padding-left: 12px; color: var(--ink2); font-size: 14px; font-weight: 600; white-space: nowrap; }
.stepper { display: flex; align-items: center; gap: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 18px; margin-bottom: 10px; box-shadow: var(--shadow-s); }
.row .rt { flex: 1; min-width: 0; }
.row .rt b { display: block; font-size: 15.5px; }
.row .rt small { color: var(--ink2); font-size: 12.5px; line-height: 1.4; display: block; margin-top: 2px; }
.toggle { position: relative; width: 52px; height: 31px; border-radius: 999px; background: var(--line); transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: 3px; right: 3px; width: 25px; height: 25px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .2); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.toggle[aria-checked="true"] { background: var(--green); }
.toggle::before { content: ''; position: absolute; inset: -7px -4px; }
.toggle[aria-checked="true"]::after { transform: translateX(-21px); }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink2) 50%), linear-gradient(135deg, var(--ink2) 50%, transparent 50%); background-position: 18px 52%, 12px 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-left: 34px; }
details.adv { background: var(--card); border-radius: 18px; box-shadow: inset 0 0 0 2px var(--line); padding: 4px 14px; margin-bottom: 16px; }
details.adv summary { list-style: none; cursor: pointer; padding: 12px 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::after { content: '‹'; margin-right: auto; transition: transform .2s; font-size: 22px; color: var(--ink2); transform: rotate(-90deg); }
details.adv[open] summary::after { transform: rotate(90deg); }
.preview-box { background: var(--green-l); color: var(--ink); border-radius: 16px; padding: 12px 14px; font-size: 14px; line-height: 1.55; margin-top: 4px; }
.preview-box b { color: var(--green); }
.presets { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px 16px; padding: 2px 18px 6px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.presets button { flex: none; display: flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-s); font-weight: 600; font-size: 14px; }
.presets button .e { font-size: 18px; }
/* בורר מקובץ: קטגוריות (צ'יפים נגללים) ← קבוצות ← הרגלים (עוטפים, בלי גלילה אינסופית) */
.pcats { display: flex; gap: 6px; overflow-x: auto; margin: 4px -18px 10px; padding: 2px 18px 6px; scrollbar-width: none; }
.pcats::-webkit-scrollbar { display: none; }
.pcats button { flex: none; min-height: 40px; padding: 8px 13px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); font-weight: 600; font-size: 13.5px; color: var(--ink2); }
.pcats button[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.pcats .pmine { background: var(--pink-l); color: var(--pink-d); box-shadow: none; }
/* במחשב (עכבר) אי אפשר לגלול הצידה בלי גלגלת — הצ'יפים יורדים לשורה חדשה */
@media (hover: hover) and (pointer: fine) {
  .pcats, .presets { flex-wrap: wrap; overflow-x: visible; }
}
.pbody { min-height: 120px; }
.pgroup { margin-bottom: 8px; }
.pgroup-t { font-size: 12.5px; font-weight: 700; color: var(--ink2); margin: 4px 2px 6px; }
.pgroup .presets { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.pgroup .presets button { min-height: 40px; }
.pgroup .presets button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--pink); }
.pgroup .presets .pmore { background: transparent; box-shadow: inset 0 0 0 2px var(--line); color: var(--ink2); }

/* ---------- עמודים ---------- */
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h2 { font-family: var(--round); margin: 0; font-size: 23px; flex: 1; }
.back { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow-s); font-size: 22px; }
.group-title { font-weight: 700; color: var(--ink2); font-size: 13.5px; margin: 20px 6px 9px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 20px; padding: 14px; box-shadow: var(--shadow-s); }
.stat .v { font-size: 19px; font-weight: 800; line-height: 1.25; }
.stat .k { color: var(--ink2); font-size: 13px; font-weight: 600; margin-top: 2px; }
.chart { background: var(--card); border-radius: 22px; padding: 26px 14px 10px; box-shadow: var(--shadow-s); }
.chart-bars { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 140px; direction: ltr; }
.chart-bars .bar { flex: 1; max-width: 26px; border-radius: 7px 7px 3px 3px; background: var(--pink-l); min-height: 4px; position: relative; transition: height .5s cubic-bezier(.2, .9, .3, 1); }
.chart-bars .bar.ok { background: linear-gradient(180deg, #4BE0A6, var(--green)); }
.chart-bars .bar.slip { background: linear-gradient(180deg, #FFB3CE, var(--pink)); }
.chart-line { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--ink3); z-index: 1; pointer-events: none; }
.chart-line span { position: absolute; right: 0; top: -20px; font-size: 11px; font-weight: 700; color: var(--ink2); background: var(--card); padding: 0 4px; border-radius: 6px; direction: rtl; }
.chart-legend { display: flex; gap: 14px; justify-content: center; font-size: 12.5px; color: var(--ink2); margin-top: 10px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 5px; vertical-align: -1px; }
.trend { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow-s); margin-bottom: 14px; }
.trend .ti { font-size: 28px; flex: none; }
.trend p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink2); }
.trend p b { color: var(--ink); }
.trend.up { background: var(--green-l); }
.trend.up p b { color: var(--green-d, #10A56F); }
.advice { background: var(--card); border-radius: 22px; padding: 16px; box-shadow: var(--shadow-s); margin-bottom: 14px; border-inline-start: 5px solid var(--pink); }
.advice.raise { border-inline-start-color: var(--green); }
.advice p { margin: 6px 0 12px; font-size: 14px; line-height: 1.55; color: var(--ink2); }
.advice p b { color: var(--ink); }
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.cal-head span { font-size: 12px; font-weight: 700; color: var(--ink3); padding-bottom: 6px; }
.cal i { font-style: normal; aspect-ratio: 1; border-radius: 11px; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink2); background: var(--card2); box-shadow: inset 0 0 0 1px var(--line); }
.cal i.ok { background: linear-gradient(160deg, #4BE0A6, var(--green)); color: #fff; box-shadow: none; }
.cal i.slip { background: linear-gradient(160deg, #FFB3CE, var(--pink)); color: #fff; box-shadow: none; }
.cal i.live { background: var(--green-l); box-shadow: inset 0 0 0 2px var(--green); color: var(--ink); }
.cal i.fut { opacity: .5; background: transparent; box-shadow: none; border: 1.5px dashed var(--line); color: var(--ink3); }
.cal i.pre { opacity: .45; background: transparent; box-shadow: none; color: var(--ink3); }
.cal i.today { outline: 2.5px solid var(--ink); outline-offset: 1px; }
@media (min-width: 768px) { .cal i { aspect-ratio: 1.5; } }
.heat { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; direction: ltr; }
.heat i { aspect-ratio: 1 / 2.2; border-radius: 5px; background: color-mix(in srgb, var(--pink) calc(var(--v) * 100%), var(--card2)); box-shadow: inset 0 0 0 1px var(--line); }
.heat-axis { display: flex; justify-content: space-between; direction: ltr; font-size: 11px; color: var(--ink3); margin-top: 5px; }
.insight { margin: 12px 2px 4px; font-size: 14px; line-height: 1.55; }
.insight b { color: var(--pink-d); }
.log { display: flex; flex-direction: column; gap: 8px; }
.log-item { display: flex; align-items: center; gap: 12px; background: var(--card); padding: 12px 14px; border-radius: 16px; box-shadow: var(--shadow-s); cursor: pointer; transition: transform .12s; }
.log-item:active { transform: scale(.98); }
.log-item .ic { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: none; }
.log-item .ic.ok { background: var(--green-l); }
.log-item .ic.slip { background: var(--pink-l); }
.log-item .t { flex: 1; }
.log-item .t b { display: block; font-size: 15px; }
.log-item .t small { color: var(--ink2); font-size: 12.5px; }
.empty-s { text-align: center; color: var(--ink2); padding: 22px; background: var(--card); border-radius: 20px; }

.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: var(--card); border-radius: 22px; padding: 14px 8px 12px; text-align: center; box-shadow: var(--shadow-s); position: relative; }
.badge .be { width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: radial-gradient(circle at 35% 30%, #FFF3C4, var(--gold)); box-shadow: 0 6px 14px -6px #D9A21B, inset 0 -3px 0 rgba(0, 0, 0, .08); }
.badge b { display: block; font-size: 13px; line-height: 1.2; }
.badge small { display: block; color: var(--ink2); font-size: 11px; margin-top: 4px; line-height: 1.3; }
.badge.locked .be { background: var(--card2); box-shadow: inset 0 0 0 2px var(--line); filter: grayscale(1); opacity: .55; }
.badge.locked b { color: var(--ink3); }
button.badge { width: 100%; font: inherit; color: inherit; transition: transform .15s; }
button.badge:active { transform: scale(.95); }
.medal { width: 132px; height: 132px; margin: 6px auto 14px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #FFF6D6, var(--gold) 60%, #D9A21B); box-shadow: 0 16px 34px -14px #C98B0A, inset 0 -6px 0 rgba(0,0,0,.1), 0 0 0 8px rgba(246, 196, 69, .25);
  display: grid; place-items: center; animation: medalIn .7s cubic-bezier(.2, 1.5, .4, 1) both; }
.medal::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.75) 50%, transparent 60%); animation: shine 2.4s ease-in-out .5s infinite; }
.medal-in { font-size: 64px; position: relative; z-index: 1; }
.medal.locked { background: var(--card2); box-shadow: inset 0 0 0 3px var(--line); filter: grayscale(1); }
.medal.locked::after { display: none; }
@keyframes medalIn { from { transform: scale(.2) rotate(-30deg); opacity: 0; } }
@keyframes shine { 0% { transform: translateX(-60%); } 60%, 100% { transform: translateX(60%); } }
.badge .new { position: absolute; top: 8px; left: 8px; background: var(--hot); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 99px; }
.progress-strip { background: var(--card); border-radius: 20px; padding: 14px 16px; box-shadow: var(--shadow-s); margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.progress-strip .bar-o { flex: 1; height: 12px; border-radius: 99px; background: var(--card2); box-shadow: inset 0 0 0 1.5px var(--line); overflow: hidden; }
.progress-strip .bar-i { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--pink)); }

.help { display: flex; flex-direction: column; gap: 10px; }
.help-i { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-s); }
.help-i .hi { width: 40px; height: 40px; border-radius: 13px; background: var(--card2); display: grid; place-items: center; font-size: 21px; flex: none; font-weight: 800; }
.help-i b { font-size: 15.5px; }
.help-i p { margin: 3px 0 0; color: var(--ink2); font-size: 13.5px; line-height: 1.5; }

/* ---------- קוד נעילה ---------- */
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 22px; direction: ltr; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px var(--ink3); transition: all .15s; }
.pin-dots i.on { background: var(--pink); box-shadow: none; transform: scale(1.1); }
.pin-dots.err { animation: shake .4s; }
.pin-dots.err i { background: var(--hot); box-shadow: none; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 290px; margin: 0 auto; direction: ltr; }
.pinpad button { height: 64px; border-radius: 22px; background: var(--card); box-shadow: var(--shadow-s); font-size: 26px; font-weight: 600; }
.pinpad button:active { background: var(--pink-l); transform: scale(.95); }
.pinpad .ghost { background: none; box-shadow: none; font-size: 15px; color: var(--ink2); }

/* ---------- הודעות קופצות ---------- */
.toasts { position: fixed; bottom: calc(18px + var(--safe-b)); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 20px;
  font-weight: 600; font-size: 15px; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45); transform: translateY(30px) scale(.9); opacity: 0;
  transition: all .35s cubic-bezier(.3, 1.5, .5, 1); pointer-events: auto;
}
.toast.show { transform: none; opacity: 1; }
.toast .te { font-size: 24px; }
.toast small { display: block; opacity: .75; font-weight: 500; font-size: 12.5px; }
.toast-act { flex: none; background: var(--pink); color: #fff; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 12px; margin-right: 4px; }
.toast-act:active { transform: scale(.94); }
.toast.badge-t { background: linear-gradient(135deg, #FFF3C4, var(--gold)); color: #4A3300; }

/* פיצוץ "התחלת דרך חדשה" */
.splash {
  position: fixed; z-index: 70; pointer-events: none; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.3); opacity: 0;
  background: linear-gradient(var(--card), var(--card)) padding-box, linear-gradient(135deg, var(--pink), var(--gold), #5AB4F5, var(--green)) border-box;
  border: 3px solid transparent; padding: 18px 28px; border-radius: 30px; box-shadow: 0 22px 50px -15px rgba(200, 60, 110, .6);
  text-align: center; font-family: var(--round); font-size: 23px; color: var(--pink-d); white-space: nowrap; animation: splash 1.7s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
.splash .se { font-size: 50px; display: block; line-height: 1.1; margin-bottom: 4px; animation: wiggle .6s ease-in-out .15s 2; }
@keyframes wiggle { 25% { transform: rotate(-12deg) scale(1.1); } 75% { transform: rotate(12deg) scale(1.1); } }
.splash small { display: block; font-family: var(--font); font-size: 13.5px; color: var(--ink2); margin-top: 4px; }
@keyframes splash {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(-8deg); opacity: 0; }
  18% { transform: translate(-50%, -50%) scale(1.08) rotate(2deg); opacity: 1; }
  28% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -62%) scale(.9); opacity: 0; }
}

/* נגיסה בסופגנייה */
.bite { position: absolute; top: -4%; left: -4%; width: 46%; height: 46%; pointer-events: none; z-index: 3; }
.bite i { position: absolute; border-radius: 50%; background: var(--card); transform: scale(0); animation: bite .32s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.bite i:nth-child(1) { width: 52%; height: 52%; top: 18%; left: 6%; }
.bite i:nth-child(2) { width: 50%; height: 50%; top: 0; left: 34%; animation-delay: .08s; }
.bite i:nth-child(3) { width: 44%; height: 44%; top: 38%; left: 0; animation-delay: .16s; }
@keyframes bite { to { transform: scale(1); } }

.fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* ---------- ברוכים הבאים ---------- */
.onb { min-height: calc(100vh - 40px); min-height: calc(100dvh - 40px); display: flex; flex-direction: column; text-align: center; padding-top: 4vh; }
.onb-art { flex: none; height: 230px; display: grid; place-items: center; }
.onb-art svg { width: 200px; height: 200px; }
.onb h2 { font-family: var(--round); font-size: 28px; margin: 12px 0 10px; }
.onb p { color: var(--ink2); font-size: 16.5px; line-height: 1.6; max-width: 340px; margin: 0 auto; }
.onb .grow { flex: 1; }
.onb.slides { padding-top: max(4vh, calc(50vh - 330px)); }
.onb-dots { display: flex; justify-content: center; gap: 7px; margin: 22px 0 18px; }
.onb-dots i { width: 8px; height: 8px; border-radius: 9px; background: var(--line); transition: all .3s; }
.onb-dots i.on { width: 24px; background: var(--pink); }
.pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: right; margin-top: 16px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow-s); transition: all .15s; }
.pick .e { font-size: 28px; }
.pick b { font-size: 14.5px; display: block; }
.pick small { color: var(--ink2); font-size: 11.5px; }
.pick[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--pink), var(--shadow-s); background: var(--pink-l); }
.tgt-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tgt { background: var(--card); border-radius: 20px; padding: 12px 14px 4px; box-shadow: var(--shadow-s); }
.tgt-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tgt-h .e { font-size: 24px; }
.tgt .quick button { padding: 8px 12px; font-size: 13.5px; }
.slide-in { animation: slideIn .45s cubic-bezier(.2, .9, .3, 1); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-24px); } }
.float { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px) rotate(3deg); } }
.spin-slow { transform-origin: 100px 100px; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* אנימציית כניסה — רק במעבר בין מסכים, לא בכל רענון */
.enter .fade-up, .enter .grid .tile { animation: fadeUp .45s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

.foot { text-align: center; color: var(--ink3); font-size: 12px; margin-top: 26px; }

/* עכבר: הרמה עדינה במעבר */
@media (hover: hover) and (pointer: fine) {
  .tile:not(.add):hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .tile.add:hover { box-shadow: inset 0 0 0 2.5px var(--pink); color: var(--pink-d); }
  .icon-btn:hover, .back:hover, .chip:hover { transform: translateY(-2px); }
  .btn:hover { filter: brightness(1.04); }
  .menu button:hover, .log-item:hover { background: var(--card2); }
  .hero-tap:hover .donut-wrap { transform: rotate(-4deg) scale(1.02); }
  .more-btn:hover { background: var(--line); color: var(--ink); }
  button.badge:hover { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  #app { padding-top: 34px; }
}
/* מחשב: הרגל ראשי מימין, רשת משמאל */
@media (min-width: 960px) {
  #app.v-home { max-width: 1080px; }
  .v-home .home-body { display: grid; grid-template-columns: 430px 1fr; gap: 28px; align-items: start; }
  .v-home .home-main { position: sticky; top: 24px; }
  .v-home .grid { grid-template-columns: repeat(3, 1fr); }
  .v-home .section-title { margin-top: 0; }
  .v-home .donut-wrap { width: 250px; }
  .v-home .chips { margin: 0 0 8px; padding-inline: 2px; }
  .desk-only { display: block; }
  .desk-sum { margin-top: 22px; }
  .desk-sum .stats { margin-bottom: 10px; }
}
@media (max-width: 959px) { .desk-only { display: none; } }

/* ===== אנגלית: משמאל לימין (js/i18n.js שם dir="ltr" על <html>) =====
 * העיצוב נבנה לעברית; כאן רק מה שצריך להפוך צד. */
[dir="ltr"] .icon-btn .dot { left: auto; right: 7px; }
[dir="ltr"] .more-btn { left: auto; right: 10px; }
[dir="ltr"] .tile-play { right: auto; left: 10px; }
[dir="ltr"] .badge .new { left: auto; right: 8px; }
[dir="ltr"] .menu button, [dir="ltr"] .pick-grid { text-align: left; }
[dir="ltr"] .dur .unit span { padding-left: 0; padding-right: 12px; }
[dir="ltr"] .toggle::after { right: auto; left: 3px; }
[dir="ltr"] .toggle[aria-checked="true"]::after { transform: translateX(21px); }
[dir="ltr"] .select { background-position: right 12px top 52%, right 18px top 52%; padding-left: 15px; padding-right: 34px; }
[dir="ltr"] details.adv summary::after { content: '›'; margin-right: 0; margin-left: auto; transform: rotate(90deg); }
[dir="ltr"] details.adv[open] summary::after { transform: rotate(-90deg); }
[dir="ltr"] .chart-line span { right: auto; left: 0; direction: ltr; }
[dir="ltr"] .chart-legend i { margin-left: 0; margin-right: 5px; }
[dir="ltr"] .toast-act { margin-right: 0; margin-left: 4px; }
[dir="ltr"] .slide-in { animation-name: slideInLtr; }
@keyframes slideInLtr { from { opacity: 0; transform: translateX(24px); } }
