:root{color-scheme:light;--bg:#F4F2ED;--surface:#FBFAF7;--surface-2:#ECE9E3;--ink:#171716;--ink-2:#66635E;--ink-3:#A6A29B;--rule:#DAD6CE;--inv:#1A1A19;--on-inv:#F4F2ED;--on-inv-2:#8D8A84;--accent:#C9483A;--accent-tint:#F3DDD8;--warn:#B0802A;--warn-tint:#F1E6CF;--ok:#5F7D5C;--paper:#FFFEFB;--paper-ink:#2A2926;--p-me:#171716;--p-fog:#6F8DA6;--p-sage:#7F9877;--p-oat:#BC9A6A;--p-rose:#C2878D;--p-lilac:#9C93B5}
.paper{--bg:#F4F2ED;--surface:#FBFAF7;--surface-2:#ECE9E3;--ink:#171716;--ink-2:#66635E;--ink-3:#A6A29B;--rule:#DAD6CE;--inv:#1A1A19;--on-inv:#F4F2ED;--on-inv-2:#8D8A84;--accent:#C9483A;--accent-tint:#F3DDD8;--warn:#B0802A;--warn-tint:#F1E6CF;--ok:#5F7D5C;--paper:#FFFEFB;--paper-ink:#2A2926;--p-me:#171716;--p-fog:#6F8DA6;--p-sage:#7F9877;--p-oat:#BC9A6A;--p-rose:#C2878D;--p-lilac:#9C93B5}
@media (prefers-color-scheme:dark){:root{color-scheme:dark;--bg:#121211;--surface:#1B1B1A;--surface-2:#252523;--ink:#EEECE7;--ink-2:#9B978F;--ink-3:#5E5B56;--rule:#2E2D2A;--inv:#EEECE7;--on-inv:#141413;--on-inv-2:#77746E;--accent:#E0644F;--accent-tint:#3A211C;--warn:#D2A04A;--warn-tint:#352B19;--ok:#8BAA86;--paper:#EDEAE2;--paper-ink:#22211F;--p-me:#EEECE7;--p-fog:#86A3BB;--p-sage:#97B08E;--p-oat:#CFAE7E;--p-rose:#D59BA1;--p-lilac:#ADA5C6}.paper{--paper:#EDEAE2;--paper-ink:#22211F}}
/* Chit website. Colour variables (--bg, --ink, --accent, --p-fog …) are generated from
   packages/ui/src/tokens.ts by build.mjs and prepended to this file; light by default, dark by
   system setting. Thermal paper, dot-matrix numbers, one red accent for "needs attention". */

:root {
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow: 0 1px 0 rgba(0, 0, 0, .03), 0 8px 24px rgba(40, 36, 30, .06);
  --paper-shadow: rgba(40, 36, 30, .16);
}
@media (prefers-color-scheme: dark) {
  :root { --shadow: 0 0 0 1px #262624; --paper-shadow: rgba(0, 0, 0, .5); }
}
:root:lang(zh) { --sans: "Inter", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif; }
:root:lang(ja) { --sans: "Inter", system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans CJK JP", "Yu Gothic", Meiryo, sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { display: block; }
a { color: inherit; text-decoration-color: var(--ink-3); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right)); }
.wrap.narrow { max-width: 760px; }

.skip { position: absolute; left: 12px; top: -60px; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); z-index: 10; }
.skip:focus { top: 12px; }

/* dot-matrix text: SVG circles from the app's 5x7 glyph table */
.dm { display: inline-block; line-height: 1; white-space: nowrap; }
.dm svg { fill: currentColor; overflow: visible; vertical-align: baseline; }

/* ───────── header & footer ───────── */
.top { position: sticky; top: 0; z-index: 20; padding: 14px 0 12px; }
/* frosted strip that fades out downwards instead of ending in a hard edge */
.top::before {
  content: ""; position: absolute; inset: 0 0 -28px 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-left { display: flex; align-items: center; gap: 14px; }
.brand { display: block; padding: 6px 0; }
.brand img { height: 26px; width: auto; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s var(--ease);
}
.icon-btn svg { fill: currentColor; }
.icon-btn:active { transform: scale(.94); }
.icon-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ───────── menu: a frosted panel that slides in from the left ───────── */
/* Native popover. Every style lives on .menu itself (not only on :popover-open), so the closing
   animation keeps its look instead of falling back to the browser's default popover box.
   Without popover support the menu stays hidden and the footer links remain. */
.menu {
  position: fixed; inset: 0 auto 0 0; margin: 0; border: 0; padding: 0;
  width: min(400px, 88vw); height: 100dvh; max-height: none; overflow: hidden auto;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
  box-shadow: 1px 0 0 color-mix(in srgb, var(--ink) 8%, transparent), 24px 0 60px rgba(20, 18, 14, .10);
  display: none; transform: translateX(-100%); opacity: 0;
  transition: transform .42s var(--ease), opacity .3s var(--ease), overlay .42s allow-discrete, display .42s allow-discrete;
}
.menu:popover-open { display: block; transform: none; opacity: 1; }
.menu::backdrop {
  background: rgba(18, 18, 16, .18);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s var(--ease), overlay .42s allow-discrete, display .42s allow-discrete;
}
.menu:popover-open::backdrop { opacity: 1; }
@starting-style {
  .menu:popover-open { transform: translateX(-100%); opacity: 0; }
  .menu:popover-open::backdrop { opacity: 0; }
}

.menu-in { min-height: 100%; display: flex; flex-direction: column; padding: 22px max(22px, env(safe-area-inset-left)) max(28px, env(safe-area-inset-bottom)); }
.menu-top { display: flex; align-items: center; justify-content: space-between; }
.menu-list { list-style: none; margin-top: 44px; display: grid; gap: 4px; }
.menu-list.minor { margin-top: 24px; padding-top: 22px; border-top: 1px dashed var(--rule); }
.menu-list a {
  display: grid; grid-template-columns: 34px auto 1fr; align-items: baseline; column-gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink);
  transition: background .2s;
}
.menu-list a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.menu-num { font-size: 13px; color: var(--ink-3); }
.menu-label { font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.menu-dots { font-size: 13px; color: var(--ink-3); }
:root:lang(en) .menu-dots { font-size: 22px; color: var(--ink); grid-column: 2 / 4; }
.menu-list.minor .menu-label { font-size: 17px; font-weight: 500; }
:root:lang(en) .menu-list.minor .menu-dots { font-size: 16px; }
.menu-list a[aria-current] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.menu-list a[aria-current] .menu-num { color: var(--ink); }
.menu-list li { transition: transform .5s var(--ease), opacity .4s var(--ease); }
.menu:popover-open .menu-list li { transform: none; opacity: 1; }
@starting-style { .menu:popover-open .menu-list li { transform: translateX(-14px); opacity: 0; } }
.menu-list li:nth-child(2) { transition-delay: .04s; } .menu-list li:nth-child(3) { transition-delay: .08s; }
.menu-list li:nth-child(4) { transition-delay: .12s; }
.menu-list.minor li { transition-delay: .1s; } .menu-list.minor li:nth-child(n+2) { transition-delay: .14s; }
.menu-foot { margin-top: auto; padding-top: 32px; display: grid; gap: 14px; justify-items: start; }
.menu-foot p { font-size: 12px; color: var(--ink-3); }
:root:has(.menu:popover-open) { overflow: hidden; }
.menu-label { white-space: nowrap; }
@media (max-width: 480px) {
  /* dots move under the native label */
  :root:not(:lang(en)) .menu-list a { grid-template-columns: 34px 1fr; row-gap: 2px; }
  :root:not(:lang(en)) .menu-dots { grid-column: 2; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu, .menu::backdrop, .menu-list li { transition: none; }
}

.lang { display: flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.lang a {
  padding: 5px 12px; border-radius: 999px; font-size: 13px; line-height: 1.4;
  color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.lang a:hover { color: var(--ink); }
.lang a[aria-current] { background: var(--ink); color: var(--bg); }

.foot { margin-top: 96px; }
.foot-in { border-top: 1px dashed var(--rule); padding-top: 28px; padding-bottom: max(40px, env(safe-area-inset-bottom)); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--ink); }
.foot-made { margin-top: 14px; font-size: 13px; color: var(--ink-3); }
.foot-made a { color: inherit; }

/* ───────── home ───────── */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center; gap: 56px; padding-top: 48px;
}
.kicker { font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.hero h1 {
  margin-top: 18px;
  font-size: clamp(36px, 5.4vw, 58px); line-height: 1.06; font-weight: 600; letter-spacing: -.025em;
}
/* CJK headlines: break only at punctuation, never inside a phrase */
:root:lang(zh) .hero h1, :root:lang(ja) .hero h1 { font-size: clamp(32px, 4.6vw, 52px); letter-spacing: 0; line-height: 1.22; }
:root:lang(zh) :is(h1, h2, h3), :root:lang(ja) :is(h1, h2, h3) { word-break: keep-all; overflow-wrap: anywhere; }
.lede { margin-top: 20px; max-width: 32em; font-size: 18px; color: var(--ink-2); }

.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.store {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-height: 52px; padding: 6px 24px; border-radius: 26px; line-height: 1.25;
  background: var(--ink); color: var(--bg); text-decoration: none;
}
.store-name { font-weight: 600; font-size: 15px; }
.store.soon { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.store-note { font-size: 12px; color: var(--ink-3); }

.section { padding-top: 88px; }
.section-title { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; font-weight: 600; letter-spacing: -.015em; }
.section-sub { margin-top: 8px; color: var(--ink-2); max-width: 36em; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 26px 24px 28px; box-shadow: var(--shadow); }
.card .num { font-size: 17px; color: var(--ink-3); }
.card h3 { margin-top: 16px; font-size: 18px; line-height: 1.3; font-weight: 600; }
.card p { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.card code { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.section-more { margin-top: 18px; font-size: 15px; }
.section-more a::after { content: " →"; }

.band { border-radius: var(--r-lg); background: var(--inv); color: var(--on-inv); padding: 40px 36px; }
.band .section-sub { color: var(--on-inv-2); }
.band ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 32px; margin-top: 26px; }
.band li { position: relative; padding-left: 20px; }
.band li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--on-inv); }
.band li span { display: block; font-size: 14px; color: var(--on-inv-2); }
.band .more { margin-top: 28px; font-size: 15px; }

.price { display: grid; grid-template-columns: auto 1fr; gap: 6px 28px; align-items: baseline; }
.price .big { font-size: 44px; line-height: 1; grid-row: span 2; }

/* ───────── example receipt ───────── */
.receipt { justify-self: center; width: min(100%, 360px); transform: rotate(-2deg); filter: drop-shadow(0 16px 26px var(--paper-shadow)); }
.paper {
  --z: 14px;
  background: var(--paper); color: var(--paper-ink);
  padding: 24px 22px 36px; font-size: 14px; line-height: 1.4;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--z) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--z) 100%;
}
.paper ul { list-style: none; }
.r-head { text-align: center; font-size: 17px; padding-top: 2px; }
.sep { border: 0; border-top: 1px dashed var(--rule); margin: 14px 0; }
.r-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 72px; grid-template-areas: "raw raw raw" "name who amt"; align-items: center; column-gap: 10px; padding: 5px 0; }
.r-raw { grid-area: raw; font-family: var(--mono); font-size: 11px; letter-spacing: .04em; color: var(--ink-3); }
.r-name { grid-area: name; }
.r-who { grid-area: who; display: flex; gap: 3px; }
.r-who i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.r-amt { text-align: right; font-size: 15px; }
.r-line .r-amt { grid-area: amt; }
.r-total { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label big" "check big"; align-items: end; }
.r-total > span:first-child { grid-area: label; font-weight: 600; }
.r-check { grid-area: check; font-size: 12px; color: var(--ok); }
.r-check::before { content: "✓ "; }
.r-big { grid-area: big; font-size: 30px; }
.r-share { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 72px; align-items: center; gap: 10px; padding: 4px 0; }
.av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: var(--paper); font-size: 12px; font-weight: 600; }
.pill { height: 22px; padding: 0 9px; border-radius: 11px; display: inline-flex; align-items: center; font-size: 11.5px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill.paid { background: var(--paper-ink); color: var(--paper); }
.pill.confirmed::before { content: "✓ "; white-space: pre; color: var(--ok); }
.pill.waiting { background: var(--accent-tint); color: var(--accent); }
.tone-me { --c: var(--p-me); } .tone-fog { --c: var(--p-fog); } .tone-sage { --c: var(--p-sage); }
.tone-oat { --c: var(--p-oat); } .tone-rose { --c: var(--p-rose); } .tone-lilac { --c: var(--p-lilac); }

/* ───────── documents ───────── */
.doc { padding-top: 36px; }
.doc h1 { font-size: clamp(30px, 4.2vw, 42px); line-height: 1.15; font-weight: 600; letter-spacing: -.02em; }
.updated { margin-top: 8px; font-size: 14px; color: var(--ink-3); }
.notice { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.notice.draft { background: var(--warn-tint); color: var(--ink); position: relative; padding-left: 34px; }
.notice.draft::before { content: ""; position: absolute; left: 16px; top: 1.1em; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

.toc { margin-top: 28px; padding: 18px 22px 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }
.toc p { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.toc ol { margin-top: 8px; padding-left: 1.6em; columns: 2; column-gap: 32px; }
.toc li { margin: 3px 0; break-inside: avoid; color: var(--ink-3); }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

.prose { margin-top: 12px; }
.prose > :first-child { margin-top: 28px; }
.prose h2 { margin: 44px 0 12px; padding-top: 24px; border-top: 1px dashed var(--rule); font-size: 20px; line-height: 1.35; font-weight: 600; scroll-margin-top: 88px; }
.prose h3 { margin: 26px 0 8px; font-size: 16.5px; font-weight: 600; }
.prose p, .prose ul, .prose ol, .prose .table { margin-bottom: 14px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 600; }
.prose .table { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); }
.prose th { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.prose .callout { padding: 16px 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); }
.prose .path { font-weight: 600; white-space: nowrap; }

/* ───────── guides ───────── */
.crumbs { font-size: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a::after { content: " ›"; color: var(--ink-3); }
.guide h1 { margin-top: 10px; }
.doc .lede { margin-top: 14px; font-size: 18px; color: var(--ink-2); }
.guide-group { margin-top: 40px; }
.group-title { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
:root:lang(zh) .group-title, :root:lang(ja) .group-title { letter-spacing: .02em; }
.guide-cards { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.guide-cards a {
  display: grid; grid-template-columns: 40px 1fr; column-gap: 14px; row-gap: 4px;
  padding: 18px 20px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); transition: transform .2s var(--ease);
}
.guide-cards a:hover { transform: translateY(-1px); }
.guide-cards .num { grid-row: span 2; font-size: 16px; color: var(--ink-3); padding-top: 3px; }
.g-title { font-weight: 600; font-size: 17px; line-height: 1.35; }
.g-desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.more { margin-top: 56px; padding-top: 28px; border-top: 1px dashed var(--rule); }
.more-title { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.more-all { margin-top: 16px; font-size: 15px; }
.get { margin-top: 40px; padding: 26px 24px; border-radius: var(--r-lg); background: var(--inv); color: var(--on-inv); }
.get-title { font-size: 20px; font-weight: 600; }
.get .stores { margin-top: 16px; }
.get .store.soon { background: color-mix(in srgb, var(--on-inv) 10%, transparent); color: var(--on-inv); box-shadow: none; }
.get .store-note { color: var(--on-inv-2); }

.lost { text-align: center; padding-top: 64px; }
.lost-code { font-size: 72px; color: var(--ink-3); }
.lost-list { list-style: none; margin-top: 28px; display: grid; gap: 8px; }
.lost-list a { margin-left: 8px; color: var(--ink-2); }

/* ───────── phones ───────── */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 48px; padding-top: 28px; }
  .receipt { transform: rotate(-1.5deg); }
  .section { padding-top: 64px; }
  .band { padding: 30px 22px; }
  .band ul { grid-template-columns: minmax(0, 1fr); }
  .toc ol { columns: 1; }
  .price { grid-template-columns: minmax(0, 1fr); }
  .price .big { grid-row: auto; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .top-in { flex-wrap: wrap; }
  .lang a { padding: 5px 10px; }
  .lede { font-size: 17px; }
  .paper { padding: 22px 16px 34px; }
}
