/* Bill splitter from a photo. Page styles on top of the shared theme.css. Built by Suman Mukherjee. */
.masthead h1 { max-width: 20ch; }
.privacy strong { color: var(--allow); }
main .section { max-width: 900px; }
main .section.why, main .section:has(.steps) { max-width: none; }

.step-h { display: flex; align-items: baseline; gap: 10px; }
.step-h .n { font-weight: 800; font-variation-settings: "wdth" 120; color: var(--cobalt); font-size: 1.15em; }

.capture { padding-top: clamp(18px, 3vw, 30px); }
.photo-btn { font-size: 18px; padding: 16px 24px; min-height: 60px; cursor: pointer; margin-top: 8px; }
.photo-btn svg { flex: none; }
.alt-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.alt-row label.btn { cursor: pointer; }
.alt-row .btn, .btn-row .btn { min-height: 44px; }
label.btn:focus-within, .photo-btn:focus-within { outline: 3px solid var(--cobalt); outline-offset: 2px; }
input.sr-only:focus-visible + * { outline: 3px solid var(--cobalt); }
.first-use { margin: 8px 0 0; }

.progress { margin: 14px 0 6px; }
.progress .bar { height: 8px; background: var(--rule-2); border-radius: 4px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; width: 2%; background: var(--cobalt); transition: width .2s; }
.progress p { margin: 6px 0 0; color: var(--ink-2); }
.progress p.err { color: var(--deny); font-weight: 600; }
.preview { margin: 12px 0 0; }
.preview img { display: block; max-height: 260px; width: auto; max-width: 100%; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
.preview figcaption { margin-top: 4px; }

.type-box { margin-top: 16px; }
.field-label { display: block; font-weight: 700; margin: 14px 0 6px; }
#typed, #sum-text { width: 100%; font-size: 15px; }
#sum-text { font-family: var(--mono); font-size: 13px; background: var(--sheet); }

/* people */
.people { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.people li { display: flex; gap: 4px; align-items: center; }
.people input { width: 9.5em; min-height: 44px; font-weight: 600; }
.add-person { display: flex; gap: 8px; flex-wrap: wrap; max-width: 420px; }
.add-person input { flex: 1 1 10em; width: auto; min-height: 44px; }

/* lines */
.list-h { margin: 22px 0 6px; }
.lines { list-style: none; padding: 0; margin: 6px 0 10px; border-top: 2px solid var(--ink); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 9.5em 44px; gap: 8px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.line .name { min-height: 44px; font-weight: 600; }
.amt-wrap { display: flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.amt-wrap .amt { text-align: right; font-variant-numeric: tabular-nums; min-height: 44px; font-weight: 650; }
.amt[aria-invalid="true"] { border-color: var(--deny); }
.chips, .line .flag, .line .bad, .line .kind { grid-column: 1 / -1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { appearance: none; font: inherit; font-size: 14px; font-weight: 600; min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--sheet); color: var(--ink-2); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.chip.all { border-style: dashed; }
.line .flag { margin: 0; color: var(--review); font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.line .flag[hidden], .line .bad[hidden] { display: none; }
.line .flag .stamp { font-size: 11px; }
.line .bad { margin: 0; color: var(--deny); font-weight: 600; }
.charge .kind select { width: auto; min-height: 40px; font-size: 14px; }
.del { appearance: none; border: 1px solid var(--rule); background: var(--sheet); border-radius: var(--radius); width: 44px; height: 44px; font-size: 22px; line-height: 1; color: var(--ink-2); cursor: pointer; }
.del:hover:not(:disabled) { color: var(--deny); border-color: var(--deny); }
.del:disabled { opacity: .35; cursor: not-allowed; }
.empty { margin: 8px 0; }
.empty[hidden] { display: none; }

.check p { margin: 8px 0; padding: 10px 12px; border-left: 4px solid var(--rule); background: var(--sheet); max-width: none; line-height: 1.7; }
.check .stamp, .sum-check .stamp { margin-right: 8px; }
.check p.ok { border-color: var(--allow); }
.check p.warn { border-color: var(--review); background: var(--review-wash); }
.check .stamp { font-size: 12px; }
.notes { margin-top: 14px; padding: 10px 12px; background: var(--cobalt-wash); border-left: 4px solid var(--cobalt); }
.notes ul { margin: 6px 0 0; padding-left: 20px; }

/* tip and payer */
.tip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px 24px; align-items: start; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.seg legend { padding: 0; margin-bottom: 6px; font-weight: 650; font-size: 13.5px; color: var(--ink-2); }
.tip-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
#tip-value { width: 7em; min-height: 44px; text-align: right; }
.radio { display: inline-flex; gap: 6px; align-items: center; min-height: 40px; cursor: pointer; }
.radio input { accent-color: var(--cobalt); width: 18px; height: 18px; }
.field select, .field input { min-height: 44px; }

/* summary */
#sum-table tr.payer th { color: var(--cobalt); }
#sum-table .paid { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
#sum-table tfoot th, #sum-table tfoot td { border-top: 1.5px solid var(--ink); border-bottom: 0; }
#sum-table th[scope=row] { text-align: left; font-weight: 650; color: var(--ink); font-size: 14.5px; padding: 9px 10px; }
.sum-check { margin: 14px 0 6px; max-width: none; line-height: 1.7; }
.warn-text { color: var(--review); font-weight: 650; }
.owes { list-style: none; padding: 0; margin: 6px 0 4px; }
.owes li { padding: 6px 0; border-bottom: 1px dashed var(--rule); font-size: 16px; }
.owes .owe-amt { font-variant-numeric: tabular-nums; }
.export { margin-top: 10px; }
.export .btn { min-height: 48px; }

/* evaluation and text sections */
table.data tr.key td { font-weight: 700; background: var(--review-wash); }
table.data td .of { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.eval-notes { max-width: 80ch; margin-top: 12px; }
.eval-notes p { color: var(--ink-2); }
.eval-notes b { color: var(--ink); }
.install { padding-left: 20px; max-width: 80ch; }
.install li { margin: 6px 0; }
.why { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; }
.limits ul { padding-left: 18px; }
.limits li { margin: 6px 0; }

@media (max-width: 720px) {
  .why { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .photo-btn { width: 100%; justify-content: center; }
  .line { grid-template-columns: minmax(0, 1fr) 44px; }
  .line .name { grid-column: 1 / -1; }
  .line .amt-wrap { grid-column: 1 / 2; }
  .people input { width: 8em; }
  #sum-table { font-size: 13px; }
  #sum-table th, #sum-table td, #sum-table th[scope=row] { padding: 7px 4px; font-size: 13px; }
  #sum-table .paid { display: block; width: max-content; margin: 2px 0 0; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li, .steps li + li { padding-left: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
}
