/* גופנים מקומיים — הכול מהדומיין שלנו, בלי גוגל */
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/heebo-hebrew-400-normal.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/heebo-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/heebo-hebrew-500-normal.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/heebo-latin-500-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/heebo-hebrew-700-normal.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/heebo-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/heebo-hebrew-800-normal.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Heebo'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/heebo-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Frank Ruhl Libre'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/frank-ruhl-libre-hebrew-700-normal.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Frank Ruhl Libre'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/frank-ruhl-libre-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Frank Ruhl Libre'; font-style: normal; font-weight: 900; font-display: swap; src: url('fonts/frank-ruhl-libre-hebrew-900-normal.woff2') format('woff2'); unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: 'Frank Ruhl Libre'; font-style: normal; font-weight: 900; font-display: swap; src: url('fonts/frank-ruhl-libre-latin-900-normal.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* מגביתא — שפת עיצוב משותפת
   קונספט: "פנקס הגבאי" — פס כהה עליון כמו כריכת פנקס, דפים בהירים, מטבע זהב כצבע ההדגשה היחיד.
   כותרות במשקל ספרותי (פרנק רוהל), גוף נקי (Heebo), ספרות טבלאיות בכל סכום. */
:root {
  --ground: #E9ECE6;
  --surface: #FFFFFF;
  --surface-2: #F4F6F1;
  --line: #D5D9CF;
  --ink: #14212E;
  --muted: #56626D;
  --bar: #14212E;
  --on-bar: #F1F3EE;
  --on-bar-muted: #AAB5BF;
  --bar-2: #22313F;
  --coin: #E2AE4A;
  --gold-text: #8A5A00;
  --gold-soft: #F7E9C8;
  --green: #1C6646;
  --green-soft: #DCEDE3;
  --red: #9E3320;
  --red-soft: #F5DDD6;
  --blue: #1D4E89;
  --blue-soft: #E0E8F3;
  --focus: #1D4E89;
  --shadow: 0 1px 0 rgba(20, 33, 46, .06), 0 6px 18px -12px rgba(20, 33, 46, .35);

  --font-display: "Frank Ruhl Libre", "David Libre", "Times New Roman", serif;
  --font-body: "Heebo", "Assistant", "Arial Hebrew", Arial, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0E151C; --surface: #16212B; --surface-2: #1B2833; --line: #2A3846;
    --ink: #E7ECEF; --muted: #9AA7B3; --bar: #090F15; --on-bar: #EEF1F3; --on-bar-muted: #93A0AC; --bar-2: #18232E;
    --coin: #E7B656; --gold-text: #E7B656; --gold-soft: #3A2E14; --green: #5DC08F; --green-soft: #173528;
    --red: #EE8A73; --red-soft: #3D1F18; --blue: #8DB4E8; --blue-soft: #18283C; --focus: #8DB4E8;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 22px -14px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0E151C; --surface: #16212B; --surface-2: #1B2833; --line: #2A3846;
  --ink: #E7ECEF; --muted: #9AA7B3; --bar: #090F15; --on-bar: #EEF1F3; --on-bar-muted: #93A0AC; --bar-2: #18232E;
  --coin: #E7B656; --gold-text: #E7B656; --gold-soft: #3A2E14; --green: #5DC08F; --green-soft: #173528;
  --red: #EE8A73; --red-soft: #3D1F18; --blue: #8DB4E8; --blue-soft: #18283C; --focus: #8DB4E8;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 22px -14px rgba(0,0,0,.8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.num, .money { font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 900; letter-spacing: -.01em; }
[hidden] { display: none !important; }

/* כפתורים */
.btn {
  min-height: 46px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-go { background: var(--green); color: #fff; border-color: var(--green); }
:root[data-theme="dark"] .btn-go { color: #08130D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-go { color: #08130D; } }
.btn-coin { background: var(--coin); color: #1B1405; border-color: var(--coin); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* תגיות מצב */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-gold { background: var(--gold-soft); color: var(--gold-text); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-mute { background: var(--surface-2); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* שדות */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.input, .select, .textarea {
  min-height: 46px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); padding: 0 12px; font-size: 15px; width: 100%;
}
.textarea { padding: 10px 12px; min-height: 92px; resize: vertical; line-height: 1.5; }

/* פס התקדמות */
.track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.track-coin { background: var(--bar-2); }
.track-coin > i { background: var(--coin); }

/* הודעה קופצת */
.toast-wrap { position: fixed; inset: auto 0 calc(88px + env(safe-area-inset-bottom, 0px)) 0; display: flex; justify-content: center; pointer-events: none; z-index: 80; padding-inline: 16px; }
.toast { background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: var(--r-md); font-weight: 600; box-shadow: var(--shadow); max-width: 520px; text-align: center; animation: toastIn .25s ease; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.demo-flag { font-size: 12px; font-weight: 700; color: #1B1405; background: var(--coin); padding: 2px 10px; border-radius: 999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
