/* בית חדש — עיצוב: תיק פרויקט של מודד. נייר, קווים, מספרים. */

:root {
  --ink:        #16283C;
  --ink-2:      #3E5266;   /* טקסט משני */
  --ink-3:      #6C7C8C;   /* טקסט עמום */
  --paper:      #FAF8F3;
  --card:       #FFFFFF;
  --rule:       #D8D3C7;
  --rule-soft:  #EAE6DC;
  --tape:       #E8B33C;
  --tape-dark:  #C8912A;
  --over:       #B3402F;
  --over-bg:    #FBEEEC;
  --ok:         #3D7A5C;
  --ok-bg:      #ECF4EF;

  --r:    12px;
  --r-sm: 9px;
  --tap:  50px;

  /* Google Sans לכל האפליקציה. הגוף במשקל 400, והכותרות שיושבות על הנייר
     עצמו (לא בתוך המסגרות הלבנות) במשקל 600. */
  --sans: 'Google Sans', 'Segoe UI', 'Arial Hebrew', system-ui, sans-serif;
  --display: var(--sans);
  --mono: 'Google Sans', 'Segoe UI', 'Arial Hebrew', system-ui, sans-serif;
}

/* כותרות על הנייר */
.app-header h1, .section-title, .pin-screen h1, .modal-head h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .025em;
}

/* מחוץ לכותרות אין מודגש — ההיררכיה נשענת על גודל, צבע וריווח */
strong, b { font-weight: 400; }

* { box-sizing: border-box; }

/* פקדים לא יורשים פונט מהדפדפן — בלי זה כרטיסים שהם <button> נופלים ל-Arial */
button, input, select, textarea { font-family: inherit; }

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}
@media (min-width: 700px) { html { font-size: 18px; } }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* רשת מילימטרית עדינה מאוד */
  background-image:
    repeating-linear-gradient(to left, rgba(22,40,60,.055) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(to bottom, rgba(22,40,60,.055) 0 1px, transparent 1px 24px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--sans); font-weight: 400; margin: 0; line-height: 1.3; }

a { color: var(--ink); }

/* ============ שלד ============ */

.app-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  border-block-end: 1px solid var(--rule);
  padding: 14px 16px 12px;
}
.app-header .wrap { max-width: 720px; margin-inline: auto; display: flex; align-items: baseline; gap: 12px; }
.app-header h1 { font-size: 1.6rem; }
.app-header .sub { font-size: .88rem; color: var(--ink-3); margin-inline-start: auto; font-family: var(--mono); }

main { max-width: 720px; margin-inline: auto; padding: 16px 16px 120px; }

.view { display: none; }
.view.on { display: block; animation: none; }

/* ============ ניווט תחתון ============ */

.nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: var(--card);
  border-block-start: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom);
}
/* רצועה נגללת — כל המסכים בשורה אחת, גוררים ימינה ושמאלה */
.nav .wrap {
  max-width: 720px; margin-inline: auto;
  display: flex; overflow-x: auto; overscroll-behavior-x: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nav .wrap::-webkit-scrollbar { display: none; }
.nav button {
  appearance: none; border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: .8rem; color: var(--ink-3);
  min-height: 64px; padding: 8px 6px 6px;
  flex: 0 0 auto; min-width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border-block-start: 3px solid transparent;
  white-space: nowrap;
}
.nav button svg { stroke: currentColor; fill: none; }
.nav button[aria-current="true"] { color: var(--ink); border-block-start-color: var(--tape); }
/* רמז שיש עוד — הצללה עדינה בקצה */
.nav::before, .nav::after {
  content: ''; position: absolute; top: 1px; bottom: 0; width: 22px; pointer-events: none; z-index: 1;
}
.nav::before { inset-inline-start: 0; background: linear-gradient(to left, var(--card), transparent); }
.nav::after  { inset-inline-end: 0;  background: linear-gradient(to right, var(--card), transparent); }

/* ============ תפריט המבורגר (דסקטופ) ============ */

.menu-btn {
  display: none;
  appearance: none; cursor: pointer;
  width: 46px; height: 46px; flex: none;
  border: 1.5px solid var(--rule); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink);
  align-items: center; justify-content: center;
  margin-inline-start: 4px;
}
.menu-btn:hover { background: #FBF9F5; }

.menu-back {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(22,40,60,.28);
}
.menu {
  position: absolute; inset-block-start: 64px; inset-inline: 0;
  max-width: 720px; margin-inline: auto;
  background: var(--paper);
  border: 1px solid var(--rule); border-radius: 0 0 var(--r) var(--r);
  padding: 12px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  box-shadow: 0 8px 24px rgba(22,40,60,.14);
  max-height: calc(100dvh - 80px); overflow-y: auto;
}
.menu-item {
  appearance: none; cursor: pointer; text-align: start;
  display: flex; align-items: center; gap: 11px;
  min-height: 58px; padding: 8px 12px;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--card); color: var(--ink);
  font-family: var(--sans); font-size: 1rem;
}
.menu-item:hover { background: #FBF9F5; }
.menu-item svg { flex: none; stroke: var(--ink-2); }
.menu-item[aria-current="true"] { border-color: var(--tape-dark); background: #FDF6E4; }
.mi-text { display: grid; min-width: 0; }
.mi-label { line-height: 1.25; }
.mi-note { font-size: .78rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 760px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  main { padding-block-end: 40px; }
  .fab { bottom: 24px; }
  .sticky-total { bottom: 0; }
}

/* ============ טיפוגרפיה ומספרים ============ */

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.big { font-size: 1.35rem; }
.muted { color: var(--ink-3); }
.small { font-size: .87rem; }
.over { color: var(--over); }
.ok { color: var(--ok); }
.center { text-align: center; }

.section-title {
  font-size: 1.22rem;
  margin: 26px 0 10px; padding-block-end: 6px;
  border-block-end: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 8px;
}
.section-title .count { font-family: var(--mono); font-size: .85rem; color: var(--ink-3); margin-inline-start: auto; }
.view > .section-title:first-child { margin-top: 4px; }

/* ============ כרטיסים ורשימות ============ */

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 14px 15px;
  margin-block-end: 12px;
}
.card.flat { padding: 0; overflow: hidden; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border-block-end: 1px solid var(--rule-soft);
  min-height: var(--tap);
  background: var(--card);
  width: 100%; text-align: start;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  border-inline: 0; border-block-start: 0;
  cursor: pointer;
}
.row:last-child { border-block-end: 0; }
.row:hover { background: #FDFCF9; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 400; }
.row .meta { font-size: .85rem; color: var(--ink-3); }
.row .chev { color: var(--rule); flex: none; }

.empty {
  padding: 26px 18px; text-align: center; color: var(--ink-3);
  border: 1px dashed var(--rule); border-radius: var(--r); background: #FFFDF9;
}

/* ============ כפתורים ============ */

.btn {
  appearance: none; cursor: pointer;
  font-family: var(--sans); font-size: 1.02rem; font-weight: 400;
  min-height: var(--tap); padding: 0 20px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--rule);
  background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: #FBF9F5; }
.btn-primary { background: var(--tape); border-color: var(--tape-dark); color: #2A1F05; }
.btn-primary:hover { background: #F0BE4C; }
.btn-danger { color: var(--over); border-color: #E3C4BE; background: var(--card); }
.btn-danger:hover { background: var(--over-bg); }
.btn-block { width: 100%; }
.btn-sm { min-height: 42px; font-size: .92rem; padding: 0 14px; }

.fab {
  position: fixed; inset-inline-start: 16px; bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 45;
  min-height: 56px; padding: 0 22px;
  border-radius: 28px;
  background: var(--tape); border: 1.5px solid var(--tape-dark); color: #2A1F05;
  font-family: var(--sans); font-size: 1.05rem; font-weight: 400;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
}

.btn-line { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-line .btn { flex: 1; }

/* ============ טפסים ============ */

.field { margin-block-end: 14px; }
.field > label {
  display: block; font-size: .92rem; font-weight: 400; color: var(--ink-2);
  margin-block-end: 5px;
}
.field .hint { font-size: .82rem; color: var(--ink-3); font-weight: 400; }

input, select, textarea {
  width: 100%;
  min-width: 0;
  font-family: var(--sans); font-size: 1.03rem; color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 12px 13px;
  min-height: var(--tap);
}
input[inputmode="decimal"], input[type="date"], input.num-in { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'><path d='M1 1l6 6 6-6' fill='none' stroke='%236C7C8C' stroke-width='2'/></svg>");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-inline-start: 38px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(232,179,60,.6); outline-offset: 1px;
}
input::placeholder, textarea::placeholder { color: #A9B3BC; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.check {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); cursor: pointer; font-size: 1.02rem;
}
.check input[type="checkbox"] {
  width: 30px; height: 30px; min-height: 30px; flex: none; margin: 0;
  accent-color: var(--ok); cursor: pointer;
}

/* ============ מודאל ============ */

.modal-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(22,40,60,.45);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 700px) { .modal-back { align-items: center; } }
.modal {
  background: var(--paper); width: 100%; max-width: 640px;
  max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--rule);
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 700px) { .modal { border-radius: 16px; } }
.modal-head {
  position: sticky; top: 0; background: var(--paper);
  padding: 16px 0 12px; margin-block-end: 4px;
  border-block-end: 1px solid var(--rule);
  display: flex; align-items: center; gap: 12px;
}
.modal-head h2 { font-size: 1.32rem; flex: 1; }
.modal-head .x {
  appearance: none; border: 1.5px solid var(--rule); background: var(--card);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 1.3rem; color: var(--ink-2); line-height: 1;
}
.modal-foot { display: flex; gap: 10px; padding-block-start: 16px; }
.modal-foot .btn { flex: 1; }

/* ============ אקורדיון ============ */

.acc { border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); margin-block-end: 12px; overflow: hidden; }
.acc > summary {
  list-style: none; cursor: pointer;
  padding: 15px; min-height: var(--tap);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-weight: 400; font-size: 1.06rem;
  background: #FCFBF8;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary .count { font-family: var(--mono); font-size: .82rem; color: var(--ink-3); margin-inline-start: auto; }
.acc > summary .caret { transition: transform .15s; color: var(--ink-3); }
.acc[open] > summary { border-block-end: 1px solid var(--rule); }
.acc[open] > summary .caret { transform: rotate(180deg); }
.acc-body { padding: 0; }

/* ============ מידות ============ */

.meas-row { display: flex; align-items: center; gap: 12px; padding: 14px 15px; border-block-end: 1px solid var(--rule-soft); cursor: pointer; background: var(--card); width: 100%; border-inline: 0; border-block-start: 0; text-align: start; }
.meas-row:last-child { border-block-end: 0; }
.meas-row .label { flex: 1; font-size: 1.05rem; font-weight: 400; min-width: 0; }
.meas-row .dims { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1.22rem; letter-spacing: -.03em; white-space: nowrap; direction: ltr; }
.meas-row .dims .x { color: var(--ink-3); padding: 0 2px; }
.meas-row .note { font-size: .84rem; color: var(--ink-3); }

/* ============ צ'יפים / פילטרים ============ */

.chips { display: flex; gap: 8px; overflow-x: auto; padding-block-end: 4px; margin-block-end: 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  appearance: none; cursor: pointer; white-space: nowrap;
  font-family: var(--sans); font-size: .93rem; font-weight: 400;
  min-height: 44px; padding: 0 15px; border-radius: 22px;
  border: 1.5px solid var(--rule); background: var(--card); color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #FFF; }

.tag {
  display: inline-block; font-size: .8rem; font-weight: 400;
  padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--rule); background: #FBF9F5; color: var(--ink-2);
  white-space: nowrap;
}
.tag.t-ok { border-color: #BEDCCB; background: var(--ok-bg); color: var(--ok); }
.tag.t-over { border-color: #E7C6C0; background: var(--over-bg); color: var(--over); }
.tag.t-tape { border-color: #EBD59A; background: #FDF6E4; color: #8A6410; }

/* ============ בדיקת התאמה ============ */

.fit {
  border: 1.5px solid var(--rule); border-radius: var(--r);
  background: #FCFBF8; padding: 14px; margin-block-end: 14px;
}
.fit h3 { font-size: 1.05rem; margin-block-end: 10px; }
.fit .track {
  position: relative; height: 46px;
  border: 1.5px solid var(--ink); border-radius: 6px;
  background:
    repeating-linear-gradient(to left, rgba(22,40,60,.14) 0 1px, transparent 1px 10px);
  overflow: hidden;
}
.fit .bar {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  background: rgba(61,122,92,.28);
  border-inline-end: 2.5px solid var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .85rem; color: var(--ink);
  min-width: 2px; transition: inline-size .2s;
}
.fit .bar.is-over { background: rgba(179,64,47,.25); border-inline-end-color: var(--over); }
.fit .verdict { margin-block-start: 10px; font-size: 1.08rem; font-weight: 400; font-family: var(--mono); }
.fit .scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .78rem; color: var(--ink-3); margin-block-start: 4px; }
.fit .warn {
  margin-block-start: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: .95rem; font-weight: 400;
  border: 1.5px solid #E7C6C0; background: var(--over-bg); color: var(--over);
}
.fit .warn.soft { border-color: #EBD59A; background: #FDF6E4; color: #7A5808; }
.fit .lines { margin-block-start: 10px; display: grid; gap: 4px; font-family: var(--mono); font-size: .93rem; }
.fit .lines div { display: flex; justify-content: space-between; gap: 10px; }

/* ============ תקציב ============ */

.bar-track { height: 14px; border-radius: 7px; background: #EDE9E0; overflow: hidden; display: flex; border: 1px solid var(--rule); }
.bar-track i { display: block; height: 100%; }
.bar-track .b-paid { background: var(--ok); }
.bar-track .b-actual { background: #8FB3A2; }
.bar-track .b-over { background: var(--over); }

.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.kv .k { color: var(--ink-2); }
.kv .v { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 400; }

.budget-row { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-block-end: 1px solid var(--rule-soft); background: var(--card); }
.budget-row:last-child { border-block-end: 0; }
.budget-row .lab { flex: 1; min-width: 0; cursor: pointer; }
.budget-row .lab .t { font-weight: 400; }
.budget-row .nums { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: end; white-space: nowrap; font-size: 1.02rem; }
.budget-row .nums .plan { color: var(--ink-3); font-size: .84rem; display: block; }
.budget-row.is-paid .lab .t { color: var(--ok); }

.sticky-total {
  position: fixed; inset-inline: 0; bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 35; background: var(--card); border-block-start: 1px solid var(--rule);
}
.sticky-total .wrap {
  max-width: 720px; margin-inline: auto; padding: 9px 12px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; text-align: center;
}
.sticky-total .lab { font-size: .72rem; color: var(--ink-3); display: block; white-space: nowrap; }
.sticky-total .val {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: .97rem; font-weight: 400; display: block; white-space: nowrap;
  letter-spacing: -.04em;
}

/* ============ דף הבית ============ */

.count-card { text-align: center; padding: 20px 15px; }
.count-card .days { font-family: var(--mono); font-size: 3.2rem; font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.count-card .lab { color: var(--ink-2); margin-block-start: 6px; }
.count-card .date { font-family: var(--mono); color: var(--ink-3); font-size: .9rem; margin-block-start: 2px; }

.alert {
  border: 1.5px solid #E7C6C0; background: var(--over-bg); color: var(--over);
  border-radius: var(--r); padding: 13px 15px; margin-block-end: 12px;
}
.alert .h { font-weight: 400; margin-block-end: 4px; }
.alert ul { margin: 0; padding-inline-start: 20px; }

/* ============ השוואת הצעות ============ */

.compare { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--card); }
.compare table { border-collapse: collapse; width: 100%; min-width: 420px; }
.compare th, .compare td { padding: 11px 12px; border-block-end: 1px solid var(--rule-soft); text-align: start; vertical-align: top; font-size: .95rem; }
.compare th { background: #FCFBF8; font-weight: 400; white-space: nowrap; width: 1%; color: var(--ink-2); }
.compare td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 400; }
.compare td.best { background: var(--ok-bg); }

/* ============ שונות ============ */

.link-row { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-block-end: 1px solid var(--rule-soft); min-height: var(--tap); }
.link-row:last-child { border-block-end: 0; }
.link-row a { flex: 1; font-weight: 400; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a:hover { text-decoration: underline; }
.link-row .edit { appearance: none; border: 0; background: none; cursor: pointer; color: var(--ink-3); padding: 8px; min-height: 44px; min-width: 44px; }

.pin-screen { max-width: 340px; margin: 12vh auto; padding: 0 20px; text-align: center; }
.pin-screen h1 { font-size: 2.15rem; margin-block-end: 6px; }
.pin-screen p { color: var(--ink-3); margin-block-start: 0; margin-block-end: 26px; }
.pin-screen input {
  font-family: var(--mono); font-size: 1.9rem; text-align: center;
  letter-spacing: .3em; padding: 14px 10px; min-height: 62px;
}
.pin-err { color: var(--over); font-weight: 400; margin-block-start: 12px; min-height: 24px; }

.toast {
  position: fixed; inset-inline: 16px; bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 70; max-width: 480px; margin-inline: auto;
  background: var(--ink); color: #FFF;
  border-radius: var(--r-sm); padding: 13px 16px;
  font-size: .98rem; text-align: center;
}
.toast.err { background: var(--over); }


.loading { padding: 40px; text-align: center; color: var(--ink-3); }

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

/* ============ רשת טופס במודאל ============ */
.modal form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; padding-block-start: 10px; }
.modal .field { grid-column: 1 / -1; min-width: 0; }
.modal .field.half { grid-column: auto; }

/* אלמנטים שמוסתרים דרך התכונה hidden */
[hidden] { display: none !important; }

/* טקסט שנקרא משמאל לימין (טלפונים, כתובות) */
.ltr { direction: ltr; unicode-bidi: isolate; text-align: start; }

/* ============ בורר עם רשימה ============ */

.combo { position: relative; display: flex; }
.combo input { padding-inline-end: 52px; }
.combo-toggle {
  position: absolute; inset-inline-end: 1px; inset-block: 1px;
  width: 48px; border: 0; background: none; cursor: pointer;
  color: var(--ink-3); display: flex; align-items: center; justify-content: center;
  border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm);
}
.combo-toggle:hover { background: #F4F1EA; }
.combo-list {
  margin-block-start: 6px;
  border: 1.5px solid var(--rule); border-radius: var(--r-sm);
  background: var(--card); max-height: 244px; overflow-y: auto;
}
.combo-opt {
  display: block; width: 100%; text-align: start;
  border: 0; border-block-end: 1px solid var(--rule-soft); background: none;
  font-family: var(--sans); font-size: 1rem; color: var(--ink);
  padding: 0 14px; min-height: 48px; cursor: pointer;
}
.combo-opt:last-child { border-block-end: 0; }
.combo-opt:hover { background: #FBF9F5; }
.combo-opt.is-current { background: #FDF6E4; font-weight: 400; }

/* ============ קבצים ותמונות ============ */

.file-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-block-end: 1px solid var(--rule-soft);
  min-height: var(--tap);
}
.file-row:last-child { border-block-end: 0; }
.file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.file-row .fsize { font-family: var(--mono); font-size: .82rem; color: var(--ink-3); white-space: nowrap; }
.file-row a { text-decoration: none; }
.file-kind {
  flex: none; width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--rule); background: #FBF9F5;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .66rem; font-weight: 400; color: var(--ink-2);
}
.file-kind.img { padding: 0; overflow: hidden; border-color: var(--rule); }
.file-kind img { width: 100%; height: 100%; object-fit: cover; }

.pick-line { display: flex; gap: 10px; margin-block-start: 4px; }
.pick-line .btn { flex: 1; }
.pick-line input[type="file"] { display: none; }

.receipt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.receipt-card {
  border: 1px solid var(--rule); border-radius: var(--r); background: var(--card);
  overflow: hidden; cursor: pointer; text-align: start;
  display: flex; flex-direction: column; padding: 0;
}
.receipt-card .thumb {
  aspect-ratio: 4 / 3; background: #F1EEE7; display: block; width: 100%;
  object-fit: cover; border-block-end: 1px solid var(--rule-soft);
}
.receipt-card .pdf {
  aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center;
  background: #F1EEE7; border-block-end: 1px solid var(--rule-soft);
  font-family: var(--mono); font-weight: 400; color: var(--ink-2);
}
.receipt-card .body { padding: 10px 12px 12px; display: grid; gap: 3px; }
.receipt-card .t { font-weight: 400; font-size: .98rem; line-height: 1.3; }
.receipt-card .m { font-size: .82rem; color: var(--ink-3); }
.receipt-card .a { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 400; }

.drive-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 400; padding: 2px 8px; border-radius: 20px;
  border: 1px solid #BEDCCB; background: var(--ok-bg); color: var(--ok);
}
.drive-chip.pending { border-color: var(--rule); background: #FBF9F5; color: var(--ink-3); }
.drive-chip.errored { border-color: #E7C6C0; background: var(--over-bg); color: var(--over); }

.viewer-img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--rule); background: #F1EEE7; }

.icon-btn {
  flex: none; width: 48px; height: 48px; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--rule); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon-btn.call { background: var(--tape); border-color: var(--tape-dark); color: #2A1F05; }
.icon-btn.call:hover { background: #F0BE4C; }
.icon-btn:hover { background: #FBF9F5; }

.progress { height: 6px; border-radius: 3px; background: #EDE9E0; overflow: hidden; margin-block-start: 8px; }
.progress i { display: block; height: 100%; background: var(--tape); transition: inline-size .2s; }

/* ============ אנשי קשר — שורה מתקפלת ============ */

.contact { position: relative; background: var(--card); border-block-end: 1px solid var(--rule-soft); }
.contact:last-child { border-block-end: 0; }

.contact > details > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  min-height: 58px; padding: 8px 15px;
}
.contact > details > summary::-webkit-details-marker { display: none; }
.contact.has-phone > details > summary { padding-inline-end: 74px; }
.contact > details > summary:hover { background: #FDFCF9; }
.c-name { flex: 1; min-width: 0; font-size: 1.05rem; }
.c-caret { color: var(--ink-3); flex: none; transition: transform .15s; }
.contact > details[open] > summary .c-caret { transform: rotate(180deg); }

.call-abs { position: absolute; inset-inline-end: 13px; top: 5px; }

/* הגוף מתחיל מתחת לכפתור החיוג (שנגמר ב-53px), ולכן משתמש בכל הרוחב */
.c-body { padding: 0 15px 14px; display: grid; gap: 7px; }
.c-line { display: flex; gap: 10px; align-items: baseline; }
.c-line.stack { flex-direction: column; gap: 1px; align-items: stretch; }
.c-line.stack .c-key { width: auto; }
.c-key { flex: none; width: 62px; font-size: .85rem; color: var(--ink-3); }
.c-val { min-width: 0; overflow-wrap: anywhere; }
.c-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-block-start: 4px; }
.c-actions .btn { text-decoration: none; }
