/* עיצוב "חצות ניאון" — העיצוב הקודם שמור ב-styles.old.css
   ההגדרות (🎨) מחליפות מאפייני data-* על <html>: theme, palette, font, size, density, fx */
:root {
  /* ערכת צבעים: שלושה צבעי גרדיאנט (RGB) + צבע הדגשה לבהיר/כהה */
  --g1: 139 92 246;
  --g2: 236 72 153;
  --g3: 245 158 11;
  --accent-l: #7c3aed;
  --accent-d: #a78bfa;

  --bg: color-mix(in srgb, rgb(var(--g1)) 7%, #f7f7fa);
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-2: color-mix(in srgb, rgb(var(--g1)) 8%, transparent);
  --text: #1a1630;
  --muted: #6b6588;
  --border: color-mix(in srgb, rgb(var(--g1)) 18%, transparent);
  --accent: var(--accent-l);
  --accent-soft: color-mix(in srgb, var(--accent) 13%, transparent);
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, rgb(var(--g1)) 0%, rgb(var(--g2)) 55%, rgb(var(--g3)) 100%);
  --bg-glow-1: rgb(var(--g1) / .18);
  --bg-glow-2: rgb(var(--g2) / .12);
  --bg-glow-3: rgb(var(--g3) / .10);
  --task: #3b82f6;
  --idea: #f59e0b;
  --debt: #10b981;
  --note: #94a3b8;
  --link: #a855f7;
  --late: #ef4444;
  --late-soft: rgba(239, 68, 68, .09);
  --ok-soft: rgba(16, 185, 129, .12);
  --radius: 20px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 8px 30px rgb(var(--g1) / .10);
  --glow: 0 0 0 1px rgb(var(--g1) / .35), 0 8px 32px rgb(var(--g1) / .25);
  --glow-1: 0 6px 20px rgb(var(--g1) / .35);
  --glow-2: 0 6px 20px rgb(var(--g2) / .3);
  --blur: blur(16px) saturate(140%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: color-mix(in srgb, rgb(var(--g1)) 5%, #09090f);
    --surface: rgba(28, 25, 46, .62);
    --surface-solid: #1a1729;
    --surface-2: rgba(255, 255, 255, .06);
    --text: #f1eefc;
    --muted: #9a94b8;
    --border: rgba(255, 255, 255, .09);
    --accent: var(--accent-d);
    --bg-glow-1: rgb(var(--g1) / .22);
    --bg-glow-2: rgb(var(--g2) / .13);
    --bg-glow-3: rgb(var(--g3) / .10);
    --task: #60a5fa;
    --idea: #fbbf24;
    --debt: #34d399;
    --note: #a1a1c2;
    --link: #c084fc;
    --late: #fb7185;
    --late-soft: rgba(251, 113, 133, .10);
    --ok-soft: rgba(52, 211, 153, .12);
    --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 10px 40px rgba(0, 0, 0, .45);
    --glow: 0 0 0 1px rgb(var(--g1) / .45), 0 10px 40px rgb(var(--g1) / .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: color-mix(in srgb, rgb(var(--g1)) 5%, #09090f);
  --surface: rgba(28, 25, 46, .62);
  --surface-solid: #1a1729;
  --surface-2: rgba(255, 255, 255, .06);
  --text: #f1eefc;
  --muted: #9a94b8;
  --border: rgba(255, 255, 255, .09);
  --accent: var(--accent-d);
  --bg-glow-1: rgb(var(--g1) / .22);
  --bg-glow-2: rgb(var(--g2) / .13);
  --bg-glow-3: rgb(var(--g3) / .10);
  --task: #60a5fa;
  --idea: #fbbf24;
  --debt: #34d399;
  --note: #a1a1c2;
  --link: #c084fc;
  --late: #fb7185;
  --late-soft: rgba(251, 113, 133, .10);
  --ok-soft: rgba(52, 211, 153, .12);
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 10px 40px rgba(0, 0, 0, .45);
  --glow: 0 0 0 1px rgb(var(--g1) / .45), 0 10px 40px rgb(var(--g1) / .35);
  color-scheme: dark;
}

/* ---------- ערכות צבעים ---------- */
:root[data-palette="ocean"]  { --g1: 6 182 212;   --g2: 59 130 246;  --g3: 99 102 241;  --accent-l: #2563eb; --accent-d: #60a5fa; }
:root[data-palette="forest"] { --g1: 16 185 129;  --g2: 132 204 22;  --g3: 234 179 8;   --accent-l: #059669; --accent-d: #34d399; }
:root[data-palette="sunset"] { --g1: 249 115 22;  --g2: 239 68 68;   --g3: 219 39 119;  --accent-l: #ea580c; --accent-d: #fb923c; }
:root[data-palette="candy"]  { --g1: 244 114 182; --g2: 192 132 252; --g3: 103 232 249; --accent-l: #db2777; --accent-d: #f9a8d4; }
:root[data-palette="mono"]   { --g1: 113 113 122; --g2: 63 63 70;    --g3: 161 161 170; --accent-l: #3f3f46; --accent-d: #e4e4e7; }

/* ---------- אפקטים: שקט ונקי ---------- */
:root[data-fx="calm"] {
  --bg-glow-1: transparent;
  --bg-glow-2: transparent;
  --bg-glow-3: transparent;
  --glow: 0 0 0 2px var(--accent-soft);
  --glow-1: none;
  --glow-2: none;
  --blur: none;
  --surface: var(--surface-solid);
}
:root[data-fx="calm"] .item::before,
:root[data-fx="calm"] .chip.due.late,
:root[data-fx="calm"] .item.done .check { box-shadow: none; }
:root[data-fx="calm"] .empty .big { filter: none; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(700px 500px at -10% 20%, var(--bg-glow-2), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, var(--bg-glow-3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Rubik', 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- פונט וגודל ---------- */
:root[data-font="heebo"] body { font-family: 'Heebo', system-ui, sans-serif; }
:root[data-font="assistant"] body { font-family: 'Assistant', system-ui, sans-serif; }
:root[data-font="varela"] body { font-family: 'Varela Round', 'Rubik', system-ui, sans-serif; }
:root[data-size="s"] body { zoom: .92; }
:root[data-size="l"] body { zoom: 1.12; }

::selection { background: var(--accent); color: #fff; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s, color .15s; }
button:active:not(:disabled) { transform: scale(.96); }

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px 96px;
}

/* זכוכית — משותף לכל הכרטיסים */
.capture, .icon-btn, .menu-list, .tab, .search input, .brief, .stat,
.item, .person, .ai-badge, .answer, .btn:not(.primary) {
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ---------- כותרת ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  font-size: 30px; line-height: 1;
  border-radius: 16px;
  background: var(--grad);
  box-shadow: var(--glow-1);
}
.brand h1 {
  margin: 0;
  font-size: 28px; font-weight: 800;
  letter-spacing: -.02em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.tagline { margin: 0; color: var(--muted); font-size: 14px; }
.top-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 18px;
  list-style: none;
}
.icon-btn:hover { border-color: var(--accent); box-shadow: var(--glow); }
.icon-btn::-webkit-details-marker { display: none; }

.menu { position: relative; }
.menu summary { cursor: pointer; }
.menu-list {
  position: absolute;
  inset-inline-end: 0;
  top: 50px;
  z-index: 20;
  min-width: 200px;
  padding: 6px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: rise-in .15s ease;
}
.menu-list button {
  text-align: start;
  background: none; border: 0;
  padding: 10px 12px;
  border-radius: 10px;
}
.menu-list button:hover { background: var(--accent-soft); }
.menu-list .danger { color: var(--late); }
.menu-note { padding: 4px 12px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; max-width: 240px; }

/* ---------- הוספה ---------- */
.capture {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.capture:focus-within {
  border-color: transparent;
  background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box;
  box-shadow: var(--glow);
}
#input {
  width: 100%;
  border: 0; outline: 0; resize: none;
  background: transparent;
  font-size: 19px;
  min-height: 32px;
  max-height: 200px;
}
#input::placeholder { color: var(--muted); }

.preview {
  min-height: 0;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 13px; color: var(--muted);
}
.preview:not(:empty) { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.preview .arrow { font-weight: 700; color: var(--accent); }

.capture-foot {
  display: flex; align-items: center; gap: 10px;
  margin-top: 12px;
}
.examples { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.examples::-webkit-scrollbar { display: none; }
.example {
  white-space: nowrap;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.example:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 9px 18px;
  font-weight: 600;
  white-space: nowrap;
}
.btn.primary {
  background: var(--grad);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: var(--glow-2);
}
.btn.primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; filter: grayscale(.4); }
.btn.mic { padding: 9px 12px; flex-shrink: 0; }
.btn.mic.rec { background: var(--late); border-color: transparent; color: #fff; animation: pulse 1.2s ease-in-out infinite; }

/* ---------- טאבים וחיפוש ---------- */
.tabs {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: 8px;
  overflow-x: auto;
  margin: 18px -16px 0;
  padding: 12px 16px;
  background: transparent;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  scrollbar-width: none;
}
:root[data-fx="calm"] .tabs { background: var(--bg); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 15px;
}
.tab:hover { border-color: var(--accent); }
.tab .count {
  font-size: 12px; font-weight: 700;
  min-width: 20px; padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  text-align: center;
}
.tab[aria-selected="true"] {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-1);
}
.tab[aria-selected="true"] .count { background: rgba(255, 255, 255, .25); color: #fff; }

.search input {
  width: 100%;
  margin: 6px 0 18px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  outline: 0;
}
.search input:focus { border-color: var(--accent); box-shadow: var(--glow); }

/* ---------- סיכום יומי ---------- */
.brief {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.brief::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad);
  opacity: .12;
  pointer-events: none;
}
.brief > * { position: relative; }
.brief h2 { margin: 0; font-size: 24px; font-weight: 800; }
.brief .date { color: var(--muted); font-size: 14px; }
.brief p { margin: 10px 0 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.stat {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}
.stat b { display: block; font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.late b { color: var(--late); }
.stat.money b { color: var(--debt); }

/* ---------- רשימות ---------- */
.section { margin-bottom: 26px; }
.section h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted);
  margin: 0 6px 10px;
}
.section h3 .n { font-weight: 500; }
.section.late h3 { color: var(--late); }
.list { display: flex; flex-direction: column; gap: 10px; }

.item {
  --c: var(--note);
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 14px 14px 10px;
  box-shadow: var(--shadow);
  transition: opacity .2s, transform .15s, border-color .15s;
  overflow: hidden;
}
.item::before {
  content: "";
  position: absolute;
  inset-block: 10px;
  inset-inline-start: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--c);
  box-shadow: 0 0 12px var(--c);
}
.item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.item.t-task { --c: var(--task); }
.item.t-idea { --c: var(--idea); }
.item.t-debt { --c: var(--debt); }
.item.t-link { --c: var(--link); }
.item.overdue { background: var(--late-soft); --c: var(--late); }
.item.done { opacity: .5; }
.item.done .title { text-decoration: line-through; }
.item.new { animation: pop .6s ease; }
@keyframes pop {
  0% { transform: scale(.96); box-shadow: var(--glow); }
  100% { transform: none; }
}

.check {
  flex: none;
  width: 26px; height: 26px; margin-top: 0;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: transparent;
  font-size: 14px; font-weight: 800;
  display: grid; place-items: center;
  padding: 0;
}
.check:hover { border-color: var(--c); color: var(--c); }
.item.done .check { background: var(--debt); border-color: var(--debt); color: #fff; box-shadow: 0 0 12px var(--debt); }

.body { flex: 1; min-width: 0; }
.title { font-weight: 500; overflow-wrap: anywhere; cursor: text; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
button.chip:hover, a.chip:hover { color: var(--accent); background: var(--accent-soft); }
.chip.due.late { background: var(--late); color: #fff; box-shadow: 0 0 12px rgba(239, 68, 68, .4); }
.chip.money { background: var(--ok-soft); color: var(--debt); font-weight: 700; }
.chip.repeat { background: var(--accent-soft); color: var(--accent); }
.ask {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.ask .chip { background: var(--accent-soft); color: var(--accent); font-weight: 600; cursor: pointer; }
.ask .chip:hover { background: var(--accent); color: #fff; }

.actions { display: flex; gap: 2px; opacity: .3; transition: opacity .15s; }
.item:hover .actions, .item:focus-within .actions { opacity: 1; }
.actions button {
  background: none; border: 0;
  width: 32px; height: 32px;
  border-radius: 10px;
  font-size: 15px;
}
.actions button:hover { background: var(--surface-2); }

.edit {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--surface-solid);
  outline: 0; resize: vertical;
  box-shadow: var(--glow);
}
.edit-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- כסף ---------- */
.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.people { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.person {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
}
.person .amt { font-weight: 800; }
.person .amt.in { color: var(--debt); }
.person .amt.out { color: var(--late); }

/* ---------- צפיפות ---------- */
:root[data-density="compact"] .app { padding-top: 12px; }
:root[data-density="compact"] .top { margin-bottom: 12px; }
:root[data-density="compact"] .capture { padding: 12px 14px 10px; border-radius: 18px; }
:root[data-density="compact"] .tabs { margin-top: 10px; padding-block: 8px; }
:root[data-density="compact"] .tab { padding: 4px 12px; }
:root[data-density="compact"] .search input { padding: 9px 14px; margin-bottom: 12px; }
:root[data-density="compact"] .brief { padding: 14px 16px; margin-bottom: 14px; }
:root[data-density="compact"] .stats { margin-top: 10px; }
:root[data-density="compact"] .stat { padding: 8px 10px; }
:root[data-density="compact"] .section { margin-bottom: 16px; }
:root[data-density="compact"] .list { gap: 6px; }
:root[data-density="compact"] .item { padding: 9px 10px 9px 8px; border-radius: 14px; gap: 10px; }
:root[data-density="compact"] .item::before { inset-block: 7px; }
:root[data-density="compact"] .meta { margin-top: 4px; }
:root[data-density="compact"] .person { padding: 8px 14px; }

/* ---------- בינה מלאכותית ---------- */
.ai-badge {
  height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 14px; font-weight: 600;
  white-space: nowrap;
}
.ai-badge.on {
  border: 1px solid transparent;
  background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box;
  color: var(--text);
  box-shadow: var(--glow-2);
}
.chip.ai { background: var(--accent-soft); color: var(--accent); }
.chip.ai.pending { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.ask-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--grad) border-box;
  color: var(--text);
  text-align: start;
}
.ask-btn:hover { box-shadow: var(--glow); }
.ask-btn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ask-btn span {
  margin-inline-start: auto;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
}

.answer {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.answer::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--grad);
  opacity: .08;
  pointer-events: none;
}
.answer > * { position: relative; }
.answer-q { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.answer-text { white-space: pre-wrap; font-size: 16px; }
.answer .related { margin-top: 12px; }
.answer .err { color: var(--late); }
.thinking { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.thinking span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
  animation: pulse 1s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: .15s; }
.thinking span:nth-child(3) { animation-delay: .3s; margin-inline-end: 6px; }

/* ---------- מצבים ריקים ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  border: 1px dashed var(--border);
  border-radius: 24px;
  background: var(--surface-2);
}
.empty .big { font-size: 48px; filter: drop-shadow(0 6px 16px rgb(var(--g1) / .4)); }
.empty h3 { color: var(--text); margin: 8px 0; font-size: 20px; }
.empty ul { text-align: start; display: inline-block; margin: 12px 0 0; padding-inline-start: 20px; }
.empty li { margin: 4px 0; }

.more-btn {
  background: none; border: 0;
  color: var(--accent);
  font-weight: 600;
  padding: 6px 4px;
  font-size: 14px;
}

/* ---------- מסך פתיחה (כניסה ראשונה) ---------- */
.first-run .tabs, .first-run .search, .first-run .examples { display: none; }
.first-run .capture-foot { justify-content: flex-end; }
.first-run #view { margin-top: 28px; }

.welcome > * { animation: rise-in .5s ease both; }
.welcome > :nth-child(2) { animation-delay: .08s; }
.welcome > :nth-child(3), .welcome > :nth-child(4) { animation-delay: .16s; }
.welcome > :nth-child(5) { animation-delay: .24s; }

.hero { text-align: center; padding: 8px 8px 4px; }
.hero-logo {
  width: 88px; height: 88px;
  margin: 0 auto 18px;
  display: grid; place-items: center;
  font-size: 50px; line-height: 1;
  border-radius: 28px;
  background: var(--grad);
  box-shadow: var(--glow-1), 0 0 60px rgb(var(--g2) / .35);
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-6px) rotate(-3deg); } }
.hero h2 {
  margin: 0;
  font-size: 40px; font-weight: 800;
  line-height: 1.12;
  letter-spacing: -.03em;
}
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero p {
  max-width: 460px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 17px;
}
.hero-cta { margin-top: 22px; padding: 13px 26px; font-size: 17px; border-radius: 16px; }

.steps {
  list-style: none;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 34px 0 0; padding: 0;
}
.steps li {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.steps b {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--grad);
  color: #fff; font-size: 14px;
}
.steps strong { display: block; font-size: 15px; }
.steps span { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.try-title {
  margin: 34px 4px 12px;
  font-size: 13px; font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.tries { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.try {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px;
  text-align: start;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  overflow: hidden;
}
.try::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120px 80px at 100% 0, color-mix(in srgb, var(--c) 22%, transparent), transparent);
  pointer-events: none;
}
.try:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--c) 25%, transparent);
}
.try i {
  font-style: normal; font-size: 22px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  margin-bottom: 6px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
}
.try strong { font-size: 14px; color: var(--c); position: relative; }
.try span { font-size: 13px; color: var(--muted); line-height: 1.4; position: relative; }

.privacy { margin: 26px 0 0; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- חלון הגדרות ---------- */
.sheet {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--glow), 0 30px 80px rgba(0, 0, 0, .35);
}
.sheet[open] { animation: sheet-in .2s ease; }
.sheet::backdrop {
  background: rgba(8, 6, 20, .5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sheet form { padding: 18px 20px 20px; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.sheet-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.sheet-head .icon-btn { width: 36px; height: 36px; font-size: 14px; }

.opt { border: 0; margin: 0; padding: 12px 0 0; min-width: 0; }
.opt legend { float: inline-start; width: 100%; padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.opt legend + * { clear: both; }

.seg {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
}
.seg label { flex: 1 1 auto; }
.seg input, .swatch input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg span:hover { color: var(--accent); }
.seg input:checked + span {
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 1px var(--accent);
}
.seg input:focus-visible + span, .swatch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
  cursor: pointer;
}
.swatch i {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--sw);
  box-shadow: 0 0 0 2px var(--surface-solid), 0 0 0 3px var(--border);
  transition: transform .15s, box-shadow .15s;
}
.swatch:hover i { transform: scale(1.06); }
.swatch input:checked + i { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--accent); }
.swatch input:checked ~ span { color: var(--text); font-weight: 600; }

.sheet-foot {
  display: flex; justify-content: space-between; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---------- הודעה קופצת ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100% - 32px);
  background: var(--surface-solid); color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: 16px;
  box-shadow: var(--glow);
  font-size: 15px;
  animation: rise .2s ease;
}
.toast button {
  background: none; border: 0;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  padding: 0;
}
@keyframes rise { from { transform: translate(-50%, 10px); opacity: 0; } }
@keyframes rise-in { from { transform: translateY(-6px); opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(12px) scale(.98); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

@media (max-width: 520px) {
  .brand { gap: 8px; min-width: 0; }
  .logo { flex: none; width: 40px; height: 40px; font-size: 24px; border-radius: 12px; }
  .brand h1 { font-size: 21px; white-space: nowrap; }
  .tagline { display: none; }
  .top-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; border-radius: 12px; font-size: 16px; }
  .ai-badge { height: 36px; padding: 0 10px; font-size: 13px; border-radius: 12px; }
  #settingsBtn { display: none; } /* נשאר בתפריט ⋯ */
  .stats { gap: 6px; }
  .stat { padding: 10px; }
  .stat b { font-size: 22px; }
  .actions { opacity: 1; }
  .actions button { width: 28px; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .hero h2 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .hero-logo { width: 76px; height: 76px; font-size: 42px; border-radius: 24px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .tries { grid-template-columns: 1fr 1fr; gap: 8px; }
  .try { padding: 12px; }
  .seg span { padding: 8px 6px; font-size: 13px; }
}
/* ---------- המוח הלומד ---------- */
.lab-try { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 17px; outline: 0; }
.lab-try:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lab-out, .lab-card { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.lab-bar { display: grid; grid-template-columns: 7.5em minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; color: var(--muted); }
.lab-bar.win { color: var(--text); font-weight: 700; }
.lab-bar-track { height: 10px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.lab-bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--note); transition: width .25s ease; }
.lab-bar-fill.t-task { background: var(--task); }
.lab-bar-fill.t-idea { background: var(--idea); }
.lab-bar-fill.t-debt { background: var(--debt); }
.lab-bar-num { text-align: end; font-variant-numeric: tabular-nums; }
.lab-row, .lab-words { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lab-k, .lab-words b { color: var(--muted); font-size: 14px; margin-inline-end: 4px; }
.lab-words b { color: var(--text); min-width: 6em; }
.lab-hint { color: var(--muted); font-size: 14px; }
.lab-ex { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lab-ex-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-ex-del { background: none; border: 0; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; }
.lab-ex-del:hover { color: var(--late); background: var(--late-soft); }
.more-btn.danger { color: var(--late); }
@media (prefers-reduced-motion: reduce) { .lab-bar-fill { transition: none; } }

/* ---------- ליטוש (13.10) ---------- */
/* תיבת ההוספה: גדלה לפי התוכן, בלי פס גלילה אפור */
#input { field-sizing: content; overflow: hidden; line-height: 1.45; }
.capture-foot { min-width: 0; }
/* שוליים דהויים לשורות שנגללות הצידה, במקום חיתוך חד */
.examples, .tabs {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
}
.examples { padding-inline-end: 24px; }
/* כפתור שמירה כבוי: ניטרלי ולא גרדיאנט עכור */
.btn.primary:disabled {
  opacity: 1; filter: none;
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
}

/* כרטיסי סטטיסטיקה: אפס לא צבוע באדום/ירוק */
.stat.zero b { color: var(--muted); }
.stat b { font-variant-numeric: tabular-nums; }
.balances { grid-template-columns: repeat(3, 1fr); }
.stat.net { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border-color: transparent; }

/* פריטים */
.item { align-items: center; }
.item:has(.meta:not(:empty)) { align-items: flex-start; }
.title { font-weight: 600; line-height: 1.35; }
.meta { gap: 5px; }
.chip { font-size: 12px; padding: 2px 9px; }
.chip.kind {
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: color-mix(in srgb, var(--c) 75%, var(--text));
  font-weight: 600;
}
.chip.money.out { background: var(--late-soft); color: var(--late); }
.check { margin-top: 1px; }
/* כפתורי פעולה: אפורים ושקטים עד שנוגעים */
.actions button { filter: grayscale(1); opacity: .7; }
.actions button:hover { filter: none; opacity: 1; }
.person { gap: 10px; }
.person .amt { white-space: nowrap; }

@media (max-width: 520px) {
  .app { padding-inline: 14px; }
  .capture { padding: 14px 14px 12px; border-radius: 20px; }
  #input { font-size: 17px; }
  .tabs { margin-inline: -14px; padding-inline: 14px; gap: 6px; }
  .tab { padding: 6px 12px; font-size: 14px; }
  .brief { padding: 18px 16px; border-radius: 20px; }
  .brief h2 { font-size: 21px; }
  .item { padding: 12px 12px 12px 8px; gap: 10px; border-radius: 16px; }
  .actions { gap: 0; margin-block: -2px; }
  .actions button { width: 28px; height: 28px; font-size: 14px; }
  .balances { gap: 6px; }
  .balances .stat b { font-size: 19px; }
  .balances .stat span { font-size: 12px; }
}

/* ---------- ליטוש, סבב 2 ---------- */
/* שורת הטאבים הדביקה: רקע עם טשטוש, כדי שהתוכן לא ייראה מתחתיה */
.tabs {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-mask-image: none; mask-image: none;
}
.tabs::after { content: ""; flex: 0 0 12px; } /* מרווח בסוף הגלילה */
:root[data-fx="calm"] .tabs { background: var(--bg); }

/* כפתור AI כבוי: גלולה שקטה במקום מסגרת מקווקוות */
.ai-badge { border-style: solid; }
.ai-badge:not(.on) { color: var(--muted); font-weight: 500; }
.ai-badge:hover { border-color: var(--accent); color: var(--accent); }

/* חיפוש עם מקש קיצור */
.search { position: relative; }
.search input { padding-inline-end: 44px; }
.search-key {
  position: absolute;
  inset-inline-end: 12px; top: 6px;
  height: calc(100% - 24px);
  display: grid; place-items: center;
  min-width: 26px; padding: 0 6px;
  font: 600 12px/1 ui-monospace, monospace;
  color: var(--muted);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 7px;
  pointer-events: none;
}
.search input:focus + .search-key, .search input:not(:placeholder-shown) + .search-key { display: none; }

/* כותרות קבוצה: מונה בגלולה */
.section h3 .n {
  font-size: 11px; font-weight: 700;
  min-width: 20px; padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  text-align: center;
}
.section.late h3 .n { background: var(--late-soft); }

/* "לא בטוח" — בועה עדינה */
.ask {
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  width: fit-content;
}
.ask .chip { background: var(--surface-solid); }

@media (max-width: 520px), (hover: none) {
  .search-key { display: none; }
  .search input { padding-inline-end: 16px; }
}
.tabs {
  --tabs-bg: color-mix(in srgb, var(--bg) 82%, transparent);
  background: var(--tabs-bg);
  box-shadow: 0 0 0 100vmax var(--tabs-bg);
  clip-path: inset(0 -100vmax);
}
:root[data-fx="calm"] .tabs { --tabs-bg: var(--bg); }
.search-key { top: 18px; height: 24px; }
:root[data-density="compact"] .search-key { top: 15px; }

/* ---------- שימושים חדשים ---------- */
.item.t-shop { --c: var(--task); }
.item.t-expense { --c: var(--debt); }
.item.t-habit { --c: var(--late); }
.item.t-birthday { --c: var(--link); }
.item.t-journal { --c: var(--note); }

/* במקום כפתור "בוצע": הסמל של ההוצאה או היומן */
.check.ph { border-color: transparent; background: none; box-shadow: none; font-size: 18px; cursor: default; color: inherit; }

/* 🛒 קניות */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 2px 10px; font-weight: 600; }
.shop-head .more-btn { margin: 0; }
.item.t-shop .title { font-size: 1.02em; }
.item.t-shop { padding-top: 10px; padding-bottom: 10px; align-items: center; }
.section.bought .item { opacity: .6; }
.more-btn.shop-link { display: block; width: 100%; margin: 4px 0 14px; text-align: center; }

/* 🔥 הרגלים */
.habit .chip.streak { font-weight: 700; }
.habit .chip.streak.on { background: color-mix(in srgb, var(--late) 16%, transparent); color: var(--late); }
.habit.today-done .check { background: var(--late); border-color: var(--late); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--late) 60%, transparent); }
.habit-days { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; margin-top: 10px; max-width: 420px; }
.habit-days i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-2); }
.habit-days i.on { background: var(--late); }
.habit-days i.today { outline: 2px solid var(--accent); outline-offset: 1px; }

/* 🧾 הוצאות */
/* הגריד על כל הרשימה, כדי שכל הפסים יתחילו ויסתיימו באותו מקום */
.cat-bars { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 10px; margin-top: 14px; font-size: 14px; }
.cat-bar { display: contents; }
.cat-track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cat-track span { display: block; height: 100%; border-radius: inherit; background: var(--debt); }
.cat-num { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 🎂 ימי הולדת */
.chip.bday-in { background: color-mix(in srgb, var(--link) 16%, transparent); color: var(--link); font-weight: 700; }
.rel { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }

/* 📔 יומן */
.item.t-journal .title { white-space: pre-wrap; line-height: 1.6; }
.section.memories h3 { color: var(--link); }

@media (max-width: 520px) {
  .cat-bars { font-size: 13px; }
  .habit-days { gap: 2px; }
}

/* ---------- ליטוש המסכים החדשים ---------- */
.chip.plain { background: none; padding-inline: 0; color: var(--muted); }

/* 🛒 קניות: כל קבוצה היא כרטיס אחד עם שורות, כמו פתק קניות */
.list:has(> .item.t-shop) {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow);
}
.list > .item.t-shop {
  border: 0; border-radius: 0;
  background: transparent; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  padding-block: 11px;
}
.list > .item.t-shop:hover { transform: none; background: var(--surface-2); }
.list > .item.t-shop + .item.t-shop { border-top: 1px solid var(--border); }
.item.t-shop::before { display: none; }
.item.t-shop .check { border-radius: 50%; }
.shop-head { font-size: 15px; color: var(--muted); }

/* 🔥 הרגלים: כתום של להבה, לא אדום של "באיחור" */
.item.t-habit { --c: #f97316; }
.habit .chip.streak.on { background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.habit.today-done .check { background: var(--c); border-color: var(--c); box-shadow: 0 0 12px color-mix(in srgb, var(--c) 55%, transparent); }
.habit-days { gap: 4px; max-width: 460px; }
.habit-days i { border-radius: 4px; }
.habit-days i.on { background: var(--c); box-shadow: 0 0 6px color-mix(in srgb, var(--c) 45%, transparent); }
.habit-days i.today { outline-color: var(--c); }

/* 🧾 הוצאות: שורה כמו בדף חשבון, הסכום בגדול בצד */
.item.t-expense { align-items: center; }
.item.t-expense .check.ph { width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); font-size: 19px; }
.item.t-expense .meta { margin-top: 2px; }
.exp-amt { flex: none; font-weight: 800; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cat-track span { background: linear-gradient(90deg, var(--debt), color-mix(in srgb, var(--debt) 60%, #fff)); }

/* 🎂 ימי הולדת: "בעוד X ימים" בולט, והתאריך צמוד אליו */
.chip.bday-in .sub {
  margin-inline-start: 6px; padding-inline-start: 6px;
  border-inline-start: 1px solid color-mix(in srgb, currentColor 40%, transparent);
  font-weight: 500; opacity: .85;
}
.rel { padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }

/* 📔 יומן: נקרא כמו דף ביומן, השעה למעלה */
.item.t-journal .check.ph { display: none; }
.item.t-journal { padding-inline-start: 18px; }
.item.t-journal .body { display: flex; flex-direction: column; }
.item.t-journal .meta { order: -1; margin: 0 0 4px; }
.item.t-journal .title { font-weight: 400; font-size: 1.04em; line-height: 1.7; }
@media (max-width: 520px) {
  .habit-days { gap: 2px; }
  .item.t-expense .check.ph { width: 34px; height: 34px; font-size: 17px; }
  .exp-amt { font-size: 16px; }
}
.item.t-expense, .item.t-expense:has(.meta:not(:empty)) { align-items: center; }
.section:has(.item.t-shop) { margin-bottom: 18px; }

/* ---------- סידור כללי: טאבים כרשת קבועה ---------- */
/* 11 טאבים: שורה אחת במחשב, כמה שורות בטלפון. הכול גלוי, בלי גלילה הצידה */
.tabs {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
  overflow: visible;
}
.tabs::after { display: none; }
.tab {
  position: relative;
  flex-direction: column; justify-content: center; gap: 3px;
  min-width: 0;
  padding: 9px 2px 7px;
  border-radius: 14px;
  font-size: 12.5px; line-height: 1.2;
}
.tab .ti { font-size: 19px; line-height: 1; }
.tab .tl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.tab .count {
  position: absolute; top: 3px; inset-inline-start: 4px;
  min-width: 17px; padding: 0 4px;
  font-size: 10.5px; line-height: 17px;
  background: var(--accent-soft); color: var(--accent);
}
.tab[aria-selected="true"] .count { background: rgba(255, 255, 255, .3); color: #fff; }
:root[data-density="compact"] .tab { padding: 6px 2px 5px; }

@media (max-width: 640px) {
  .tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: static; /* שתי שורות דביקות תופסות יותר מדי מסך */
    background: none; box-shadow: none; clip-path: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    margin-inline: 0; padding-inline: 0;
  }
  .tab { font-size: 12px; padding: 8px 2px 6px; }
}

/* מסך הפתיחה: 11 דוגמאות בכרטיסים קומפקטיים */
.tries { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.try {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px; row-gap: 1px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
}
.try i { grid-row: 1 / 3; margin: 0; width: 34px; height: 34px; font-size: 18px; border-radius: 10px; }
.try strong { font-size: 13.5px; }
.try span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .tries { grid-template-columns: 1fr 1fr; }
  .try:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.try i { grid-column: 1; grid-row: 1 / 3; }
.try strong, .try span { grid-column: 2; justify-self: start; max-width: 100%; }

/* ---------- סנכרון בין מכשירים ---------- */
.sync-body { display: grid; gap: 14px; margin-top: 14px; }
.sync-p { margin: 0; line-height: 1.6; }
.sync-note { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.sync-status { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--ok-soft); color: var(--debt); font-weight: 700; }
.sync-status.bad { background: var(--late-soft); color: var(--late); }
.sync-code {
  font: 700 clamp(15px, 4.2vw, 20px) / 1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .06em; text-align: center;
  padding: 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px dashed var(--border);
  user-select: all; overflow-wrap: anywhere;
}
.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sync-choice { display: grid; gap: 8px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); }
.sync-choice h3 { margin: 0; font-size: 15px; }
.sync-field { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.sync-field input, .sync-code-in {
  font: inherit; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: inherit;
}
.sync-code-in { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; text-transform: uppercase; }
.sync-err { margin: 0; color: var(--late); font-weight: 600; min-height: 1em; }
.sync-err:empty { display: none; }

/* תפריט: "מחיקת הכול" מופרד מהאפשרויות הבטוחות */
.menu-list .danger { margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; padding-top: 12px; }

/* אפליקציה מותקנת בטלפון: מרווח מהפס התחתון ומהחריץ של המסך */
.toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
.app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); padding-top: calc(20px + env(safe-area-inset-top)); }

/* ---------- מצבים ריקים שמזמינים לנסות ---------- */
.empty.inviting {
  --c: var(--accent);
  position: relative;
  overflow: hidden;
  padding: 36px 20px 26px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, var(--border));
  background:
    radial-gradient(260px 160px at 50% 0, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%),
    var(--surface);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.empty.inviting .big {
  width: 72px; height: 72px;
  margin: 0 auto 6px;
  display: grid; place-items: center;
  font-size: 38px; line-height: 1;
  border-radius: 22px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  filter: none;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--c) 25%, transparent);
  animation: float 4s ease-in-out infinite;
}
.empty.inviting h3 { font-size: 21px; margin-bottom: 4px; }
.empty.inviting > div:not(.big):not(.empty-tries) { max-width: 340px; margin: 0 auto; font-size: 15px; }
.empty-tries {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
  margin-top: 18px;
}
.empty-hint { width: 100%; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.empty-try {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border));
  background: color-mix(in srgb, var(--c) 10%, var(--surface-solid));
  color: var(--text);
  font-size: 14px;
}
.empty-try span { color: var(--c); font-weight: 700; opacity: .7; }
.empty-try:hover { border-color: var(--c); box-shadow: 0 4px 16px color-mix(in srgb, var(--c) 30%, transparent); }
.empty-try:hover span { opacity: 1; }
:root[data-fx="calm"] .empty.inviting .big { animation: none; box-shadow: none; }

/* כרטיסי דוגמה במסך הפתיחה: האייקון משמאל, הטקסט מימין */
.try { grid-template-columns: minmax(0, 1fr) auto; }
.try i { grid-column: 2; }
.try strong,
.try span { grid-column: 1; }
.try::before { background: radial-gradient(120px 80px at 0 0, color-mix(in srgb, var(--c) 22%, transparent), transparent); }


/* ---------- תצוגת אריחים (ברירת המחדל; "רשימה" בהגדרות מחזיר את הרשימה) ----------
   כרטיסים קטנים בשתי עמודות: כותרת בצבע הסוג, שורת פרטים אחת, וריבוע אייקון בצד.
   קניות, הרגלים ויומן נשארים ברשימה, כי יש להם מבנה משלהם. */
.check .ticon { display: none; }

:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 700px) {
  :root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 74px;
  padding: 12px 14px;
  border-radius: 16px;
  border-color: color-mix(in srgb, var(--c) 24%, var(--border));
  background:
    radial-gradient(140px 90px at 0 0, color-mix(in srgb, var(--c) 18%, transparent), transparent),
    var(--surface);
  outline: 0;
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item.overdue {
  background:
    radial-gradient(140px 90px at 0 0, color-mix(in srgb, var(--late) 22%, transparent), transparent),
    var(--late-soft);
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item::before { display: none; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--c) 22%, transparent);
}

/* ריבוע האייקון = כפתור "בוצע": מראה את הסוג, ובמעבר עכבר / כשבוצע מראה ✓ */
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .check {
  grid-column: 2; grid-row: 1 / span 2;
  position: relative;
  width: 40px; height: 40px;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  font-size: 20px;
  color: inherit;
  box-shadow: none;
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .check .ticon { display: inline; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .check .ck {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: inherit;
  background: var(--c); color: #fff;
  font-size: 18px; font-weight: 800;
  opacity: 0;
  transition: opacity .15s;
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .check:hover .ck { opacity: .92; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item.done .check .ck { opacity: 1; background: var(--debt); }

:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .body { grid-column: 1; grid-row: 1; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .title {
  color: color-mix(in srgb, var(--c) 80%, var(--text));
  font-weight: 700; font-size: 15px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item.done .title { color: var(--muted); }

/* הפרטים: שורה אחת שקטה, מופרדת בנקודות, שדוהה בקצה */
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta {
  flex-wrap: nowrap; gap: 0;
  margin-top: 3px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to left, #000 80%, transparent);
  mask-image: linear-gradient(to left, #000 80%, transparent);
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip {
  flex: none; max-width: none;
  padding: 0;
  background: none; box-shadow: none;
  font-size: 12.5px; font-weight: 400;
  color: var(--muted);
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip + .chip::before { content: "·"; margin-inline: 5px; color: var(--muted); }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip.kind { display: none; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip.kind + .chip::before { content: none; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip.due.late { color: var(--late); font-weight: 700; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip.money { color: var(--debt); font-weight: 700; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip.money.out,
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .meta .chip.bday-in { color: var(--c); font-weight: 700; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .rel { display: none; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .ask { margin-top: 6px; padding: 4px 8px; font-size: 12px; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .exp-amt { grid-column: 1; grid-row: 2; justify-self: start; font-size: 15px; }

/* עריכה ומחיקה: מופיעים במעבר עכבר, או בנגיעה בכרטיס בטלפון */
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .actions {
  position: absolute;
  bottom: 6px; inset-inline-end: 6px;
  gap: 0;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:hover .actions,
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:focus-within .actions,
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:focus .actions { opacity: 1; pointer-events: auto; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .actions button { width: 28px; height: 28px; font-size: 13px; filter: none; opacity: 1; }

/* פריט בעריכה תופס את כל הרוחב */
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:has(.edit) { grid-column: 1 / -1; display: flex; }
/* אריח שנשאר לבד בשורה האחרונה נמתח, כדי שלא יישאר חור */
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 700px) {
  :root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:last-child:nth-child(odd) { grid-column: auto; }
  :root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
  :root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item:last-child:nth-child(3n+2) { grid-column: span 2; }
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .title {
  white-space: normal;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  line-height: 1.3;
}
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .ask .chip { padding: 2px 8px; font-size: 12px; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item { align-items: start; }
:root:not([data-layout="list"]) .list:not(:has(.t-shop, .t-habit, .t-journal)) > .item .check { align-self: center; }

/* ---------- מסך הבית: רשת קטגוריות (בתצוגת אריחים) ---------- */
.home-grid { margin: 0 0 26px; }
:root[data-layout="list"] .home-grid { display: none; }
:root:not([data-layout="list"]) .all-clear { display: none; } /* הרשת כבר מראה שהכול ריק */
.home-tile { min-height: 64px; }
.home-tile strong { display: flex; align-items: center; gap: 6px; }
.home-tile em {
  font-style: normal;
  min-width: 18px; padding: 0 5px;
  font-size: 11px; line-height: 18px; text-align: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c);
}
.home-tile.quiet span { opacity: .75; }

/* ---------- אריחים: בלי שורת טאבים, ניווט דרך מסך הבית ---------- */
:root:not([data-layout="list"]) #tabs { display: none; }
:root:not([data-layout="list"]) .search input { margin-top: 18px; }
:root[data-layout="list"] .crumb, :root[data-layout="list"] .home-done { display: none; }
.home-done { display: block; margin: -14px auto 22px; }
.crumb {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 16px;
}
.crumb h2 { margin: 0; font-size: 22px; font-weight: 800; }
.crumb-back {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 600;
}
.crumb-back:hover { border-color: var(--accent); color: var(--accent); }
:root:not([data-layout="list"]) .search-key { top: 30px; }

/* אריחי מסך הבית: גדולים יותר */
.home-grid { gap: 12px; }
.home-tile {
  min-height: 92px;
  padding: 16px 16px;
  border-radius: 20px;
  column-gap: 12px; row-gap: 4px;
}
.home-tile i { width: 50px; height: 50px; font-size: 26px; border-radius: 15px; }
.home-tile strong { font-size: 17px; }
.home-tile span { font-size: 13.5px; }
.home-tile em { min-width: 21px; font-size: 12px; line-height: 21px; }
.home-tile::before { background: radial-gradient(180px 120px at 0 0, color-mix(in srgb, var(--c) 24%, transparent), transparent); }
@media (max-width: 640px) {
  .home-tile { min-height: 84px; padding: 14px 12px; }
  .home-tile i { width: 44px; height: 44px; font-size: 23px; border-radius: 13px; }
  .home-tile strong { font-size: 16px; }
}
.home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- מרחבים משותפים ---------- */
.spaces { display: grid; gap: 12px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--border); }
.spaces-title { margin: 0; font-size: 17px; }
.space-card { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.space-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.space-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.chip.space { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #8b5cf6; font-weight: 600; }
.space-block { margin-bottom: 26px; }
.space-block .brief .sync-actions { margin-top: 10px; }
.settle { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 6px; }
.settle-head { font-weight: 600; }
.settle-row { font-size: 15px; }
.settle .more-btn { justify-self: start; margin: 4px 0 0; }
