:root {
  color-scheme: light;
  --paper: #f6f5ee;
  --ink: #223d34;
  --muted: #65756d;
  --green: #174e40;
  --lime: #d4ef9e;
  --line: #dfe4d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .35; }
button, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid #689e39; outline-offset: 3px; }
input { color: var(--ink); min-width: 0; width: 100%; font-variant-numeric: tabular-nums; }
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input::placeholder { color: #89968d; opacity: 1; }
.page { max-width: 900px; margin: 0 auto; padding: 64px 28px 30px; }
.intro { margin-bottom: 34px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 10px; font-weight: 750; letter-spacing: 2px; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #bbcabc; border-radius: 50%; font-size: 24px; font-weight: 500; letter-spacing: 0; }
h1 { margin: 20px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 6vw, 54px); font-weight: 500; letter-spacing: -2px; line-height: 1.1; }
h1 > span { color: #619449; }
.intro > p { margin: 0; color: var(--muted); font-size: 16px; }
.calculator { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.inputs { background: #fffefa; border: 1px solid var(--line); border-radius: 22px; padding: 28px; }
.section-heading, .receipt-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 26px; }
h2 { font-size: 16px; font-weight: 650; margin: 0; }
.reset { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: -8px -6px; padding: 8px 6px; border: 0; background: none; color: var(--muted); font-size: 12px; }
.reset:hover { color: var(--green); }
.reset > span { font-size: 19px; }
label, legend { font-size: 13px; font-weight: 650; }
.field > label { display: block; margin-bottom: 10px; }
.input-wrap { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #f8faf5; padding: 0 16px; }
.input-wrap:focus-within { border-color: #67974d; }
.input-wrap > span { color: var(--muted); font-size: 20px; }
.input-wrap > input { border: 0; background: transparent; padding: 14px 0; }
.bill-wrap { gap: 12px; }
.bill-wrap > input { font-size: 27px; font-weight: 550; }
fieldset { padding: 0; border: 0; margin: 25px 0; min-width: 0; }
legend { padding: 0; margin-bottom: 11px; }
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.presets > button { border: 1px solid var(--line); border-radius: 9px; min-height: 47px; padding: 8px 2px; color: var(--ink); background: #fffefa; font-size: 15px; font-weight: 600; }
.presets > button:hover { border-color: #67974d; background: #f1f6e9; }
.presets > button[aria-pressed=true] { color: white; background: var(--green); border-color: var(--green); }
.custom-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.custom-row > label { color: var(--muted); font-size: 12px; font-weight: 400; }
.custom-wrap { width: 113px; padding: 0 12px; gap: 5px; }
.custom-wrap > input { padding: 10px 0; font-size: 16px; text-align: right; }
.custom-wrap > span { font-size: 14px; }
.people-control { display: flex; align-items: center; justify-content: space-between; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf5; }
.people-control > button { flex: 0 0 44px; height: 44px; border-radius: 7px; background: #fffefa; border: 1px solid var(--line); color: var(--green); font-size: 23px; }
.people-control > button:not(:disabled):hover { background: #e7efde; }
.people-value { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; min-width: 0; }
.people-value > input { width: 4ch; text-align: center; border: 0; background: transparent; font-size: 20px; font-weight: 600; padding: 9px 0; }
.people-value > span { font-size: 13px; color: var(--muted); }
.field-error { font-size: 12px; line-height: 1.45; color: #a13222; margin: 8px 0 0; }
input[aria-invalid=true] { color: #a13222; }
.receipt { display: flex; flex-direction: column; background: var(--green); color: #f4f8ed; padding: 30px; border-radius: 22px; }
.receipt-heading { margin-bottom: 30px; }
.receipt-heading > svg { color: #bcd1b8; }
.receipt-heading > h2 { font-weight: 500; }
.per-person > p { margin: 0; font-size: 14px; color: #d1e0cc; }
.per-person > output { display: block; margin: 9px 0 8px; font-size: clamp(31px, 5vw, 55px); line-height: 1.2; letter-spacing: -2px; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.per-person > p.tip-included { font-size: 12px; color: var(--lime); }
.breakdown { padding-top: 25px; margin: 28px 0 0; border-top: 1px dashed #709b80; }
.breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 14px; margin-bottom: 15px; }
dt { color: #d1e0cc; }
dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.breakdown > div.grand-total { padding-top: 15px; border-top: 1px solid #3c6a55; margin-bottom: 0; font-weight: 650; font-size: 17px; }
.grand-total > dt { color: #f4f8ed; }
.split-note { min-height: 36px; font-size: 12px; line-height: 1.5; color: #d1e0cc; margin: 18px 0 22px; }
.receipt-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 10px; color: #bed5b5; }
.receipt-footer > span { color: var(--lime); font-size: 17px; }
.page-footer { text-align: center; color: var(--muted); font-size: 11px; margin-top: 24px; }
.page-footer > span { padding: 0 6px; }
.noscript { padding: 16px; border: 1px solid #a13222; border-radius: 10px; }
@media (max-width: 650px) {
  .page { max-width: 450px; padding: 30px 18px 25px; }
  .intro { margin-bottom: 25px; }
  h1 { margin-top: 19px; letter-spacing: -1.5px; }
  .calculator { grid-template-columns: 1fr; gap: 14px; }
  .inputs, .receipt { padding: 24px; border-radius: 18px; }
  .receipt-heading { margin-bottom: 22px; }
  .per-person > output { font-size: clamp(32px, 10vw, 47px); }
  .split-note { min-height: 0; }
}
@media (max-width: 340px) {
  .page { padding-inline: 12px; }
  .inputs, .receipt { padding: 20px; }
  .presets { gap: 6px; }
}
