* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:#ede5d8;
  color:#342f29;
  font:16px system-ui,sans-serif;
}
header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:17px max(5vw,16px);
  border-bottom:1px solid #b7c0b5;
}
a {
  color:inherit;
}
header b,.mono,footer,.stamp,.label {
  font:700 12px ui-monospace,monospace;
  letter-spacing:.08em;
}
header i,h1 span {
  color:#a54628;
}
main {
  max-width:650px;
  margin:38px auto;
  padding:0 18px 30px;
}
.stamp {
  display:inline-block;
  border:1px solid #995236;
  color:#863d26;
  padding:4px 8px;
  transform:rotate(-3deg);
}
h1 {
  font:normal clamp(40px,7vw,61px)/1 Georgia,serif;
  letter-spacing:-.055em;
  margin:16px 0 8px;
}
.intro p {
  margin:0 0 24px;
  color:#544a42;
}
nav {
  display:flex;
  margin-bottom:16px;
  gap:6px;
}
button,select {
  font:inherit;
  color:inherit;
  border:1px solid #a5b3a8;
  background:transparent;
  border-radius:5px;
  padding:10px 14px;
  min-height:44px;
  cursor:pointer;
}
nav button[aria-pressed=true],.primary {
  background:#673e32;
  color:white;
  border-color:#673e32;
}
.paper {
  background:#fffaf0;
  padding:clamp(18px,5vw,34px);
  border-top:4px solid #673e32;
  box-shadow:0 3px 9px #342f2914;
  position:relative;
}
.paper:after {
  content:"";
  position:absolute;
  bottom:-6px;
  left:0;
  right:0;
  height:7px;
  background:linear-gradient(135deg,#fffaf0 25%,transparent 25%) -5px 0,linear-gradient(225deg,#fffaf0 25%,transparent 25%) -5px 0;
  background-size:10px 14px;
}
.row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:7px 0;
}
.row strong {
  white-space:nowrap;
}
.dash {
  border-top:1px dashed #acb0a1;
  margin:17px 0;
}
.total {
  font:normal 46px/1 Georgia,serif;
  letter-spacing:-.05em;
}
.label {
  color:#655a4e;
}
h2 {
  font:normal 29px Georgia,serif;
  letter-spacing:-.035em;
  margin:7px 0;
}
p {
  line-height:1.45;
}
.actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:17px;
}
.actions button {
  flex:auto;
}
.note,small {
  font-size:14px;
  color:#655a4e;
}
.alert {
  border-left:3px solid #ad643f;
  padding-left:12px;
}
footer {
  display:flex;
  justify-content:space-between;
  margin-top:24px;
  color:#5c685e;
  font-size:10px;
}
select {
  width:100%;
  margin-top:7px;
}
button:focus-visible,a:focus-visible,select:focus-visible {
  outline:3px solid #b15c2b;
  outline-offset:2px;
}
.total,.row strong {
  font-variant-numeric:tabular-nums;
}
.row strong {
  font-family:ui-monospace,monospace;
}
header a {
  display:inline-flex;
  align-items:center;
  min-height:44px;
}
header {
  padding-top:6px;
  padding-bottom:6px;
}

/* The receipt and roll each have their own scroll region below the controls. */
body.page-settle main {display:flex;flex-direction:column;min-height:0;width:100%;flex:1;overflow:hidden}
.page-settle #screen {display:flex;flex:1;min-height:0;overflow:hidden}
.page-settle #screen .paper {display:flex;flex-direction:column;width:100%;min-height:0;overflow:hidden}
.page-settle #screen .detail-scroll {min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scroll-padding:4px}
.page-settle .balance-line {display:flex;align-items:center;justify-content:space-between;margin-top:8px}
.page-settle .badge {padding:3px 8px;border-radius:3px;background:#ece4d7;color:#583b27;font-size:13px}
.page-settle .badge.paid {background:#e0eade;color:#28442a}
.page-settle .badge.held {background:#f6dbb8;color:#6e3c0d}
.page-settle .purchase {border-top:1px dashed #c1b6a4;padding:6px 0}
.page-settle .purchase .row {padding:2px 0}
.page-settle .person {display:grid;grid-template-columns:minmax(0,1fr) auto;width:100%;gap:4px;align-items:center;text-align:right;border:0;border-bottom:1px solid #d6cdbf;border-radius:0;padding:4px 0;font-variant-numeric:tabular-nums}
.page-settle .person-name {text-align:left}
.page-settle .person-name small {display:block;font-size:12px}
.page-settle .view-overview>button,.page-settle [data-action="all"] {align-self:start;font-size:14px;padding:5px 9px}
.page-settle .view-account h3,.page-settle .view-account h2,.page-settle .view-overview h2 {margin:5px 0}
.page-settle .paper .actions {flex:none}
.page-settle .paper .alert {margin:4px 0;font-size:14px}
@media (max-height:470px) and (min-width:550px) {
  .page-settle #screen .view-account {display:grid;grid-template-columns:minmax(165px,.75fr) minmax(0,1.25fr);grid-template-rows:auto auto auto 1fr;align-content:start;gap:2px 16px}
  .page-settle #screen .view-account > :not(.detail-scroll) {grid-column:1}
  .page-settle #screen .view-account > .detail-scroll {grid-column:2;grid-row:1/-1;height:100%}
  .page-settle #screen .view-account .label,.page-settle #screen .view-account select {margin:0}
  .page-settle #screen .view-account .actions {margin:2px 0}
  .page-settle #screen .view-account .actions button {padding:4px;font-size:14px}
  .page-settle #screen .view-account .total {font-size:1.9rem}
  .page-settle #screen .view-account:has(.alert) .alert {grid-column:2;grid-row:1}
  .page-settle #screen .view-account:has(.alert) .detail-scroll {grid-row:2/-1}
}
.page-settle .roll-heading {display:flex;justify-content:space-between;align-items:center}
.page-settle .roll-heading button {padding:4px 6px;border:0;text-decoration:underline;font-size:13px}
@media (max-height:470px) and (min-width:550px) {
  .page-settle #screen .view-overview {padding:4px 10px}
  .page-settle .view-overview .detail-scroll {display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:0 10px}
  .page-settle .view-overview .person {font-size:14px;grid-template-columns:minmax(0,1fr) auto}
}
.page-settle .paid-receipt {border-top:1px dashed #beaf98}
.page-settle .paid-receipt summary small {margin-left:5px}
.page-settle .sheet {max-width:400px;margin:auto;padding:10px 16px 14px;border:1px solid #c9c2b7;border-radius:16px;background:#faf8f4}
.page-settle .sheet-head,.page-settle .wallet-card {display:flex;align-items:center;gap:12px}
.page-settle .sheet-head {justify-content:space-between}
.page-settle .sheet-head button,.page-settle .sheet>[data-action="decline"] {border:none;font-size:14px;text-decoration:underline}
.page-settle .wallet-card {border:1px solid #d3cbbc;background:white;border-radius:8px;padding:8px}
.page-settle .wallet-card small {display:block}
.page-settle .card-swatch {width:44px;height:29px;border-radius:5px;background:linear-gradient(135deg,#29363a,#476a74);border-top:6px solid #14282d}
.page-settle .success-mark {display:block;color:#316346;font-size:1.9rem}
.page-settle .view-account h3 {font-size:1.05rem;margin:9px 0 5px}
@media (max-height:470px) and (min-width:550px) {
  .page-settle .sheet {max-width:none;display:grid;grid-template-columns:1fr 1fr;gap:3px 14px}
  .page-settle .sheet-head {grid-column:1/-1}
  .page-settle .sheet h2,.page-settle .sheet .note {margin:0}
}

.page-settle .apple-sheet { background: #f2f2f5; color: #18191b; font-family: system-ui, sans-serif; }
.page-settle .apple-sheet h2 { font: 650 1.85rem/1.15 system-ui, sans-serif; letter-spacing: -.045em; }
.page-settle .apple-sheet .primary { background: #172125; border-color: #172125; border-radius: 12px; }
.page-settle .apple-sheet .row { padding: 10px 0; border-bottom: 1px solid #d4d5d6; }

.page-settle .fee-breakdown small {display:block;font-size:.85rem;font-weight:550}
.page-settle .wallet-bill {background:white;color:#172125;padding:0 10px;border-radius:8px}
.page-settle .apple-sheet .wallet-bill .row {min-height:30px;padding:5px 0}
.page-settle .wallet-bill > .row {font-weight:700}
.page-settle .apple-sheet .wallet-bill .fee-breakdown .row:last-child {border:0}
.page-settle .apple-sheet .wallet-identity h2 {margin:2px 0 5px}
.page-settle .apple-sheet .wallet-identity .note {margin:3px 0}
@media (min-width:550px) and (max-height:470px) {
  .page-settle .apple-sheet {align-items:center;padding:4px 10px;gap:2px 12px}
  .page-settle .apple-sheet .wallet-identity {grid-column:1;grid-row:2}
  .page-settle .apple-sheet .wallet-bill {grid-column:2;grid-row:2}
  .page-settle .apple-sheet .actions {grid-column:2;grid-row:3;margin:0}
  .page-settle .apple-sheet > [data-action="decline"], .page-settle .apple-sheet > .note {grid-column:1;grid-row:3}
}
/* The payment sheet carries its own title and cancel action. Give the quote the full workspace. */
.page-settle main:has(.apple-sheet) > .intro,
.page-settle main:has(.apple-sheet) > nav {display:none}
.page-settle #screen .paper:has(.apple-sheet) {padding:6px}
@media (max-height:470px) {
  .page-settle:has(.apple-sheet) > header {display:none}
  .page-settle .apple-sheet .wallet-bill .row {line-height:1.15;padding-block:4px}
}
