@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap");
:root {
  font-family: "DM Sans", sans-serif;
  color: #233d35;
  background: #f7f8f4;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #c08629;
  outline-offset: 4px;
}
header {
  height: 90px;
  max-width: 1120px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid #dee5dc;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #176853;
  font-size: 30px;
  text-decoration: none;
  font-weight: 700;
}
.brand > span {
  font-size: 21px;
  letter-spacing: -1px;
}
.light {
  font-weight: 400;
  margin-left: 5px;
}
.tag,
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #698174;
}
main {
  max-width: 1056px;
  margin: auto;
  padding: 36px 0;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 30px;
}
h1 {
  font-family: Manrope, sans-serif;
  font-size: 49px;
  line-height: 1.15;
  letter-spacing: -2px;
  margin: 18px 0;
  color: #213e32;
}
.intro p:not(.eyebrow) {
  color: #718075;
  font-size: 15px;
}
.illustration {
  border-radius: 50%;
  background: #e6eddf;
  color: #3e7651;
  width: 160px;
  height: 160px;
  text-align: center;
  font-size: 125px;
  line-height: 150px;
  position: relative;
  margin-right: 55px;
}
.illustration span {
  position: absolute;
  font-size: 27px;
  line-height: 48px;
  right: -6px;
  bottom: 7px;
  border-radius: 50%;
  background: #176853;
  color: white;
  width: 48px;
  transform: rotate(-12deg);
}
.notice {
  font-size: 12px;
  line-height: 1.6;
  background: #edf0e7;
  border: 1px solid #dce3d5;
  padding: 12px 16px;
  border-radius: 10px;
  color: #637258;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0 22px;
}
.month {
  display: flex;
  gap: 18px;
  align-items: center;
}
.month h2 {
  font-size: 21px;
  min-width: 190px;
  text-align: center;
  text-transform: capitalize;
}
.month button {
  border: 1px solid #dce3d8;
  background: white;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  color: #426153;
}
.primary {
  background: #176853;
  border: 0;
  border-radius: 9px;
  color: white;
  padding: 13px 20px;
  font-weight: 600;
}
.primary:hover {
  background: #104e3e;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.stats article {
  background: white;
  border: 1px solid #e1e7dd;
  border-radius: 13px;
  padding: 22px 25px;
}
.stats p {
  margin: 0 0 13px;
  font-size: 13px;
  color: #6d7e72;
}
.stats strong {
  display: block;
  font-family: Manrope, sans-serif;
  font-size: 30px;
  letter-spacing: -1px;
}
.stats small {
  display: block;
  margin-top: 13px;
  color: #7a867b;
  font-size: 12px;
}
.stats .paidcard {
  background: #e8f0e7;
  border-color: #d9e5d6;
}
.paidcard strong {
  color: #176853;
}
.accounts {
  background: white;
  border: 1px solid #e1e7dd;
  border-radius: 14px;
  margin-top: 28px;
  padding: 25px;
}
.sectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sectionhead h2 {
  font-size: 18px;
  margin: 0;
}
.text {
  border: 0;
  background: transparent;
  color: #587666;
  font-size: 12px;
  padding: 8px;
}
.filters {
  display: flex;
  gap: 7px;
  margin: 24px 0 12px;
}
.filters button {
  background: transparent;
  border: 0;
  border-radius: 7px;
  padding: 8px 14px;
  color: #7b867e;
  font-size: 12px;
}
.filters button.active {
  background: #e9f0e7;
  color: #176853;
  font-weight: 700;
}
.bill {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid #edf0e9;
  padding: 20px 0;
}
.toggle {
  border: 1.5px solid #cdd8cd;
  background: white;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  flex-shrink: 0;
}
.toggle.done {
  background: #176853;
  border-color: #176853;
}
.billinfo {
  flex: 1;
  min-width: 0;
}
.billinfo strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.billinfo small {
  display: block;
  font-size: 12px;
  color: #819083;
  margin-top: 6px;
}
.billamount {
  text-align: right;
}
.billamount strong {
  font-size: 15px;
  display: block;
}
.status {
  font-size: 10px;
  color: #9a712b;
  display: inline-block;
  margin-top: 7px;
  background: #fbf2de;
  border-radius: 4px;
  padding: 4px 7px;
}
.status.paid {
  color: #176853;
  background: #edf4e8;
}
.status.late {
  color: #b04b43;
  background: #fbeae5;
}
.billactions {
  display: flex;
  flex-direction: column;
}
.empty {
  padding: 50px 16px;
  text-align: center;
  color: #728274;
}
.empty strong {
  display: block;
  color: #3b5847;
  font-size: 18px;
  margin-bottom: 10px;
}
.empty button {
  margin-top: 14px;
}
footer {
  text-align: center;
  margin: 30px;
  font-size: 12px;
  line-height: 2;
  color: #8a9589;
}
dialog {
  border: 1px solid #dfe5da;
  border-radius: 18px;
  padding: 28px;
  max-width: 540px;
  width: calc(100% - 28px);
  color: #233d35;
}
dialog::backdrop {
  background: #163d3266;
  backdrop-filter: blur(3px);
}
dialog p {
  line-height: 1.7;
  font-size: 14px;
}
label {
  display: block;
  font-size: 13px;
  margin: 16px 0;
}
input,
select {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #d4ded1;
  border-radius: 7px;
  margin-top: 8px;
  background: white;
  color: #233d35;
}
.formrow {
  display: flex;
  gap: 14px;
}
.formrow label {
  flex: 1;
  min-width: 0;
}
.dialoghead {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialoghead h2 {
  font-size: 21px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.check input {
  width: auto;
  margin: 0;
}
.hint {
  font-size: 12px !important;
  color: #7a8777;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #234f3c;
  color: white;
  border-radius: 8px;
  padding: 12px 22px;
  display: none;
  max-width: 90%;
  font-size: 13px;
}
@media (max-width: 1120px) {
  main {
    padding: 25px 25px;
  }
}
@media (max-width: 600px) {
  header {
    height: 70px;
    padding: 0 20px;
  }
  .tag {
    display: none;
  }
  .brand > span {
    font-size: 19px;
  }
  main {
    padding: 20px 16px;
  }
  h1 {
    font-size: 35px;
  }
  .illustration {
    width: 80px;
    height: 80px;
    font-size: 65px;
    line-height: 75px;
    margin-right: 5px;
  }
  .illustration span {
    width: 28px;
    line-height: 28px;
    font-size: 17px;
  }
  .intro {
    gap: 14px;
  }
  .intro p:not(.eyebrow) {
    font-size: 12px;
    line-height: 1.6;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .notice {
    font-size: 11px;
  }
  .toolbar {
    gap: 10px;
  }
  .month {
    gap: 7px;
  }
  .month h2 {
    font-size: 16px;
    min-width: 132px;
  }
  .month button {
    width: 28px;
    height: 28px;
  }
  .primary {
    font-size: 12px;
    padding: 12px 14px;
  }
  .stats {
    gap: 8px;
  }
  .stats article {
    padding: 15px 10px;
  }
  .stats strong {
    font-size: 19px;
    letter-spacing: -0.6px;
  }
  .stats p {
    font-size: 11px;
  }
  .stats small {
    font-size: 10px;
    line-height: 1.5;
  }
  .accounts {
    padding: 17px 12px;
  }
  .sectionhead h2 {
    font-size: 16px;
  }
  .bill {
    gap: 10px;
    padding: 17px 0;
  }
  .billinfo strong {
    font-size: 13px;
  }
  .billinfo small {
    font-size: 10px;
    line-height: 1.6;
  }
  .billamount strong {
    font-size: 13px;
  }
  .billactions .text {
    font-size: 10px;
    padding: 6px 3px;
  }
  .filters button {
    padding: 8px 10px;
  }
  .formrow {
    gap: 8px;
  }
}
#importDialog {
  max-width: 850px;
  max-height: 90vh;
  overflow: auto;
}
.import-help {
  font-size: 12px;
  line-height: 2;
  background: #eef3e9;
  border-radius: 8px;
  padding: 12px;
}
.import-help a {
  color: #176853;
}
.file-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#importMessage {
  color: #9b3e33;
}
#importSummary {
  padding: 14px;
  background: #e9f0e7;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}
.import-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.import-row {
  border: 1px solid #dce5d7;
  border-radius: 9px;
  padding: 10px 16px;
  margin: 10px 0;
}
.import-row.invalid {
  border-color: #eac1b8;
  background: #fff9f6;
}
.import-row .check {
  margin: 5px 0;
  font-size: 14px;
}
.import-row p {
  font-size: 12px;
  line-height: 1.6;
  margin: 7px 0;
  overflow-wrap: anywhere;
}
.import-row input:disabled {
  opacity: 0.4;
}
.import-error {
  color: #a0372a;
}
.import-warning {
  color: #8c650d;
}
.import-confirm {
  position: sticky;
  bottom: -28px;
  background: #fff;
  padding: 15px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #e1e7dd;
}
.import-confirm strong {
  font-size: 13px;
}
.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .sectionhead {
    align-items: flex-start;
    gap: 6px;
  }
  .file-actions {
    max-width: 150px;
  }
  .file-actions .text {
    padding: 4px;
    font-size: 11px;
  }
  .import-confirm {
    bottom: -28px;
    flex-wrap: wrap;
  }
}
/* Flexible tracks keep long values and imported descriptions inside their cards. */
.stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.stats article,
.stats strong,
.billamount,
.sectionhead > * {
  min-width: 0;
}
.stats strong,
.billamount strong {
  overflow-wrap: anywhere;
}
.billinfo small {
  overflow-wrap: anywhere;
}
dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
input,
select {
  min-width: 0;
  max-width: 100%;
}
.import-row .check {
  align-items: flex-start;
}
.import-row .check strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.check input {
  flex: 0 0 auto;
}
button {
  touch-action: manipulation;
}
@media (max-width: 640px) {
  header {
    height: 64px;
    padding: 0 16px;
  }
  .brand > span {
    font-size: 20px;
  }
  .tag {
    display: none;
  }
  main {
    padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  }
  .intro {
    display: block;
    padding: 0 0 20px;
  }
  .illustration {
    display: none;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1px;
    margin: 4px 0 12px;
  }
  h1 {
    font-size: clamp(28px, 7.8vw, 38px);
    line-height: 1.15;
    letter-spacing: -1.1px;
    margin: 0 0 12px;
  }
  .intro p:not(.eyebrow) {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    max-width: 36ch;
  }
  .notice {
    font-size: 12px;
    padding: 12px;
    line-height: 1.5;
  }
  .toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin: 20px 0 16px;
  }
  .month {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 10px;
  }
  .month h2 {
    min-width: 0;
    font-size: 18px;
    margin: 0;
    line-height: 1.4;
  }
  .month button {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .primary {
    font-size: 15px;
    min-height: 46px;
    padding: 12px 16px;
  }
  .toolbar > .primary {
    width: 100%;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .stats article {
    padding: 16px;
    border-radius: 12px;
  }
  .stats article:first-child {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 12px;
  }
  .stats article:first-child p {
    margin: 0;
  }
  .stats article:first-child strong {
    grid-column: 2;
    grid-row: 1/3;
    max-width: 100%;
    font-size: clamp(20px, 5.5vw, 27px);
  }
  .stats article:first-child small {
    margin: 0;
  }
  .stats strong {
    font-size: clamp(19px, 5.2vw, 25px);
    line-height: 1.4;
    letter-spacing: -0.5px;
  }
  .stats p {
    font-size: 13px;
    margin: 0 0 8px;
  }
  .stats small {
    font-size: 12px;
    line-height: 1.4;
    margin-top: 8px;
  }
  .accounts {
    padding: 18px 14px;
    margin-top: 20px;
  }
  .sectionhead {
    display: block;
  }
  .sectionhead h2 {
    font-size: 19px;
    margin: 0 0 10px;
  }
  .file-actions {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: initial;
  }
  .file-actions .text {
    font-size: 12px;
    min-height: 44px;
    padding: 8px;
    border: 1px solid #dce5d7;
    border-radius: 8px;
    white-space: normal;
  }
  .filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    margin: 16px 0 8px;
  }
  .filters button {
    min-height: 44px;
    font-size: 12px;
    padding: 8px 2px;
    min-width: 0;
  }
  .bill {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 18px 0;
    align-items: start;
  }
  .toggle {
    width: 44px;
    height: 44px;
    font-size: 20px;
    border-radius: 10px;
    grid-column: 1;
    grid-row: 1;
  }
  .billinfo {
    grid-column: 2;
    grid-row: 1;
  }
  .billinfo strong {
    font-size: 15px;
    line-height: 1.4;
  }
  .billinfo small {
    font-size: 12px;
    line-height: 1.6;
    margin-top: 4px;
  }
  .billamount {
    grid-column: 2;
    text-align: left;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  .billamount strong {
    font-size: 18px;
  }
  .status {
    font-size: 11px;
    margin: 0;
    padding: 4px 8px;
  }
  .billactions {
    grid-column: 2;
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
  }
  .billactions .text {
    font-size: 13px;
    min-height: 44px;
    padding: 10px 16px;
    background: #f2f5ef;
    border-radius: 7px;
  }
  .empty {
    padding: 30px 6px;
    font-size: 14px;
    line-height: 1.6;
  }
  .empty button {
    max-width: 100%;
    white-space: normal;
  }
  footer {
    margin: 24px 0 0;
    font-size: 12px;
    line-height: 1.6;
  }
  footer .text {
    font-size: 12px;
    min-height: 44px;
  }
  dialog,
  #importDialog {
    width: calc(100% - 16px);
    max-width: 540px;
    max-height: calc(100dvh - 24px);
    padding: 20px 16px;
    border-radius: 14px;
  }
  .dialoghead {
    gap: 8px;
    align-items: flex-start;
  }
  .dialoghead h2 {
    font-size: 21px;
    margin: 8px 0;
    overflow-wrap: anywhere;
  }
  .dialoghead .text {
    min-height: 44px;
    flex-shrink: 0;
    font-size: 13px;
  }
  .formrow {
    display: block;
  }
  label {
    font-size: 14px;
    margin: 14px 0;
  }
  input,
  select {
    font-size: 16px;
    min-height: 46px;
    padding: 11px 10px;
  }
  input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-height: 22px;
  }
  .check {
    line-height: 1.5;
    align-items: flex-start;
  }
  .hint {
    font-size: 12px !important;
  }
  form > .primary {
    width: 100%;
  }
  .import-help {
    font-size: 13px;
    line-height: 1.8;
    overflow-wrap: anywhere;
  }
  .import-help a {
    display: block;
    padding: 8px 0;
  }
  .import-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .import-controls button {
    min-height: 44px;
    text-align: left;
    font-size: 13px;
  }
  .import-row {
    padding: 12px;
  }
  .import-row .check {
    font-size: 14px;
  }
  .import-row p {
    font-size: 13px;
  }
  .import-confirm {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px 0 6px;
  }
  .import-confirm strong {
    font-size: 15px;
  }
  .import-confirm button {
    width: 100%;
  }
  #importFile {
    font-size: 14px;
    padding: 10px 4px;
  }
  #toast {
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(100% - 32px);
    max-width: 420px;
    text-align: center;
  }
}
[hidden] {
  display: none !important;
}
.workspace-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  flex-wrap: wrap;
}
.workspace-bar label {
  margin: 8px 0;
}
.workspace-bar select {
  min-width: 220px;
}
#authPanel {
  max-width: 540px;
  margin: 20px auto;
}
#authPanel h1 {
  font-size: 34px;
}
#authError {
  color: #a0372a;
}
fieldset {
  border: 1px solid #dce5d7;
  border-radius: 10px;
  padding: 14px;
}
.share-entry {
  display: grid;
  grid-template-columns: 1fr 140px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #edf0e9;
}
.share-entry .check {
  overflow-wrap: anywhere;
}
.billamount small {
  display: block;
  font-size: 12px;
  margin-top: 6px;
}
textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  font: inherit;
  overflow-wrap: anywhere;
}
#memberList p,
#auditList p,
#paymentHistory p {
  overflow-wrap: anywhere;
  font-size: 13px;
  border-bottom: 1px solid #e1e7dd;
  padding-bottom: 12px;
}
#paymentShares p {
  font-size: 14px;
}
@media (max-width: 640px) {
  .workspace-bar {
    display: block;
  }
  .workspace-bar select {
    width: 100%;
    min-width: 0;
  }
  .workspace-bar .text {
    min-height: 44px;
    font-size: 13px;
  }
  .share-entry {
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 8px;
  }
  .share-entry label {
    min-width: 0;
  }
  #authPanel h1 {
    font-size: 28px;
  }
  .billamount small {
    flex-basis: 100%;
  }
}
#planDialog {
  width: calc(100% - 24px);
  max-width: 1280px;
  max-height: 94dvh;
}
#planSummary {
  padding: 14px;
  background: #e9f0e7;
  border-radius: 8px;
  line-height: 1.6;
  font-size: 14px;
}
#planError {
  color: #a0372a;
  font-size: 14px;
}
.plan-scroll {
  overflow: auto;
  margin-top: 18px;
}
.plan-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.plan-table th {
  text-align: left;
  background: #f1f5ed;
  padding: 12px;
}
.plan-table th:first-child {
  width: 85px;
}
.plan-table th:nth-child(2) {
  width: 22%;
}
.plan-table th:nth-child(3),
.plan-table th:nth-child(4) {
  width: 16%;
}
.plan-table td {
  border-bottom: 1px solid #dce5d7;
  padding: 10px;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.plan-table label {
  font-size: 12px;
  margin: 8px 0;
}
.plan-table input {
  padding: 9px 7px;
  font-size: 14px;
  width: 100%;
  min-width: 0;
}
.plan-person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid #edf0e9;
}
.plan-person input[type="checkbox"] {
  width: 20px;
  height: 20px;
}
.plan-person .check {
  overflow-wrap: anywhere;
}
.plan-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 16px;
}
.plan-footer button {
  min-height: 44px;
}
.plan-table small {
  font-size: 12px;
}
@media (max-width: 760px) {
  .plan-table,
  .plan-table tbody,
  .plan-table tr,
  .plan-table td {
    display: block;
    width: 100%;
  }
  .plan-table thead {
    display: none;
  }
  .plan-table tr {
    border: 1px solid #dce5d7;
    border-radius: 10px;
    margin: 0 0 16px;
    padding: 10px;
  }
  .plan-table td {
    border: 0;
    padding: 6px;
  }
  .plan-table td:before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 14px;
  }
  .plan-table input {
    font-size: 16px;
    min-height: 44px;
  }
  .plan-table input[type="checkbox"] {
    min-height: 22px;
  }
  .plan-footer {
    display: grid;
    grid-template-columns: 1fr;
  }
  .plan-scroll {
    overflow: visible;
  }
  .plan-person {
    grid-template-columns: minmax(0, 1fr) 110px;
  }
}
.personal-wallet {
  margin: 0 0 24px;
}
.wallet-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.wallet-cards article {
  padding: 18px;
  border: 1px solid #dce5d7;
  border-radius: 12px;
  background: #eff4ec;
}
.wallet-cards article:last-child {
  background: #fff6e4;
  border-color: #e6d8b7;
}
.wallet-cards h3 {
  font-size: 15px;
  margin: 0 0 12px;
}
.wallet-cards strong {
  font-size: 28px;
  display: block;
  overflow-wrap: anywhere;
}
.wallet-cards p,
.wallet-cards small {
  font-size: 12px;
  line-height: 1.6;
}
.personal-wallet summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}
.income-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #e1e7dd;
  padding: 14px 0;
}
.income-entry strong {
  font-size: 14px;
}
.income-entry p,
.income-entry small {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.income-entry.voided {
  opacity: 0.65;
}
#incomeError {
  color: #a0372a;
}
#fundingHint {
  background: #f0f4eb;
  padding: 10px;
  border-radius: 8px;
}
@media (max-width: 640px) {
  .wallet-cards {
    grid-template-columns: minmax(0, 1fr);
  }
  .wallet-cards strong {
    font-size: 27px;
  }
  .personal-wallet .sectionhead {
    display: grid;
    gap: 12px;
  }
  .income-entry {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .income-entry button {
    min-height: 44px;
  }
  .personal-wallet summary {
    min-height: 44px;
  }
}

[hidden] {
  display: none !important;
}
.income-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.income-history-head h3 {
  font-size: 16px;
}
.income-history-head label {
  max-width: 100%;
  margin: 8px 0;
}
.share-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
  align-items: center;
}
.share-entry strong {
  overflow-wrap: anywhere;
}
.share-entry label {
  min-width: 0;
}
#participantsDialog {
  max-width: 800px;
  max-height: 90dvh;
  overflow: auto;
}
.participant-table-wrap {
  overflow: auto;
  max-height: 50dvh;
}
.participant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.participant-table th,
.participant-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #dce5d7;
  overflow-wrap: anywhere;
}
.participant-table input {
  width: 22px;
  height: 22px;
  margin: 0;
}
.participant-table th {
  position: sticky;
  top: 0;
  background: #f4f7f1;
}
#participantError {
  color: #a0372a;
}
@media (max-width: 600px) {
  .share-entry {
    grid-template-columns: minmax(0, 1fr) 110px;
  }
  .participant-table th,
  .participant-table td {
    padding: 8px;
  }
  .participant-table td:nth-child(3) {
    min-width: 140px;
  }
}
/* The desktop keeps its dashboard; phone screens use five separate views. */
.mobile-only {
  display: none;
}
.secondary {
  border: 1px solid #cbdad1;
  background: #fff;
  border-radius: 10px;
  color: #176853;
  padding: 12px 16px;
  font-weight: 600;
}
.secondary:disabled {
  opacity: 0.6;
  cursor: default;
}
.action-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.action-grid > * {
  flex: 1;
  min-width: 120px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 8px 0 24px;
}
.page-heading h1 {
  font-size: 29px;
  letter-spacing: -1px;
  margin: 6px 0;
}
.page-heading .eyebrow {
  font-size: 9px;
}
.compact-label {
  font-size: 10px;
  max-width: 145px;
}
.compact-label input {
  font-size: 13px;
  padding: 9px;
}
.balance-hero {
  padding: 24px;
  background: #176853;
  color: white;
  border-radius: 23px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px #1768531c;
}
.balance-hero > span {
  font-size: 13px;
  opacity: 0.85;
}
.balance-hero > strong {
  display: block;
  font:
    700 34px Manrope,
    sans-serif;
  letter-spacing: -1px;
  margin: 10px 0;
}
.balance-hero p {
  font-size: 11px;
  opacity: 0.75;
}
.balance-hero > div {
  border-top: 1px solid #ffffff30;
  margin-top: 20px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.balance-hero > div strong {
  font-size: 18px;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 28px;
}
.summary-grid article {
  background: #fff;
  border: 1px solid #e1e8df;
  border-radius: 16px;
  padding: 17px 14px;
  min-width: 0;
}
.summary-grid span {
  font-size: 11px;
  color: #758478;
}
.summary-grid strong {
  display: block;
  font-size: 22px;
  margin: 10px 0 8px;
  overflow-wrap: anywhere;
}
.summary-grid small {
  font-size: 10px;
  color: #738073;
  display: block;
}
.upcoming-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #e3e9df;
  width: 100%;
  background: transparent;
  padding: 18px 0;
  text-align: left;
  color: #233d35;
}
.upcoming-row > span {
  min-width: 0;
}
.upcoming-row strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.upcoming-row small {
  display: block;
  font-size: 11px;
  margin-top: 7px;
  color: #718075;
}
.upcoming-row > strong {
  white-space: nowrap;
}
.home-shortcuts {
  display: flex;
  gap: 10px;
  margin: 24px 0;
}
.home-shortcuts > * {
  flex: 1;
}
.group-card,
.invitation-card,
.profile-card {
  padding: 20px;
  background: white;
  border: 1px solid #dce5d8;
  border-radius: 18px;
  margin: 18px 0;
}
.group-card.selected {
  border-color: #176853;
  box-shadow: 0 0 0 1px #17685315;
}
.group-card h2 {
  font-size: 17px;
  margin: 0;
}
.group-tag {
  font-size: 10px;
  background: #eaf2e7;
  border-radius: 20px;
  padding: 6px 9px;
  color: #176853;
}
.group-members {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}
.group-members li {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
}
.group-members li > span:last-child {
  min-width: 0;
}
.group-members strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.group-members small {
  display: block;
  font-size: 10px;
  color: #718075;
  margin-top: 5px;
  overflow-wrap: anywhere;
}
.mini-avatar,
.avatar {
  display: grid;
  place-items: center;
  background: #e7eee2;
  border-radius: 50%;
  color: #176853;
  flex-shrink: 0;
}
.mini-avatar {
  width: 32px;
  height: 32px;
}
.avatar {
  width: 52px;
  height: 52px;
  font-size: 19px;
  font-weight: 700;
}
.icon-button {
  position: relative;
  border: 1px solid #dce5d8;
  border-radius: 50%;
  background: white;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #176853;
}
.icon-button svg {
  width: 22px;
  height: 22px;
}
.badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: #b34436;
  color: white;
  border-radius: 20px;
  min-width: 19px;
  height: 19px;
  font-size: 10px;
  padding: 3px;
}
.notification-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #b34436;
  border-radius: 50%;
  margin-left: 3px;
  vertical-align: top;
}
.profile-card {
  display: flex;
  gap: 14px;
  align-items: center;
}
.profile-card strong {
  font-size: 17px;
  overflow-wrap: anywhere;
}
.profile-card > div {
  min-width: 0;
}
.profile-card p {
  font-size: 12px;
  color: #718075;
  overflow-wrap: anywhere;
}
.menu-list {
  background: white;
  border: 1px solid #dce5d8;
  border-radius: 16px;
  overflow: hidden;
}
.menu-list button {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #edf0e9;
  background: white;
  padding: 20px;
  width: 100%;
  text-align: left;
  color: #233d35;
}
.menu-list button > span:nth-child(2) {
  flex: 1;
}
.menu-list svg {
  width: 22px;
  height: 22px;
}
.contact-options {
  max-height: 220px;
  overflow: auto;
}
.contact-option {
  display: block;
  text-align: left;
  width: 100%;
  background: #f2f6ef;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  margin: 7px 0;
  color: #233d35;
}
.contact-option small {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
textarea {
  font: inherit;
  width: 100%;
  min-height: 90px;
  padding: 12px;
  border: 1px solid #cbdad1;
  border-radius: 8px;
  overflow-wrap: anywhere;
}
#groupsError,
#outflowsError,
#newInviteError,
#joinError,
#profileError,
#invitationsError {
  color: #a0372a;
  font-size: 13px;
}
#outflowsDialog {
  max-width: 720px;
  max-height: 90dvh;
  overflow: auto;
}
@media (max-width: 760px) {
  body {
    background: #f6f8f3;
  }
  body > header {
    height: 64px;
    padding: 0 20px;
    border-bottom: 0;
  }
  .brand > span {
    font-size: 19px;
  }
  .tag {
    display: none;
  }
  main {
    padding: 0 18px calc(100px + env(safe-area-inset-bottom));
  }
  .mobile-only {
    display: block;
  }
  .bottom-nav {
    position: fixed;
    z-index: 50;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 10px 8px calc(9px + env(safe-area-inset-bottom));
    background: #ffffffed;
    backdrop-filter: blur(16px);
    border-top: 1px solid #dfe6da;
    box-shadow: 0 -4px 20px #233d3505;
  }
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    background: transparent;
    border: 0;
    color: #849087;
    font-size: 10px;
    padding: 3px;
  }
  .bottom-nav svg {
    width: 23px;
    height: 23px;
  }
  .bottom-nav button[aria-current="page"] {
    color: #176853;
    font-weight: 700;
  }
  .bottom-nav button[aria-current="page"] > span:first-child {
    background: #e8f0e3;
    border-radius: 12px;
    padding: 4px 15px;
    margin-top: -4px;
    margin-bottom: -4px;
  }
  .bottom-nav button > span:first-child {
    display: flex;
  }
  .desktop-intro,
  .desktop-footer,
  #groupNotice {
    display: none;
  }
  .workspace-bar {
    margin: 0 0 12px;
    padding: 12px 0;
    border: 0;
    background: transparent;
  }
  .workspace-bar > div:first-child {
    width: 100%;
  }
  .workspace-bar #userName,
  .workspace-bar > div:last-child {
    display: none;
  }
  .workspace-bar label {
    margin: 0;
    font-size: 10px;
    color: #718075;
  }
  .workspace-bar select {
    margin-top: 5px;
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
  }
  .app-screen {
    animation: screen-in 0.16s ease-out;
  }
  body[data-mobile-page="home"]
    [data-mobile-screen]:not([data-mobile-screen="home"]),
  body[data-mobile-page="bills"]
    [data-mobile-screen]:not([data-mobile-screen="bills"]),
  body[data-mobile-page="income"]
    [data-mobile-screen]:not([data-mobile-screen="income"]),
  body[data-mobile-page="groups"]
    [data-mobile-screen]:not([data-mobile-screen="groups"]),
  body[data-mobile-page="more"]
    [data-mobile-screen]:not([data-mobile-screen="more"]) {
    display: none;
  }
  body[data-mobile-page="income"] .workspace-bar,
  body[data-mobile-page="more"] .workspace-bar {
    display: none;
  }
  .personal-wallet {
    margin: 8px 0;
    padding: 20px 16px;
    border-radius: 19px;
  }
  .personal-wallet .sectionhead {
    flex-wrap: wrap;
    gap: 14px;
  }
  .personal-wallet .sectionhead .primary {
    width: 100%;
  }
  .wallet-cards {
    grid-template-columns: 1fr;
  }
  .wallet-cards article {
    border-radius: 14px;
  }
  #openOutflows {
    width: 100%;
    margin: 12px 0;
  }
  .toolbar {
    margin: 20px 0;
    flex-wrap: wrap;
  }
  .toolbar .month {
    flex: 1;
    justify-content: space-between;
  }
  .toolbar .primary {
    width: 100%;
    padding: 14px;
  }
  .stats {
    gap: 7px;
  }
  .stats article {
    padding: 14px 9px;
  }
  .stats strong {
    font-size: 18px;
  }
  .accounts {
    border-radius: 18px;
  }
  .bill {
    flex-wrap: wrap;
  }
  .billinfo {
    flex: 1;
    min-width: 130px;
  }
  .billamount {
    margin-left: auto;
  }
  .billactions {
    width: 100%;
    flex-direction: row;
    justify-content: flex-end;
    border-top: 1px dashed #e5eade;
    padding-top: 5px;
  }
  .billactions .text {
    font-size: 12px;
    padding: 9px;
  }
  .filters {
    overflow-x: auto;
    white-space: nowrap;
  }
  .income-history-head {
    gap: 4px;
  }
  .income-history-head h3 {
    line-height: 1.5;
  }
  .income-history-head label {
    width: 100%;
  }
  .income-entry {
    align-items: flex-start;
    gap: 8px;
  }
  .income-entry p {
    overflow-wrap: anywhere;
  }
  dialog,
  dialog#planDialog,
  dialog#participantsDialog,
  dialog#importDialog,
  dialog#outflowsDialog {
    position: fixed;
    inset: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    padding: calc(16px + env(safe-area-inset-top)) 20px
      calc(24px + env(safe-area-inset-bottom));
    overflow: auto;
    overscroll-behavior: contain;
    background: #f9faf6;
  }
  dialog .dialoghead {
    position: sticky;
    top: calc(-16px - env(safe-area-inset-top));
    z-index: 5;
    background: #f9faf6;
    border-bottom: 1px solid #e3e9de;
    margin: -1px -2px 20px;
    padding: 8px 2px;
    gap: 8px;
  }
  dialog .dialoghead h2 {
    font-size: 19px;
    margin: 12px 0;
  }
  dialog input,
  dialog select,
  #authForm input {
    font-size: 16px;
  }
  dialog .primary {
    padding: 15px 18px;
  }
  #form > .primary,
  #incomeForm > .primary,
  #profileForm > .primary {
    width: 100%;
    margin-top: 18px;
  }
  .formrow {
    flex-wrap: wrap;
  }
  .formrow label {
    flex-basis: 140px;
  }
  #planDialog .plan-footer {
    bottom: calc(-24px - env(safe-area-inset-bottom));
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    background: #f9faf6;
  }
  #planDialog .plan-scroll {
    overflow: visible;
  }
  #toast {
    z-index: 100;
    bottom: calc(90px + env(safe-area-inset-bottom));
    width: calc(100% - 36px);
    max-width: 500px;
    text-align: center;
  }
  #authPanel {
    margin-top: 14px;
    padding: 24px 18px;
  }
  #authPanel h1 {
    font-size: 29px;
  }
  .participant-table-wrap {
    max-height: none;
  }
  .home-shortcuts .primary,
  .home-shortcuts .secondary {
    font-size: 12px;
    padding: 14px 10px;
  }
  @keyframes screen-in {
    from {
      opacity: 0.5;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-screen {
    animation: none;
  }
}

@media (max-width: 760px) {
  body:has(dialog[open]) {
    overflow: hidden;
  }
}
