/* Bill split page (/split-bill-upi/). Tokens and components come from site.css. */

.split-people { border: 0; padding: 0; margin: 0.5rem 0 1.25rem; min-width: 0; }
.split-people > legend { padding: 0; }
.split-check-hint { display: block; margin-top: 0.15rem; }
.split-section-title { margin-top: 0.25rem; padding-top: 1rem; border-top: 1px dashed var(--border); }

/* People list: one roomy row per person, thumb sized controls */
.split-list { list-style: none; padding: 0; margin: 0.5rem 0 0.75rem; }
.split-person {
  margin: 0; padding: 0.6rem 0; border-top: 1px solid var(--border);
}
.split-person:last-child { border-bottom: 1px solid var(--border); }
.split-person-main { display: flex; gap: 0.5rem; align-items: center; }
.split-person-main .input { flex: 1 1 auto; min-width: 0; }
.split-remove { flex: none; width: 48px; padding: 0; color: var(--muted); }
.split-remove svg { width: 20px; height: 20px; max-width: none; }
.split-remove:hover { color: var(--danger); }
.split-me-label { margin: 0; min-height: 48px; display: flex; align-items: center; font-weight: 600; overflow-wrap: anywhere; }

/* Uneven controls: hidden (and out of the tab order) until "Uneven split" is ticked */
.split-uneven { display: none; }
.split-form.is-uneven .split-uneven {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; margin-top: 0.5rem;
}
.split-value { font-variant-numeric: tabular-nums; }
.split-uneven .field-error { grid-column: 1 / -1; margin-top: 0; }
.split-uneven-hint { display: none; margin-top: 0.75rem; }
.split-form.is-uneven .split-uneven-hint { display: block; }
.split-add { margin-top: 0.25rem; }

@media (min-width: 30rem) {
  .split-form.is-uneven .split-person { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 0.5rem; align-items: start; }
  .split-form.is-uneven .split-uneven { margin-top: 0; }
}

/* Results */
.split-status { margin: 0 0 0.75rem; font-variant-numeric: tabular-nums; }
.split-status.is-error { color: var(--danger); font-weight: 550; }
.split-rows { list-style: none; padding: 0; margin: 0 0 1rem; }
.split-row { margin: 0; padding: 0.85rem 0; border-top: 1px dashed var(--border-strong); }
.split-row:last-child { border-bottom: 1px dashed var(--border-strong); }
.split-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.split-row-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.split-row-amount { font-size: 1.25rem; font-weight: 650; white-space: nowrap; }
.split-row-note { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }
.split-row .copy-row { margin-top: 0.5rem; }
.split-qr-toggle { margin-top: 0.35rem; margin-left: -0.6rem; }
.split-qr { padding: 0.5rem 0 0.25rem; text-align: center; }
.split-qr .qr-panel { max-width: 16rem; }
.split-qr-caption { margin: 0.5rem 0 0; color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }

/* Summary for a chat */
.split-summary-wrap { margin-top: 1.25rem; }
.split-summary-title { font-size: 1rem; margin: 0 0 0.5rem; }
.split-summary {
  margin: 0; padding: 0.85rem; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: var(--mono); font-size: 0.85rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.split-howto ol { padding-left: 1.25rem; }

@media print {
  .split-qr-toggle, .split-row .copy-row .btn { display: none; }
}
