

* { box-sizing: border-box; }

.card-clickable {
  cursor: pointer;
}

.card-breakdown {
  margin-top: 10px;
}

.card-breakdown summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
}

.card-breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.card-breakdown-row:last-child {
  border-bottom: none;
}

.card-breakdown-row .label {
  color: var(--text-muted);
}

.card-breakdown-row .value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.chart-pair {
  display: grid;
  /* min(360px, 100%): on a phone (390px viewport minus padding) a fixed 360px
     minimum overflowed the page (MOB-0, docs/mobile-plan.md stage 1). */
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 24px;
}

.chart-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 8px;
}

/* "עודכן לפני X ימים" alongside a date value (accounts / pension savings
   tables) — a block under the date rather than inline text, so it doesn't
   compete with the date's own font size or push the column wider. */
.freshness-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

/* M10: counterparty ("תאור מורחב") shown as a second line under a
   transaction's description — same treatment as .freshness-note, kept as its
   own class since it labels a different kind of value. */
.txn-counterparty-note,
.txn-group-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

/* UX-3: a long header note collapsed into an ⓘ button (compactLongSectionNotes). */
.info-btn {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  vertical-align: middle;
}

.info-btn:hover,
.info-btn[aria-expanded="true"] {
  color: var(--attention-text);
  background: var(--surface-sub);
}

.section-note-expanded {
  font-size: 13px;
  color: var(--text-strong-body);
  background: var(--surface-sub);
  border-inline-start: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: -4px 0 12px;
}

.section-note-expanded.hidden {
  display: none;
}

.chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.chart-wrap svg {
  display: block;
  font-family: inherit;
  /* Chart geometry (axis at the left, text-anchor start/end) is written in
     LTR terms; inherited RTL flipped text-anchor, so y-axis labels spilled
     over the bars (found 2026-09-28 on the monthly-spending chart). */
  direction: ltr;
}

.chart-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 12px 0;
}

.chart-axis-label {
  font-size: 11px;
  fill: var(--text-muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 12px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.alerts h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* A small icon box (settings nav, wizard step): a Lucide icon on a neutral square. */
.section-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sub);
  color: var(--accent);
  flex-shrink: 0;
}
.st-nav-item .section-icon { background: none; }

/* Backup and system status (settings): up to date is plain, overdue needs attention (amber). */
.freshness-ok { color: var(--text-muted); }
.freshness-stale { color: var(--attention-text); font-weight: 500; }
.freshness-very-stale { color: var(--attention); font-weight: 600; }

/* How old a figure is (M3, owner request 2026-10-12; freshnessInfo in app.js): grey while fresh, orange from the orange
   threshold, red from the red one. Red here is the owner's explicit choice for a figure too old to rely on. */
.freshness-muted { color: var(--text-muted); }
.freshness-warn { color: var(--attention); font-weight: 600; }
.freshness-old { color: var(--expense); font-weight: 600; }
/* on a phone the date only when it needs attention (owner decision 2026-10-12) */
@media (max-width: 640px) {
  .freshness-note.freshness-muted { display: none; }
}

.fee-offers-table {
  font-size: 13px;
}

.dup-context {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
}

.dup-context.hidden {
  display: none;
}

.dup-context-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
}

.dup-context-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.dup-context-target {
  background: var(--attention-bg);
  font-weight: 600;
}

.alert-group-details {
  margin: 8px 0 0;
  padding-inline-start: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.import-summary-list {
  margin: 6px 0 0;
  padding-inline-start: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Modal "close" (dismiss) button, system-wide (2026-09-24 UI unification —
   previously insurance-only styling, now applied to every modal). */

.add-row-buttons {
  margin-top: 14px;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
}

.add-form {
  margin-top: 14px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
}

.add-form.hidden {
  display: none;
}

.add-form label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-muted);
  gap: 4px;
}

.add-form .form-actions {
  display: flex;
  gap: 8px;
}

.form-error {
  color: var(--expense);
  font-size: 12px;
  grid-column: 1 / -1;
}

#mislaka-decisions {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mislaka-decision-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

/* What saving does with each product (owner request M1): a word in a tag, and the same colour on the row's edge */
.mislaka-decision-row[data-outcome] { border-inline-start: 3px solid var(--border-strong); padding-inline-start: 10px; }
.mislaka-decision-row[data-outcome="new"] { border-inline-start-color: var(--income-bar); }
.mislaka-decision-row[data-outcome="update"] { border-inline-start-color: var(--accent); }
.mislaka-decision-row[data-outcome="ask"] { border-inline-start-color: var(--attention); }
.mislaka-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* "לא פעיל" / "מבוטל" next to a fund's provider (reportStatusChipHtml): grey, a fact from the report, not a warning */
.status-chip { display: inline-block; font-size: var(--fs-label); font-weight: 600; padding: 1px 8px; border-radius: var(--radius-sm); background: var(--surface-sub); color: var(--text-body); white-space: nowrap; vertical-align: middle; }
.mislaka-tag { font-size: var(--fs-label); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-sm); background: var(--surface-sub); color: var(--text-body); white-space: nowrap; }
[data-outcome="new"] > .mislaka-row-head .mislaka-tag { background: var(--income-soft); color: var(--income); }
[data-outcome="update"] > .mislaka-row-head .mislaka-tag { background: var(--row-selected); color: var(--accent); }
/* amber is for what needs the family's attention (the open question), not for a product that is simply skipped (R6-06) */
[data-outcome="ask"] > .mislaka-row-head .mislaka-tag { background: var(--attention-bg); color: var(--attention-text); }
.mislaka-delta { font-size: 13px; color: var(--text-body); }
.mislaka-plan { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.mislaka-plan:empty { display: none; }
.mislaka-delta:empty { display: none; }
.mislaka-result { display: flex; flex-direction: column; gap: 8px; }
.mislaka-result-group { border-inline-start: 3px solid var(--border-strong); padding-inline-start: 10px; font-size: 13px; }
.mislaka-result-group[data-outcome="created"] { border-inline-start-color: var(--income-bar); }
.mislaka-result-group[data-outcome="updated"] { border-inline-start-color: var(--accent); }
.mislaka-result-group summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.mislaka-result-group ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mislaka-result-why { color: var(--text-body); margin-top: 2px; }
.mislaka-not-in-report { margin-top: 12px; border-inline-start: 3px solid var(--attention, var(--border-strong)); padding-inline-start: 10px; font-size: 13px; }
.mislaka-not-in-report ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mislaka-not-in-report-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mislaka-not-in-report-done { color: var(--text-muted); }
.mislaka-not-in-report-row.is-decided .mislaka-not-in-report-name { color: var(--text-muted); }

.mislaka-action-select {
  max-width: 420px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
}

@keyframes search-target-flash {
  0%, 100% { background: transparent; }
  30% { background: var(--attention-bg); }
}

.search-target-highlight {
  animation: search-target-flash 2.5s ease;
}

/* Row/modal action-icon buttons, system-wide (2026-09-24 UI unification —
   originally built for insurance only as a minimalist line-icon alternative
   to a plain-emoji `.edit-icon-btn`; that older class had no remaining
   users after the rollout and was removed). */

.insurance-clip-icon {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-start: 4px;
  color: var(--text-muted);
}

.insurance-clip-icon svg {
  width: 13px;
  height: 13px;
}

.documents-list .document-name svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-inline-end: 2px;
  color: var(--text-muted);
}

input[type="file"].hidden {
  display: none;
}

/* A missing field's table cell is highlighted individually (not the whole
   row) and is clickable — jumps to that field in the edit modal. */
.missing-field-cell {
  background: var(--attention-row);
  cursor: pointer;
}

.missing-field-cell:hover {
  background: var(--attention-bg);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-muted);
  gap: 4px;
}

.modal-body label.checkbox-label {
  flex-direction: row;
  align-items: center;
}

#decisions-modal details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 500;
  margin-top: 12px;
}

/* Edit-modal field grid, system-wide (2026-09-24 UI unification — built for
   insurance first: fields in a 2-column grid instead of one long vertical
   list, and a wider box so the grid has room; now the standard layout for
   every modal with more than 1-2 fields). `.modal-grid-full` lets one field
   (e.g. a textarea, or a checkbox) span both columns. */

.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.modal-grid-full {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  .modal-grid {
    grid-template-columns: 1fr;
  }
}

.modal-divider {
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* P-11 שלב A: read-only field grid inside the entity-details-modal, same
   layout rhythm as .modal-grid (which pairs a <label> with an <input>) but
   for plain text — a row is display, not a field to edit. */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-bottom: 4px;
}

.details-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.details-field-full {
  grid-column: 1 / -1;
}

.details-label {
  font-size: 12px;
  color: var(--text-muted);
}

.details-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.details-value-link {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}

.details-value-link:hover {
  color: var(--accent-hover);
}

@media (max-width: 560px) {
  .details-grid {
    grid-template-columns: 1fr;
  }
}

/* A row that opens the entity-details-modal on click (openEntityDetailsPanel).
   Buttons/links/missing-field-cells inside it stop the click from also
   opening the details panel (see makeRowClickable in app.js). */
.details-row {
  cursor: pointer;
}

.modal-subheader {
  font-weight: 700;
  font-size: 13px;
}

.documents-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.documents-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.documents-list .document-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.documents-list .document-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Generic show/hide. Until 2026-09-30 this listed a few selectors only, so
   every other element toggled with .hidden stayed on screen: the decisions
   badge always showed "0", the lens delete button showed with no lens, and
   empty error boxes sat under forms. The class now always wins. */
.hidden {
  display: none !important;
}

.backup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
}

/* UI-1: system-styled replacement for native confirm()/alert(). Above the
   other modals, since it can be opened from inside one. Two classes: components.css (loaded after this file) sets
   .modal-overlay to 100, which since 2026-10-05 put "יש שינויים שלא נשמרו" behind every window placed after it in
   index.html (UX round 6, R6-11). */
.modal-overlay.ui-dialog-overlay {
  z-index: 110;
}

/* ERR-1: one banner for every failed load/save (showAppError in app.js). */
.app-error-banner {
  position: fixed;
  bottom: 16px;
  inset-inline: 16px;
  margin-inline: auto;
  max-width: 640px;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--expense-tint);
  border: 1px solid var(--expense);
  color: var(--expense);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
}

.app-error-banner.hidden {
  display: none;
}
/* a notice, not a fault (showAppError's kind 'notice'): no red, nothing to send */
.app-error-banner[data-kind='notice'] {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.app-error-banner[data-kind='notice'] .app-error-copy { display: none; }

.app-error-copy {
  flex: none;
  padding: 4px 12px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.app-error-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  padding: 0 4px;
}

.txn-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  align-items: end;
  margin: 0 0 16px;
  padding: 12px;
  background: var(--surface-foot);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.txn-filters label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: var(--text-muted);
  gap: 4px;
}

.txn-filters .form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.txn-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 -20px -16px;
  padding: 10px 20px;
  background: var(--surface-foot);
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.category-rules-table {
  margin-top: 10px;
}

.rule-apply-preview-list {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
}

.rule-apply-preview-row {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.rule-apply-preview-row:last-child {
  border-bottom: none;
}

/* MOB-3 (docs/mobile-plan.md stage 4): tables → cards on a phone. Each
   <td> carries data-label (labelTableCells in app.js). The first cell is the
   card's title; empty-label cells (row actions) sit at the bottom. Sorting
   by column header isn't available in this layout (the header row is hidden). */
@media (max-width: 640px) {
  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) thead {
    display: none;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table),
  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) tbody,
  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) tr,
  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    white-space: normal;
    text-align: left;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td:first-child {
    font-weight: 700;
    font-size: 15px;
    text-align: right;
    justify-content: flex-start;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td:first-child::before,
  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td[data-label=""]::before {
    content: none;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td:last-child {
    border-bottom: none;
  }

  table:not(.family-table):not(.fw-table):not(.fw-sample):not(.txn-table):not(.recurring-table) td[data-label=""] {
    justify-content: flex-end;
  }

  /* Transaction filters: two per row (the free-text search spans both)
     instead of eight full-width rows before the first transaction. */
  .txn-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .txn-filters label,
  .txn-filters input,
  .txn-filters select {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .txn-filters > :first-child {
    grid-column: 1 / -1;
  }
}

/* MOB-3 (stage 4, transactions): the transactions list has its own two-line layout, see "Transactions page, round 9". */

/* MOB-2 (docs/mobile-plan.md stage 3): a ~44px touch target for the controls components.css doesn't size. */
@media (pointer: coarse) {
  .info-btn,
  .decisions-chip {
    min-width: 44px;
    min-height: 44px;
  }

  /* settings (UX round 9, J13): the folds, the file picker, and the plain links in a list */
  .st-details summary {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .backup-dest-row input[type='file'] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .attached-doc-name,
  .st-dl a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* P-10 (2026-09-28): overview analysis hub — analysis.js */
.analysis-coverage { margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.analysis-coverage ul { margin: 6px 0 0; padding-inline-start: 18px; }
.coverage-gap { color: var(--attention-text); }
.analysis-details { margin: 8px 0 16px; }
.analysis-details summary { cursor: pointer; color: var(--accent); font-size: 13.5px; }
.lens-toolbar { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.lens-toolbar .chart-range-row { flex-wrap: wrap; }
.lens-header { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.lens-kpis { flex: 1; margin-bottom: 8px; }
.lens-kpis .card { padding: 14px 16px; }
.lens-footnote { margin-top: 12px; }
.lens-group-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.lens-group-row input { flex: 1; }
.share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.share-label { width: 110px; flex-shrink: 0; font-size: 13px; color: var(--text-muted); }
.share-bar { display: flex; gap: 2px; flex: 1; height: 26px; border-radius: 6px; overflow: hidden; }
.share-seg { display: flex; align-items: center; justify-content: center; color: var(--on-accent); font-size: 12px; font-weight: 600; min-width: 2px; cursor: pointer; }

@media (max-width: 640px) {
  .share-label { width: 80px; }
  /* 44px touch target (MOB checks in scripts/mobile-smoke.mjs). */
  
}
.insights-list { margin: 8px 0 4px; padding-inline-start: 18px; font-size: 13.5px; line-height: 1.7; }
.insights-list li { margin-bottom: 6px; }

/* P-12: שוק ההון — מקטע לכל סוג השקעה, ופירוט אחזקות שנפתח מתחת לשורה. */
.add-form-subgrid { display: contents; }
.add-form-full { grid-column: 1 / -1; }
.add-form select#new-investment-kind { max-width: 320px; }
.ira-candidates { display: flex; flex-direction: column; gap: 8px; }
.ira-candidate { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }

.twin-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.twin-link:hover { text-decoration: underline; }
.holdings-toggle { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.holdings-toggle .icon { transition: transform 0.15s; }
.holdings-toggle[aria-expanded="false"] .icon { transform: rotate(90deg); }
.holdings-row > td { background: var(--bg); padding: 12px 16px; }
.holdings-panel { display: flex; flex-direction: column; gap: 10px; }
.holdings-table { width: 100%; font-size: 13px; background: var(--surface); border-radius: var(--radius); }
.holdings-table th { font-size: 12px; }
.holdings-table .positive { color: var(--income); font-weight: 600; }
.holdings-table .negative { color: var(--text); font-weight: 600; } /* red is for KPIs, totals and errors */
.holdings-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .holdings-row > td { padding: 8px 0; }
  .holdings-table { background: transparent; }
  /* 44px touch targets (MOB checks in scripts/mobile-smoke.mjs). */
  .twin-link { display: inline-flex; align-items: center; min-height: 44px; }
  
}
.import-notes { margin: 8px 0; padding-inline-start: 18px; font-size: 13px; line-height: 1.7; }
/* P-12 stage D: allocation — one-hue ranked bars (dataviz: magnitude → bar).
   Thin (≤24px), 4px rounded data-end, square at the baseline (the start side in RTL). */
.allocation-list { position: relative; display: flex; flex-direction: column; gap: 10px; margin: 12px 0 8px; }
.allocation-row { display: grid; grid-template-columns: minmax(110px, 200px) 1fr auto; align-items: center; gap: 12px; }
.allocation-label { font-size: 13px; color: var(--text-muted); }
.allocation-track { height: 18px; }
.allocation-bar {
  display: block;
  height: 100%;
  background: var(--data-3);
  border-start-end-radius: 4px;
  border-end-end-radius: 4px;
}
.allocation-value { font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 640px) {
  .allocation-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .allocation-track { grid-column: 1 / -1; grid-row: 2; }
}
/* Five dimension buttons don't fit one line at 360px — they wrap instead of spilling off-screen. */
#brokerage-allocation .chart-range-row { flex-wrap: wrap; }

/* 2026-09-28: header actions (decisions center + settings). */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ---------- Overview: tiles that link to their page (2026-09-28) ---------- */
.overview-tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}

.card-link .card-value {
  font-size: 24px;
}

.card-link .card-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pending decisions = "needs attention": a light amber strip. Nothing pending: one quiet line. */
.decisions-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 24px;
  padding: 10px 16px;
  background: var(--attention-row);
  border: 1px solid var(--attention-border);
  border-radius: var(--radius);
  color: var(--attention-text);
  font-size: 14px;
}

.decisions-strip:empty {
  display: none;
}

.decisions-strip-icon { display: inline-grid; place-items: center; color: var(--attention); }
.decisions-strip-icon svg { width: 16px; height: 16px; }

.decisions-strip-ok {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-muted);
}

.decisions-strip-ok .decisions-strip-icon {
  color: var(--text-muted);
  font-weight: 600;
}

.decisions-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
}

.decisions-chip {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--attention-border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--attention-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--t-fast);
}

.decisions-chip:hover {
  background: var(--attention-bg);
}

/* ---------- Decisions center ---------- */
.undo-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 10px 12px 10px 16px;
  background: var(--heading);
  color: var(--on-accent);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  font-size: 14px;
}

.undo-toast.hidden {
  display: none;
}

.undo-toast .dup-btn {
  margin: 0;
  font-weight: 700;
}

/* ---------- Transactions page: to-dos next to the import button ---------- */
.notice-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--attention-border);
  background: var(--attention-row);
}

.notice-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.notice-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  font-size: 13.5px;
}

.notice-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.notice-list li:last-child {
  border-bottom: none;
}

.notice-actions {
  display: flex;
  gap: 6px;
}

.notice-actions .dup-btn {
  margin: 0;
}

.overview-tiles.overview-rows {
  grid-template-columns: 1fr;
  gap: 8px;
}

.overview-rows .card-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 20px;
  grid-template-areas:
    "icon label value arrow"
    "icon subs  value arrow";
  column-gap: 16px;
  align-items: center;
  padding: 12px 20px;
}

.overview-rows .card-link:hover {
  transform: none;
}

.overview-rows .card-icon {
  grid-area: icon;
  margin: 0;
}

.overview-rows .card-label {
  grid-area: label;
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.overview-rows .card-subs {
  grid-area: subs;
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  min-width: 0;
}

.overview-rows .card-value {
  grid-area: value;
  justify-self: end;
  font-size: 20px;
  margin: 0;
}

.overview-rows .card-link-arrow {
  grid-area: arrow;
  position: static;
}

/* ---------- Overview: the four-stage path (2026-09-30) ---------- */
.overview-stages {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.stage-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stage-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "num text"
    "meter meter";
  align-items: center;
  column-gap: 10px;
  row-gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-kpi);
  color: inherit;
  text-decoration: none;
  min-height: 44px;
}

.stage-step:hover {
  border-color: var(--accent);
}

.stage-step:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.stage-num {
  grid-area: num;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.stage-step.complete .stage-num {
  background: var(--accent);
  color: var(--on-accent);
}

.stage-step-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stage-step-text b {
  font-size: 15px;
}

.stage-step-text small {
  color: var(--text-muted);
  font-size: 12px;
}

.stage-meter {
  grid-area: meter;
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.stage-meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.stage {
  scroll-margin-top: 140px;
  /* A stage is a block inside the path card: a group band (like a group row in a table) on top, tiles inside. */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.stage:last-child { margin-bottom: 0; }
.stage > :not(.stage-head) { margin-inline: 16px; }

.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 16px;
  padding: 10px 16px;
  background: var(--group-row);
  border-bottom: 1px solid var(--border);
  color: var(--heading);
}

.stage-head .stage-num {
  align-self: center;
}

.stage-head h2 {
  margin: 0;
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--heading);
}
[data-tone] .stage-head .stage-question,
[data-tone] .stage-head .stage-count { color: var(--on-accent); }
.stage-head .stage-question,
.stage-head .stage-count { color: var(--text-body); }
.stage-head .info-btn { color: var(--text-body); }

.stage-question {
  flex: 1 1 auto;
  color: var(--text-muted);
  font-size: 14px;
}

.stage-count {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: 13px;
}

.stage-tiles {
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
}

.overview-rows .stage-tiles {
  grid-template-columns: 1fr;
  gap: 8px;
}

/* The budget question sits inside stage 1 until it is answered. */
.stage-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  background: var(--accent-tint);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
}

.stage-ask .section-note { color: var(--text-body); }

.stage-ask-actions {
  display: flex;
  gap: 8px;
  margin-inline-start: auto;
}

@media (max-width: 640px) {
  .stage-path {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stage-step {
    padding: 10px 12px;
  }

  .stage-count {
    margin-inline-start: 0;
    flex-basis: 100%;
  }

  .stage-ask-actions {
    margin-inline-start: 0;
  }
}

/* ---------- Monthly budget (2026-09-30) ---------- */
.budget-month {
  font-size: 1rem;
}

.budget-summary {
  margin: 10px 0;
}

.budget-scroll {
  overflow-x: auto;
}

.budget-income-title {
  margin: 18px 0 6px;
  font-size: 1rem;
}

.budget-table td.amount {
  white-space: nowrap;
}

.budget-muted {
  color: var(--text-muted);
}

.budget-input {
  width: 110px;
  min-height: 40px; /* 44px on a touch screen, below (R12-12) */
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.budget-bar {
  height: 6px;
  margin-top: 4px;
  border-radius: 3px;
  background: var(--surface-sub);
  overflow: hidden;
  min-width: 80px;
}

.budget-bar i {
  display: block;
  height: 100%;
  background: var(--data-3);
}

/* UX round 12 (J7). The card follows the month bar, so its head is the month alone (R12-03). */
.budget-month-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.budget-target { display: grid; gap: 4px; justify-items: start; }
.budget-error { max-width: 260px; }
.budget-input[aria-invalid="true"] { border-color: var(--expense); }
.budget-add { margin-top: 10px; }
/* The parent's name under a sub-category: only on a phone, where the rows are cards and the indent is gone (R12-17). */
.budget-parent-name { display: none; }
@media (pointer: coarse) {
  .budget-input { min-height: 44px; font-size: 16px; } /* a finger's target; 16px also keeps iOS from zooming (R12-12) */
}
@media (max-width: 640px) {
  /* a bar on the card's start edge (a margin would push the full-width card off the screen) */
  .budget-table tr.budget-child { box-shadow: inset -3px 0 0 var(--border-strong); }
  .budget-parent-name { display: inline; font-size: 12px; font-weight: 400; color: var(--text-muted); }
  .budget-parent-name::before { content: '· '; }
}

/* Over the family's own target: needs attention (amber), not "expense" red. */
.budget-bar.over i {
  background: var(--attention);
}

/* Phone: the overview is a quick scan, so tiles drop their icon. */
@media (max-width: 640px) {
  .overview-tiles {
    gap: 10px;
  }

  .overview-tiles .card-link {
    padding: 14px 18px;
  }

  .overview-tiles .card-icon {
    display: none;
  }

  .overview-rows .card-link {
    grid-template-columns: minmax(0, 1fr) auto 16px;
    grid-template-areas:
      "label value arrow"
      "subs  value arrow";
    column-gap: 12px;
  }

  .overview-rows .card-value {
    font-size: 17px;
  }

  .overview-rows .card-subs {
    flex-direction: column;
  }

  /* A nowrap sub-line (".card-link .card-sub") is a flex item that won't shrink below its
     text, so on a 390px phone the net-worth line ran under the value (seen 2026-09-30).
     Rows have room to grow in height, so the line wraps instead of being cut. */
  .overview-rows .card-sub {
    white-space: normal;
    max-width: 100%;
  }

  .overview-tiles .card-link-arrow {
    top: 14px;
  }
}

/* ---------- "saved" confirmation toast ---------- */
.saved-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 190;
  padding: 8px 16px;
  background: var(--heading);
  color: var(--on-accent);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  font-size: 14px;
  pointer-events: none;
}

.saved-toast.hidden {
  display: none;
}
.saved-toast-mark { display: inline-flex; vertical-align: -2px; margin-inline-end: 6px; }

/* ---------- empty table state ---------- */

@media (max-width: 640px) {
  tbody tr.empty-row,
  tbody tr.empty-row td {
    display: block;
    border: 0;
    box-shadow: none;
  }
}

.sortable-th:focus-visible,
.details-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.share-menu { position: absolute; z-index: 1000; min-width: 190px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.share-menu button { background: none; border: 0; text-align: right; padding: 9px 12px; border-radius: var(--radius); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; }
@media (pointer: coarse) { .share-menu button { min-height: 44px; } } /* a finger's target (UX round 11, R11-15) */
.share-menu button:hover, .share-menu button:focus-visible { background: var(--accent-tint); color: var(--accent-hover); outline: none; }

.report-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-bottom: 12px; }
.report-sections label, .report-amounts { display: flex; align-items: center; gap: 6px; }
.report-amounts { margin: 10px 0; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) { .report-sections { grid-template-columns: 1fr; } }
.modal-body .report-sections label, .modal-body label.report-amounts { flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; text-align: right; }
.modal-body .report-sections input, .modal-body label.report-amounts input { width: auto; margin: 0; flex: none; }
.report-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.report-row label { margin: 0; }
/* The parts are check boxes (a selection list), the amounts switches (owner, 2026-10-15). */
.modal-body .report-row input.report-part { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.modal-body .report-row label { flex-direction: row; align-items: center; gap: 8px; }
.modal-body .report-row .report-amt { color: var(--text-muted); font-size: 13px; }
.modal-body .report-row input { width: auto; margin: 0; flex: none; }
.report-sections { display: block; }
.report-sections-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 6px; }
.report-hint { color: var(--text-muted); font-size: 12px; margin: 8px 0 0; }
.report-selection-note { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--surface-sub); color: var(--text-strong-body); border-inline-start: 4px solid var(--border-strong); font-weight: 600; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.modal-body .report-selection-note label { flex-direction: row; align-items: center; gap: 8px; }
.modal-body .report-selection-note input { width: auto; margin: 0; }

.report-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 900; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-pop); padding: 8px 8px 8px 14px; font-size: 14px; font-weight: 600; }
tr.row-selected > td { background: var(--accent-tint); }
.report-bar.hidden { display: none; }
/* The bar opens the report window: it does not ride over that window or any other (UX round 11, R11-14). */
body:has(.modal-overlay:not(.hidden)) .report-bar { display: none; }
/* A finger's target in the report window (R11-15): the switch rows were 26px tall. */
@media (pointer: coarse) {
  .modal-body .report-row label, #report-amounts-all, #report-selection-clear { min-height: 44px; }
}

/* Setup wizard (wizard.js) — same building blocks as the rest of the app:
   .card-like sections, .section-icon chips, pill .dup-btn buttons, the
   modal form footer, and the tile accent stripe. */
#setup-modal .hidden { display: none !important; }

/* Overview card */
.setup-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
}
.setup-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.setup-head h2 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.setup-progress { height: 6px; background: var(--border); border-radius: 999px; margin: 14px 0 14px; overflow: hidden; }
.setup-progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s ease; }
.setup-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.setup-step { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.setup-step small { margin-inline-start: auto; color: var(--text-muted); font-size: 11.5px; font-weight: 600; }
.setup-step-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; text-align: start; }
.setup-step-btn:hover { color: var(--accent); }
/* Phone: the step name is the tap target, so it fills the row at touch height (smoke:mobile on an empty DB, 2026-10-01: 15px high). */
@media (pointer: coarse), (max-width: 640px) {
  .setup-step { padding-block: 0; }
  .setup-step-btn { min-height: 44px; display: inline-flex; align-items: center; flex: 1; }
}
.setup-mark { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; background: var(--attention-bg); color: var(--attention); }
.setup-done .setup-mark { background: var(--surface-sub); color: var(--text-strong-body); }
.setup-done small { color: var(--text-muted); }
.setup-skipped .setup-mark { background: var(--border); color: var(--text-muted); }
.setup-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.setup-actions .dup-btn { margin-inline-start: 0; }
.setup-cta { padding: 9px 22px; font-size: 13.5px; box-shadow: none; }
.setup-link-row { margin: 0 0 10px; display: flex; }
.setup-quick { font-size: 12.5px; color: var(--accent-hover); background: var(--accent-tint); border-color: transparent; margin-inline-start: 0; }

/* Wizard dialog */
.setup-box { max-width: 1000px; width: 96vw; }
/* `.modal-box.setup-box` outranks components.css's `.modal-box-wide` (640px), which loads later and used to win: the step
   tables (up to nine columns) scrolled sideways and the seventh tab was cut off (UX round 1, R1-05). Phones keep the
   full-screen window, and on a narrow desktop the tabs wrap instead of hiding a step. */
@media (min-width: 641px) {
  .modal-box.setup-box { width: min(1100px, 96vw); max-width: none; }
  .setup-tabs { flex-wrap: wrap; overflow-x: visible; }
}
.setup-tabs { list-style: none; display: flex; gap: 6px; margin: 0 0 12px; padding: 0 0 4px; overflow-x: auto; scrollbar-width: thin; }
.setup-tabs li { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 8px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--text-strong-body); cursor: pointer; font-size: 13px; white-space: nowrap; flex-shrink: 0; transition: background var(--t-fast), border-color var(--t-fast); }
.setup-tabs li:hover { background: var(--surface-sub); }
.setup-tabs li:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.setup-num { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--border); color: var(--text-muted); }
.setup-tabs li.setup-done .setup-num { background: var(--surface-sub); color: var(--text-strong-body); }
.setup-tabs li.setup-skipped { color: var(--text-muted); }
.setup-tabs li.active { background: var(--chip-on); border-color: var(--chip-on); color: var(--on-accent); }
.setup-tabs li.active .setup-num { background: var(--surface); color: var(--chip-on); }
#setup-bar { margin: 0 0 16px; height: 4px; }
.setup-step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.setup-step-head h3 { margin: 0; font-size: 16px; }
.setup-step-of { margin-inline-start: auto; font-size: 12px; color: var(--text-muted); }
.setup-hint { color: var(--text-muted); font-size: 13px; line-height: 1.6; margin: 0 0 12px; }

.setup-suggest { background: var(--attention-bg); border: 1px solid var(--attention-border); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 12px; font-size: 13px; }
.setup-suggest-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.setup-suggest-item + .setup-suggest-item { margin-top: 6px; }
.setup-suggest .link-btn { font-weight: 600; }

/* Import panels (bank statements / מסלקה) */
.setup-mislaka { background: var(--surface-foot); border: 1px solid var(--accent-tint); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.setup-mislaka > strong { display: block; font-size: 13.5px; }
.setup-mislaka-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 10px; }
.modal-body .setup-mislaka-row label { flex-direction: column; }
.setup-mislaka .dup-btn { margin-inline-start: 0; }
.setup-mislaka input[type=file]::file-selector-button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 4px 12px; margin-inline-end: 8px; font: inherit; font-size: 12px; cursor: pointer; }
.setup-mislaka input[type=file] { background: transparent; border-style: dashed; }
.setup-mislaka-block { border-top: 1px solid var(--accent-tint); margin-top: 12px; padding-top: 10px; }
.setup-mislaka-file { font-weight: 600; font-size: 13px; }
#setup-mislaka-decisions, .setup-mislaka-decisions { margin-top: 10px; }
.setup-mislaka .setup-actions { margin-top: 12px; }

/* Bulk-entry tools */
.setup-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.setup-tools .dup-btn { margin-inline-start: 0; font-size: 12.5px; color: var(--text); }
.setup-csv-label { cursor: pointer; flex-direction: row !important; align-items: center; display: inline-flex; }
.modal-body .setup-csv-label { font-size: 12.5px; color: var(--text); }
.setup-paste { background: var(--surface-foot); border: 1px solid var(--accent-tint); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.setup-paste textarea { width: 100%; box-sizing: border-box; margin: 6px 0 8px; }
.setup-paste .dup-btn { margin-inline-start: 0; }

/* Entry grid */
.setup-grid-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.setup-grid { width: 100%; border-collapse: collapse; }
.setup-grid th { text-align: right; font-size: 11.5px; font-weight: 600; color: var(--text-muted); padding: 9px 6px; white-space: nowrap; background: var(--surface-foot); border-bottom: 1px solid var(--border); }
.setup-grid td { padding: 5px 4px; border-bottom: 1px solid var(--border); }
.setup-grid tr:last-child td { border-bottom: 0; }
.setup-grid th:first-child, .setup-grid td:first-child { padding-inline-start: 10px; }
.setup-grid input, .setup-grid select { width: 100%; min-width: 92px; box-sizing: border-box; }
.setup-grid input[type=file] { min-width: 0; font-size: 11.5px; }
.setup-grid tr.setup-saved td { background: var(--surface-foot); }
.setup-grid tr.setup-saved input, .setup-grid tr.setup-saved select { opacity: 0.65; }
.setup-row-status { font-size: 12px; white-space: nowrap; min-width: 70px; }
.setup-status-text { margin-inline-start: 4px; }
.setup-row-ok { color: var(--text-muted); font-weight: 500; }
.setup-row-error { color: var(--expense); white-space: normal; font-weight: 500; }
.setup-row-remove { border: 0; background: none; color: var(--text-muted); cursor: pointer; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; }
.setup-row-remove:hover { color: var(--expense); background: var(--expense-tint); }
.setup-add-row { margin: 12px 0 0; border-style: dashed; color: var(--accent-hover); margin-inline-start: 0; }
#setup-error { margin-top: 12px; }
#setup-error.setup-note-ok { color: var(--text-strong-body); background: var(--surface-sub); border-color: var(--border); }

/* Footer: same as every modal's form footer */
.modal-body .setup-footer { flex-wrap: wrap; align-items: center; }
.setup-footer .dup-btn { margin-inline-start: 0; }

/* Summary */
#setup-summary h3 { margin: 6px 0 4px; font-size: 18px; }
.setup-summary-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; grid-template-columns: none; }
.setup-summary-list .setup-step { padding: 10px 12px; }
.setup-summary-list .setup-step small { font-size: 12px; }
#setup-summary .setup-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
#setup-summary .setup-actions .dup-btn-primary { padding: 10px 26px; font-size: 14px; box-shadow: none; }

/* Phones: every row becomes a card with labelled fields */
@media (max-width: 720px) {
  .setup-grid-wrap { border: 0; }
  .setup-grid thead { display: none; }
  .setup-grid, .setup-grid tbody, .setup-grid tr, .setup-grid td { display: block; width: 100%; }
  .setup-grid tr { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
  .setup-grid td, .setup-grid td:first-child { padding: 3px 0; border: 0; background: none; }
  .setup-grid td[data-label] { display: flex; flex-direction: column; gap: 2px; }
  .setup-grid td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--text-muted); }
  .setup-grid tr.setup-saved { background: var(--surface-foot); }
  .setup-grid input, .setup-grid select { min-width: 0; font-size: 16px; }
  .setup-row-status { display: flex; justify-content: space-between; align-items: center; flex-direction: row-reverse; }
  .setup-steps { grid-template-columns: 1fr 1fr; }
  .modal-body .setup-footer .dup-btn-primary { flex: 1 0 100%; }
  .setup-step-head h3 { font-size: 15px; }
  /* beat the app-wide phone table layout (bold first cell, no label) */
  table.setup-grid td, table.setup-grid td:first-child { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; border: 0; font-weight: 400; font-size: inherit; text-align: start; padding: 3px 0; }
  table.setup-grid td[data-label]::before, table.setup-grid td[data-label]:first-child::before { content: attr(data-label); font-size: 12px; font-weight: 400; color: var(--text-muted); text-align: start; }
  table.setup-grid td.setup-row-status { flex-direction: row-reverse; justify-content: space-between; align-items: center; }
  table.setup-grid td.setup-row-status::before { content: none; }
}
.setup-mislaka-block .setup-mislaka-row { align-items: center; }
.setup-grid input[type=file]::file-selector-button, .setup-csv-label input::file-selector-button { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 10px; margin-inline-end: 6px; font: inherit; font-size: 11.5px; cursor: pointer; }
.setup-grid input[type=file] { border-style: dashed; background: transparent; padding: 3px 6px; }

/* ---------- Decisions center (redesign) ----------
   A review queue: segmented tabs with counts, one progress line, and one
   compact card per decision (a comparison table, not paragraphs). Long
   explanations live once per tab or behind a "מה עושים?" toggle. */
#decisions-modal .modal-box { max-width: 720px; }

.dc-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; font-size: 13px; color: var(--text-muted); }
.dc-progress { flex: 1 1 120px; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.dc-progress i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.25s ease; }
.dc-summary-text strong { color: var(--text); }
.dc-summary-note { font-size: 12px; }
.dc-tab-note { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.dc-empty-icon { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: var(--radius); background: var(--surface-sub); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 20px; }

.dc-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px; background: var(--surface); box-shadow: var(--shadow-kpi); }
#decisions-body { display: flex; flex-direction: column; gap: 12px; }
.dc-group { border-inline-start: 4px solid var(--accent); }
.dc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0; border: 0; background: none; }
.dc-head h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.dc-kind { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.dc-kind-duplicates { background: var(--surface-sub); }
.dc-kind-transfers { background: var(--surface-sub); }
.dc-kind-alerts { background: var(--attention-bg); }

.dc-note { margin: -4px 0 10px; font-size: 12.5px; color: var(--attention); }

.dc-compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; background: var(--bg); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.dc-compare th, .dc-compare td { padding: 7px 12px; text-align: right; vertical-align: top; overflow-wrap: break-word; background: transparent; border: 0; text-transform: none; letter-spacing: 0; }
.dc-compare thead th:first-child, .dc-compare tbody th { width: 64px; }
.dc-compare thead th { font-size: 11.5px; font-weight: 600; color: var(--text-muted); padding-block: 8px 4px; }
.dc-compare tbody th { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.dc-compare tbody tr + tr > * { border-top: 1px solid var(--row-line); }
.dc-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-compare td.dc-diff { background: var(--attention-bg); }

.dc-route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.dc-arrow { color: var(--text-muted); }
.dc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.dc-stats > div { background: var(--bg); border-radius: var(--radius); padding: 8px 12px; }
.dc-stats dt { font-size: 11.5px; color: var(--text-muted); }
.dc-stats dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dc-message { margin: 0 0 12px; font-size: 13.5px; line-height: 1.6; }

.dc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dc-actions .dup-btn { margin-inline-start: 0; padding: 8px 18px; font-size: 13px; }
.dc-context-btn { margin-inline-start: auto; font-size: 12.5px; }
.dc-consequence { margin: 8px 0 0; font-size: 12px; color: var(--text-muted); }
.dc-details { margin-top: 10px; }
.dc-details > summary { cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 500; }
.dc-help { margin: 8px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.dc-nested { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.dc-nested .dc-card { box-shadow: none; }
.dc-help-lead { margin: 0 0 10px; color: var(--text); }
.dc-map-line { padding: 10px 0; border-top: 1px solid var(--border); }
.dc-map-text { margin: 0 0 8px; font-size: 13.5px; line-height: 1.6; }
.dc-map-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dc-map-controls select { min-width: 0; max-width: 100%; flex: 1 1 180px; }
.dc-items { list-style: none; margin: 8px 0 0; padding: 0; }
.dc-items li { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.dc-items li strong { font-variant-numeric: tabular-nums; }
.dc-items li .dup-btn { margin-inline-start: auto; }
.dc-more { align-self: center; margin: 0; }
@media (max-width: 640px) {
  .dc-stats { grid-template-columns: 1fr 1fr; }
  .dc-compare th, .dc-compare td { padding: 6px 8px; }
  .dc-compare tbody th { width: 48px; }
  .dc-actions .dup-btn-primary, .dc-actions .dup-btn { flex: 1 1 auto; }
  .dc-context-btn { flex-basis: 100%; text-align: center; }
}
@media (max-width: 640px) {
  /* keep the comparison a real table — beat the app-wide "tables → cards" rule */
  table.dc-compare { display: table; width: 100%; }
  table.dc-compare thead { display: table-header-group; }
  table.dc-compare tbody { display: table-row-group; }
  table.dc-compare tbody tr { display: table-row; border: 0; padding: 0; margin: 0; background: none; border-radius: 0; }
  table.dc-compare th, table.dc-compare td { display: table-cell; width: auto; padding: 6px 8px; border: 0; text-align: right; }
  table.dc-compare td::before { content: none; }
  table.dc-compare { font-size: 12.5px; }
  table.dc-compare thead th:first-child, table.dc-compare tbody th { width: 1%; white-space: nowrap; padding-inline: 8px 2px; }
  table.dc-compare td { white-space: nowrap; }
  table.dc-compare td:last-child, table.dc-compare td:nth-child(2) { white-space: normal; }
  
  
}

/* "Already there" list: collapsed, with suspected duplicates flagged */
.setup-existing { border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 12px; background: var(--surface-foot); }
.setup-existing > summary { cursor: pointer; padding: 9px 14px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.setup-existing-list { max-height: 260px; overflow-y: auto; padding: 0 14px 6px; display: flex; flex-direction: column; }
.setup-existing-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.setup-existing-row strong { font-weight: 600; margin-inline-end: 6px; }
.setup-existing-row .setup-chip { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); font-weight: 400; }
.setup-existing-dup { background: var(--attention-bg); margin-inline: -14px; padding-inline: 14px; }

#report-modal .hidden { display: none !important; }

/* ------------------------------------------------------------------ */
/* עמוד ההגדרות (2026-09-29): ניווט צדדי + קטע אחד בכל פעם.            */
/* ------------------------------------------------------------------ */

#page-settings .hidden {
  display: none !important;
}

.st-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.st-nav {
  position: sticky;
  top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-kpi);
  padding: 12px;
}

.st-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.st-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.st-nav-item:hover {
  background: var(--surface-sub);
}

.st-nav-item.active {
  background: var(--surface-sub);
  color: var(--text);
  font-weight: 500;
}
.st-nav-item.active .section-icon { color: var(--accent); }

.st-nav-item .section-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.st-content {
  min-width: 0;
}

.st-section > h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
  color: var(--heading);
}
.st-section > h2 .section-note { font-size: 13px; color: var(--text-muted); }

.st-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-kpi);
  padding: 16px 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Participation and support panel (settings): text stays compact, buttons keep their natural width. */
.st-support-card h3,
.st-support-card p {
  margin: 0;
}

.st-support-card .dup-btn {
  align-self: flex-start;
  text-decoration: none;
}

.st-support-card .section-note .dup-btn {
  align-self: auto;
  display: inline-block;
}

.st-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.st-field input[type="text"],
.st-field input[type="number"],
.st-field select {
  max-width: 320px;
}

.st-field small,
.st-switch small {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.st-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.st-msg {
  font-size: 13px;
  color: var(--text-strong-body);
}

.st-msg-error {
  color: var(--expense);
}

.st-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.st-subhead .chart-subtitle {
  margin: 0;
}

.st-members {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-kpi);
  display: flex;
  flex-direction: column;
}

.st-members:empty {
  display: none;
}

.st-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.st-member-row:last-child {
  border-bottom: 0;
}

.st-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-tint);
  color: var(--accent-hover);
  font-weight: 700;
}

.st-member-main {
  display: flex;
  flex-direction: column;
  min-width: 90px;
}

.st-member-rel {
  color: var(--text-muted);
  font-size: 12px;
}

.st-member-row .st-chips {
  flex: 1;
}

.st-member-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 600px) {
  .st-member-row {
    flex-wrap: wrap;
  }

  .st-member-row .st-chips {
    order: 3;
    flex-basis: 100%;
  }

  .st-member-actions {
    margin-inline-start: auto;
  }
}

.st-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.st-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.st-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 2px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.st-list-row:first-child {
  border-top: none;
}

.st-list-main {
  font-weight: 600;
  flex: 1 1 auto;
}

.st-list-sub {
  color: var(--text-muted);
  font-size: 12px;
  direction: ltr;
  unicode-bidi: plaintext;
}

.st-list-end {
  color: var(--text-muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.st-details summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 500;
}

.st-details ol {
  margin: 8px 0;
  padding-inline-start: 22px;
  line-height: 1.8;
  font-size: 13.5px;
}

.st-details code {
  direction: ltr;
  unicode-bidi: embed;
  background: var(--surface-sub);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.st-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.st-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-kpi);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.st-tile-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.st-tile-icon {
  font-size: 18px;
}

.st-tile-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.st-tile .section-note {
  margin: 0;
  flex: 1 1 auto;
}

.st-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.st-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.st-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 13px;
}

.st-table th,
.st-table td {
  padding: 8px 10px;
  text-align: start;
  border-bottom: 1px solid var(--border);
}

.st-table th {
  background: var(--bg);
  font-weight: 700;
  color: var(--text-muted);
}

.st-table td.num {
  font-variant-numeric: tabular-nums;
}

.st-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
}

.st-switch input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.st-switch span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.st-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.st-dl-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

.st-dl-row:first-child {
  border-top: none;
}

.st-dl dt {
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.st-dl dd {
  margin: 0;
  text-align: end;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .st-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Phone / narrow: the section list becomes a horizontal chip row. */
  .st-nav {
    position: static;
    padding: 8px;
  }

  .st-nav-list {
    flex-direction: row;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
  }

  .st-nav-list::-webkit-scrollbar {
    display: none;
  }

  .st-nav-item {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
  }

  .st-nav-item .section-icon {
    display: none;
  }

  .st-field input[type="text"],
  .st-field input[type="number"],
  .st-field select {
    max-width: none;
  }
}

/* Suggested lenses + fixed monthly cost (2026-09-30) */
.lens-templates { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.lens-templates:empty { display: none; }
.fixed-cost-total { margin-bottom: 16px; }
.fixed-cost-total-value { font-size: 32px; font-weight: 700; }
.fixed-cost-group { margin-bottom: 14px; }
.fixed-cost-group h3 { font-size: 14px; margin: 0 0 6px; }
.fixed-cost-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.fixed-cost-row.fixed-cost-off,
.fixed-cost-row.fixed-cost-off .section-note { color: var(--text-muted); } /* a switched-off row is dimmed by colour and a strike-through; opacity .55 left its text under 4.5:1 */
.fixed-cost-row.fixed-cost-off .fixed-cost-amount { text-decoration: line-through; }
.fixed-cost-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.fixed-cost-add { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.fixed-cost-add input[type="text"] { flex: 1; min-width: 160px; }
.fixed-cost-more { margin-top: 8px; }
.fixed-cost-more summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.fixed-cost-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 6px 14px; margin-top: 10px; }
.fixed-cost-category { display: flex; gap: 6px; align-items: center; font-size: 14px; }

/* Education layer (concepts.js): the ⓘ reuses .info-btn; the explanation is a
   small popover on desktop and a bottom sheet on a phone (as MOB-4 modals). */
body.concepts-off .concept-btn {
  display: none;
}

.concept-popover {
  position: absolute;
  z-index: 90;
  width: 320px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  text-align: right;
}

.concept-popover.hidden {
  display: none;
}

.concept-popover p {
  margin: 8px 0;
}

.concept-popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.concept-popover-note {
  color: var(--text-muted);
  background: var(--accent-tint);
  border-radius: var(--radius);
  padding: 6px 10px;
}

.concept-popover-fact {
  background: var(--accent-tint);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: 8px 0;
}

.concept-popover-fact small {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.concept-popover-fact a {
  color: var(--accent);
}

.concept-popover-links-label {
  font-weight: 700;
  margin-top: 10px;
}

.concept-popover-links {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
}

.concept-popover-links a {
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  padding: 3px 0;
}

.concept-popover-links a:hover {
  text-decoration: underline;
}

.concept-popover-article {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.concept-popover-article:hover {
  text-decoration: underline;
}

/* concepts.js externalMark(): a link that opens outside the app. */
.ext-mark { display: inline-flex; vertical-align: -2px; margin-inline: 4px; }

.concept-popover-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.concept-editor-box small,
.st-section #st-concepts-editor small {
  color: var(--text-muted);
}

.concept-ed-links-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.concept-ed-link {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr auto;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.concept-ed-link-actions {
  display: inline-flex;
}

.concept-ed-error {
  color: var(--expense);
  white-space: pre-line;
  font-size: 13px;
}

.concept-ed-error.hidden {
  display: none;
}

.concept-ed-over {
  color: var(--expense);
}

#st-concepts-editor {
  margin-top: 12px;
}

#st-concepts-editor.hidden {
  display: none;
}

@media (max-width: 640px) {
  .concept-popover {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    top: auto !important;
    left: 0 !important;
    width: auto;
    max-width: none;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  }

  .concept-popover-links a {
    padding: 10px 0; /* 44px touch target */
  }

  .concept-ed-link {
    grid-template-columns: 1fr;
  }
}

/* Backup destination (settings › data). */
.backup-dest {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.backup-dest-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.backup-dest-row input {
  flex: 1 1 260px;
  min-width: 0;
}

/* Side menu (public/sidemenu.js; z-index above the public demo banner, 99999): a drawer from the start edge (the right, in RTL), opened with the
   three-dots button in the header. Since the redesign (2026-10-05) it is the navigation below 1000px only (components.css, Header). */

.side-backdrop { position: fixed; inset: 0; background: var(--overlay); visibility: hidden; z-index: 100000; }
.side-backdrop.open { visibility: visible; }
.side-menu { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 86vw); background: var(--surface); border-inline-end: 1px solid var(--border); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; visibility: hidden; z-index: 100001; overflow-y: auto; }
.side-menu.open { visibility: visible; }
.side-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 20px; background: var(--surface-head); border-bottom: 1px solid var(--border); font-weight: 600; font-size: var(--fs-h2); color: var(--heading); }
.side-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--text-muted); cursor: pointer; border-radius: var(--radius); width: 44px; height: 44px; transition: background var(--t-fast); }
.side-close:hover { background: var(--surface-sub); color: var(--text); }
.side-menu-pages { display: flex; flex-direction: column; gap: 2px; padding: 8px; }
.side-menu a, .side-menu-actions button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius); text-decoration: none; color: var(--text-body); font: inherit; font-size: 15px; font-weight: 400; background: transparent; border: 0; width: 100%; text-align: start; cursor: pointer; transition: background var(--t-fast); }
.side-menu svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-muted); }
.side-menu a:hover, .side-menu-actions button:hover { background: var(--surface-sub); color: var(--text); }
.side-menu a.active { background: var(--surface-sub); color: var(--text); font-weight: 500; }
.side-menu a.active svg { color: var(--accent); }
.side-menu a:focus-visible, .side-menu-actions button:focus-visible, .side-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side-menu-actions { margin-top: auto; padding: 8px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }

/* Knowledge hub page (public/knowledge.js) */

.knowledge-article h3 { font-size: 1.05em; margin: 18px 0 4px; }
.knowledge-article p { line-height: 1.6; margin: 4px 0; }
.knowledge-lead { font-size: 1.05em; color: var(--text-muted); }
.knowledge-calc { margin: 8px 0 6px; }
.kn-links { padding-inline-start: 20px; margin: 6px 0 0; }
.kn-links li { margin: 0; }
/* A link is a whole row tall, not the 18px of its text: a phone's finger target (UX round 11, R11-05). */
.kn-links a { display: inline-flex; align-items: center; min-height: 44px; }
/* The concepts list (R11-03): one folded row per concept. */
.kn-concept { border-top: 1px solid var(--border); }
.kn-concept:last-of-type { border-bottom: 1px solid var(--border); }
.kn-concept > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; color: var(--heading); }
.kn-concept > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
.kn-concept[open] > summary { margin-bottom: 2px; }
.kn-concept > p { margin: 0 0 8px; }

/* Quick-setup modal on a phone: the import/paste/template buttons wrapped into a ragged 2+1 stack and the
   row-remove "x" was a 26px glyph floating under the fields (2026-10-01, Android review). */
@media (max-width: 640px) {
  .setup-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .setup-tools > * { justify-content: center; text-align: center; margin: 0; }
  .setup-tools > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .setup-row-remove { width: 44px; height: 44px; border: 1px solid var(--border); font-size: 16px; }
  .setup-add-row { width: 100%; justify-content: center; }
}

/* PWA (docs/pwa-ingestion-plan.md): shown when the data worker cannot open the
   database, e.g. when the app is already open in another window. A screen over the
   page, like the lock screen: the app under it never opened (UX round 10, R10-04). */
.pwa-fatal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  overflow-y: auto;
}
.pwa-fatal-card { display: grid; gap: 14px; }
body.pwa-fatal-shown > :not(.pwa-fatal) { display: none !important; }

/* PWA bars (src/pwa/boot.ts): a new version waits for the user; a backup reminder. */
.pwa-bar {
  position: fixed;
  inset-inline: 16px;
  bottom: 16px;
  /* under the windows (.modal-overlay 100, #import-modal 90), over the floating import button (80): a reminder used to
     sit bright on top of an open window */
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  margin-inline: auto;
  padding: 10px 12px 10px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-pop);
  font-weight: 600;
}

/* PWA lock screen (src/pwa/lockScreen.ts): password, recovery code. */
.pwa-lock {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  overflow-y: auto;
}

.pwa-lock-logo { width: 44px; height: 44px; } /* the brand mark (components.css) */

.pwa-lock-card p { margin: 0; line-height: 1.6; }
.pwa-lock-note { color: var(--text-muted); font-size: 14px; }
.pwa-lock-card form { display: grid; gap: 12px; }
.pwa-lock-field { display: grid; gap: 6px; font-weight: 600; }

.pwa-lock-error { color: var(--expense); font-weight: 600; min-height: 1em; }
.pwa-lock-error:empty { display: none; }

.pwa-welcome-lead { font-size: 17px; line-height: 1.7; margin: 0; }
.pwa-welcome-points { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.pwa-welcome-points li { padding: 10px 14px; border-radius: 12px; background: var(--accent-tint); line-height: 1.55; }
.pwa-welcome-demo { display: inline-flex; align-items: center; }
.pwa-lock-link { justify-self: start; min-height: 44px; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.pwa-lock-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pwa-lock-check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.pwa-lock-check input { width: 22px; height: 22px; }
.pwa-lock-code {
  display: block;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  font-size: clamp(17px, 5vw, 20px);
  user-select: all;
}
.pwa-update-dismiss { background: transparent !important; color: var(--on-accent) !important; border: 1px solid var(--on-accent) !important; }
/* "Install as an app" (src/pwa/install.ts): steps for the visitor's browser, others folded underneath. */
.pwa-install-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.65;
}
.pwa-install-dialog::backdrop { background: var(--overlay); }
.pwa-install-dialog h2 { margin: 0 0 8px; font-size: 20px; }
.pwa-install-dialog h3, .pwa-install-dialog h4 { margin: 14px 0 4px; font-size: 16px; }
.pwa-install-dialog ol { margin: 0; padding-inline-start: 22px; }
.pwa-install-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--surface-sub); color: var(--text-strong-body); border: 1px solid var(--border-strong); }
.pwa-install-dialog details { margin: 14px 0; }
.pwa-install-dialog summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; color: var(--accent); }
.pwa-install-dialog .pwa-lock-primary { margin-top: 8px; }
/* Printing from the recovery-code screen prints only that card, as a sheet to keep:
   the logo, the key, and the print-only lines (when it was issued, where to keep it). */
.pwa-print-only { display: none; }
@media print {
  body.pwa-locked > :not(.pwa-lock) { display: none !important; }
  .pwa-lock { position: static; background: none; }
  
  .pwa-lock-card button, .pwa-lock-check { display: none !important; }
  .pwa-lock-card .pwa-print-only { display: grid; gap: 10px; }
  .pwa-lock-card h1 + p { display: none; } /* the on-screen explanation; the sheet has its own */
  .pwa-lock-code { border: 2px solid var(--text); background: none; font-size: 22px; }
}
/* The fatal screen of the browser version: what happened, and what can still be done (boot.ts). */
.pwa-fatal-card p { font-weight: 600; }
.pwa-fatal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pwa-fatal-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.pwa-diag-box { display: block; width: min(560px, 100%); margin: 10px auto 0; font: 12px/1.5 monospace; }
/* More than one bar at once: only the most urgent shows, the rest wait (arrangeBottomBars in app.js). Fixed offsets for a
   second and third bar overlapped as soon as a bar's text wrapped to two lines. */
.pwa-bar[data-queued] { display: none; }
/* While a bar is up, the page can scroll its last fields out from under it (UX round 5: the install offer covered the
   new-asset form's save button on a phone). */
body:has(> .pwa-bar:not([data-queued])) { padding-bottom: 140px; }

/* Statement import (PWA plan S6): drop zone, one card per file, recent imports. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}



.import-new-account { display: grid; gap: 10px; }
.import-new-account .mu-btn-primary { justify-self: start; }

.import-batches-title { margin: 18px 0 6px; font-size: 15px; }
.import-batches-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.import-batch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.import-batch-main { font-weight: 600; overflow-wrap: anywhere; }
.import-batch-sub { color: var(--text-muted); font-size: 13px; flex: 1; }
.import-batches-all { display: inline-block; margin-top: 8px; font-size: 13.5px; }

/* The full import history in settings › ייבוא (docs/import-review-2026-10.md 2.6, public/import-history.js) */
.import-history { margin-bottom: 14px; }
.import-history-title { margin: 0 0 4px; font-size: 15px; }
.import-history-list { list-style: none; margin: 8px 0 0; padding: 0; }
.import-history-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.import-history-main { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.import-history-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.import-history-name { overflow-wrap: anywhere; }
.import-history-facts { color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }
.import-history-when { color: var(--text-muted); font-size: 12.5px; }
.import-history-blocked { color: var(--text-muted); font-size: 12.5px; flex: 0 1 220px; }
.import-history-more { margin-top: 10px; }

/* The coverage map on the accounts page (2.7): twelve month cells per account. A gap (a month no file reaches, between
   two that one does) is amber, and is also said in words under the row, so the map is not colour alone. */
.cov-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 10px; color: var(--text-muted); font-size: 12.5px; }
.cov-legend .cov-swatch { width: 14px; height: 14px; }
.cov-legend .cov-swatch:not(:first-child) { margin-inline-start: 8px; }
.cov-list { list-style: none; margin: 0; padding: 0; }
.cov-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 480px); align-items: center; gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.cov-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; overflow-wrap: anywhere; }
.cov-type { color: var(--text-muted); font-size: 12.5px; }
.cov-cells { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; direction: ltr; }
.cov-cell { display: flex; align-items: center; justify-content: center; height: 26px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-sub); color: var(--text-muted); font-size: 11px; line-height: 1; }
.cov-covered { border-color: var(--data-3); background: var(--data-3); color: var(--text); }
.cov-gap { border: 1.5px solid var(--attention); background: var(--attention-bg); color: var(--attention-text); font-weight: 600; }
.cov-note { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 12.5px; }
.cov-note-gap { color: var(--attention-text); }
@media (max-width: 640px) {
  .cov-row { grid-template-columns: minmax(0, 1fr); }
  .cov-cell { height: 24px; font-size: 10px; }
}

/* PWA plan S7: where each file is downloaded, with the family's own link */
.download-guides { margin-top: 14px; }
.download-guides > summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.download-guides-due { color: var(--attention-text); font-weight: 600; }
.download-guide-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.download-guide {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  display: grid;
  gap: 8px;
}
.download-guide-due { border-color: var(--attention-border); background: var(--attention-row); }
.download-guide-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.download-guide-status { color: var(--text-muted); font-size: 13px; }
.download-guide-due .download-guide-status { color: var(--attention-text); font-weight: 600; }
.download-guide-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 2px; }
.download-guide .form-actions { flex-wrap: wrap; }
.download-guide-editor { display: grid; gap: 8px; }
.download-guide-editor label { display: grid; gap: 4px; font-weight: 600; }
.download-guide-editor input { min-height: 44px; width: 100%; box-sizing: border-box; }

/* PWA plan S8: watch folder (public/watch-folder.js) */
.watch-folder { display: grid; gap: 8px; }
.watch-folder-line { margin: 0; overflow-wrap: anywhere; }

/* Monthly update (2026-10-04): one screen for bringing the month's files in. */
.mu-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; padding: 0; }
.mu-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.mu-steps b { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-size: 14px; }
.mu-steps span { display: grid; gap: 2px; font-weight: 700; line-height: 1.35; }
.mu-steps small { color: var(--text-muted); font-size: 12.5px; font-weight: 400; }
@media (max-width: 640px) { .mu-steps { grid-template-columns: 1fr; } }

/* dropping a file anywhere in the app */
.mu-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}


.import-structure { display: grid; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border); }
.import-structure-out { display: grid; gap: 8px; }
.import-structure-text { width: 100%; font: 12px/1.5 monospace; direction: rtl; text-align: right; }

/* what the month needs: one row per source, ticked off as its file is saved */
.mu-guides { margin-top: 14px; }
.mu-guides summary small { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.mu-more { margin-top: 14px; }
.mu-more > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
/* "where do I download a file": one drop-down list of institutions, the chosen one's panel below it */
.guide-picker { margin-top: 14px; display: grid; gap: 8px; }
.guide-picker-label { display: grid; gap: 4px; font-weight: 600; max-width: 420px; }
.guide-picker-label select { min-height: 44px; }
.guide-picker-panel { margin: 0; }
.guide-picker-panel:empty { display: none; }
.download-guide-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.download-guide-how > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: var(--accent); font-weight: 600; }
.download-guide-how { display: grid; gap: 8px; }
.download-guide-tick { font-weight: 800; }
.download-guide-tick-ok { color: var(--income); }
.download-guide-tick-due { color: var(--attention-text); }
.download-guide-top .form-actions { margin: 0; }
.download-guide { gap: 6px; }
.import-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* View-only device (device-transfer.js): a strip under the header, in the note colors, not fixed so it never covers content. */
.view-only-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 10px 16px;
  background: var(--surface-sub);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-strong-body);
  font-size: 14px;
  font-weight: 600;
}
.view-only-strip .dup-btn {
  min-height: 44px;
}
/* the same, at the top of an edit window (app.js noteViewOnly) */
.view-only-note {
  padding: 10px 16px;
  background: var(--surface-sub);
  border-bottom: 1px solid var(--border-strong);
  font-size: 14px;
  line-height: 1.5;
}
.view-only-note a { color: var(--accent); white-space: nowrap; }
.st-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-block: 8px;
}

/* ---------- Overview, top half (overview.js; design handoff "Dashboard") ---------- */
/* stretch: the recent-transactions card is as tall as the column beside it, with its footer at the bottom. With few rows it
   used to end early and leave a bare hole beside the cashflow card (UX round 1, R1-11). */
.overview-work { display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px; margin: 0 0 24px; }
.panel.overview-recent { flex: 1 1 640px; min-width: 0; margin: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.panel.overview-recent .card-head { margin: 0; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px 20px; }
.overview-recent-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.overview-recent-top h2 { margin: 0; font-size: var(--fs-h2); font-weight: 600; color: var(--heading); }
.overview-recent-top input { width: 200px; }
.overview-recent-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.panel.overview-recent > .table-wrap { width: 100%; margin: 0; flex: 1 1 auto; } /* the card has no padding: no full-bleed offset */
.overview-recent-table th:first-child, .overview-recent-table td:first-child { padding-inline-start: 20px; width: 92px; }
.overview-recent-table th:last-child, .overview-recent-table td:last-child { padding-inline-end: 20px; }
.overview-recent-desc { font-weight: 500; white-space: normal; min-width: 160px; }
.overview-recent-account { color: var(--text-body); }
.overview-recent .table-foot { border-radius: 0 0 var(--radius) var(--radius); }
.overview-aside { flex: 1 1 340px; max-width: 440px; min-width: min(300px, 100%); display: flex; flex-direction: column; gap: 24px; align-self: flex-start; }
.overview-aside .panel { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.overview-aside .panel > h2 { margin-bottom: 0; justify-content: space-between; }
.overview-aside .seg { margin: 0; align-self: flex-start; }
.page-disclaimer { margin: 0; font-size: 12px; color: var(--text-muted); }
@media (max-width: 999px) {
  .overview-aside { max-width: none; }
}
@media (max-width: 640px) {
  .overview-recent-top input { width: 100%; }
  .overview-recent-top .card-head-end, .overview-recent-top .input-search { width: 100%; }
  .overview-recent-top select { flex: 1; }
  /* the latest transactions on a phone: description and amount on top, date and category under them */
  .overview-recent-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'desc amount' 'date cat'; gap: 4px 12px; padding: 10px 12px; margin: 0; border: 0; border-bottom: 1px solid var(--row-line); border-radius: 0; }
  .overview-recent-table td, .overview-recent-table td:first-child { display: block; padding: 0; border: 0; width: auto; font-size: 14px; font-weight: 400; }
  .overview-recent-table td::before { content: none; }
  .overview-recent-table td:nth-child(1) { grid-area: date; font-size: 12px; text-align: right; }
  .overview-recent-table td:nth-child(2) { grid-area: desc; font-weight: 500; }
  .overview-recent-table td:nth-child(3) { grid-area: cat; text-align: left; }
  .overview-recent-table td:nth-child(4) { display: none; }
  .overview-recent-table td:nth-child(5) { grid-area: amount; }
}

/* Monthly cash flow: a pair of bars per month (income / expense), the newest month on the left (RTL). */
.cf-legend { display: flex; gap: 12px; font-size: 12px; font-weight: 400; color: var(--text-body); }
.cf-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cf-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.cf-income { background: var(--income-bar); }
.cf-expense { background: var(--expense-bar); }
.cf-flag-swatch { border-radius: 50%; background: var(--attention); }
.cf-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius); font-size: 12px; }
.cf-panel > div { display: flex; flex-direction: column; }
.cf-panel-end { align-items: flex-end; }
.cf-panel .num { font-size: 13px; }
.cf-panel strong.num { font-size: 15px; font-weight: 600; }
.amount-expense-total { color: var(--expense); }
body.privacy-on .amount-expense-total { color: var(--text-muted); }
.cf-bars-row { display: flex; align-items: stretch; justify-content: space-between; gap: 2px; height: 178px; }
.cf-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 0;
  border: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  font: inherit;
  cursor: default;
  transition: background var(--t-fast);
}
.cf-col.active { background: var(--surface-sub); }
.cf-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--border); }
.cf-bar { display: block; min-height: 1px; border-radius: 3px 3px 0 0; opacity: 0.45; }
.cf-col.active .cf-bar { opacity: 1; }
.cf-label { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.cf-col.active .cf-label { color: var(--text); }
.cf-flag { width: 6px; height: 6px; border-radius: 50%; }
.cf-flag.on { background: var(--attention); }
.cf-bars-row.dense .cf-label { font-size: 10px; }
.cf-note { margin: 0; font-size: 12px; color: var(--text-muted); }

/* The four-stage path, in its own card under the top half. */
.overview-path { overflow: visible; }
.overview-path .view-toggle { margin-bottom: 16px; }
.overview-path .stage-path { margin-bottom: 16px; }

/* ---------- Transactions page ---------- */
.txn-desc { white-space: normal; font-weight: 500; min-width: 180px; }
.txn-filters input, .txn-filters select { width: 100%; }
#txn-list-section { padding-bottom: 16px; }
.txn-category-select { max-width: 180px; height: 30px; }
.rule-suggestion { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem; }
.rule-suggestion input { max-width: 150px; }
.rule-suggestion small { flex-basis: 100%; color: var(--text-muted); }
.new-category-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.new-category-field input { max-width: 150px; }
.new-category-field small:empty { display: none; }
.new-category-field small { flex-basis: 100%; color: var(--expense); }

/* Insurance: the renewal date and, under it, how far it is ("בעוד 46 ימים"); amber within 60 days. */
.renewal-hint { display: block; font-size: 12px; color: var(--text-muted); }
.renewal-hint.soon { color: var(--attention); font-weight: 500; }
/* a policy with no renewal date (M3): a quiet tag that opens the edit form on that field */
.renewal-missing {
  border: 0;
  border-radius: 999px;
  padding: 2px 10px;
  background: var(--surface-sub);
  color: var(--text-body);
  font: inherit;
  font-size: var(--fs-small);
  cursor: pointer;
  white-space: nowrap;
}
.renewal-missing:hover { color: var(--accent); }
.renewal-missing:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* on a touch screen the tag is a full-size target (R8-08: it was 24px high) */
@media (pointer: coarse) {
  .renewal-missing { min-height: 44px; padding: 0 14px; }
  .insurance-calendar-btn { min-height: 44px; }
}
/* "הוספת תזכורת ליומן" under the renewal date in the policy window (R8-07) */
.insurance-calendar-btn { align-self: flex-start; margin-top: 4px; font-size: var(--fs-small); }

/* The column wizard (public/format-wizard.js) */
.fw { display: grid; gap: 12px; }
.fw-title { margin: 0; font-size: 17px; }
.fw-step { margin: 8px 0 0; font-weight: 700; }
.fw-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fw-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fw-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.fw-table .fw-pick { width: 36px; text-align: center; }
.fw-table .fw-header-row td { background: var(--surface-head); font-weight: 700; }
.fw-roles { display: grid; gap: 6px; max-width: 560px; }
.fw-role { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.fw-role-name { font-weight: 600; overflow-wrap: anywhere; }
.fw-role select, .fw-questions select, .fw-questions input[type=text] { min-height: 44px; }
.fw-questions { display: grid; gap: 10px; max-width: 560px; }
.fw-field { display: grid; gap: 4px; font-weight: 600; }
.fw-confirm { display: flex; align-items: flex-start; gap: 8px; }
.fw-sample { border-collapse: collapse; width: 100%; font-size: 13px; }
.fw-sample th, .fw-sample td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: start; }
.fw-sample .fw-amount { text-align: end; white-space: nowrap; }
.fw-errors { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.fw-facts { margin: 0; font-weight: 600; }
.fw-ok { margin: 0; color: var(--income); font-weight: 600; }
.fw-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fw-formats { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fw-format { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.fw-format-name { font-weight: 600; flex: 1; overflow-wrap: anywhere; }
/* stage 3 (import review 2026-10): the total-row check and the structure sent with the wizard's choices */
.fw-total { display: grid; gap: 4px; max-width: 560px; }
.fw-total-label { display: flex; align-items: flex-start; gap: 8px; }
.fw-total .section-note { margin: 0; }
.fw-report { display: grid; gap: 6px; max-width: 640px; }
.fw .link-btn { justify-self: start; }

/* The unified import box: a clearinghouse report reviewed inside its card (docs/unified-import-plan.md). */
.import-card-owner-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.import-card-owner {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  background: var(--surface);
}

.mislaka-review {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.mislaka-compare {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.mislaka-compare-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mislaka-compare-caption {
  min-width: 92px;
  color: var(--text-muted);
}



.missing-field-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ---------- Transactions page, round 9 (docs/transactions-redesign-plan.md §5) ---------- */
/* The month bar: month, the month's one-line summary, search and the filter button. Sticky under the app header
   (--app-header-h is set from the header's real height, app.js trackHeaderHeight). */
:root { --app-header-h: 0px; }
.txn-bar {
  position: sticky;
  top: var(--app-header-h);
  z-index: 20;
  display: grid;
  gap: 8px;
  margin: -12px 0 16px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.txn-bar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.txn-month { display: inline-flex; align-items: center; gap: 2px; }
.txn-month-btn {
  display: inline-grid;
  place-items: center;
  inline-size: 32px;
  block-size: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-body);
  cursor: pointer;
}
.txn-month-btn:hover:not(:disabled) { background: var(--surface-sub); color: var(--text); }
.txn-month-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.txn-month-btn:disabled { opacity: 0.35; cursor: default; }
.txn-month-label { min-inline-size: 8.5em; text-align: center; font-weight: 600; color: var(--heading); white-space: nowrap; }
.txn-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0; font-size: 14px; color: var(--text-body); }
.txn-summary b { font-weight: 600; color: var(--text); }
.txn-summary-sep { color: var(--text-faint); }
.txn-search { flex: 1 1 220px; }
.txn-search input { width: 100%; }
.txn-filter-toggle .chip-count { margin-inline-start: 2px; padding: 0 6px; border-radius: 999px; background: var(--chip-on); color: var(--on-accent); font-size: 11px; opacity: 1; }
.txn-filter-toggle.active { border-color: var(--accent); }
.txn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.txn-chip svg { flex: none; }
#page-transactions > .txn-filters { margin-top: -8px; }

/* The list: grouped by day, optional columns hidden as whole columns. */
.txn-table.txn-grouped .txn-col-date,
.txn-table.txn-hide-account .txn-col-account,
.txn-table.txn-hide-owner .txn-col-owner { display: none; }
.txn-table .txn-col-amount { white-space: nowrap; }
.txn-day-row th,
.txn-day-row td {
  padding-block: 6px;
  background: var(--surface-sub);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-body);
  text-align: start;
}
.txn-day-row .txn-day-sum { text-align: left; font-weight: 500; color: var(--text-body); }
#txn-uncat-section { padding-bottom: 16px; }
#txn-uncat-more { margin: 12px 0 0; }
.group-count { font-weight: 500; }

/* "תשלומים קבועים" */
.recurring-table td { vertical-align: top; }
.recurring-table .recurring-payee { font-weight: 500; }
.recurring-table .recurring-usual,
.recurring-table .recurring-months,
.recurring-table .recurring-last { white-space: nowrap; }
.fixed-costs-more { margin: 16px 0 8px; }
.fixed-costs-more[open] > summary { margin-bottom: 12px; }
.fixed-cost-total { margin: 0 0 16px; }
.recurring-foot { margin: 8px 0 0; }

/* The analysis on the overview (round 9): a heading per question, the cards folded under it. */
.overview-analysis { margin-top: 8px; }
.overview-subhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 24px 0 12px; }
.overview-subhead h2 { margin: 0; font-size: var(--fs-h2); font-weight: 600; color: var(--heading); }
.overview-subhead .chart-range-row { margin: 0; }

@media (pointer: coarse), (max-width: 640px) {
  .txn-month-btn { inline-size: 44px; block-size: 44px; }
}

@media (max-width: 640px) {
  /* On a phone the app header already takes ~110px: the bar scrolls with the page instead of adding its own height. */
  .txn-bar { position: static; margin-top: -8px; padding: 8px 10px; gap: 6px; }
  .txn-bar-row { gap: 6px 12px; }
  .txn-month { flex: 1 1 100%; justify-content: space-between; }
  .txn-month-label { min-inline-size: 0; flex: 1; }
  .txn-summary { font-size: 13px; }

  /* Two lines per transaction: what and how much on top, the category (and the date when not grouped) below. */
  .txn-table thead { display: none; }
  .txn-table tbody tr.txn-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'desc amount'
      'category date';
    align-items: center;
    column-gap: 12px;
    row-gap: 4px;
    padding: 10px 16px;
  }
  .txn-table tbody tr td { display: block; border-bottom: none; padding: 0; }
  .txn-table td::before { content: none; }
  .txn-table .txn-col-date { grid-area: date; font-size: 12px; text-align: left; }
  .txn-table .txn-col-desc { grid-area: desc; min-width: 0; font-weight: 600; font-size: 15px; }
  .txn-table .txn-col-account,
  .txn-table .txn-col-owner { display: none; }
  .txn-table .txn-col-category { grid-area: category; min-width: 0; }
  .txn-table .txn-col-amount { grid-area: amount; text-align: left; font-weight: 600; }
  .txn-table.txn-grouped .txn-col-date { display: none; }
  .txn-table tbody tr.txn-day-row { display: flex; justify-content: space-between; align-items: center; padding: 0 16px; background: var(--surface-sub); }
  .txn-table tbody tr.txn-day-row th,
  .txn-table tbody tr.txn-day-row td { display: block; padding: 6px 0; border-bottom: 0; background: transparent; }
  .txn-table .txn-category-select { max-width: 100%; }
  .txn-table tbody tr.txn-row + tr.txn-row { border-top: 1px solid var(--border); }

  .recurring-table thead { display: none; }
  .recurring-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 10px 0; }
  .recurring-table tbody tr td { display: block; padding: 0; border-bottom: 0; }
  /* the column headers are hidden on a phone: the two small values say what they are */
  .recurring-table .recurring-months::before { content: 'כבר '; }
  .recurring-table .recurring-last::before { content: 'לאחרונה '; }
  .recurring-table .recurring-usual { text-align: left; white-space: normal; }
  .recurring-table .recurring-months,
  .recurring-table .recurring-last { font-size: 12px; color: var(--text-muted); }
  .recurring-table .recurring-last { text-align: left; }
  .recurring-table tbody tr + tr { border-top: 1px solid var(--border); }
}

/* The change log (round 9 of the UX test, J13): long values wrap inside their column instead of widening the page. */
.st-log-table {
  table-layout: fixed;
}

.st-log-table th:nth-child(1),
.st-log-table th:nth-child(6) {
  width: 7.5rem;
}

.st-log-table th:nth-child(2) {
  width: 10rem;
}

.st-log-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

/* Stage 4 of docs/import-review-2026-10.md: "מה עכשיו" after a save (4.1) and the monthly update as a list (4.4). */
.import-whatnow {
  margin: 10px 0;
  padding: 10px 12px;
  background: var(--surface-sub);
  border-inline-start: 4px solid var(--border-strong);
  border-radius: var(--radius);
}
.import-whatnow-title { margin: 0 0 4px; font-size: 15px; }
.import-whatnow-head { margin: 0 0 4px; }
.import-whatnow-list { margin: 0; padding-inline-start: 20px; }
.import-whatnow-list li { margin: 4px 0; }
.import-whatnow-list .link-btn { min-height: 32px; text-align: start; }
.import-monthly { margin: 0 0 10px; }
.import-monthly-title { margin: 0 0 4px; font-weight: 700; font-size: 14px; }
.import-monthly-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.import-monthly-item { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.import-monthly-tick { font-weight: 800; color: var(--attention-text); }
.import-monthly-done .import-monthly-tick { color: var(--income); }
.import-monthly-status { color: var(--text-muted); font-size: 13px; }
.import-monthly-link { font-size: 13px; display: inline-flex; align-items: center; min-height: 32px; }
.import-owner-note { margin: 2px 0 0; }

/* 5.4: a fund's public average fee under the family's own (public/fund-facts.js) */
.fund-avg { margin-top: 4px; }
.fund-avg:empty { display: none; }
.fund-avg-line { font-size: 0.85em; color: var(--text-muted); }
.fund-avg-select { max-width: 100%; margin-block: 4px; }
.fund-avg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
