:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #1d4ed8;
  --primary-soft: #e0e8ff;
  --on-primary: #ffffff;
  --elec: #d97706;
  --elec-soft: #fef3c7;
  --water: #0284c7;
  --water-soft: #e0f2fe;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --font: 'Heebo', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #131b2e;
    --surface-2: #1a2338;
    --border: #273248;
    --text: #e5e9f2;
    --muted: #94a3b8;
    --primary: #6d8dff;
    --primary-soft: #1e2b55;
    --on-primary: #0b1120;
    --elec: #fbbf24;
    --elec-soft: #3a2c0b;
    --water: #38bdf8;
    --water-soft: #0b3045;
    --ok: #4ade80;
    --ok-soft: #10331f;
    --warn: #fbbf24;
    --warn-soft: #3a2c0b;
    --danger: #f87171;
    --danger-soft: #3b1414;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
svg {
  width: 20px;
  height: 20px;
  flex: none;
}
a {
  color: var(--primary);
  text-decoration: none;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}
h1 {
  font-size: 1.5rem;
  font-weight: 800;
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
h3 {
  font-size: 1rem;
  font-weight: 700;
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.num {
  font-variant-numeric: tabular-nums;
  direction: rtl;
  unicode-bidi: isolate;
}
[hidden] {
  display: none !important;
}

/* ---------- סרגל עליון וניווט ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #fff;
}
.brand-mark svg {
  width: 15px;
  height: 15px;
}
.brand-mark svg:first-child {
  color: #fde047;
}
.nav {
  display: flex;
  gap: 4px;
  margin-inline-start: auto;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.nav a.nav-new {
  background: var(--primary);
  color: var(--on-primary);
}

@media (max-width: 760px) {
  .topbar {
    padding: 10px 16px;
    padding-top: max(10px, env(safe-area-inset-top));
  }
  .nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    justify-content: space-around;
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }
  .nav a {
    flex-direction: column;
    gap: 2px;
    padding: 6px 4px;
    font-size: 0.7rem;
    flex: 1;
    text-align: center;
  }
  .nav a svg {
    width: 22px;
    height: 22px;
  }
  .nav a.nav-new {
    background: none;
    color: var(--primary);
  }
  .nav a.nav-new svg {
    width: 44px;
    height: 44px;
    padding: 10px;
    margin-top: -22px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
  }
  .nav a.active {
    background: none;
  }
  .view {
    padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
  }
}

/* ---------- פריסה ---------- */
.view {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: 12px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 640px) {
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .grid-2.collapse {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-head .spacer {
  flex: 1;
}

/* ---------- טפסים ---------- */
label.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 0;
}
.input,
select.input,
textarea.input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}
textarea.input {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}
.input,
.input::placeholder {
  text-align: right;
}
/* מספרים וטקסט באנגלית נכתבים משמאל לימין, אבל מיושרים לימין כמו שאר הטופס */
input[type='number'].input,
input[dir='ltr'].input {
  direction: ltr;
  text-align: right;
}
/* תאריכים: סמל לוח השנה בצד שמאל והתאריך מימין (באייפון התאריך נצמד שמאלה בלי ההגדרה השנייה) */
input[type='date'].input {
  direction: rtl;
  text-align: right;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}
input[type='date'].input::-webkit-date-and-time-value {
  text-align: right;
}
/* תווית ארוכה שנשברת לשתי שורות לא מורידה את השדה שלה מתחת לשדה השכן */
.section-body .grid {
  align-items: end;
}
/* שדה עם יחידה (קוט"ש, מ"ק, ₪, %): המסגרת על העטיפה, והיחידה בצד ימין, צמודה למספר */
.input-suffix {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.input-suffix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--surface);
}
.input-suffix .input,
.input-suffix .input:focus {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 10px 0;
}
.input-suffix span {
  order: -1;
  flex: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
}
/* תיבת סימון עם אזור הקשה נוח (44 פיקסלים) */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  padding: 0 8px;
  margin: 0 -8px;
  border-radius: 10px;
}
.checkbox:active {
  background: var(--surface-2);
}
.checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}
.card-head .checkbox {
  background: var(--surface-2);
  margin: 0;
  padding: 0 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s,
    transform 0.05s;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.danger {
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger-soft);
}
.btn.ghost {
  background: none;
  border-color: transparent;
}
.btn.small {
  padding: 6px 10px;
  font-size: 0.85rem;
}
.btn.icon {
  padding: 8px;
}
.btn.block {
  width: 100%;
}
.btn.whatsapp {
  color: #128c4b;
}

/* ---------- אזורי חישוב ---------- */
.section-card {
  border-top: 4px solid var(--border);
}
.section-card.elec {
  border-top-color: var(--elec);
}
.section-card.water {
  border-top-color: var(--water);
}
.section-card.off .section-body {
  display: none;
}
.section-card h2 {
  white-space: nowrap;
}
.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.elec .section-icon {
  background: var(--elec-soft);
  color: var(--elec);
}
.water .section-icon {
  background: var(--water-soft);
  color: var(--water);
}
.section-icon.elec {
  background: var(--elec-soft);
  color: var(--elec);
}
.section-icon.water {
  background: var(--water-soft);
  color: var(--water);
}
.section-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sub-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: -4px;
}

/* חיובים נוספים וחישוב יחסי */
.extras {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.extras:empty {
  display: none;
}
.extra-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.prorate-box {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 4px 12px 12px;
}
.prorate-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.calc-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px;
}
@media (max-width: 520px) {
  .calc-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.calc-result .k {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.calc-result .v {
  font-size: 1.05rem;
  font-weight: 700;
}
.calc-result .v.big {
  color: var(--primary);
}

.alert {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
}
.alert svg {
  margin-top: 2px;
}
.alert.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.alert.error {
  background: var(--danger-soft);
  color: var(--danger);
}
.alert.info {
  background: var(--primary-soft);
  color: var(--primary);
}
.alert.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.extract-banner {
  cursor: pointer;
  align-items: center;
}
.extract-banner > span:first-of-type {
  flex: 1;
}

/* ---------- תמונות ---------- */
.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}
.photo {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}
.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.photo select {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: 6px 8px;
  font-size: 0.8rem;
  background: var(--surface);
}
.photo .remove {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 5px;
  cursor: pointer;
  display: flex;
}
.photo .remove svg {
  width: 16px;
  height: 16px;
}
.photo-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 130px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
  padding: 8px;
}
.photo-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.photo-add svg {
  width: 26px;
  height: 26px;
}

/* ---------- סכום כולל ---------- */
.total-bar {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.15);
  padding: 12px 16px;
}
@media (max-width: 760px) {
  .total-bar {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}
.total-bar .total {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
}
.total-bar .actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}

/* ---------- רשימות ---------- */
.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
}
a.list-item:hover {
  border-color: var(--primary);
}
.list-item .main {
  flex: 1;
  min-width: 0;
}
.list-item .title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item .meta {
  font-size: 0.85rem;
  color: var(--muted);
}
.list-item .amount {
  font-weight: 800;
  font-size: 1.05rem;
}
.list-item .side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.type-icons {
  display: flex;
  gap: 4px;
}
.type-icons span {
  display: inline-flex;
  padding: 6px;
  border-radius: 8px;
}
.type-icons .e {
  background: var(--elec-soft);
  color: var(--elec);
}
.type-icons .w {
  background: var(--water-soft);
  color: var(--water);
}
.type-icons svg {
  width: 16px;
  height: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.chip svg {
  width: 14px;
  height: 14px;
}
.chip.open {
  background: var(--warn-soft);
  color: var(--warn);
}
.chip.paid {
  background: var(--ok-soft);
  color: var(--ok);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat .k {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}
.stat .v {
  font-size: 1.4rem;
  font-weight: 800;
}

/* דף הבית: כרטיסים מהירים וסטטיסטיקה */
.quick {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}
.quick > div {
  min-width: 0;
}
.quick:hover {
  border-color: var(--primary);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.stats .stat + .stat {
  border-inline-start: 1px solid var(--border);
  padding-inline-start: 12px;
}

/* חישוב חדש: בחירת חשמל, מים או שניהם */
.type-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.type-choice .quick {
  padding: 20px;
}
.type-choice-icons {
  display: flex;
  gap: 6px;
}

.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
}
.empty svg {
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  opacity: 0.5;
}

.tabs {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.tabs button {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th,
.table td {
  text-align: start;
  padding: 9px 8px;
  border-bottom: 1px solid var(--border);
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}
.table-wrap {
  overflow-x: auto;
}

.chart {
  width: 100%;
  height: 180px;
  display: block;
}
.chart text {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

/* ---------- התחברות ---------- */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 20% 0%, rgba(14, 165, 233, 0.18), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(29, 78, 216, 0.18), transparent 50%), var(--bg);
}
.auth .card {
  width: 100%;
  max-width: 400px;
  padding: 28px;
}
.auth .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin: 0 auto 14px;
  display: flex;
}
.auth .brand-mark svg {
  width: 22px;
  height: 22px;
}
.auth h1 {
  text-align: center;
}
.auth p.lead {
  text-align: center;
  margin: 6px 0 22px;
}

/* ---------- חלון קופץ ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fade 0.15s;
}
.modal {
  background: var(--surface);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal.wide {
  max-width: 900px;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  flex: 1;
}
.modal-body {
  padding: 18px;
  overflow: auto;
}
.modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes sheet {
  from {
    transform: translateY(40px);
    opacity: 0.6;
  }
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  transform: translateX(-50%);
  top: calc(68px + env(safe-area-inset-top));
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  max-width: calc(100vw - 32px);
}
.toast.error {
  background: var(--danger);
}
@media (min-width: 761px) {
  .toast {
    top: 76px;
  }
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading {
  display: flex;
  justify-content: center;
  padding: 48px;
  color: var(--muted);
}
.loading .spinner {
  width: 28px;
  height: 28px;
}

.install-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
}
.install-banner .btn {
  background: #fff;
  color: #1d4ed8;
  border-color: #fff;
}
.install-banner svg {
  width: 28px;
  height: 28px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    inset: 0;
  }
}

/* ---------- טלפון ---------- */
@media (max-width: 560px) {
  .page-head {
    margin-bottom: 12px;
  }
  .page-head h1 {
    font-size: 1.35rem;
  }
  .page-head .actions {
    width: 100%;
    gap: 6px;
  }
  .page-head .actions .btn,
  .page-head .actions .chip {
    padding: 7px 10px !important;
    font-size: 0.82rem;
  }
  .page-head .actions .btn svg {
    width: 16px;
    height: 16px;
  }

  .section-card .card-head {
    gap: 8px;
  }
  .section-card h2 {
    font-size: 1.05rem;
  }
  .card-head .checkbox {
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .extract-banner {
    flex-wrap: wrap;
  }
  .extract-banner > span:first-of-type {
    flex: 1 1 calc(100% - 32px);
  }
  .extract-banner .btn {
    width: 100%;
    background: var(--surface);
  }
  .extra-row {
    grid-template-columns: minmax(0, 1fr) 110px auto;
    gap: 6px;
  }

  .total-bar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 10px;
  }
  .total-bar .total {
    font-size: 1.2rem;
  }
  .total-bar .actions {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .total-bar .actions .btn {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .total-bar .actions .btn:not(.primary) svg {
    display: none;
  }

  .list-item {
    padding: 12px;
    gap: 10px;
  }
  .type-icons {
    flex-direction: column;
    gap: 3px;
  }
  .type-icons span {
    padding: 5px;
  }

  .quick {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
  }
  .type-choice {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .type-choice .quick {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 16px;
  }
  .stats {
    gap: 8px;
    padding: 14px 10px;
  }
  .stats .stat + .stat {
    padding-inline-start: 8px;
  }
  .stats .stat .v {
    font-size: 1.05rem;
  }
  .stats .stat .k,
  .stats .stat .small {
    font-size: 0.72rem;
  }

  /* חלון קופץ: גיליון שעולה מלמטה */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: none;
    border-radius: 18px 18px 0 0;
    max-height: calc(100dvh - 24px);
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet 0.2s ease-out;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-foot {
    padding: 12px 16px;
  }
  .modal-foot .btn {
    flex: 1;
  }
}
