/* ---------------------------------------------------------------
 * The expense screens' own layout — a bill's lines, the sums, the filter row, the receipts. Everything
 * else is the kit's (cards, badges, tables, dialogs); load this after its index.css, because the order
 * is the override.
 * --------------------------------------------------------------- */

/* One column that may shrink: a grid item's min-width is its content, and a wide table would
   push the whole screen past a phone's edge instead of scrolling inside `.table-scroll`. */
.exp-stack {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}
/* A count that is a link: a finger-sized target, not the width of one digit. */
.exp-count {
  display: inline-block;
  min-width: 1.5rem;
  min-height: 1.5rem;
  line-height: 1.5rem;
  text-align: end;
}
.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.exp-head-acts,
.exp-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}
.exp-filters .field {
  margin: 0;
  min-width: 11rem;
}
.exp-num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A bill's lines: text wide, the numbers narrow; the description and the line's category below. */
.exp-lines {
  display: grid;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}
.exp-line {
  display: grid;
  grid-template-columns: minmax(10rem, 3fr) 5.5rem 7rem 5.5rem auto;
  align-items: end;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft, var(--line));
}
.exp-line .field {
  margin: 0;
}
.exp-line .exp-line-detail {
  grid-column: 1 / 3;
}
.exp-line .exp-line-category {
  grid-column: 3 / 5;
}
@media (max-width: 760px) {
  .exp-line {
    grid-template-columns: 1fr 1fr;
  }
  .exp-line > :first-child,
  .exp-line .exp-line-detail,
  .exp-line .exp-line-category {
    grid-column: 1 / -1;
  }
}

.exp-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
  margin-top: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.exp-total b {
  font-size: 1.3rem;
}

.exp-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.exp-filter .btn[aria-pressed="true"] {
  border-color: var(--fg);
  box-shadow: inset 0 0 0 1px var(--fg);
}

.exp-receipts {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}
.exp-receipts li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.exp-receipts a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  overflow-wrap: anywhere;
}

.exp-note {
  color: var(--muted);
  font-size: 0.85rem;
}
.exp-period-quarter td,
.exp-period-year td {
  font-weight: 700;
}
