@font-face {
  font-family: 'Atkinson Next';
  src: url(/fonts/next-latin.woff2) format('woff2');
  font-weight: 200 800;
  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: 'Atkinson Next';
  src: url(/fonts/next-latin-ext.woff2) format('woff2');
  font-weight: 200 800;
  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: 'Atkinson Mono';
  src: url(/fonts/mono-latin.woff2) format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --ink: #0b0b0b;
  --soft: #4a4a4a;
  --hair: #d0d0d0;
  --wash: #f1f1f1;
  --marker: #ffe14d;
  --on-marker: #0b0b0b;
  --press: #2e2e2e;
  --sans: 'Atkinson Next', 'Verdana', sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, 'Menlo', monospace;
  --pad: 20px;
  --max: 1240px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e0e0e;
    --ink: #f4f4f4;
    --soft: #b5b5b5;
    --hair: #3a3a3a;
    --wash: #1c1c1c;
    --press: #d6d6d6;
  }
}
@media (min-width: 720px) { :root { --pad: 40px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 60px; border-bottom: 1px solid var(--hair);
}
.mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; letter-spacing: -0.01em; text-decoration: none; min-height: 44px; }
.mark svg { width: 22px; height: 22px; flex: none; }
.bar nav { display: flex; gap: 4px; }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-weight: 500; text-decoration: none; }
.bar nav a:hover { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px;
  border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.btn:hover { background: var(--wash); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--press); border-color: var(--press); }
.btn.quiet { border-color: transparent; background: transparent; }
.btn.quiet:hover { background: var(--wash); }
.btn.danger { border-color: var(--ink); }
.btn.icon { width: 48px; padding: 0; }
.btn svg, .ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; }
.btn[disabled] { opacity: .45; cursor: default; }

input[type=text], input:not([type]), select {
  width: 100%; min-height: 52px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink);
  font-size: 19px;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 44px; }
input::placeholder { color: var(--soft); opacity: 1; }
label.field { display: block; font-weight: 700; margin: 0 0 6px; }
.hint { color: var(--soft); font-size: 15px; margin: 6px 0 0; }

.marker { background: var(--marker); color: var(--on-marker); padding: 0 .2em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- home ---------- */
.hero { padding: 48px 0 40px; }
.hero h1 { font-size: clamp(36px, 7vw, 68px); line-height: 1.04; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 20px; max-width: 15em; }
.hero .lede { font-size: 20px; line-height: 1.45; max-width: 36em; margin: 0 0 28px; }
.make { display: grid; grid-template-columns: 1fr auto; gap: 0; max-width: 620px; }
.make input { border-right: 0; }
.make .btn { min-height: 56px; }
.make input { min-height: 56px; }
.make-note { color: var(--soft); font-size: 15px; margin: 10px 0 0; }
.form-error { margin: 10px 0 0; font-weight: 700; border-left: 4px solid var(--ink); padding-left: 10px; }
.form-error:empty { display: none; }

.mine { margin: 36px 0 0; max-width: 620px; }
.mine h2 { font-size: 15px; font-weight: 700; margin: 0 0 6px; }
.mine ul { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.mine li { border-bottom: 1px solid var(--hair); }
.mine a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; font-size: 19px; font-weight: 700; text-decoration: none; }
.mine a:hover .t { text-decoration: underline; }
.mine .when { font-weight: 400; color: var(--soft); font-size: 15px; }

.block { padding: 40px 0; border-top: 2px solid var(--ink); }
.block > h2 { font-size: 24px; letter-spacing: -0.01em; margin: 0 0 6px; }
.block > .sub { color: var(--soft); margin: 0 0 24px; max-width: 40em; }
.notes { display: grid; gap: 28px; }
.notes h3 { font-size: 19px; margin: 0 0 6px; }
.notes p { margin: 0; max-width: 34em; }
@media (min-width: 880px) { .notes { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.faq { margin: 0; display: grid; gap: 0; max-width: 820px; }
.faq dt { font-weight: 700; font-size: 19px; padding-top: 18px; border-top: 1px solid var(--hair); }
.faq dd { margin: 4px 0 18px; }
.faq dt:first-child { border-top: 0; padding-top: 0; }

footer.foot { border-top: 1px solid var(--hair); margin-top: 24px; padding: 20px 0 40px; color: var(--soft); font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px 24px; }
footer.foot a, footer.foot span { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- prose ---------- */
.prose { max-width: 700px; padding: 40px 0 24px; }
.prose h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 20px; }
.prose h2 { font-size: 22px; margin: 32px 0 8px; }
.prose p, .prose li { font-size: 18px; }
.prose ul { padding-left: 22px; }

/* ---------- list page ---------- */
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; color: var(--soft); min-height: 44px; text-align: right; }
.status::before { content: ''; width: 10px; height: 10px; flex: none; border: 2px solid var(--soft); }
.status[data-s=live] { color: var(--ink); }
.status[data-s=live]::before { background: var(--ink); border-color: var(--ink); }
.status[data-s=saving]::before { border-color: var(--ink); }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 0 6px; }
.head h1 { font-size: clamp(30px, 6vw, 44px); line-height: 1.08; letter-spacing: -0.02em; margin: 0; overflow-wrap: anywhere; }
.head-actions { display: flex; gap: 8px; flex: none; }
.summary { margin: 0 0 16px; color: var(--soft); font-size: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; }
.summary .marker { font-weight: 700; }
.linkish { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 16px; }

.invite { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; border: 2px solid var(--ink); padding: 14px 16px; margin: 0 0 18px; }
.invite p { margin: 0; flex: 1 1 260px; font-weight: 500; }
.invite .btns { display: flex; gap: 8px; }

.add { position: relative; display: grid; grid-template-columns: 1fr auto; margin: 0 0 8px; }
.add input { min-height: 56px; border-right: 0; font-size: 19px; }
.add .btn { min-height: 56px; min-width: 84px; }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin: 0; padding: 0; list-style: none; background: var(--paper); border: 2px solid var(--ink); border-top: 0; }
.suggest li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; cursor: pointer; font-size: 18px; border-top: 1px solid var(--hair); }
.suggest li:first-child { border-top: 0; }
.suggest li[aria-selected=true], .suggest li:hover { background: var(--wash); }
.suggest .where { color: var(--soft); font-size: 14px; }

.sections { margin-top: 18px; }
@media (min-width: 880px) {
  .sections { columns: 330px; column-gap: 44px; }
}
.sec { break-inside: avoid; border-top: 2px solid var(--ink); margin: 0 0 26px; }
.sec h2 { display: flex; align-items: baseline; gap: 14px; margin: 0; padding: 12px 0 6px; font-size: 19px; font-weight: 700; }
.sec h2 .num { font-family: var(--mono); font-size: 26px; font-weight: 500; line-height: 1; min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.sec h2 .lbl { flex: 1; }
.sec h2 .left { font-family: var(--mono); font-size: 15px; font-weight: 400; color: var(--soft); }
.sec ul { list-style: none; margin: 0; padding: 0; }

.item { display: flex; align-items: center; border-top: 1px solid var(--hair); min-height: 56px; transition: opacity 200ms ease-out; }
.item:first-child { border-top: 0; }
.item .tap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 0; cursor: pointer; }
.item input { appearance: none; -webkit-appearance: none; flex: none; margin: 0 0 0 1px; width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); display: grid; place-items: center; cursor: pointer; transition: background-color 150ms ease-out; }
.item input::after { content: ''; width: 12px; height: 7px; border-left: 3px solid var(--paper); border-bottom: 3px solid var(--paper); transform: translateY(-2px) rotate(-45deg); opacity: 0; transition: opacity 150ms ease-out; }
.item input:checked { background: var(--ink); }
.item input:checked::after { opacity: 1; }
.item .qty { flex: none; margin-left: auto; padding-left: 12px; font-family: var(--mono); font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.item .qty:empty { display: none; }
.item .txt { flex: 1; min-width: 0; font-size: 19px; line-height: 1.3; overflow-wrap: anywhere; }
.item.done .txt, .item.done .qty { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--soft); }
.item .w { transition: background-color 250ms ease-out; }
.item.new .w { background: var(--marker); color: var(--on-marker); padding: 0 .2em; margin: 0 -.2em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.item .edit { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; color: var(--soft); cursor: pointer; }
.item .edit:hover { color: var(--ink); background: var(--wash); }
.item.leaving { opacity: 0; }

.empty { border-top: 2px solid var(--ink); padding: 18px 0; color: var(--soft); font-size: 18px; margin: 0; }

.cart { border-top: 2px solid var(--ink); margin-top: 10px; }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.cart-head h2 { font-size: 19px; margin: 0; }
.cart-head h2 .left { font-family: var(--mono); font-weight: 400; color: var(--soft); margin-left: 8px; font-size: 15px; }
.cart ul { list-style: none; margin: 0; padding: 0; }
@media (min-width: 880px) { .cart ul { columns: 330px; column-gap: 44px; } .cart .item { break-inside: avoid; } .cart .item:first-child { border-top: 1px solid var(--hair); } }

.usuals { border-top: 1px solid var(--hair); margin-top: 26px; padding: 14px 0 0; }
.usuals-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.usuals h2 { font-size: 19px; margin: 0; }
.usuals p.hint { margin: 2px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; font-size: 17px; border-radius: 0; transition: background-color 150ms ease-out; }
.chip:hover { background: var(--wash); }
.chip .n { font-family: var(--mono); font-size: 13px; color: var(--soft); }
.chip.forget { border-style: dashed; }

.gone { padding: 48px 0; max-width: 640px; }
.gone h1 { font-size: 36px; margin: 0 0 12px; letter-spacing: -0.02em; }

/* ---------- dialogs ---------- */
dialog { border: 2px solid var(--ink); border-radius: 0; padding: 0; background: var(--paper); color: var(--ink); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog[open] { animation: rise 200ms ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dlg { padding: 20px; display: grid; gap: 16px; }
.dlg h2 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
.dlg-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -8px -8px 0 0; }
.dlg .row { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg .row .btn { flex: 1 1 auto; }
.dlg p { margin: 0; }
@media (max-width: 600px) {
  dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-width: 2px 0 0; }
}
.menu { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.menu li { border-bottom: 1px solid var(--hair); }
.menu button, .menu a { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 0 4px; background: none; border: 0; text-align: left; font-size: 18px; font-weight: 500; cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--wash); }
.order { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); max-height: 56dvh; overflow: auto; }
.order li { display: grid; grid-template-columns: 2ch 1fr 48px 48px; align-items: center; gap: 8px; min-height: 56px; padding: 4px 0; border-bottom: 1px solid var(--hair); }
.order .num { font-family: var(--mono); font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.order .lbl { font-weight: 500; font-size: 18px; }
.order .lbl small { display: block; color: var(--soft); font-weight: 400; font-size: 14px; line-height: 1.2; }
.order button { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; }
.order button:hover { background: var(--wash); }
.order button[disabled] { opacity: .25; cursor: default; background: none; }
.share-url { font-family: var(--mono); font-size: 15px; }
.qr { width: 220px; max-width: 70vw; border: 2px solid var(--ink); }
.qr svg { display: block; width: 100%; height: auto; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translate(-50%, 12px); z-index: 20; display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 24px); width: max-content; min-height: 52px; padding: 4px 6px 4px 16px; background: var(--ink); color: var(--paper); font-size: 16px; opacity: 0; pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--paper); font-weight: 700; min-height: 44px; padding: 0 12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  :root { --paper: #fff; --ink: #000; --soft: #444; --hair: #bbb; }
  .bar, .add, .head-actions, .summary, .invite, .usuals, .cart, .toast, footer, .item .edit, dialog { display: none !important; }
  .sections { columns: 2; column-gap: 32px; margin: 0; }
  .item { min-height: 0; }
  .item .tap { min-height: 30px; padding: 2px 0; }
  .item input { width: 16px; height: 16px; }
  .item .txt { font-size: 14px; }
  .item .qty { font-size: 13px; }
  .sec h2 { padding: 6px 0 2px; font-size: 14px; }
  .sec h2 .num { font-size: 16px; }
  .item.new .w { background: none; }
}

.sample .tap { cursor: default; }
.sample .box { flex: none; width: 28px; height: 28px; margin-left: 1px; border: 2px solid var(--ink); display: grid; place-items: center; }
.sample .box.on { background: var(--ink); }
.sample .box.on::after { content: ''; width: 12px; height: 7px; border-left: 3px solid var(--paper); border-bottom: 3px solid var(--paper); transform: translateY(-2px) rotate(-45deg); }
.sample .item { min-height: 52px; }
.sample .sec { margin-bottom: 20px; }

.template { margin-top: 8px; }
.template .item { min-height: 44px; }
.template .tap { min-height: 44px; padding: 4px 0; }
.template .line { flex: 1; border-bottom: 1px solid var(--hair); height: 24px; }
.template .blank { border-top: 0; }
.prose.after { padding-top: 8px; }
@media print {
  .guide .bar, .guide .foot, .guide .prose p, .guide .prose.after, .guide #print { display: none !important; }
  .guide .prose { padding: 0; }
  .guide .prose h1 { font-size: 20px; margin: 0 0 6px; }
  .guide .sections { columns: 3; column-gap: 20px; }
  .guide .sec { margin: 0 0 8px; border-top-width: 1.5px; }
  .guide .sec h2 { padding: 3px 0 1px; font-size: 11px; gap: 6px; }
  .guide .sec h2 .num { font-size: 12px; }
  .guide .template .item, .guide .template .tap { min-height: 0; padding: 0; gap: 6px; }
  .guide .template .item { border-top: 0; }
  .guide .template .txt { font-size: 10.5px; line-height: 1.55; }
  .guide .sample .box { width: 9px; height: 9px; border-width: 1px; }
  .guide .template .line { height: 13px; }
  @page { margin: 12mm; }
}
