/* =====================================================================
   הפרויקטים שלנו — one family, one project, one phone.
   Tokens: paper / surface / ink / muted / line · blue (the money panel)
           marigold (action + money already paid) · raspberry (over) · green (done)
   ===================================================================== */
@font-face { font-family: "Secular One"; font-weight: 400; font-display: swap;
  src: url(fonts/secular-one-hebrew-400-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Secular One"; font-weight: 400; font-display: swap;
  src: url(fonts/secular-one-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Assistant"; font-weight: 400; font-display: swap; src: url(fonts/assistant-hebrew-400-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-weight: 600; font-display: swap; src: url(fonts/assistant-hebrew-600-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-weight: 700; font-display: swap; src: url(fonts/assistant-hebrew-700-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Assistant"; font-weight: 400; font-display: swap; src: url(fonts/assistant-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Assistant"; font-weight: 600; font-display: swap; src: url(fonts/assistant-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Assistant"; font-weight: 700; font-display: swap; src: url(fonts/assistant-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }

:root {
  --paper: #EEF0F2; --surface: #FFFFFF; --ink: #1C2733; --muted: #5E6B78; --line: #D9DEE3;
  --blue: #1E3A5F; --blue-ink: #F4F7FA; --blue-muted: #A9BCD0; --blue-track: #2F5079;
  --marigold: #F2B33D; --marigold-ink: #1C2733; --raspberry: #B4235A; --green: #2E7D5B;
  --display: "Secular One", "Assistant", system-ui, sans-serif;
  --body: "Assistant", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --gutter: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12171D; --surface: #1B222B; --ink: #E9EEF3; --muted: #93A1AE; --line: #2A333E;
    --blue: #1D3858; --blue-track: #2C4C73; --raspberry: #E0628F; --green: #5FB58C;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }

/* ---------------------------------------------------------------- frame */
.screen { max-width: 560px; margin: 0 auto; min-height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) calc(120px + env(safe-area-inset-bottom)); }
.head { margin: 6px 0 18px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.title { font: 400 32px/1.1 var(--display); margin: 0; flex: 1; letter-spacing: -.005em; }
.when { margin: 0; color: var(--muted); font-size: 16px; flex-basis: 100%; }
.text-btn { background: none; border: 0; padding: 8px 0; color: var(--muted); font-size: 16px; }
.text-btn.back::before { content: "‹ "; }
.text-btn.quiet { font-size: 15px; padding: 10px 0 0; }

/* ---------------------------------------------------------------- the money panel */
.money { background: var(--blue); color: var(--blue-ink); border-radius: 22px; padding: 20px 20px 18px; margin-bottom: 30px; }
.money .lead { margin: 0; color: var(--blue-muted); font-size: 16px; }
.money .big { font: 400 46px/1.05 var(--display); margin: 4px 0 2px; }
.money .big.over { color: #FFB3CD; }
.money .of { margin: 0 0 16px; color: var(--blue-muted); }
.bar3 { position: relative; display: flex; height: 12px; border-radius: 6px; background: var(--blue-track); overflow: hidden; }
.bar3 .paid { background: var(--marigold); }
.bar3 .expected { background: repeating-linear-gradient(-45deg, var(--marigold) 0 3px, transparent 3px 7px); opacity: .85; }
.bar3 .cap { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--blue-ink); }
.legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 16px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .sw.paid { background: var(--marigold); }
.legend .sw.expected { background: repeating-linear-gradient(-45deg, var(--marigold) 0 2px, transparent 2px 5px); outline: 1px solid var(--marigold); outline-offset: -1px; }
.legend b { font-weight: 700; }
.money .set-budget { margin-top: 12px; background: none; border: 1px solid var(--blue-muted); color: var(--blue-ink); border-radius: 999px; padding: 8px 14px; }

/* ---------------------------------------------------------------- blocks */
.block { margin-bottom: 30px; }
.block h2 { font: 400 22px/1.2 var(--display); margin: 0 0 8px; }
.empty { color: var(--muted); margin: 4px 0; }

/* todo: a list, not cards */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--muted); background: none; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; padding: 0; }
.todo .tick.on { background: var(--green); border-color: var(--green); }
.todo .what { flex: 1; min-width: 0; }
.todo .what div:first-child { font-weight: 600; }
.todo .who { color: var(--muted); font-size: 15px; }
.todo .late { color: var(--raspberry); }
.done-list li { opacity: .6; }
.done-list .what div:first-child { text-decoration: line-through; text-decoration-thickness: 1px; }

/* decisions: the only real cards, built around photos */
.choice { display: block; width: 100%; text-align: start; background: var(--surface); border: 0; border-radius: 18px; padding: 14px 16px 16px; margin-bottom: 12px; box-shadow: 0 1px 0 var(--line), 0 6px 20px -12px rgba(28,39,51,.35); }
.choice h3 { font: 600 19px/1.3 var(--body); margin: 0 0 12px; }
.swatches { display: flex; gap: 8px; margin-bottom: 12px; }
.swatches img, .swatches .ph { width: 74px; height: 74px; border-radius: 12px; object-fit: cover; background: var(--paper); flex: none; }
.swatches .ph { display: grid; place-items: center; color: var(--muted); font-size: 14px; text-align: center; padding: 4px; line-height: 1.2; }
.choice .foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.choice .go { color: var(--ink); font-weight: 700; }
.decided { list-style: none; margin: 4px 0 0; padding: 0; }
.decided li { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: var(--muted); }
.decided img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.decided b { color: var(--ink); font-weight: 600; }

/* ledger */
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.ledger li:last-child { border-bottom: 0; }
.ledger .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ledger .name { font-weight: 700; font-size: 18px; }
.ledger .mark { font-weight: 700; color: var(--green); }
.ledger .mark.over { color: var(--raspberry); }
.ledger .fig { color: var(--muted); font-size: 16px; }
.ledger .thin { height: 4px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
.ledger .thin i { display: block; height: 100%; background: var(--marigold); }
.ledger .thin i.full { background: var(--green); }
.ledger .thin i.over { background: var(--raspberry); }
.ledger-note { color: var(--muted); font-size: 15px; margin: 10px 0 0; }

/* history */
.history summary { font: 400 20px/1.2 var(--display); cursor: pointer; list-style: none; color: var(--muted); }
.history summary::-webkit-details-marker { display: none; }
.history summary::after { content: " ▾"; font-size: 14px; }
.history[open] summary::after { content: " ▴"; }
.history ul { list-style: none; margin: 10px 0 0; padding: 0; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.history li .t { color: var(--muted); font-size: 14px; }
.history li .e { grid-column: 1 / -1; color: var(--muted); }

/* projects list */
.projects { list-style: none; margin: 0; padding: 0; }
.projects li { padding: 16px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.projects .pn { font: 400 24px/1.2 var(--display); }
.projects .pm { color: var(--muted); margin-top: 2px; }

/* login */
.login { display: grid; align-content: center; gap: 28px; }
.brand { font: 400 38px/1.1 var(--display); margin: 0; }
.login-form { display: grid; gap: 14px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 16px; }
.field input, .field select, .field textarea { width: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); font-size: 17px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--ink); outline: none; }
.money-input { font: 400 34px/1 var(--display) !important; padding: 12px 14px !important; }
.btn { border: 0; border-radius: 16px; padding: 16px; font-weight: 700; font-size: 18px; width: 100%; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.ghost { background: none; border: 1.5px solid var(--line); }
.btn:disabled { opacity: .5; }
.error { color: var(--raspberry); margin: 0; min-height: 1.3em; font-size: 15px; }
.hint { color: var(--muted); font-size: 15px; margin: -4px 0 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 15px; font-size: 16px; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip.new { border-style: dashed; }

.camera { display: grid; place-items: center; gap: 6px; min-height: 150px; border-radius: 18px; background: var(--paper); border: 1.5px dashed var(--line); color: var(--muted); cursor: pointer; overflow: hidden; position: relative; }
.camera input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.camera img { width: 100%; max-height: 260px; object-fit: cover; }
.camera .cam-icon { font-size: 34px; line-height: 1; }
.camera.compact { min-height: 64px; grid-auto-flow: column; justify-content: start; padding: 0 16px; gap: 12px; }
.camera.compact img { width: 64px; height: 64px; max-height: none; border-radius: 10px; }

/* ---------------------------------------------------------------- + menu */
.adds { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.adds button { display: grid; grid-template-columns: 48px 1fr; gap: 2px 14px; align-items: center; text-align: start; width: 100%; background: none; border: 0; padding: 12px 4px; border-radius: 14px; }
.adds button:active { background: var(--paper); }
.adds .ic { grid-row: span 2; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--paper); }
.adds .ic.found { background: var(--marigold); color: var(--marigold-ink); }
.adds b { font-size: 18px; }
.adds small { color: var(--muted); font-size: 15px; }

/* decision sheet */
.options { display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; text-align: start; width: 100%; padding: 8px; background: var(--paper); border: 2px solid transparent; border-radius: 18px; }
.opt img, .opt .ph { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; background: var(--line); }
.opt b { display: block; font-size: 18px; }
.opt .p { font: 400 22px/1.2 var(--display); margin-top: 2px; }
.opt.on { border-color: var(--ink); background: var(--surface); }
.opt.won { border-color: var(--green); }

/* ---------------------------------------------------------------- inbox, notes, quick add */
.inbox h2 { display: flex; align-items: center; gap: 8px; }
.count { font: 700 14px/1 var(--body); background: var(--marigold); color: var(--marigold-ink); border-radius: 999px; padding: 4px 9px; }
.tray { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-snap-type: x proximity; }
.cap { flex: none; width: 104px; height: 104px; border-radius: 16px; border: 0; padding: 0; background: var(--surface); overflow: hidden; position: relative;
  display: grid; scroll-snap-align: start; box-shadow: 0 1px 0 var(--line); }
.cap img { width: 100%; height: 100%; object-fit: cover; grid-area: 1 / 1; }
.cap-text { grid-area: 1 / 1; align-self: end; text-align: start; font-size: 14px; line-height: 1.25; padding: 8px 10px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cap img + .cap-text { background: linear-gradient(transparent, rgba(18,23,29,.78)); color: #fff; -webkit-line-clamp: 2; }
.cap-photo { width: 100%; max-height: 300px; object-fit: cover; border-radius: 16px; }
.cap-quote { margin: 0; font-size: 20px; line-height: 1.35; }
.kind .chips { gap: 8px; }
.quick-add input { width: 100%; border: 0; border-bottom: 1.5px dashed var(--line); background: none; padding: 12px 2px; font-size: 17px; }
.quick-add input:focus { outline: none; border-bottom-color: var(--ink); }
.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.notes li:last-child { border-bottom: 0; }
.notes .who { color: var(--muted); font-size: 14px; margin-top: 2px; }
.note-input { width: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--paper); font-size: 19px; resize: none; }
.note-input:focus { outline: none; border-color: var(--ink); }

/* ---------------------------------------------------------------- dock: camera · + · note */
.dock { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom)); inset-inline: 0; margin: 0 auto; width: max-content;
  display: flex; align-items: center; gap: 18px; z-index: 5; }
.dock .fab { position: static; transform: none; }
.dock-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center;
  box-shadow: 0 8px 22px -8px rgba(28,39,51,.5), 0 0 0 1px var(--line); cursor: pointer; position: relative; padding: 0; }
.dock-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.dock-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

/* ---------------------------------------------------------------- FAB, sheet, toast */
.fab { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); inset-inline-start: 50%; transform: translateX(50%);
  width: 66px; height: 66px; border-radius: 50%; border: 0; background: var(--marigold); color: var(--marigold-ink);
  font: 400 40px/1 var(--display); box-shadow: 0 10px 28px -8px rgba(28,39,51,.55); padding-bottom: 4px; }
dialog { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; background: transparent; max-height: 100dvh; }
dialog::backdrop { background: rgba(18,23,29,.45); }
.sheet { background: var(--surface); border-radius: 24px 24px 0 0; padding: 10px var(--gutter) calc(20px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto; }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet form { display: grid; gap: 16px; }
.sheet h3 { font: 400 26px/1.15 var(--display); margin: 0; }
dialog[open] .sheet { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.toast { position: fixed; inset-inline: 20px; bottom: calc(102px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 420px; background: var(--ink); color: var(--paper);
  padding: 14px 18px; border-radius: 16px; font-size: 17px; z-index: 20; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); }
.toast b { color: var(--marigold); }
.toast { display: flex; align-items: center; gap: 12px; }
.toast > span { flex: 1; }
.toast-act { flex: none; background: var(--marigold); color: var(--marigold-ink); border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { dialog[open] .sheet { animation: none; } }
