/* כסף משותף: עיצוב "פנקס בנק". רקע אפור-נייר קר, דיו כחול כצבע המותג, ספרות טבלאיות.
   בלי צללים ובלי מילוי צבעוני לכפתורים משניים: היררכיה בעזרת משקל, מסגרת דקה ומרווח. */
:root {
  --bg: #f1f2ef;
  --surface: #ffffff;
  --surface-2: #ebede9;
  --text: #15191c;
  --muted: #687076;
  --line: #e0e2de;
  --line-strong: #c9cdc7;
  --primary: #1f3b70;
  --primary-ink: #ffffff;
  --primary-soft: #e4e9f3;
  --income: #18704a;
  --income-soft: #dcefe4;
  --expense: #b4372a;
  --expense-soft: #f6e1dd;
  --warn: #a8700f;
  --radius: 14px;
  --r-ctl: 10px;
  --shadow: none;
  --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 {
    --bg: #0f1214; --surface: #171b1e; --surface-2: #20262a; --text: #e8eaeb; --muted: #8e979d; --line: #262c30; --line-strong: #353c41;
    --primary: #9db8ee; --primary-ink: #0d1626; --primary-soft: #1c2638;
    --income: #5cc28f; --income-soft: #15291f; --expense: #f07e6e; --expense-soft: #33191a; --warn: #e0ad4a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.5 "IBM Plex Sans Hebrew", system-ui, sans-serif; min-height: 100dvh; -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.income { color: var(--income); }
.expense { color: var(--expense); }
.ico { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }
h1 { font-size: 1.75rem; font-weight: 600; letter-spacing: -.01em; margin: .3em 0; }
h2 { font-size: .95rem; font-weight: 600; color: var(--text); margin: 1.6rem 2px .55rem; display: flex; align-items: center; gap: 6px; }
h2 .ico { color: var(--muted); }
.center-msg { padding: 30vh 24px 0; text-align: center; color: var(--muted); }

#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(150px + var(--safe-b)); }
.demo-bar { margin: 0 -16px; background: var(--surface-2); color: var(--muted); font-size: .78rem; text-align: center; padding: calc(5px + var(--safe-t)) 8px 5px; border-bottom: 1px solid var(--line); }

/* top */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + var(--safe-t)) 0 10px; background: var(--bg); }
.demo-bar + .top { padding-top: 8px; }
.month-title { font-weight: 600; font-size: 1.05rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.icon-btn:active { background: var(--surface-2); }
.sheet-head .icon-btn { background: var(--surface-2); width: 34px; height: 34px; font-size: 1rem; }

/* cards: משטח לבן עם קו דק. בלי צל. */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.card.list { padding: 0; overflow: hidden; }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* סיכום החודש: מספר גדול על הרקע, ומד אחד שמראה כמה מההכנסות כבר הוצאו */
.summary { padding: 14px 2px 4px; }
.summary small { display: block; color: var(--muted); font-size: .9rem; }
.balance strong { display: block; font-size: 2.9rem; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; margin-top: 2px; }
.balance strong .cur { font-size: .55em; font-weight: 500; color: var(--muted); margin-inline-start: 2px; letter-spacing: 0; }
.balance strong.neg { color: var(--expense); }
.meter { position: relative; height: 10px; margin-top: 16px; border-radius: 99px; background: var(--income-soft); overflow: hidden; }
.meter i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--text); border-radius: 99px; transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.meter.over { background: var(--expense-soft); }
.meter.over i { background: var(--expense); }
.io { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: .88rem; color: var(--muted); }
.io b { font-weight: 600; color: var(--text) !important; }
.io > div:last-child { text-align: left; }
.io > div:last-child b { color: var(--income) !important; }
.summary .cmp { margin: 12px 0 0; font-size: .88rem; color: var(--muted); }
.summary .cmp b { font-weight: 600; }
.cmp { font-size: .95rem; }

.quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 18px; }
.quick .btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 6px; white-space: nowrap; }

/* buttons */
.btn { border: 1px solid transparent; border-radius: var(--r-ctl); padding: 11px 16px; font-weight: 500; cursor: pointer; background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.soft { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.btn.soft.expense { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.soft.income { color: var(--income); }
.btn.danger { color: var(--expense); }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.block:has(.ico) { display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn.big { padding: 14px; font-size: 1.05rem; }
.btn:disabled { opacity: .55; }
.link { background: none; border: 0; color: var(--primary); padding: 8px 0 0; cursor: pointer; font-weight: 500; }


/* tabs */
.tabs { position: fixed; z-index: 7; bottom: 0; left: 0; right: 0; display: flex; justify-content: center;
  background: var(--surface); border-top: 1px solid var(--line); padding: 0 4px var(--safe-b); }
.tabs button { position: relative; flex: 1; max-width: 112px; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .72rem; color: var(--muted); cursor: pointer; padding: 10px 0 8px; }
.tabs svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.on { color: var(--text); font-weight: 600; }
.tabs button.on::before { content: ""; position: absolute; top: -1px; inset-inline: 30%; height: 2px; border-radius: 0 0 2px 2px; background: var(--primary); }

/* tx rows */
.tx { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 11px 16px; text-align: right; cursor: pointer; }
.tx:active { background: var(--surface-2); }
.tx + .tx { border-top: 1px solid var(--line); }
.tx-icon { width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.05rem; }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tx-main b { font-weight: 500; display: flex; align-items: center; gap: 5px; }
.tx-main small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-amt { font-weight: 600; white-space: nowrap; direction: ltr; }
.tx-amt.expense { color: var(--text); }
.tx-amt.income { color: var(--income); }
.day { font-size: .82rem; color: var(--muted); font-weight: 500; margin: 18px 2px 6px; }

/* bars */
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; padding: 7px 0; }
.bar-row > b { font-weight: 600; }
.bar-row b small { color: var(--muted); font-weight: 400; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.budget.ok .bar i { background: var(--income); }
.budget.warn .bar i { background: var(--warn); }
.budget.over .bar i { background: var(--expense); }
.budget .note { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
.budget.over .note { color: var(--expense); font-weight: 500; }
.budget-item { display: flex; align-items: flex-end; gap: 10px; }
.budget-item .bar-row { flex: 1; }
.budget-item + .budget-item { border-top: 1px solid var(--line); }

/* forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-top: 12px; }
input, select { display: block; width: 100%; margin-top: 5px; padding: 11px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; color: var(--text); }
input:focus, select:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
.row { display: flex; gap: 8px; align-items: center; }
.row > input, .row > select { margin-top: 0; }
.error { color: var(--expense); font-size: .9rem; }
.seg { display: flex; background: var(--surface-2); border-radius: var(--r-ctl); padding: 3px; margin-top: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--line); }
.seg.kind button.on[data-kind=expense] { color: var(--text); }
.seg.kind button.on[data-kind=income] { color: var(--income); }

.chips { display: flex; gap: 6px; overflow-x: auto; }
.chips.wrap { flex-wrap: wrap; }
.chip { flex: none; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 99px; padding: 6px 12px; font-size: .86rem; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.filters { display: grid; gap: 8px; margin-top: 4px; }

/* auth */
.auth { padding: calc(56px + var(--safe-t)) 0 40px; text-align: center; }
.auth .card { text-align: right; margin-top: 22px; }
.logo-big { display: block; width: 72px; height: 72px; margin: 0 auto 6px; border-radius: 20px; }

/* report */
.table-wrap { overflow-x: auto; padding: 0; }
table.report { width: 100%; border-collapse: collapse; font-size: .9rem; }
.report th, .report td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); }
.report th { color: var(--muted); font-weight: 500; font-size: .78rem; background: var(--surface-2); }
.report td.num, .report th.num { text-align: left; white-space: nowrap; direction: ltr; }
.report tfoot td { font-weight: 600; border-bottom: 0; }
.report tfoot tr:first-child td { border-top: 1px solid var(--line-strong); }
.report .lim { display: block; font-size: .72rem; color: var(--muted); }
.report .lim.over { color: var(--expense); }
.compare { margin: 0 2px 8px; }
.compare select { flex: 1; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.chart .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.chart .bars i { width: 34%; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 2px; }
.chart i.inc, .legend i.inc { background: var(--income); }
.chart i.exp, .legend i.exp { background: var(--text); }
.chart small { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.chart small.v { font-size: .66rem; margin-top: 0; }
.chart .col.cur small:first-of-type { color: var(--text); font-weight: 600; }
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; }

/* settings */
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; }
.code { font-size: 1.15rem; letter-spacing: .16em; color: var(--primary); font-weight: 600 !important; }
#catForm { margin-top: 12px; }
#catForm select { width: auto; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(10, 14, 20, 0); transition: background .25s; display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap.open { background: rgba(10, 14, 20, .45); }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--bg); border-radius: 20px 20px 0 0; padding: 8px 16px calc(20px + var(--safe-b));
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet-wrap.open .sheet { transform: none; }
.grab { width: 36px; height: 4px; border-radius: 9px; background: var(--line-strong); margin: 4px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h2 { margin: 0; font-size: 1.15rem; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 20px 0 8px; }
.amount span { font-size: 1.6rem; color: var(--muted); }
.amount input { width: 60%; margin: 0; border: 0; border-bottom: 1px solid var(--line-strong); border-radius: 0; background: transparent; font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; text-align: center; padding: 4px; direction: ltr; -moz-appearance: textfield; }
.amount input::-webkit-outer-spin-button, .amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.amount input:focus { outline: none; border-bottom: 2px solid var(--primary); }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; padding: 2px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 1px solid transparent; background: none; border-radius: var(--r-ctl); padding: 8px 2px; font-size: .72rem; line-height: 1.25; cursor: pointer; color: var(--text); }
.cat.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface); font-weight: 600; }
.sheet .row .chip { flex: none; }

#toast { position: fixed; z-index: 30; left: 50%; bottom: calc(140px + var(--safe-b)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-ctl); font-size: .9rem; max-width: calc(100% - 32px); transition: .22s; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

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

/* receipts */
.btn.soft.scan { color: var(--text); }
.btn.soft.scan .ico, .btn.soft.income .ico { color: currentColor; }
label.btn { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; margin-top: 0; font-size: .95rem; text-align: center; color: var(--text); }
label.btn .ico { width: 24px; height: 24px; color: var(--primary); }
.scan-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.scan-opts .btn { padding: 18px 10px; }
.picked { margin-top: 10px; }
.picked .x { background: none; border: 0; padding: 0 2px; color: var(--muted); cursor: pointer; }
textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 16px; color: inherit; resize: vertical; }
details > summary { cursor: pointer; color: var(--primary); font-size: .9rem; font-weight: 500; padding: 10px 0 4px; }
.spin { display: inline-block; width: 1em; height: 1em; vertical-align: -2px; margin-inline-end: 6px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scan-ok { display: flex; gap: 8px; align-items: flex-start; background: var(--primary-soft); color: var(--text); border-radius: var(--r-ctl); padding: 10px 12px; font-size: .9rem; margin: 10px 0 0; }
.scan-ok .ico { color: var(--primary); margin-top: .15em; }
.items { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 12px 10px; margin-top: 14px; }
.item-row { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.item-row .nm { font-size: .92rem; }
.item-row .num { direction: ltr; font-size: .92rem; }
.item-row select { grid-column: 1 / -1; margin-top: 0; padding: 6px 10px; font-size: .85rem; }
.icon-btn.sm { width: 28px; height: 28px; font-size: .85rem; box-shadow: none; background: var(--surface-2); }
.receipt-tag { display: inline-flex; color: var(--muted); }
.receipt-tag .ico { width: 15px; height: 15px; }
.report .drill { display: block; font-size: .78rem; padding-top: 2px; }
.items-table tr.grp { cursor: pointer; }
.items-table .caret { display: inline-block; color: var(--muted); transition: transform .2s; }
.items-table tr.grp.open .caret { transform: rotate(-90deg); }
.items-table tr.sub td { font-size: .82rem; background: var(--surface-2); padding-top: 6px; padding-bottom: 6px; }
.items-table tr.sub td:first-child { padding-inline-start: 22px; }
.ib-search { margin-top: 10px; }
.items-table th, .items-table td { padding: 8px 6px; }
.items-table td:first-child { min-width: 8.5em; }
.item-row input { margin-top: 0; padding: 6px 8px; font-size: .9rem; }
.item-row .tot { display: flex; align-items: center; gap: 2px; direction: ltr; font-size: .9rem; color: var(--muted); }
.item-row .tot input { width: 5.2em; text-align: left; }
.chip .plain { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.chip .x { background: none; border: 0; padding: 0 0 0 4px; margin-inline-start: 4px; color: var(--muted); cursor: pointer; }
.types { margin: 10px 0; }

/* אפל פיי: הוצאות שמחכות לאישור קטגוריה */
.review { padding: 10px 0; }
.review > p { padding: 0 14px; margin: 0 0 6px; }
.review > .btn { margin: 8px 14px 0; width: calc(100% - 28px); }
.review-row { display: flex; align-items: center; gap: 4px; padding-left: 10px; }
.review-row + .review-row { border-top: 1px solid var(--line); }
.review-row .tx { flex: 1; min-width: 0; }
.icon-btn.ok { flex: none; color: var(--income); background: var(--income-soft); }
.icon-btn.ok .ico { width: 20px; height: 20px; stroke-width: 2.4; }
.review-tag { font-size: .7rem; font-weight: 600; color: var(--warn); border: 1px solid currentColor; border-radius: 99px; padding: 0 7px; line-height: 1.5; }
details.steps { margin-top: 10px; }
details.steps summary { cursor: pointer; font-weight: 600; color: var(--primary); }
details.steps ol { padding-right: 20px; margin: 8px 0; line-height: 1.6; }
details.steps li { margin-bottom: 6px; }
details.steps code { direction: ltr; unicode-bidi: embed; background: var(--surface-2); border-radius: 4px; padding: 0 4px; }
#walletUrl { font-size: .8rem; }
.wallet .wstep { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 8px; }
.wallet .wstep .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.wallet .wstep small { display: block; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.wallet .taps { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 6px; }
.wallet .taps span { background: var(--surface-2); border-radius: 8px; padding: 3px 8px; font-weight: 600; font-size: .9rem; }
.wallet .taps i { font-style: normal; color: var(--muted); }
.wallet a.btn { text-align: center; text-decoration: none; display: block; }
.wallet a.btn.ghost { color: var(--primary); }
.wallet details.steps > * { margin-top: 8px; }

/* אשף חיבור האייפון: מסך אחד לכל שלב, עם ציור של מה שרואים באייפון */
.wallet-ok { display: flex; gap: 6px; align-items: flex-start; color: var(--income); font-weight: 500; }
.wallet-ok .ico { margin-top: .2em; }
.wiz-dots { display: flex; gap: 6px; justify-content: center; margin: 12px 0 4px; }
.wiz-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.wiz-dots i.done { background: var(--primary-soft); }
.wiz-dots i.on { background: var(--primary); width: 20px; border-radius: 4px; }
.wiz-title { display: flex; gap: 10px; align-items: center; font-size: 1.2rem; margin: 14px 0 6px; }
.wiz-title .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-size: .95rem; }
#wiz > p { line-height: 1.6; }
#wiz a.btn { display: block; text-align: center; text-decoration: none; }
#wiz a.btn.ghost { color: var(--primary); }
.wiz-nav { display: flex; gap: 8px; margin-top: 14px; }
.wiz-nav .btn { flex: 1; }
.mock { direction: ltr; background: #f2f2f7; color: #111; border-radius: 18px; padding: 12px; margin: 10px auto; max-width: 300px; border: 6px solid #1c1c1e; font-family: -apple-system, system-ui, sans-serif; }
.mock .hot { outline: 3px solid #ff9f0a; outline-offset: 2px; border-radius: 10px; animation: hot 1.4s ease-in-out infinite; }
@keyframes hot { 50% { outline-color: rgba(255, 159, 10, .25); } }
.mock small { display: block; direction: rtl; color: #8e8e93; font-size: .72rem; }
.m-title { font-weight: 700; text-align: center; margin-bottom: 10px; }
.m-field { background: #fff; border-radius: 10px; padding: 12px; direction: rtl; font-size: .85rem; color: #8e8e93; }
.m-btn { background: #0a84ff; color: #fff; text-align: center; border-radius: 12px; padding: 10px; margin-top: 12px; font-weight: 600; }
.m-top { display: flex; justify-content: flex-end; }
.m-plus { width: 30px; height: 30px; display: grid; place-items: center; color: #0a84ff; font-size: 1.4rem; font-weight: 600; }
.m-next { color: #0a84ff; font-weight: 600; padding: 2px 8px; }
.m-empty { height: 60px; }
.m-tabs { display: flex; justify-content: space-around; border-top: 1px solid #d1d1d6; padding-top: 8px; font-size: .78rem; text-align: center; }
.m-tabs span { padding: 4px 6px; }
.m-tabs .hot { color: #0a84ff; }
.m-row { background: #fff; padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; font-size: .9rem; }
.m-row:first-child, .m-top + .m-row { border-radius: 10px 10px 0 0; }
.m-row + .m-row { border-top: 1px solid #e5e5ea; }
.m-row small { display: inline; }
.m-head { font-weight: 700; padding: 4px 6px; display: inline-block; }
.m-tiles { display: flex; gap: 8px; margin-top: 8px; }
.m-tiles span { flex: 1; background: linear-gradient(135deg, #34c759, #0f5f5a); color: #fff; border-radius: 12px; padding: 22px 10px 10px; font-weight: 600; direction: rtl; }
.m-tiles span:last-child { background: #c7c7cc; }

/* חשבון משותף / אישי */
.top { flex-wrap: wrap; }
.seg.scope { flex-basis: 100%; margin-top: 8px; }
body.personal .seg.scope button.on { color: var(--primary); }
.seg.acct { margin: 4px 0 10px; }
.seg.mini { margin: 0; padding: 3px; flex: none; }
.seg.mini button { padding: 5px 12px; font-size: .85rem; }
.my-cards { margin: 10px 0; }
.my-cards .kv { align-items: center; }
.cardq { display: grid; gap: 10px; }
.cardq-row p { margin: 0 0 8px; }
.cardq-row .row .btn { flex: 1; }

/* פתיחה: רק אני / זוג / קוד הזמנה */
.ob-pick { display: grid; gap: 8px; margin: 12px 0; }
.ob-pick button { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: start;
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-ctl); padding: 12px; cursor: pointer; color: var(--text); font: inherit; }
.ob-pick button svg { grid-row: span 2; width: 22px; height: 22px; color: var(--muted); }
.ob-pick button small { color: var(--muted); grid-column: 2; }
.ob-pick button.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.ob-pick button.on svg { color: var(--primary); }

/* בדיקת עיצוב 2026-10: חלונות בתוך האפליקציה, כניסה, הגדרות בעמודים */
.quick-scan { margin-top: 18px; }
.demo-bar .link { padding: 0; font-size: inherit; }
.ask p { margin: 12px 0 0; line-height: 1.55; }
.ask .row { margin-top: 5px; }
.ask .row .btn { flex: none; }
.ask-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.btn.danger-fill { background: var(--expense); color: #fff; }
.link.danger-link { display: block; margin: 10px auto 0; color: var(--expense); }
.code-in { text-transform: uppercase; letter-spacing: .2em; text-align: center; }

.pw { position: relative; }
.pw input { padding-left: 46px; }
.pw-eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); margin-top: 2px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; border-radius: 8px; }
.pw-eye .ico { width: 20px; height: 20px; }
.hint { display: flex; align-items: center; gap: 5px; margin: 6px 0 0; font-size: .82rem; color: var(--muted); }
.hint .ico { width: 15px; height: 15px; opacity: .35; }
.hint.ok { color: var(--income); }
.hint.ok .ico { opacity: 1; }
.auth .link { display: block; margin: 6px auto 0; }
.trust { display: flex; gap: 8px; align-items: flex-start; justify-content: center; text-align: right; color: var(--muted); font-size: .85rem; margin: 16px 8px 4px; line-height: 1.5; }
.trust .ico { margin-top: .2em; color: var(--income); }
.card.invite { display: flex; gap: 10px; align-items: flex-start; background: var(--primary-soft); border-color: transparent; }
.card.invite .ico { width: 22px; height: 22px; color: var(--primary); margin-top: .15em; }
.card.invite p { margin: 0; }

.note-box { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); color: var(--muted); border-radius: var(--r-ctl); padding: 10px 12px; font-size: .88rem; margin: 0 0 10px; }
.note-box .ico { margin-top: .15em; }
.tag { font-size: .7rem; font-weight: 500; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 99px; padding: 0 7px; margin-inline-start: 4px; vertical-align: 1px; }
.budget.done .bar i { background: var(--primary); }
.goal-cats { margin-bottom: 4px; }
.goal-cats .chip small { color: var(--muted); font-size: .75rem; }
.goal-cats .chip.on small { color: inherit; opacity: .75; }
.goal-rest { display: contents; }
.goal-rest.hidden { display: none !important; }
.chip.more { border-style: dashed; color: var(--primary); }

.page-title { font-size: 1.35rem; margin: calc(14px + var(--safe-t)) 2px 12px; }
.back { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; color: var(--primary); font-weight: 500; padding: calc(12px + var(--safe-t)) 0 0; cursor: pointer; }
.back + .page-title { margin-top: 6px; }
.menu-row { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 12px 16px; text-align: right; cursor: pointer; color: var(--text); }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row:active { background: var(--surface-2); }
.menu-row .tx-icon .ico { color: var(--primary); }
.menu-row > .ico { color: var(--muted); }

/* טבלת ההשוואה בטלפון: שם קטגוריה בשורה אחת, ופחות ריווח */
.report .nm { display: block; }
@media (max-width: 420px) {
  table.report { font-size: .82rem; }
  .report th, .report td { padding: 9px 5px; }
  .report:not(.items-table) td:first-child .nm { max-width: 8.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* מסך טעינה ראשון */
.splash { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.splash img { width: 64px; height: 64px; border-radius: 18px; }
.splash b { color: var(--text); font-size: 1.15rem; font-weight: 600; }
.link.inline { display: inline; padding: 0; font-size: inherit; }

/* שיפורי עיצוב 2026-10: פלוס בסרגל, אייקוני קטגוריות, השוואה בשורות, מסך הוספה */
.add-fab { position: fixed; z-index: 6; left: max(16px, calc(50% - 264px)); bottom: calc(76px + var(--safe-b)); display: flex; align-items: center; gap: 6px;
  height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 99px; background: var(--primary); color: var(--primary-ink); font-weight: 600; font-size: 1rem;
  box-shadow: 0 8px 22px -8px rgba(15, 30, 60, .6); cursor: pointer; transition: transform .25s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.add-fab .ico { width: 22px; height: 22px; stroke-width: 2.2; }
.add-fab:active { transform: translateY(1px); }
.add-fab.away { transform: translateY(24px); opacity: 0; pointer-events: none; }

.ci { display: inline-grid; place-items: center; flex: none; color: hsl(var(--h, 210) 42% 34%); }
.ci svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ci.tile { width: 36px; height: 36px; border-radius: 11px; background: hsl(var(--h, 210) 50% 93%); }
.ci.tile svg { width: 20px; height: 20px; }
.ci.emo { background: var(--surface-2); }
.ci.emo:not(.tile) { background: none; font-size: .95em; }
@media (prefers-color-scheme: dark) {
  .ci { color: hsl(var(--h, 210) 60% 74%); }
  .ci.tile { background: hsl(var(--h, 210) 22% 19%); }
}
.cn { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.chip .ci { margin-inline-end: 5px; vertical-align: -2px; }
.chip.on .ci { color: inherit; }

/* כרטיס חדש: פס אחד קטן במקום כרטיס גדול */
.nudge { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; background: var(--primary-soft); border-radius: var(--radius); padding: 10px 12px; margin: 14px 0 0; }
.nudge > .ico { color: var(--primary); width: 20px; height: 20px; }
.nudge p { margin: 0; font-size: .92rem; }
.nudge small { display: block; color: var(--muted); font-size: .8rem; }
.nudge-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.nudge-btns .btn { padding: 8px; font-size: .92rem; }

/* השוואת קטגוריות: שורה לכל קטגוריה, הסכום והשינוי בצד */
.cmp-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; }
.cmp-row + .cmp-row { border-top: 1px solid var(--line); }
.cmp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.cmp-main b { font-weight: 500; }
.cmp-main small, .cmp-amt small { font-size: .78rem; }
.cmp-main .lim { color: var(--muted); }
.cmp-main .lim.over { color: var(--expense); }
.cmp-main .drill { padding: 2px 0 0; }
.cmp-amt { display: flex; flex-direction: column; align-items: flex-end; text-align: left; white-space: nowrap; }
.cmp-amt b { font-weight: 600; }
.cmp-row.tot { background: var(--surface-2); }
.cmp-row.tot .cmp-main b { font-weight: 600; }

/* יעדים: כל השורה נלחצת לעריכה */
button.budget-item { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; padding: 6px 16px; text-align: right; cursor: pointer; color: var(--text); font: inherit; }
button.budget-item:active { background: var(--surface-2); }
button.budget-item > .ico { color: var(--muted); width: 18px; height: 18px; }

/* מסך הוספה: סכום ראשון, כפתור שמירה תמיד גלוי */
.head-acts { display: flex; align-items: center; gap: 8px; }
.scan-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--primary); }
.scan-chip .ico { width: 16px; height: 16px; }
.sheet .amount { margin: 14px 0 6px; }
.acct-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.acct-row .chip { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.acct-row .chip .ico { width: 16px; height: 16px; }
.acct-row .chip.on { color: var(--bg); }
.sheet-foot { position: sticky; bottom: calc(-20px - var(--safe-b)); z-index: 2; margin: 14px -16px calc(-20px - var(--safe-b)); padding: 10px 16px calc(12px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--line); }
.sheet-foot .btn { margin-top: 0; }

/* תנועה קבועה: מתג "חוזר כל חודש" במסך ההוספה */
.repeat-row { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-ctl); color: var(--text); text-align: right; cursor: pointer; }
.repeat-row .tx-icon { background: var(--surface); }
.repeat-row .tx-icon .ico { color: var(--muted); }
.repeat-row.on { background: var(--primary-soft); border-color: var(--primary); }
.repeat-row.on .tx-icon .ico { color: var(--primary); }
.repeat-row .tx-main small { white-space: normal; }
.switch { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .25); transition: inset-inline-start .2s; }
.repeat-row.on .switch { background: var(--primary); }
.repeat-row.on .switch::after { inset-inline-start: 21px; }
.rec-form .ico { width: 15px; height: 15px; vertical-align: -2px; }

/* קטגוריות במסך ההוספה: "הצג הכל" */
.cat.more { color: var(--primary); font-weight: 500; }
.cat-more-ico { width: 36px; height: 36px; border-radius: 11px; border: 1.5px dashed var(--line); display: grid; place-items: center; }
