/* Reference-led, isolated bill details. No account or storage styles are changed. */
body.bills-page-active { background: #fcf7ef; overflow: hidden; }
body.bills-page-active #appShell {
  width: min(100%, 560px); height: 100dvh; min-height: 0; margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 11px max(10px, env(safe-area-inset-bottom));
  background: #fcf7ef; overflow: hidden;
}
body.bills-page-active #appShell > .topbar,
body.bills-page-active #appShell > .nav-dock,
body.bills-page-active #appShell > .chat-overview-strip,
body.bills-page-active #appShell > .footer-note { display: none; }
#billsPage {
  --bills-line: #f5ebdf; --bills-muted: #858480;
  display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0 12px;
  border: 0; border-radius: 27px; background: #fffdfa; color: #2d2d29;
  overflow: hidden; box-shadow: none; font-variant-numeric: tabular-nums;
}
#billsPage button, #billsPage select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#billsPage button:focus-visible, #billsPage select:focus-visible, #billsPage input:focus-visible,
#billsPage [tabindex]:focus-visible { outline: 2px solid #cd820e; outline-offset: -2px; }
#billsPage .bills-header { position: relative; flex: 0 0 62px; display: grid; place-items: center; }
#billsPage .bills-header h2 { margin: 6px 0 0; font-size: 20px; font-weight: 700; letter-spacing: .06em; }
#billsPage .bills-back { position: absolute; left: 0; top: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; }
#billsPage .bills-back img { width: 26px; height: 26px; opacity: .8; }
#billsPage .bills-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 0 0 44px; min-width: 0; margin: 0 4px 16px; }
#billsPage .bills-select { position: relative; display: block; min-width: 0; width: 112px; }
#billsPage .bills-select select { display: block; appearance: none; -webkit-appearance: none; width: 100%; min-width: 0; height: 44px; padding: 0 30px 0 13px; margin: 0; border: 1px solid var(--bills-line); border-radius: 24px; background: #fcf8f2; color: #2d2d29; font: inherit; font-size: 16px; font-weight: 500; text-overflow: ellipsis; box-shadow: none; cursor: pointer; }
#billsPage .bills-select img { position: absolute; top: 13px; right: 10px; width: 18px; height: 18px; opacity: .72; pointer-events: none; }
#billsPage .bills-calendar { position: relative; flex: 0 0 44px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--bills-line); border-radius: 16px; background: #fffdfa; }
#billsPage .bills-calendar img { width: 25px; height: 25px; opacity: .82; }
#billsPage .bills-calendar.is-filtered::after { content: ''; position: absolute; right: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #e49821; }
#billsPage .bills-calendar[aria-expanded="true"] { background: #fff0d6; border-color: #ebcf9f; }
#billsPage .bills-filter-status { flex: 0 0 auto; margin: -5px 5px 10px; color: #896c45; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#billsPage .bill-filter-card { flex: 0 0 auto; max-height: 45%; overflow-y: auto; overscroll-behavior: contain; margin: 0 0 12px; padding: 12px; background: #fcf8f2; border: 1px solid var(--bills-line); border-radius: 18px; box-shadow: none; }
#billsPage .bills-filter-panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 34px; font-size: 15px; }
#billsPage .bills-filter-panel-heading button { min-height: 36px; min-width: 44px; border: 0; background: none; font-size: 14px; color: #80623a; }
#billsPage .bill-search-field { margin: 6px 0 12px; min-height: 44px; background: #fffdfa; border-color: var(--bills-line); }
#billsPage #billSearchInput { min-width: 0; font-size: 16px; }
#billsPage .bill-filter-heading { margin: 0 0 8px; font-size: 14px; }
#billsPage .bill-filter-heading strong { font-size: 14px; }
#billsPage .period-filter-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 0; background: none; }
#billsPage .bill-filter-button { min-width: 0; min-height: 44px; padding: 0 3px; font-size: 14px; border: 1px solid transparent; border-radius: 12px; color: #6b675f; background: none; }
#billsPage .bill-filter-button.is-active { color: #915b12; background: #fff0d6; border-color: #efdab8; box-shadow: none; }
#billsPage .custom-date-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 10px 0 0; }
#billsPage .custom-date-field { min-width: 0; font-size: 14px; }
#billsPage .custom-date-field input { display: block; appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; height: 44px; min-height: 44px; padding: 0 6px; font-size: 16px; line-height: normal; border: 1px solid #e8e0d4; border-radius: 10px; background: #fffdfa; }
#billsPage .custom-date-field input::-webkit-date-and-time-value { text-align: left; }
#billsPage .custom-date-apply { grid-column: 1 / -1; min-height: 44px; background: #ed9b20; color: #fff; border: 0; border-radius: 12px; }
#billsPage .custom-date-error { grid-column: 1 / -1; margin: 0; font-size: 14px; }
#billsPage .bill-category-filter, #billsPage .bills-filter-balance { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; color: #77726a; }
#billsPage .bill-category-filter button { min-height: 44px; padding: 0 8px; }
#billsPage .bills-filter-balance strong { color: #393832; }
#billsPage .bill-list { display: block; flex: 1 1 auto; min-height: 40px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #e8ddce transparent; padding: 0 0 12px; margin: 0; }
#billsPage .date-group { margin: 0 0 14px; padding: 0; border: 1px solid var(--bills-line); border-radius: 19px; background: #fffdfa; overflow: hidden; }
#billsPage .date-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; min-height: 48px; margin: 0; padding: 10px 12px; background: #fcf8f2; border-bottom: 1px solid var(--bills-line); color: var(--bills-muted); font-size: 14px; font-weight: 400; }
#billsPage .bill-day { display: flex; align-items: baseline; gap: 7px; white-space: nowrap; }
#billsPage .bill-day strong { font-size: 16px; color: #2d2d29; font-weight: 600; }
#billsPage .bill-day-totals { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-left: auto; font-size: 13px; }
#billsPage .bill-day-totals span { white-space: nowrap; color: var(--bills-muted); }
#billsPage .bill-card { margin: 0; padding: 0; border: 0; border-radius: 0; background: #fffdfa; box-shadow: none; }
#billsPage .swipe-row-content { background: #fffdfa; padding: 0 13px; }
#billsPage .bill-card + .bill-card .bill-main { border-top: 1px solid var(--bills-line); }
#billsPage .bill-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 86px; padding: 14px 0; }
#billsPage .bill-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
#billsPage .bill-art { display: grid; place-items: center; flex: 0 0 51px; width: 51px; height: 51px; overflow: hidden; border-radius: 15px; }
#billsPage .bill-art img { display: block; width: 122%; height: 122%; max-width: none; object-fit: contain; }
#billsPage .bill-art.is-fallback { background: #fcf3e3; }
#billsPage .bill-art.is-fallback img { width: 29px; height: 29px; opacity: .64; }
#billsPage .bill-copy { min-width: 0; }
#billsPage .bill-title { margin: 0; color: #292925; font-size: 17px; font-weight: 650; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#billsPage .bill-subtitle { margin-top: 6px; color: var(--bills-muted); font-size: 14px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#billsPage .bill-card-actions { display: block; min-width: 0; text-align: right; }
#billsPage .bill-amount { color: #f26850; font-size: 18px; font-weight: 550; line-height: 1.4; white-space: nowrap; }
#billsPage .bill-amount.income { color: #628970; }
#billsPage .bill-time { display: block; margin-top: 6px; color: var(--bills-muted); font-size: 13px; line-height: 1.4; }
#billsPage .swipe-row-actions { padding: 8px; gap: 6px; background: #f5efe5; }
#billsPage .swipe-row-actions button { border-radius: 12px; min-height: 44px; padding: 5px; font-size: 13px; background: #fff7e9; color: #8b642a; }
#billsPage .swipe-row-actions button.is-danger { background: #fde9e4; color: #bc5947; }
#billsPage .swipe-row-actions img { width: 21px; height: 21px; opacity: .6; }
#billsPage .bills-summary { flex: 0 0 auto; margin: 0 9px; padding: 18px 0 18px; border-top: 1px solid var(--bills-line); color: var(--bills-muted); font-size: 16px; line-height: 1.5; }
#billsPage .bills-summary-totals { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 7px; }
#billsPage .bills-summary-totals > span { white-space: nowrap; }
#billsPage .bills-summary strong { color: #373630; font-weight: 550; }
#billsPage .empty-state { padding: 52px 12px; border: 0; background: none; box-shadow: none; color: var(--bills-muted); }
#billsPage .empty-state > img { width: 40px; height: 40px; margin-bottom: 12px; opacity: .3; }
#billsPage .empty-state strong { font-size: 17px; color: #57534c; }
#billsPage .empty-state p { font-size: 14px; line-height: 1.7; }
#billsPage .empty-action { min-height: 44px; color: #90672e; background: #fcf3e3; border: 0; border-radius: 14px; }
@media (max-width: 360px) {
  #billsPage { padding-inline: 10px; }
  #billsPage .bills-toolbar { gap: 8px; margin-inline: 0; }
  #billsPage .bills-select { width: 106px; }
  #billsPage .bills-select select { padding-left: 10px; }
  #billsPage .bill-day-totals { gap: 8px; font-size: 12px; }
  #billsPage .bill-left { gap: 8px; }
  #billsPage .bill-art { flex-basis: 44px; width: 44px; height: 44px; }
  #billsPage .bill-amount { font-size: 16px; }
  #billsPage .bill-title { font-size: 16px; }
}
@media (max-height: 580px) {
  #billsPage .bills-header { flex-basis: 52px; }
  #billsPage .bills-back { top: 4px; }
  #billsPage .bills-summary { padding-block: 10px; }
  #billsPage .bill-filter-card { max-height: 40%; }
}
@media (prefers-reduced-motion: reduce) {
  #billsPage .swipe-row-content, #billsPage .swipe-row-actions { transition: none; }
}
