/* =====================================================================
   הכיס שלנו - מערכת עיצוב
   Mobile-first. כל ערך נלקח מסקאלה: צבע, טיפוגרפיה, ריווח, רדיוס, צל, תנועה.
   ===================================================================== */

:root {
  /* ---- צבעי בסיס (פלטה טבעית: טורקיז, כחול ים, חום עץ, חול) ---- */
  --sand-50: #fbf8f3;  --sand-100: #f5efe5; --sand-200: #ece2d3; --sand-300: #ddcdb6;
  --teal-50: #e6f4f2;  --teal-100: #cdeae6; --teal-400: #3fb3ab; --teal-500: #0f8b8d; --teal-600: #0b7476; --teal-700: #0a5c5f; --teal-900: #0a3a3d;
  --ocean-50: #e8f0f7; --ocean-500: #1f5f8b; --ocean-700: #164666;
  --clay-50: #f8ece0;  --clay-300: #ecc99f; --clay-200: #f3d9b8; --clay-500: #c0824f; --wood-600: #8a5a3b; --wood-800: #4a2f1b;
  --moss-500: #4f7d56; --red-500: #c4513d;
  --ink-900: #18211f; --ink-700: #3a4744; --ink-500: #66736e; --ink-400: #8a958f;

  /* ---- צבעים סמנטיים ---- */
  --bg: var(--sand-100);
  --bg-2: var(--sand-200);
  --surface: #fffdf9;
  --surface-sunken: var(--sand-50);
  --line: color-mix(in srgb, var(--sand-300) 70%, transparent);
  --line-strong: var(--sand-300);
  --text: var(--ink-900);
  --text-2: var(--ink-700);
  --muted: var(--ink-500);
  --accent: var(--teal-500);
  --accent-hover: var(--teal-600);
  --accent-soft: var(--teal-50);
  --accent-ink: var(--teal-700);
  --on-accent: #fff;
  --danger: var(--red-500);
  --success: var(--moss-500);
  --focus: color-mix(in srgb, var(--teal-400) 55%, transparent);

  /* שמות שהקוד משתמש בהם */
  --card: var(--surface);
  --teal: var(--teal-500); --teal-d: var(--teal-700); --turq: var(--teal-400); --turq-soft: var(--teal-50);
  --ocean: var(--ocean-500); --ocean-soft: var(--ocean-50);
  --clay: var(--clay-500); --clay-soft: var(--clay-50); --wood: var(--wood-600); --moss: var(--moss-500);
  --needs: var(--ocean); --wants: var(--clay); --invest: var(--teal); --income: var(--moss);

  --hero: linear-gradient(145deg, var(--teal-700) 0%, var(--teal-500) 52%, var(--ocean-500) 100%);
  --brand-grad: linear-gradient(170deg, var(--teal-900) 0%, var(--teal-700) 45%, var(--ocean-700) 100%);

  /* ---- טיפוגרפיה: סקאלה 1.2 (minor third), גדלים פלואידיים בכותרות ---- */
  --font: "Assistant", system-ui, "Segoe UI", Arial, sans-serif;
  --display: "Rubik", "Assistant", system-ui, sans-serif;
  --text-2xs: 0.6875rem;                                   /* 11 */
  --text-xs: 0.75rem;                                      /* 12 */
  --text-sm: 0.875rem;                                     /* 14 */
  --text-base: 1rem;                                       /* 16 */
  --text-md: 1.125rem;                                     /* 18 */
  --text-lg: clamp(1.25rem, 1.15rem + .4vw, 1.375rem);     /* 20-22 */
  --text-xl: clamp(1.375rem, 1.2rem + .8vw, 1.75rem);      /* 22-28 */
  --text-2xl: clamp(1.75rem, 1.45rem + 1.3vw, 2.25rem);    /* 28-36 */
  --text-3xl: clamp(2.25rem, 1.8rem + 2vw, 3rem);          /* 36-48 */
  --leading-tight: 1.15; --leading-snug: 1.3; --leading-normal: 1.5;
  --tracking-tight: -0.02em; --tracking-wide: 0.04em;
  --weight-regular: 400; --weight-medium: 500; --weight-semibold: 600; --weight-bold: 700;

  /* ---- ריווח: רשת 4pt ---- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px;
  --gutter: var(--space-4);

  /* ---- רדיוס ---- */
  --radius-xs: 6px; --radius-sm: 10px; --radius-md: 14px; --radius-lg: 20px; --radius-xl: 28px; --radius-full: 999px;
  --radius: var(--radius-lg);

  /* ---- צללים (גובה) - חמים, בגווני חום ---- */
  --shadow-1: 0 1px 2px rgb(60 40 20 / .06);
  --shadow-2: 0 1px 2px rgb(60 40 20 / .05), 0 6px 16px -8px rgb(60 40 20 / .16);
  --shadow-3: 0 2px 4px rgb(60 40 20 / .05), 0 16px 36px -14px rgb(60 40 20 / .24);
  --shadow-4: 0 30px 80px -20px rgb(20 20 10 / .45);
  --shadow: var(--shadow-2);

  /* ---- תנועה ---- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);      /* אקספוננציאלי - כניסה מהירה ונחיתה רכה */
  --ease-spring: cubic-bezier(.22, 1, .36, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 280ms;  /* כל תנועה עד 300ms */

  /* ---- שכבות ---- */
  --z-header: 15; --z-nav: 20; --z-fab: 21; --z-sheet: 30; --z-toast: 40;

  /* ---- מידות ---- */
  --tap: 44px;
  --nav-h: 64px;
  --content-max: 1160px;
  --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"]) {
    color-scheme: dark;
    --bg: #0e1817; --bg-2: #15231f; --surface: #162422; --surface-sunken: #12201e;
    --line: color-mix(in srgb, #2a4440 80%, transparent); --line-strong: #2a4440;
    --text: #e8efec; --text-2: #c3d0cb; --muted: #8fa39d;
    --accent: #3fb3ab; --accent-hover: #55c3bb; --accent-soft: #173936; --accent-ink: #7fd6cf;
    --teal: #3fb3ab; --teal-d: #7fd6cf; --turq-soft: #173936;
    --ocean: #5d9ccf; --ocean-soft: #16303f; --clay: #d79a68; --clay-soft: #36271b; --wood: #e0b48b; --moss: #86b38c;
    --danger: #e27762; --success: #86b38c;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-2: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -12px rgb(0 0 0 / .55);
    --shadow-3: 0 2px 4px rgb(0 0 0 / .3), 0 18px 40px -14px rgb(0 0 0 / .65);
  }
}

/* =========================== בסיס =========================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--text-base); line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: var(--weight-semibold); margin: 0; letter-spacing: var(--tracking-tight); line-height: var(--leading-tight); }
p { margin: var(--space-2) 0; }
b, strong { font-weight: var(--weight-bold); }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* כפתורים */
button {
  font: inherit; font-weight: var(--weight-semibold); cursor: pointer; border: 0;
  min-height: var(--tap); padding: 0 var(--space-4); border-radius: var(--radius-md);
  background: var(--accent); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  transition: transform var(--dur-1) var(--ease-out), background var(--dur-2), box-shadow var(--dur-2), color var(--dur-2);
  touch-action: manipulation; user-select: none;
}
@media (hover: hover) { button:hover { background: var(--accent-hover); } }
button:active { transform: scale(.97); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button.ghost { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
@media (hover: hover) { button.ghost:hover { background: var(--accent-soft); } }
button.soft { background: var(--accent-soft); color: var(--accent-ink); }
@media (hover: hover) { button.soft:hover { background: color-mix(in srgb, var(--accent-soft) 80%, var(--accent) 20%); } }
button.link { background: none; color: var(--accent-ink); padding: 0; min-height: 0; font-weight: var(--weight-semibold); }
@media (hover: hover) { button.link:hover { background: none; text-decoration: underline; text-underline-offset: 3px; } }
button.danger { background: none; color: var(--danger); padding: 0 var(--space-3); }
@media (hover: hover) { button.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); } }
button.sm { min-height: 34px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }

/* שדות - 16px לפחות כדי שהאייפון לא יעשה זום */
input, select, textarea {
  font: inherit; font-size: max(16px, 1rem); color: var(--text);
  min-height: var(--tap); padding: 0 var(--space-3); width: 100%;
  background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: var(--radius-md);
  transition: border-color var(--dur-2), box-shadow var(--dur-2);
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); outline: none; }
input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="checkbox"] { min-height: 0; width: 22px; height: 22px; padding: 0; accent-color: var(--accent); flex: none; }
select { appearance: none; -webkit-appearance: none; padding-left: var(--space-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2366736e' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left var(--space-3) center; }
label { display: block; margin: var(--space-3) 0 var(--space-1); color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-semibold); }
details summary { min-height: var(--tap); display: flex; align-items: center; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* =========================== מבנה =========================== */
.shell { min-height: 100dvh; }
.side { display: none; }
.main { min-width: 0; }

.top {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: calc(var(--space-2) + var(--safe-t)) var(--gutter) var(--space-2);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color var(--dur-2);
}
.top.scrolled { border-bottom-color: var(--line); }
.top-brand { display: flex; align-items: center; gap: var(--space-2); font-family: var(--display); font-weight: var(--weight-semibold); font-size: var(--text-md); color: var(--accent-ink); }
.top-brand .brand-mark { width: 32px; height: 32px; border-radius: var(--radius-sm); font-size: var(--text-md); background: var(--brand-grad); color: var(--clay-200); }
.month-nav { display: flex; align-items: center; gap: var(--space-1); }
.month-nav h1 { font-size: var(--text-md); min-width: 112px; text-align: center; font-weight: var(--weight-semibold); }
.icon-btn {
  width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: var(--radius-full);
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.icon-btn svg.i { width: 18px; height: 18px; }
@media (hover: hover) { .icon-btn:hover { background: var(--bg-2); } }
.chip-btn { min-height: 32px; padding: 0 var(--space-3); font-size: var(--text-sm); background: var(--accent-soft); color: var(--accent-ink); border-radius: var(--radius-full); }
@media (hover: hover) { .chip-btn:hover { background: var(--accent-soft); filter: brightness(.97); } }
.top-actions { display: flex; align-items: center; gap: var(--space-2); }

main { max-width: var(--content-max); padding: var(--space-2) var(--gutter) calc(var(--nav-h) + var(--space-12) + var(--safe-b)); outline: none; }
main > * { animation: rise var(--dur-3) var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.badge { background: var(--clay); color: #fff; border-radius: var(--radius-full); min-width: 20px; height: 20px; padding: 0 6px; font-size: var(--text-2xs); font-weight: var(--weight-bold); display: inline-grid; place-items: center; line-height: 1; }

/* =========================== כרטיסים =========================== */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-5) var(--space-4); margin-bottom: var(--space-4); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.card-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); flex-wrap: wrap; }
.card-head h2 { font-size: var(--text-md); }
.grid { display: grid; gap: var(--space-4); }
.cols-2, .cols-3 { grid-template-columns: 1fr; }
.grid > .card { margin-bottom: 0; }
.grid + .card, .grid + .grid, .card + .grid { margin-top: var(--space-4); }

/* מספרים מרכזיים */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat { min-width: 0; }
.stat-label { color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-wide); }
.stat-value { font-family: var(--display); font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-snug); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value.pos { color: var(--success); } .stat-value.accent { color: var(--accent); } .stat-value.neg { color: var(--danger); }
.stat-value input { font-family: var(--display); font-size: var(--text-lg); font-weight: var(--weight-semibold); max-width: 150px; min-height: 40px; }

/* =========================== רישום מהיר =========================== */
.quick { background: var(--hero); color: #fff; border: 0; position: relative; overflow: hidden; isolation: isolate; box-shadow: var(--shadow-3); }
.quick::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / .12), transparent 65%); z-index: -1; }
.quick::after { content: ""; position: absolute; inset: auto auto -90px -70px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgb(243 217 184 / .32), transparent 70%); z-index: -1; pointer-events: none; }
.quick h2 { font-size: var(--text-lg); }
.quick .sub { opacity: .82; font-size: var(--text-sm); }
.seg { display: inline-flex; background: rgb(255 255 255 / .14); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.seg button { background: transparent; color: #e6f5f3; min-height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-sm); }
.seg button.on { background: #fff; color: var(--teal-700); box-shadow: var(--shadow-1); }
@media (hover: hover) { .seg button:not(.on):hover { background: rgb(255 255 255 / .1); } }
.amount-field { display: flex; align-items: baseline; gap: var(--space-2); margin: var(--space-5) 0 var(--space-4); border-bottom: 2px solid rgb(255 255 255 / .3); padding-bottom: var(--space-2); transition: border-color var(--dur-2); }
.amount-field:focus-within { border-color: var(--clay-200); }
.amount-field span { font-family: var(--display); font-size: var(--text-2xl); opacity: .75; }
.amount-field input { background: transparent; border: 0; color: #fff; font-family: var(--display); font-size: var(--text-3xl); font-weight: var(--weight-semibold); padding: 0; min-height: 0; direction: ltr; text-align: right; letter-spacing: var(--tracking-tight); }
.amount-field input:focus { box-shadow: none; }
.amount-field input::placeholder { color: rgb(255 255 255 / .4); }
.quick .desc { background: rgb(255 255 255 / .96); border: 0; color: var(--ink-900); }
.quick .desc:focus { box-shadow: 0 0 0 4px rgb(243 217 184 / .5); }
.quick .methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin: var(--space-3) 0 var(--space-4); }
.pill { background: rgb(255 255 255 / .14); color: #fff; min-height: 40px; padding: 0 var(--space-2); border-radius: var(--radius-full); font-size: var(--text-sm); white-space: nowrap; overflow: hidden; }
@media (hover: hover) { .pill:hover { background: rgb(255 255 255 / .22); } }
.pill.on { background: var(--clay-200); color: #5a3a22; }
.quick .go { width: 100%; min-height: 52px; background: var(--clay-200); color: var(--wood-800); font-size: var(--text-md); border-radius: var(--radius-md); box-shadow: 0 8px 20px -10px rgb(0 0 0 / .4); }
@media (hover: hover) { .quick .go:hover { background: var(--clay-300); } }
.guess { margin-top: var(--space-2); font-size: var(--text-sm); min-height: 22px; opacity: .95; }
.guess b { background: rgb(255 255 255 / .18); padding: 2px var(--space-2); border-radius: var(--radius-full); }

.hero-stats { display: flex; gap: var(--space-8); margin-top: var(--space-5); flex-wrap: wrap; }
.hero-stats .stat-value { font-size: var(--text-2xl); }
.hero-stats .stat-label { color: rgb(255 255 255 / .8); }

/* =========================== דליים 60/20/20 =========================== */
.bucket { position: relative; overflow: hidden; }
.bucket.needs { --c: var(--needs); --soft: var(--ocean-soft); }
.bucket.wants { --c: var(--wants); --soft: var(--clay-soft); }
.bucket.invest { --c: var(--invest); --soft: var(--turq-soft); }
.bucket .label { display: flex; align-items: center; gap: var(--space-2); font-weight: var(--weight-bold); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }
.bucket .big { font-family: var(--display); font-size: var(--text-2xl); font-weight: var(--weight-semibold); margin: var(--space-2) 0 var(--space-1); letter-spacing: var(--tracking-tight); }
.bucket .of { color: var(--muted); font-size: var(--text-sm); }
.bar { height: 8px; background: color-mix(in srgb, var(--text) 9%, transparent); border-radius: var(--radius-full); overflow: hidden; margin: var(--space-3) 0 var(--space-2); }
.bar > div { height: 100%; background: var(--c, var(--accent)); border-radius: var(--radius-full); transition: width var(--dur-3) var(--ease-out); }
.bar.over > div { background: var(--danger); }
.ratio { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--text-xs); color: var(--muted); }
.status-ok { color: var(--success); font-weight: var(--weight-bold); }
.status-over { color: var(--danger); font-weight: var(--weight-bold); }

.meter { margin-top: var(--space-3); }
.meter-head { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); }
.meter-head b { display: inline-flex; align-items: center; gap: var(--space-2); }

.split { display: flex; height: 36px; border-radius: var(--radius-sm); overflow: hidden; gap: 3px; }
.split div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: var(--text-xs); font-weight: var(--weight-bold); white-space: nowrap; overflow: hidden; }
.alloc { display: grid; gap: var(--space-1); margin-top: var(--space-3); font-size: var(--text-sm); }

/* =========================== רשימות =========================== */
.tx { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-1); border-bottom: 1px solid var(--line); min-height: 64px; }
.tx:last-child { border-bottom: 0; }
.tx[data-tx] { cursor: pointer; transition: background var(--dur-1); }
@media (hover: hover) { .tx[data-tx]:hover { background: var(--surface-sunken); } }
.tx[data-tx]:active { background: var(--bg-2); }
.tx .ic { width: 42px; height: 42px; border-radius: var(--radius-md); display: grid; place-items: center; font-size: 20px; background: var(--bg-2); flex: none; }
.tx .ic.needs { background: var(--ocean-soft); } .tx .ic.wants { background: var(--clay-soft); } .tx .ic.invest, .tx .ic.income { background: var(--turq-soft); }
.tx .ic.pending { background: var(--clay-soft); }
.tx .what { flex: 1; min-width: 0; }
.tx .what b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: var(--weight-semibold); }
.tx .what span { color: var(--muted); font-size: var(--text-xs); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx .amt { font-weight: var(--weight-semibold); font-family: var(--display); white-space: nowrap; }
.amt.neg { color: var(--text); } .amt.pos { color: var(--success); }
.tx button.classify { background: var(--clay); min-height: 34px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-sm); }
.tag { font-size: var(--text-2xs); padding: 1px var(--space-2); border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); font-weight: var(--weight-bold); margin-inline-start: var(--space-1); vertical-align: 2px; }
.tag.brown { background: var(--clay-soft); color: var(--wood); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin: var(--space-6) var(--space-1) var(--space-1); padding-bottom: var(--space-2); border-bottom: 1px solid var(--line-strong); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--text-2); }
.day-head:first-child { margin-top: var(--space-2); }
.day-head .num { font-weight: var(--weight-semibold); color: var(--muted); }

.chips { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding: var(--space-1) var(--space-4); }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-full); font-size: var(--text-sm); background: var(--surface-sunken); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-strong); flex: none; }
@media (hover: hover) { .chip:hover { background: var(--accent-soft); } }
.chip.on { background: var(--text); color: var(--surface); box-shadow: none; }

.fixed-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) 0; border-bottom: 1px dashed var(--line-strong); min-height: 52px; }
.fixed-item:last-child { border-bottom: 0; }
.fixed-item .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; flex: none; color: #fff; }
.fixed-item.paid .check { background: var(--success); border-color: var(--success); }
.fixed-item.paid .nm { color: var(--muted); }
.fixed-item .nm { flex: 1; min-width: 0; }
.fixed-item .nm small { display: block; color: var(--muted); font-size: var(--text-xs); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--line); font-size: var(--text-sm); vertical-align: middle; }
th { color: var(--muted); font-weight: var(--weight-semibold); font-size: var(--text-xs); letter-spacing: var(--tracking-wide); }
td.n, th.n { text-align: left; }
td input { min-height: 38px; padding: 0 var(--space-2); max-width: 96px; text-align: left; direction: ltr; border-radius: var(--radius-sm); }
tr.total td { font-weight: var(--weight-bold); border-bottom: 0; padding-top: var(--space-3); }

/* טבלת ההוצאות הקבועות - כרטיס לכל שורה בטלפון */
.fixed-table tr:first-child { display: none; }
.fixed-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-3); padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.fixed-table td { display: block; border: 0; padding: 0; }
.fixed-table td[data-l]::before { content: attr(data-l); display: block; font-size: var(--text-xs); color: var(--muted); font-weight: var(--weight-semibold); margin-bottom: 2px; }
.fixed-table td input, .fixed-table td select { max-width: none; text-align: right; direction: rtl; }
.fixed-table td.f-name { grid-column: 1 / -1; display: flex; gap: var(--space-2); align-items: center; }
.fixed-table td.f-name input { font-weight: var(--weight-semibold); }
.fixed-table td.f-kw { grid-column: 1 / -1; order: 10; }
.fixed-table td.f-status button, .fixed-table td.f-status .status-ok { width: 100%; min-height: var(--tap); display: flex; align-items: center; justify-content: center; }
.fixed-table td.f-amount input, .fixed-table td.f-day input { direction: ltr; text-align: left; }
.fixed-table td.f-status { display: flex; align-items: flex-end; }

.banner { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); margin-bottom: var(--space-3); background: var(--clay-soft); color: var(--wood); border: 1px solid color-mix(in srgb, var(--clay) 30%, transparent); flex-wrap: wrap; }
.banner.teal { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.banner .emoji { font-size: 24px; }
.banner > div { flex: 1; min-width: 0; }
.banner b { display: block; line-height: var(--leading-snug); }
.banner .small { opacity: .85; }
.banner button { min-height: 38px; white-space: nowrap; }

.empty { text-align: center; padding: var(--space-8) var(--space-3); color: var(--muted); }
.empty .big-emoji { font-size: 40px; display: block; margin-bottom: var(--space-2); }

.build-cta { text-align: center; padding: var(--space-10) var(--space-5); }
.build-cta .art { font-size: 48px; }
.build-cta h2 { font-size: var(--text-xl); margin: var(--space-2) 0; }
.build-cta p { max-width: 520px; margin: var(--space-2) auto var(--space-5); color: var(--muted); }
.build-cta .row { justify-content: center; }
.build-cta input { max-width: 180px; }

/* =========================== חלון (sheet) =========================== */
.sheet-wrap { position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-items: end center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgb(12 26 24 / .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade var(--dur-2) ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; background: var(--surface); width: 100%; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-6) var(--space-4) calc(var(--space-6) + var(--safe-b));
  box-shadow: var(--shadow-4); animation: sheet-up var(--dur-3) var(--ease-out);
}
.sheet::before { content: ""; position: absolute; top: var(--space-2); left: 50%; transform: translateX(-50%); width: 40px; height: 5px; border-radius: var(--radius-full); background: var(--line-strong); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-size: var(--text-xl); padding-inline-end: var(--space-10); }
.sheet .q { color: var(--muted); margin: var(--space-1) 0 var(--space-4); }
.sheet .close { position: absolute; top: var(--space-4); left: var(--space-4); }
.sheet .quick { margin: var(--space-10) 0 0; box-shadow: none; }
.cat-group { margin-top: var(--space-4); }
.cat-group h3 { font-size: var(--text-xs); color: var(--muted); font-family: var(--font); font-weight: var(--weight-bold); letter-spacing: var(--tracking-wide); margin-bottom: var(--space-2); display: flex; gap: var(--space-2); align-items: center; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.cat { background: var(--surface-sunken); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); justify-content: flex-start; text-align: right; min-height: 50px; padding: 0 var(--space-3); font-size: var(--text-sm); border-radius: var(--radius-md); }
.cat span:last-child, .cat { overflow: hidden; }
@media (hover: hover) { .cat:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--turq); } }
.cat .e { font-size: 18px; flex: none; }
.cat.best { background: var(--accent); color: #fff; box-shadow: none; }
@media (hover: hover) { .cat.best:hover { background: var(--accent-hover); } }

.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--space-6) + var(--safe-b)); left: 50%; transform: translateX(-50%);
  background: var(--ink-900); color: #fff; padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  z-index: var(--z-toast); box-shadow: var(--shadow-3); width: max-content; max-width: calc(100% - var(--space-8));
  text-align: center; font-weight: var(--weight-semibold); font-size: var(--text-sm); animation: toast-in var(--dur-3) var(--ease-spring);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px) scale(.96); } }
.toast.error { background: var(--danger); }
.toast button.link { min-height: 0; }

/* =========================== התחברות =========================== */
.auth { max-width: 420px; margin: 0 auto; padding: calc(var(--space-12) + var(--safe-t)) var(--gutter) var(--space-8); }
.auth .brand { justify-content: center; margin-bottom: var(--space-6); color: var(--accent-ink); }
.auth .brand-mark { background: var(--brand-grad); color: var(--clay-200); }
.auth .card { padding: var(--space-8) var(--space-6); box-shadow: var(--shadow-3); }
.auth h2 { font-size: var(--text-xl); margin-bottom: var(--space-1); }
.auth button { width: 100%; margin-top: var(--space-5); min-height: 50px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-1); padding: var(--space-1); margin-bottom: var(--space-6); background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-full); }
.auth .auth-tabs button { margin: 0; min-height: var(--tap); border-radius: var(--radius-full); background: transparent; color: var(--muted); box-shadow: none; }
.auth .auth-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.auth-qr-hint { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-5); padding: var(--space-3) var(--space-4); background: var(--accent-soft); color: var(--text-2); border-radius: var(--radius-md); font-size: var(--text-sm); line-height: var(--leading-snug); }
.auth-qr-hint svg.i { color: var(--accent-ink); margin-top: 2px; }
.pair { text-align: center; }
.pair-qr { width: min(260px, 70vw); margin: var(--space-5) auto var(--space-3); padding: var(--space-3); background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); transition: opacity var(--dur-2), filter var(--dur-2); }
.pair-qr svg { display: block; width: 100%; height: auto; }
.pair-qr.expired { opacity: .25; filter: blur(2px); }
.pair-timer { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); }
.invite-code { font-family: var(--display); font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: .06em; padding: var(--space-3) var(--space-4); background: var(--accent-soft); color: var(--accent-ink); border-radius: var(--radius-md); text-align: center; user-select: all; }

/* =========================== ניווט תחתון + FAB =========================== */
.bottom-nav {
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
  position: fixed; bottom: 0; inset-inline: 0; z-index: var(--z-nav);
  height: calc(var(--nav-h) + var(--safe-b)); padding: 0 var(--space-2) var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border-top: 1px solid var(--line);
}
.bottom-nav button { background: none; color: var(--muted); flex-direction: column; gap: 3px; font-size: var(--text-2xs); font-weight: var(--weight-semibold); padding: 0; min-height: 0; border-radius: 0; position: relative; }
.bottom-nav button svg.i { width: 22px; height: 22px; }
.bottom-nav button.active { color: var(--accent); }
.bottom-nav button.active svg.i { stroke-width: 2.3; }
.bottom-nav button.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.bottom-nav .badge { position: absolute; top: 6px; left: calc(50% - 22px); }
.fab {
  position: fixed; bottom: calc(var(--space-5) + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: var(--z-fab);
  width: 60px; height: 60px; min-height: 0; border-radius: 50%; padding: 0;
  background: var(--hero); box-shadow: 0 10px 24px -8px rgb(11 110 112 / .7), 0 0 0 5px var(--bg);
}
.fab svg.i { width: 28px; height: 28px; stroke-width: 2.4; }
.fab:active { transform: translateX(-50%) scale(.94); }

.checklist label { display: flex; gap: var(--space-3); align-items: center; color: var(--text); font-weight: var(--weight-medium); font-size: var(--text-base); margin: 0; min-height: 52px; border-bottom: 1px dashed var(--line-strong); cursor: pointer; }
.checklist label:last-child { border-bottom: 0; }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }

.hide-m { display: none; }
.acct { flex-wrap: wrap; }
.acct .acct-actions { display: flex; gap: var(--space-2); width: 100%; padding-inline-start: 54px; }
.acct .acct-actions button { min-height: 36px; font-size: var(--text-sm); }
.cat-chip svg.i { width: 14px; height: 14px; }
.danger svg.i { width: 18px; height: 18px; }
.cats-inline { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.cat-chip { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm); padding: var(--space-1) var(--space-1) var(--space-1) var(--space-3); border-radius: var(--radius-full); background: var(--bg-2); }
.cat-chip button { min-height: 28px; width: 28px; padding: 0; color: var(--muted); background: none; border-radius: 50%; }
.form-row { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-2); margin-top: var(--space-4); }
.form-row > :nth-child(n+3) { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-2); }

/* =========================== טאבלט (≥ 600) =========================== */
@media (min-width: 600px) {
  :root { --gutter: var(--space-6); }
  .cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .form-row { grid-template-columns: 72px minmax(0, 220px) minmax(0, 180px) auto; }
  .form-row > :nth-child(n+3) { grid-column: auto; }
  .card { padding: var(--space-6); }
  .sheet { width: min(640px, calc(100% - var(--space-8))); border-radius: var(--radius-xl); margin-bottom: var(--space-6); padding: var(--space-8) var(--space-6); }
  .sheet-wrap { place-items: center; }
  .sheet::before { display: none; }
  .sheet { animation-name: sheet-pop; }
  @keyframes sheet-pop { from { transform: translateY(16px) scale(.98); opacity: 0; } }
  .quick .methods { display: flex; flex-wrap: wrap; }
  .pill { padding: 0 var(--space-4); }
  .chips { margin-inline: 0; padding-inline: 0; }
}

/* =========================== דסקטופ (≥ 960) =========================== */
@media (min-width: 960px) {
  :root { --gutter: var(--space-8); }
  .shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); }
  .side { position: sticky; top: 0; height: 100dvh; background: var(--brand-grad); color: #eaf6f4; padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); }
  .bottom-nav, .fab, .top-brand { display: none; }
  .top { padding: var(--space-5) var(--gutter) var(--space-3); }
  .month-nav h1 { font-size: var(--text-xl); min-width: 180px; }
  .icon-btn { width: 40px; height: 40px; }
  main { padding: var(--space-2) var(--gutter) var(--space-16); }
  .cols-2 { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
  .grid { gap: var(--space-5); }
  .grid + .card, .grid + .grid, .card + .grid { margin-top: var(--space-5); }
  .card { margin-bottom: var(--space-5); }
  .hide-m { display: initial; }
  td.hide-m, th.hide-m { display: table-cell; }
  .stats { gap: var(--space-5); }
  .toast { bottom: var(--space-8); }
  main { padding-bottom: var(--space-16); }

  /* טבלת קבועות חוזרת להיות טבלה */
  .fixed-table tr:first-child { display: table-row; }
  .fixed-table tr { display: table-row; padding: 0; }
  .fixed-table td { display: table-cell; padding: var(--space-2) var(--space-1); border-bottom: 1px solid var(--line); }
  .fixed-table td[data-l]::before { display: none; }
  .fixed-table td.f-name { display: table-cell; }
  .fixed-table td.f-name input { min-width: 140px; }
  .fixed-table td.f-amount input { max-width: 96px; }
  .fixed-table td.f-day input { max-width: 64px; }
  .fixed-table td.f-status { display: table-cell; }
}

.brand { display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-2); }
.brand b { font-family: var(--display); font-size: var(--text-lg); display: block; line-height: var(--leading-tight); }
.brand small { opacity: .72; font-size: var(--text-sm); }
.brand-mark { width: 42px; height: 42px; border-radius: var(--radius-md); display: grid; place-items: center; font-size: 22px; background: rgb(255 255 255 / .14); color: var(--clay-200); flex: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav button { background: transparent; color: #cfe6e2; justify-content: flex-start; text-align: right; gap: var(--space-3); font-weight: var(--weight-medium); padding: 0 var(--space-3); border-radius: var(--radius-md); }
@media (hover: hover) { .side-nav button:hover { background: rgb(255 255 255 / .08); color: #fff; } }
.side-nav button.active { background: rgb(255 255 255 / .15); color: #fff; font-weight: var(--weight-bold); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08); }
.side-nav .badge { margin-inline-start: auto; }
.side-foot { margin-top: auto; font-size: var(--text-sm); opacity: .85; padding: 0 var(--space-2); }
.side-foot .link { color: var(--clay-200); }

/* =====================================================================
   מובייל-פירסט: בית, רישום מהיר, הקלטה, סקירה בהחלקה
   ===================================================================== */
:root { --needs-hero: #a9cff0; --wants-hero: #f5cfa6; --invest-hero: #a6ebe2; }
.d-only { display: none !important; }
@media (min-width: 960px) { .d-only { display: block !important; } .m-only { display: none !important; } }

/* כרטיס "נשאר להוציא" */
.hero { background: var(--hero); color: #fff; border: 0; position: relative; overflow: hidden; isolation: isolate; box-shadow: var(--shadow-3); }
.hero::after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgb(243 217 184 / .28), transparent 70%); z-index: -1; }
.hero-main { display: flex; align-items: center; gap: var(--space-4); }
.hero-text { flex: 1; min-width: 0; }
.hero-label { font-size: var(--text-sm); font-weight: var(--weight-semibold); opacity: .85; }
.hero-big { font-family: var(--display); font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: 1.05; margin: var(--space-1) 0 var(--space-2); }
.hero-sub { font-size: var(--text-sm); opacity: .9; }
.hero-sub b { background: rgb(255 255 255 / .16); padding: 1px var(--space-2); border-radius: var(--radius-full); }
.hero-note { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); font-size: var(--text-xs); opacity: .85; }
.hero-note svg.i { width: 15px; height: 15px; }
.hero-btn { margin-top: var(--space-5); background: var(--clay-200); color: var(--wood-800); width: 100%; min-height: 50px; }
@media (hover: hover) { .hero-btn:hover { background: var(--clay-300); } }
.hero-buckets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-5); }
.hb { flex-direction: column; align-items: stretch; gap: 2px; min-height: 0; padding: var(--space-2) var(--space-3); background: rgb(255 255 255 / .1); border-radius: var(--radius-md); color: #fff; text-align: right; font-weight: var(--weight-regular); }
@media (hover: hover) { .hb:hover { background: rgb(255 255 255 / .16); } }
.hb-name { font-size: var(--text-2xs); opacity: .9; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.hb-name .dot { width: 7px; height: 7px; }
.hb-val { font-family: var(--display); font-weight: var(--weight-semibold); font-size: var(--text-base); text-align: right; }
.hb-bar { height: 4px; border-radius: 4px; background: rgb(255 255 255 / .18); overflow: hidden; margin-top: 2px; }
.hb-bar i { display: block; height: 100%; border-radius: 4px; }

.ring-wrap { position: relative; width: 104px; height: 104px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-track { stroke: rgb(255 255 255 / .18); }
.ring-fill { stroke: var(--clay-200); stroke-linecap: round; transition: stroke-dashoffset var(--dur-3) var(--ease-out); }
.ring-fill.over { stroke: #ffb4a6; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label b { font-family: var(--display); font-size: var(--text-lg); }
.ring-label span { font-size: var(--text-2xs); opacity: .8; }

/* שני הכפתורים הגדולים */
.actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--space-3); margin: var(--space-4) 0; }
.action { justify-content: flex-start; gap: var(--space-3); min-height: 72px; padding: 0 var(--space-4); background: var(--surface); color: var(--text); border-radius: var(--radius-lg); box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); text-align: right; }
@media (hover: hover) { .action:hover { background: var(--surface-sunken); } }
.action b { display: block; font-size: var(--text-base); }
.action small { display: block; color: var(--muted); font-weight: var(--weight-regular); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action > span:last-child { min-width: 0; }
.action-ic { width: 44px; height: 44px; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.voice-action .action-ic { background: var(--hero); color: #fff; box-shadow: 0 6px 16px -6px rgb(11 110 112 / .6); }

/* שדה תיאור + מיקרופון */
.desc-row { display: flex; gap: var(--space-2); align-items: center; }
.desc-row input { flex: 1; }
.mic-btn { width: var(--tap); height: var(--tap); min-height: 0; padding: 0; flex: none; border-radius: var(--radius-full); background: rgb(255 255 255 / .18); color: #fff; }
@media (hover: hover) { .mic-btn:hover { background: rgb(255 255 255 / .28); } }
.mic-btn.solid { background: var(--hero); color: #fff; box-shadow: 0 6px 14px -6px rgb(11 110 112 / .6); }

/* מסך רישום עם מקלדת */
.add { display: flex; flex-direction: column; gap: var(--space-3); padding-top: var(--space-2); }
.add-head { display: flex; justify-content: center; }
.seg-light { background: var(--bg-2); }
.seg-light button { color: var(--text-2); }
.seg-light button.on { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-1); }
.heard { display: flex; align-items: center; gap: var(--space-2); align-self: center; max-width: 100%; font-size: var(--text-sm); color: var(--accent-ink); background: var(--accent-soft); padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); }
.heard span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heard svg.i { width: 15px; height: 15px; }
.add-amount { display: flex; justify-content: center; align-items: baseline; gap: var(--space-2); font-family: var(--display); padding: var(--space-2) 0; direction: ltr; }
.add-amount .cur { font-size: var(--text-2xl); color: var(--muted); order: -1; }
.add-amount #addAmt { font-size: clamp(2.75rem, 11vw, 3.5rem); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); line-height: 1; }
.is-income .add-amount #addAmt { color: var(--success); }
.add-amount.bump #addAmt { animation: bump .18s var(--ease-out); }
@keyframes bump { 50% { transform: scale(1.06); } }
.add-amount.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.add .guess { color: var(--accent-ink); min-height: 20px; margin: 0; text-align: center; }
.add .guess b { background: var(--accent-soft); }
.add-head { gap: var(--space-2); align-items: center; padding-inline-end: var(--space-10); }
.day-chip { gap: 6px; padding: 0 var(--space-3); }
.day-chip svg.i { width: 16px; height: 16px; }
.add-methods { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.add-methods .chip { padding: 0 var(--space-1); white-space: nowrap; overflow: hidden; font-size: var(--text-xs); }
@media (min-width: 380px) { .add-methods .chip { font-size: var(--text-sm); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.key { min-height: 56px; font-family: var(--display); font-size: var(--text-xl); font-weight: var(--weight-medium); background: var(--surface-sunken); color: var(--text); border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line); }
@media (hover: hover) { .key:hover { background: var(--bg-2); } }
.key:active { background: var(--accent-soft); transform: scale(.95); }
.key svg.i { width: 24px; height: 24px; }
.add-save { min-height: 56px; font-size: var(--text-md); border-radius: var(--radius-lg); background: var(--hero); box-shadow: 0 10px 24px -10px rgb(11 110 112 / .7); }
.add-save svg.i { stroke-width: 2.6; }
@media (max-height: 700px) { .key { min-height: 48px; } .add-amount #addAmt { font-size: 2.5rem; } }

/* הקלטה */
.voice { text-align: center; padding-top: var(--space-2); }
.voice h2 { padding: 0; }
.voice .q b { color: var(--text); font-weight: var(--weight-semibold); }
.voice-orb { position: relative; width: 120px; height: 120px; min-height: 0; border-radius: 50%; margin: var(--space-6) auto var(--space-4); display: grid; background: var(--hero); color: #fff; box-shadow: 0 18px 40px -14px rgb(11 110 112 / .75); }
.voice-orb svg.i { width: 44px; height: 44px; stroke-width: 2; }
.voice-orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--teal-400); opacity: 0; transform: none; width: auto; height: auto; }
.voice-orb.on .ring { animation: pulse 1.8s var(--ease-out) infinite; }
.voice-orb.on .r2 { animation-delay: .6s; }
@keyframes pulse { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
.voice-status { font-weight: var(--weight-semibold); color: var(--accent-ink); min-height: 24px; }
.voice-text { font-family: var(--display); font-size: var(--text-lg); min-height: 64px; margin: var(--space-3) 0; color: var(--text); }
.voice .banner { margin-top: var(--space-4); }

/* סקירה מהירה */
.review-top { display: flex; align-items: center; gap: var(--space-2); padding-inline-end: var(--space-10); min-height: 36px; }
.review .bar { margin: var(--space-2) 0 var(--space-4); height: 6px; }
.review-stage { padding: var(--space-2) 0; }
.review-card { position: relative; text-align: center; padding: var(--space-8) var(--space-5) var(--space-6); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-3), inset 0 0 0 1px var(--line); touch-action: pan-y; user-select: none; cursor: grab; transition: box-shadow var(--dur-2); }
.review-card:active { cursor: grabbing; }
.review-ic { font-size: 34px; }
.review-amt { font-family: var(--display); font-size: var(--text-3xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); margin: var(--space-2) 0 var(--space-1); }
.review-desc { font-size: var(--text-lg); font-weight: var(--weight-semibold); margin-bottom: var(--space-1); overflow-wrap: anywhere; }
.stamp { position: absolute; top: var(--space-4); padding: 2px var(--space-3); border-radius: var(--radius-sm); font-weight: var(--weight-bold); font-size: var(--text-sm); border: 2px solid; opacity: 0; transition: opacity var(--dur-1); }
.stamp.ok { left: var(--space-4); color: var(--success); transform: rotate(-10deg); }
.stamp.skip { right: var(--space-4); color: var(--muted); transform: rotate(10deg); }
.review-card.to-ok { box-shadow: var(--shadow-3), inset 0 0 0 2px var(--success); }
.review-card.to-ok .stamp.ok, .review-card.to-skip .stamp.skip { opacity: 1; }
.swipe-hint { text-align: center; margin: var(--space-2) 0 var(--space-4); }
.review-accept { width: 100%; min-height: 54px; font-size: var(--text-md); border-radius: var(--radius-lg); margin-bottom: var(--space-3); background: var(--success); }
@media (hover: hover) { .review-accept:hover { background: color-mix(in srgb, var(--success) 85%, #000); } }

/* חיפוש */
.search { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); padding: 0 var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--focus); }
.search input { border: 0; background: none; padding: 0; min-height: var(--tap); box-shadow: none !important; }
.pending-card { border-color: color-mix(in srgb, var(--clay) 45%, transparent); }
.pending-card h2 { display: flex; align-items: center; gap: var(--space-2); }

/* כשנפתח כאפליקציה מהמסך הבית */
.standalone .top { padding-top: calc(var(--space-3) + var(--safe-t)); }



/* =========================== ליטוש: משטחי דפדפן =========================== */
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--text); }
html { accent-color: var(--accent); caret-color: var(--accent); scrollbar-color: var(--line-strong) transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
.amt, .stat-value, .hero-big, .bucket .big, .hb-val, .review-amt, .key, table .n { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* לחיצה: משוב פיזי קצר */
button:not(:disabled):active, .tx[data-tx]:active { transform: scale(.98); }
.tx[data-tx] { transition: background var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }

/* =========================== מעבר בין חודשים =========================== */
#view[data-slide="next"] > * { animation: slide-next var(--dur-3) var(--ease-out) both; }
#view[data-slide="prev"] > * { animation: slide-prev var(--dur-3) var(--ease-out) both; }
/* RTL: חודש הבא נכנס משמאל, קודם - מימין */
@keyframes slide-next { from { opacity: 0; transform: translateX(-16px); } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(16px); } }

/* =========================== שלד טעינה =========================== */
.skel-wrap { display: grid; gap: var(--space-4); padding-top: var(--space-2); }
.skel { background: color-mix(in srgb, var(--text) 7%, transparent); border-radius: var(--radius-md); position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent), transparent); animation: shimmer 1.2s linear infinite; }
.skel-hero { height: 220px; border-radius: var(--radius-xl); }
.skel-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.skel-pill { height: 72px; border-radius: var(--radius-lg); }
.skel-tx { display: flex; gap: var(--space-3); align-items: center; }
.skel-ic { width: 42px; height: 42px; flex: none; }
.skel-lines { flex: 1; display: grid; gap: var(--space-2); }
.skel-line { height: 12px; width: 60%; border-radius: var(--radius-full); }
.skel-line.short { width: 30%; }
@keyframes shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* =========================== תנועה מופחתת: הכל כבוי =========================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:not(:disabled):active, .tx[data-tx]:active { transform: none; }
}