@font-face {
  font-family: 'Archivo';
  src: url(../fonts/archivo.woff2) format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  src: url(../fonts/archivo-ext.woff2) format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat';
  src: url(../fonts/caveat.woff2) format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Caveat';
  src: url(../fonts/caveat-ext.woff2) format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* A green guest-check pad on a counter: printed green rules and labels, a red serial number,
   ballpoint-blue handwriting, and a yellow carbon copy for what comes in from a link. */
:root {
  color-scheme: light;
  --table: #e6e1d3;
  --table-2: #d8d1bf;
  --paper: #f3f7ea;
  --paper-2: #e7efdb;
  --field: #fbfdf7;
  --rule: #c3dab8;
  --rule-2: #93b98a;
  --print: #2b6846;
  --print-2: #4b7f61;
  --ink: #1e2630;
  --ink-2: #444e57;
  --muted: #66705f;
  --pen: #22409a;
  --red: #c1352a;
  --up: #2b7a4b;
  --down: #bf3a2e;
  --carbon: #fbf0b9;
  --carbon-line: #eadb95;
  --carbon-ink: #383e9c;
  --btn: #2b6846;
  --btn-ink: #f6f9ef;
  --shadow: 0 1px 0 rgba(40, 50, 30, .06), 0 12px 26px -16px rgba(40, 50, 30, .45);
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --hand: 'Caveat', 'Bradley Hand', 'Segoe Print', cursive;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --table: #111512;
    --table-2: #1a201b;
    --paper: #1b231d;
    --paper-2: #222c25;
    --field: #141a16;
    --rule: #2c3b30;
    --rule-2: #3f5846;
    --print: #86cfa1;
    --print-2: #6fae87;
    --ink: #e6ebe3;
    --ink-2: #c2cabe;
    --muted: #97a193;
    --pen: #a8bbff;
    --red: #ff7d70;
    --up: #86cfa1;
    --down: #ff8a7c;
    --carbon: #2d2a19;
    --carbon-line: #443f22;
    --carbon-ink: #d4d0ff;
    --btn: #86cfa1;
    --btn-ink: #0f1a13;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 12px 28px -14px rgba(0, 0, 0, .75);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
p, li { text-wrap: pretty; }
body {
  margin: 0;
  background: var(--table);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  font-stretch: 96%;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; font-stretch: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.15; }
.printed, .check-head, .kicker, legend, .field > span:first-child, .boxes small, .day, .tot span, .sections a, .brand span {
  font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--print);
}

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--table) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--table-2);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span { font-size: 1.28rem; font-weight: 800; letter-spacing: .06em; color: var(--ink); }
.brand img { display: block; border-radius: 7px; }
.bar-link { font-size: .92rem; font-weight: 650; color: var(--ink-2); text-decoration: none; padding: 6px 2px; }
.bar-link:hover { color: var(--ink); text-decoration: underline; }

main { max-width: 680px; margin: 0 auto; padding: 16px 16px 120px; outline: none; }
.noscript { text-align: center; padding: 3rem 16px; }

/* Part of junkdrawer.works, under every screen */
.jd-foot { max-width: 680px; margin: 0 auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); text-align: center; font-size: .86rem; color: var(--ink-2); }
.jd-foot a { text-decoration: none; }
.jd-foot a:hover, .jd-foot a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.jd-foot span { margin: 0 6px; color: var(--muted); }

/* Buttons and chips */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 16px; border-radius: 10px;
  border: 1.5px solid var(--rule-2); background: var(--paper);
  font-weight: 650; text-decoration: none; line-height: 1.2; text-align: center;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--print); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.btn.primary:hover { background: color-mix(in srgb, var(--btn) 86%, var(--ink)); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .92rem; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.link-btn { background: none; border: 0; padding: 4px 0; font-weight: 650; color: var(--print); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.link-btn:hover { color: var(--ink); }
.link-btn.danger { color: var(--red); }
.link-btn[disabled] { opacity: .45; text-decoration: none; cursor: default; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 13px; border-radius: 999px;
  border: 1.5px solid var(--rule-2); background: var(--field);
  font-weight: 600; font-size: .95rem; line-height: 1.15;
}
.chip small { font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.chip[aria-pressed="true"] { background: var(--print); border-color: var(--print); color: var(--btn-ink); }
.chip.quiet { border-style: dashed; background: transparent; }
.chip.quiet[aria-pressed="true"] { border-style: solid; background: var(--print); }
.chip.mini { min-height: 34px; padding: 4px 11px; font-size: .88rem; }

/* The check: a sheet off the pad */
.check {
  position: relative;
  background: var(--paper);
  border-top: 6px solid var(--print);
  border-radius: 3px 3px 5px 5px;
  box-shadow: var(--shadow);
  margin: 0 0 18px;
}
.check-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 14px 7px; font-size: .86rem;
  border-bottom: 2px solid var(--print);
}
.serial { color: var(--red); font-stretch: 85%; letter-spacing: .06em; font-weight: 700; }
.check > .lede, .check > .hint, .check > .blank { padding: 0 14px; }
.check > .lede { margin: 12px 0 10px; }
.check > .hint { margin: 10px 0 12px; }
.blank { color: var(--muted); text-align: center; margin: 18px 0; padding: 0 14px; }
.hint { color: var(--muted); font-size: .92rem; margin: 6px 0 0; }
.lede { color: var(--ink-2); }
.small { font-size: .86rem; color: var(--muted); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--red); }

.boxes { display: grid; grid-template-columns: 1.4fr 1fr 1fr; border-bottom: 2px solid var(--print); }
.boxes > div { padding: 5px 12px 7px; border-left: 1px solid var(--rule-2); min-width: 0; }
.boxes > div:first-child { border-left: 0; }
.boxes small { display: block; font-size: .68rem; line-height: 1.3; }
.boxes b { display: block; font-family: var(--hand); font-weight: 700; font-size: 1.45rem; line-height: 1.05; color: var(--pen); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.day { padding: 12px 14px 3px; font-size: .74rem; border-bottom: 1px solid var(--rule); color: var(--print-2); }
.line {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: stretch;
  width: 100%; min-height: 56px; padding: 0; margin: 0;
  border: 0; border-bottom: 1px solid var(--rule); background: none;
  text-decoration: none; text-align: left; color: inherit;
}
button.line { font: inherit; }
.line:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.line .qty { display: grid; place-items: center; border-right: 1px solid var(--rule); font-size: 1.1rem; }
.line .what { padding: 8px 12px; display: grid; align-content: center; min-width: 0; }
.line .what b { font-weight: 650; overflow-wrap: anywhere; line-height: 1.25; }
.line .what small { color: var(--muted); font-size: .84rem; line-height: 1.35; margin-top: 1px; }
.line .amt { display: flex; align-items: center; justify-content: flex-end; min-width: 104px; padding: 0 14px 0 10px; border-left: 3px double var(--rule-2); font-weight: 650; white-space: nowrap; }
.line.pay .what b { color: var(--print); }
.line.pay .qty { color: var(--print); font-weight: 700; }
.line.ghost { min-height: 40px; }
.line.ghost::before, .line.ghost::after { content: ''; }
.line.ghost::before { border-right: 1px solid var(--rule); }
.line.ghost::after { grid-column: 3; min-width: 104px; border-left: 3px double var(--rule-2); }
.mark { display: inline-block; margin-right: 6px; padding: 0 5px; border-radius: 3px; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--carbon-ink); background: var(--carbon); border: 1px solid var(--carbon-line); vertical-align: 1px; }

.totals { border-top: 3px double var(--print); margin-top: -1px; padding: 4px 0; }
.tot { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 14px; }
.tot span { font-size: .86rem; }
.tot b { font-size: 1.3rem; font-weight: 750; }
.tot.sub b { font-size: 1.05rem; font-weight: 650; color: var(--ink-2); }

/* The tear-off stub at the bottom of a check */
.perf { position: relative; height: 16px; margin: 4px 0 0; background: radial-gradient(circle, var(--table) 2.6px, transparent 3.2px) 6px 50% / 11px 16px repeat-x; }
.perf::before, .perf::after { content: ''; position: absolute; top: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--table); }
.perf::before { left: -8px; }
.perf::after { right: -8px; }
.stub-link { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center; padding: 10px 14px 14px; text-decoration: none; }
.stub-link .printed { font-size: .86rem; color: var(--red); }
.stub-link .stub-text { font-weight: 600; line-height: 1.35; }
.stub-link .go { font-size: 1.3rem; color: var(--print); }
.stub-link:hover .stub-text { text-decoration: underline; }

/* Rubber stamp */
.stamp {
  display: inline-block; color: var(--red);
  font-stretch: 70%; font-weight: 850; text-transform: uppercase; letter-spacing: .12em; line-height: 1;
  border: 3px solid currentColor; border-radius: 7px; padding: 5px 10px 4px;
  transform: rotate(-7deg); opacity: .9;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='70'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2 2.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='70'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2 2.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.stamp.small { font-size: .78rem; border-width: 2px; padding: 3px 7px 2px; border-radius: 5px; transform: rotate(-4deg); }
.stamp.big { font-size: 2.6rem; border-width: 5px; padding: 8px 20px 6px; border-radius: 12px; }

/* Home */
.hero { text-align: center; padding: 10px 4px 6px; }
.hero h1 { text-wrap: balance; font-size: clamp(1.9rem, 7.4vw, 2.6rem); font-stretch: 80%; font-weight: 800; letter-spacing: -.01em; margin: 6px 0 10px; }
.hero p { color: var(--ink-2); max-width: 32rem; margin: 0 auto 20px; font-size: 1.04rem; }
.hero.compact { text-align: left; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 4px 0 14px; }
.hero.compact h1 { margin: 0; font-size: 1.7rem; }
.hero-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-check {
  position: relative; width: 250px; margin: 6px auto 16px; text-align: left;
  background: var(--paper); border-top: 6px solid var(--print); border-radius: 3px; box-shadow: var(--shadow);
  transform: rotate(-2.5deg); padding-bottom: 6px;
}
.hero-check .check-head { font-size: .72rem; padding: 6px 10px 5px; }
.hc-line { display: flex; justify-content: space-between; padding: 3px 10px; border-bottom: 1px solid var(--rule); font-family: var(--hand); font-size: 1.25rem; color: var(--pen); line-height: 1.2; }
.hc-line span:last-child { border-left: 3px double var(--rule-2); padding-left: 8px; min-width: 76px; text-align: right; }
.hc-line.total { border-top: 3px double var(--print); border-bottom: 0; font-weight: 700; }
.hc-line.total span:first-child { font-family: var(--sans); font-size: .72rem; font-stretch: 72%; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--print); align-self: center; }
.hero-check .stamp { position: absolute; right: 20px; top: 58px; font-size: 1.6rem; transform: rotate(-14deg); }

.stubs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stub a {
  display: grid; gap: 1px; height: 100%; text-decoration: none;
  background: var(--paper); border-top: 6px solid var(--print); border-radius: 3px 3px 5px 5px; box-shadow: var(--shadow);
  padding: 0 14px 12px;
}
.stub a:hover { background: color-mix(in srgb, var(--paper) 80%, var(--paper-2)); }
.stub-top { display: flex; justify-content: space-between; font-size: .72rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--print); padding: 7px 0 5px; border-bottom: 2px solid var(--print); margin: 0 -14px 6px; padding-left: 14px; padding-right: 14px; }
.stub .t { font-family: var(--hand); font-weight: 700; font-size: 1.9rem; line-height: 1.05; color: var(--pen); overflow-wrap: anywhere; }
.stub .s { color: var(--muted); font-size: .9rem; }
.stub .state { margin-top: 6px; padding-top: 7px; border-top: 1px dashed var(--rule-2); font-weight: 600; font-size: .95rem; }
.stub .state b { font-weight: 750; }
.archived { margin-top: 22px; }
.archived summary { cursor: pointer; font-weight: 650; color: var(--ink-2); padding: 6px 0 12px; }
.keep { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--table-2); color: var(--muted); font-size: .92rem; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.keep p { margin: 0; flex: 1 1 100%; }
.keep label { cursor: pointer; }
.keep input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.keep label:has(:focus-visible) { outline: 3px solid var(--pen); outline-offset: 2px; }

/* A tab's header and its three parts */
.tabhead { margin: 0 0 14px; }
.tabhead-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tabhead-title { min-width: 0; }
.kicker { margin: 0; font-size: .74rem; color: var(--print-2); }
.written { font-family: var(--hand); font-weight: 700; font-size: clamp(2.2rem, 9vw, 2.9rem); line-height: 1; color: var(--pen); margin: 2px 0 12px; overflow-wrap: anywhere; letter-spacing: 0; }
.send { flex: none; margin-top: 4px; }
.sections { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 2px solid var(--table-2); }
.sections a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 4px; text-decoration: none; font-size: .9rem; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.sections a[aria-current] { color: var(--print); border-bottom-color: var(--print); }
.sections a:hover { color: var(--ink); }
.sections i { font-style: normal; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: var(--btn-ink); font-size: .74rem; letter-spacing: 0; font-stretch: 90%; }

/* The yellow carbon copy: what came in from a link */
.carbon {
  position: relative; margin: 0 0 16px; padding: 0 14px 12px;
  background: var(--carbon) repeating-linear-gradient(to bottom, transparent 0 27px, var(--carbon-line) 27px 28px);
  color: var(--carbon-ink); border-radius: 2px; box-shadow: var(--shadow);
  text-shadow: 0 0 .7px color-mix(in srgb, var(--carbon-ink) 60%, transparent);
}
.carbon-head { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0 6px; border-bottom: 2px solid var(--carbon-ink); font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; font-size: .8rem; }
.carbon-head span:first-child { color: var(--red); letter-spacing: .3em; }
.carbon p { margin: 10px 0 0; }
.carbon .changes { list-style: none; margin: 6px 0 0; padding: 0; }
.carbon .changes li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--carbon-line); }
.carbon .changes b { font-weight: 800; }
.carbon .changes .amt { font-weight: 650; white-space: nowrap; }
.carbon .changes .gone span { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.carbon .chips { margin-top: 10px; }
.carbon .chip { background: transparent; border-color: var(--carbon-ink); color: var(--carbon-ink); }
.carbon .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.carbon .btn { background: transparent; border-color: var(--carbon-ink); color: var(--carbon-ink); text-shadow: none; }

/* When this browser won't save: a notice at the top of the home screen and each tab */
.unsaved { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 14px; margin: 0 0 16px; padding: 12px 14px; background: var(--paper); border: 1.5px solid var(--red); border-left-width: 6px; border-radius: 4px; box-shadow: var(--shadow); }
.unsaved p { flex: 1 1 260px; margin: 0; font-weight: 600; line-height: 1.4; }
.unsaved .btn { flex: none; }

/* Squaring up */
.standing { list-style: none; margin: 0; padding: 0; }
.standing li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: baseline; padding: 11px 14px 13px; border-bottom: 1px solid var(--rule); }
.standing li:last-child { border-bottom: 0; }
.standing .nm { font-weight: 650; }
.standing .nm small { color: var(--muted); font-weight: 500; }
.standing .v { text-align: right; line-height: 1.15; white-space: nowrap; }
.standing .v b { font-size: 1.1rem; font-weight: 750; }
.standing .v small { font-size: .82rem; color: var(--muted); margin-right: 4px; }
.standing .up .v b { color: var(--up); }
.standing .down .v b { color: var(--down); }
.meter { grid-column: 1 / -1; grid-row: 2; position: relative; height: 10px; border-radius: 5px; background: var(--paper-2); }
.meter::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--rule-2); }
.meter i { position: absolute; top: 0; bottom: 0; width: calc(var(--w) / 2); }
.up .meter i { left: 50%; background: var(--up); border-radius: 0 5px 5px 0; }
.down .meter i { right: 50%; background: var(--down); border-radius: 5px 0 0 5px; }

.tickets { list-style: none; margin: 0; padding: 0 14px; display: grid; gap: 10px; }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 12px 14px; border: 1.5px dashed var(--rule-2); border-radius: 8px; background: var(--field); }
.tk-who { font-size: 1.05rem; }
.tk-who b { font-weight: 700; }
.tk-amt { font-size: 1.3rem; font-weight: 750; }
.tk-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.squared { text-align: center; padding: 26px 14px 20px; }
.squared p { margin: 18px 0 14px; font-weight: 600; }

.ledger { padding: 4px 14px 0; }
.lr { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.lr span:not(:first-child) { text-align: right; white-space: nowrap; }
.lr span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lr.head span { font-size: .7rem; font-stretch: 72%; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--print); }
.lr .up { color: var(--up); font-weight: 650; }
.lr .down { color: var(--down); font-weight: 650; }
.ledger + .hint { padding: 0 14px 12px; }

/* People */
.people { list-style: none; margin: 0; padding: 0; }
.person { padding: 12px 14px; border-bottom: 1px solid var(--rule); }
.p-top { display: flex; align-items: center; gap: 10px; }
.p-top .input { flex: 1; min-width: 0; font-weight: 600; }
.me-pick { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--ink-2); white-space: nowrap; cursor: pointer; }
.me-pick input { width: 18px; height: 18px; accent-color: var(--print); margin: 0; }
.person details { margin-top: 6px; }
.person summary { cursor: pointer; color: var(--muted); font-size: .9rem; padding: 4px 0; }
.p-more { padding: 8px 0 2px; display: grid; gap: 8px; }
.p-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 10px; }
.p-row > span:first-child { font-weight: 600; font-size: .92rem; }
.p-more .hint { margin: 0 0 4px; }
.p-more .link-btn { justify-self: start; }
.pre { display: flex; align-items: center; border: 1.5px solid var(--rule-2); border-radius: 8px; background: var(--field); min-width: 0; }
.pre i { font-style: normal; color: var(--muted); padding-left: 10px; font-size: .9rem; white-space: nowrap; }
.pre .input { border: 0; background: transparent; min-height: 40px; padding-left: 3px; }
.pre:focus-within { border-color: var(--print); }
.add-person { display: flex; gap: 8px; padding: 12px 14px 14px; }
.add-person .input { flex: 1; min-width: 0; }
.tab-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 0; }
.check > .tab-acts + .hint { padding-bottom: 14px; }

.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--rule-2); border-radius: 9px; background: var(--field); overflow: hidden; }
.stepper button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.15rem; font-weight: 700; color: var(--print); }
.stepper button:hover { background: var(--paper-2); }
.stepper b { min-width: 32px; text-align: center; font-weight: 700; }
.stepper.off { opacity: .45; }

/* Forms on the check */
.edhead { margin: 0 0 12px; }
.back { display: inline-block; font-size: .9rem; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 2px 0; }
.back::before { content: '← '; }
.back:hover { color: var(--ink); text-decoration: underline; }
.edhead h1 { margin: 2px 0 0; font-size: 1.7rem; font-stretch: 80%; font-weight: 800; }
.check.form { padding-bottom: 6px; }
.check.form > .field, .check.form > .pair, .check .field { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--rule); margin: 0; min-width: 0; }
.check.form > :last-child { border-bottom: 0; }
.field { display: grid; gap: 6px; }
.field > span:first-child, legend { font-size: .76rem; }
legend { float: left; width: 100%; padding: 0; margin: 0 0 8px; }
legend + * { clear: both; }
.pair { display: flex; flex-wrap: wrap; gap: 12px; }
.pair > .field { padding: 0 !important; border: 0 !important; flex: 1 1 140px; }
.pair > .field.grow { flex: 2 1 170px; }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 8px;
  border: 1.5px solid var(--rule-2); background: var(--field);
  font-size: 1.02rem;
}
::placeholder { color: var(--muted); opacity: .6; }
.input:focus { outline: none; border-color: var(--print); box-shadow: 0 0 0 3px color-mix(in srgb, var(--print) 22%, transparent); }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.4; }
select.input { appearance: auto; }
input[type=date].input { min-width: 0; }
.money { display: flex; align-items: center; border: 1.5px solid var(--rule-2); border-radius: 8px; background: var(--field); min-width: 0; }
.money:focus-within { border-color: var(--print); box-shadow: 0 0 0 3px color-mix(in srgb, var(--print) 22%, transparent); }
.money i { font-style: normal; color: var(--muted); padding-left: 12px; white-space: nowrap; font-weight: 600; }
.money .input { border: 0; background: transparent; box-shadow: none; padding-left: 5px; min-width: 0; }
.money.pct i { padding: 0 12px 0 0; }
.money.pct .input { padding-left: 12px; text-align: right; }
.money.big .input { font-size: 1.5rem; font-weight: 700; min-height: 52px; }
.money.big i { font-size: 1.2rem; }
.money.small .input { min-height: 40px; padding-top: 6px; padding-bottom: 6px; text-align: right; }
.rows { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.rows li { display: flex; align-items: center; gap: 10px; }
.rows .input { flex: 1; min-width: 0; }
.you-tag { width: 40px; text-align: center; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--print); }
.x { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--muted); font-size: 1rem; display: grid; place-items: center; }
.x:hover { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.add { border: 1.5px dashed var(--rule-2); background: none; border-radius: 10px; min-height: 44px; padding: 8px 14px; font-weight: 650; color: var(--ink-2); width: 100%; text-align: left; }
.add:hover { border-style: solid; color: var(--ink); }
.add::before { content: '+ '; color: var(--print); font-weight: 800; }
.problem { color: var(--red); font-weight: 600; margin: 8px 0 0; }

.seg { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1.5px solid var(--rule-2); border-radius: 10px; overflow: hidden; background: var(--field); }
.seg button { border: 0; border-left: 1px solid var(--rule-2); background: none; min-height: 42px; padding: 4px 2px; font-size: .86rem; font-weight: 650; font-stretch: 86%; color: var(--ink-2); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--print); color: var(--btn-ink); }
.seg-switch { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 10px; font-size: .9rem; color: var(--muted); }

.split-rows { list-style: none; margin: 10px 0 0; padding: 0; }
.split-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; align-items: center; gap: 10px; min-height: 50px; padding: 4px 0; border-bottom: 1px dashed var(--rule); }
.split-rows li:has(> .tick) { grid-template-columns: auto minmax(0, 1fr) auto 86px; }
/* Split equally there's no control in the row, so a long part takes room from the name rather than running off the check. */
.split-rows li:has(> .tick):not(:has(> .stepper)) { grid-template-columns: auto minmax(0, 1fr) minmax(86px, max-content); }
.split-rows.paid-rows li { grid-template-columns: minmax(0, 1fr) auto; }
.split-rows li:last-child { border-bottom: 0; }
.split-rows .nm { font-weight: 600; overflow-wrap: anywhere; line-height: 1.2; }
.split-rows li.out .nm, .split-rows li.out .each { color: var(--muted); }
.split-rows .money.small { width: 118px; }
.split-rows .money.pct { width: 92px; }
.split-rows .each { grid-column: -2; }
.each { text-align: right; font-weight: 650; color: var(--ink-2); font-size: .95rem; white-space: nowrap; }
.tick { width: 34px; height: 34px; border-radius: 8px; border: 1.5px solid var(--rule-2); background: var(--field); color: transparent; font-weight: 800; display: grid; place-items: center; padding: 0; }
.tick[aria-pressed="true"] { background: var(--print); border-color: var(--print); color: var(--btn-ink); }
.status { margin: 8px 0 0; font-size: .92rem; font-weight: 600; color: var(--red); }
.status[data-ok="true"] { color: var(--print); }
.status:empty { display: none; }
.cats .chip { font-size: .9rem; }

/* By item */
.items { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: item; }
.item { padding: 10px 0 10px; border-bottom: 1px dashed var(--rule-2); }
.item-top { display: grid; grid-template-columns: minmax(0, 1fr) 118px 36px; gap: 8px; align-items: center; }
.item-top .x { width: 36px; height: 36px; }
.item .who { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.item .who .each { margin-left: auto; font-size: .86rem; color: var(--muted); font-weight: 600; }
.round-btn { margin-top: 10px; }
.extras .ex-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 48px; }
.extras .ex-row > span:first-child { font-weight: 650; }
.extras .ex-row output { grid-column: 2 / -1; text-align: right; font-weight: 650; }
.extras .ex-row .money { max-width: 150px; }
.extras .ex-row.tip { grid-template-columns: 1fr; gap: 6px; padding: 6px 0 4px; }
.extras .ex-row.tip .chips { gap: 5px; }
.extras .ex-row.tip .chip { padding: 4px 8px; }
.extras .unit { display: flex; gap: 4px; }
.extras .unit .chip { min-width: 40px; justify-content: center; }
.extras .total { border-top: 3px double var(--print); margin-top: 6px; }
.extras .total output { font-size: 1.3rem; font-weight: 750; }
.each-list { list-style: none; margin: 0; padding: 0; }
.each-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 8px 0; border-bottom: 1px dashed var(--rule); }
.each-list li:last-child { border-bottom: 0; }
.each-list .nm { font-weight: 650; }
.each-list small { grid-row: 2; color: var(--muted); font-size: .84rem; }
.each-list b { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 1.1rem; }
.each-list .empty { display: block; color: var(--muted); }

/* The bar with the main action, stuck to the bottom of the screen */
.next-bar {
  position: sticky; bottom: 0; z-index: 5;
  margin: 18px -16px -120px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--table) 72%, color-mix(in srgb, var(--table) 0%, transparent));
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.next-bar .note { margin: 0 auto 0 0; color: var(--red); font-size: .9rem; font-weight: 600; line-height: 1.25; min-width: 0; }
.next-bar .note[data-ok="true"], .next-bar .note[data-soft="true"] { color: var(--ink-2); font-weight: 500; }
.next-bar .btn { flex: none; }

/* Toast and sheet */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 30; max-width: min(92vw, 460px); width: max-content;
  background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 12px 10px 16px;
  display: flex; align-items: center; gap: 14px; font-weight: 600; font-size: .95rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
}
.toast button { border: 0; background: none; color: var(--rule); font-weight: 750; padding: 6px 4px; text-decoration: underline; }
.sheet {
  border: 0; padding: 0; border-radius: 4px 4px 12px 12px; width: min(94vw, 520px); max-height: 90vh;
  background: var(--paper); color: var(--ink); border-top: 6px solid var(--print);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55);
}
.sheet::backdrop { background: rgba(18, 22, 16, .55); }
.sheet-body { padding: 18px 18px 18px; display: grid; gap: 12px; }
.sheet-body h2 { margin: 0; font-size: 1.4rem; font-stretch: 82%; font-weight: 800; }
.sheet-body p { margin: 0; color: var(--ink-2); }
.sheet-body .small { color: var(--muted); }
.sheet-body .field { padding: 0; border: 0; }
.sheet-body textarea { width: 100%; min-height: 84px; border-radius: 8px; border: 1.5px solid var(--rule-2); background: var(--field); padding: 10px 12px; font-size: .82rem; resize: none; overflow-wrap: anywhere; word-break: break-all; }
.sheet-body .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.sheet-body .grow { flex: 1; }
.pay-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.pay-pair + .pay-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pay-pair .arrow { padding-bottom: 12px; color: var(--print); font-weight: 800; }
.sheet.round .kicker { font-size: .78rem; }
.round-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.round-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid var(--rule-2); background: var(--field); text-align: left; }
.round-item .tick { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--rule-2); color: transparent; font-weight: 800; }
.round-item[aria-pressed="true"] { border-color: var(--print); background: color-mix(in srgb, var(--print) 12%, var(--field)); }
.round-item[aria-pressed="true"] .tick { background: var(--print); border-color: var(--print); color: var(--btn-ink); }
.round-item .nm { font-weight: 650; display: grid; line-height: 1.25; }
.round-item .nm small { font-weight: 500; color: var(--muted); font-size: .84rem; }
.round-item .amt { font-weight: 650; }

.note-card { padding-bottom: 16px; }
.note-card h2, .note-card .hint, .note-card .btn { margin-left: 14px; margin-right: 14px; }
.note-card h2 { margin-top: 16px; }
.note-card .hint { margin-bottom: 14px; }

@media (min-width: 720px) {
  main { padding-top: 26px; }
  .written { font-size: 3.2rem; }
}
@media (max-width: 380px) {
  .line .amt { min-width: 92px; padding-right: 10px; }
  .split-rows li { grid-template-columns: minmax(0, 1fr) auto 76px; gap: 8px; }
  .split-rows li:has(> .tick) { grid-template-columns: auto minmax(0, 1fr) auto 76px; }
  .split-rows li:has(> .tick):not(:has(> .stepper)) { grid-template-columns: auto minmax(0, 1fr) minmax(76px, max-content); }
  .split-rows .money.small { width: 104px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
