:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", sans-serif;
  color: #182e25;
  background: #f5f8f6;
  font-synthesis: none;
  --green: #176749;
  --green-dark: #104c36;
  --muted: #63786d;
  --line: #e3ebe6;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button {
  min-height: 44px; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; background: white; color: var(--green-dark);
  font-weight: 600; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: 9px;
}
button:hover { background: #edf5ef; }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #448b66; outline-offset: 3px;
}
button.primary { background: var(--green); color: white; border-color: var(--green); }
button.primary:hover { background: var(--green-dark); }
button.secondary { background: #e2efe6; border-color: #e2efe6; }
button.quiet { background: transparent; border-color: transparent; }
button.quiet:hover { background: #eef3ef; }
button.danger { color: #a74336; }
button.wide { width: 100%; margin-top: 14px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }
.icon-button { width: 44px; min-width: 44px; padding: 10px; }
button.text-button { border: 0; background: none; padding: 0; text-align: left; justify-content: start; overflow-wrap: anywhere; min-height: 44px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.65px; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.5px; }
h3 { font-size: 16px; font-weight: 650; letter-spacing: -.25px; }
p { line-height: 1.55; }
small, .hint { color: var(--muted); font-size: 13px; }
strong, .amount-row, .share-list li > span { font-variant-numeric: tabular-nums; }
.masthead { max-width: 1184px; margin: auto; padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; color: var(--green-dark); text-decoration: none; font-size: 26px; font-weight: 750; letter-spacing: -1.3px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--green); color: #d8efb0; border-radius: 11px; margin-right: 11px; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand-dot { color: #83ae46; }
main { max-width: 1184px; margin: auto; padding: 22px 32px 0; }
.bill-heading { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin-bottom: 32px; }
.title-block { min-width: 0; flex: 1; }
label { display: block; font-size: 13px; font-weight: 600; }
.title-block > label { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.title-block > label .icon { width: 13px; height: 13px; }
input:not([type=checkbox]), textarea, select { width: 100%; border: 1px solid #d4dfd7; border-radius: 11px; background: #f8faf8; padding: 12px 14px; color: #182e25; min-height: 48px; margin-top: 7px; font-size: 16px; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 16px 0; margin: 18px 0 0; min-width: 0; }
legend { font-size: 14px; font-weight: 650; padding-right: 12px; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--green); }
.people-heading { margin-top: 26px; }
.discount-person { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.discount-person > span { min-width: 0; overflow-wrap: anywhere; }
.discount-person small { display: block; margin-top: 3px; }
.sample-note { background: #edf5ef; padding: 12px; border-radius: 10px; font-size: 13px; margin: 12px 0; }
[hidden] { display: none !important; }
#adjustments-error:empty { display: none; }
#bill-name { font-size: 36px; font-weight: 650; letter-spacing: -1.4px; padding: 5px 0; margin: 3px 0 5px; background: transparent; border: 0; border-radius: 3px; max-width: 650px; }
.session-note { color: var(--muted); display: flex; align-items: center; gap: 6px; font-size: 12px; }
.session-note .icon { width: 14px; height: 14px; }
.bill-glance { display: grid; gap: 6px; text-align: right; padding-left: 24px; flex-shrink: 0; }
.bill-glance > span { font-size: 12px; color: var(--muted); }
.bill-glance strong { font-size: 30px; letter-spacing: -1px; font-weight: 650; color: var(--green-dark); font-variant-numeric: tabular-nums; }
nav { display: flex; gap: 5px; width: fit-content; background: #e8efea; padding: 5px; border-radius: 15px; margin-bottom: 30px; }
nav button { background: transparent; border: 0; color: var(--muted); padding: 10px 24px; font-size: 13px; border-radius: 11px; }
nav .icon { width: 18px; height: 18px; }
nav [aria-current] { background: white; color: var(--green-dark); box-shadow: 0 2px 5px #173c2510; }
#notice { position: fixed; z-index: 15; left: 50%; bottom: 24px; transform: translateX(-50%); width: max-content; max-width: min(540px,calc(100% - 32px)); max-height: 140px; overflow: auto; background: var(--green-dark); color: white; border-radius: 12px; padding: 13px 18px; font-size: 13px; box-shadow: 0 6px 28px #163d2620; overflow-wrap: anywhere; }
#notice:empty { display: none; }
.workspace-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(0,1fr); gap: 28px; align-items: start; }
.receipt { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 26px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 12px; }
.section-heading > div { min-width: 0; }
.section-heading p { color: var(--muted); font-size: 13px; margin-top: 5px; }
.heading-inline { display: flex; align-items: center; gap: 10px; }
.count { font-size: 11px; font-weight: 600; color: var(--muted); background: #eff4f0; padding: 4px 8px; border-radius: 7px; white-space: nowrap; }
.empty { text-align: center; padding: 50px 12px 54px; }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: #eef5ef; color: #4c8a66; margin-bottom: 20px; }
.empty-icon .icon { width: 28px; height: 28px; stroke-width: 1.3; }
.empty h2, .empty h3 { font-size: 17px; font-weight: 600; letter-spacing: -.35px; }
.empty p { color: var(--muted); margin-top: 8px; font-size: 13px; }
.empty.small { padding: 42px 15px; background: #edf3ee; border: 1px dashed #cdded1; border-radius: 18px; }
.item-list, .share-list { list-style: none; padding: 0; margin: 0; }
.item-row { padding: 22px 0 17px; border-bottom: 1px solid var(--line); }
.item-top { display: flex; align-items: center; gap: 10px; }
.item-description { flex: 1; min-width: 0; }
.item-description h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; overflow-wrap: anywhere; }
.item-description p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.item-top strong { font-size: 15px; white-space: nowrap; font-weight: 650; }
.drag-handle { padding: 6px 0; width: 22px; min-width: 22px; background: transparent; border: 0; color: #9aaba0; cursor: grab; touch-action: none; user-select: none; }
.item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 0 32px; }
.assignment { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.assignment .icon { width: 14px; height: 14px; }
.warning { color: #936024; }
.item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.item-actions button { border-color: transparent; width: 40px; min-width: 40px; padding: 9px; color: #5c7768; }
.item-actions button.danger { color: #a16b62; }
.item-actions .icon { width: 17px; height: 17px; }
.receipt-total { margin-top: 23px; }
.amount-row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 12px 0; font-size: 13px; }
.amount-row > span:last-child { white-space: nowrap; }
.amount-row.strong { font-size: 17px; font-weight: 650; letter-spacing: -.25px; }
.diners > .section-heading { margin: 0 0 18px; padding: 5px 0; }
.diner-card { border: 1px solid var(--line); border-radius: 16px; background: white; padding: 20px; margin-bottom: 12px; }
.diner-card-heading { display: flex; align-items: center; gap: 11px; }
.diner-card-heading > div { flex: 1; min-width: 0; }
.diner-card-heading h3 { overflow-wrap: anywhere; }
.diner-card-heading p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.diner-card-heading .icon { width: 16px; height: 16px; }
.avatar { width: 40px; height: 40px; border-radius: 14px; background: #e1eedf; color: #456e45; display: inline-grid; place-items: center; flex-shrink: 0; font-size: 15px; font-weight: 650; }
.color-1 { background: #f4ecdb; color: #856c3e; }
.color-2 { background: #e6eaf4; color: #626c93; }
.color-3 { background: #efe5ed; color: #86617f; }
.color-4 { background: #f3e5df; color: #946e5f; }
.item-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; }
.item-chips:empty { margin: 8px 0; }
.chip { font-size: 11px; background: #f4f7f4; border: 0; padding: 6px 9px; border-radius: 7px; max-width: 100%; overflow-wrap: anywhere; font-weight: 500; }
.diner-card .amount-row { border-top: 1px solid #eef2ef; padding-top: 12px; margin-bottom: 0; }
.diner-card .amount-row > span:first-child { font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.mobile-diners { display: none; }
.adjustment-note { max-width: 520px; margin: 35px auto; text-align: center; }
.adjustment-note p { margin: 16px 0 25px; color: var(--muted); font-size: 14px; }
.summary-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 26px; align-items: start; }
.summary > .section-heading { margin-bottom: 24px; }
.summary-total { position: sticky; top: 24px; }
.summary-total p { margin-top: 18px; font-size: 12px; }
.receipt-check, .complete { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.receipt-check .icon, .complete .icon { width: 15px; height: 15px; }
.summary-total .complete { color: var(--green); }
.diner-summary { margin-bottom: 16px; }
.diner-summary h2, .summary .section-heading p { overflow-wrap: anywhere; }
.share-list { margin: 14px 0 20px; }
.share-list li { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-list li > div { min-width: 0; }
.share-list li > span { white-space: nowrap; font-size: 13px; }
.share-list small { display: block; font-size: 11px; margin-top: -4px; }
.owed { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 18px; color: var(--green-dark); }
.adjustment-details { color: var(--muted); font-size: 13px; }
.adjustment-details summary { min-height: 44px; padding-top: 12px; cursor: pointer; }
.adjustment-details summary span { float: right; }
.adjustment-details .amount-row { padding-left: 12px; }
.unassigned { border-color: #e2d4bc; }
footer { color: #738579; font-size: 11px; padding: 28px 0; text-align: center; }
dialog { width: min(500px,calc(100% - 24px)); max-height: calc(100dvh - 32px); border: 0; border-radius: 22px; padding: 28px; color: #182e25; overscroll-behavior: contain; box-shadow: 0 24px 90px #123b2630; }
dialog::backdrop { background: #142e235c; backdrop-filter: blur(5px); }
dialog label { margin: 18px 0; }
dialog h2 { overflow-wrap: anywhere; font-size: 22px; }
dialog p { margin: 12px 0; }
dialog .section-heading { align-items: start; }
dialog .error:empty { display: none; }
.error { color: #a74336; padding: 10px 12px; background: #fff4f0; border-radius: 8px; font-size: 13px; }
.assign-list { display: grid; gap: 8px; }
.assign-list button { overflow-wrap: anywhere; }
.split-price { font-size: 27px; font-weight: 650; letter-spacing: -.8px; color: var(--green-dark); }
.weight-row { display: grid; grid-template-columns: minmax(0,1fr) 85px 60px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.weight-choice { display: flex; align-items: center; gap: 10px; overflow-wrap: anywhere; min-width: 0; }
.weight-choice input { width: 21px; height: 21px; flex-shrink: 0; accent-color: var(--green); }
.weight-value { font-weight: 400; color: var(--muted); font-size: 11px; }
.weight-row output { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
textarea { resize: vertical; font-size: 14px; min-height: 200px; }
.header-actions { display: flex; gap: 8px; }
.receipt-note { min-height: 80px; }
.drop-active { outline: 2px solid #508c62; outline-offset: 2px; background: #e9f5e8; }
#drag-label { position: fixed; z-index: 20; pointer-events: none; background: var(--green-dark); color: white; padding: 10px 14px; border-radius: 10px; width: 170px; font-size: 13px; overflow-wrap: anywhere; box-shadow: 0 3px 12px #0003; }
@media(max-width:760px) {
  .masthead { padding: 16px 20px; }
  .brand { font-size: 24px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  main { padding: 14px 18px 0; }
  .bill-heading { display: block; margin-bottom: 22px; }
  #bill-name { font-size: 28px; letter-spacing: -1px; }
  .session-note { font-size: 11px; align-items: start; }
  .session-note .icon { margin-top: 2px; }
  .bill-glance { display: grid; grid-template-columns: 1fr auto; padding: 18px 20px; background: var(--green-dark); color: white; border-radius: 17px; text-align: left; gap: 5px 12px; margin-top: 24px; }
  .bill-glance strong { grid-column: 2; grid-row: 1/3; align-self: center; font-size: 23px; color: white; letter-spacing: -.6px; }
  .bill-glance > span { color: #d9e8df; font-size: 12px; }
  #bill-progress { font-size: 10px; color: #a8cbb7; }
  nav { width: 100%; margin-bottom: 22px; gap: 0; }
  nav button { flex: 1; padding: 10px 7px; font-size: 12px; gap: 6px; }
  nav .icon { width: 16px; height: 16px; }
  .workspace-grid, .summary-layout { grid-template-columns: minmax(0,1fr); gap: 24px; }
  .receipt { padding: 20px; border-radius: 17px; }
  .empty { padding: 34px 5px 40px; }
  .empty p { font-size: 12px; }
  .empty.small { padding: 30px 12px; }
  .section-heading { margin-bottom: 5px; }
  h1, h2 { font-size: 19px; }
  .mobile-diners:not(:empty) { display: flex; position: sticky; top: 0; z-index: 5; background: #f5f8f6f5; backdrop-filter: blur(8px); padding: 8px 0 12px; margin: -8px 0 12px; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; }
  .diner-target { display: flex; align-items: center; gap: 8px; white-space: nowrap; border-radius: 22px; max-width: 220px; flex-shrink: 0; padding: 5px 12px 5px 6px; font-size: 12px; overflow: hidden; }
  .diner-target .avatar { width: 30px; height: 30px; border-radius: 50%; font-size: 12px; }
  .item-row { padding: 17px 0 12px; }
  .item-top { gap: 8px; }
  .item-description h2 { font-size: 14px; }
  .item-top strong { font-size: 13px; }
  .item-bottom { margin-left: 30px; flex-wrap: wrap; gap: 2px; }
  .assignment { flex-basis: 100%; font-size: 11px; }
  .item-actions { margin-left: -8px; }
  .amount-row.strong { font-size: 16px; }
  .diner-card { padding: 18px; }
  .diners > .section-heading { padding: 0 3px; margin-bottom: 12px; }
  .summary-total { position: static; }
  .share-list li { gap: 10px; }
  .share-list li > span { font-size: 12px; }
  .share-list .text-button { font-size: 14px; }
  dialog { padding: 22px; }
  .weight-row { grid-template-columns: minmax(0,1fr) 68px 42px; gap: 8px; }
}
@media(max-width:360px) {
  main { padding-left: 12px; padding-right: 12px; }
  .receipt { padding: 17px; }
  nav button { font-size: 11px; gap: 5px; }
  .bill-glance { padding: 16px; }
  .bill-glance strong { font-size: 19px; }
  .item-top { display: grid; grid-template-columns: 22px minmax(0,1fr); align-items: start; }
  .item-top .drag-handle { grid-row: 1/3; align-self: center; }
  .item-top strong, .item-description { grid-column: 2; }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior: auto!important; } }
.unit-list { list-style: none; padding: 0; }
.unit-list li { border-bottom: 1px solid #dde7e0; padding: 12px 0; }
.unit-list p { overflow-wrap: anywhere; }
.unit-pages { display: flex; align-items: center; gap: 8px; margin: 12px 0; }
.unit-pages > * { min-width: 0; flex: 1; }
.offline-help { max-width: 640px; margin: 16px auto; text-align: left; }
.offline-help summary { cursor: pointer; padding: 12px 0; }
.offline-help p { line-height: 1.5; }
.export-result img { display: block; width: 100%; height: auto; margin-top: 16px; }
.save-link { display: block; padding: 12px; margin: 8px 0; text-align: center; border-radius: 12px; }
.export-result textarea { width: 100%; }
