/* #region zone:finance.style.tx — หน้ารายรับ–รายจ่าย: แถบสรุป ตัวกรอง รายการรายวัน และคอลัมน์ขวา */
/* Summary strip: four figures on one white panel, 2 x 2 on a phone. */
.panel.tx-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: var(--sp-1);
}
.tx-cell {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  border-inline-end: 1px solid var(--line);
}
.tx-cell:last-child {
  border-inline-end: 0;
}
.tx-l,
.tx-cell small,
.tx-cap {
  color: var(--muted);
  font-size: var(--t-caption);
}
.tx-cell strong {
  font-size: var(--t-kpi);
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* Filters: search, category chips with a colour dot, account menu. They wrap and never touch. */
.tx-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
}
.tx-search {
  flex: 1 1 220px;
  min-width: 0;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  background: var(--panel);
}
.tx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.tx-chip {
  min-width: 44px;
  min-height: 44px;
  gap: 6px;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--u-radius-pill);
  color: var(--muted);
  font-weight: 500;
}
.tx-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}
.tx-chip[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--acc-soft);
  color: var(--text);
}
.tx-account {
  flex: 0 1 200px;
  min-width: 150px;
}

/* List + rail. */
.tx-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
  gap: var(--sp-4);
  align-items: start;
}
.tx-list {
  padding: var(--sp-2) 0;
  gap: 0;
}
.tx-limit-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: var(--sp-3) var(--sp-5) var(--sp-2);
  padding: var(--sp-3) 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--t-label);
}
.tx-limit-note p {
  margin: 0;
}
.tx-day + .tx-day {
  margin-top: var(--sp-1);
}
.tx-dayhead {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5) 6px;
  color: var(--muted);
  font-size: var(--t-label);
  font-weight: 600;
}
.tx-row {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2);
  margin-block: var(--sp-2);
  border-top: 1px solid var(--line);
}
.tx-row > .row-menu-btn {
  height: auto;
  border-radius: var(--r-control);
}
.tx-hit {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 10px 0 10px var(--sp-5);
  border: 0;
  border-radius: var(--r-inner);
  background: transparent;
  text-align: start;
  font-weight: 400;
  white-space: normal;
}
.tx-hit:hover {
  background: var(--panel2);
}
.tx-tile {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.tx-main {
  display: grid;
  min-width: 0;
}
.tx-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tx-name b {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.tx-main small {
  color: var(--muted);
  font-size: var(--t-caption);
  overflow-wrap: anywhere;
}
.tx-tag {
  padding: 1px var(--sp-2);
  border-radius: var(--u-radius-pill);
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
}
.tx-amt {
  white-space: nowrap;
  font-weight: 650;
}
.tx-suggest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  margin: 10px var(--sp-5) 14px;
  padding: 10px 14px;
  border: 1px dashed var(--accent);
  border-radius: var(--r-inner);
  background: var(--acc-soft);
  font-size: var(--t-label);
}
.tx-suggest > span {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  min-width: 0;
  flex: 1 1 240px;
}
.tx-suggest svg {
  flex: none;
  color: var(--accent-text);
  margin-top: 2px;
}

/* Right rail. */
.tx-rail {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
  /* Keeps the cards clear of the floating Luna button that sits over the right edge (52px + its margin). */
  padding-inline-end: 56px;
}
.tx-rail-card {
  gap: var(--sp-2);
}
.tx-rail-card h3 {
  font-size: var(--t-body);
  font-weight: 650;
}
.tx-heat-head,
.tx-heat {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--sp-1);
}
.tx-heat-head {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.tx-heat-day {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--panel2);
}
.tx-heat-day.is-shaded {
  background: color-mix(in srgb, var(--money-neg) calc(var(--v) * 1%), var(--panel2));
}
.tx-heat-day.is-today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.tx-heat-day.is-future {
  opacity: 0.4;
}
.tx-bar {
  display: grid;
  grid-template-columns: minmax(64px, 96px) minmax(0, 1fr) auto;
  gap: var(--sp-2);
  align-items: center;
  margin: var(--sp-1) 0;
  font-size: var(--t-label);
}
.tx-bar > span:first-child {
  overflow-wrap: anywhere;
}
.tx-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: var(--panel2);
}
.tx-bar-track i {
  display: block;
  width: var(--w);
  height: 100%;
  border-radius: 5px;
  background: var(--c);
  transform-origin: left;
  animation: tx-grow 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  animation-delay: calc(var(--i) * 80ms);
}
@keyframes tx-grow {
  from {
    transform: scaleX(0);
  }
}
.tx-repeat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--t-label);
}
.tx-repeat > span {
  flex: 1 1 140px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.tx-repeat button {
  min-height: 32px;
  padding: 3px var(--sp-3);
}

@media (max-width: 980px) {
  .tx-split {
    grid-template-columns: minmax(0, 1fr);
  }
  .tx-rail {
    padding-inline-end: 0;
  }
}
@media (max-width: 760px) {
  .panel.tx-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tx-cell:nth-child(2) {
    border-inline-end: 0;
  }
  .tx-cell:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}
@media (max-width: 600px) {
  .tx-dayhead,
  .tx-suggest {
    margin-inline: 0;
  }
  .tx-dayhead {
    padding-inline: var(--sp-4);
  }
  .tx-hit {
    padding-inline-start: var(--sp-4);
    gap: 10px;
  }
  .tx-suggest {
    margin: 10px var(--sp-4) 14px;
  }
  .tx-account {
    flex: 1 1 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tx-bar-track i {
    animation: none;
  }
}
/* #endregion */
